@syncular/console 0.0.6-85 → 0.0.6-86

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.
@@ -1,26 +1,26 @@
1
- function jM(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 l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).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__,ct=globalThis,Ji="10.40.0";function ha(){return Jh(ct),ct}function Jh(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ji,t[Ji]=t[Ji]||{}}function Fc(e,t,n=ct){const s=n.__SENTRY__=n.__SENTRY__||{},i=s[Ji]=s[Ji]||{};return i[e]||(i[e]=t())}const AM=["debug","info","warn","error","log","assert","trace"],kM="Sentry Logger ",hh={};function pa(e){if(!("console"in ct))return e();const t=ct.console,n={},s=Object.keys(hh);s.forEach(i=>{const a=hh[i];n[i]=t[i],t[i]=a});try{return e()}finally{s.forEach(i=>{t[i]=n[i]})}}function OM(){Hv().enabled=!0}function MM(){Hv().enabled=!1}function QC(){return Hv().enabled}function IM(...e){Fv("log",...e)}function PM(...e){Fv("warn",...e)}function DM(...e){Fv("error",...e)}function Fv(e,...t){Ce&&QC()&&pa(()=>{ct.console[e](`${kM}[${e}]:`,...t)})}function Hv(){return Ce?Fc("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const be={enable:OM,disable:MM,isEnabled:QC,log:IM,warn:PM,error:DM},WC=50,oa="?",cw=/\(error: (.*)\)/,lw=/captureMessage|captureException/;function JC(...e){const t=e.sort((n,s)=>n[0]-s[0]).map(n=>n[1]);return(n,s=0,i=0)=>{const a=[],l=n.split(`
2
- `);for(let f=s;f<l.length;f++){let d=l[f];d.length>1024&&(d=d.slice(0,1024));const p=cw.test(d)?d.replace(cw,"$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>=WC+i)break}}return LM(a.slice(i))}}function zM(e){return Array.isArray(e)?JC(...e):e}function LM(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Sd(t).function||"")&&t.pop(),t.reverse(),lw.test(Sd(t).function||"")&&(t.pop(),lw.test(Sd(t).function||"")&&t.pop()),t.slice(0,WC).map(n=>({...n,filename:n.filename||Sd(t).filename,function:n.function||oa}))}function Sd(e){return e[e.length-1]||{}}const $g="<anonymous>";function Xs(e){try{return!e||typeof e!="function"?$g:e.name||$g}catch{return $g}}function uw(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 eR(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const Zd={},fw={};function ci(e,t){Zd[e]=Zd[e]||[],Zd[e].push(t)}function li(e,t){if(!fw[e]){fw[e]=!0;try{t()}catch(n){Ce&&be.error(`Error while instrumenting ${e}`,n)}}}function Hr(e,t){const n=e&&Zd[e];if(n)for(const s of n)try{s(t)}catch(i){Ce&&be.error(`Error while triggering instrumentation handler.
1
+ function MM(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 l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).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__,ct=globalThis,Wi="10.40.0";function da(){return ep(ct),ct}function ep(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Wi,t[Wi]=t[Wi]||{}}function Fc(e,t,n=ct){const s=n.__SENTRY__=n.__SENTRY__||{},i=s[Wi]=s[Wi]||{};return i[e]||(i[e]=t())}const IM=["debug","info","warn","error","log","assert","trace"],PM="Sentry Logger ",ph={};function ha(e){if(!("console"in ct))return e();const t=ct.console,n={},s=Object.keys(ph);s.forEach(i=>{const a=ph[i];n[i]=t[i],t[i]=a});try{return e()}finally{s.forEach(i=>{t[i]=n[i]})}}function DM(){Vv().enabled=!0}function zM(){Vv().enabled=!1}function eR(){return Vv().enabled}function LM(...e){qv("log",...e)}function UM(...e){qv("warn",...e)}function $M(...e){qv("error",...e)}function qv(e,...t){Ce&&eR()&&ha(()=>{ct.console[e](`${PM}[${e}]:`,...t)})}function Vv(){return Ce?Fc("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const be={enable:DM,disable:zM,isEnabled:eR,log:LM,warn:UM,error:$M},tR=50,sa="?",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=[],l=n.split(`
2
+ `);for(let f=s;f<l.length;f++){let d=l[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 FM(a.slice(i))}}function BM(e){return Array.isArray(e)?nR(...e):e}function FM(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(_d(t).function||"")&&t.pop(),t.reverse(),fw.test(_d(t).function||"")&&(t.pop(),fw.test(_d(t).function||"")&&t.pop()),t.slice(0,tR).map(n=>({...n,filename:n.filename||_d(t).filename,function:n.function||sa}))}function _d(e){return e[e.length-1]||{}}const Bg="<anonymous>";function Xs(e){try{return!e||typeof e!="function"?Bg:e.name||Bg}catch{return Bg}}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 Yd={},hw={};function ci(e,t){Yd[e]=Yd[e]||[],Yd[e].push(t)}function li(e,t){if(!hw[e]){hw[e]=!0;try{t()}catch(n){Ce&&be.error(`Error while instrumenting ${e}`,n)}}}function Hr(e,t){const n=e&&Yd[e];if(n)for(const s of n)try{s(t)}catch(i){Ce&&be.error(`Error while triggering instrumentation handler.
3
3
  Type: ${e}
4
4
  Name: ${Xs(s)}
5
- Error:`,i)}}let Bg=null;function tR(e){const t="error";ci(t,e),li(t,UM)}function UM(){Bg=ct.onerror,ct.onerror=function(e,t,n,s,i){return Hr("error",{column:s,error:i,line:n,msg:e,url:t}),Bg?Bg.apply(this,arguments):!1},ct.onerror.__SENTRY_INSTRUMENTED__=!0}let Fg=null;function nR(e){const t="unhandledrejection";ci(t,e),li(t,$M)}function $M(){Fg=ct.onunhandledrejection,ct.onunhandledrejection=function(e){return Hr("unhandledrejection",e),Fg?Fg.apply(this,arguments):!0},ct.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const rR=Object.prototype.toString;function ep(e){switch(rR.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Qs(e,Error)}}function Hc(e,t){return rR.call(e)===`[object ${t}]`}function sR(e){return Hc(e,"ErrorEvent")}function dw(e){return Hc(e,"DOMError")}function BM(e){return Hc(e,"DOMException")}function Gs(e){return Hc(e,"String")}function tp(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Cc(e){return e===null||tp(e)||typeof e!="object"&&typeof e!="function"}function yu(e){return Hc(e,"Object")}function np(e){return typeof Event<"u"&&Qs(e,Event)}function FM(e){return typeof Element<"u"&&Qs(e,Element)}function HM(e){return Hc(e,"RegExp")}function qc(e){return!!(e?.then&&typeof e.then=="function")}function qM(e){return yu(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Qs(e,t){try{return e instanceof t}catch{return!1}}function oR(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function qv(e){return typeof Request<"u"&&Qs(e,Request)}const Vv=ct,VM=80;function Vr(e,t={}){if(!e)return"<unknown>";try{let n=e;const s=5,i=[];let a=0,l=0;const f=" > ",d=f.length;let p;const g=Array.isArray(t)?t:t.keyAttrs,y=!Array.isArray(t)&&t.maxStringLength||VM;for(;n&&a++<s&&(p=KM(n,g),!(p==="html"||a>1&&l+i.length*d+p.length>=y));)i.push(p),l+=p.length,n=n.parentNode;return i.reverse().join(f)}catch{return"<unknown>"}}function KM(e,t){const n=e,s=[];if(!n?.tagName)return"";if(Vv.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(l=>n.getAttribute(l)).map(l=>[l,n.getAttribute(l)]):null;if(i?.length)i.forEach(l=>{s.push(`[${l[0]}="${l[1]}"]`)});else{n.id&&s.push(`#${n.id}`);const l=n.className;if(l&&Gs(l)){const f=l.split(/\s+/);for(const d of f)s.push(`.${d}`)}}const a=["aria-label","type","name","title","alt"];for(const l of a){const f=n.getAttribute(l);f&&s.push(`[${l}="${f}"]`)}return s.join("")}function ku(){try{return Vv.document.location.href}catch{return""}}function iR(e){if(!Vv.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 gr(e,t,n){if(!(t in e))return;const s=e[t];if(typeof s!="function")return;const i=n(s);typeof i=="function"&&aR(i,s);try{e[t]=i}catch{Ce&&be.log(`Failed to replace method "${t}" in object`,e)}}function Yn(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 aR(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Yn(e,"__sentry_original__",t)}catch{}}function Kv(e){return e.__sentry_original__}function cR(e){if(ep(e))return{message:e.message,name:e.name,stack:e.stack,...pw(e)};if(np(e)){const t={type:e.type,target:hw(e.target),currentTarget:hw(e.currentTarget),...pw(e)};return typeof CustomEvent<"u"&&Qs(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function hw(e){try{return FM(e)?Vr(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function pw(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 GM(e){const t=Object.keys(cR(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let ac;function Ou(e){if(ac!==void 0)return ac?ac(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=ct;return t in n&&typeof n[t]=="function"?(ac=n[t],ac(e)):(ac=null,e())}function Vo(){return Ou(()=>Math.random())}function Mu(){return Ou(()=>Date.now())}function Vy(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function mw(e,t){if(!Array.isArray(e))return"";const n=[];for(let s=0;s<e.length;s++){const i=e[s];try{oR(i)?n.push(eR(i)):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Yd(e,t,n=!1){return Gs(e)?HM(t)?t.test(e):Gs(t)?n?e===t:e.includes(t):!1:!1}function Ko(e,t=[],n=!1){return t.some(s=>Yd(e,s,n))}function ZM(){const e=ct;return e.crypto||e.msCrypto}let Hg;function YM(){return Vo()*16}function qr(e=ZM()){try{if(e?.randomUUID)return Ou(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Hg||(Hg="10000000100040008000"+1e11),Hg.replace(/[018]/g,t=>(t^(YM()&15)>>t/4).toString(16))}function lR(e){return e.exception?.values?.[0]}function Gi(e){const{message:t,event_id:n}=e;if(t)return t;const s=lR(e);return s?s.type&&s.value?`${s.type}: ${s.value}`:s.type||s.value||n||"<unknown>":n||"<unknown>"}function Ky(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 Rc(e,t){const n=lR(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 gw(e){if(XM(e))return!0;try{Yn(e,"__sentry_captured__",!0)}catch{}return!1}function XM(e){try{return e.__sentry_captured__}catch{}}const uR=1e3;function ma(){return Mu()/uR}function QM(){const{performance:e}=ct;if(!e?.now||!e.timeOrigin)return ma;const t=e.timeOrigin;return()=>(t+Ou(()=>e.now()))/uR}let yw;function cn(){return(yw??(yw=QM()))()}let qg=null;function WM(){const{performance:e}=ct;if(!e?.now)return;const t=3e5,n=Ou(()=>e.now()),s=Mu(),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 Sr(){return qg===null&&(qg=WM()),qg}function JM(e){const t=cn(),n={sid:qr(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>tI(n)};return e&&Nc(n,e),n}function Nc(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||cn(),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:qr()),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 eI(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Nc(e,n)}function tI(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 Iu(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]=Iu(s[i],t[i],n-1));return s}function Ws(){return qr()}function Zs(){return qr().substring(16)}const Gy="_sentrySpan";function jc(e,t){t?Yn(e,Gy,t):delete e[Gy]}function Ac(e){return e[Gy]}const nI=100;class Js{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:Ws(),sampleRand:Vo()}}clone(){const t=new Js;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,jc(t,Ac(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&&Nc(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 Js?n.getScopeData():yu(n)?t:void 0,{tags:i,attributes:a,extra:l,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,...l},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,jc(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ws(),sampleRand:Vo()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const s=typeof n=="number"?n:nI;if(s<=0)return this;const i={timestamp:ma(),...t,message:t.message?Vy(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:Ac(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Iu(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const s=n?.event_id||qr();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||qr();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||qr();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 rI(){return Fc("defaultCurrentScope",()=>new Js)}function sI(){return Fc("defaultIsolationScope",()=>new Js)}class oI{constructor(t,n){let s;t?s=t:s=new Js;let i;n?i=n:i=new Js,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 qc(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 kc(){const e=ha(),t=Jh(e);return t.stack=t.stack||new oI(rI(),sI())}function iI(e){return kc().withScope(e)}function aI(e,t){const n=kc();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function vw(e){return kc().withScope(()=>e(kc().getIsolationScope()))}function cI(){return{withIsolationScope:vw,withScope:iI,withSetScope:aI,withSetIsolationScope:(e,t)=>vw(t),getCurrentScope:()=>kc().getScope(),getIsolationScope:()=>kc().getIsolationScope()}}function Vc(e){const t=Jh(e);return t.acs?t.acs:cI()}function bt(){const e=ha();return Vc(e).getCurrentScope()}function Zr(){const e=ha();return Vc(e).getIsolationScope()}function lI(){return Fc("globalScope",()=>new Js)}function Pu(...e){const t=ha(),n=Vc(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 fR(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:s,propagationSpanId:i}=t,a={trace_id:n,span_id:i||Zs()};return s&&(a.parent_span_id=s),a}const vs="sentry.source",Gv="sentry.sample_rate",dR="sentry.previous_trace_sample_rate",eo="sentry.op",gn="sentry.origin",vu="sentry.idle_span_finish_reason",Du="sentry.measurement_unit",zu="sentry.measurement_value",bw="sentry.custom_span_name",Zv="sentry.profile_id",Kc="sentry.exclusive_time",uI="sentry.link.type",fI="gen_ai.conversation.id",dI=0,Yv=1,hn=2;function hI(e){if(e<400&&e>=100)return{code:Yv};if(e>=400&&e<500)switch(e){case 401:return{code:hn,message:"unauthenticated"};case 403:return{code:hn,message:"permission_denied"};case 404:return{code:hn,message:"not_found"};case 409:return{code:hn,message:"already_exists"};case 413:return{code:hn,message:"failed_precondition"};case 429:return{code:hn,message:"resource_exhausted"};case 499:return{code:hn,message:"cancelled"};default:return{code:hn,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:hn,message:"unimplemented"};case 503:return{code:hn,message:"unavailable"};case 504:return{code:hn,message:"deadline_exceeded"};default:return{code:hn,message:"internal_error"}}return{code:hn,message:"internal_error"}}function hR(e,t){e.setAttribute("http.response.status_code",t);const n=hI(t);n.message!=="unknown_error"&&e.setStatus(n)}const pR="_sentryScope",mR="_sentryIsolationScope";function pI(e){try{const t=ct.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function mI(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function gI(e,t,n){e&&(Yn(e,mR,pI(n)),Yn(e,pR,t))}function ph(e){const t=e;return{scope:t[pR],isolationScope:mI(t[mR])}}const Xv="sentry-",yI=/^sentry-/,vI=8192;function gR(e){const t=xI(e);if(!t)return;const n=Object.entries(t).reduce((s,[i,a])=>{if(i.match(yI)){const l=i.slice(Xv.length);s[l]=a}return s},{});if(Object.keys(n).length>0)return n}function bI(e){if(!e)return;const t=Object.entries(e).reduce((n,[s,i])=>(i&&(n[`${Xv}${s}`]=i),n),{});return SI(t)}function xI(e){if(!(!e||!Gs(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const s=xw(n);return Object.entries(s).forEach(([i,a])=>{t[i]=a}),t},{}):xw(e)}function xw(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 SI(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,s],i)=>{const a=`${encodeURIComponent(n)}=${encodeURIComponent(s)}`,l=i===0?a:`${t},${a}`;return l.length>vI?(Ce&&be.warn(`Not adding key: ${n} with val: ${s} to baggage header due to exceeding baggage size limits.`),t):l},"")}const _I=/^o(\d+)\./,wI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function EI(e){return e==="http"||e==="https"}function Gc(e,t=!1){const{host:n,path:s,pass:i,port:a,projectId:l,protocol:f,publicKey:d}=e;return`${f}://${d}${t&&i?`:${i}`:""}@${n}${a?`:${a}`:""}/${s&&`${s}/`}${l}`}function TI(e){const t=wI.exec(e);if(!t){pa(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,s,i="",a="",l="",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 yR({host:a,pass:i,path:d,projectId:p,port:l,protocol:n,publicKey:s})}function yR(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function CI(e){if(!Ce)return!0;const{port:t,projectId:n,protocol:s}=e;return["protocol","publicKey","host","projectId"].find(l=>e[l]?!1:(be.error(`Invalid Sentry Dsn: ${l} missing`),!0))?!1:n.match(/^\d+$/)?EI(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 RI(e){return e.match(_I)?.[1]}function NI(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let s;return t.orgId?s=String(t.orgId):n&&(s=RI(n)),s}function jI(e){const t=typeof e=="string"?TI(e):yR(e);if(!(!t||!CI(t)))return t}function bu(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 vR=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function AI(e){if(!e)return;const t=e.match(vR);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 kI(e,t){const n=AI(e),s=gR(t);if(!n?.traceId)return{traceId:Ws(),sampleRand:Vo()};const i=OI(n,s);s&&(s.sample_rand=i.toString());const{traceId:a,parentSpanId:l,parentSampled:f}=n;return{traceId:a,parentSpanId:l,sampled:f,dsc:s||{},sampleRand:i}}function bR(e=Ws(),t=Zs(),n){let s="";return n!==void 0&&(s=n?"-1":"-0"),`${e}-${t}${s}`}function xR(e=Ws(),t=Zs(),n){return`00-${e}-${t}-${n?"01":"00"}`}function OI(e,t){const n=bu(t?.sample_rand);if(n!==void 0)return n;const s=bu(t?.sample_rate);return s&&e?.parentSampled!==void 0?e.parentSampled?Vo()*s:s+Vo()*(1-s):Vo()}const SR=0,Qv=1;let Sw=!1;function MI(e){const{spanId:t,traceId:n}=e.spanContext(),{data:s,op:i,parent_span_id:a,status:l,origin:f,links:d}=yt(e);return{parent_span_id:a,span_id:t,trace_id:n,data:s,op:i,status:l,origin:f,links:d}}function _R(e){const{spanId:t,traceId:n,isRemote:s}=e.spanContext(),i=s?t:yt(e).parent_span_id,a=ph(e).scope,l=s?a?.getPropagationContext().propagationSpanId||Zs():t;return{parent_span_id:i,span_id:l,trace_id:n}}function II(e){const{traceId:t,spanId:n}=e.spanContext(),s=ui(e);return bR(t,n,s)}function PI(e){const{traceId:t,spanId:n}=e.spanContext(),s=ui(e);return xR(t,n,s)}function wR(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===Qv,attributes:a,...i}))}function ea(e){return typeof e=="number"?_w(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?_w(e.getTime()):cn()}function _w(e){return e>9999999999?e/1e3:e}function yt(e){if(zI(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(DI(e)){const{attributes:s,startTime:i,name:a,endTime:l,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:ea(i),timestamp:ea(l)||void 0,status:ER(f),op:s[eo],origin:s[gn],links:wR(d)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function DI(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function zI(e){return typeof e.getSpanJSON=="function"}function ui(e){const{traceFlags:t}=e.spanContext();return t===Qv}function ER(e){if(!(!e||e.code===dI))return e.code===Yv?"ok":e.message||"internal_error"}const ta="_sentryChildSpans",Zy="_sentryRootSpan";function TR(e,t){const n=e[Zy]||e;Yn(t,Zy,n),e[ta]?e[ta].add(t):Yn(e,ta,new Set([t]))}function LI(e,t){e[ta]&&e[ta].delete(t)}function Xd(e){const t=new Set;function n(s){if(!t.has(s)&&ui(s)){t.add(s);const i=s[ta]?Array.from(s[ta]):[];for(const a of i)n(a)}}return n(e),Array.from(t)}function Dn(e){return e[Zy]||e}function Xn(){const e=ha(),t=Vc(e);return t.getActiveSpan?t.getActiveSpan():Ac(bt())}function Yy(){Sw||(pa(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Sw=!0)}let ww=!1;function UI(){if(ww)return;function e(){const t=Xn(),n=t&&Dn(t);if(n){const s="internal_error";Ce&&be.log(`[Tracing] Root span: ${s} -> Global error occurred`),n.setStatus({code:hn,message:s})}}e.tag="sentry_tracingErrorCallback",ww=!0,tR(e),nR(e)}function ss(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||vt()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Ew(e){be.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function mh(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(BI(n)){if(Yd(e.description,n))return Ce&&Ew(e),!0;continue}if(!n.name&&!n.op)continue;const s=n.name?Yd(e.description,n.name):!0,i=n.op?e.op&&Yd(e.op,n.op):!0;if(s&&i)return Ce&&Ew(e),!0}return!1}function $I(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 BI(e){return typeof e=="string"||e instanceof RegExp}const Wv="production",CR="_frozenDsc";function Qd(e,t){Yn(e,CR,t)}function RR(e,t){const n=t.getOptions(),{publicKey:s}=t.getDsn()||{},i={environment:n.environment||Wv,release:n.release,public_key:s,trace_id:e,org_id:NI(t)};return t.emit("createDsc",i),i}function Jv(e,t){const n=t.getPropagationContext();return n.dsc||RR(n.traceId,e)}function to(e){const t=vt();if(!t)return{};const n=Dn(e),s=yt(n),i=s.data,a=n.spanContext().traceState,l=a?.get("sentry.sample_rate")??i[Gv]??i[dR];function f(S){return(typeof l=="number"||typeof l=="string")&&(S.sample_rate=`${l}`),S}const d=n[CR];if(d)return f(d);const p=a?.get("sentry.dsc"),g=p&&gR(p);if(g)return f(g);const y=RR(e.spanContext().traceId,t),b=i[vs],x=s.description;return b!=="url"&&x&&(y.transaction=x),ss()&&(y.sampled=String(ui(n)),y.sample_rand=a?.get("sentry.sample_rand")??ph(n).scope?.getPropagationContext().sampleRand.toString()),f(y),t.emit("createDsc",y,n),y}class ei{constructor(t={}){this._traceId=t.traceId||Ws(),this._spanId=t.spanId||Zs()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:SR}}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 Vs(e,t=100,n=1/0){try{return Xy("",e,t,n)}catch(s){return{ERROR:`**non-serializable** (${s})`}}}function NR(e,t=3,n=100*1024){const s=Vs(e,t);return VI(s)>n?NR(e,t-1,n):s}function Xy(e,t,n=1/0,s=1/0,i=KI()){const[a,l]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const f=FI(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 Xy("",x,d-1,s,i)}catch{}const g=Array.isArray(t)?[]:{};let y=0;const b=cR(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]=Xy(x,S,d-1,s,i),y++}return l(t),g}function FI(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(oR(t))return eR(t);if(qM(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Xs(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=HI(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function HI(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function qI(e){return~-encodeURI(e).split(/%..|./).length}function VI(e){return qI(JSON.stringify(e))}function KI(){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 ga(e,t=[]){return[e,t]}function GI(e,t){const[n,s]=e;return[n,[...s,t]]}function Qy(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 ZI(e,t){return Qy(e,(n,s)=>t.includes(s))}function Wy(e){const t=Jh(ct);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function YI(e){const[t,n]=e;let s=JSON.stringify(t);function i(a){typeof s=="string"?s=typeof a=="string"?s+a:[Wy(s),a]:s.push(typeof a=="string"?Wy(a):a)}for(const a of n){const[l,f]=a;if(i(`
5
+ Error:`,i)}}let Fg=null;function sR(e){const t="error";ci(t,e),li(t,HM)}function HM(){Fg=ct.onerror,ct.onerror=function(e,t,n,s,i){return Hr("error",{column:s,error:i,line:n,msg:e,url:t}),Fg?Fg.apply(this,arguments):!1},ct.onerror.__SENTRY_INSTRUMENTED__=!0}let Hg=null;function oR(e){const t="unhandledrejection";ci(t,e),li(t,qM)}function qM(){Hg=ct.onunhandledrejection,ct.onunhandledrejection=function(e){return Hr("unhandledrejection",e),Hg?Hg.apply(this,arguments):!0},ct.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const iR=Object.prototype.toString;function tp(e){switch(iR.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Qs(e,Error)}}function Hc(e,t){return iR.call(e)===`[object ${t}]`}function aR(e){return Hc(e,"ErrorEvent")}function pw(e){return Hc(e,"DOMError")}function VM(e){return Hc(e,"DOMException")}function Gs(e){return Hc(e,"String")}function np(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Cc(e){return e===null||np(e)||typeof e!="object"&&typeof e!="function"}function yu(e){return Hc(e,"Object")}function rp(e){return typeof Event<"u"&&Qs(e,Event)}function KM(e){return typeof Element<"u"&&Qs(e,Element)}function GM(e){return Hc(e,"RegExp")}function qc(e){return!!(e?.then&&typeof e.then=="function")}function ZM(e){return yu(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Qs(e,t){try{return e instanceof t}catch{return!1}}function cR(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function Kv(e){return typeof Request<"u"&&Qs(e,Request)}const Gv=ct,YM=80;function Vr(e,t={}){if(!e)return"<unknown>";try{let n=e;const s=5,i=[];let a=0,l=0;const f=" > ",d=f.length;let p;const g=Array.isArray(t)?t:t.keyAttrs,y=!Array.isArray(t)&&t.maxStringLength||YM;for(;n&&a++<s&&(p=XM(n,g),!(p==="html"||a>1&&l+i.length*d+p.length>=y));)i.push(p),l+=p.length,n=n.parentNode;return i.reverse().join(f)}catch{return"<unknown>"}}function XM(e,t){const n=e,s=[];if(!n?.tagName)return"";if(Gv.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(l=>n.getAttribute(l)).map(l=>[l,n.getAttribute(l)]):null;if(i?.length)i.forEach(l=>{s.push(`[${l[0]}="${l[1]}"]`)});else{n.id&&s.push(`#${n.id}`);const l=n.className;if(l&&Gs(l)){const f=l.split(/\s+/);for(const d of f)s.push(`.${d}`)}}const a=["aria-label","type","name","title","alt"];for(const l of a){const f=n.getAttribute(l);f&&s.push(`[${l}="${f}"]`)}return s.join("")}function Ou(){try{return Gv.document.location.href}catch{return""}}function lR(e){if(!Gv.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 gr(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 Yn(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,Yn(e,"__sentry_original__",t)}catch{}}function Zv(e){return e.__sentry_original__}function fR(e){if(tp(e))return{message:e.message,name:e.name,stack:e.stack,...gw(e)};if(rp(e)){const t={type:e.type,target:mw(e.target),currentTarget:mw(e.currentTarget),...gw(e)};return typeof CustomEvent<"u"&&Qs(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function mw(e){try{return KM(e)?Vr(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 QM(e){const t=Object.keys(fR(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let ac;function Mu(e){if(ac!==void 0)return ac?ac(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=ct;return t in n&&typeof n[t]=="function"?(ac=n[t],ac(e)):(ac=null,e())}function Vo(){return Mu(()=>Math.random())}function Iu(){return Mu(()=>Date.now())}function Ky(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{cR(i)?n.push(rR(i)):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Xd(e,t,n=!1){return Gs(e)?GM(t)?t.test(e):Gs(t)?n?e===t:e.includes(t):!1:!1}function Ko(e,t=[],n=!1){return t.some(s=>Xd(e,s,n))}function WM(){const e=ct;return e.crypto||e.msCrypto}let qg;function JM(){return Vo()*16}function qr(e=WM()){try{if(e?.randomUUID)return Mu(()=>e.randomUUID()).replace(/-/g,"")}catch{}return qg||(qg="10000000100040008000"+1e11),qg.replace(/[018]/g,t=>(t^(JM()&15)>>t/4).toString(16))}function dR(e){return e.exception?.values?.[0]}function Ki(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 Gy(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 Rc(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(eI(e))return!0;try{Yn(e,"__sentry_captured__",!0)}catch{}return!1}function eI(e){try{return e.__sentry_captured__}catch{}}const hR=1e3;function pa(){return Iu()/hR}function tI(){const{performance:e}=ct;if(!e?.now||!e.timeOrigin)return pa;const t=e.timeOrigin;return()=>(t+Mu(()=>e.now()))/hR}let bw;function cn(){return(bw??(bw=tI()))()}let Vg=null;function nI(){const{performance:e}=ct;if(!e?.now)return;const t=3e5,n=Mu(()=>e.now()),s=Iu(),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 Sr(){return Vg===null&&(Vg=nI()),Vg}function rI(e){const t=cn(),n={sid:qr(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>oI(n)};return e&&Nc(n,e),n}function Nc(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||cn(),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:qr()),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 sI(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Nc(e,n)}function oI(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 Pu(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]=Pu(s[i],t[i],n-1));return s}function Ws(){return qr()}function Zs(){return qr().substring(16)}const Zy="_sentrySpan";function jc(e,t){t?Yn(e,Zy,t):delete e[Zy]}function Ac(e){return e[Zy]}const iI=100;class Js{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:Ws(),sampleRand:Vo()}}clone(){const t=new Js;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,jc(t,Ac(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&&Nc(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 Js?n.getScopeData():yu(n)?t:void 0,{tags:i,attributes:a,extra:l,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,...l},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,jc(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ws(),sampleRand:Vo()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const s=typeof n=="number"?n:iI;if(s<=0)return this;const i={timestamp:pa(),...t,message:t.message?Ky(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:Ac(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Pu(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const s=n?.event_id||qr();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||qr();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||qr();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 aI(){return Fc("defaultCurrentScope",()=>new Js)}function cI(){return Fc("defaultIsolationScope",()=>new Js)}class lI{constructor(t,n){let s;t?s=t:s=new Js;let i;n?i=n:i=new Js,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 qc(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 kc(){const e=da(),t=ep(e);return t.stack=t.stack||new lI(aI(),cI())}function uI(e){return kc().withScope(e)}function fI(e,t){const n=kc();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function xw(e){return kc().withScope(()=>e(kc().getIsolationScope()))}function dI(){return{withIsolationScope:xw,withScope:uI,withSetScope:fI,withSetIsolationScope:(e,t)=>xw(t),getCurrentScope:()=>kc().getScope(),getIsolationScope:()=>kc().getIsolationScope()}}function Vc(e){const t=ep(e);return t.acs?t.acs:dI()}function bt(){const e=da();return Vc(e).getCurrentScope()}function Zr(){const e=da();return Vc(e).getIsolationScope()}function hI(){return Fc("globalScope",()=>new Js)}function Du(...e){const t=da(),n=Vc(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||Zs()};return s&&(a.parent_span_id=s),a}const vs="sentry.source",Yv="sentry.sample_rate",mR="sentry.previous_trace_sample_rate",eo="sentry.op",gn="sentry.origin",vu="sentry.idle_span_finish_reason",zu="sentry.measurement_unit",Lu="sentry.measurement_value",Sw="sentry.custom_span_name",Xv="sentry.profile_id",Kc="sentry.exclusive_time",pI="sentry.link.type",mI="gen_ai.conversation.id",gI=0,Qv=1,hn=2;function yI(e){if(e<400&&e>=100)return{code:Qv};if(e>=400&&e<500)switch(e){case 401:return{code:hn,message:"unauthenticated"};case 403:return{code:hn,message:"permission_denied"};case 404:return{code:hn,message:"not_found"};case 409:return{code:hn,message:"already_exists"};case 413:return{code:hn,message:"failed_precondition"};case 429:return{code:hn,message:"resource_exhausted"};case 499:return{code:hn,message:"cancelled"};default:return{code:hn,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:hn,message:"unimplemented"};case 503:return{code:hn,message:"unavailable"};case 504:return{code:hn,message:"deadline_exceeded"};default:return{code:hn,message:"internal_error"}}return{code:hn,message:"internal_error"}}function gR(e,t){e.setAttribute("http.response.status_code",t);const n=yI(t);n.message!=="unknown_error"&&e.setStatus(n)}const yR="_sentryScope",vR="_sentryIsolationScope";function vI(e){try{const t=ct.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function bI(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function xI(e,t,n){e&&(Yn(e,vR,vI(n)),Yn(e,yR,t))}function mh(e){const t=e;return{scope:t[yR],isolationScope:bI(t[vR])}}const Wv="sentry-",SI=/^sentry-/,_I=8192;function bR(e){const t=EI(e);if(!t)return;const n=Object.entries(t).reduce((s,[i,a])=>{if(i.match(SI)){const l=i.slice(Wv.length);s[l]=a}return s},{});if(Object.keys(n).length>0)return n}function wI(e){if(!e)return;const t=Object.entries(e).reduce((n,[s,i])=>(i&&(n[`${Wv}${s}`]=i),n),{});return TI(t)}function EI(e){if(!(!e||!Gs(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 TI(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,s],i)=>{const a=`${encodeURIComponent(n)}=${encodeURIComponent(s)}`,l=i===0?a:`${t},${a}`;return l.length>_I?(Ce&&be.warn(`Not adding key: ${n} with val: ${s} to baggage header due to exceeding baggage size limits.`),t):l},"")}const CI=/^o(\d+)\./,RI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function NI(e){return e==="http"||e==="https"}function Gc(e,t=!1){const{host:n,path:s,pass:i,port:a,projectId:l,protocol:f,publicKey:d}=e;return`${f}://${d}${t&&i?`:${i}`:""}@${n}${a?`:${a}`:""}/${s&&`${s}/`}${l}`}function jI(e){const t=RI.exec(e);if(!t){ha(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,s,i="",a="",l="",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:l,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 AI(e){if(!Ce)return!0;const{port:t,projectId:n,protocol:s}=e;return["protocol","publicKey","host","projectId"].find(l=>e[l]?!1:(be.error(`Invalid Sentry Dsn: ${l} missing`),!0))?!1:n.match(/^\d+$/)?NI(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 kI(e){return e.match(CI)?.[1]}function OI(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let s;return t.orgId?s=String(t.orgId):n&&(s=kI(n)),s}function MI(e){const t=typeof e=="string"?jI(e):xR(e);if(!(!t||!AI(t)))return t}function bu(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 II(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 PI(e,t){const n=II(e),s=bR(t);if(!n?.traceId)return{traceId:Ws(),sampleRand:Vo()};const i=DI(n,s);s&&(s.sample_rand=i.toString());const{traceId:a,parentSpanId:l,parentSampled:f}=n;return{traceId:a,parentSpanId:l,sampled:f,dsc:s||{},sampleRand:i}}function _R(e=Ws(),t=Zs(),n){let s="";return n!==void 0&&(s=n?"-1":"-0"),`${e}-${t}${s}`}function wR(e=Ws(),t=Zs(),n){return`00-${e}-${t}-${n?"01":"00"}`}function DI(e,t){const n=bu(t?.sample_rand);if(n!==void 0)return n;const s=bu(t?.sample_rate);return s&&e?.parentSampled!==void 0?e.parentSampled?Vo()*s:s+Vo()*(1-s):Vo()}const ER=0,Jv=1;let ww=!1;function zI(e){const{spanId:t,traceId:n}=e.spanContext(),{data:s,op:i,parent_span_id:a,status:l,origin:f,links:d}=yt(e);return{parent_span_id:a,span_id:t,trace_id:n,data:s,op:i,status:l,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=mh(e).scope,l=s?a?.getPropagationContext().propagationSpanId||Zs():t;return{parent_span_id:i,span_id:l,trace_id:n}}function LI(e){const{traceId:t,spanId:n}=e.spanContext(),s=ui(e);return _R(t,n,s)}function UI(e){const{traceId:t,spanId:n}=e.spanContext(),s=ui(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===Jv,attributes:a,...i}))}function Ji(e){return typeof e=="number"?Ew(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Ew(e.getTime()):cn()}function Ew(e){return e>9999999999?e/1e3:e}function yt(e){if(BI(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if($I(e)){const{attributes:s,startTime:i,name:a,endTime:l,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:Ji(i),timestamp:Ji(l)||void 0,status:RR(f),op:s[eo],origin:s[gn],links:CR(d)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function $I(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function BI(e){return typeof e.getSpanJSON=="function"}function ui(e){const{traceFlags:t}=e.spanContext();return t===Jv}function RR(e){if(!(!e||e.code===gI))return e.code===Qv?"ok":e.message||"internal_error"}const ea="_sentryChildSpans",Yy="_sentryRootSpan";function NR(e,t){const n=e[Yy]||e;Yn(t,Yy,n),e[ea]?e[ea].add(t):Yn(e,ea,new Set([t]))}function FI(e,t){e[ea]&&e[ea].delete(t)}function Qd(e){const t=new Set;function n(s){if(!t.has(s)&&ui(s)){t.add(s);const i=s[ea]?Array.from(s[ea]):[];for(const a of i)n(a)}}return n(e),Array.from(t)}function Dn(e){return e[Yy]||e}function Xn(){const e=da(),t=Vc(e);return t.getActiveSpan?t.getActiveSpan():Ac(bt())}function Xy(){ww||(ha(()=>{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 HI(){if(Tw)return;function e(){const t=Xn(),n=t&&Dn(t);if(n){const s="internal_error";Ce&&be.log(`[Tracing] Root span: ${s} -> Global error occurred`),n.setStatus({code:hn,message:s})}}e.tag="sentry_tracingErrorCallback",Tw=!0,sR(e),oR(e)}function ss(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 gh(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(VI(n)){if(Xd(e.description,n))return Ce&&Cw(e),!0;continue}if(!n.name&&!n.op)continue;const s=n.name?Xd(e.description,n.name):!0,i=n.op?e.op&&Xd(e.op,n.op):!0;if(s&&i)return Ce&&Cw(e),!0}return!1}function qI(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 VI(e){return typeof e=="string"||e instanceof RegExp}const eb="production",jR="_frozenDsc";function Wd(e,t){Yn(e,jR,t)}function AR(e,t){const n=t.getOptions(),{publicKey:s}=t.getDsn()||{},i={environment:n.environment||eb,release:n.release,public_key:s,trace_id:e,org_id:OI(t)};return t.emit("createDsc",i),i}function tb(e,t){const n=t.getPropagationContext();return n.dsc||AR(n.traceId,e)}function to(e){const t=vt();if(!t)return{};const n=Dn(e),s=yt(n),i=s.data,a=n.spanContext().traceState,l=a?.get("sentry.sample_rate")??i[Yv]??i[mR];function f(S){return(typeof l=="number"||typeof l=="string")&&(S.sample_rate=`${l}`),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[vs],x=s.description;return b!=="url"&&x&&(y.transaction=x),ss()&&(y.sampled=String(ui(n)),y.sample_rand=a?.get("sentry.sample_rand")??mh(n).scope?.getPropagationContext().sampleRand.toString()),f(y),t.emit("createDsc",y,n),y}class ei{constructor(t={}){this._traceId=t.traceId||Ws(),this._spanId=t.spanId||Zs()}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 Vs(e,t=100,n=1/0){try{return Qy("",e,t,n)}catch(s){return{ERROR:`**non-serializable** (${s})`}}}function kR(e,t=3,n=100*1024){const s=Vs(e,t);return YI(s)>n?kR(e,t-1,n):s}function Qy(e,t,n=1/0,s=1/0,i=XI()){const[a,l]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const f=KI(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 Qy("",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]=Qy(x,S,d-1,s,i),y++}return l(t),g}function KI(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(cR(t))return rR(t);if(ZM(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Xs(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=GI(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function GI(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function ZI(e){return~-encodeURI(e).split(/%..|./).length}function YI(e){return ZI(JSON.stringify(e))}function XI(){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 ma(e,t=[]){return[e,t]}function QI(e,t){const[n,s]=e;return[n,[...s,t]]}function Wy(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 WI(e,t){return Wy(e,(n,s)=>t.includes(s))}function Jy(e){const t=ep(ct);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function JI(e){const[t,n]=e;let s=JSON.stringify(t);function i(a){typeof s=="string"?s=typeof a=="string"?s+a:[Jy(s),a]:s.push(typeof a=="string"?Jy(a):a)}for(const a of n){const[l,f]=a;if(i(`
6
6
  ${JSON.stringify(l)}
7
- `),typeof f=="string"||f instanceof Uint8Array)i(f);else{let d;try{d=JSON.stringify(f)}catch{d=JSON.stringify(Vs(f))}i(d)}}return typeof s=="string"?s:XI(s)}function XI(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 QI(e){return[{type:"span"},e]}function WI(e){const t=typeof e.data=="string"?Wy(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const JI={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 Tw(e){return JI[e]}function jR(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function eP(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:Gc(s)},...i&&{trace:i}}}function tP(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 nP(e,t,n,s){const i=jR(n),a={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!s&&t&&{dsn:Gc(t)}},l="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return ga(a,[l])}function rP(e,t,n,s){const i=jR(n),a=e.type&&e.type!=="replay_event"?e.type:"event";tP(e,n?.sdk);const l=eP(e,i,s,t);return delete e.sdkProcessingMetadata,ga(l,[[{type:a},e]])}function sP(e,t){function n(x){return!!x.trace_id&&!!x.public_key}const s=to(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,l={sent_at:new Date().toISOString(),...n(s)&&{trace:s},...!!a&&i&&{dsn:Gc(i)}},{beforeSendSpan:f,ignoreSpans:d}=t?.getOptions()||{},p=d?.length?e.filter(x=>!mh(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||(Yy(),S)}:yt,b=[];for(const x of p){const S=y(x);S&&b.push(QI(S))}return ga(l,b)}function oP(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:s}=yt(e),{spanId:i}=e.spanContext(),a=ui(e),l=Dn(e),f=l===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(l);p.push(`root ID: ${l.spanContext().spanId}`),g&&p.push(`root op: ${g}`),y&&p.push(`root description: ${y}`)}be.log(`${d}
7
+ `),typeof f=="string"||f instanceof Uint8Array)i(f);else{let d;try{d=JSON.stringify(f)}catch{d=JSON.stringify(Vs(f))}i(d)}}return typeof s=="string"?s:eP(s)}function eP(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 tP(e){return[{type:"span"},e]}function nP(e){const t=typeof e.data=="string"?Jy(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const rP={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 rP[e]}function OR(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function sP(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:Gc(s)},...i&&{trace:i}}}function oP(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 iP(e,t,n,s){const i=OR(n),a={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!s&&t&&{dsn:Gc(t)}},l="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return ma(a,[l])}function aP(e,t,n,s){const i=OR(n),a=e.type&&e.type!=="replay_event"?e.type:"event";oP(e,n?.sdk);const l=sP(e,i,s,t);return delete e.sdkProcessingMetadata,ma(l,[[{type:a},e]])}function cP(e,t){function n(x){return!!x.trace_id&&!!x.public_key}const s=to(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,l={sent_at:new Date().toISOString(),...n(s)&&{trace:s},...!!a&&i&&{dsn:Gc(i)}},{beforeSendSpan:f,ignoreSpans:d}=t?.getOptions()||{},p=d?.length?e.filter(x=>!gh(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||(Xy(),S)}:yt,b=[];for(const x of p){const S=y(x);S&&b.push(tP(S))}return ma(l,b)}function lP(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:s}=yt(e),{spanId:i}=e.spanContext(),a=ui(e),l=Dn(e),f=l===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(l);p.push(`root ID: ${l.spanContext().spanId}`),g&&p.push(`root op: ${g}`),y&&p.push(`root description: ${y}`)}be.log(`${d}
8
8
  ${p.join(`
9
- `)}`)}function iP(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >"}=yt(e),{spanId:s}=e.spanContext(),a=Dn(e)===e,l=`[Tracing] Finishing "${n}" ${a?"root ":""}span "${t}" with ID ${s}`;be.log(l)}function aP(e,t,n,s=Xn()){const i=s&&Dn(s);i&&(Ce&&be.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[zu]:t,[Du]:n}))}function Cw(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const s=n.attributes||{},i=s[Du],a=s[zu];typeof i=="string"&&typeof a=="number"&&(t[n.name]={value:a,unit:i})}),t}const Rw=1e3;class rp{constructor(t={}){this._traceId=t.traceId||Ws(),this._spanId=t.spanId||Zs(),this._startTime=t.startTimestamp||cn(),this._links=t.links,this._attributes={},this.setAttributes({[gn]:"manual",[eo]: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?Qv:SR}}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=ea(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(vs,"custom"),this}end(t){this._endTime||(this._endTime=ea(t),iP(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[eo],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:ER(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[gn],profile_id:this._attributes[Zv],exclusive_time:this._attributes[Kc],measurements:Cw(this._events),is_segment:this._isStandaloneSpan&&Dn(this)===this||void 0,segment_id:this._isStandaloneSpan?Dn(this).spanContext().spanId:void 0,links:wR(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,s){Ce&&be.log("[Tracing] Adding an event to span:",t);const i=Nw(n)?n:s||cn(),a=Nw(n)?{}:n||{},l={name:t,time:ea(i),attributes:a};return this._events.push(l),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=vt();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===Dn(this)))return;if(this._isStandaloneSpan){this._sampled?lP(sP([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&&(ph(this).scope||bt()).captureEvent(s)}_convertSpanToTransaction(){if(!jw(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}=ph(this),s=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const a=Xd(this).filter(g=>g!==this&&!cP(g)).map(g=>yt(g)).filter(jw),l=this._attributes[vs];delete this._attributes[bw],a.forEach(g=>{delete g.data[bw]});const f={contexts:{trace:MI(this)},spans:a.length>Rw?a.sort((g,y)=>g.start_timestamp-y.start_timestamp).slice(0,Rw):a,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:to(this)},request:s,...l&&{transaction_info:{source:l}}},d=Cw(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 Nw(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function jw(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function cP(e){return e instanceof rp&&e.isStandaloneSpan()}function lP(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 uP(e,t,n=()=>{},s=()=>{}){let i;try{i=e()}catch(a){throw t(a),n(),a}return fP(i,t,n,s)}function fP(e,t,n,s){return qc(e)?e.then(i=>(n(),s(i),i),i=>{throw t(i),n(),i}):(n(),s(e),e)}function dP(e,t,n){if(!ss(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=bu(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 l=n<a;return l||Ce&&be.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[l,a,s]}const AR="__SENTRY_SUPPRESS_TRACING__";function kR(e,t){const n=tb();if(n.startSpan)return n.startSpan(e,t);const s=MR(e),{forceTransaction:i,parentSpan:a,scope:l}=e,f=l?.clone();return Pu(f,()=>pP(a)(()=>{const p=bt(),g=IR(p,a),b=e.onlyIfParent&&!g?new ei:OR({parentSpan:g,spanArguments:s,forceTransaction:i,scope:p});return jc(p,b),uP(()=>t(b),()=>{const{status:x}=yt(b);b.isRecording()&&(!x||x==="ok")&&b.setStatus({code:hn,message:"internal_error"})},()=>{b.end()})}))}function Zc(e){const t=tb();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=MR(e),{forceTransaction:s,parentSpan:i}=e;return(e.scope?l=>Pu(e.scope,l):i!==void 0?l=>eb(i,l):l=>l())(()=>{const l=bt(),f=IR(l,i);return e.onlyIfParent&&!f?new ei:OR({parentSpan:f,spanArguments:n,forceTransaction:s,scope:l})})}function eb(e,t){const n=tb();return n.withActiveSpan?n.withActiveSpan(e,t):Pu(s=>(jc(s,e||void 0),t(s)))}function OR({parentSpan:e,spanArguments:t,forceTransaction:n,scope:s}){if(!ss()){const l=new ei;if(n||!e){const f={sampled:"false",sample_rate:"0",transaction:t.name,...to(l)};Qd(l,f)}return l}const i=Zr();let a;if(e&&!n)a=hP(e,s,t),TR(e,a);else if(e){const l=to(e),{traceId:f,spanId:d}=e.spanContext(),p=ui(e);a=Aw({traceId:f,parentSpanId:d,...t},s,p),Qd(a,l)}else{const{traceId:l,dsc:f,parentSpanId:d,sampled:p}={...i.getPropagationContext(),...s.getPropagationContext()};a=Aw({traceId:l,parentSpanId:d,...t},s,p),f&&Qd(a,f)}return oP(a),gI(a,s,i),a}function MR(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const s={...n};return s.startTimestamp=ea(e.startTime),delete s.startTime,s}return n}function tb(){const e=ha();return Vc(e)}function Aw(e,t,n){const s=vt(),i=s?.getOptions()||{},{name:a=""}=e,l={spanAttributes:{...e.attributes},spanName:a,parentSampled:n};s?.emit("beforeSampling",l,{decision:!1});const f=l.parentSampled??n,d=l.spanAttributes,p=t.getPropagationContext(),[g,y,b]=t.getScopeData().sdkProcessingMetadata[AR]?[!1]:dP(i,{name:a,parentSampled:f,attributes:d,parentSampleRate:bu(p.dsc?.sample_rate)},p.sampleRand),x=new rp({...e,attributes:{[vs]:"custom",[Gv]: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 hP(e,t,n){const{spanId:s,traceId:i}=e.spanContext(),a=t.getScopeData().sdkProcessingMetadata[AR]?!1:ui(e),l=a?new rp({...n,parentSpanId:s,traceId:i,sampled:a}):new ei({traceId:i});TR(e,l);const f=vt();return f&&(f.emit("spanStart",l),n.endTimestamp&&f.emit("spanEnd",l)),l}function IR(e,t){if(t)return t;if(t===null)return;const n=Ac(e);if(!n)return;const s=vt();return(s?s.getOptions():{}).parentSpanIsAlwaysRootSpan?Dn(n):n}function pP(e){return e!==void 0?t=>eb(e,t):t=>t()}const Wd={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},mP="heartbeatFailed",gP="idleTimeout",yP="finalTimeout",vP="externalFinish";function PR(e,t={}){const n=new Map;let s=!1,i,a=vP,l=!t.disableAutoFinish;const f=[],{idleTimeout:d=Wd.idleTimeout,finalTimeout:p=Wd.finalTimeout,childSpanTimeout:g=Wd.childSpanTimeout,beforeSpanEnd:y,trimIdleSpanEndTimestamp:b=!0}=t,x=vt();if(!x||!ss()){const j=new ei,A={sample_rate:"0",sampled:"false",...to(j)};return Qd(j,A),j}const S=bt(),w=Xn(),T=bP(e);T.end=new Proxy(T.end,{apply(j,A,P){if(y&&y(T),A instanceof ei)return;const[Z,...B]=P,z=Z||cn(),Q=ea(z),Y=Xd(T).filter(U=>U!==T),ee=yt(T);if(!Y.length||!b)return L(Q),Reflect.apply(j,A,[Q,...B]);const D=x.getOptions().ignoreSpans,V=Y?.reduce((U,I)=>{const H=yt(I);return!H.timestamp||D&&mh(H,D)?U:U?Math.max(U,H.timestamp):H.timestamp},void 0),q=ee.start_timestamp,K=Math.min(q?q+p/1e3:1/0,Math.max(q||-1/0,Math.min(Q,V||1/0)));return L(K),Reflect.apply(j,A,[K,...B])}});function C(){i&&(clearTimeout(i),i=void 0)}function O(j){C(),i=setTimeout(()=>{!s&&n.size===0&&l&&(a=gP,T.end(j))},d)}function N(j){i=setTimeout(()=>{!s&&l&&(a=mP,T.end(j))},g)}function R(j){C(),n.set(j,!0);const A=cn();N(A+g/1e3)}function M(j){if(n.has(j)&&n.delete(j),n.size===0){const A=cn();O(A+d/1e3)}}function L(j){s=!0,n.clear(),f.forEach(Y=>Y()),jc(S,w);const A=yt(T),{start_timestamp:P}=A;if(!P)return;A.data[vu]||T.setAttribute(vu,a);const B=A.status;(!B||B==="unknown")&&T.setStatus({code:Yv}),be.log(`[Tracing] Idle span "${A.op}" finished`);const z=Xd(T).filter(Y=>Y!==T);let Q=0;z.forEach(Y=>{Y.isRecording()&&(Y.setStatus({code:hn,message:"cancelled"}),Y.end(j),Ce&&be.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Y,void 0,2)));const ee=yt(Y),{timestamp:D=0,start_timestamp:V=0}=ee,q=V<=j,K=(p+d)/1e3,U=D-V<=K;if(Ce){const I=JSON.stringify(Y,void 0,2);q?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||!q)&&(LI(T,Y),Q++)}),Q>0&&T.setAttribute("sentry.idle_span_discarded_spans",Q)}return f.push(x.on("spanStart",j=>{if(s||j===T||yt(j).timestamp||j instanceof rp&&j.isStandaloneSpan())return;Xd(T).includes(j)&&R(j.spanContext().spanId)})),f.push(x.on("spanEnd",j=>{s||M(j.spanContext().spanId)})),f.push(x.on("idleSpanEnableAutoFinish",j=>{j===T&&(l=!0,O(),n.size&&N())})),t.disableAutoFinish||O(),setTimeout(()=>{s||(T.setStatus({code:hn,message:"deadline_exceeded"}),a=yP,T.end())},p),T}function bP(e){const t=Zc(e);return jc(bt(),t),Ce&&be.log("[Tracing] Started span is an idle span"),t}const Vg=0,kw=1,Ow=2;function Lu(e){return new xu(t=>{t(e)})}function nb(e){return new xu((t,n)=>{n(e)})}class xu{constructor(t){this._state=Vg,this._handlers=[],this._runExecutor(t)}then(t,n){return new xu((s,i)=>{this._handlers.push([!1,a=>{if(!t)s(a);else try{s(t(a))}catch(l){i(l)}},a=>{if(!n)i(a);else try{s(n(a))}catch(l){i(l)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new xu((n,s)=>{let i,a;return this.then(l=>{a=!1,i=l,t&&t()},l=>{a=!0,i=l,t&&t()}).then(()=>{if(a){s(i);return}n(i)})})}_executeHandlers(){if(this._state===Vg)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===kw&&n[1](this._value),this._state===Ow&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(a,l)=>{if(this._state===Vg){if(qc(l)){l.then(s,i);return}this._state=a,this._value=l,this._executeHandlers()}},s=a=>{n(kw,a)},i=a=>{n(Ow,a)};try{t(s,i)}catch(a){i(a)}}}function xP(e,t,n,s=0){try{const i=Jy(t,n,e,s);return qc(i)?i:Lu(i)}catch(i){return nb(i)}}function Jy(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`),qc(a)?a.then(l=>Jy(l,t,n,s+1)):Jy(a,t,n,s+1)}let Fi,Mw,Iw,zo;function SP(e){const t=ct._sentryDebugIds,n=ct._debugIds;if(!t&&!n)return{};const s=t?Object.keys(t):[],i=n?Object.keys(n):[];if(zo&&s.length===Mw&&i.length===Iw)return zo;Mw=s.length,Iw=i.length,zo={},Fi||(Fi={});const a=(l,f)=>{for(const d of l){const p=f[d],g=Fi?.[d];if(g&&zo&&p)zo[g[0]]=p,Fi&&(Fi[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&&zo&&Fi){zo[S]=p,Fi[d]=[S,p];break}}}}};return t&&a(s,t),n&&a(i,n),zo}function _P(e,t){const{fingerprint:n,span:s,breadcrumbs:i,sdkProcessingMetadata:a}=t;wP(e,t),s&&CP(e,s),RP(e,n),EP(e,i),TP(e,a)}function Pw(e,t){const{extra:n,tags:s,attributes:i,user:a,contexts:l,level:f,sdkProcessingMetadata:d,breadcrumbs:p,fingerprint:g,eventProcessors:y,attachments:b,propagationContext:x,transactionName:S,span:w}=t;Wl(e,"extra",n),Wl(e,"tags",s),Wl(e,"attributes",i),Wl(e,"user",a),Wl(e,"contexts",l),e.sdkProcessingMetadata=Iu(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 Wl(e,t,n){e[t]=Iu(e[t],n,1)}function sp(e,t){const n=lI().getScopeData();return e&&Pw(n,e.getScopeData()),t&&Pw(n,t.getScopeData()),n}function wP(e,t){const{extra:n,tags:s,user:i,contexts:a,level:l,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}),l&&(e.level=l),f&&e.type!=="transaction"&&(e.transaction=f)}function EP(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function TP(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function CP(e,t){e.contexts={trace:_R(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:to(t),...e.sdkProcessingMetadata};const n=Dn(t),s=yt(n).description;s&&!e.transaction&&e.type==="transaction"&&(e.transaction=s)}function RP(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 NP(e,t,n,s,i,a){const{normalizeDepth:l=3,normalizeMaxBreadth:f=1e3}=e,d={...t,event_id:t.event_id||n.event_id||qr(),timestamp:t.timestamp||ma()},p=n.integrations||e.integrations.map(C=>C.name);jP(d,e),OP(d,p),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&AP(d,e.stackParser);const g=IP(s,n.captureContext);n.mechanism&&Rc(d,n.mechanism);const y=i?i.getEventProcessors():[],b=sp(a,g),x=[...n.attachments||[],...b.attachments];x.length&&(n.attachments=x),_P(d,b);const S=[...y,...b.eventProcessors];return(n.data&&n.data.__sentry__===!0?Lu(d):xP(S,d,n)).then(C=>(C&&kP(C),typeof l=="number"&&l>0?MP(C,l,f):C))}function jP(e,t){const{environment:n,release:s,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||Wv,!e.release&&s&&(e.release=s),!e.dist&&i&&(e.dist=i);const l=e.request;l?.url&&a&&(l.url=Vy(l.url,a)),a&&e.exception?.values?.forEach(f=>{f.value&&(f.value=Vy(f.value,a))})}function AP(e,t){const n=SP(t);e.exception?.values?.forEach(s=>{s.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=n[i.filename])})})}function kP(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 OP(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function MP(e,t,n){if(!e)return null;const s={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:Vs(i.data,t,n)}}))},...e.user&&{user:Vs(e.user,t,n)},...e.contexts&&{contexts:Vs(e.contexts,t,n)},...e.extra&&{extra:Vs(e.extra,t,n)}};return e.contexts?.trace&&s.contexts&&(s.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(s.contexts.trace.data=Vs(e.contexts.trace.data,t,n))),e.spans&&(s.spans=e.spans.map(i=>({...i,...i.data&&{data:Vs(i.data,t,n)}}))),e.contexts?.flags&&s.contexts&&(s.contexts.flags=Vs(e.contexts.flags,3,n)),s}function IP(e,t){if(!t)return e;const n=e?e.clone():new Js;return n.update(t),n}function DR(e,t){return bt().captureException(e,void 0)}function zR(e,t){return bt().captureEvent(e,t)}function PP(e,t){Zr().setContext(e,t)}function DP(){const e=vt();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Dw(e){const t=Zr(),{user:n}=sp(t,bt()),{userAgent:s}=ct.navigator||{},i=JM({user:n,...s&&{userAgent:s},...e}),a=t.getSession();return a?.status==="ok"&&Nc(a,{status:"exited"}),LR(),t.setSession(i),i}function LR(){const e=Zr(),n=bt().getSession()||e.getSession();n&&eI(n),UR(),e.setSession()}function UR(){const e=Zr(),t=vt(),n=e.getSession();n&&t&&t.captureSession(n)}function Kg(e=!1){if(e){LR();return}UR()}const zP="7";function LP(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function UP(e){return`${LP(e)}${e.projectId}/envelope/`}function $P(e,t){const n={sentry_version:zP};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function BP(e,t,n){return t||`${UP(e)}?${$P(e,n)}`}const zw=[];function FP(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 HP(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 FP(s)}function qP(e,t){const n={};return t.forEach(s=>{s&&$R(e,s,n)}),n}function Lw(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function $R(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,!zw.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),zw.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,l)=>s(a,l,e),{id:t.name});e.addEventProcessor(i)}Ce&&be.log(`Integration installed: ${t.name}`)}function VP(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function KP(e,t){const{value:n,unit:s}=VP(e)?e:{value:e,unit:void 0},i=GP(n),a=s&&typeof s=="string"?{unit:s}:{};if(i)return{...i,...a};if(!t||t==="skip-undefined"&&n===void 0)return;let l="";try{l=JSON.stringify(n)??""}catch{}return{value:l,type:"string",...a}}function gh(e,t=!1){const n={};for(const[s,i]of Object.entries(e??{})){const a=KP(i,t);a&&(n[s]=a)}return n}function GP(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 BR(e,t){return t?Pu(t,()=>{const n=Xn(),s=n?_R(n):fR(t);return[n?to(n):Jv(e,t),s]}):[void 0,void 0]}const ZP={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function YP(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function XP(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Gc(s)),ga(i,[YP(e)])}const QP=100;function ps(e,t,n,s=!0){n&&(!e[t]||s)&&(e[t]=n)}function WP(e,t){const n=rb(),s=FR(e);s===void 0?n.set(e,[t]):s.length>=QP?(yh(e,s),n.set(e,[t])):n.set(e,[...s,t])}function JP(e,t=bt(),n=WP){const s=t?.getClient()??vt();if(!s){Ce&&be.warn("No client available to capture log.");return}const{release:i,environment:a,enableLogs:l=!1,beforeSendLog:f}=s.getOptions();if(!l){Ce&&be.warn("logging option not enabled, log will not be captured.");return}const[,d]=BR(s,t),p={...e.attributes},{user:{id:g,email:y,username:b},attributes:x={}}=sp(Zr(),t);ps(p,"user.id",g,!1),ps(p,"user.email",y,!1),ps(p,"user.name",b,!1),ps(p,"sentry.release",i),ps(p,"sentry.environment",a);const{name:S,version:w}=s.getSdkMetadata()?.sdk??{};ps(p,"sentry.sdk.name",S),ps(p,"sentry.sdk.version",w);const T=s.getIntegrationByName("Replay"),C=T?.getReplayId(!0);ps(p,"sentry.replay_id",C),C&&T?.getRecordingMode()==="buffer"&&ps(p,"sentry._internal.replay_is_buffering",!0);const O=e.message;if(tp(O)){const{__sentry_template_string__:B,__sentry_template_values__:z=[]}=O;z?.length&&(p["sentry.message.template"]=B),z.forEach((Q,Y)=>{p[`sentry.message.parameter.${Y}`]=Q})}const N=Ac(t);ps(p,"sentry.trace.parent_span_id",N?.spanContext().spanId);const R={...e,attributes:p};s.emit("beforeCaptureLog",R);const M=f?pa(()=>f(R)):R;if(!M){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:A={},severityNumber:P}=M,Z={timestamp:cn(),level:L,body:j,trace_id:d?.trace_id,severity_number:P??ZP[L],attributes:{...gh(x),...gh(A,!0)}};n(s,Z),s.emit("afterCaptureLog",M)}function yh(e,t){const n=t??FR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=XP(n,s._metadata,s.tunnel,e.getDsn());rb().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function FR(e){return rb().get(e)}function rb(){return Fc("clientToLogBufferMap",()=>new WeakMap)}function eD(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function tD(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Gc(s)),ga(i,[eD(e)])}const nD=1e3;function Fs(e,t,n,s=!0){n&&(s||!(t in e))&&(e[t]=n)}function rD(e,t){const n=ob(),s=HR(e);s===void 0?n.set(e,[t]):s.length>=nD?(sb(e,s),n.set(e,[t])):n.set(e,[...s,t])}function sD(e,t,n){const{release:s,environment:i}=t.getOptions(),a={...e.attributes};Fs(a,"user.id",n.id,!1),Fs(a,"user.email",n.email,!1),Fs(a,"user.name",n.username,!1),Fs(a,"sentry.release",s),Fs(a,"sentry.environment",i);const{name:l,version:f}=t.getSdkMetadata()?.sdk??{};Fs(a,"sentry.sdk.name",l),Fs(a,"sentry.sdk.version",f);const d=t.getIntegrationByName("Replay"),p=d?.getReplayId(!0);return Fs(a,"sentry.replay_id",p),p&&d?.getRecordingMode()==="buffer"&&Fs(a,"sentry._internal.replay_is_buffering",!0),{...e,attributes:a}}function oD(e,t,n,s){const[,i]=BR(t,n),a=Ac(n),l=a?a.spanContext().traceId:i?.trace_id,f=a?a.spanContext().spanId:void 0;return{timestamp:cn(),trace_id:l??"",span_id:f,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...gh(s),...gh(e.attributes,"skip-undefined")}}}function iD(e,t){const n=t?.scope??bt(),s=t?.captureSerializedMetric??rD,i=n?.getClient()??vt();if(!i){Ce&&be.warn("No client available to capture metric.");return}const{_experiments:a,enableMetrics:l,beforeSendMetric:f}=i.getOptions();if(!(l??a?.enableMetrics??!0)){Ce&&be.warn("metrics option not enabled, metric will not be captured.");return}const{user:p,attributes:g}=sp(Zr(),n),y=sD(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=oD(x,i,n,g);Ce&&be.log("[Metric]",S),s(i,S),i.emit("afterCaptureMetric",x)}function sb(e,t){const n=t??HR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=tD(n,s._metadata,s.tunnel,e.getDsn());ob().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function HR(e){return ob().get(e)}function ob(){return Fc("clientToMetricBufferMap",()=>new WeakMap)}function qR(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const ib=Symbol.for("SentryBufferFullError");function ab(e=100){const t=new Set;function n(){return t.size<e}function s(l){t.delete(l)}function i(l){if(!n())return nb(ib);const f=l();return t.add(f),f.then(()=>s(f),()=>s(f)),f}function a(l){if(!t.size)return Lu(!0);const f=Promise.allSettled(Array.from(t)).then(()=>!0);if(!l)return f;const d=[f,new Promise(p=>qR(setTimeout(()=>p(!1),l)))];return Promise.race(d)}return{get $(){return Array.from(t)},add:i,drain:a}}const aD=60*1e3;function cD(e,t=Mu()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const s=Date.parse(`${e}`);return isNaN(s)?aD:s-t}function lD(e,t){return e[t]||e.all||0}function uD(e,t,n=Mu()){return lD(e,t)>n}function fD(e,{statusCode:t,headers:n},s=Mu()){const i={...e},a=n?.["x-sentry-rate-limits"],l=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 l?i.all=s+cD(l,s):t===429&&(i.all=s+60*1e3);return i}const VR=64;function dD(e,t,n=ab(e.bufferSize||VR)){let s={};const i=l=>n.drain(l);function a(l){const f=[];if(Qy(l,(y,b)=>{const x=Tw(b);uD(s,x)?e.recordDroppedEvent("ratelimit_backoff",x):f.push(y)}),f.length===0)return Promise.resolve({});const d=ga(l[0],f),p=y=>{if(ZI(d,["client_report"])){Ce&&be.warn(`Dropping client report. Will not send outcomes (reason: ${y}).`);return}Qy(d,(b,x)=>{e.recordDroppedEvent(y,Tw(x))})},g=()=>t({body:YI(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=fD(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===ib)return Ce&&be.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw y})}return{send:a,flush:i}}function hD(e,t,n){const s=[{type:"client_report"},{timestamp:ma(),discarded_events:e}];return ga(t?{dsn:t}:{},[s])}function KR(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 pD(e){const{trace_id:t,parent_span_id:n,span_id:s,status:i,origin:a,data:l,op:f}=e.contexts?.trace??{};return{data:l??{},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:l?.[Zv],exclusive_time:l?.[Kc],measurements:e.measurements,is_segment:!0}}function mD(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&&{[Zv]:e.profile_id},...e.exclusive_time&&{[Kc]:e.exclusive_time}}}},measurements:e.measurements}}const Uw="Not capturing exception because it's already been captured.",$w="Discarded session because of missing or non-string release",GR=Symbol.for("SentryInternalError"),ZR=Symbol.for("SentryDoNotSendEventError"),gD=5e3;function Jd(e){return{message:e,[GR]:!0}}function Gg(e){return{message:e,[ZR]:!0}}function Bw(e){return!!e&&typeof e=="object"&&GR in e}function Fw(e){return!!e&&typeof e=="object"&&ZR in e}function Hw(e,t,n,s,i){let a=0,l,f=!1;e.on(n,()=>{a=0,clearTimeout(l),f=!1}),e.on(t,d=>{a+=s(d),a>=8e5?i(e):f||(f=!0,l=qR(setTimeout(()=>{i(e)},gD)))}),e.on("flush",()=>{i(e)})}class yD{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=ab(t.transportOptions?.bufferSize??VR),t.dsn?this._dsn=jI(t.dsn):Ce&&be.warn("No DSN provided, client will not send events."),this._dsn){const s=BP(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&&Hw(this,"afterCaptureLog","flushLogs",SD,yh),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Hw(this,"afterCaptureMetric","flushMetrics",xD,sb)}captureException(t,n,s){const i=qr();if(gw(t))return Ce&&be.log(Uw),i;const a={event_id:i,...n};return this._process(()=>this.eventFromException(t,a).then(l=>this._captureEvent(l,a,s)).then(l=>l),"error"),a.event_id}captureMessage(t,n,s,i){const a={event_id:qr(),...s},l=tp(t)?t:String(t),f=Cc(t),d=f?this.eventFromMessage(l,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=qr();if(n?.originalException&&gw(n.originalException))return Ce&&be.log(Uw),i;const a={event_id:i,...n},l=t.sdkProcessingMetadata||{},f=l.capturedSpanScope,d=l.capturedSpanIsolationScope,p=qw(t.type);return this._process(()=>this._captureEvent(t,a,f||s,d),p),a.event_id}captureSession(t){this.sendSession(t),Nc(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){yh(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];$R(this,t,this._integrations),n||Lw(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let s=rP(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])s=GI(s,WI(i));this.sendEnvelope(s).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){const{release:n,environment:s=Wv}=this._options;if("aggregates"in t){const a=t.attrs||{};if(!a.release&&!n){Ce&&be.warn($w);return}a.release=a.release||n,a.environment=a.environment||s,t.attrs=a}else{if(!t.release&&!n){Ce&&be.warn($w);return}t.release=t.release||n,t.environment=t.environment||s}this.emit("beforeSendSession",t);const i=nP(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=qP(this,t),Lw(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 l=t.status==="ok";(l&&t.errors===0||l&&s)&&(Nc(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(),l=Object.keys(this._integrations);return!n.integrations&&l?.length&&(n.integrations=l),this.emit("preprocessEvent",t,n),t.type||i.setLastEventId(t.event_id||n.event_id),NP(a,t,n,s,this,i).then(f=>{if(f===null)return f;this.emit("postprocessEvent",f,n),f.contexts={trace:fR(s),...f.contexts};const d=Jv(this,s);return f.sdkProcessingMetadata={dynamicSamplingContext:d,...f.sdkProcessingMetadata},f})}_captureEvent(t,n={},s=bt(),i=Zr()){return Ce&&ev(t)&&be.log(`Captured error event \`${KR(t)[0]||"<unknown>"}\``),this._processEvent(t,n,s,i).then(a=>a.event_id,a=>{Ce&&(Fw(a)?be.log(a.message):Bw(a)?be.warn(a.message):be.warn(a))})}_processEvent(t,n,s,i){const a=this.getOptions(),{sampleRate:l}=a,f=YR(t),d=ev(t),g=`before send for type \`${t.type||"error"}\``,y=typeof l>"u"?void 0:bu(l);if(d&&typeof y=="number"&&Vo()>y)return this.recordDroppedEvent("sample_rate","error"),nb(Gg(`Discarding event because it's not included in the random sample (sampling rate = ${l})`));const b=qw(t.type);return this._prepareEvent(t,n,s,i).then(x=>{if(x===null)throw this.recordDroppedEvent("event_processor",b),Gg("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return x;const w=bD(this,a,x,n);return vD(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 Gg(`${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,O=T-C;O>0&&this.recordDroppedEvent("before_send","span",O)}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 Fw(x)||Bw(x)?x:(this.captureException(x,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:x}),Jd(`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===ib&&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=hD(t,this._options.tunnel&&Gc(this._dsn));this.sendEnvelope(n)}}function qw(e){return e==="replay_event"?"replay":e||"error"}function vD(e,t){const n=`${t} must return \`null\` or a valid event.`;if(qc(e))return e.then(s=>{if(!yu(s)&&s!==null)throw Jd(n);return s},s=>{throw Jd(`${t} rejected with ${s}`)});if(!yu(e)&&e!==null)throw Jd(n);return e}function bD(e,t,n,s){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:l,ignoreSpans:f}=t;let d=n;if(ev(d)&&i)return i(d,s);if(YR(d)){if(l||f){const p=pD(d);if(f?.length&&mh(p,f))return null;if(l){const g=l(p);g?d=Iu(n,mD(g)):Yy()}if(d.spans){const g=[],y=d.spans;for(const x of y){if(f?.length&&mh(x,f)){$I(y,x);continue}if(l){const S=l(x);S?g.push(S):(Yy(),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 ev(e){return e.type===void 0}function YR(e){return e.type==="transaction"}function xD(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+XR(e.attributes)}function SD(e){let t=0;return e.message&&(t+=e.message.length*2),t+XR(e.attributes)}function XR(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Vw(n[0]):Cc(n)?t+=Vw(n):t+=100}),t}function Vw(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function _D(e){return ep(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Kw(e){return _D(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function wD(e,t){t.debug===!0&&(Ce?be.enable():pa(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),bt().update(t.initialScope);const s=new e(t);return ED(s),s.init(),s}function ED(e){bt().setClient(e)}const TD="thismessage:/";function QR(e){return"isRelative"in e}function WR(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,s=n?TD: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 CD(e){if(QR(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 na(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 RD(e){return e.split(/[?#]/,1)[0]}function Go(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 l="";if(t&&a!==-1){const f=e.slice(a+1);l=f.length>10?`${f.slice(0,10)}... [truncated]`:f}return`data:${s}${i?",base64":""}${l?`,${l}`:""}`}return e}function ND(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 jD=ND;function AD(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 JR(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:Ji})),i.version=Ji)}function e1(e={}){const t=e.client||vt();if(!DP()||!t)return{};const n=ha(),s=Vc(n);if(s.getTraceData)return s.getTraceData(e);const i=e.scope||bt(),a=e.span||Xn(),l=a?II(a):kD(i),f=a?to(a):Jv(t,i),d=bI(f);if(!vR.test(l))return be.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const g={"sentry-trace":l,baggage:d};return e.propagateTraceparent&&(g.traceparent=a?PI(a):OD(i)),g}function kD(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return bR(t,s,n)}function OD(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return xR(t,s,n)}const MD=100;function ia(e,t){const n=vt(),s=Zr();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=MD}=n.getOptions();if(a<=0)return;const f={timestamp:ma(),...e},d=i?pa(()=>i(f,t)):f;d!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",d,t),s.addBreadcrumb(d,a))}let Gw;const ID="FunctionToString",Zw=new WeakMap,PD=(()=>({name:ID,setupOnce(){Gw=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Kv(this),n=Zw.has(vt())&&t!==void 0?t:this;return Gw.apply(n,e)}}catch{}},setup(e){Zw.set(e,!0)}})),DD=PD,zD=[/^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$/],LD="EventFilters",UD=(e={})=>{let t;return{name:LD,setup(n){const s=n.getOptions();t=Yw(e,s)},processEvent(n,s,i){if(!t){const a=i.getOptions();t=Yw(e,a)}return BD(n,t)?null:n}}},$D=((e={})=>({...UD(e),name:"InboundFilters"}));function Yw(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:zD],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function BD(e,t){if(e.type){if(e.type==="transaction"&&HD(e,t.ignoreTransactions))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
11
- Event: ${Gi(e)}`),!0}else{if(FD(e,t.ignoreErrors))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
12
- Event: ${Gi(e)}`),!0;if(GD(e))return Ce&&be.warn(`Event dropped due to not having an error message, error type or stacktrace.
13
- Event: ${Gi(e)}`),!0;if(qD(e,t.denyUrls))return Ce&&be.warn(`Event dropped due to being matched by \`denyUrls\` option.
14
- Event: ${Gi(e)}.
15
- Url: ${vh(e)}`),!0;if(!VD(e,t.allowUrls))return Ce&&be.warn(`Event dropped due to not being matched by \`allowUrls\` option.
16
- Event: ${Gi(e)}.
17
- Url: ${vh(e)}`),!0}return!1}function FD(e,t){return t?.length?KR(e).some(n=>Ko(n,t)):!1}function HD(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Ko(n,t):!1}function qD(e,t){if(!t?.length)return!1;const n=vh(e);return n?Ko(n,t):!1}function VD(e,t){if(!t?.length)return!0;const n=vh(e);return n?Ko(n,t):!0}function KD(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 vh(e){try{const n=[...e.exception?.values??[]].reverse().find(s=>s.mechanism?.parent_id===void 0&&s.stacktrace?.frames?.length)?.stacktrace?.frames;return n?KD(n):null}catch{return Ce&&be.error(`Cannot extract url for event ${Gi(e)}`),null}}function GD(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function ZD(e,t,n,s,i,a){if(!i.exception?.values||!a||!Qs(a.originalException,Error))return;const l=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;l&&(i.exception.values=tv(e,t,s,a.originalException,n,i.exception.values,l,0))}function tv(e,t,n,s,i,a,l,f){if(a.length>=n+1)return a;let d=[...a];if(Qs(s[i],Error)){Xw(l,f,s);const p=e(t,s[i]),g=d.length;Qw(p,i,g,f),d=tv(e,t,n,s[i],i,[p,...d],p,g)}return t1(s)&&s.errors.forEach((p,g)=>{if(Qs(p,Error)){Xw(l,f,s);const y=e(t,p),b=d.length;Qw(y,`errors[${g}]`,b,f),d=tv(e,t,n,p,i,[y,...d],y,b)}}),d}function t1(e){return Array.isArray(e.errors)}function Xw(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...t1(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Qw(e,t,n,s){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:s}}function YD(e){const t="console";ci(t,e),li(t,XD)}function XD(){"console"in ct&&AM.forEach(function(e){e in ct.console&&gr(ct.console,e,function(t){return hh[e]=t,function(...n){Hr("console",{args:n,level:e}),hh[e]?.apply(ct.console,n)}})})}function QD(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const WD="Dedupe",JD=(()=>{let e;return{name:WD,processEvent(t){if(t.type)return t;try{if(t2(t,e))return Ce&&be.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),e2=JD;function t2(e,t){return t?!!(n2(e,t)||r2(e,t)):!1}function n2(e,t){const n=e.message,s=t.message;return!(!n&&!s||n&&!s||!n&&s||n!==s||!r1(e,t)||!n1(e,t))}function r2(e,t){const n=Ww(t),s=Ww(e);return!(!n||!s||n.type!==s.type||n.value!==s.value||!r1(e,t)||!n1(e,t))}function n1(e,t){let n=uw(e),s=uw(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],l=n[i];if(a.filename!==l.filename||a.lineno!==l.lineno||a.colno!==l.colno||a.function!==l.function)return!1}return!0}function r1(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 Ww(e){return e.exception?.values?.[0]}const s2="ConversationId",o2=(()=>({name:s2,setup(e){e.on("spanStart",t=>{const n=bt().getScopeData(),s=Zr().getScopeData(),i=n.conversationId||s.conversationId;i&&t.setAttribute(fI,i)})}})),i2=o2;function a2(e,t,n,s,i){if(!e.fetchData)return;const{method:a,url:l}=e.fetchData,f=ss()&&t(l);if(e.endTimestamp){const x=e.fetchData.__span;if(!x)return;const S=s[x];S&&(f&&(u2(S,e),c2(S,e,i)),delete s[x]);return}const{spanOrigin:d="auto.http.browser",propagateTraceparent:p=!1}=typeof i=="object"?i:{spanOrigin:i},g=!!Xn(),y=f&&g?Zc(d2(l,a,d)):new ei;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=l2(x,S,ss()&&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 c2(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function l2(e,t,n,s){const i=e1({span:n,propagateTraceparent:s}),a=i["sentry-trace"],l=i.baggage,f=i.traceparent;if(!a)return;const d=t.headers||(qv(e)?e.headers:void 0);if(d)if(f2(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),l){const g=p.get("baggage");g?_d(g)||p.set("baggage",`${g},${l}`):p.set("baggage",l)}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"&&_d(y[1]));return l&&!g&&p.push(["baggage",l]),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=>_d(w)):_d(y));l&&!x&&b.push(l);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 u2(e,t){if(t.response){hR(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:hn,message:"internal_error"});e.end()}function _d(e){return e.split(",").some(t=>t.trim().startsWith(Xv))}function f2(e){return typeof Headers<"u"&&Qs(e,Headers)}function d2(e,t,n){if(e.startsWith("data:")){const a=Go(e);return{name:`${t} ${a}`,attributes:Jw(e,void 0,t,n)}}const s=WR(e),i=s?CD(s):e;return{name:`${t} ${i}`,attributes:Jw(e,s,t,n)}}function Jw(e,t,n,s){const i={url:Go(e),type:"fetch","http.method":n,[gn]:s,[eo]:"http.client"};return t&&(QR(t)||(i["http.url"]=Go(t.href),i["server.address"]=t.host),t.search&&(i["http.query"]=t.search),t.hash&&(i["http.fragment"]=t.hash)),i}function Yc(e,t,n,s,i){JP({level:e,message:t,attributes:n,severityNumber:i},s)}function h2(e,t,{scope:n}={}){Yc("trace",e,t,n)}function p2(e,t,{scope:n}={}){Yc("debug",e,t,n)}function m2(e,t,{scope:n}={}){Yc("info",e,t,n)}function g2(e,t,{scope:n}={}){Yc("warn",e,t,n)}function y2(e,t,{scope:n}={}){Yc("error",e,t,n)}function v2(e,t,{scope:n}={}){Yc("fatal",e,t,n)}const b2=Object.freeze(Object.defineProperty({__proto__:null,debug:p2,error:y2,fatal:v2,fmt:jD,info:m2,trace:h2,warn:g2},Symbol.toStringTag,{value:"Module"}));function cb(e,t,n,s){iD({type:e,name:t,value:n,unit:s?.unit,attributes:s?.attributes},{scope:s?.scope})}function eE(e,t=1,n){cb("counter",e,t,n)}function tE(e,t,n){cb("gauge",e,t,n)}function nE(e,t,n){cb("distribution",e,t,n)}function s1(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Su=ct;function x2(){return"history"in Su&&!!Su.history}function S2(){if(!("fetch"in Su))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function nv(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function _2(){if(typeof EdgeRuntime=="string")return!0;if(!S2())return!1;if(nv(Su.fetch))return!0;let e=!1;const t=Su.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=nv(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 o1(e,t){const n="fetch";ci(n,e),li(n,()=>i1(void 0,t))}function w2(e){const t="fetch-body-resolved";ci(t,e),li(t,()=>i1(T2))}function i1(e,t=!1){t&&!_2()||gr(ct,"fetch",function(n){return function(...s){const i=new Error,{method:a,url:l}=C2(s),f={args:s,fetchData:{method:a,url:l},startTimestamp:cn()*1e3,virtualError:i,headers:R2(s)};return e||Hr("fetch",{...f}),n.apply(ct,s).then(async d=>(e?e(d):Hr("fetch",{...f,endTimestamp:cn()*1e3,response:d}),d),d=>{Hr("fetch",{...f,endTimestamp:cn()*1e3,error:d}),ep(d)&&d.stack===void 0&&(d.stack=i.stack,Yn(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})`:Yn(d,"__sentry_fetch_url_host__",x)}catch{}throw d})}})}async function E2(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 l;try{l=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:f}=await s.read();clearTimeout(l),f&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(l)}}clearTimeout(i),s.releaseLock(),n.cancel().then(null,()=>{})}}function T2(e){let t;try{t=e.clone()}catch{return}E2(t,()=>{Hr("fetch-body-resolved",{endTimestamp:cn()*1e3,response:e})})}function eh(e,t){return!!e&&typeof e=="object"&&!!e[t]}function rE(e){return typeof e=="string"?e:e?eh(e,"url")?e.url:e.toString?e.toString():"":""}function C2(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,s]=e;return{url:rE(n),method:eh(s,"method")?String(s.method).toUpperCase():qv(n)&&eh(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:rE(t),method:eh(t,"method")?String(t.method).toUpperCase():"GET"}}function R2(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(qv(t))return new Headers(t.headers)}catch{}}function N2(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function j2(){return"npm"}function A2(){return!N2()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function k2(){return typeof window<"u"&&(!A2()||O2())}function O2(){return ct.process?.type==="renderer"}const st=ct;let rv=0;function a1(){return rv>0}function M2(){rv++,setTimeout(()=>{rv--})}function Oc(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(Kv(e))return e}catch{return e}const s=function(...i){try{const a=i.map(l=>Oc(l,t));return e.apply(this,a)}catch(a){throw M2(),Pu(l=>{l.addEventProcessor(f=>(t.mechanism&&(Ky(f,void 0),Rc(f,t.mechanism)),f.extra={...f.extra,arguments:i},f)),DR(a)}),a}};try{for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[i]=e[i])}catch{}aR(s,e),Yn(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=ku(),{referrer:t}=st.document||{},{userAgent:n}=st.navigator||{},s={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:s}}function ub(e,t){const n=fb(e,t),s={type:L2(t),value:U2(t)};return n.length&&(s.stacktrace={frames:n}),s.type===void 0&&s.value===""&&(s.value="Unrecoverable error caught"),s}function I2(e,t,n,s){const a=vt()?.getOptions().normalizeDepth,l=q2(t),f={__serialized__:NR(t,a)};if(l)return{exception:{values:[ub(e,l)]},extra:f};const d={exception:{values:[{type:np(t)?t.constructor.name:s?"UnhandledRejection":"Error",value:F2(t,{isUnhandledRejection:s})}]},extra:f};if(n){const p=fb(e,n);p.length&&(d.exception.values[0].stacktrace={frames:p})}return d}function Zg(e,t){return{exception:{values:[ub(e,t)]}}}function fb(e,t){const n=t.stacktrace||t.stack||"",s=D2(t),i=z2(t);try{return e(n,s,i)}catch{}return[]}const P2=/Minified React error #\d+;/i;function D2(e){return e&&P2.test(e.message)?1:0}function z2(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function c1(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function L2(e){const t=e?.name;return!t&&c1(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function U2(e){const t=e?.message;return c1(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Kw(t.error):Kw(e):"No error message"}function $2(e,t,n,s){const i=n?.syntheticException||void 0,a=db(e,t,i,s);return Rc(a),a.level="error",n?.event_id&&(a.event_id=n.event_id),Lu(a)}function B2(e,t,n="info",s,i){const a=s?.syntheticException||void 0,l=sv(e,t,a,i);return l.level=n,s?.event_id&&(l.event_id=s.event_id),Lu(l)}function db(e,t,n,s,i){let a;if(sR(t)&&t.error)return Zg(e,t.error);if(dw(t)||BM(t)){const l=t;if("stack"in t)a=Zg(e,t);else{const f=l.name||(dw(l)?"DOMError":"DOMException"),d=l.message?`${f}: ${l.message}`:f;a=sv(e,d,n,s),Ky(a,d)}return"code"in l&&(a.tags={...a.tags,"DOMException.code":`${l.code}`}),a}return ep(t)?Zg(e,t):yu(t)||np(t)?(a=I2(e,t,n,i),Rc(a,{synthetic:!0}),a):(a=sv(e,t,n,s),Ky(a,`${t}`),Rc(a,{synthetic:!0}),a)}function sv(e,t,n,s){const i={};if(s&&n){const a=fb(e,n);a.length&&(i.exception={values:[{value:t,stacktrace:{frames:a}}]}),Rc(i,{synthetic:!0})}if(tp(t)){const{__sentry_template_string__:a,__sentry_template_values__:l}=t;return i.logentry={message:a,params:l},i}return i.message=t,i}function F2(e,{isUnhandledRejection:t}){const n=GM(e),s=t?"promise rejection":"exception";return sR(e)?`Event \`ErrorEvent\` captured as ${s} with message \`${e.message}\``:np(e)?`Event \`${H2(e)}\` (type=${e.type}) captured as ${s}`:`Object captured as ${s} with keys: ${n}`}function H2(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function q2(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class V2 extends yD{constructor(t){const n=K2(t),s=st.SENTRY_SDK_SOURCE||j2();JR(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:l,_experiments:f,enableMetrics:d}=this._options,p=d??f?.enableMetrics??!0;st.document&&(a||l||p)&&st.document.addEventListener("visibilitychange",()=>{st.document.visibilityState==="hidden"&&(a&&this._flushOutcomes(),l&&yh(this),p&&sb(this))}),i&&this.on("beforeSendSession",AD)}eventFromException(t,n){return $2(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",s){return B2(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 K2(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:st.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const Uu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ge=ct,G2=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",$u=(e,t,n,s)=>{let i,a;return l=>{t.value>=0&&(l||s)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=G2(t.value,n),e(t)))}},Bu=(e=!0)=>{const t=Ge.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Xc=()=>Bu()?.activationStart??0;function Zo(e,t,n){Ge.document&&Ge.addEventListener(e,t,n)}function bh(e,t,n){Ge.document&&Ge.removeEventListener(e,t,n)}let gc=-1;const l1=new Set,Z2=()=>Ge.document?.visibilityState==="hidden"&&!Ge.document?.prerendering?0:1/0,th=e=>{if(Y2(e)&&gc>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of l1)t();isFinite(gc)||(gc=e.type==="visibilitychange"?e.timeStamp:0,bh("prerenderingchange",th,!0))}},Fu=()=>{if(Ge.document&&gc<0){const e=Xc();gc=(Ge.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??Z2(),Zo("visibilitychange",th,!0),Zo("pagehide",th,!0),Zo("prerenderingchange",th,!0)}return{get firstHiddenTime(){return gc},onHidden(e){l1.add(e)}}};function Y2(e){return e.type==="pagehide"||Ge.document?.visibilityState==="hidden"}const X2=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Hu=(e,t=-1)=>{const n=Bu();let s="navigate";return n&&(Ge.document?.prerendering||Xc()>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:X2(),navigationType:s}},Yg=new WeakMap;function hb(e,t){try{return Yg.get(e)||Yg.set(e,new t),Yg.get(e)}catch{return new t}}class xh{constructor(){xh.prototype.__init.call(this),xh.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 Qc=(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{}},pb=e=>{let t=!1;return()=>{t||(e(),t=!0)}},op=e=>{Ge.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Q2=[1800,3e3],W2=(e,t={})=>{op(()=>{const n=Fu(),s=Hu("FCP");let i;const l=Qc("paint",f=>{for(const d of f)d.name==="first-contentful-paint"&&(l.disconnect(),d.startTime<n.firstHiddenTime&&(s.value=Math.max(d.startTime-Xc(),0),s.entries.push(d),i(!0)))});l&&(i=$u(e,s,Q2,t.reportAllChanges))})},J2=[.1,.25],ez=(e,t={})=>{W2(pb(()=>{const n=Hu("CLS",0);let s;const i=Fu(),a=hb(t,xh),l=d=>{for(const p of d)a._processEntry(p);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,s())},f=Qc("layout-shift",l);f&&(s=$u(e,n,J2,t.reportAllChanges),i.onHidden(()=>{l(f.takeRecords()),s(!0)}),Ge?.setTimeout?.(s))}))};let u1=0,Xg=1/0,wd=0;const tz=e=>{e.forEach(t=>{t.interactionId&&(Xg=Math.min(Xg,t.interactionId),wd=Math.max(wd,t.interactionId),u1=wd?(wd-Xg)/7+1:0)})};let ov;const f1=()=>ov?u1:performance.interactionCount||0,nz=()=>{"interactionCount"in performance||ov||(ov=Qc("event",tz,{type:"event",buffered:!0,durationThreshold:0}))},Qg=10;let d1=0;const rz=()=>f1()-d1;class Sh{constructor(){Sh.prototype.__init.call(this),Sh.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){d1=f1(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(rz()/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<Qg||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>Qg){const i=this._longestInteractionList.splice(Qg);for(const a of i)this._longestInteractionMap.delete(a.id)}this._onAfterProcessingINPCandidate?.(s)}}}const h1=e=>{const t=Ge.requestIdleCallback||Ge.setTimeout;Ge.document?.visibilityState==="hidden"?e():(e=pb(e),Zo("visibilitychange",e,{once:!0,capture:!0}),Zo("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),bh("visibilitychange",e,{capture:!0}),bh("pagehide",e,{capture:!0})}))},sz=[200,500],oz=40,iz=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Fu();op(()=>{nz();const s=Hu("INP");let i;const a=hb(t,Sh),l=d=>{h1(()=>{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=Qc("event",l,{durationThreshold:t.durationThreshold??oz});i=$u(e,s,sz,t.reportAllChanges),f&&(f.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{l(f.takeRecords()),i(!0)}))})};class az{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const cz=[2500,4e3],lz=(e,t={})=>{op(()=>{const n=Fu(),s=Hu("LCP");let i;const a=hb(t,az),l=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-Xc(),0),s.entries=[p],i())},f=Qc("largest-contentful-paint",l);if(f){i=$u(e,s,cz,t.reportAllChanges);const d=pb(()=>{l(f.takeRecords()),f.disconnect(),i(!0)}),p=g=>{g.isTrusted&&(h1(d),bh(g.type,p,{capture:!0}))};for(const g of["keydown","click","visibilitychange"])Zo(g,p,{capture:!0})}})},uz=[800,1800],iv=e=>{Ge.document?.prerendering?op(()=>iv(e)):Ge.document?.readyState!=="complete"?addEventListener("load",()=>iv(e),!0):setTimeout(e)},fz=(e,t={})=>{const n=Hu("TTFB"),s=$u(e,n,uz,t.reportAllChanges);iv(()=>{const i=Bu();i&&(n.value=Math.max(i.responseStart-Xc(),0),n.entries=[i],s(!0))})},uu={},_h={};let p1,m1,g1,y1;function v1(e,t=!1){return ip("cls",e,pz,p1,t)}function b1(e,t=!1){return ip("lcp",e,mz,m1,t)}function dz(e){return ip("ttfb",e,gz,g1)}function hz(e){return ip("inp",e,yz,y1)}function Mc(e,t){return x1(e,t),_h[e]||(vz(e),_h[e]=!0),S1(e,t)}function qu(e,t){const n=uu[e];if(n?.length)for(const s of n)try{s(t)}catch(i){Uu&&be.error(`Error while triggering instrumentation handler.
9
+ `)}`)}function uP(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >"}=yt(e),{spanId:s}=e.spanContext(),a=Dn(e)===e,l=`[Tracing] Finishing "${n}" ${a?"root ":""}span "${t}" with ID ${s}`;be.log(l)}function fP(e,t,n,s=Xn()){const i=s&&Dn(s);i&&(Ce&&be.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[Lu]:t,[zu]:n}))}function Nw(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const s=n.attributes||{},i=s[zu],a=s[Lu];typeof i=="string"&&typeof a=="number"&&(t[n.name]={value:a,unit:i})}),t}const jw=1e3;class sp{constructor(t={}){this._traceId=t.traceId||Ws(),this._spanId=t.spanId||Zs(),this._startTime=t.startTimestamp||cn(),this._links=t.links,this._attributes={},this.setAttributes({[gn]:"manual",[eo]: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?Jv: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=Ji(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(vs,"custom"),this}end(t){this._endTime||(this._endTime=Ji(t),uP(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[eo],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[gn],profile_id:this._attributes[Xv],exclusive_time:this._attributes[Kc],measurements:Nw(this._events),is_segment:this._isStandaloneSpan&&Dn(this)===this||void 0,segment_id:this._isStandaloneSpan?Dn(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||cn(),a=Aw(n)?{}:n||{},l={name:t,time:Ji(i),attributes:a};return this._events.push(l),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=vt();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===Dn(this)))return;if(this._isStandaloneSpan){this._sampled?hP(cP([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&&(mh(this).scope||bt()).captureEvent(s)}_convertSpanToTransaction(){if(!kw(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}=mh(this),s=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const a=Qd(this).filter(g=>g!==this&&!dP(g)).map(g=>yt(g)).filter(kw),l=this._attributes[vs];delete this._attributes[Sw],a.forEach(g=>{delete g.data[Sw]});const f={contexts:{trace:zI(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:to(this)},request:s,...l&&{transaction_info:{source:l}}},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 kw(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function dP(e){return e instanceof sp&&e.isStandaloneSpan()}function hP(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 pP(e,t,n=()=>{},s=()=>{}){let i;try{i=e()}catch(a){throw t(a),n(),a}return mP(i,t,n,s)}function mP(e,t,n,s){return qc(e)?e.then(i=>(n(),s(i),i),i=>{throw t(i),n(),i}):(n(),s(e),e)}function gP(e,t,n){if(!ss(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=bu(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 l=n<a;return l||Ce&&be.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[l,a,s]}const MR="__SENTRY_SUPPRESS_TRACING__";function IR(e,t){const n=rb();if(n.startSpan)return n.startSpan(e,t);const s=DR(e),{forceTransaction:i,parentSpan:a,scope:l}=e,f=l?.clone();return Du(f,()=>vP(a)(()=>{const p=bt(),g=zR(p,a),b=e.onlyIfParent&&!g?new ei:PR({parentSpan:g,spanArguments:s,forceTransaction:i,scope:p});return jc(p,b),pP(()=>t(b),()=>{const{status:x}=yt(b);b.isRecording()&&(!x||x==="ok")&&b.setStatus({code:hn,message:"internal_error"})},()=>{b.end()})}))}function Zc(e){const t=rb();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=DR(e),{forceTransaction:s,parentSpan:i}=e;return(e.scope?l=>Du(e.scope,l):i!==void 0?l=>nb(i,l):l=>l())(()=>{const l=bt(),f=zR(l,i);return e.onlyIfParent&&!f?new ei:PR({parentSpan:f,spanArguments:n,forceTransaction:s,scope:l})})}function nb(e,t){const n=rb();return n.withActiveSpan?n.withActiveSpan(e,t):Du(s=>(jc(s,e||void 0),t(s)))}function PR({parentSpan:e,spanArguments:t,forceTransaction:n,scope:s}){if(!ss()){const l=new ei;if(n||!e){const f={sampled:"false",sample_rate:"0",transaction:t.name,...to(l)};Wd(l,f)}return l}const i=Zr();let a;if(e&&!n)a=yP(e,s,t),NR(e,a);else if(e){const l=to(e),{traceId:f,spanId:d}=e.spanContext(),p=ui(e);a=Ow({traceId:f,parentSpanId:d,...t},s,p),Wd(a,l)}else{const{traceId:l,dsc:f,parentSpanId:d,sampled:p}={...i.getPropagationContext(),...s.getPropagationContext()};a=Ow({traceId:l,parentSpanId:d,...t},s,p),f&&Wd(a,f)}return lP(a),xI(a,s,i),a}function DR(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const s={...n};return s.startTimestamp=Ji(e.startTime),delete s.startTime,s}return n}function rb(){const e=da();return Vc(e)}function Ow(e,t,n){const s=vt(),i=s?.getOptions()||{},{name:a=""}=e,l={spanAttributes:{...e.attributes},spanName:a,parentSampled:n};s?.emit("beforeSampling",l,{decision:!1});const f=l.parentSampled??n,d=l.spanAttributes,p=t.getPropagationContext(),[g,y,b]=t.getScopeData().sdkProcessingMetadata[MR]?[!1]:gP(i,{name:a,parentSampled:f,attributes:d,parentSampleRate:bu(p.dsc?.sample_rate)},p.sampleRand),x=new sp({...e,attributes:{[vs]:"custom",[Yv]: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 yP(e,t,n){const{spanId:s,traceId:i}=e.spanContext(),a=t.getScopeData().sdkProcessingMetadata[MR]?!1:ui(e),l=a?new sp({...n,parentSpanId:s,traceId:i,sampled:a}):new ei({traceId:i});NR(e,l);const f=vt();return f&&(f.emit("spanStart",l),n.endTimestamp&&f.emit("spanEnd",l)),l}function zR(e,t){if(t)return t;if(t===null)return;const n=Ac(e);if(!n)return;const s=vt();return(s?s.getOptions():{}).parentSpanIsAlwaysRootSpan?Dn(n):n}function vP(e){return e!==void 0?t=>nb(e,t):t=>t()}const Jd={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},bP="heartbeatFailed",xP="idleTimeout",SP="finalTimeout",_P="externalFinish";function LR(e,t={}){const n=new Map;let s=!1,i,a=_P,l=!t.disableAutoFinish;const f=[],{idleTimeout:d=Jd.idleTimeout,finalTimeout:p=Jd.finalTimeout,childSpanTimeout:g=Jd.childSpanTimeout,beforeSpanEnd:y,trimIdleSpanEndTimestamp:b=!0}=t,x=vt();if(!x||!ss()){const j=new ei,A={sample_rate:"0",sampled:"false",...to(j)};return Wd(j,A),j}const S=bt(),w=Xn(),T=wP(e);T.end=new Proxy(T.end,{apply(j,A,P){if(y&&y(T),A instanceof ei)return;const[G,...B]=P,z=G||cn(),Q=Ji(z),Y=Qd(T).filter(U=>U!==T),ee=yt(T);if(!Y.length||!b)return L(Q),Reflect.apply(j,A,[Q,...B]);const D=x.getOptions().ignoreSpans,K=Y?.reduce((U,I)=>{const H=yt(I);return!H.timestamp||D&&gh(H,D)?U:U?Math.max(U,H.timestamp):H.timestamp},void 0),q=ee.start_timestamp,V=Math.min(q?q+p/1e3:1/0,Math.max(q||-1/0,Math.min(Q,K||1/0)));return L(V),Reflect.apply(j,A,[V,...B])}});function C(){i&&(clearTimeout(i),i=void 0)}function k(j){C(),i=setTimeout(()=>{!s&&n.size===0&&l&&(a=xP,T.end(j))},d)}function N(j){i=setTimeout(()=>{!s&&l&&(a=bP,T.end(j))},g)}function R(j){C(),n.set(j,!0);const A=cn();N(A+g/1e3)}function M(j){if(n.has(j)&&n.delete(j),n.size===0){const A=cn();k(A+d/1e3)}}function L(j){s=!0,n.clear(),f.forEach(Y=>Y()),jc(S,w);const A=yt(T),{start_timestamp:P}=A;if(!P)return;A.data[vu]||T.setAttribute(vu,a);const B=A.status;(!B||B==="unknown")&&T.setStatus({code:Qv}),be.log(`[Tracing] Idle span "${A.op}" finished`);const z=Qd(T).filter(Y=>Y!==T);let Q=0;z.forEach(Y=>{Y.isRecording()&&(Y.setStatus({code:hn,message:"cancelled"}),Y.end(j),Ce&&be.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Y,void 0,2)));const ee=yt(Y),{timestamp:D=0,start_timestamp:K=0}=ee,q=K<=j,V=(p+d)/1e3,U=D-K<=V;if(Ce){const I=JSON.stringify(Y,void 0,2);q?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||!q)&&(FI(T,Y),Q++)}),Q>0&&T.setAttribute("sentry.idle_span_discarded_spans",Q)}return f.push(x.on("spanStart",j=>{if(s||j===T||yt(j).timestamp||j instanceof sp&&j.isStandaloneSpan())return;Qd(T).includes(j)&&R(j.spanContext().spanId)})),f.push(x.on("spanEnd",j=>{s||M(j.spanContext().spanId)})),f.push(x.on("idleSpanEnableAutoFinish",j=>{j===T&&(l=!0,k(),n.size&&N())})),t.disableAutoFinish||k(),setTimeout(()=>{s||(T.setStatus({code:hn,message:"deadline_exceeded"}),a=SP,T.end())},p),T}function wP(e){const t=Zc(e);return jc(bt(),t),Ce&&be.log("[Tracing] Started span is an idle span"),t}const Kg=0,Mw=1,Iw=2;function Uu(e){return new xu(t=>{t(e)})}function sb(e){return new xu((t,n)=>{n(e)})}class xu{constructor(t){this._state=Kg,this._handlers=[],this._runExecutor(t)}then(t,n){return new xu((s,i)=>{this._handlers.push([!1,a=>{if(!t)s(a);else try{s(t(a))}catch(l){i(l)}},a=>{if(!n)i(a);else try{s(n(a))}catch(l){i(l)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new xu((n,s)=>{let i,a;return this.then(l=>{a=!1,i=l,t&&t()},l=>{a=!0,i=l,t&&t()}).then(()=>{if(a){s(i);return}n(i)})})}_executeHandlers(){if(this._state===Kg)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Mw&&n[1](this._value),this._state===Iw&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(a,l)=>{if(this._state===Kg){if(qc(l)){l.then(s,i);return}this._state=a,this._value=l,this._executeHandlers()}},s=a=>{n(Mw,a)},i=a=>{n(Iw,a)};try{t(s,i)}catch(a){i(a)}}}function EP(e,t,n,s=0){try{const i=ev(t,n,e,s);return qc(i)?i:Uu(i)}catch(i){return sb(i)}}function ev(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`),qc(a)?a.then(l=>ev(l,t,n,s+1)):ev(a,t,n,s+1)}let Bi,Pw,Dw,zo;function TP(e){const t=ct._sentryDebugIds,n=ct._debugIds;if(!t&&!n)return{};const s=t?Object.keys(t):[],i=n?Object.keys(n):[];if(zo&&s.length===Pw&&i.length===Dw)return zo;Pw=s.length,Dw=i.length,zo={},Bi||(Bi={});const a=(l,f)=>{for(const d of l){const p=f[d],g=Bi?.[d];if(g&&zo&&p)zo[g[0]]=p,Bi&&(Bi[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&&zo&&Bi){zo[S]=p,Bi[d]=[S,p];break}}}}};return t&&a(s,t),n&&a(i,n),zo}function CP(e,t){const{fingerprint:n,span:s,breadcrumbs:i,sdkProcessingMetadata:a}=t;RP(e,t),s&&AP(e,s),kP(e,n),NP(e,i),jP(e,a)}function zw(e,t){const{extra:n,tags:s,attributes:i,user:a,contexts:l,level:f,sdkProcessingMetadata:d,breadcrumbs:p,fingerprint:g,eventProcessors:y,attachments:b,propagationContext:x,transactionName:S,span:w}=t;Wl(e,"extra",n),Wl(e,"tags",s),Wl(e,"attributes",i),Wl(e,"user",a),Wl(e,"contexts",l),e.sdkProcessingMetadata=Pu(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 Wl(e,t,n){e[t]=Pu(e[t],n,1)}function op(e,t){const n=hI().getScopeData();return e&&zw(n,e.getScopeData()),t&&zw(n,t.getScopeData()),n}function RP(e,t){const{extra:n,tags:s,user:i,contexts:a,level:l,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}),l&&(e.level=l),f&&e.type!=="transaction"&&(e.transaction=f)}function NP(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function jP(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function AP(e,t){e.contexts={trace:TR(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:to(t),...e.sdkProcessingMetadata};const n=Dn(t),s=yt(n).description;s&&!e.transaction&&e.type==="transaction"&&(e.transaction=s)}function kP(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 OP(e,t,n,s,i,a){const{normalizeDepth:l=3,normalizeMaxBreadth:f=1e3}=e,d={...t,event_id:t.event_id||n.event_id||qr(),timestamp:t.timestamp||pa()},p=n.integrations||e.integrations.map(C=>C.name);MP(d,e),DP(d,p),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&IP(d,e.stackParser);const g=LP(s,n.captureContext);n.mechanism&&Rc(d,n.mechanism);const y=i?i.getEventProcessors():[],b=op(a,g),x=[...n.attachments||[],...b.attachments];x.length&&(n.attachments=x),CP(d,b);const S=[...y,...b.eventProcessors];return(n.data&&n.data.__sentry__===!0?Uu(d):EP(S,d,n)).then(C=>(C&&PP(C),typeof l=="number"&&l>0?zP(C,l,f):C))}function MP(e,t){const{environment:n,release:s,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||eb,!e.release&&s&&(e.release=s),!e.dist&&i&&(e.dist=i);const l=e.request;l?.url&&a&&(l.url=Ky(l.url,a)),a&&e.exception?.values?.forEach(f=>{f.value&&(f.value=Ky(f.value,a))})}function IP(e,t){const n=TP(t);e.exception?.values?.forEach(s=>{s.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=n[i.filename])})})}function PP(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 DP(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function zP(e,t,n){if(!e)return null;const s={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:Vs(i.data,t,n)}}))},...e.user&&{user:Vs(e.user,t,n)},...e.contexts&&{contexts:Vs(e.contexts,t,n)},...e.extra&&{extra:Vs(e.extra,t,n)}};return e.contexts?.trace&&s.contexts&&(s.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(s.contexts.trace.data=Vs(e.contexts.trace.data,t,n))),e.spans&&(s.spans=e.spans.map(i=>({...i,...i.data&&{data:Vs(i.data,t,n)}}))),e.contexts?.flags&&s.contexts&&(s.contexts.flags=Vs(e.contexts.flags,3,n)),s}function LP(e,t){if(!t)return e;const n=e?e.clone():new Js;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 UP(e,t){Zr().setContext(e,t)}function $P(){const e=vt();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Lw(e){const t=Zr(),{user:n}=op(t,bt()),{userAgent:s}=ct.navigator||{},i=rI({user:n,...s&&{userAgent:s},...e}),a=t.getSession();return a?.status==="ok"&&Nc(a,{status:"exited"}),BR(),t.setSession(i),i}function BR(){const e=Zr(),n=bt().getSession()||e.getSession();n&&sI(n),FR(),e.setSession()}function FR(){const e=Zr(),t=vt(),n=e.getSession();n&&t&&t.captureSession(n)}function Gg(e=!1){if(e){BR();return}FR()}const BP="7";function FP(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function HP(e){return`${FP(e)}${e.projectId}/envelope/`}function qP(e,t){const n={sentry_version:BP};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function VP(e,t,n){return t||`${HP(e)}?${qP(e,n)}`}const Uw=[];function KP(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 GP(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 KP(s)}function ZP(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,l)=>s(a,l,e),{id:t.name});e.addEventProcessor(i)}Ce&&be.log(`Integration installed: ${t.name}`)}function YP(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function XP(e,t){const{value:n,unit:s}=YP(e)?e:{value:e,unit:void 0},i=QP(n),a=s&&typeof s=="string"?{unit:s}:{};if(i)return{...i,...a};if(!t||t==="skip-undefined"&&n===void 0)return;let l="";try{l=JSON.stringify(n)??""}catch{}return{value:l,type:"string",...a}}function yh(e,t=!1){const n={};for(const[s,i]of Object.entries(e??{})){const a=XP(i,t);a&&(n[s]=a)}return n}function QP(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?Du(t,()=>{const n=Xn(),s=n?TR(n):pR(t);return[n?to(n):tb(e,t),s]}):[void 0,void 0]}const WP={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function JP(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function eD(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Gc(s)),ma(i,[JP(e)])}const tD=100;function ps(e,t,n,s=!0){n&&(!e[t]||s)&&(e[t]=n)}function nD(e,t){const n=ob(),s=VR(e);s===void 0?n.set(e,[t]):s.length>=tD?(vh(e,s),n.set(e,[t])):n.set(e,[...s,t])}function rD(e,t=bt(),n=nD){const s=t?.getClient()??vt();if(!s){Ce&&be.warn("No client available to capture log.");return}const{release:i,environment:a,enableLogs:l=!1,beforeSendLog:f}=s.getOptions();if(!l){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={}}=op(Zr(),t);ps(p,"user.id",g,!1),ps(p,"user.email",y,!1),ps(p,"user.name",b,!1),ps(p,"sentry.release",i),ps(p,"sentry.environment",a);const{name:S,version:w}=s.getSdkMetadata()?.sdk??{};ps(p,"sentry.sdk.name",S),ps(p,"sentry.sdk.version",w);const T=s.getIntegrationByName("Replay"),C=T?.getReplayId(!0);ps(p,"sentry.replay_id",C),C&&T?.getRecordingMode()==="buffer"&&ps(p,"sentry._internal.replay_is_buffering",!0);const k=e.message;if(np(k)){const{__sentry_template_string__:B,__sentry_template_values__:z=[]}=k;z?.length&&(p["sentry.message.template"]=B),z.forEach((Q,Y)=>{p[`sentry.message.parameter.${Y}`]=Q})}const N=Ac(t);ps(p,"sentry.trace.parent_span_id",N?.spanContext().spanId);const R={...e,attributes:p};s.emit("beforeCaptureLog",R);const M=f?ha(()=>f(R)):R;if(!M){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:A={},severityNumber:P}=M,G={timestamp:cn(),level:L,body:j,trace_id:d?.trace_id,severity_number:P??WP[L],attributes:{...yh(x),...yh(A,!0)}};n(s,G),s.emit("afterCaptureLog",M)}function vh(e,t){const n=t??VR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=eD(n,s._metadata,s.tunnel,e.getDsn());ob().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function VR(e){return ob().get(e)}function ob(){return Fc("clientToLogBufferMap",()=>new WeakMap)}function sD(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function oD(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Gc(s)),ma(i,[sD(e)])}const iD=1e3;function Fs(e,t,n,s=!0){n&&(s||!(t in e))&&(e[t]=n)}function aD(e,t){const n=ab(),s=KR(e);s===void 0?n.set(e,[t]):s.length>=iD?(ib(e,s),n.set(e,[t])):n.set(e,[...s,t])}function cD(e,t,n){const{release:s,environment:i}=t.getOptions(),a={...e.attributes};Fs(a,"user.id",n.id,!1),Fs(a,"user.email",n.email,!1),Fs(a,"user.name",n.username,!1),Fs(a,"sentry.release",s),Fs(a,"sentry.environment",i);const{name:l,version:f}=t.getSdkMetadata()?.sdk??{};Fs(a,"sentry.sdk.name",l),Fs(a,"sentry.sdk.version",f);const d=t.getIntegrationByName("Replay"),p=d?.getReplayId(!0);return Fs(a,"sentry.replay_id",p),p&&d?.getRecordingMode()==="buffer"&&Fs(a,"sentry._internal.replay_is_buffering",!0),{...e,attributes:a}}function lD(e,t,n,s){const[,i]=qR(t,n),a=Ac(n),l=a?a.spanContext().traceId:i?.trace_id,f=a?a.spanContext().spanId:void 0;return{timestamp:cn(),trace_id:l??"",span_id:f,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...yh(s),...yh(e.attributes,"skip-undefined")}}}function uD(e,t){const n=t?.scope??bt(),s=t?.captureSerializedMetric??aD,i=n?.getClient()??vt();if(!i){Ce&&be.warn("No client available to capture metric.");return}const{_experiments:a,enableMetrics:l,beforeSendMetric:f}=i.getOptions();if(!(l??a?.enableMetrics??!0)){Ce&&be.warn("metrics option not enabled, metric will not be captured.");return}const{user:p,attributes:g}=op(Zr(),n),y=cD(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=lD(x,i,n,g);Ce&&be.log("[Metric]",S),s(i,S),i.emit("afterCaptureMetric",x)}function ib(e,t){const n=t??KR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=oD(n,s._metadata,s.tunnel,e.getDsn());ab().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function KR(e){return ab().get(e)}function ab(){return Fc("clientToMetricBufferMap",()=>new WeakMap)}function GR(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const cb=Symbol.for("SentryBufferFullError");function lb(e=100){const t=new Set;function n(){return t.size<e}function s(l){t.delete(l)}function i(l){if(!n())return sb(cb);const f=l();return t.add(f),f.then(()=>s(f),()=>s(f)),f}function a(l){if(!t.size)return Uu(!0);const f=Promise.allSettled(Array.from(t)).then(()=>!0);if(!l)return f;const d=[f,new Promise(p=>GR(setTimeout(()=>p(!1),l)))];return Promise.race(d)}return{get $(){return Array.from(t)},add:i,drain:a}}const fD=60*1e3;function dD(e,t=Iu()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const s=Date.parse(`${e}`);return isNaN(s)?fD:s-t}function hD(e,t){return e[t]||e.all||0}function pD(e,t,n=Iu()){return hD(e,t)>n}function mD(e,{statusCode:t,headers:n},s=Iu()){const i={...e},a=n?.["x-sentry-rate-limits"],l=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 l?i.all=s+dD(l,s):t===429&&(i.all=s+60*1e3);return i}const ZR=64;function gD(e,t,n=lb(e.bufferSize||ZR)){let s={};const i=l=>n.drain(l);function a(l){const f=[];if(Wy(l,(y,b)=>{const x=Rw(b);pD(s,x)?e.recordDroppedEvent("ratelimit_backoff",x):f.push(y)}),f.length===0)return Promise.resolve({});const d=ma(l[0],f),p=y=>{if(WI(d,["client_report"])){Ce&&be.warn(`Dropping client report. Will not send outcomes (reason: ${y}).`);return}Wy(d,(b,x)=>{e.recordDroppedEvent(y,Rw(x))})},g=()=>t({body:JI(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=mD(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===cb)return Ce&&be.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw y})}return{send:a,flush:i}}function yD(e,t,n){const s=[{type:"client_report"},{timestamp:pa(),discarded_events:e}];return ma(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 vD(e){const{trace_id:t,parent_span_id:n,span_id:s,status:i,origin:a,data:l,op:f}=e.contexts?.trace??{};return{data:l??{},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:l?.[Xv],exclusive_time:l?.[Kc],measurements:e.measurements,is_segment:!0}}function bD(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&&{[Xv]:e.profile_id},...e.exclusive_time&&{[Kc]: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"),xD=5e3;function eh(e){return{message:e,[XR]:!0}}function Zg(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,l,f=!1;e.on(n,()=>{a=0,clearTimeout(l),f=!1}),e.on(t,d=>{a+=s(d),a>=8e5?i(e):f||(f=!0,l=GR(setTimeout(()=>{i(e)},xD)))}),e.on("flush",()=>{i(e)})}class SD{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=lb(t.transportOptions?.bufferSize??ZR),t.dsn?this._dsn=MI(t.dsn):Ce&&be.warn("No DSN provided, client will not send events."),this._dsn){const s=VP(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",TD,vh),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Vw(this,"afterCaptureMetric","flushMetrics",ED,ib)}captureException(t,n,s){const i=qr();if(vw(t))return Ce&&be.log(Bw),i;const a={event_id:i,...n};return this._process(()=>this.eventFromException(t,a).then(l=>this._captureEvent(l,a,s)).then(l=>l),"error"),a.event_id}captureMessage(t,n,s,i){const a={event_id:qr(),...s},l=np(t)?t:String(t),f=Cc(t),d=f?this.eventFromMessage(l,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=qr();if(n?.originalException&&vw(n.originalException))return Ce&&be.log(Bw),i;const a={event_id:i,...n},l=t.sdkProcessingMetadata||{},f=l.capturedSpanScope,d=l.capturedSpanIsolationScope,p=Kw(t.type);return this._process(()=>this._captureEvent(t,a,f||s,d),p),a.event_id}captureSession(t){this.sendSession(t),Nc(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){vh(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=aP(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])s=QI(s,nP(i));this.sendEnvelope(s).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){const{release:n,environment:s=eb}=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=iP(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=ZP(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 l=t.status==="ok";(l&&t.errors===0||l&&s)&&(Nc(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(),l=Object.keys(this._integrations);return!n.integrations&&l?.length&&(n.integrations=l),this.emit("preprocessEvent",t,n),t.type||i.setLastEventId(t.event_id||n.event_id),OP(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=tb(this,s);return f.sdkProcessingMetadata={dynamicSamplingContext:d,...f.sdkProcessingMetadata},f})}_captureEvent(t,n={},s=bt(),i=Zr()){return Ce&&tv(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:l}=a,f=WR(t),d=tv(t),g=`before send for type \`${t.type||"error"}\``,y=typeof l>"u"?void 0:bu(l);if(d&&typeof y=="number"&&Vo()>y)return this.recordDroppedEvent("sample_rate","error"),sb(Zg(`Discarding event because it's not included in the random sample (sampling rate = ${l})`));const b=Kw(t.type);return this._prepareEvent(t,n,s,i).then(x=>{if(x===null)throw this.recordDroppedEvent("event_processor",b),Zg("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return x;const w=wD(this,a,x,n);return _D(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 Zg(`${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,k=T-C;k>0&&this.recordDroppedEvent("before_send","span",k)}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}),eh(`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===cb&&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=yD(t,this._options.tunnel&&Gc(this._dsn));this.sendEnvelope(n)}}function Kw(e){return e==="replay_event"?"replay":e||"error"}function _D(e,t){const n=`${t} must return \`null\` or a valid event.`;if(qc(e))return e.then(s=>{if(!yu(s)&&s!==null)throw eh(n);return s},s=>{throw eh(`${t} rejected with ${s}`)});if(!yu(e)&&e!==null)throw eh(n);return e}function wD(e,t,n,s){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:l,ignoreSpans:f}=t;let d=n;if(tv(d)&&i)return i(d,s);if(WR(d)){if(l||f){const p=vD(d);if(f?.length&&gh(p,f))return null;if(l){const g=l(p);g?d=Pu(n,bD(g)):Xy()}if(d.spans){const g=[],y=d.spans;for(const x of y){if(f?.length&&gh(x,f)){qI(y,x);continue}if(l){const S=l(x);S?g.push(S):(Xy(),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 tv(e){return e.type===void 0}function WR(e){return e.type==="transaction"}function ED(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+JR(e.attributes)}function TD(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]):Cc(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 CD(e){return tp(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Zw(e){return CD(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function RD(e,t){t.debug===!0&&(Ce?be.enable():ha(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),bt().update(t.initialScope);const s=new e(t);return ND(s),s.init(),s}function ND(e){bt().setClient(e)}const jD="thismessage:/";function e1(e){return"isRelative"in e}function t1(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,s=n?jD: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 AD(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 ta(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 kD(e){return e.split(/[?#]/,1)[0]}function Go(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 l="";if(t&&a!==-1){const f=e.slice(a+1);l=f.length>10?`${f.slice(0,10)}... [truncated]`:f}return`data:${s}${i?",base64":""}${l?`,${l}`:""}`}return e}function OD(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 MD=OD;function ID(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:Wi})),i.version=Wi)}function r1(e={}){const t=e.client||vt();if(!$P()||!t)return{};const n=da(),s=Vc(n);if(s.getTraceData)return s.getTraceData(e);const i=e.scope||bt(),a=e.span||Xn(),l=a?LI(a):PD(i),f=a?to(a):tb(t,i),d=wI(f);if(!SR.test(l))return be.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const g={"sentry-trace":l,baggage:d};return e.propagateTraceparent&&(g.traceparent=a?UI(a):DD(i)),g}function PD(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return _R(t,s,n)}function DD(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return wR(t,s,n)}const zD=100;function oa(e,t){const n=vt(),s=Zr();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=zD}=n.getOptions();if(a<=0)return;const f={timestamp:pa(),...e},d=i?ha(()=>i(f,t)):f;d!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",d,t),s.addBreadcrumb(d,a))}let Yw;const LD="FunctionToString",Xw=new WeakMap,UD=(()=>({name:LD,setupOnce(){Yw=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Zv(this),n=Xw.has(vt())&&t!==void 0?t:this;return Yw.apply(n,e)}}catch{}},setup(e){Xw.set(e,!0)}})),$D=UD,BD=[/^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$/],FD="EventFilters",HD=(e={})=>{let t;return{name:FD,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 VD(n,t)?null:n}}},qD=((e={})=>({...HD(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?[]:BD],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function VD(e,t){if(e.type){if(e.type==="transaction"&&GD(e,t.ignoreTransactions))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
11
+ Event: ${Ki(e)}`),!0}else{if(KD(e,t.ignoreErrors))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
12
+ Event: ${Ki(e)}`),!0;if(QD(e))return Ce&&be.warn(`Event dropped due to not having an error message, error type or stacktrace.
13
+ Event: ${Ki(e)}`),!0;if(ZD(e,t.denyUrls))return Ce&&be.warn(`Event dropped due to being matched by \`denyUrls\` option.
14
+ Event: ${Ki(e)}.
15
+ Url: ${bh(e)}`),!0;if(!YD(e,t.allowUrls))return Ce&&be.warn(`Event dropped due to not being matched by \`allowUrls\` option.
16
+ Event: ${Ki(e)}.
17
+ Url: ${bh(e)}`),!0}return!1}function KD(e,t){return t?.length?YR(e).some(n=>Ko(n,t)):!1}function GD(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Ko(n,t):!1}function ZD(e,t){if(!t?.length)return!1;const n=bh(e);return n?Ko(n,t):!1}function YD(e,t){if(!t?.length)return!0;const n=bh(e);return n?Ko(n,t):!0}function XD(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 bh(e){try{const n=[...e.exception?.values??[]].reverse().find(s=>s.mechanism?.parent_id===void 0&&s.stacktrace?.frames?.length)?.stacktrace?.frames;return n?XD(n):null}catch{return Ce&&be.error(`Cannot extract url for event ${Ki(e)}`),null}}function QD(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function WD(e,t,n,s,i,a){if(!i.exception?.values||!a||!Qs(a.originalException,Error))return;const l=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;l&&(i.exception.values=nv(e,t,s,a.originalException,n,i.exception.values,l,0))}function nv(e,t,n,s,i,a,l,f){if(a.length>=n+1)return a;let d=[...a];if(Qs(s[i],Error)){Ww(l,f,s);const p=e(t,s[i]),g=d.length;Jw(p,i,g,f),d=nv(e,t,n,s[i],i,[p,...d],p,g)}return s1(s)&&s.errors.forEach((p,g)=>{if(Qs(p,Error)){Ww(l,f,s);const y=e(t,p),b=d.length;Jw(y,`errors[${g}]`,b,f),d=nv(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 JD(e){const t="console";ci(t,e),li(t,e2)}function e2(){"console"in ct&&IM.forEach(function(e){e in ct.console&&gr(ct.console,e,function(t){return ph[e]=t,function(...n){Hr("console",{args:n,level:e}),ph[e]?.apply(ct.console,n)}})})}function t2(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const n2="Dedupe",r2=(()=>{let e;return{name:n2,processEvent(t){if(t.type)return t;try{if(o2(t,e))return Ce&&be.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),s2=r2;function o2(e,t){return t?!!(i2(e,t)||a2(e,t)):!1}function i2(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 a2(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],l=n[i];if(a.filename!==l.filename||a.lineno!==l.lineno||a.colno!==l.colno||a.function!==l.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 c2="ConversationId",l2=(()=>({name:c2,setup(e){e.on("spanStart",t=>{const n=bt().getScopeData(),s=Zr().getScopeData(),i=n.conversationId||s.conversationId;i&&t.setAttribute(mI,i)})}})),u2=l2;function f2(e,t,n,s,i){if(!e.fetchData)return;const{method:a,url:l}=e.fetchData,f=ss()&&t(l);if(e.endTimestamp){const x=e.fetchData.__span;if(!x)return;const S=s[x];S&&(f&&(p2(S,e),d2(S,e,i)),delete s[x]);return}const{spanOrigin:d="auto.http.browser",propagateTraceparent:p=!1}=typeof i=="object"?i:{spanOrigin:i},g=!!Xn(),y=f&&g?Zc(g2(l,a,d)):new ei;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=h2(x,S,ss()&&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 d2(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function h2(e,t,n,s){const i=r1({span:n,propagateTraceparent:s}),a=i["sentry-trace"],l=i.baggage,f=i.traceparent;if(!a)return;const d=t.headers||(Kv(e)?e.headers:void 0);if(d)if(m2(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),l){const g=p.get("baggage");g?wd(g)||p.set("baggage",`${g},${l}`):p.set("baggage",l)}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"&&wd(y[1]));return l&&!g&&p.push(["baggage",l]),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=>wd(w)):wd(y));l&&!x&&b.push(l);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 p2(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:hn,message:"internal_error"});e.end()}function wd(e){return e.split(",").some(t=>t.trim().startsWith(Wv))}function m2(e){return typeof Headers<"u"&&Qs(e,Headers)}function g2(e,t,n){if(e.startsWith("data:")){const a=Go(e);return{name:`${t} ${a}`,attributes:tE(e,void 0,t,n)}}const s=t1(e),i=s?AD(s):e;return{name:`${t} ${i}`,attributes:tE(e,s,t,n)}}function tE(e,t,n,s){const i={url:Go(e),type:"fetch","http.method":n,[gn]:s,[eo]:"http.client"};return t&&(e1(t)||(i["http.url"]=Go(t.href),i["server.address"]=t.host),t.search&&(i["http.query"]=t.search),t.hash&&(i["http.fragment"]=t.hash)),i}function Yc(e,t,n,s,i){rD({level:e,message:t,attributes:n,severityNumber:i},s)}function y2(e,t,{scope:n}={}){Yc("trace",e,t,n)}function v2(e,t,{scope:n}={}){Yc("debug",e,t,n)}function b2(e,t,{scope:n}={}){Yc("info",e,t,n)}function x2(e,t,{scope:n}={}){Yc("warn",e,t,n)}function S2(e,t,{scope:n}={}){Yc("error",e,t,n)}function _2(e,t,{scope:n}={}){Yc("fatal",e,t,n)}const w2=Object.freeze(Object.defineProperty({__proto__:null,debug:v2,error:S2,fatal:_2,fmt:MD,info:b2,trace:y2,warn:x2},Symbol.toStringTag,{value:"Module"}));function ub(e,t,n,s){uD({type:e,name:t,value:n,unit:s?.unit,attributes:s?.attributes},{scope:s?.scope})}function nE(e,t=1,n){ub("counter",e,t,n)}function rE(e,t,n){ub("gauge",e,t,n)}function sE(e,t,n){ub("distribution",e,t,n)}function a1(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Su=ct;function E2(){return"history"in Su&&!!Su.history}function T2(){if(!("fetch"in Su))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function rv(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function C2(){if(typeof EdgeRuntime=="string")return!0;if(!T2())return!1;if(rv(Su.fetch))return!0;let e=!1;const t=Su.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=rv(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 c1(e,t){const n="fetch";ci(n,e),li(n,()=>l1(void 0,t))}function R2(e){const t="fetch-body-resolved";ci(t,e),li(t,()=>l1(j2))}function l1(e,t=!1){t&&!C2()||gr(ct,"fetch",function(n){return function(...s){const i=new Error,{method:a,url:l}=A2(s),f={args:s,fetchData:{method:a,url:l},startTimestamp:cn()*1e3,virtualError:i,headers:k2(s)};return e||Hr("fetch",{...f}),n.apply(ct,s).then(async d=>(e?e(d):Hr("fetch",{...f,endTimestamp:cn()*1e3,response:d}),d),d=>{Hr("fetch",{...f,endTimestamp:cn()*1e3,error:d}),tp(d)&&d.stack===void 0&&(d.stack=i.stack,Yn(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})`:Yn(d,"__sentry_fetch_url_host__",x)}catch{}throw d})}})}async function N2(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 l;try{l=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:f}=await s.read();clearTimeout(l),f&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(l)}}clearTimeout(i),s.releaseLock(),n.cancel().then(null,()=>{})}}function j2(e){let t;try{t=e.clone()}catch{return}N2(t,()=>{Hr("fetch-body-resolved",{endTimestamp:cn()*1e3,response:e})})}function th(e,t){return!!e&&typeof e=="object"&&!!e[t]}function oE(e){return typeof e=="string"?e:e?th(e,"url")?e.url:e.toString?e.toString():"":""}function A2(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,s]=e;return{url:oE(n),method:th(s,"method")?String(s.method).toUpperCase():Kv(n)&&th(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:oE(t),method:th(t,"method")?String(t.method).toUpperCase():"GET"}}function k2(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Kv(t))return new Headers(t.headers)}catch{}}function O2(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function M2(){return"npm"}function I2(){return!O2()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function P2(){return typeof window<"u"&&(!I2()||D2())}function D2(){return ct.process?.type==="renderer"}const st=ct;let sv=0;function u1(){return sv>0}function z2(){sv++,setTimeout(()=>{sv--})}function Oc(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(Zv(e))return e}catch{return e}const s=function(...i){try{const a=i.map(l=>Oc(l,t));return e.apply(this,a)}catch(a){throw z2(),Du(l=>{l.addEventProcessor(f=>(t.mechanism&&(Gy(f,void 0),Rc(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),Yn(e,"__sentry_wrapped__",s);try{Object.getOwnPropertyDescriptor(s,"name").configurable&&Object.defineProperty(s,"name",{get(){return e.name}})}catch{}return s}function fb(){const e=Ou(),{referrer:t}=st.document||{},{userAgent:n}=st.navigator||{},s={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:s}}function db(e,t){const n=hb(e,t),s={type:F2(t),value:H2(t)};return n.length&&(s.stacktrace={frames:n}),s.type===void 0&&s.value===""&&(s.value="Unrecoverable error caught"),s}function L2(e,t,n,s){const a=vt()?.getOptions().normalizeDepth,l=Z2(t),f={__serialized__:kR(t,a)};if(l)return{exception:{values:[db(e,l)]},extra:f};const d={exception:{values:[{type:rp(t)?t.constructor.name:s?"UnhandledRejection":"Error",value:K2(t,{isUnhandledRejection:s})}]},extra:f};if(n){const p=hb(e,n);p.length&&(d.exception.values[0].stacktrace={frames:p})}return d}function Yg(e,t){return{exception:{values:[db(e,t)]}}}function hb(e,t){const n=t.stacktrace||t.stack||"",s=$2(t),i=B2(t);try{return e(n,s,i)}catch{}return[]}const U2=/Minified React error #\d+;/i;function $2(e){return e&&U2.test(e.message)?1:0}function B2(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 F2(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 H2(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 q2(e,t,n,s){const i=n?.syntheticException||void 0,a=pb(e,t,i,s);return Rc(a),a.level="error",n?.event_id&&(a.event_id=n.event_id),Uu(a)}function V2(e,t,n="info",s,i){const a=s?.syntheticException||void 0,l=ov(e,t,a,i);return l.level=n,s?.event_id&&(l.event_id=s.event_id),Uu(l)}function pb(e,t,n,s,i){let a;if(aR(t)&&t.error)return Yg(e,t.error);if(pw(t)||VM(t)){const l=t;if("stack"in t)a=Yg(e,t);else{const f=l.name||(pw(l)?"DOMError":"DOMException"),d=l.message?`${f}: ${l.message}`:f;a=ov(e,d,n,s),Gy(a,d)}return"code"in l&&(a.tags={...a.tags,"DOMException.code":`${l.code}`}),a}return tp(t)?Yg(e,t):yu(t)||rp(t)?(a=L2(e,t,n,i),Rc(a,{synthetic:!0}),a):(a=ov(e,t,n,s),Gy(a,`${t}`),Rc(a,{synthetic:!0}),a)}function ov(e,t,n,s){const i={};if(s&&n){const a=hb(e,n);a.length&&(i.exception={values:[{value:t,stacktrace:{frames:a}}]}),Rc(i,{synthetic:!0})}if(np(t)){const{__sentry_template_string__:a,__sentry_template_values__:l}=t;return i.logentry={message:a,params:l},i}return i.message=t,i}function K2(e,{isUnhandledRejection:t}){const n=QM(e),s=t?"promise rejection":"exception";return aR(e)?`Event \`ErrorEvent\` captured as ${s} with message \`${e.message}\``:rp(e)?`Event \`${G2(e)}\` (type=${e.type}) captured as ${s}`:`Object captured as ${s} with keys: ${n}`}function G2(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Z2(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class Y2 extends SD{constructor(t){const n=X2(t),s=st.SENTRY_SDK_SOURCE||M2();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:l,_experiments:f,enableMetrics:d}=this._options,p=d??f?.enableMetrics??!0;st.document&&(a||l||p)&&st.document.addEventListener("visibilitychange",()=>{st.document.visibilityState==="hidden"&&(a&&this._flushOutcomes(),l&&vh(this),p&&ib(this))}),i&&this.on("beforeSendSession",ID)}eventFromException(t,n){return q2(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",s){return V2(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 X2(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:st.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const $u=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ge=ct,Q2=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Bu=(e,t,n,s)=>{let i,a;return l=>{t.value>=0&&(l||s)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=Q2(t.value,n),e(t)))}},Fu=(e=!0)=>{const t=Ge.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Xc=()=>Fu()?.activationStart??0;function Zo(e,t,n){Ge.document&&Ge.addEventListener(e,t,n)}function xh(e,t,n){Ge.document&&Ge.removeEventListener(e,t,n)}let gc=-1;const d1=new Set,W2=()=>Ge.document?.visibilityState==="hidden"&&!Ge.document?.prerendering?0:1/0,nh=e=>{if(J2(e)&&gc>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of d1)t();isFinite(gc)||(gc=e.type==="visibilitychange"?e.timeStamp:0,xh("prerenderingchange",nh,!0))}},Hu=()=>{if(Ge.document&&gc<0){const e=Xc();gc=(Ge.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??W2(),Zo("visibilitychange",nh,!0),Zo("pagehide",nh,!0),Zo("prerenderingchange",nh,!0)}return{get firstHiddenTime(){return gc},onHidden(e){d1.add(e)}}};function J2(e){return e.type==="pagehide"||Ge.document?.visibilityState==="hidden"}const ez=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,qu=(e,t=-1)=>{const n=Fu();let s="navigate";return n&&(Ge.document?.prerendering||Xc()>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:ez(),navigationType:s}},Xg=new WeakMap;function mb(e,t){try{return Xg.get(e)||Xg.set(e,new t),Xg.get(e)}catch{return new t}}class Sh{constructor(){Sh.prototype.__init.call(this),Sh.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 Qc=(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{}},gb=e=>{let t=!1;return()=>{t||(e(),t=!0)}},ip=e=>{Ge.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},tz=[1800,3e3],nz=(e,t={})=>{ip(()=>{const n=Hu(),s=qu("FCP");let i;const l=Qc("paint",f=>{for(const d of f)d.name==="first-contentful-paint"&&(l.disconnect(),d.startTime<n.firstHiddenTime&&(s.value=Math.max(d.startTime-Xc(),0),s.entries.push(d),i(!0)))});l&&(i=Bu(e,s,tz,t.reportAllChanges))})},rz=[.1,.25],sz=(e,t={})=>{nz(gb(()=>{const n=qu("CLS",0);let s;const i=Hu(),a=mb(t,Sh),l=d=>{for(const p of d)a._processEntry(p);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,s())},f=Qc("layout-shift",l);f&&(s=Bu(e,n,rz,t.reportAllChanges),i.onHidden(()=>{l(f.takeRecords()),s(!0)}),Ge?.setTimeout?.(s))}))};let h1=0,Qg=1/0,Ed=0;const oz=e=>{e.forEach(t=>{t.interactionId&&(Qg=Math.min(Qg,t.interactionId),Ed=Math.max(Ed,t.interactionId),h1=Ed?(Ed-Qg)/7+1:0)})};let iv;const p1=()=>iv?h1:performance.interactionCount||0,iz=()=>{"interactionCount"in performance||iv||(iv=Qc("event",oz,{type:"event",buffered:!0,durationThreshold:0}))},Wg=10;let m1=0;const az=()=>p1()-m1;class _h{constructor(){_h.prototype.__init.call(this),_h.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(az()/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<Wg||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>Wg){const i=this._longestInteractionList.splice(Wg);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=gb(e),Zo("visibilitychange",e,{once:!0,capture:!0}),Zo("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),xh("visibilitychange",e,{capture:!0}),xh("pagehide",e,{capture:!0})}))},cz=[200,500],lz=40,uz=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Hu();ip(()=>{iz();const s=qu("INP");let i;const a=mb(t,_h),l=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=Qc("event",l,{durationThreshold:t.durationThreshold??lz});i=Bu(e,s,cz,t.reportAllChanges),f&&(f.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{l(f.takeRecords()),i(!0)}))})};class fz{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const dz=[2500,4e3],hz=(e,t={})=>{ip(()=>{const n=Hu(),s=qu("LCP");let i;const a=mb(t,fz),l=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-Xc(),0),s.entries=[p],i())},f=Qc("largest-contentful-paint",l);if(f){i=Bu(e,s,dz,t.reportAllChanges);const d=gb(()=>{l(f.takeRecords()),f.disconnect(),i(!0)}),p=g=>{g.isTrusted&&(g1(d),xh(g.type,p,{capture:!0}))};for(const g of["keydown","click","visibilitychange"])Zo(g,p,{capture:!0})}})},pz=[800,1800],av=e=>{Ge.document?.prerendering?ip(()=>av(e)):Ge.document?.readyState!=="complete"?addEventListener("load",()=>av(e),!0):setTimeout(e)},mz=(e,t={})=>{const n=qu("TTFB"),s=Bu(e,n,pz,t.reportAllChanges);av(()=>{const i=Fu();i&&(n.value=Math.max(i.responseStart-Xc(),0),n.entries=[i],s(!0))})},uu={},wh={};let y1,v1,b1,x1;function S1(e,t=!1){return ap("cls",e,vz,y1,t)}function _1(e,t=!1){return ap("lcp",e,bz,v1,t)}function gz(e){return ap("ttfb",e,xz,b1)}function yz(e){return ap("inp",e,Sz,x1)}function Mc(e,t){return w1(e,t),wh[e]||(_z(e),wh[e]=!0),E1(e,t)}function Vu(e,t){const n=uu[e];if(n?.length)for(const s of n)try{s(t)}catch(i){$u&&be.error(`Error while triggering instrumentation handler.
18
18
  Type: ${e}
19
19
  Name: ${Xs(s)}
20
- Error:`,i)}}function pz(){return ez(e=>{qu("cls",{metric:e}),p1=e},{reportAllChanges:!0})}function mz(){return lz(e=>{qu("lcp",{metric:e}),m1=e},{reportAllChanges:!0})}function gz(){return fz(e=>{qu("ttfb",{metric:e}),g1=e})}function yz(){return iz(e=>{qu("inp",{metric:e}),y1=e})}function ip(e,t,n,s,i=!1){x1(e,t);let a;return _h[e]||(a=n(),_h[e]=!0),s&&t({metric:s}),S1(e,t,i?a:void 0)}function vz(e){const t={};e==="event"&&(t.durationThreshold=0),Qc(e,n=>{qu(e,{entries:n})},t)}function x1(e,t){uu[e]=uu[e]||[],uu[e].push(t)}function S1(e,t,n){return()=>{n&&n();const s=uu[e];if(!s)return;const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}function bz(e){return"duration"in e}const xz=e=>{const t=n=>{(n.type==="pagehide"||Ge.document?.visibilityState==="hidden")&&e(n)};Zo("visibilitychange",t,{capture:!0,once:!0}),Zo("pagehide",t,{capture:!0,once:!0})};function Wg(e){return typeof e=="number"&&isFinite(e)}function ti(e,t,n,{...s}){const i=yt(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),eb(e,()=>{const a=Zc({startTime:t,...s});return a&&a.end(n),a})}function mb(e){const t=vt();if(!t)return;const{name:n,transaction:s,attributes:i,startTime:a}=e,{release:l,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:l,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 Zc({name:n,attributes:w,startTime:a,experimental:{standalone:!0}})}function Vu(){return Ge.addEventListener&&Ge.performance}function Xt(e){return e/1e3}function Sz(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 _1(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function w1(e,t){let n,s=!1;function i(f){!s&&n&&t(f,n),s=!0}xz(()=>{i("pagehide")});const a=e.on("beforeStartNavigationSpan",(f,d)=>{d?.isRedirect||(i("navigation"),a(),l())}),l=e.on("afterStartPageLoadSpan",f=>{n=f.spanContext().spanId,l()})}function _z(e){let t=0,n;if(!_1("layout-shift"))return;const s=v1(({metric:i})=>{const a=i.entries[i.entries.length-1];a&&(t=i.value,n=a)},!0);w1(e,(i,a)=>{wz(t,n,a,i),s()})}function wz(e,t,n,s){Uu&&be.log(`Sending CLS span (${e})`);const i=t?Xt((Sr()||0)+t.startTime):cn(),a=bt().getScopeData().transactionName,l=t?Vr(t.sources[0]?.node):"Layout shift",f={[gn]:"auto.http.browser.cls",[eo]:"ui.webvital.cls",[Kc]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t?.sources&&t.sources.forEach((p,g)=>{f[`cls.source.${g+1}`]=Vr(p.node)});const d=mb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("cls",{[Du]:"",[zu]:e}),d.end(i))}function Ez(e){let t=0,n;if(!_1("largest-contentful-paint"))return;const s=b1(({metric:i})=>{const a=i.entries[i.entries.length-1];a&&(t=i.value,n=a)},!0);w1(e,(i,a)=>{Tz(t,n,a,i),s()})}function Tz(e,t,n,s){Uu&&be.log(`Sending LCP span (${e})`);const i=Xt((Sr()||0)+(t?.startTime||0)),a=bt().getScopeData().transactionName,l=t?Vr(t.element):"Largest contentful paint",f={[gn]:"auto.http.browser.lcp",[eo]:"ui.webvital.lcp",[Kc]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t&&(t.element&&(f["lcp.element"]=Vr(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=mb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("lcp",{[Du]:"millisecond",[zu]:e}),d.end(i))}function Pr(e){return e&&((Sr()||performance.timeOrigin)+e)/1e3}function E1(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:s}=Sz(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=n}return Sr()||Vu()?.timeOrigin?Cz({...t,"http.request.redirect_start":Pr(e.redirectStart),"http.request.redirect_end":Pr(e.redirectEnd),"http.request.worker_start":Pr(e.workerStart),"http.request.fetch_start":Pr(e.fetchStart),"http.request.domain_lookup_start":Pr(e.domainLookupStart),"http.request.domain_lookup_end":Pr(e.domainLookupEnd),"http.request.connect_start":Pr(e.connectStart),"http.request.secure_connection_start":Pr(e.secureConnectionStart),"http.request.connection_end":Pr(e.connectEnd),"http.request.request_start":Pr(e.requestStart),"http.request.response_start":Pr(e.responseStart),"http.request.response_end":Pr(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Cz(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Rz=2147483647;let sE=0,ns={},Kn,wh;function Nz({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const s=Vu();if(s&&Sr()){s.mark&&Ge.performance.mark("sentry-tracing-init");const i=t?Ez(n):Mz(),a=Iz(),l=e?_z(n):Oz();return()=>{i?.(),a(),l?.()}}return()=>{}}function jz(){Mc("longtask",({entries:e})=>{const t=Xn();if(!t)return;const{op:n,start_timestamp:s}=yt(t);for(const i of e){const a=Xt(Sr()+i.startTime),l=Xt(i.duration);n==="navigation"&&s&&a<s||ti(t,a,a+l,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[gn]:"auto.ui.browser.metrics"}})}})}function Az(){new PerformanceObserver(t=>{const n=Xn();if(n)for(const s of t.getEntries()){if(!s.scripts[0])continue;const i=Xt(Sr()+s.startTime),{start_timestamp:a,op:l}=yt(n);if(l==="navigation"&&a&&i<a)continue;const f=Xt(s.duration),d={[gn]:"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),ti(n,i,i+f,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:d})}}).observe({type:"long-animation-frame",buffered:!0})}function kz(){Mc("event",({entries:e})=>{const t=Xn();if(t){for(const n of e)if(n.name==="click"){const s=Xt(Sr()+n.startTime),i=Xt(n.duration),a={name:Vr(n.target),op:`ui.interaction.${n.name}`,startTime:s,attributes:{[gn]:"auto.ui.browser.metrics"}},l=iR(n.target);l&&(a.attributes["ui.component_name"]=l),ti(t,s,s+i,a)}}})}function Oz(){return v1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ns.cls={value:e.value,unit:""},wh=t)},!0)}function Mz(){return b1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ns.lcp={value:e.value,unit:"millisecond"},Kn=t)},!0)}function Iz(){return dz(({metric:e})=>{e.entries[e.entries.length-1]&&(ns.ttfb={value:e.value,unit:"millisecond"})})}function Pz(e,t){const n=Vu(),s=Sr();if(!n?.getEntries||!s)return;const i=Xt(s),a=n.getEntries(),{op:l,start_timestamp:f}=yt(e);a.slice(sE).forEach(d=>{const p=Xt(d.startTime),g=Xt(Math.max(0,d.duration));if(!(l==="navigation"&&f&&i+p<f))switch(d.entryType){case"navigation":{Uz(e,d,i);break}case"mark":case"paint":case"measure":{zz(e,d,p,g,i,t.ignorePerformanceApiSpans);const y=Fu(),b=d.startTime<y.firstHiddenTime;d.name==="first-paint"&&b&&(ns.fp={value:d.startTime,unit:"millisecond"}),d.name==="first-contentful-paint"&&b&&(ns.fcp={value:d.startTime,unit:"millisecond"});break}case"resource":{Fz(e,d,d.name,p,g,i,t.ignoreResourceSpans);break}}}),sE=Math.max(a.length-1,0),Hz(e),l==="pageload"&&(Kz(ns),t.recordClsOnPageloadSpan||delete ns.cls,t.recordLcpOnPageloadSpan||delete ns.lcp,Object.entries(ns).forEach(([d,p])=>{aP(d,p.value,p.unit)}),e.setAttribute("performance.timeOrigin",i),e.setAttribute("performance.activationStart",Xc()),qz(e,t)),Kn=void 0,wh=void 0,ns={}}function Dz(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function zz(e,t,n,s,i,a){if(Dz(t)||["mark","measure"].includes(t.entryType)&&Ko(t.name,a))return;const l=Bu(!1),f=Xt(l?l.requestStart:0),d=i+Math.max(n,f),p=i+n,g=p+s,y={[gn]:"auto.resource.browser.metrics"};d!==p&&(y["sentry.browser.measure_happened_before_request"]=!0,y["sentry.browser.measure_start_time"]=d),Lz(y,t),d<=g&&ti(e,d,g,{name:t.name,op:t.entryType,attributes:y})}function Lz(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[s,i]of Object.entries(n))if(i&&Cc(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(Cc(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Uz(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(s=>{Ed(e,t,s,n)}),Ed(e,t,"secureConnection",n,"TLS/SSL"),Ed(e,t,"fetch",n,"cache"),Ed(e,t,"domainLookup",n,"DNS"),Bz(e,t,n)}function Ed(e,t,n,s,i=n){const a=$z(n),l=t[a],f=t[`${n}Start`];!f||!l||ti(e,s+Xt(f),s+Xt(l),{op:`browser.${i}`,name:t.name,attributes:{[gn]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function $z(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Bz(e,t,n){const s=n+Xt(t.requestStart),i=n+Xt(t.responseEnd),a=n+Xt(t.responseStart);t.responseEnd&&(ti(e,s,i,{op:"browser.request",name:t.name,attributes:{[gn]:"auto.ui.browser.metrics"}}),ti(e,a,i,{op:"browser.response",name:t.name,attributes:{[gn]:"auto.ui.browser.metrics"}}))}function Fz(e,t,n,s,i,a,l){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const f=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(l?.includes(f))return;const d={[gn]:"auto.resource.browser.metrics"},p=na(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),Vz(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,...E1(t)},y=a+s,b=y+i;ti(e,y,b,{name:n.replace(Ge.location.origin,""),op:f,attributes:g})}function Hz(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),Wg(n.rtt)&&(ns["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Wg(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Wg(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function qz(e,t){Kn&&t.recordLcpOnPageloadSpan&&(Kn.element&&e.setAttribute("lcp.element",Vr(Kn.element)),Kn.id&&e.setAttribute("lcp.id",Kn.id),Kn.url&&e.setAttribute("lcp.url",Kn.url.trim().slice(0,200)),Kn.loadTime!=null&&e.setAttribute("lcp.loadTime",Kn.loadTime),Kn.renderTime!=null&&e.setAttribute("lcp.renderTime",Kn.renderTime),e.setAttribute("lcp.size",Kn.size)),wh?.sources&&t.recordClsOnPageloadSpan&&wh.sources.forEach((n,s)=>e.setAttribute(`cls.source.${s+1}`,Vr(n.node)))}function Vz(e,t,n){n.forEach(([s,i])=>{const a=e[s];a!=null&&(typeof a=="number"&&a<Rz||typeof a=="string")&&(t[i]=a)})}function Kz(e){const t=Bu(!1);if(!t)return;const{responseStart:n,requestStart:s}=t;s<=n&&(e["ttfb.requestTime"]={value:n-s,unit:"millisecond"})}function Gz(){return Vu()&&Sr()?Mc("element",Zz):()=>{}}const Zz=({entries:e})=>{const t=Xn(),n=t?Dn(t):void 0,s=n?yt(n).description:bt().getScopeData().transactionName;e.forEach(i=>{const a=i;if(!a.identifier)return;const l=a.name,f=a.renderTime,d=a.loadTime,[p,g]=d?[Xt(d),"load-time"]:f?[Xt(f),"render-time"]:[cn(),"entry-emission"],y=l==="image-paint"?Xt(Math.max(0,(f??0)-(d??0))):0,b={[gn]:"auto.ui.browser.elementtiming",[eo]:"ui.elementtiming",[vs]:"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":l};kR({name:`element[${a.identifier}]`,attributes:b,startTime:p,onlyIfParent:!0},x=>{x.end(p+y)})})},Yz=1e3;let oE,av,cv;function Xz(e){ci("dom",e),li("dom",Qz)}function Qz(){if(!Ge.document)return;const e=Hr.bind(null,"dom"),t=iE(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")&&(gr(i,"addEventListener",function(a){return function(l,f,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},g=p[l]=p[l]||{refCount:0};if(!g.handler){const y=iE(e);g.handler=y,a.call(this,l,y,d)}g.refCount++}catch{}return a.call(this,l,f,d)}}),gr(i,"removeEventListener",function(a){return function(l,f,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__||{},g=p[l];g&&(g.refCount--,g.refCount<=0&&(a.call(this,l,g.handler,d),g.handler=void 0,delete p[l]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,f,d)}}))})}function Wz(e){if(e.type!==av)return!1;try{if(!e.target||e.target._sentryId!==cv)return!1}catch{}return!0}function Jz(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function iE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const s=eL(n);if(Jz(n.type,s))return;Yn(n,"_sentryCaptured",!0),s&&!s._sentryId&&Yn(s,"_sentryId",qr());const i=n.type==="keypress"?"input":n.type;Wz(n)||(e({event:n,name:i,global:t}),av=n.type,cv=s?s._sentryId:void 0),clearTimeout(oE),oE=Ge.setTimeout(()=>{cv=void 0,av=void 0},Yz)}}function eL(e){try{return e.target}catch{return null}}let Td;function gb(e){const t="history";ci(t,e),li(t,tL)}function tL(){if(Ge.addEventListener("popstate",()=>{const t=Ge.location.href,n=Td;if(Td=t,n===t)return;Hr("history",{from:n,to:t})}),!x2())return;function e(t){return function(...n){const s=n.length>2?n[2]:void 0;if(s){const i=Td,a=nL(String(s));if(Td=a,i===a)return t.apply(this,n);Hr("history",{from:i,to:a})}return t.apply(this,n)}}gr(Ge.history,"pushState",e),gr(Ge.history,"replaceState",e)}function nL(e){try{return new URL(e,Ge.location.origin).toString()}catch{return e}}const nh={};function rL(e){const t=nh[e];if(t)return t;let n=Ge[e];if(nv(n))return nh[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){Uu&&be.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n&&(nh[e]=n.bind(Ge))}function sL(e){nh[e]=void 0}const fc="__sentry_xhr_v3__";function T1(e){ci("xhr",e),li("xhr",oL)}function oL(){if(!Ge.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,s){const i=new Error,a=cn()*1e3,l=Gs(s[0])?s[0].toUpperCase():void 0,f=iL(s[1]);if(!l||!f)return t.apply(n,s);n[fc]={method:l,url:f,request_headers:{}},l==="POST"&&f.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const d=()=>{const p=n[fc];if(p&&n.readyState===4){try{p.status_code=n.status}catch{}const g={endTimestamp:cn()*1e3,startTimestamp:a,xhr:n,virtualError:i};Hr("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[fc];return S&&Gs(b)&&Gs(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[fc];if(!i)return t.apply(n,s);s[0]!==void 0&&(i.body=s[0]);const a={startTimestamp:cn()*1e3,xhr:n};return Hr("xhr",a),t.apply(n,s)}})}function iL(e){if(Gs(e))return e;try{return e.toString()}catch{}}function aL(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Uu&&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 Jg=[],rh=new Map,cc=new Map,cL=60;function lL(){if(Vu()&&Sr()){const t=uL();return()=>{t()}}return()=>{}}const lv={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 uL(){return hz(fL)}const fL=({metric:e})=>{if(e.value==null)return;const t=Xt(e.value);if(t>cL)return;const n=e.entries.find(S=>S.duration===e.value&&lv[S.name]);if(!n)return;const{interactionId:s}=n,i=lv[n.name],a=Xt(Sr()+n.startTime),l=Xn(),f=l?Dn(l):void 0,d=s!=null?rh.get(s):void 0,p=d?.span||f,g=p?yt(p).description:bt().getScopeData().transactionName,y=d?.elementName||Vr(n.target),b={[gn]:"auto.http.browser.inp",[eo]:`ui.interaction.${i}`,[Kc]:n.duration},x=mb({name:y,transaction:g,attributes:b,startTime:a});x&&(x.addEvent("inp",{[Du]:"millisecond",[zu]:e.value}),x.end(a+t))};function dL(){const e=Object.keys(lv);k2()&&e.forEach(i=>{Ge.addEventListener(i,t,{capture:!0,passive:!0})});function t(i){const a=i.target;if(!a)return;const l=Vr(a),f=Math.round(i.timeStamp);if(cc.set(f,l),cc.size>50){const d=cc.keys().next().value;d!==void 0&&cc.delete(d)}}function n(i){const a=Math.round(i.startTime);let l=cc.get(a);if(!l)for(let f=-5;f<=5;f++){const d=cc.get(a+f);if(d){l=d;break}}return l||"<unknown>"}const s=({entries:i})=>{const a=Xn(),l=a&&Dn(a);i.forEach(f=>{if(!bz(f))return;const d=f.interactionId;if(d==null||rh.has(d))return;const p=f.target?Vr(f.target):n(f);if(Jg.length>10){const g=Jg.shift();rh.delete(g)}Jg.push(d),rh.set(d,{span:l,elementName:p})})};Mc("event",s),Mc("first-input",s)}const hL=40;function pL(e,t=rL("fetch")){let n=0,s=0;async function i(a){const l=a.body.length;n+=l,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 sL("fetch"),d}finally{n-=l,s--}}return dD(e,i,ab(e.bufferSize||hL))}const Kr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,mL=30,gL=50;function uv(e,t,n,s){const i={filename:e,function:t==="<anonymous>"?oa:t,in_app:!0};return n!==void 0&&(i.lineno=n),s!==void 0&&(i.colno=s),i}const yL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,vL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bL=/\((\S*)(?::(\d+))(?::(\d+))\)/,xL=/at (.+?) ?\(data:(.+?),/,SL=e=>{const t=e.match(xL);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=yL.exec(e);if(n){const[,i,a,l]=n;return uv(i,oa,+a,+l)}const s=vL.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){const f=bL.exec(s[2]);f&&(s[2]=f[1],s[3]=f[2],s[4]=f[3])}const[a,l]=C1(s[1]||oa,s[2]);return uv(l,a,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},_L=[mL,SL],wL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,EL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,TL=e=>{const t=wL.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const a=EL.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]||oa;return[i,s]=C1(i,s),uv(s,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},CL=[gL,TL],RL=[_L,CL],NL=JC(...RL),C1=(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]:oa,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Cd=1024,jL="Breadcrumbs",AL=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:jL,setup(n){t.console&&YD(IL(n)),t.dom&&Xz(ML(n,t.dom)),t.xhr&&T1(PL(n)),t.fetch&&o1(DL(n)),t.history&&gb(zL(n)),t.sentry&&n.on("beforeSendEvent",OL(n))}}}),kL=AL;function OL(e){return function(n){vt()===e&&ia({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Gi(n)},{event:n})}}function ML(e,t){return function(s){if(vt()!==e)return;let i,a,l=typeof t=="object"?t.serializeAttribute:void 0,f=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;f&&f>Cd&&(Kr&&be.warn(`\`dom.maxStringLength\` cannot exceed ${Cd}, but a value of ${f} was configured. Sentry will use ${Cd} instead.`),f=Cd),typeof l=="string"&&(l=[l]);try{const p=s.event,g=LL(p)?p.target:p;i=Vr(g,{keyAttrs:l,maxStringLength:f}),a=iR(g)}catch{i="<unknown>"}if(i.length===0)return;const d={category:`ui.${s.name}`,message:i};a&&(d.data={"ui.component_name":a}),ia(d,{event:s.event,name:s.name,global:s.global})}}function IL(e){return function(n){if(vt()!==e)return;const s={category:"console",data:{arguments:n.args,logger:"console"},level:QD(n.level),message:mw(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)s.message=`Assertion failed: ${mw(n.args.slice(1)," ")||"console.assert"}`,s.data.arguments=n.args.slice(1);else return;ia(s,{input:n.args,level:n.level})}}function PL(e){return function(n){if(vt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n,a=n.xhr[fc];if(!s||!i||!a)return;const{method:l,url:f,status_code:d,body:p}=a,g={method:l,url:f,status_code:d},y={xhr:n.xhr,input:p,startTimestamp:s,endTimestamp:i},b={category:"xhr",data:g,type:"http",level:s1(d)};e.emit("beforeOutgoingRequestBreadcrumb",b,y),ia(b,y)}}function DL(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,l={data:n.error,input:n.args,startTimestamp:s,endTimestamp:i},f={category:"fetch",data:a,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",f,l),ia(f,l)}else{const a=n.response,l={...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:l,type:"http",level:s1(l.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",d,f),ia(d,f)}}}function zL(e){return function(n){if(vt()!==e)return;let s=n.from,i=n.to;const a=na(st.location.href);let l=s?na(s):void 0;const f=na(i);l?.path||(l=a),a.protocol===f.protocol&&a.host===f.host&&(i=f.relative),a.protocol===l.protocol&&a.host===l.host&&(s=l.relative),ia({category:"navigation",data:{from:s,to:i}})}}function LL(e){return!!e&&!!e.target}const UL=["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"],$L="BrowserApiErrors",BL=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:$L,setupOnce(){t.setTimeout&&gr(st,"setTimeout",aE),t.setInterval&&gr(st,"setInterval",aE),t.requestAnimationFrame&&gr(st,"requestAnimationFrame",HL),t.XMLHttpRequest&&"XMLHttpRequest"in st&&gr(XMLHttpRequest.prototype,"send",qL);const n=t.eventTarget;n&&(Array.isArray(n)?n:UL).forEach(i=>VL(i,t))}}}),FL=BL;function aE(e){return function(...t){const n=t[0];return t[0]=Oc(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Xs(e)}`}}),e.apply(this,t)}}function HL(e){return function(t){return e.apply(this,[Oc(t,{mechanism:{data:{handler:Xs(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"&&gr(n,i,function(a){const l={mechanism:{data:{handler:Xs(a)},handled:!1,type:`auto.browser.browserapierrors.xhr.${i}`}},f=Kv(a);return f&&(l.mechanism.data.handler=Xs(f)),Oc(a,l)})}),e.apply(this,t)}}function VL(e,t){const s=st[e]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(gr(s,"addEventListener",function(i){return function(a,l,f){try{KL(l)&&(l.handleEvent=Oc(l.handleEvent,{mechanism:{data:{handler:Xs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&GL(this,a,l),i.apply(this,[a,Oc(l,{mechanism:{data:{handler:Xs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),f])}}),gr(s,"removeEventListener",function(i){return function(a,l,f){try{const d=l.__sentry_wrapped__;d&&i.call(this,a,d,f)}catch{}return i.call(this,a,l,f)}}))}function KL(e){return typeof e.handleEvent=="function"}function GL(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const ZL=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof st.document>"u"){Kr&&be.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Dw({ignoreDuration:!0}),Kg();const n=Zr();let s=n.getUser();n.addScopeListener(i=>{const a=i.getUser();(s?.id!==a?.id||s?.ip_address!==a?.ip_address)&&(Kg(),s=a)}),t==="route"&&gb(({from:i,to:a})=>{i!==a&&(Dw({ignoreDuration:!0}),Kg())})}}},YL="CultureContext",XL=(()=>({name:YL,preprocessEvent(e){const t=WL();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})),QL=XL;function WL(){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 JL="GlobalHandlers",e4=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:JL,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(n4(n),cE("onerror")),t.onunhandledrejection&&(r4(n),cE("onunhandledrejection"))}}}),t4=e4;function n4(e){tR(t=>{const{stackParser:n,attachStacktrace:s}=R1();if(vt()!==e||a1())return;const{msg:i,url:a,line:l,column:f,error:d}=t,p=i4(db(n,d||i,void 0,s,!1),a,l,f);p.level="error",zR(p,{originalException:d,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function r4(e){nR(t=>{const{stackParser:n,attachStacktrace:s}=R1();if(vt()!==e||a1())return;const i=s4(t),a=Cc(i)?o4(i):db(n,i,void 0,s,!0);a.level="error",zR(a,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function s4(e){if(Cc(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 o4(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function i4(e,t,n,s){const i=e.exception=e.exception||{},a=i.values=i.values||[],l=a[0]=a[0]||{},f=l.stacktrace=l.stacktrace||{},d=f.frames=f.frames||[],p=s,g=n,y=a4(t)??ku();return d.length===0&&d.push({colno:p,filename:y,function:oa,in_app:!0,lineno:g}),e}function cE(e){Kr&&be.log(`Global Handler attached: ${e}`)}function R1(){return vt()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function a4(e){if(!(!Gs(e)||e.length===0))return e.startsWith("data:")?`<${Go(e,!1)}>`:e}const c4=()=>({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}}}),l4="cause",u4=5,f4="LinkedErrors",d4=((e={})=>{const t=e.limit||u4,n=e.key||l4;return{name:f4,preprocessEvent(s,i,a){const l=a.getOptions();ZD(ub,l.stackParser,n,t,s,i)}}}),h4=d4;function p4(){return m4()?(Kr&&pa(()=>{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 m4(){if(typeof st.window>"u")return!1;const e=st;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=ku(),s=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(st===st.top&&s.some(a=>n.startsWith(`${a}://`)))}function g4(e){return[$D(),DD(),i2(),FL(),kL(),t4(),h4(),e2(),c4(),QL(),ZL()]}function y4(e={}){const t=!e.skipBrowserExtensionCheck&&p4();let n=e.defaultIntegrations==null?g4():e.defaultIntegrations;const s={...e,enabled:t?!1:e.enabled,stackParser:zM(e.stackParser||NL),integrations:HP({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||pL};return wD(V2,s)}function v4(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function N1(e){try{return new URL(e,st.location.origin).href}catch{return}}function b4(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function j1(e){try{return new Headers(e)}catch{return}}const lE=new WeakMap,ey=new Map,A1={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function x4(e,t){const{traceFetch:n,traceXHR:s,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:a,enableHTTPTimings:l,tracePropagationTargets:f,onRequestSpanStart:d,onRequestSpanEnd:p}={...A1,...t},g=typeof a=="function"?a:S=>!0,y=S=>S4(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=ey.get(w.span_id);T&&(w.timestamp=T/1e3,ey.delete(w.span_id))}}),S)),i&&w2(S=>{if(S.response){const w=lE.get(S.response);w&&S.endTimestamp&&ey.set(w,S.endTimestamp)}}),o1(S=>{const w=a2(S,g,y,b,{propagateTraceparent:x,onRequestSpanEnd:p});if(S.response&&S.fetchData.__span&&lE.set(S.response,S.fetchData.__span),w){const T=N1(S.fetchData.url),C=T?na(T).host:void 0;w.setAttributes({"http.url":T?Go(T):void 0,"server.address":C}),l&&uE(w),d?.(w,{headers:S.headers})}})),s&&T1(S=>{const w=_4(S,g,y,b,x,p);w&&(l&&uE(w),d?.(w,{headers:j1(S.xhr.__sentry_xhr_v3__?.request_headers)}))})}function uE(e){const{url:t}=yt(e).data;if(!t||typeof t!="string")return;const n=Mc("resource",({entries:s})=>{s.forEach(i=>{b4(i)&&i.name.endsWith(t)&&(e.setAttributes(E1(i)),setTimeout(n))})})}function S4(e,t){const n=ku();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?Ko(s.toString(),t)||a&&Ko(s.pathname,t):a}else{const s=!!e.match(/^\/(?!\/)/);return t?Ko(e,t):s}}function _4(e,t,n,s,i,a){const l=e.xhr,f=l?.[fc];if(!l||l.__sentry_own_request__||!f)return;const{url:d,method:p}=f,g=ss()&&t(d);if(e.endTimestamp){const C=l.__sentry_xhr_span_id__;if(!C)return;const O=s[C];O&&(g&&f.status_code!==void 0&&(hR(O,f.status_code),O.end(),a?.(O,{headers:j1(aL(l)),error:e.error})),delete s[C]);return}const y=N1(d),b=na(y||d),x=Go(RD(d)),S=!!Xn(),w=g&&S?Zc({name:`${p} ${x}`,attributes:{url:Go(d),type:"xhr","http.method":p,"http.url":y?Go(y):void 0,"server.address":b?.host,[gn]:"auto.http.browser",[eo]:"http.client",...b?.search&&{"http.query":b?.search},...b?.hash&&{"http.fragment":b?.hash}}}):new ei;l.__sentry_xhr_span_id__=w.spanContext().spanId,s[l.__sentry_xhr_span_id__]=w,n(d)&&w4(l,ss()&&S?w:void 0,i);const T=vt();return T&&T.emit("beforeOutgoingRequestSpan",w,e),w}function w4(e,t,n){const{"sentry-trace":s,baggage:i,traceparent:a}=e1({span:t,propagateTraceparent:n});s&&E4(e,s,i,a)}function E4(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||!v4(a))&&e.setRequestHeader("baggage",n)}}catch{}}function T4(){st.document?st.document.addEventListener("visibilitychange",()=>{const e=Xn();if(!e)return;const t=Dn(e);if(st.document.hidden&&t){const n="cancelled",{op:s,status:i}=yt(t);Kr&&be.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${s}`),i||t.setStatus({code:hn,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Kr&&be.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const C4=3600,k1="sentry_previous_trace",R4="sentry.previous_trace";function N4(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const s=t==="session-storage";let i=s?k4():void 0;e.on("spanStart",l=>{if(Dn(l)!==l)return;const f=bt().getPropagationContext();i=j4(i,l,f),s&&A4(i)});let a=!0;n&&e.on("beforeSampling",l=>{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(fv(i.spanContext))},sampleRand:i.sampleRand}),l.parentSampled=fv(i.spanContext),l.parentSampleRate=i.sampleRate,l.spanAttributes={...l.spanAttributes,[dR]:i.sampleRate}})}function j4(e,t,n){const s=yt(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(s.data?.[Gv])}catch{return 0}}const a={spanContext:t.spanContext(),startTimestamp:s.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;const l=e.spanContext;return l.traceId===s.trace_id?e:(Date.now()/1e3-e.startTimestamp<=C4&&(Kr&&be.log(`Adding previous_trace \`${JSON.stringify(l)}\` link to span \`${JSON.stringify({op:s.op,...t.spanContext()})}\``),t.addLink({context:l,attributes:{[uI]:"previous_trace"}}),t.setAttribute(R4,`${l.traceId}-${l.spanId}-${fv(l)?1:0}`)),a)}function A4(e){try{st.sessionStorage.setItem(k1,JSON.stringify(e))}catch(t){Kr&&be.warn("Could not store previous trace in sessionStorage",t)}}function k4(){try{const e=st.sessionStorage?.getItem(k1);return JSON.parse(e)}catch{return}}function fv(e){return e.traceFlags===1}const O4="BrowserTracing",M4={...Wd,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:{},...A1},I4=((e={})=>{const t={name:void 0,source:void 0},n=st.document,{enableInp:s,enableElementTiming:i,enableLongTask:a,enableLongAnimationFrame:l,_experiments:{enableInteractions:f,enableStandaloneClsSpans:d,enableStandaloneLcpSpans:p},beforeStartSpan:g,idleTimeout:y,finalTimeout:b,childSpanTimeout:x,markBackgroundSpan:S,traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,shouldCreateSpanForRequest:O,enableHTTPTimings:N,ignoreResourceSpans:R,ignorePerformanceApiSpans:M,instrumentPageLoad:L,instrumentNavigation:j,detectRedirects:A,linkPreviousTrace:P,consistentTraceSampling:Z,enableReportPageLoaded:B,onRequestSpanStart:z,onRequestSpanEnd:Q}={...M4,...e};let Y,ee,D;function V(q,K,U=!0){const I=K.op==="pageload",H=K.name,W=g?g(K):K,X=W.attributes||{};if(H!==W.name&&(X[vs]="custom",W.attributes=X),!U){const pe=ma();Zc({...W,startTime:pe}).end(pe);return}t.name=W.name,t.source=X[vs];const oe=PR(W,{idleTimeout:y,finalTimeout:b,childSpanTimeout:x,disableAutoFinish:I,beforeSpanEnd:pe=>{Y?.(),Pz(pe,{recordClsOnPageloadSpan:!d,recordLcpOnPageloadSpan:!p,ignoreResourceSpans:R,ignorePerformanceApiSpans:M}),hE(q,void 0);const xe=bt(),de=xe.getPropagationContext();xe.setPropagationContext({...de,traceId:oe.spanContext().traceId,sampled:ui(oe),dsc:to(pe)}),I&&(D=void 0)},trimIdleSpanEndTimestamp:!B});I&&B&&(D=oe),hE(q,oe);function se(){n&&["interactive","complete"].includes(n.readyState)&&q.emit("idleSpanEnableAutoFinish",oe)}I&&!B&&n&&(n.addEventListener("readystatechange",()=>{se()}),se())}return{name:O4,setup(q){if(UI(),Y=Nz({recordClsStandaloneSpans:d||!1,recordLcpStandaloneSpans:p||!1,client:q}),s&&lL(),i&&Gz(),l&&ct.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?Az():a&&jz(),f&&kz(),A&&n){const U=()=>{ee=cn()};addEventListener("click",U,{capture:!0}),addEventListener("keydown",U,{capture:!0,passive:!0})}function K(){const U=_u(q);U&&!yt(U).timestamp&&(Kr&&be.log(`[Tracing] Finishing current active span with op: ${yt(U).op}`),U.setAttribute(vu,"cancelled"),U.end())}q.on("startNavigationSpan",(U,I)=>{if(vt()!==q)return;if(I?.isRedirect){Kr&&be.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),V(q,{op:"navigation.redirect",...U},!1);return}ee=void 0,K(),Zr().setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:ss()?void 0:Zs()});const H=bt();H.setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:ss()?void 0:Zs()}),H.setSDKProcessingMetadata({normalizedRequest:void 0}),V(q,{op:"navigation",...U,parentSpan:null,forceTransaction:!0})}),q.on("startPageLoadSpan",(U,I={})=>{if(vt()!==q)return;K();const H=I.sentryTrace||fE("sentry-trace")||dE("sentry-trace"),W=I.baggage||fE("baggage")||dE("baggage"),X=kI(H,W),oe=bt();oe.setPropagationContext(X),ss()||(oe.getPropagationContext().propagationSpanId=Zs()),oe.setSDKProcessingMetadata({normalizedRequest:lb()}),V(q,{op:"pageload",...U})}),q.on("endPageloadSpan",()=>{B&&D&&(D.setAttribute(vu,"reportPageLoaded"),D.end())})},afterAllSetup(q){let K=ku();if(P!=="off"&&N4(q,{linkPreviousTrace:P,consistentTraceSampling:Z}),st.location){if(L){const U=Sr();P4(q,{name:st.location.pathname,startTime:U?U/1e3:void 0,attributes:{[vs]:"url",[gn]:"auto.pageload.browser"}})}j&&gb(({to:U,from:I})=>{if(I===void 0&&K?.indexOf(U)!==-1){K=void 0;return}K=void 0;const H=WR(U),W=_u(q),X=W&&A&&L4(W,ee);D4(q,{name:H?.pathname||st.location.pathname,attributes:{[vs]:"url",[gn]:"auto.navigation.browser"}},{url:U,isRedirect:X})})}S&&T4(),f&&z4(q,y,b,x,t),s&&dL(),x4(q,{traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,tracePropagationTargets:q.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:O,enableHTTPTimings:N,onRequestSpanStart:z,onRequestSpanEnd:Q})}}});function P4(e,t,n){e.emit("startPageLoadSpan",t,n),bt().setTransactionName(t.name);const s=_u(e);return s&&e.emit("afterStartPageLoadSpan",s),s}function D4(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}}),_u(e)}function fE(e){return st.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function dE(e){return st.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(s=>s.name===e)?.description}function z4(e,t,n,s,i){const a=st.document;let l;const f=()=>{const d="ui.action.click",p=_u(e);if(p){const g=yt(p).op;if(["navigation","pageload"].includes(g)){Kr&&be.warn(`[Tracing] Did not create ${d} span because a pageload or navigation span is in progress.`);return}}if(l&&(l.setAttribute(vu,"interactionInterrupted"),l.end(),l=void 0),!i.name){Kr&&be.warn(`[Tracing] Did not create ${d} transaction because _latestRouteName is missing.`);return}l=PR({name:i.name,op:d,attributes:{[vs]:i.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:s})};a&&addEventListener("click",f,{capture:!0})}const O1="_sentry_idleSpan";function _u(e){return e[O1]}function hE(e,t){Yn(e,O1,t)}const pE=1.5;function L4(e,t){const n=yt(e),s=ma(),i=n.start_timestamp;return!(s-i>pE||t&&s-t<=pE)}function M1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ty={exports:{}},Ke={};var mE;function U4(){if(mE)return Ke;mE=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"),l=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,H,W){this.props=I,this.context=H,this.refs=T,this.updater=W||S}C.prototype.isReactComponent={},C.prototype.setState=function(I,H){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,H,"setState")},C.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function O(){}O.prototype=C.prototype;function N(I,H,W){this.props=I,this.context=H,this.refs=T,this.updater=W||S}var R=N.prototype=new O;R.constructor=N,w(R,C.prototype),R.isPureReactComponent=!0;var M=Array.isArray;function L(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function P(I,H,W){var X=W.ref;return{$$typeof:e,type:I,key:H,ref:X!==void 0?X:null,props:W}}function Z(I,H){return P(I.type,H,I.props)}function B(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function z(I){var H={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(W){return H[W]})}var Q=/\/+/g;function Y(I,H){return typeof I=="object"&&I!==null&&I.key!=null?z(""+I.key):H.toString(36)}function ee(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(H){I.status==="pending"&&(I.status="fulfilled",I.value=H)},function(H){I.status==="pending"&&(I.status="rejected",I.reason=H)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function D(I,H,W,X,oe){var se=typeof I;(se==="undefined"||se==="boolean")&&(I=null);var pe=!1;if(I===null)pe=!0;else switch(se){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,D(pe(I._payload),H,W,X,oe)}}if(pe)return oe=oe(I),pe=X===""?"."+Y(I,0):X,M(oe)?(W="",pe!=null&&(W=pe.replace(Q,"$&/")+"/"),D(oe,H,W,"",function(Me){return Me})):oe!=null&&(B(oe)&&(oe=Z(oe,W+(oe.key==null||I&&I.key===oe.key?"":(""+oe.key).replace(Q,"$&/")+"/")+pe)),H.push(oe)),1;pe=0;var xe=X===""?".":X+":";if(M(I))for(var de=0;de<I.length;de++)X=I[de],se=xe+Y(X,de),pe+=D(X,H,W,se,oe);else if(de=x(I),typeof de=="function")for(I=de.call(I),de=0;!(X=I.next()).done;)X=X.value,se=xe+Y(X,de++),pe+=D(X,H,W,se,oe);else if(se==="object"){if(typeof I.then=="function")return D(ee(I),H,W,X,oe);throw H=String(I),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return pe}function V(I,H,W){if(I==null)return I;var X=[],oe=0;return D(I,X,"","",function(se){return H.call(W,se,oe++)}),X}function q(I){if(I._status===-1){var H=I._result;H=H(),H.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=H)}if(I._status===1)return I._result.default;throw I._result}var K=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=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(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},U={map:V,forEach:function(I,H,W){V(I,function(){H.apply(this,arguments)},W)},count:function(I){var H=0;return V(I,function(){H++}),H},toArray:function(I){return V(I,function(H){return H})||[]},only:function(I){if(!B(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,H,W){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var X=w({},I.props),oe=I.key;if(H!=null)for(se in H.key!==void 0&&(oe=""+H.key),H)!A.call(H,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&H.ref===void 0||(X[se]=H[se]);var se=arguments.length-2;if(se===1)X.children=W;else if(1<se){for(var pe=Array(se),xe=0;xe<se;xe++)pe[xe]=arguments[xe+2];X.children=pe}return P(I.type,oe,X)},Ke.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:a,_context:I},I},Ke.createElement=function(I,H,W){var X,oe={},se=null;if(H!=null)for(X in H.key!==void 0&&(se=""+H.key),H)A.call(H,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(oe[X]=H[X]);var pe=arguments.length-2;if(pe===1)oe.children=W;else if(1<pe){for(var xe=Array(pe),de=0;de<pe;de++)xe[de]=arguments[de+2];oe.children=xe}if(I&&I.defaultProps)for(X in pe=I.defaultProps,pe)oe[X]===void 0&&(oe[X]=pe[X]);return P(I,se,oe)},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(I){return{$$typeof:f,render:I}},Ke.isValidElement=B,Ke.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:q}},Ke.memo=function(I,H){return{$$typeof:p,type:I,compare:H===void 0?null:H}},Ke.startTransition=function(I){var H=j.T,W={};j.T=W;try{var X=I(),oe=j.S;oe!==null&&oe(W,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(L,K)}catch(se){K(se)}finally{H!==null&&W.types!==null&&(H.types=W.types),j.T=H}},Ke.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ke.use=function(I){return j.H.use(I)},Ke.useActionState=function(I,H,W){return j.H.useActionState(I,H,W)},Ke.useCallback=function(I,H){return j.H.useCallback(I,H)},Ke.useContext=function(I){return j.H.useContext(I)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(I,H){return j.H.useDeferredValue(I,H)},Ke.useEffect=function(I,H){return j.H.useEffect(I,H)},Ke.useEffectEvent=function(I){return j.H.useEffectEvent(I)},Ke.useId=function(){return j.H.useId()},Ke.useImperativeHandle=function(I,H,W){return j.H.useImperativeHandle(I,H,W)},Ke.useInsertionEffect=function(I,H){return j.H.useInsertionEffect(I,H)},Ke.useLayoutEffect=function(I,H){return j.H.useLayoutEffect(I,H)},Ke.useMemo=function(I,H){return j.H.useMemo(I,H)},Ke.useOptimistic=function(I,H){return j.H.useOptimistic(I,H)},Ke.useReducer=function(I,H,W){return j.H.useReducer(I,H,W)},Ke.useRef=function(I){return j.H.useRef(I)},Ke.useState=function(I){return j.H.useState(I)},Ke.useSyncExternalStore=function(I,H,W){return j.H.useSyncExternalStore(I,H,W)},Ke.useTransition=function(){return j.H.useTransition()},Ke.version="19.2.4",Ke}var gE;function Ku(){return gE||(gE=1,ty.exports=U4()),ty.exports}var _=Ku();const Ic=M1(_),I1=jM({__proto__:null,default:Ic},[_]);function $4(e){const t={...e};return JR(t,"react"),PP("react",{version:_.version}),y4(t)}function ue(e,t,n){function s(f,d){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:d,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,d);const p=l.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 l(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(l,"init",{value:s}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class yc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class P1 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const D1={};function ni(e){return D1}function z1(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 dv(e,t){return typeof t=="bigint"?t.toString():t}function yb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function vb(e){return e==null}function bb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function B4(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,l=Number.parseInt(e.toFixed(a).replace(".","")),f=Number.parseInt(t.toFixed(a).replace(".",""));return l%f/10**a}const yE=Symbol("evaluating");function wt(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==yE)return s===void 0&&(s=yE,s=n()),s},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function ya(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fi(...e){const t={};for(const n of e){const s=Object.getOwnPropertyDescriptors(n);Object.assign(t,s)}return Object.defineProperties({},t)}function vE(e){return JSON.stringify(e)}function F4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const L1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Eh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const H4=yb(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Pc(e){if(Eh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Eh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function U1(e){return Pc(e)?{...e}:Array.isArray(e)?[...e]:e}const q4=new Set(["string","number","symbol"]);function Dc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function di(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 V4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const K4={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 G4(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=fi(e._zod.def,{get shape(){const l={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}return ya(this,"shape",l),l},checks:[]});return di(e,a)}function Z4(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=fi(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}return ya(this,"shape",l),l},checks:[]});return di(e,a)}function Y4(e,t){if(!Pc(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 l in t)if(Object.getOwnPropertyDescriptor(a,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=fi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return ya(this,"shape",a),a}});return di(e,i)}function X4(e,t){if(!Pc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=fi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return ya(this,"shape",s),s}});return di(e,n)}function Q4(e,t){const n=fi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return ya(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return di(e,n)}function W4(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 l=fi(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 ya(this,"shape",d),d},checks:[]});return di(t,l)}function J4(e,t,n){const s=fi(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(a[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)a[l]=new e({type:"nonoptional",innerType:i[l]});return ya(this,"shape",a),a}});return di(t,s)}function dc(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 hc(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function Rd(e){return typeof e=="string"?e:e?.message}function ri(e,t,n){const s={...e,path:e.path??[]};if(!e.message){const i=Rd(e.inst?._zod.def?.error?.(e))??Rd(t?.error?.(e))??Rd(n.customError?.(e))??Rd(n.localeError?.(e))??"Invalid input";s.message=i}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function xb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function wu(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const $1=(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,dv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},B1=ue("$ZodError",$1),F1=ue("$ZodError",$1,{Parent:Error});function e5(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 t5(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(l=>s({issues:l}));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 l=n,f=0;for(;f<a.path.length;){const d=a.path[f];f===a.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],f++}}};return s(e),n}const Sb=e=>(t,n,s,i)=>{const a=s?Object.assign(s,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise)throw new yc;if(l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ri(d,a,ni())));throw L1(f,i?.callee),f}return l.value},_b=e=>async(t,n,s,i)=>{const a=s?Object.assign(s,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise&&(l=await l),l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ri(d,a,ni())));throw L1(f,i?.callee),f}return l.value},ap=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 yc;return a.issues.length?{success:!1,error:new(e??B1)(a.issues.map(l=>ri(l,i,ni())))}:{success:!0,data:a.value}},n5=ap(F1),cp=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(l=>ri(l,i,ni())))}:{success:!0,data:a.value}},r5=cp(F1),s5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Sb(e)(t,n,i)},o5=e=>(t,n,s)=>Sb(e)(t,n,s),i5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return _b(e)(t,n,i)},a5=e=>async(t,n,s)=>_b(e)(t,n,s),c5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return ap(e)(t,n,i)},l5=e=>(t,n,s)=>ap(e)(t,n,s),u5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return cp(e)(t,n,i)},f5=e=>async(t,n,s)=>cp(e)(t,n,s),d5=/^[cC][^\s-]{8,}$/,h5=/^[0-9a-z]+$/,p5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,m5=/^[0-9a-vA-V]{20}$/,g5=/^[A-Za-z0-9]{27}$/,y5=/^[a-zA-Z0-9_-]{21}$/,v5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,b5=/^([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})$/,bE=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)$/,x5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,S5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _5(){return new RegExp(S5,"u")}const w5=/^(?:(?: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])$/,E5=/^(([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}|:))$/,T5=/^((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])$/,C5=/^(([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])$/,R5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,H1=/^[A-Za-z0-9_-]*$/,N5=/^\+[1-9]\d{6,14}$/,q1="(?:(?:\\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])))",j5=new RegExp(`^${q1}$`);function V1(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 A5(e){return new RegExp(`^${V1(e)}$`)}function k5(e){const t=V1({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(`^${q1}T(?:${s})$`)}const O5=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},M5=/^-?\d+$/,K1=/^-?\d+(?:\.\d+)?$/,I5=/^(?:true|false)$/i,P5=/^[^A-Z]*$/,D5=/^[^a-z]*$/,Qn=ue("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),G1={number:"number",bigint:"bigint",object:"date"},Z1=ue("$ZodCheckLessThan",(e,t)=>{Qn.init(e,t);const n=G1[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})}}),Y1=ue("$ZodCheckGreaterThan",(e,t)=>{Qn.init(e,t);const n=G1[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})}}),z5=ue("$ZodCheckMultipleOf",(e,t)=>{Qn.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):B4(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})}}),L5=ue("$ZodCheckNumberFormat",(e,t)=>{Qn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),s=n?"int":"number",[i,a]=K4[t.format];e._zod.onattach.push(l=>{const f=l._zod.bag;f.format=t.format,f.minimum=i,f.maximum=a,n&&(f.pattern=M5)}),e._zod.check=l=>{const f=l.value;if(n){if(!Number.isInteger(f)){l.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?l.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}):l.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&&l.issues.push({origin:"number",input:f,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),f>a&&l.issues.push({origin:"number",input:f,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),U5=ue("$ZodCheckMaxLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!vb(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 l=xb(i);s.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),$5=ue("$ZodCheckMinLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!vb(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 l=xb(i);s.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),B5=ue("$ZodCheckLengthEquals",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!vb(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 l=xb(i),f=a>t.length;s.issues.push({origin:l,...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})}}),lp=ue("$ZodCheckStringFormat",(e,t)=>{var n,s;Qn.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=()=>{})}),F5=ue("$ZodCheckRegex",(e,t)=>{lp.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})}}),H5=ue("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=P5),lp.init(e,t)}),q5=ue("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=D5),lp.init(e,t)}),V5=ue("$ZodCheckIncludes",(e,t)=>{Qn.init(e,t);const n=Dc(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})}}),K5=ue("$ZodCheckStartsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`^${Dc(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})}}),G5=ue("$ZodCheckEndsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`.*${Dc(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})}}),Z5=ue("$ZodCheckOverwrite",(e,t)=>{Qn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Y5{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(`
20
+ Error:`,i)}}function vz(){return sz(e=>{Vu("cls",{metric:e}),y1=e},{reportAllChanges:!0})}function bz(){return hz(e=>{Vu("lcp",{metric:e}),v1=e},{reportAllChanges:!0})}function xz(){return mz(e=>{Vu("ttfb",{metric:e}),b1=e})}function Sz(){return uz(e=>{Vu("inp",{metric:e}),x1=e})}function ap(e,t,n,s,i=!1){w1(e,t);let a;return wh[e]||(a=n(),wh[e]=!0),s&&t({metric:s}),E1(e,t,i?a:void 0)}function _z(e){const t={};e==="event"&&(t.durationThreshold=0),Qc(e,n=>{Vu(e,{entries:n})},t)}function w1(e,t){uu[e]=uu[e]||[],uu[e].push(t)}function E1(e,t,n){return()=>{n&&n();const s=uu[e];if(!s)return;const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}function wz(e){return"duration"in e}const Ez=e=>{const t=n=>{(n.type==="pagehide"||Ge.document?.visibilityState==="hidden")&&e(n)};Zo("visibilitychange",t,{capture:!0,once:!0}),Zo("pagehide",t,{capture:!0,once:!0})};function Jg(e){return typeof e=="number"&&isFinite(e)}function ti(e,t,n,{...s}){const i=yt(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),nb(e,()=>{const a=Zc({startTime:t,...s});return a&&a.end(n),a})}function yb(e){const t=vt();if(!t)return;const{name:n,transaction:s,attributes:i,startTime:a}=e,{release:l,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:l,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 Zc({name:n,attributes:w,startTime:a,experimental:{standalone:!0}})}function Ku(){return Ge.addEventListener&&Ge.performance}function Xt(e){return e/1e3}function Tz(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}Ez(()=>{i("pagehide")});const a=e.on("beforeStartNavigationSpan",(f,d)=>{d?.isRedirect||(i("navigation"),a(),l())}),l=e.on("afterStartPageLoadSpan",f=>{n=f.spanContext().spanId,l()})}function Cz(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)=>{Rz(t,n,a,i),s()})}function Rz(e,t,n,s){$u&&be.log(`Sending CLS span (${e})`);const i=t?Xt((Sr()||0)+t.startTime):cn(),a=bt().getScopeData().transactionName,l=t?Vr(t.sources[0]?.node):"Layout shift",f={[gn]:"auto.http.browser.cls",[eo]:"ui.webvital.cls",[Kc]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t?.sources&&t.sources.forEach((p,g)=>{f[`cls.source.${g+1}`]=Vr(p.node)});const d=yb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("cls",{[zu]:"",[Lu]:e}),d.end(i))}function Nz(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)=>{jz(t,n,a,i),s()})}function jz(e,t,n,s){$u&&be.log(`Sending LCP span (${e})`);const i=Xt((Sr()||0)+(t?.startTime||0)),a=bt().getScopeData().transactionName,l=t?Vr(t.element):"Largest contentful paint",f={[gn]:"auto.http.browser.lcp",[eo]:"ui.webvital.lcp",[Kc]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t&&(t.element&&(f["lcp.element"]=Vr(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=yb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("lcp",{[zu]:"millisecond",[Lu]:e}),d.end(i))}function Pr(e){return e&&((Sr()||performance.timeOrigin)+e)/1e3}function R1(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:s}=Tz(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=n}return Sr()||Ku()?.timeOrigin?Az({...t,"http.request.redirect_start":Pr(e.redirectStart),"http.request.redirect_end":Pr(e.redirectEnd),"http.request.worker_start":Pr(e.workerStart),"http.request.fetch_start":Pr(e.fetchStart),"http.request.domain_lookup_start":Pr(e.domainLookupStart),"http.request.domain_lookup_end":Pr(e.domainLookupEnd),"http.request.connect_start":Pr(e.connectStart),"http.request.secure_connection_start":Pr(e.secureConnectionStart),"http.request.connection_end":Pr(e.connectEnd),"http.request.request_start":Pr(e.requestStart),"http.request.response_start":Pr(e.responseStart),"http.request.response_end":Pr(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Az(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const kz=2147483647;let iE=0,ns={},Kn,Eh;function Oz({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const s=Ku();if(s&&Sr()){s.mark&&Ge.performance.mark("sentry-tracing-init");const i=t?Nz(n):zz(),a=Lz(),l=e?Cz(n):Dz();return()=>{i?.(),a(),l?.()}}return()=>{}}function Mz(){Mc("longtask",({entries:e})=>{const t=Xn();if(!t)return;const{op:n,start_timestamp:s}=yt(t);for(const i of e){const a=Xt(Sr()+i.startTime),l=Xt(i.duration);n==="navigation"&&s&&a<s||ti(t,a,a+l,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[gn]:"auto.ui.browser.metrics"}})}})}function Iz(){new PerformanceObserver(t=>{const n=Xn();if(n)for(const s of t.getEntries()){if(!s.scripts[0])continue;const i=Xt(Sr()+s.startTime),{start_timestamp:a,op:l}=yt(n);if(l==="navigation"&&a&&i<a)continue;const f=Xt(s.duration),d={[gn]:"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),ti(n,i,i+f,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:d})}}).observe({type:"long-animation-frame",buffered:!0})}function Pz(){Mc("event",({entries:e})=>{const t=Xn();if(t){for(const n of e)if(n.name==="click"){const s=Xt(Sr()+n.startTime),i=Xt(n.duration),a={name:Vr(n.target),op:`ui.interaction.${n.name}`,startTime:s,attributes:{[gn]:"auto.ui.browser.metrics"}},l=lR(n.target);l&&(a.attributes["ui.component_name"]=l),ti(t,s,s+i,a)}}})}function Dz(){return S1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ns.cls={value:e.value,unit:""},Eh=t)},!0)}function zz(){return _1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ns.lcp={value:e.value,unit:"millisecond"},Kn=t)},!0)}function Lz(){return gz(({metric:e})=>{e.entries[e.entries.length-1]&&(ns.ttfb={value:e.value,unit:"millisecond"})})}function Uz(e,t){const n=Ku(),s=Sr();if(!n?.getEntries||!s)return;const i=Xt(s),a=n.getEntries(),{op:l,start_timestamp:f}=yt(e);a.slice(iE).forEach(d=>{const p=Xt(d.startTime),g=Xt(Math.max(0,d.duration));if(!(l==="navigation"&&f&&i+p<f))switch(d.entryType){case"navigation":{Hz(e,d,i);break}case"mark":case"paint":case"measure":{Bz(e,d,p,g,i,t.ignorePerformanceApiSpans);const y=Hu(),b=d.startTime<y.firstHiddenTime;d.name==="first-paint"&&b&&(ns.fp={value:d.startTime,unit:"millisecond"}),d.name==="first-contentful-paint"&&b&&(ns.fcp={value:d.startTime,unit:"millisecond"});break}case"resource":{Kz(e,d,d.name,p,g,i,t.ignoreResourceSpans);break}}}),iE=Math.max(a.length-1,0),Gz(e),l==="pageload"&&(Xz(ns),t.recordClsOnPageloadSpan||delete ns.cls,t.recordLcpOnPageloadSpan||delete ns.lcp,Object.entries(ns).forEach(([d,p])=>{fP(d,p.value,p.unit)}),e.setAttribute("performance.timeOrigin",i),e.setAttribute("performance.activationStart",Xc()),Zz(e,t)),Kn=void 0,Eh=void 0,ns={}}function $z(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function Bz(e,t,n,s,i,a){if($z(t)||["mark","measure"].includes(t.entryType)&&Ko(t.name,a))return;const l=Fu(!1),f=Xt(l?l.requestStart:0),d=i+Math.max(n,f),p=i+n,g=p+s,y={[gn]:"auto.resource.browser.metrics"};d!==p&&(y["sentry.browser.measure_happened_before_request"]=!0,y["sentry.browser.measure_start_time"]=d),Fz(y,t),d<=g&&ti(e,d,g,{name:t.name,op:t.entryType,attributes:y})}function Fz(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[s,i]of Object.entries(n))if(i&&Cc(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(Cc(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Hz(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(s=>{Td(e,t,s,n)}),Td(e,t,"secureConnection",n,"TLS/SSL"),Td(e,t,"fetch",n,"cache"),Td(e,t,"domainLookup",n,"DNS"),Vz(e,t,n)}function Td(e,t,n,s,i=n){const a=qz(n),l=t[a],f=t[`${n}Start`];!f||!l||ti(e,s+Xt(f),s+Xt(l),{op:`browser.${i}`,name:t.name,attributes:{[gn]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function qz(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Vz(e,t,n){const s=n+Xt(t.requestStart),i=n+Xt(t.responseEnd),a=n+Xt(t.responseStart);t.responseEnd&&(ti(e,s,i,{op:"browser.request",name:t.name,attributes:{[gn]:"auto.ui.browser.metrics"}}),ti(e,a,i,{op:"browser.response",name:t.name,attributes:{[gn]:"auto.ui.browser.metrics"}}))}function Kz(e,t,n,s,i,a,l){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const f=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(l?.includes(f))return;const d={[gn]:"auto.resource.browser.metrics"},p=ta(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),Yz(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;ti(e,y,b,{name:n.replace(Ge.location.origin,""),op:f,attributes:g})}function Gz(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),Jg(n.rtt)&&(ns["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Jg(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Jg(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function Zz(e,t){Kn&&t.recordLcpOnPageloadSpan&&(Kn.element&&e.setAttribute("lcp.element",Vr(Kn.element)),Kn.id&&e.setAttribute("lcp.id",Kn.id),Kn.url&&e.setAttribute("lcp.url",Kn.url.trim().slice(0,200)),Kn.loadTime!=null&&e.setAttribute("lcp.loadTime",Kn.loadTime),Kn.renderTime!=null&&e.setAttribute("lcp.renderTime",Kn.renderTime),e.setAttribute("lcp.size",Kn.size)),Eh?.sources&&t.recordClsOnPageloadSpan&&Eh.sources.forEach((n,s)=>e.setAttribute(`cls.source.${s+1}`,Vr(n.node)))}function Yz(e,t,n){n.forEach(([s,i])=>{const a=e[s];a!=null&&(typeof a=="number"&&a<kz||typeof a=="string")&&(t[i]=a)})}function Xz(e){const t=Fu(!1);if(!t)return;const{responseStart:n,requestStart:s}=t;s<=n&&(e["ttfb.requestTime"]={value:n-s,unit:"millisecond"})}function Qz(){return Ku()&&Sr()?Mc("element",Wz):()=>{}}const Wz=({entries:e})=>{const t=Xn(),n=t?Dn(t):void 0,s=n?yt(n).description:bt().getScopeData().transactionName;e.forEach(i=>{const a=i;if(!a.identifier)return;const l=a.name,f=a.renderTime,d=a.loadTime,[p,g]=d?[Xt(d),"load-time"]:f?[Xt(f),"render-time"]:[cn(),"entry-emission"],y=l==="image-paint"?Xt(Math.max(0,(f??0)-(d??0))):0,b={[gn]:"auto.ui.browser.elementtiming",[eo]:"ui.elementtiming",[vs]:"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":l};IR({name:`element[${a.identifier}]`,attributes:b,startTime:p,onlyIfParent:!0},x=>{x.end(p+y)})})},Jz=1e3;let aE,cv,lv;function eL(e){ci("dom",e),li("dom",tL)}function tL(){if(!Ge.document)return;const e=Hr.bind(null,"dom"),t=cE(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")&&(gr(i,"addEventListener",function(a){return function(l,f,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},g=p[l]=p[l]||{refCount:0};if(!g.handler){const y=cE(e);g.handler=y,a.call(this,l,y,d)}g.refCount++}catch{}return a.call(this,l,f,d)}}),gr(i,"removeEventListener",function(a){return function(l,f,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__||{},g=p[l];g&&(g.refCount--,g.refCount<=0&&(a.call(this,l,g.handler,d),g.handler=void 0,delete p[l]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,f,d)}}))})}function nL(e){if(e.type!==cv)return!1;try{if(!e.target||e.target._sentryId!==lv)return!1}catch{}return!0}function rL(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function cE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const s=sL(n);if(rL(n.type,s))return;Yn(n,"_sentryCaptured",!0),s&&!s._sentryId&&Yn(s,"_sentryId",qr());const i=n.type==="keypress"?"input":n.type;nL(n)||(e({event:n,name:i,global:t}),cv=n.type,lv=s?s._sentryId:void 0),clearTimeout(aE),aE=Ge.setTimeout(()=>{lv=void 0,cv=void 0},Jz)}}function sL(e){try{return e.target}catch{return null}}let Cd;function vb(e){const t="history";ci(t,e),li(t,oL)}function oL(){if(Ge.addEventListener("popstate",()=>{const t=Ge.location.href,n=Cd;if(Cd=t,n===t)return;Hr("history",{from:n,to:t})}),!E2())return;function e(t){return function(...n){const s=n.length>2?n[2]:void 0;if(s){const i=Cd,a=iL(String(s));if(Cd=a,i===a)return t.apply(this,n);Hr("history",{from:i,to:a})}return t.apply(this,n)}}gr(Ge.history,"pushState",e),gr(Ge.history,"replaceState",e)}function iL(e){try{return new URL(e,Ge.location.origin).toString()}catch{return e}}const rh={};function aL(e){const t=rh[e];if(t)return t;let n=Ge[e];if(rv(n))return rh[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){$u&&be.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n&&(rh[e]=n.bind(Ge))}function cL(e){rh[e]=void 0}const fc="__sentry_xhr_v3__";function N1(e){ci("xhr",e),li("xhr",lL)}function lL(){if(!Ge.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,s){const i=new Error,a=cn()*1e3,l=Gs(s[0])?s[0].toUpperCase():void 0,f=uL(s[1]);if(!l||!f)return t.apply(n,s);n[fc]={method:l,url:f,request_headers:{}},l==="POST"&&f.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const d=()=>{const p=n[fc];if(p&&n.readyState===4){try{p.status_code=n.status}catch{}const g={endTimestamp:cn()*1e3,startTimestamp:a,xhr:n,virtualError:i};Hr("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[fc];return S&&Gs(b)&&Gs(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[fc];if(!i)return t.apply(n,s);s[0]!==void 0&&(i.body=s[0]);const a={startTimestamp:cn()*1e3,xhr:n};return Hr("xhr",a),t.apply(n,s)}})}function uL(e){if(Gs(e))return e;try{return e.toString()}catch{}}function fL(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return $u&&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 ey=[],sh=new Map,cc=new Map,dL=60;function hL(){if(Ku()&&Sr()){const t=pL();return()=>{t()}}return()=>{}}const uv={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 pL(){return yz(mL)}const mL=({metric:e})=>{if(e.value==null)return;const t=Xt(e.value);if(t>dL)return;const n=e.entries.find(S=>S.duration===e.value&&uv[S.name]);if(!n)return;const{interactionId:s}=n,i=uv[n.name],a=Xt(Sr()+n.startTime),l=Xn(),f=l?Dn(l):void 0,d=s!=null?sh.get(s):void 0,p=d?.span||f,g=p?yt(p).description:bt().getScopeData().transactionName,y=d?.elementName||Vr(n.target),b={[gn]:"auto.http.browser.inp",[eo]:`ui.interaction.${i}`,[Kc]:n.duration},x=yb({name:y,transaction:g,attributes:b,startTime:a});x&&(x.addEvent("inp",{[zu]:"millisecond",[Lu]:e.value}),x.end(a+t))};function gL(){const e=Object.keys(uv);P2()&&e.forEach(i=>{Ge.addEventListener(i,t,{capture:!0,passive:!0})});function t(i){const a=i.target;if(!a)return;const l=Vr(a),f=Math.round(i.timeStamp);if(cc.set(f,l),cc.size>50){const d=cc.keys().next().value;d!==void 0&&cc.delete(d)}}function n(i){const a=Math.round(i.startTime);let l=cc.get(a);if(!l)for(let f=-5;f<=5;f++){const d=cc.get(a+f);if(d){l=d;break}}return l||"<unknown>"}const s=({entries:i})=>{const a=Xn(),l=a&&Dn(a);i.forEach(f=>{if(!wz(f))return;const d=f.interactionId;if(d==null||sh.has(d))return;const p=f.target?Vr(f.target):n(f);if(ey.length>10){const g=ey.shift();sh.delete(g)}ey.push(d),sh.set(d,{span:l,elementName:p})})};Mc("event",s),Mc("first-input",s)}const yL=40;function vL(e,t=aL("fetch")){let n=0,s=0;async function i(a){const l=a.body.length;n+=l,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 cL("fetch"),d}finally{n-=l,s--}}return gD(e,i,lb(e.bufferSize||yL))}const Kr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,bL=30,xL=50;function fv(e,t,n,s){const i={filename:e,function:t==="<anonymous>"?sa:t,in_app:!0};return n!==void 0&&(i.lineno=n),s!==void 0&&(i.colno=s),i}const SL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_L=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,wL=/\((\S*)(?::(\d+))(?::(\d+))\)/,EL=/at (.+?) ?\(data:(.+?),/,TL=e=>{const t=e.match(EL);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=SL.exec(e);if(n){const[,i,a,l]=n;return fv(i,sa,+a,+l)}const s=_L.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){const f=wL.exec(s[2]);f&&(s[2]=f[1],s[3]=f[2],s[4]=f[3])}const[a,l]=j1(s[1]||sa,s[2]);return fv(l,a,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},CL=[bL,TL],RL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,NL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,jL=e=>{const t=RL.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const a=NL.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]||sa;return[i,s]=j1(i,s),fv(s,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},AL=[xL,jL],kL=[CL,AL],OL=nR(...kL),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]:sa,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Rd=1024,ML="Breadcrumbs",IL=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:ML,setup(n){t.console&&JD(LL(n)),t.dom&&eL(zL(n,t.dom)),t.xhr&&N1(UL(n)),t.fetch&&c1($L(n)),t.history&&vb(BL(n)),t.sentry&&n.on("beforeSendEvent",DL(n))}}}),PL=IL;function DL(e){return function(n){vt()===e&&oa({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Ki(n)},{event:n})}}function zL(e,t){return function(s){if(vt()!==e)return;let i,a,l=typeof t=="object"?t.serializeAttribute:void 0,f=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;f&&f>Rd&&(Kr&&be.warn(`\`dom.maxStringLength\` cannot exceed ${Rd}, but a value of ${f} was configured. Sentry will use ${Rd} instead.`),f=Rd),typeof l=="string"&&(l=[l]);try{const p=s.event,g=FL(p)?p.target:p;i=Vr(g,{keyAttrs:l,maxStringLength:f}),a=lR(g)}catch{i="<unknown>"}if(i.length===0)return;const d={category:`ui.${s.name}`,message:i};a&&(d.data={"ui.component_name":a}),oa(d,{event:s.event,name:s.name,global:s.global})}}function LL(e){return function(n){if(vt()!==e)return;const s={category:"console",data:{arguments:n.args,logger:"console"},level:t2(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;oa(s,{input:n.args,level:n.level})}}function UL(e){return function(n){if(vt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n,a=n.xhr[fc];if(!s||!i||!a)return;const{method:l,url:f,status_code:d,body:p}=a,g={method:l,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),oa(b,y)}}function $L(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,l={data:n.error,input:n.args,startTimestamp:s,endTimestamp:i},f={category:"fetch",data:a,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",f,l),oa(f,l)}else{const a=n.response,l={...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:l,type:"http",level:a1(l.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",d,f),oa(d,f)}}}function BL(e){return function(n){if(vt()!==e)return;let s=n.from,i=n.to;const a=ta(st.location.href);let l=s?ta(s):void 0;const f=ta(i);l?.path||(l=a),a.protocol===f.protocol&&a.host===f.host&&(i=f.relative),a.protocol===l.protocol&&a.host===l.host&&(s=l.relative),oa({category:"navigation",data:{from:s,to:i}})}}function FL(e){return!!e&&!!e.target}const HL=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],qL="BrowserApiErrors",VL=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:qL,setupOnce(){t.setTimeout&&gr(st,"setTimeout",lE),t.setInterval&&gr(st,"setInterval",lE),t.requestAnimationFrame&&gr(st,"requestAnimationFrame",GL),t.XMLHttpRequest&&"XMLHttpRequest"in st&&gr(XMLHttpRequest.prototype,"send",ZL);const n=t.eventTarget;n&&(Array.isArray(n)?n:HL).forEach(i=>YL(i,t))}}}),KL=VL;function lE(e){return function(...t){const n=t[0];return t[0]=Oc(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Xs(e)}`}}),e.apply(this,t)}}function GL(e){return function(t){return e.apply(this,[Oc(t,{mechanism:{data:{handler:Xs(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function ZL(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&gr(n,i,function(a){const l={mechanism:{data:{handler:Xs(a)},handled:!1,type:`auto.browser.browserapierrors.xhr.${i}`}},f=Zv(a);return f&&(l.mechanism.data.handler=Xs(f)),Oc(a,l)})}),e.apply(this,t)}}function YL(e,t){const s=st[e]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(gr(s,"addEventListener",function(i){return function(a,l,f){try{XL(l)&&(l.handleEvent=Oc(l.handleEvent,{mechanism:{data:{handler:Xs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&QL(this,a,l),i.apply(this,[a,Oc(l,{mechanism:{data:{handler:Xs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),f])}}),gr(s,"removeEventListener",function(i){return function(a,l,f){try{const d=l.__sentry_wrapped__;d&&i.call(this,a,d,f)}catch{}return i.call(this,a,l,f)}}))}function XL(e){return typeof e.handleEvent=="function"}function QL(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const WL=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof st.document>"u"){Kr&&be.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Lw({ignoreDuration:!0}),Gg();const n=Zr();let s=n.getUser();n.addScopeListener(i=>{const a=i.getUser();(s?.id!==a?.id||s?.ip_address!==a?.ip_address)&&(Gg(),s=a)}),t==="route"&&vb(({from:i,to:a})=>{i!==a&&(Lw({ignoreDuration:!0}),Gg())})}}},JL="CultureContext",e4=(()=>({name:JL,preprocessEvent(e){const t=n4();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})),t4=e4;function n4(){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 r4="GlobalHandlers",s4=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:r4,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(i4(n),uE("onerror")),t.onunhandledrejection&&(a4(n),uE("onunhandledrejection"))}}}),o4=s4;function i4(e){sR(t=>{const{stackParser:n,attachStacktrace:s}=A1();if(vt()!==e||u1())return;const{msg:i,url:a,line:l,column:f,error:d}=t,p=u4(pb(n,d||i,void 0,s,!1),a,l,f);p.level="error",$R(p,{originalException:d,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function a4(e){oR(t=>{const{stackParser:n,attachStacktrace:s}=A1();if(vt()!==e||u1())return;const i=c4(t),a=Cc(i)?l4(i):pb(n,i,void 0,s,!0);a.level="error",$R(a,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function c4(e){if(Cc(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 l4(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function u4(e,t,n,s){const i=e.exception=e.exception||{},a=i.values=i.values||[],l=a[0]=a[0]||{},f=l.stacktrace=l.stacktrace||{},d=f.frames=f.frames||[],p=s,g=n,y=f4(t)??Ou();return d.length===0&&d.push({colno:p,filename:y,function:sa,in_app:!0,lineno:g}),e}function uE(e){Kr&&be.log(`Global Handler attached: ${e}`)}function A1(){return vt()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function f4(e){if(!(!Gs(e)||e.length===0))return e.startsWith("data:")?`<${Go(e,!1)}>`:e}const d4=()=>({name:"HttpContext",preprocessEvent(e){if(!st.navigator&&!st.location&&!st.document)return;const t=fb(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),h4="cause",p4=5,m4="LinkedErrors",g4=((e={})=>{const t=e.limit||p4,n=e.key||h4;return{name:m4,preprocessEvent(s,i,a){const l=a.getOptions();WD(db,l.stackParser,n,t,s,i)}}}),y4=g4;function v4(){return b4()?(Kr&&ha(()=>{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 b4(){if(typeof st.window>"u")return!1;const e=st;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=Ou(),s=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(st===st.top&&s.some(a=>n.startsWith(`${a}://`)))}function x4(e){return[qD(),$D(),u2(),KL(),PL(),o4(),y4(),s2(),d4(),t4(),WL()]}function S4(e={}){const t=!e.skipBrowserExtensionCheck&&v4();let n=e.defaultIntegrations==null?x4():e.defaultIntegrations;const s={...e,enabled:t?!1:e.enabled,stackParser:BM(e.stackParser||OL),integrations:GP({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||vL};return RD(Y2,s)}function _4(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function k1(e){try{return new URL(e,st.location.origin).href}catch{return}}function w4(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function O1(e){try{return new Headers(e)}catch{return}}const fE=new WeakMap,ty=new Map,M1={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function E4(e,t){const{traceFetch:n,traceXHR:s,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:a,enableHTTPTimings:l,tracePropagationTargets:f,onRequestSpanStart:d,onRequestSpanEnd:p}={...M1,...t},g=typeof a=="function"?a:S=>!0,y=S=>T4(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=ty.get(w.span_id);T&&(w.timestamp=T/1e3,ty.delete(w.span_id))}}),S)),i&&R2(S=>{if(S.response){const w=fE.get(S.response);w&&S.endTimestamp&&ty.set(w,S.endTimestamp)}}),c1(S=>{const w=f2(S,g,y,b,{propagateTraceparent:x,onRequestSpanEnd:p});if(S.response&&S.fetchData.__span&&fE.set(S.response,S.fetchData.__span),w){const T=k1(S.fetchData.url),C=T?ta(T).host:void 0;w.setAttributes({"http.url":T?Go(T):void 0,"server.address":C}),l&&dE(w),d?.(w,{headers:S.headers})}})),s&&N1(S=>{const w=C4(S,g,y,b,x,p);w&&(l&&dE(w),d?.(w,{headers:O1(S.xhr.__sentry_xhr_v3__?.request_headers)}))})}function dE(e){const{url:t}=yt(e).data;if(!t||typeof t!="string")return;const n=Mc("resource",({entries:s})=>{s.forEach(i=>{w4(i)&&i.name.endsWith(t)&&(e.setAttributes(R1(i)),setTimeout(n))})})}function T4(e,t){const n=Ou();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?Ko(s.toString(),t)||a&&Ko(s.pathname,t):a}else{const s=!!e.match(/^\/(?!\/)/);return t?Ko(e,t):s}}function C4(e,t,n,s,i,a){const l=e.xhr,f=l?.[fc];if(!l||l.__sentry_own_request__||!f)return;const{url:d,method:p}=f,g=ss()&&t(d);if(e.endTimestamp){const C=l.__sentry_xhr_span_id__;if(!C)return;const k=s[C];k&&(g&&f.status_code!==void 0&&(gR(k,f.status_code),k.end(),a?.(k,{headers:O1(fL(l)),error:e.error})),delete s[C]);return}const y=k1(d),b=ta(y||d),x=Go(kD(d)),S=!!Xn(),w=g&&S?Zc({name:`${p} ${x}`,attributes:{url:Go(d),type:"xhr","http.method":p,"http.url":y?Go(y):void 0,"server.address":b?.host,[gn]:"auto.http.browser",[eo]:"http.client",...b?.search&&{"http.query":b?.search},...b?.hash&&{"http.fragment":b?.hash}}}):new ei;l.__sentry_xhr_span_id__=w.spanContext().spanId,s[l.__sentry_xhr_span_id__]=w,n(d)&&R4(l,ss()&&S?w:void 0,i);const T=vt();return T&&T.emit("beforeOutgoingRequestSpan",w,e),w}function R4(e,t,n){const{"sentry-trace":s,baggage:i,traceparent:a}=r1({span:t,propagateTraceparent:n});s&&N4(e,s,i,a)}function N4(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||!_4(a))&&e.setRequestHeader("baggage",n)}}catch{}}function j4(){st.document?st.document.addEventListener("visibilitychange",()=>{const e=Xn();if(!e)return;const t=Dn(e);if(st.document.hidden&&t){const n="cancelled",{op:s,status:i}=yt(t);Kr&&be.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${s}`),i||t.setStatus({code:hn,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Kr&&be.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const A4=3600,I1="sentry_previous_trace",k4="sentry.previous_trace";function O4(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const s=t==="session-storage";let i=s?P4():void 0;e.on("spanStart",l=>{if(Dn(l)!==l)return;const f=bt().getPropagationContext();i=M4(i,l,f),s&&I4(i)});let a=!0;n&&e.on("beforeSampling",l=>{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(dv(i.spanContext))},sampleRand:i.sampleRand}),l.parentSampled=dv(i.spanContext),l.parentSampleRate=i.sampleRate,l.spanAttributes={...l.spanAttributes,[mR]:i.sampleRate}})}function M4(e,t,n){const s=yt(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(s.data?.[Yv])}catch{return 0}}const a={spanContext:t.spanContext(),startTimestamp:s.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;const l=e.spanContext;return l.traceId===s.trace_id?e:(Date.now()/1e3-e.startTimestamp<=A4&&(Kr&&be.log(`Adding previous_trace \`${JSON.stringify(l)}\` link to span \`${JSON.stringify({op:s.op,...t.spanContext()})}\``),t.addLink({context:l,attributes:{[pI]:"previous_trace"}}),t.setAttribute(k4,`${l.traceId}-${l.spanId}-${dv(l)?1:0}`)),a)}function I4(e){try{st.sessionStorage.setItem(I1,JSON.stringify(e))}catch(t){Kr&&be.warn("Could not store previous trace in sessionStorage",t)}}function P4(){try{const e=st.sessionStorage?.getItem(I1);return JSON.parse(e)}catch{return}}function dv(e){return e.traceFlags===1}const D4="BrowserTracing",z4={...Jd,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:{},...M1},L4=((e={})=>{const t={name:void 0,source:void 0},n=st.document,{enableInp:s,enableElementTiming:i,enableLongTask:a,enableLongAnimationFrame:l,_experiments:{enableInteractions:f,enableStandaloneClsSpans:d,enableStandaloneLcpSpans:p},beforeStartSpan:g,idleTimeout:y,finalTimeout:b,childSpanTimeout:x,markBackgroundSpan:S,traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,shouldCreateSpanForRequest:k,enableHTTPTimings:N,ignoreResourceSpans:R,ignorePerformanceApiSpans:M,instrumentPageLoad:L,instrumentNavigation:j,detectRedirects:A,linkPreviousTrace:P,consistentTraceSampling:G,enableReportPageLoaded:B,onRequestSpanStart:z,onRequestSpanEnd:Q}={...z4,...e};let Y,ee,D;function K(q,V,U=!0){const I=V.op==="pageload",H=V.name,W=g?g(V):V,X=W.attributes||{};if(H!==W.name&&(X[vs]="custom",W.attributes=X),!U){const de=pa();Zc({...W,startTime:de}).end(de);return}t.name=W.name,t.source=X[vs];const oe=LR(W,{idleTimeout:y,finalTimeout:b,childSpanTimeout:x,disableAutoFinish:I,beforeSpanEnd:de=>{Y?.(),Uz(de,{recordClsOnPageloadSpan:!d,recordLcpOnPageloadSpan:!p,ignoreResourceSpans:R,ignorePerformanceApiSpans:M}),mE(q,void 0);const xe=bt(),he=xe.getPropagationContext();xe.setPropagationContext({...he,traceId:oe.spanContext().traceId,sampled:ui(oe),dsc:to(de)}),I&&(D=void 0)},trimIdleSpanEndTimestamp:!B});I&&B&&(D=oe),mE(q,oe);function se(){n&&["interactive","complete"].includes(n.readyState)&&q.emit("idleSpanEnableAutoFinish",oe)}I&&!B&&n&&(n.addEventListener("readystatechange",()=>{se()}),se())}return{name:D4,setup(q){if(HI(),Y=Oz({recordClsStandaloneSpans:d||!1,recordLcpStandaloneSpans:p||!1,client:q}),s&&hL(),i&&Qz(),l&&ct.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?Iz():a&&Mz(),f&&Pz(),A&&n){const U=()=>{ee=cn()};addEventListener("click",U,{capture:!0}),addEventListener("keydown",U,{capture:!0,passive:!0})}function V(){const U=_u(q);U&&!yt(U).timestamp&&(Kr&&be.log(`[Tracing] Finishing current active span with op: ${yt(U).op}`),U.setAttribute(vu,"cancelled"),U.end())}q.on("startNavigationSpan",(U,I)=>{if(vt()!==q)return;if(I?.isRedirect){Kr&&be.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),K(q,{op:"navigation.redirect",...U},!1);return}ee=void 0,V(),Zr().setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:ss()?void 0:Zs()});const H=bt();H.setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:ss()?void 0:Zs()}),H.setSDKProcessingMetadata({normalizedRequest:void 0}),K(q,{op:"navigation",...U,parentSpan:null,forceTransaction:!0})}),q.on("startPageLoadSpan",(U,I={})=>{if(vt()!==q)return;V();const H=I.sentryTrace||hE("sentry-trace")||pE("sentry-trace"),W=I.baggage||hE("baggage")||pE("baggage"),X=PI(H,W),oe=bt();oe.setPropagationContext(X),ss()||(oe.getPropagationContext().propagationSpanId=Zs()),oe.setSDKProcessingMetadata({normalizedRequest:fb()}),K(q,{op:"pageload",...U})}),q.on("endPageloadSpan",()=>{B&&D&&(D.setAttribute(vu,"reportPageLoaded"),D.end())})},afterAllSetup(q){let V=Ou();if(P!=="off"&&O4(q,{linkPreviousTrace:P,consistentTraceSampling:G}),st.location){if(L){const U=Sr();U4(q,{name:st.location.pathname,startTime:U?U/1e3:void 0,attributes:{[vs]:"url",[gn]:"auto.pageload.browser"}})}j&&vb(({to:U,from:I})=>{if(I===void 0&&V?.indexOf(U)!==-1){V=void 0;return}V=void 0;const H=t1(U),W=_u(q),X=W&&A&&F4(W,ee);$4(q,{name:H?.pathname||st.location.pathname,attributes:{[vs]:"url",[gn]:"auto.navigation.browser"}},{url:U,isRedirect:X})})}S&&j4(),f&&B4(q,y,b,x,t),s&&gL(),E4(q,{traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,tracePropagationTargets:q.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:k,enableHTTPTimings:N,onRequestSpanStart:z,onRequestSpanEnd:Q})}}});function U4(e,t,n){e.emit("startPageLoadSpan",t,n),bt().setTransactionName(t.name);const s=_u(e);return s&&e.emit("afterStartPageLoadSpan",s),s}function $4(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:{...fb(),url:s}}),_u(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 B4(e,t,n,s,i){const a=st.document;let l;const f=()=>{const d="ui.action.click",p=_u(e);if(p){const g=yt(p).op;if(["navigation","pageload"].includes(g)){Kr&&be.warn(`[Tracing] Did not create ${d} span because a pageload or navigation span is in progress.`);return}}if(l&&(l.setAttribute(vu,"interactionInterrupted"),l.end(),l=void 0),!i.name){Kr&&be.warn(`[Tracing] Did not create ${d} transaction because _latestRouteName is missing.`);return}l=LR({name:i.name,op:d,attributes:{[vs]:i.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:s})};a&&addEventListener("click",f,{capture:!0})}const P1="_sentry_idleSpan";function _u(e){return e[P1]}function mE(e,t){Yn(e,P1,t)}const gE=1.5;function F4(e,t){const n=yt(e),s=pa(),i=n.start_timestamp;return!(s-i>gE||t&&s-t<=gE)}function D1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ny={exports:{}},Ke={};var yE;function H4(){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"),l=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,H,W){this.props=I,this.context=H,this.refs=T,this.updater=W||S}C.prototype.isReactComponent={},C.prototype.setState=function(I,H){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,H,"setState")},C.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function k(){}k.prototype=C.prototype;function N(I,H,W){this.props=I,this.context=H,this.refs=T,this.updater=W||S}var R=N.prototype=new k;R.constructor=N,w(R,C.prototype),R.isPureReactComponent=!0;var M=Array.isArray;function L(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function P(I,H,W){var X=W.ref;return{$$typeof:e,type:I,key:H,ref:X!==void 0?X:null,props:W}}function G(I,H){return P(I.type,H,I.props)}function B(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function z(I){var H={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(W){return H[W]})}var Q=/\/+/g;function Y(I,H){return typeof I=="object"&&I!==null&&I.key!=null?z(""+I.key):H.toString(36)}function ee(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(H){I.status==="pending"&&(I.status="fulfilled",I.value=H)},function(H){I.status==="pending"&&(I.status="rejected",I.reason=H)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function D(I,H,W,X,oe){var se=typeof I;(se==="undefined"||se==="boolean")&&(I=null);var de=!1;if(I===null)de=!0;else switch(se){case"bigint":case"string":case"number":de=!0;break;case"object":switch(I.$$typeof){case e:case t:de=!0;break;case g:return de=I._init,D(de(I._payload),H,W,X,oe)}}if(de)return oe=oe(I),de=X===""?"."+Y(I,0):X,M(oe)?(W="",de!=null&&(W=de.replace(Q,"$&/")+"/"),D(oe,H,W,"",function(Me){return Me})):oe!=null&&(B(oe)&&(oe=G(oe,W+(oe.key==null||I&&I.key===oe.key?"":(""+oe.key).replace(Q,"$&/")+"/")+de)),H.push(oe)),1;de=0;var xe=X===""?".":X+":";if(M(I))for(var he=0;he<I.length;he++)X=I[he],se=xe+Y(X,he),de+=D(X,H,W,se,oe);else if(he=x(I),typeof he=="function")for(I=he.call(I),he=0;!(X=I.next()).done;)X=X.value,se=xe+Y(X,he++),de+=D(X,H,W,se,oe);else if(se==="object"){if(typeof I.then=="function")return D(ee(I),H,W,X,oe);throw H=String(I),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return de}function K(I,H,W){if(I==null)return I;var X=[],oe=0;return D(I,X,"","",function(se){return H.call(W,se,oe++)}),X}function q(I){if(I._status===-1){var H=I._result;H=H(),H.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=H)}if(I._status===1)return I._result.default;throw I._result}var V=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=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(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},U={map:K,forEach:function(I,H,W){K(I,function(){H.apply(this,arguments)},W)},count:function(I){var H=0;return K(I,function(){H++}),H},toArray:function(I){return K(I,function(H){return H})||[]},only:function(I){if(!B(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,H,W){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var X=w({},I.props),oe=I.key;if(H!=null)for(se in H.key!==void 0&&(oe=""+H.key),H)!A.call(H,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&H.ref===void 0||(X[se]=H[se]);var se=arguments.length-2;if(se===1)X.children=W;else if(1<se){for(var de=Array(se),xe=0;xe<se;xe++)de[xe]=arguments[xe+2];X.children=de}return P(I.type,oe,X)},Ke.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:a,_context:I},I},Ke.createElement=function(I,H,W){var X,oe={},se=null;if(H!=null)for(X in H.key!==void 0&&(se=""+H.key),H)A.call(H,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(oe[X]=H[X]);var de=arguments.length-2;if(de===1)oe.children=W;else if(1<de){for(var xe=Array(de),he=0;he<de;he++)xe[he]=arguments[he+2];oe.children=xe}if(I&&I.defaultProps)for(X in de=I.defaultProps,de)oe[X]===void 0&&(oe[X]=de[X]);return P(I,se,oe)},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(I){return{$$typeof:f,render:I}},Ke.isValidElement=B,Ke.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:q}},Ke.memo=function(I,H){return{$$typeof:p,type:I,compare:H===void 0?null:H}},Ke.startTransition=function(I){var H=j.T,W={};j.T=W;try{var X=I(),oe=j.S;oe!==null&&oe(W,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(L,V)}catch(se){V(se)}finally{H!==null&&W.types!==null&&(H.types=W.types),j.T=H}},Ke.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ke.use=function(I){return j.H.use(I)},Ke.useActionState=function(I,H,W){return j.H.useActionState(I,H,W)},Ke.useCallback=function(I,H){return j.H.useCallback(I,H)},Ke.useContext=function(I){return j.H.useContext(I)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(I,H){return j.H.useDeferredValue(I,H)},Ke.useEffect=function(I,H){return j.H.useEffect(I,H)},Ke.useEffectEvent=function(I){return j.H.useEffectEvent(I)},Ke.useId=function(){return j.H.useId()},Ke.useImperativeHandle=function(I,H,W){return j.H.useImperativeHandle(I,H,W)},Ke.useInsertionEffect=function(I,H){return j.H.useInsertionEffect(I,H)},Ke.useLayoutEffect=function(I,H){return j.H.useLayoutEffect(I,H)},Ke.useMemo=function(I,H){return j.H.useMemo(I,H)},Ke.useOptimistic=function(I,H){return j.H.useOptimistic(I,H)},Ke.useReducer=function(I,H,W){return j.H.useReducer(I,H,W)},Ke.useRef=function(I){return j.H.useRef(I)},Ke.useState=function(I){return j.H.useState(I)},Ke.useSyncExternalStore=function(I,H,W){return j.H.useSyncExternalStore(I,H,W)},Ke.useTransition=function(){return j.H.useTransition()},Ke.version="19.2.4",Ke}var vE;function Gu(){return vE||(vE=1,ny.exports=H4()),ny.exports}var _=Gu();const Ic=D1(_),z1=MM({__proto__:null,default:Ic},[_]);function q4(e){const t={...e};return n1(t,"react"),UP("react",{version:_.version}),S4(t)}function ue(e,t,n){function s(f,d){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:d,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,d);const p=l.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 l(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(l,"init",{value:s}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class yc 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 ni(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 hv(e,t){return typeof t=="bigint"?t.toString():t}function bb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function xb(e){return e==null}function Sb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function V4(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,l=Number.parseInt(e.toFixed(a).replace(".","")),f=Number.parseInt(t.toFixed(a).replace(".",""));return l%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 ga(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fi(...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 K4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const B1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Th(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const G4=bb(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Pc(e){if(Th(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Th(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function F1(e){return Pc(e)?{...e}:Array.isArray(e)?[...e]:e}const Z4=new Set(["string","number","symbol"]);function Dc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function di(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 Y4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const X4={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 Q4(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=fi(e._zod.def,{get shape(){const l={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}return ga(this,"shape",l),l},checks:[]});return di(e,a)}function W4(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=fi(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}return ga(this,"shape",l),l},checks:[]});return di(e,a)}function J4(e,t){if(!Pc(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 l in t)if(Object.getOwnPropertyDescriptor(a,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=fi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return ga(this,"shape",a),a}});return di(e,i)}function e5(e,t){if(!Pc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=fi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return ga(this,"shape",s),s}});return di(e,n)}function t5(e,t){const n=fi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return ga(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return di(e,n)}function n5(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 l=fi(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 ga(this,"shape",d),d},checks:[]});return di(t,l)}function r5(e,t,n){const s=fi(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(a[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)a[l]=new e({type:"nonoptional",innerType:i[l]});return ga(this,"shape",a),a}});return di(t,s)}function dc(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 hc(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function Nd(e){return typeof e=="string"?e:e?.message}function ri(e,t,n){const s={...e,path:e.path??[]};if(!e.message){const i=Nd(e.inst?._zod.def?.error?.(e))??Nd(t?.error?.(e))??Nd(n.customError?.(e))??Nd(n.localeError?.(e))??"Invalid input";s.message=i}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function _b(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function wu(...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,hv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},q1=ue("$ZodError",H1),V1=ue("$ZodError",H1,{Parent:Error});function s5(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 o5(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(l=>s({issues:l}));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 l=n,f=0;for(;f<a.path.length;){const d=a.path[f];f===a.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],f++}}};return s(e),n}const wb=e=>(t,n,s,i)=>{const a=s?Object.assign(s,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise)throw new yc;if(l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ri(d,a,ni())));throw B1(f,i?.callee),f}return l.value},Eb=e=>async(t,n,s,i)=>{const a=s?Object.assign(s,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise&&(l=await l),l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ri(d,a,ni())));throw B1(f,i?.callee),f}return l.value},cp=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 yc;return a.issues.length?{success:!1,error:new(e??q1)(a.issues.map(l=>ri(l,i,ni())))}:{success:!0,data:a.value}},i5=cp(V1),lp=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(l=>ri(l,i,ni())))}:{success:!0,data:a.value}},a5=lp(V1),c5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return wb(e)(t,n,i)},l5=e=>(t,n,s)=>wb(e)(t,n,s),u5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Eb(e)(t,n,i)},f5=e=>async(t,n,s)=>Eb(e)(t,n,s),d5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return cp(e)(t,n,i)},h5=e=>(t,n,s)=>cp(e)(t,n,s),p5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return lp(e)(t,n,i)},m5=e=>async(t,n,s)=>lp(e)(t,n,s),g5=/^[cC][^\s-]{8,}$/,y5=/^[0-9a-z]+$/,v5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,b5=/^[0-9a-vA-V]{20}$/,x5=/^[A-Za-z0-9]{27}$/,S5=/^[a-zA-Z0-9_-]{21}$/,_5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,w5=/^([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)$/,E5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,T5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function C5(){return new RegExp(T5,"u")}const R5=/^(?:(?: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])$/,N5=/^(([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}|:))$/,j5=/^((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])$/,A5=/^(([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])$/,k5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,K1=/^[A-Za-z0-9_-]*$/,O5=/^\+[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])))",M5=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 I5(e){return new RegExp(`^${Z1(e)}$`)}function P5(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 D5=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},z5=/^-?\d+$/,Y1=/^-?\d+(?:\.\d+)?$/,L5=/^(?:true|false)$/i,U5=/^[^A-Z]*$/,$5=/^[^a-z]*$/,Qn=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)=>{Qn.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)=>{Qn.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})}}),B5=ue("$ZodCheckMultipleOf",(e,t)=>{Qn.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):V4(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})}}),F5=ue("$ZodCheckNumberFormat",(e,t)=>{Qn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),s=n?"int":"number",[i,a]=X4[t.format];e._zod.onattach.push(l=>{const f=l._zod.bag;f.format=t.format,f.minimum=i,f.maximum=a,n&&(f.pattern=z5)}),e._zod.check=l=>{const f=l.value;if(n){if(!Number.isInteger(f)){l.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?l.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}):l.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&&l.issues.push({origin:"number",input:f,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),f>a&&l.issues.push({origin:"number",input:f,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),H5=ue("$ZodCheckMaxLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xb(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 l=_b(i);s.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),q5=ue("$ZodCheckMinLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xb(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 l=_b(i);s.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),V5=ue("$ZodCheckLengthEquals",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xb(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 l=_b(i),f=a>t.length;s.issues.push({origin:l,...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})}}),up=ue("$ZodCheckStringFormat",(e,t)=>{var n,s;Qn.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=()=>{})}),K5=ue("$ZodCheckRegex",(e,t)=>{up.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})}}),G5=ue("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=U5),up.init(e,t)}),Z5=ue("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$5),up.init(e,t)}),Y5=ue("$ZodCheckIncludes",(e,t)=>{Qn.init(e,t);const n=Dc(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})}}),X5=ue("$ZodCheckStartsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`^${Dc(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})}}),Q5=ue("$ZodCheckEndsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`.*${Dc(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})}}),W5=ue("$ZodCheckOverwrite",(e,t)=>{Qn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class J5{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
22
  `).filter(l=>l),i=Math.min(...s.map(l=>l.length-l.trimStart().length)),a=s.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of a)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
23
- `))}}const X5={major:4,minor:3,patch:6},Ft=ue("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=X5;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=(l,f,d)=>{let p=dc(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(p)continue;const b=l.issues.length,x=y._zod.check(l);if(x instanceof Promise&&d?.async===!1)throw new yc;if(g||x instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await x,l.issues.length!==b&&(p||(p=dc(l,b)))});else{if(l.issues.length===b)continue;p||(p=dc(l,b))}}return g?g.then(()=>l):l},a=(l,f,d)=>{if(dc(l))return l.aborted=!0,l;const p=i(f,s,d);if(p instanceof Promise){if(d.async===!1)throw new yc;return p.then(g=>e._zod.parse(g,d))}return e._zod.parse(p,d)};e._zod.run=(l,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const p=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(g=>a(g,l,f)):a(p,l,f)}const d=e._zod.parse(l,f);if(d instanceof Promise){if(f.async===!1)throw new yc;return d.then(p=>i(p,s,f))}return i(d,s,f)}}wt(e,"~standard",()=>({validate:i=>{try{const a=n5(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return r5(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),wb=ue("$ZodString",(e,t)=>{Ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??O5(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}}),Bt=ue("$ZodStringFormat",(e,t)=>{lp.init(e,t),wb.init(e,t)}),Q5=ue("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=b5),Bt.init(e,t)}),W5=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=bE(s))}else t.pattern??(t.pattern=bE());Bt.init(e,t)}),J5=ue("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=x5),Bt.init(e,t)}),eU=ue("$ZodURL",(e,t)=>{Bt.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})}}}),tU=ue("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=_5()),Bt.init(e,t)}),nU=ue("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=y5),Bt.init(e,t)}),rU=ue("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=d5),Bt.init(e,t)}),sU=ue("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=h5),Bt.init(e,t)}),oU=ue("$ZodULID",(e,t)=>{t.pattern??(t.pattern=p5),Bt.init(e,t)}),iU=ue("$ZodXID",(e,t)=>{t.pattern??(t.pattern=m5),Bt.init(e,t)}),aU=ue("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=g5),Bt.init(e,t)}),cU=ue("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=k5(t)),Bt.init(e,t)}),lU=ue("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=j5),Bt.init(e,t)}),uU=ue("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=A5(t)),Bt.init(e,t)}),fU=ue("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=v5),Bt.init(e,t)}),dU=ue("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=w5),Bt.init(e,t),e._zod.bag.format="ipv4"}),hU=ue("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=E5),Bt.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})}}}),pU=ue("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=T5),Bt.init(e,t)}),mU=ue("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=C5),Bt.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 l=Number(a);if(`${l}`!==a)throw new Error;if(l<0||l>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 X1(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const gU=ue("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=R5),Bt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{X1(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function yU(e){if(!H1.test(e))return!1;const t=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return X1(n)}const vU=ue("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=H1),Bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{yU(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),bU=ue("$ZodE164",(e,t)=>{t.pattern??(t.pattern=N5),Bt.init(e,t)});function xU(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 SU=ue("$ZodJWT",(e,t)=>{Bt.init(e,t),e._zod.check=n=>{xU(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Q1=ue("$ZodNumber",(e,t)=>{Ft.init(e,t),e._zod.pattern=e._zod.bag.pattern??K1,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}}),_U=ue("$ZodNumberFormat",(e,t)=>{L5.init(e,t),Q1.init(e,t)}),wU=ue("$ZodBoolean",(e,t)=>{Ft.init(e,t),e._zod.pattern=I5,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}}),EU=ue("$ZodUnknown",(e,t)=>{Ft.init(e,t),e._zod.parse=n=>n}),TU=ue("$ZodNever",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function xE(e,t,n){e.issues.length&&t.issues.push(...hc(n,e.issues)),t.value[n]=e.value}const CU=ue("$ZodArray",(e,t)=>{Ft.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 l=0;l<i.length;l++){const f=i[l],d=t.element._zod.run({value:f,issues:[]},s);d instanceof Promise?a.push(d.then(p=>xE(p,n,l))):xE(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function Th(e,t,n,s,i){if(e.issues.length){if(i&&!(n in s))return;t.issues.push(...hc(n,e.issues))}e.value===void 0?n in s&&(t.value[n]=void 0):t.value[n]=e.value}function W1(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=V4(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function J1(e,t,n,s,i,a){const l=[],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"){l.push(y);continue}const b=d.run({value:t[y],issues:[]},s);b instanceof Promise?e.push(b.then(x=>Th(x,n,y,t,g))):Th(b,n,y,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const RU=ue("$ZodObject",(e,t)=>{if(Ft.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=yb(()=>W1(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=Eh,a=t.catchall;let l;e._zod.parse=(f,d)=>{l??(l=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=l.shape;for(const b of l.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=>Th(T,f,b,p,S))):Th(w,f,b,p,S)}return a?J1(g,p,f,d,s.value,e):g.length?Promise.all(g).then(()=>f):f}}),NU=ue("$ZodObjectJIT",(e,t)=>{RU.init(e,t);const n=e._zod.parse,s=yb(()=>W1(t)),i=b=>{const x=new Y5(["shape","payload","ctx"]),S=s.value,w=N=>{const R=vE(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],M=vE(N),j=b[N]?._zod?.optout==="optional";x.write(`const ${R} = ${w(N)};`),j?x.write(`
23
+ `))}}const eU={major:4,minor:3,patch:6},Ft=ue("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=eU;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=(l,f,d)=>{let p=dc(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(p)continue;const b=l.issues.length,x=y._zod.check(l);if(x instanceof Promise&&d?.async===!1)throw new yc;if(g||x instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await x,l.issues.length!==b&&(p||(p=dc(l,b)))});else{if(l.issues.length===b)continue;p||(p=dc(l,b))}}return g?g.then(()=>l):l},a=(l,f,d)=>{if(dc(l))return l.aborted=!0,l;const p=i(f,s,d);if(p instanceof Promise){if(d.async===!1)throw new yc;return p.then(g=>e._zod.parse(g,d))}return e._zod.parse(p,d)};e._zod.run=(l,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const p=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(g=>a(g,l,f)):a(p,l,f)}const d=e._zod.parse(l,f);if(d instanceof Promise){if(f.async===!1)throw new yc;return d.then(p=>i(p,s,f))}return i(d,s,f)}}wt(e,"~standard",()=>({validate:i=>{try{const a=i5(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return a5(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),Tb=ue("$ZodString",(e,t)=>{Ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??D5(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}}),Bt=ue("$ZodStringFormat",(e,t)=>{up.init(e,t),Tb.init(e,t)}),tU=ue("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=w5),Bt.init(e,t)}),nU=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());Bt.init(e,t)}),rU=ue("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=E5),Bt.init(e,t)}),sU=ue("$ZodURL",(e,t)=>{Bt.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})}}}),oU=ue("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=C5()),Bt.init(e,t)}),iU=ue("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=S5),Bt.init(e,t)}),aU=ue("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=g5),Bt.init(e,t)}),cU=ue("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=y5),Bt.init(e,t)}),lU=ue("$ZodULID",(e,t)=>{t.pattern??(t.pattern=v5),Bt.init(e,t)}),uU=ue("$ZodXID",(e,t)=>{t.pattern??(t.pattern=b5),Bt.init(e,t)}),fU=ue("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=x5),Bt.init(e,t)}),dU=ue("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=P5(t)),Bt.init(e,t)}),hU=ue("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=M5),Bt.init(e,t)}),pU=ue("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=I5(t)),Bt.init(e,t)}),mU=ue("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=_5),Bt.init(e,t)}),gU=ue("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=R5),Bt.init(e,t),e._zod.bag.format="ipv4"}),yU=ue("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=N5),Bt.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})}}}),vU=ue("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=j5),Bt.init(e,t)}),bU=ue("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=A5),Bt.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 l=Number(a);if(`${l}`!==a)throw new Error;if(l<0||l>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 xU=ue("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=k5),Bt.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 SU(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 _U=ue("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=K1),Bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{SU(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),wU=ue("$ZodE164",(e,t)=>{t.pattern??(t.pattern=O5),Bt.init(e,t)});function EU(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 TU=ue("$ZodJWT",(e,t)=>{Bt.init(e,t),e._zod.check=n=>{EU(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)=>{Ft.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}}),CU=ue("$ZodNumberFormat",(e,t)=>{F5.init(e,t),eN.init(e,t)}),RU=ue("$ZodBoolean",(e,t)=>{Ft.init(e,t),e._zod.pattern=L5,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}}),NU=ue("$ZodUnknown",(e,t)=>{Ft.init(e,t),e._zod.parse=n=>n}),jU=ue("$ZodNever",(e,t)=>{Ft.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(...hc(n,e.issues)),t.value[n]=e.value}const AU=ue("$ZodArray",(e,t)=>{Ft.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 l=0;l<i.length;l++){const f=i[l],d=t.element._zod.run({value:f,issues:[]},s);d instanceof Promise?a.push(d.then(p=>_E(p,n,l))):_E(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function Ch(e,t,n,s,i){if(e.issues.length){if(i&&!(n in s))return;t.issues.push(...hc(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=Y4(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 l=[],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"){l.push(y);continue}const b=d.run({value:t[y],issues:[]},s);b instanceof Promise?e.push(b.then(x=>Ch(x,n,y,t,g))):Ch(b,n,y,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const kU=ue("$ZodObject",(e,t)=>{if(Ft.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=bb(()=>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=Th,a=t.catchall;let l;e._zod.parse=(f,d)=>{l??(l=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=l.shape;for(const b of l.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=>Ch(T,f,b,p,S))):Ch(w,f,b,p,S)}return a?nN(g,p,f,d,s.value,e):g.length?Promise.all(g).then(()=>f):f}}),OU=ue("$ZodObjectJIT",(e,t)=>{kU.init(e,t);const n=e._zod.parse,s=bb(()=>tN(t)),i=b=>{const x=new J5(["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],M=xE(N),j=b[N]?._zod?.optout==="optional";x.write(`const ${R} = ${w(N)};`),j?x.write(`
24
24
  if (${R}.issues.length) {
25
25
  if (${M} in input) {
26
26
  payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
@@ -54,25 +54,25 @@ Error:`,i)}}function pz(){return ez(e=>{qu("cls",{metric:e}),p1=e},{reportAllCha
54
54
  newResult[${M}] = ${R}.value;
55
55
  }
56
56
 
57
- `)}x.write("payload.value = newResult;"),x.write("return payload;");const O=x.compile();return(N,R)=>O(b,N,R)};let a;const l=Eh,f=!D1.jitless,p=f&&H4.value,g=t.catchall;let y;e._zod.parse=(b,x)=>{y??(y=s.value);const S=b.value;return l(S)?f&&p&&x?.async===!1&&x.jitless!==!0?(a||(a=i(t.shape)),b=a(b,x),g?J1([],S,b,x,y,e):b):n(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function SE(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=>!dc(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(l=>ri(l,s,ni())))}),t)}const jU=ue("$ZodUnion",(e,t)=>{Ft.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=>bb(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 l=!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),l=!0;else{if(p.issues.length===0)return p;f.push(p)}}return l?Promise.all(f).then(d=>SE(d,i,e,a)):SE(f,i,e,a)}}),AU=ue("$ZodIntersection",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},s),l=t.right._zod.run({value:i,issues:[]},s);return a instanceof Promise||l instanceof Promise?Promise.all([a,l]).then(([d,p])=>_E(n,d,p)):_E(n,a,l)}});function hv(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(Pc(e)&&Pc(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 l=hv(e[a],t[a]);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};i[a]=l.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],l=hv(i,a);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function _E(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}),dc(e))return e;const l=hv(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const kU=ue("$ZodRecord",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Pc(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],l=t.keyType._zod.values;if(l){n.value={};const f=new Set;for(const p of l)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(...hc(p,y.issues)),n.value[p]=y.value})):(g.issues.length&&n.issues.push(...hc(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"&&K1.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=>ri(y,s,ni())),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(...hc(f,y.issues)),n.value[d.value]=y.value})):(g.issues.length&&n.issues.push(...hc(f,g.issues)),n.value[d.value]=g.value)}}return a.length?Promise.all(a).then(()=>n):n}}),OU=ue("$ZodEnum",(e,t)=>{Ft.init(e,t);const n=z1(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"?Dc(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const l=i.value;return s.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),MU=ue("$ZodLiteral",(e,t)=>{if(Ft.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"?Dc(s):s?Dc(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}}),IU=ue("$ZodTransform",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new P1(e.constructor.name);const i=t.transform(n.value,n);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new yc;return n.value=i,n}});function wE(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const eN=ue("$ZodOptional",(e,t)=>{Ft.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(`^(${bb(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=>wE(a,n.value)):wE(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,s)}}),PU=ue("$ZodExactOptional",(e,t)=>{eN.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)}),DU=ue("$ZodNullable",(e,t)=>{Ft.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(`^(${bb(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)}),zU=ue("$ZodDefault",(e,t)=>{Ft.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=>EE(a,t)):EE(i,t)}});function EE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const LU=ue("$ZodPrefault",(e,t)=>{Ft.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))}),UU=ue("$ZodNonOptional",(e,t)=>{Ft.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=>TE(a,e)):TE(i,e)}});function TE(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 $U=ue("$ZodCatch",(e,t)=>{Ft.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(l=>ri(l,s,ni()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>ri(a,s,ni()))},input:n.value}),n.issues=[]),n)}}),BU=ue("$ZodPipe",(e,t)=>{Ft.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(l=>Nd(l,t.in,s)):Nd(a,t.in,s)}const i=t.in._zod.run(n,s);return i instanceof Promise?i.then(a=>Nd(a,t.out,s)):Nd(i,t.out,s)}});function Nd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const FU=ue("$ZodReadonly",(e,t)=>{Ft.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(CE):CE(i)}});function CE(e){return e.value=Object.freeze(e.value),e}const HU=ue("$ZodCustom",(e,t)=>{Qn.init(e,t),Ft.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=>RE(a,n,s,e));RE(i,n,s,e)}});function RE(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(wu(i))}}var NE;class qU{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 VU(){return new qU}(NE=globalThis).__zod_globalRegistry??(NE.__zod_globalRegistry=VU());const cu=globalThis.__zod_globalRegistry;function KU(e,t){return new e({type:"string",...De(t)})}function GU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function jE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function ZU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function YU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function XU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function QU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function WU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function JU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function e3(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function t3(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function n3(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function r3(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function s3(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function o3(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function i3(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function a3(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function c3(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function l3(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function u3(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function f3(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function d3(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function h3(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function p3(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function m3(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function g3(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function y3(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function v3(e,t){return new e({type:"number",checks:[],...De(t)})}function b3(e,t){return new e({type:"number",coerce:!0,checks:[],...De(t)})}function x3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function S3(e,t){return new e({type:"boolean",...De(t)})}function _3(e){return new e({type:"unknown"})}function w3(e,t){return new e({type:"never",...De(t)})}function AE(e,t){return new Z1({check:"less_than",...De(t),value:e,inclusive:!1})}function ny(e,t){return new Z1({check:"less_than",...De(t),value:e,inclusive:!0})}function kE(e,t){return new Y1({check:"greater_than",...De(t),value:e,inclusive:!1})}function ry(e,t){return new Y1({check:"greater_than",...De(t),value:e,inclusive:!0})}function OE(e,t){return new z5({check:"multiple_of",...De(t),value:e})}function tN(e,t){return new U5({check:"max_length",...De(t),maximum:e})}function Ch(e,t){return new $5({check:"min_length",...De(t),minimum:e})}function nN(e,t){return new B5({check:"length_equals",...De(t),length:e})}function E3(e,t){return new F5({check:"string_format",format:"regex",...De(t),pattern:e})}function T3(e){return new H5({check:"string_format",format:"lowercase",...De(e)})}function C3(e){return new q5({check:"string_format",format:"uppercase",...De(e)})}function R3(e,t){return new V5({check:"string_format",format:"includes",...De(t),includes:e})}function N3(e,t){return new K5({check:"string_format",format:"starts_with",...De(t),prefix:e})}function j3(e,t){return new G5({check:"string_format",format:"ends_with",...De(t),suffix:e})}function Wc(e){return new Z5({check:"overwrite",tx:e})}function A3(e){return Wc(t=>t.normalize(e))}function k3(){return Wc(e=>e.trim())}function O3(){return Wc(e=>e.toLowerCase())}function M3(){return Wc(e=>e.toUpperCase())}function I3(){return Wc(e=>F4(e))}function P3(e,t,n){return new e({type:"array",element:t,...De(n)})}function D3(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function z3(e){const t=L3(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(wu(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(wu(i))}},e(n.value,n)));return t}function L3(e,t){const n=new Qn({check:"custom",...De(t)});return n._zod.check=e,n}function rN(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??cu,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 ln(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 l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const b=l.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&&(l.ref||(l.ref=y),ln(y,t,g),t.seen.get(y).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&On(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((s=l.schema).default??(s.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function sN(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 l of e.seen.entries()){const f=e.metadataRegistry.get(l[0])?.id;if(f){const d=s.get(f);if(d&&d!==l[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,l[0])}}const i=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(l[0])?.id,b=e.external.uri??(S=>S);if(y)return{ref:b(y)};const x=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=x,{defId:x,ref:`${b("__shared")}#/${f}/${x}`}}if(l[1]===n)return{ref:"#"};const p=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:p+g}},a=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:d,defId:p}=i(l);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 l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
57
+ `)}x.write("payload.value = newResult;"),x.write("return payload;");const k=x.compile();return(N,R)=>k(b,N,R)};let a;const l=Th,f=!U1.jitless,p=f&&G4.value,g=t.catchall;let y;e._zod.parse=(b,x)=>{y??(y=s.value);const S=b.value;return l(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=>!dc(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(l=>ri(l,s,ni())))}),t)}const MU=ue("$ZodUnion",(e,t)=>{Ft.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=>Sb(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 l=!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),l=!0;else{if(p.issues.length===0)return p;f.push(p)}}return l?Promise.all(f).then(d=>wE(d,i,e,a)):wE(f,i,e,a)}}),IU=ue("$ZodIntersection",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},s),l=t.right._zod.run({value:i,issues:[]},s);return a instanceof Promise||l instanceof Promise?Promise.all([a,l]).then(([d,p])=>EE(n,d,p)):EE(n,a,l)}});function pv(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(Pc(e)&&Pc(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 l=pv(e[a],t[a]);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};i[a]=l.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],l=pv(i,a);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};n.push(l.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}),dc(e))return e;const l=pv(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const PU=ue("$ZodRecord",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Pc(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],l=t.keyType._zod.values;if(l){n.value={};const f=new Set;for(const p of l)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(...hc(p,y.issues)),n.value[p]=y.value})):(g.issues.length&&n.issues.push(...hc(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=>ri(y,s,ni())),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(...hc(f,y.issues)),n.value[d.value]=y.value})):(g.issues.length&&n.issues.push(...hc(f,g.issues)),n.value[d.value]=g.value)}}return a.length?Promise.all(a).then(()=>n):n}}),DU=ue("$ZodEnum",(e,t)=>{Ft.init(e,t);const n=$1(t.entries),s=new Set(n);e._zod.values=s,e._zod.pattern=new RegExp(`^(${n.filter(i=>Z4.has(typeof i)).map(i=>typeof i=="string"?Dc(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const l=i.value;return s.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),zU=ue("$ZodLiteral",(e,t)=>{if(Ft.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"?Dc(s):s?Dc(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}}),LU=ue("$ZodTransform",(e,t)=>{Ft.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(l=>(n.value=l,n));if(i instanceof Promise)throw new yc;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)=>{Ft.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(`^(${Sb(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)}}),UU=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)}),$U=ue("$ZodNullable",(e,t)=>{Ft.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(`^(${Sb(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)}),BU=ue("$ZodDefault",(e,t)=>{Ft.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 FU=ue("$ZodPrefault",(e,t)=>{Ft.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))}),HU=ue("$ZodNonOptional",(e,t)=>{Ft.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 qU=ue("$ZodCatch",(e,t)=>{Ft.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(l=>ri(l,s,ni()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>ri(a,s,ni()))},input:n.value}),n.issues=[]),n)}}),VU=ue("$ZodPipe",(e,t)=>{Ft.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(l=>jd(l,t.in,s)):jd(a,t.in,s)}const i=t.in._zod.run(n,s);return i instanceof Promise?i.then(a=>jd(a,t.out,s)):jd(i,t.out,s)}});function jd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const KU=ue("$ZodReadonly",(e,t)=>{Ft.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 GU=ue("$ZodCustom",(e,t)=>{Qn.init(e,t),Ft.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(wu(i))}}var AE;class ZU{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 YU(){return new ZU}(AE=globalThis).__zod_globalRegistry??(AE.__zod_globalRegistry=YU());const cu=globalThis.__zod_globalRegistry;function XU(e,t){return new e({type:"string",...De(t)})}function QU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function kE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function WU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function JU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function e3(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function t3(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function n3(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function r3(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function s3(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function o3(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function i3(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function a3(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function c3(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function l3(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function u3(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function f3(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function d3(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function h3(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function p3(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function m3(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function g3(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function y3(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function v3(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function b3(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function x3(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function S3(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function _3(e,t){return new e({type:"number",checks:[],...De(t)})}function w3(e,t){return new e({type:"number",coerce:!0,checks:[],...De(t)})}function E3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function T3(e,t){return new e({type:"boolean",...De(t)})}function C3(e){return new e({type:"unknown"})}function R3(e,t){return new e({type:"never",...De(t)})}function OE(e,t){return new Q1({check:"less_than",...De(t),value:e,inclusive:!1})}function ry(e,t){return new Q1({check:"less_than",...De(t),value:e,inclusive:!0})}function ME(e,t){return new W1({check:"greater_than",...De(t),value:e,inclusive:!1})}function sy(e,t){return new W1({check:"greater_than",...De(t),value:e,inclusive:!0})}function IE(e,t){return new B5({check:"multiple_of",...De(t),value:e})}function sN(e,t){return new H5({check:"max_length",...De(t),maximum:e})}function Rh(e,t){return new q5({check:"min_length",...De(t),minimum:e})}function oN(e,t){return new V5({check:"length_equals",...De(t),length:e})}function N3(e,t){return new K5({check:"string_format",format:"regex",...De(t),pattern:e})}function j3(e){return new G5({check:"string_format",format:"lowercase",...De(e)})}function A3(e){return new Z5({check:"string_format",format:"uppercase",...De(e)})}function k3(e,t){return new Y5({check:"string_format",format:"includes",...De(t),includes:e})}function O3(e,t){return new X5({check:"string_format",format:"starts_with",...De(t),prefix:e})}function M3(e,t){return new Q5({check:"string_format",format:"ends_with",...De(t),suffix:e})}function Wc(e){return new W5({check:"overwrite",tx:e})}function I3(e){return Wc(t=>t.normalize(e))}function P3(){return Wc(e=>e.trim())}function D3(){return Wc(e=>e.toLowerCase())}function z3(){return Wc(e=>e.toUpperCase())}function L3(){return Wc(e=>K4(e))}function U3(e,t,n){return new e({type:"array",element:t,...De(n)})}function $3(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function B3(e){const t=F3(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(wu(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(wu(i))}},e(n.value,n)));return t}function F3(e,t){const n=new Qn({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??cu,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 ln(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 l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const b=l.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&&(l.ref||(l.ref=y),ln(y,t,g),t.seen.get(y).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&On(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((s=l.schema).default??(s.default=l.schema._prefault)),delete l.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 l of e.seen.entries()){const f=e.metadataRegistry.get(l[0])?.id;if(f){const d=s.get(f);if(d&&d!==l[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,l[0])}}const i=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(l[0])?.id,b=e.external.uri??(S=>S);if(y)return{ref:b(y)};const x=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=x,{defId:x,ref:`${b("__shared")}#/${f}/${x}`}}if(l[1]===n)return{ref:"#"};const p=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:p+g}},a=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:d,defId:p}=i(l);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 l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
58
58
 
59
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const f=l[1];if(t===l[0]){a(l);continue}if(e.external){const p=e.external.registry.get(l[0])?.id;if(t!==l[0]&&p){a(l);continue}}if(e.metadataRegistry.get(l[0])?.id){a(l);continue}if(f.cycle){a(l);continue}if(f.count>1&&e.reused==="ref"){a(l);continue}}}function oN(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=l=>{const f=e.seen.get(l);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),l._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=l._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:l,jsonSchema:d,path:f.path??[]})};for(const l of[...e.seen.entries()].reverse())s(l[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 l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[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 l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Rh(t,"input",e.processors),output:Rh(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function On(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 On(s.element,n);if(s.type==="set")return On(s.valueType,n);if(s.type==="lazy")return On(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 On(s.innerType,n);if(s.type==="intersection")return On(s.left,n)||On(s.right,n);if(s.type==="record"||s.type==="map")return On(s.keyType,n)||On(s.valueType,n);if(s.type==="pipe")return On(s.in,n)||On(s.out,n);if(s.type==="object"){for(const i in s.shape)if(On(s.shape[i],n))return!0;return!1}if(s.type==="union"){for(const i of s.options)if(On(i,n))return!0;return!1}if(s.type==="tuple"){for(const i of s.items)if(On(i,n))return!0;return!!(s.rest&&On(s.rest,n))}return!1}const U3=(e,t={})=>n=>{const s=rN({...n,processors:t});return ln(e,s),sN(s,e),oN(s,e)},Rh=(e,t,n={})=>s=>{const{libraryOptions:i,target:a}=s??{},l=rN({...i??{},target:a,io:t,processors:n});return ln(e,l),sN(l,e),oN(l,e)},$3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},B3=(e,t,n,s)=>{const i=n;i.type="string";const{minimum:a,maximum:l,format:f,patterns:d,contentEncoding:p}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof l=="number"&&(i.maxLength=l),f&&(i.format=$3[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}))])}},F3=(e,t,n,s)=>{const i=n,{minimum:a,maximum:l,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 l=="number"&&(i.maximum=l,typeof p=="number"&&t.target!=="draft-04"&&(p<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},H3=(e,t,n,s)=>{n.type="boolean"},q3=(e,t,n,s)=>{n.not={}},V3=(e,t,n,s)=>{},K3=(e,t,n,s)=>{const i=e._zod.def,a=z1(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},G3=(e,t,n,s)=>{const i=e._zod.def,a=[];for(const l of i.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(l))}else a.push(l);if(a.length!==0)if(a.length===1){const l=a[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),a.every(l=>typeof l=="boolean")&&(n.type="boolean"),a.every(l=>l===null)&&(n.type="null"),n.enum=a},Z3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Y3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},X3=(e,t,n,s)=>{const i=n,a=e._zod.def,{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof f=="number"&&(i.maxItems=f),i.type="array",i.items=ln(a.element,t,{...s,path:[...s.path,"items"]})},Q3=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const l=a.shape;for(const p in l)i.properties[p]=ln(l[p],t,{...s,path:[...s.path,"properties",p]});const f=new Set(Object.keys(l)),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=ln(a.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},W3=(e,t,n,s)=>{const i=e._zod.def,a=i.inclusive===!1,l=i.options.map((f,d)=>ln(f,t,{...s,path:[...s.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=l:n.anyOf=l},J3=(e,t,n,s)=>{const i=e._zod.def,a=ln(i.left,t,{...s,path:[...s.path,"allOf",0]}),l=ln(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(l)?l.allOf:[l]];n.allOf=d},e$=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object";const l=a.keyType,d=l._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const g=ln(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=ln(a.keyType,t,{...s,path:[...s.path,"propertyNames"]})),i.additionalProperties=ln(a.valueType,t,{...s,path:[...s.path,"additionalProperties"]});const p=l._zod.values;if(p){const g=[...p].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(i.required=g)}},t$=(e,t,n,s)=>{const i=e._zod.def,a=ln(i.innerType,t,s),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},n$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},r$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},s$=(e,t,n,s)=>{const i=e._zod.def;ln(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)))},o$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},i$=(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;ln(a,t,s);const l=t.seen.get(e);l.ref=a},a$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},iN=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},c$=ue("ZodISODateTime",(e,t)=>{cU.init(e,t),qt.init(e,t)});function l$(e){return p3(c$,e)}const u$=ue("ZodISODate",(e,t)=>{lU.init(e,t),qt.init(e,t)});function f$(e){return m3(u$,e)}const d$=ue("ZodISOTime",(e,t)=>{uU.init(e,t),qt.init(e,t)});function h$(e){return g3(d$,e)}const p$=ue("ZodISODuration",(e,t)=>{fU.init(e,t),qt.init(e,t)});function m$(e){return y3(p$,e)}const g$=(e,t)=>{B1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>t5(e,n)},flatten:{value:n=>e5(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,dv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,dv,2)}},isEmpty:{get(){return e.issues.length===0}}})},Yr=ue("ZodError",g$,{Parent:Error}),y$=Sb(Yr),v$=_b(Yr),b$=ap(Yr),x$=cp(Yr),S$=s5(Yr),_$=o5(Yr),w$=i5(Yr),E$=a5(Yr),T$=c5(Yr),C$=l5(Yr),R$=u5(Yr),N$=f5(Yr),Ht=ue("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Rh(e,"input"),output:Rh(e,"output")}}),e.toJSONSchema=U3(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(fi(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)=>di(e,n,s),e.brand=()=>e,e.register=((n,s)=>(n.add(e,s),e)),e.parse=(n,s)=>y$(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>b$(e,n,s),e.parseAsync=async(n,s)=>v$(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>x$(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>S$(e,n,s),e.decode=(n,s)=>_$(e,n,s),e.encodeAsync=async(n,s)=>w$(e,n,s),e.decodeAsync=async(n,s)=>E$(e,n,s),e.safeEncode=(n,s)=>T$(e,n,s),e.safeDecode=(n,s)=>C$(e,n,s),e.safeEncodeAsync=async(n,s)=>R$(e,n,s),e.safeDecodeAsync=async(n,s)=>N$(e,n,s),e.refine=(n,s)=>e.check(SB(n,s)),e.superRefine=n=>e.check(_B(n)),e.overwrite=n=>e.check(Wc(n)),e.optional=()=>PE(e),e.exactOptional=()=>cB(e),e.nullable=()=>DE(e),e.nullish=()=>PE(DE(e)),e.nonoptional=n=>pB(e,n),e.array=()=>Gr(e),e.or=n=>Tb([e,n]),e.and=n=>nB(e,n),e.transform=n=>zE(e,iB(n)),e.default=n=>fB(e,n),e.prefault=n=>hB(e,n),e.catch=n=>gB(e,n),e.pipe=n=>zE(e,n),e.readonly=()=>bB(e),e.describe=n=>{const s=e.clone();return cu.add(s,{description:n}),s},Object.defineProperty(e,"description",{get(){return cu.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return cu.get(e);const s=e.clone();return cu.add(s,n[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),aN=ue("_ZodString",(e,t)=>{wb.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>B3(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(E3(...s)),e.includes=(...s)=>e.check(R3(...s)),e.startsWith=(...s)=>e.check(N3(...s)),e.endsWith=(...s)=>e.check(j3(...s)),e.min=(...s)=>e.check(Ch(...s)),e.max=(...s)=>e.check(tN(...s)),e.length=(...s)=>e.check(nN(...s)),e.nonempty=(...s)=>e.check(Ch(1,...s)),e.lowercase=s=>e.check(T3(s)),e.uppercase=s=>e.check(C3(s)),e.trim=()=>e.check(k3()),e.normalize=(...s)=>e.check(A3(...s)),e.toLowerCase=()=>e.check(O3()),e.toUpperCase=()=>e.check(M3()),e.slugify=()=>e.check(I3())}),j$=ue("ZodString",(e,t)=>{wb.init(e,t),aN.init(e,t),e.email=n=>e.check(GU(A$,n)),e.url=n=>e.check(WU(k$,n)),e.jwt=n=>e.check(h3(K$,n)),e.emoji=n=>e.check(JU(O$,n)),e.guid=n=>e.check(jE(ME,n)),e.uuid=n=>e.check(ZU(jd,n)),e.uuidv4=n=>e.check(YU(jd,n)),e.uuidv6=n=>e.check(XU(jd,n)),e.uuidv7=n=>e.check(QU(jd,n)),e.nanoid=n=>e.check(e3(M$,n)),e.guid=n=>e.check(jE(ME,n)),e.cuid=n=>e.check(t3(I$,n)),e.cuid2=n=>e.check(n3(P$,n)),e.ulid=n=>e.check(r3(D$,n)),e.base64=n=>e.check(u3(H$,n)),e.base64url=n=>e.check(f3(q$,n)),e.xid=n=>e.check(s3(z$,n)),e.ksuid=n=>e.check(o3(L$,n)),e.ipv4=n=>e.check(i3(U$,n)),e.ipv6=n=>e.check(a3($$,n)),e.cidrv4=n=>e.check(c3(B$,n)),e.cidrv6=n=>e.check(l3(F$,n)),e.e164=n=>e.check(d3(V$,n)),e.datetime=n=>e.check(l$(n)),e.date=n=>e.check(f$(n)),e.time=n=>e.check(h$(n)),e.duration=n=>e.check(m$(n))});function Fe(e){return KU(j$,e)}const qt=ue("ZodStringFormat",(e,t)=>{Bt.init(e,t),aN.init(e,t)}),A$=ue("ZodEmail",(e,t)=>{J5.init(e,t),qt.init(e,t)}),ME=ue("ZodGUID",(e,t)=>{Q5.init(e,t),qt.init(e,t)}),jd=ue("ZodUUID",(e,t)=>{W5.init(e,t),qt.init(e,t)}),k$=ue("ZodURL",(e,t)=>{eU.init(e,t),qt.init(e,t)}),O$=ue("ZodEmoji",(e,t)=>{tU.init(e,t),qt.init(e,t)}),M$=ue("ZodNanoID",(e,t)=>{nU.init(e,t),qt.init(e,t)}),I$=ue("ZodCUID",(e,t)=>{rU.init(e,t),qt.init(e,t)}),P$=ue("ZodCUID2",(e,t)=>{sU.init(e,t),qt.init(e,t)}),D$=ue("ZodULID",(e,t)=>{oU.init(e,t),qt.init(e,t)}),z$=ue("ZodXID",(e,t)=>{iU.init(e,t),qt.init(e,t)}),L$=ue("ZodKSUID",(e,t)=>{aU.init(e,t),qt.init(e,t)}),U$=ue("ZodIPv4",(e,t)=>{dU.init(e,t),qt.init(e,t)}),$$=ue("ZodIPv6",(e,t)=>{hU.init(e,t),qt.init(e,t)}),B$=ue("ZodCIDRv4",(e,t)=>{pU.init(e,t),qt.init(e,t)}),F$=ue("ZodCIDRv6",(e,t)=>{mU.init(e,t),qt.init(e,t)}),H$=ue("ZodBase64",(e,t)=>{gU.init(e,t),qt.init(e,t)}),q$=ue("ZodBase64URL",(e,t)=>{vU.init(e,t),qt.init(e,t)}),V$=ue("ZodE164",(e,t)=>{bU.init(e,t),qt.init(e,t)}),K$=ue("ZodJWT",(e,t)=>{SU.init(e,t),qt.init(e,t)}),Eb=ue("ZodNumber",(e,t)=>{Q1.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>F3(e,s,i),e.gt=(s,i)=>e.check(kE(s,i)),e.gte=(s,i)=>e.check(ry(s,i)),e.min=(s,i)=>e.check(ry(s,i)),e.lt=(s,i)=>e.check(AE(s,i)),e.lte=(s,i)=>e.check(ny(s,i)),e.max=(s,i)=>e.check(ny(s,i)),e.int=s=>e.check(IE(s)),e.safe=s=>e.check(IE(s)),e.positive=s=>e.check(kE(0,s)),e.nonnegative=s=>e.check(ry(0,s)),e.negative=s=>e.check(AE(0,s)),e.nonpositive=s=>e.check(ny(0,s)),e.multipleOf=(s,i)=>e.check(OE(s,i)),e.step=(s,i)=>e.check(OE(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 tn(e){return v3(Eb,e)}const G$=ue("ZodNumberFormat",(e,t)=>{_U.init(e,t),Eb.init(e,t)});function IE(e){return x3(G$,e)}const Z$=ue("ZodBoolean",(e,t)=>{wU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>H3(e,n,s)});function no(e){return S3(Z$,e)}const Y$=ue("ZodUnknown",(e,t)=>{EU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>V3()});function aa(){return _3(Y$)}const X$=ue("ZodNever",(e,t)=>{TU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>q3(e,n,s)});function Q$(e){return w3(X$,e)}const W$=ue("ZodArray",(e,t)=>{CU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>X3(e,n,s,i),e.element=t.element,e.min=(n,s)=>e.check(Ch(n,s)),e.nonempty=n=>e.check(Ch(1,n)),e.max=(n,s)=>e.check(tN(n,s)),e.length=(n,s)=>e.check(nN(n,s)),e.unwrap=()=>e.element});function Gr(e,t){return P3(W$,e,t)}const J$=ue("ZodObject",(e,t)=>{NU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Q3(e,n,s,i),wt(e,"shape",()=>t.shape),e.keyof=()=>Zu(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:aa()}),e.loose=()=>e.clone({...e._zod.def,catchall:aa()}),e.strict=()=>e.clone({...e._zod.def,catchall:Q$()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Y4(e,n),e.safeExtend=n=>X4(e,n),e.merge=n=>Q4(e,n),e.pick=n=>G4(e,n),e.omit=n=>Z4(e,n),e.partial=(...n)=>W4(cN,e,n[0]),e.required=(...n)=>J4(lN,e,n[0])});function At(e,t){const n={type:"object",shape:e??{},...De(t)};return new J$(n)}const eB=ue("ZodUnion",(e,t)=>{jU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>W3(e,n,s,i),e.options=t.options});function Tb(e,t){return new eB({type:"union",options:e,...De(t)})}const tB=ue("ZodIntersection",(e,t)=>{AU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>J3(e,n,s,i)});function nB(e,t){return new tB({type:"intersection",left:e,right:t})}const rB=ue("ZodRecord",(e,t)=>{kU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>e$(e,n,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function Gu(e,t,n){return new rB({type:"record",keyType:e,valueType:t,...De(n)})}const pv=ue("ZodEnum",(e,t)=>{OU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>K3(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 l of s)if(n.has(l))a[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new pv({...t,checks:[],...De(i),entries:a})},e.exclude=(s,i)=>{const a={...t.entries};for(const l of s)if(n.has(l))delete a[l];else throw new Error(`Key ${l} not found in enum`);return new pv({...t,checks:[],...De(i),entries:a})}});function Zu(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new pv({type:"enum",entries:n,...De(t)})}const sB=ue("ZodLiteral",(e,t)=>{MU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>G3(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 si(e,t){return new sB({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const oB=ue("ZodTransform",(e,t)=>{IU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Y3(e,n),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new P1(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(wu(a,n.value,t));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(wu(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function iB(e){return new oB({type:"transform",transform:e})}const cN=ue("ZodOptional",(e,t)=>{eN.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>iN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function PE(e){return new cN({type:"optional",innerType:e})}const aB=ue("ZodExactOptional",(e,t)=>{PU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>iN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function cB(e){return new aB({type:"optional",innerType:e})}const lB=ue("ZodNullable",(e,t)=>{DU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>t$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function DE(e){return new lB({type:"nullable",innerType:e})}const uB=ue("ZodDefault",(e,t)=>{zU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>r$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fB(e,t){return new uB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():U1(t)}})}const dB=ue("ZodPrefault",(e,t)=>{LU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>s$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function hB(e,t){return new dB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():U1(t)}})}const lN=ue("ZodNonOptional",(e,t)=>{UU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>n$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function pB(e,t){return new lN({type:"nonoptional",innerType:e,...De(t)})}const mB=ue("ZodCatch",(e,t)=>{$U.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>o$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function gB(e,t){return new mB({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const yB=ue("ZodPipe",(e,t)=>{BU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>i$(e,n,s,i),e.in=t.in,e.out=t.out});function zE(e,t){return new yB({type:"pipe",in:e,out:t})}const vB=ue("ZodReadonly",(e,t)=>{FU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>a$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function bB(e){return new vB({type:"readonly",innerType:e})}const xB=ue("ZodCustom",(e,t)=>{HU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Z3(e,n)});function SB(e,t={}){return D3(xB,e,t)}function _B(e){return z3(e)}function LE(e){return b3(Eb,e)}At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:tn().int().min(0),mimeType:Fe().min(1),encrypted:no().optional(),keyId:Fe().optional()});const uN=At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i),size:tn().int().min(0),mimeType:Fe().min(1),createdAt:Fe(),expiresAt:Fe().optional(),uploadComplete:no()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:tn().int().min(0),mimeType:Fe().min(1)});At({exists:no(),uploadId:Fe().optional(),uploadUrl:Fe().url().optional(),uploadMethod:Zu(["PUT","POST"]).optional(),uploadHeaders:Gu(Fe(),Fe()).optional(),chunkSize:tn().int().optional()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});At({ok:no(),metadata:uN.optional(),error:Fe().optional()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});At({url:Fe().url(),expiresAt:Fe(),metadata:uN});At({error:Fe(),message:Fe().optional(),code:Fe().optional()});At({limit:LE().int().min(1).max(100).default(50),offset:LE().int().min(0).default(0)});const wB="json-row-frame-v1",EB="gzip",fN=Zu(["upsert","delete"]),TB=Gu(Fe(),Fe()),dN=Gu(Fe(),Tb([Fe(),Gr(Fe())])),CB=At({table:Fe(),row_id:Fe(),op:fN,payload:Gu(Fe(),aa()).nullable(),base_version:tn().int().nullable().optional()}),RB=At({clientId:Fe().min(1),clientCommitId:Fe().min(1),operations:Gr(CB).min(1),schemaVersion:tn().int().min(1)}),NB=At({opIndex:tn().int(),status:si("applied")}),jB=At({opIndex:tn().int(),status:si("conflict"),message:Fe(),server_version:tn().int(),server_row:aa()}),AB=At({opIndex:tn().int(),status:si("error"),error:Fe(),code:Fe().optional(),retriable:no().optional()}),kB=Tb([NB,jB,AB]),OB=At({ok:si(!0),status:Zu(["applied","cached","rejected"]),commitSeq:tn().int().optional(),results:Gr(kB)}),hN=At({asOfCommitSeq:tn().int(),tables:Gr(Fe()),tableIndex:tn().int(),rowCursor:Fe().nullable()}),MB=At({id:Fe().min(1),table:Fe().min(1),scopes:dN,params:Gu(Fe(),aa()).optional(),cursor:tn().int(),bootstrapState:hN.nullable().optional()}),IB=At({clientId:Fe().min(1),limitCommits:tn().int().min(1),limitSnapshotRows:tn().int().min(1).optional(),maxSnapshotPages:tn().int().min(1).optional(),dedupeRows:no().optional(),subscriptions:Gr(MB)}),PB=At({table:Fe(),row_id:Fe(),op:fN,row_json:aa().nullable(),row_version:tn().int().nullable(),scopes:TB}),DB=At({commitSeq:tn().int(),createdAt:Fe(),actorId:Fe(),changes:Gr(PB)}),zB=At({id:Fe(),byteLength:tn().int(),sha256:Fe(),encoding:si(wB),compression:si(EB)}),LB=At({table:Fe(),rows:Gr(aa()),chunks:Gr(zB).optional(),isFirstPage:no(),isLastPage:no()}),UB=At({id:Fe(),status:Zu(["active","revoked"]),scopes:dN,bootstrap:no(),bootstrapState:hN.nullable().optional(),nextCursor:tn().int(),commits:Gr(DB),snapshots:Gr(LB).optional()}),$B=At({ok:si(!0),subscriptions:Gr(UB)});At({clientId:Fe().min(1),push:RB.omit({clientId:!0}).optional(),pull:IB.omit({clientId:!0}).optional()});At({ok:si(!0),push:OB.optional(),pull:$B.optional()});new TextEncoder;const BB={setAttribute(){},setAttributes(){},setStatus(){}};function FB(e){return e.level?e.level:e.error?"error":"info"}function sy(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 HB(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 UE(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 VB(e){return{startSpan(t,n){return e.startSpan?e.startSpan(t,s=>n(HB(s))):n(BB)}}}function KB(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 GB(e){return{log(t){const n=FB(t),{event:s,...i}=t,a=sy(e.logger,n);if(!a)return;const l=UE(i);if(!l){a(s);return}a(s,l)},tracer:VB(e),metrics:KB(e),captureException(t,n){if(e.captureException?.(t),!n)return;const s=sy(e.logger,"error")??sy(e.logger,"info");if(!s)return;const i=UE(n);if(!i){s("sync.exception.context");return}s("sync.exception.context",i)}}}function ZB(e){if(e?.attributes)return{attributes:e.attributes}}function $E(e){if(!e)return;const t=!!e.attributes,n=!!e.unit;if(!(!t&&!n))return{attributes:e.attributes,unit:e.unit}}function YB(){return GB({logger:b2,startSpan(e,t){return kR(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=ZB(n);if(s){eE(e,t,s);return}eE(e,t)},gauge(e,t,n){const s=$E(n);if(s){tE(e,t,s);return}tE(e,t)},distribution(e,t,n){const s=$E(n);if(s){nE(e,t,s);return}nE(e,t)}},captureException(e){DR(e)}})}function XB(){return YB()}function QB(e){const t=WB(e);return $4(t),XB()}function WB(e){const t=e.integrations;if(typeof t=="function")return e;const n=t??[];return n.some(i=>i.name==="BrowserTracing")?e:{...e,integrations:[I4(),...n]}}var oy={exports:{}},Jl={};var BE;function JB(){if(BE)return Jl;BE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+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:l,ref:i!==void 0?i:null,props:a}}return Jl.Fragment=t,Jl.jsx=n,Jl.jsxs=n,Jl}var FE;function e6(){return FE||(FE=1,oy.exports=JB()),oy.exports}var h=e6(),iy={exports:{}},eu={},ay={exports:{}},cy={};var HE;function t6(){return HE||(HE=1,(function(e){function t(D,V){var q=D.length;D.push(V);e:for(;0<q;){var K=q-1>>>1,U=D[K];if(0<i(U,V))D[K]=V,D[q]=U,q=K;else break e}}function n(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var V=D[0],q=D.pop();if(q!==V){D[0]=q;e:for(var K=0,U=D.length,I=U>>>1;K<I;){var H=2*(K+1)-1,W=D[H],X=H+1,oe=D[X];if(0>i(W,q))X<U&&0>i(oe,W)?(D[K]=oe,D[X]=q,K=X):(D[K]=W,D[H]=q,K=H);else if(X<U&&0>i(oe,q))D[K]=oe,D[X]=q,K=X;else break e}}return V}function i(D,V){var q=D.sortIndex-V.sortIndex;return q!==0?q:D.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 l=Date,f=l.now();e.unstable_now=function(){return l.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,O=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function R(D){for(var V=n(p);V!==null;){if(V.callback===null)s(p);else if(V.startTime<=D)s(p),V.sortIndex=V.expirationTime,t(d,V);else break;V=n(p)}}function M(D){if(w=!1,R(D),!S)if(n(d)!==null)S=!0,L||(L=!0,z());else{var V=n(p);V!==null&&ee(M,V.startTime-D)}}var L=!1,j=-1,A=5,P=-1;function Z(){return T?!0:!(e.unstable_now()-P<A)}function B(){if(T=!1,L){var D=e.unstable_now();P=D;var V=!0;try{e:{S=!1,w&&(w=!1,O(j),j=-1),x=!0;var q=b;try{t:{for(R(D),y=n(d);y!==null&&!(y.expirationTime>D&&Z());){var K=y.callback;if(typeof K=="function"){y.callback=null,b=y.priorityLevel;var U=K(y.expirationTime<=D);if(D=e.unstable_now(),typeof U=="function"){y.callback=U,R(D),V=!0;break t}y===n(d)&&s(d),R(D)}else s(d);y=n(d)}if(y!==null)V=!0;else{var I=n(p);I!==null&&ee(M,I.startTime-D),V=!1}}break e}finally{y=null,b=q,x=!1}V=void 0}}finally{V?z():L=!1}}}var z;if(typeof N=="function")z=function(){N(B)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,Y=Q.port2;Q.port1.onmessage=B,z=function(){Y.postMessage(null)}}else z=function(){C(B,0)};function ee(D,V){j=C(function(){D(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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(D){switch(b){case 1:case 2:case 3:var V=3;break;default:V=b}var q=b;b=V;try{return D()}finally{b=q}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(D,V){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var q=b;b=D;try{return V()}finally{b=q}},e.unstable_scheduleCallback=function(D,V,q){var K=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?K+q:K):q=K,D){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=q+U,D={id:g++,callback:V,priorityLevel:D,startTime:q,expirationTime:U,sortIndex:-1},q>K?(D.sortIndex=q,t(p,D),n(d)===null&&D===n(p)&&(w?(O(j),j=-1):w=!0,ee(M,q-K))):(D.sortIndex=U,t(d,D),S||x||(S=!0,L||(L=!0,z()))),D},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(D){var V=b;return function(){var q=b;b=V;try{return D.apply(this,arguments)}finally{b=q}}}})(cy)),cy}var qE;function n6(){return qE||(qE=1,ay.exports=t6()),ay.exports}var ly={exports:{}},Rn={};var VE;function r6(){if(VE)return Rn;VE=1;var e=Ku();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 l=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 Rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Rn.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)},Rn.flushSync=function(d){var p=l.T,g=s.p;try{if(l.T=null,s.p=2,d)return d()}finally{l.T=p,s.p=g,s.d.f()}},Rn.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))},Rn.prefetchDNS=function(d){typeof d=="string"&&s.d.D(d)},Rn.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})}},Rn.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)},Rn.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})}},Rn.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)},Rn.requestFormReset=function(d){s.d.r(d)},Rn.unstable_batchedUpdates=function(d,p){return d(p)},Rn.useFormState=function(d,p,g){return l.H.useFormState(d,p,g)},Rn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Rn.version="19.2.4",Rn}var KE;function pN(){if(KE)return ly.exports;KE=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(),ly.exports=r6(),ly.exports}var GE;function s6(){if(GE)return eu;GE=1;var e=n6(),t=Ku(),n=pN();function s(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}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,c=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(c=o.return),r=o.return;while(r)}return o.tag===3?c:null}function l(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 c=r,u=o;;){var m=c.return;if(m===null)break;var v=m.alternate;if(v===null){if(u=m.return,u!==null){c=u;continue}break}if(m.child===v.child){for(v=m.child;v;){if(v===c)return d(m),r;if(v===u)return d(m),o;v=v.sibling}throw Error(s(188))}if(c.return!==u.return)c=m,u=v;else{for(var E=!1,k=m.child;k;){if(k===c){E=!0,c=m,u=v;break}if(k===u){E=!0,u=m,c=v;break}k=k.sibling}if(!E){for(k=v.child;k;){if(k===c){E=!0,c=v,u=m;break}if(k===u){E=!0,u=v,c=m;break}k=k.sibling}if(!E)throw Error(s(189))}}if(c.alternate!==u)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?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"),O=Symbol.for("react.consumer"),N=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function z(r){return r===null||typeof r!="object"?null:(r=B&&r[B]||r["@@iterator"],typeof r=="function"?r:null)}var Q=Symbol.for("react.client.reference");function Y(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Q?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case M:return"Suspense";case L:return"SuspenseList";case P:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case N:return r.displayName||"Context";case O: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 A:o=r._payload,r=r._init;try{return Y(r(o))}catch{}}return null}var ee=Array.isArray,D=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,q={pending:!1,data:null,method:null,action:null},K=[],U=-1;function I(r){return{current:r}}function H(r){0>U||(r.current=K[U],K[U]=null,U--)}function W(r,o){U++,K[U]=r.current,r.current=o}var X=I(null),oe=I(null),se=I(null),pe=I(null);function xe(r,o){switch(W(se,o),W(oe,r),W(X,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=O_(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}H(X),W(X,r)}function de(){H(X),H(oe),H(se)}function Me(r){r.memoizedState!==null&&W(pe,r);var o=X.current,c=O_(o,r.type);o!==c&&(W(oe,r),W(X,c))}function _e(r){oe.current===r&&(H(X),H(oe)),pe.current===r&&(H(pe),Zl._currentValue=q)}var ne,he;function ae(r){if(ne===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);ne=o&&o[1]||"",he=-1<c.stack.indexOf(`
59
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const f=l[1];if(t===l[0]){a(l);continue}if(e.external){const p=e.external.registry.get(l[0])?.id;if(t!==l[0]&&p){a(l);continue}}if(e.metadataRegistry.get(l[0])?.id){a(l);continue}if(f.cycle){a(l);continue}if(f.count>1&&e.reused==="ref"){a(l);continue}}}function cN(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=l=>{const f=e.seen.get(l);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),l._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=l._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:l,jsonSchema:d,path:f.path??[]})};for(const l of[...e.seen.entries()].reverse())s(l[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 l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[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 l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Nh(t,"input",e.processors),output:Nh(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function On(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 On(s.element,n);if(s.type==="set")return On(s.valueType,n);if(s.type==="lazy")return On(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 On(s.innerType,n);if(s.type==="intersection")return On(s.left,n)||On(s.right,n);if(s.type==="record"||s.type==="map")return On(s.keyType,n)||On(s.valueType,n);if(s.type==="pipe")return On(s.in,n)||On(s.out,n);if(s.type==="object"){for(const i in s.shape)if(On(s.shape[i],n))return!0;return!1}if(s.type==="union"){for(const i of s.options)if(On(i,n))return!0;return!1}if(s.type==="tuple"){for(const i of s.items)if(On(i,n))return!0;return!!(s.rest&&On(s.rest,n))}return!1}const H3=(e,t={})=>n=>{const s=iN({...n,processors:t});return ln(e,s),aN(s,e),cN(s,e)},Nh=(e,t,n={})=>s=>{const{libraryOptions:i,target:a}=s??{},l=iN({...i??{},target:a,io:t,processors:n});return ln(e,l),aN(l,e),cN(l,e)},q3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},V3=(e,t,n,s)=>{const i=n;i.type="string";const{minimum:a,maximum:l,format:f,patterns:d,contentEncoding:p}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof l=="number"&&(i.maxLength=l),f&&(i.format=q3[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}))])}},K3=(e,t,n,s)=>{const i=n,{minimum:a,maximum:l,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 l=="number"&&(i.maximum=l,typeof p=="number"&&t.target!=="draft-04"&&(p<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},G3=(e,t,n,s)=>{n.type="boolean"},Z3=(e,t,n,s)=>{n.not={}},Y3=(e,t,n,s)=>{},X3=(e,t,n,s)=>{const i=e._zod.def,a=$1(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},Q3=(e,t,n,s)=>{const i=e._zod.def,a=[];for(const l of i.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(l))}else a.push(l);if(a.length!==0)if(a.length===1){const l=a[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),a.every(l=>typeof l=="boolean")&&(n.type="boolean"),a.every(l=>l===null)&&(n.type="null"),n.enum=a},W3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},J3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},e$=(e,t,n,s)=>{const i=n,a=e._zod.def,{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof f=="number"&&(i.maxItems=f),i.type="array",i.items=ln(a.element,t,{...s,path:[...s.path,"items"]})},t$=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const l=a.shape;for(const p in l)i.properties[p]=ln(l[p],t,{...s,path:[...s.path,"properties",p]});const f=new Set(Object.keys(l)),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=ln(a.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},n$=(e,t,n,s)=>{const i=e._zod.def,a=i.inclusive===!1,l=i.options.map((f,d)=>ln(f,t,{...s,path:[...s.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=l:n.anyOf=l},r$=(e,t,n,s)=>{const i=e._zod.def,a=ln(i.left,t,{...s,path:[...s.path,"allOf",0]}),l=ln(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(l)?l.allOf:[l]];n.allOf=d},s$=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object";const l=a.keyType,d=l._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const g=ln(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=ln(a.keyType,t,{...s,path:[...s.path,"propertyNames"]})),i.additionalProperties=ln(a.valueType,t,{...s,path:[...s.path,"additionalProperties"]});const p=l._zod.values;if(p){const g=[...p].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(i.required=g)}},o$=(e,t,n,s)=>{const i=e._zod.def,a=ln(i.innerType,t,s),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},i$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},a$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},c$=(e,t,n,s)=>{const i=e._zod.def;ln(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)))},l$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},u$=(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;ln(a,t,s);const l=t.seen.get(e);l.ref=a},f$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},lN=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},d$=ue("ZodISODateTime",(e,t)=>{dU.init(e,t),qt.init(e,t)});function h$(e){return v3(d$,e)}const p$=ue("ZodISODate",(e,t)=>{hU.init(e,t),qt.init(e,t)});function m$(e){return b3(p$,e)}const g$=ue("ZodISOTime",(e,t)=>{pU.init(e,t),qt.init(e,t)});function y$(e){return x3(g$,e)}const v$=ue("ZodISODuration",(e,t)=>{mU.init(e,t),qt.init(e,t)});function b$(e){return S3(v$,e)}const x$=(e,t)=>{q1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>o5(e,n)},flatten:{value:n=>s5(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,hv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,hv,2)}},isEmpty:{get(){return e.issues.length===0}}})},Yr=ue("ZodError",x$,{Parent:Error}),S$=wb(Yr),_$=Eb(Yr),w$=cp(Yr),E$=lp(Yr),T$=c5(Yr),C$=l5(Yr),R$=u5(Yr),N$=f5(Yr),j$=d5(Yr),A$=h5(Yr),k$=p5(Yr),O$=m5(Yr),Ht=ue("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Nh(e,"input"),output:Nh(e,"output")}}),e.toJSONSchema=H3(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(fi(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)=>di(e,n,s),e.brand=()=>e,e.register=((n,s)=>(n.add(e,s),e)),e.parse=(n,s)=>S$(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>w$(e,n,s),e.parseAsync=async(n,s)=>_$(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>E$(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>T$(e,n,s),e.decode=(n,s)=>C$(e,n,s),e.encodeAsync=async(n,s)=>R$(e,n,s),e.decodeAsync=async(n,s)=>N$(e,n,s),e.safeEncode=(n,s)=>j$(e,n,s),e.safeDecode=(n,s)=>A$(e,n,s),e.safeEncodeAsync=async(n,s)=>k$(e,n,s),e.safeDecodeAsync=async(n,s)=>O$(e,n,s),e.refine=(n,s)=>e.check(TB(n,s)),e.superRefine=n=>e.check(CB(n)),e.overwrite=n=>e.check(Wc(n)),e.optional=()=>zE(e),e.exactOptional=()=>dB(e),e.nullable=()=>LE(e),e.nullish=()=>zE(LE(e)),e.nonoptional=n=>vB(e,n),e.array=()=>Gr(e),e.or=n=>Rb([e,n]),e.and=n=>iB(e,n),e.transform=n=>UE(e,uB(n)),e.default=n=>mB(e,n),e.prefault=n=>yB(e,n),e.catch=n=>xB(e,n),e.pipe=n=>UE(e,n),e.readonly=()=>wB(e),e.describe=n=>{const s=e.clone();return cu.add(s,{description:n}),s},Object.defineProperty(e,"description",{get(){return cu.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return cu.get(e);const s=e.clone();return cu.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)=>{Tb.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>V3(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(N3(...s)),e.includes=(...s)=>e.check(k3(...s)),e.startsWith=(...s)=>e.check(O3(...s)),e.endsWith=(...s)=>e.check(M3(...s)),e.min=(...s)=>e.check(Rh(...s)),e.max=(...s)=>e.check(sN(...s)),e.length=(...s)=>e.check(oN(...s)),e.nonempty=(...s)=>e.check(Rh(1,...s)),e.lowercase=s=>e.check(j3(s)),e.uppercase=s=>e.check(A3(s)),e.trim=()=>e.check(P3()),e.normalize=(...s)=>e.check(I3(...s)),e.toLowerCase=()=>e.check(D3()),e.toUpperCase=()=>e.check(z3()),e.slugify=()=>e.check(L3())}),M$=ue("ZodString",(e,t)=>{Tb.init(e,t),uN.init(e,t),e.email=n=>e.check(QU(I$,n)),e.url=n=>e.check(n3(P$,n)),e.jwt=n=>e.check(y3(X$,n)),e.emoji=n=>e.check(r3(D$,n)),e.guid=n=>e.check(kE(PE,n)),e.uuid=n=>e.check(WU(Ad,n)),e.uuidv4=n=>e.check(JU(Ad,n)),e.uuidv6=n=>e.check(e3(Ad,n)),e.uuidv7=n=>e.check(t3(Ad,n)),e.nanoid=n=>e.check(s3(z$,n)),e.guid=n=>e.check(kE(PE,n)),e.cuid=n=>e.check(o3(L$,n)),e.cuid2=n=>e.check(i3(U$,n)),e.ulid=n=>e.check(a3($$,n)),e.base64=n=>e.check(p3(G$,n)),e.base64url=n=>e.check(m3(Z$,n)),e.xid=n=>e.check(c3(B$,n)),e.ksuid=n=>e.check(l3(F$,n)),e.ipv4=n=>e.check(u3(H$,n)),e.ipv6=n=>e.check(f3(q$,n)),e.cidrv4=n=>e.check(d3(V$,n)),e.cidrv6=n=>e.check(h3(K$,n)),e.e164=n=>e.check(g3(Y$,n)),e.datetime=n=>e.check(h$(n)),e.date=n=>e.check(m$(n)),e.time=n=>e.check(y$(n)),e.duration=n=>e.check(b$(n))});function Fe(e){return XU(M$,e)}const qt=ue("ZodStringFormat",(e,t)=>{Bt.init(e,t),uN.init(e,t)}),I$=ue("ZodEmail",(e,t)=>{rU.init(e,t),qt.init(e,t)}),PE=ue("ZodGUID",(e,t)=>{tU.init(e,t),qt.init(e,t)}),Ad=ue("ZodUUID",(e,t)=>{nU.init(e,t),qt.init(e,t)}),P$=ue("ZodURL",(e,t)=>{sU.init(e,t),qt.init(e,t)}),D$=ue("ZodEmoji",(e,t)=>{oU.init(e,t),qt.init(e,t)}),z$=ue("ZodNanoID",(e,t)=>{iU.init(e,t),qt.init(e,t)}),L$=ue("ZodCUID",(e,t)=>{aU.init(e,t),qt.init(e,t)}),U$=ue("ZodCUID2",(e,t)=>{cU.init(e,t),qt.init(e,t)}),$$=ue("ZodULID",(e,t)=>{lU.init(e,t),qt.init(e,t)}),B$=ue("ZodXID",(e,t)=>{uU.init(e,t),qt.init(e,t)}),F$=ue("ZodKSUID",(e,t)=>{fU.init(e,t),qt.init(e,t)}),H$=ue("ZodIPv4",(e,t)=>{gU.init(e,t),qt.init(e,t)}),q$=ue("ZodIPv6",(e,t)=>{yU.init(e,t),qt.init(e,t)}),V$=ue("ZodCIDRv4",(e,t)=>{vU.init(e,t),qt.init(e,t)}),K$=ue("ZodCIDRv6",(e,t)=>{bU.init(e,t),qt.init(e,t)}),G$=ue("ZodBase64",(e,t)=>{xU.init(e,t),qt.init(e,t)}),Z$=ue("ZodBase64URL",(e,t)=>{_U.init(e,t),qt.init(e,t)}),Y$=ue("ZodE164",(e,t)=>{wU.init(e,t),qt.init(e,t)}),X$=ue("ZodJWT",(e,t)=>{TU.init(e,t),qt.init(e,t)}),Cb=ue("ZodNumber",(e,t)=>{eN.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>K3(e,s,i),e.gt=(s,i)=>e.check(ME(s,i)),e.gte=(s,i)=>e.check(sy(s,i)),e.min=(s,i)=>e.check(sy(s,i)),e.lt=(s,i)=>e.check(OE(s,i)),e.lte=(s,i)=>e.check(ry(s,i)),e.max=(s,i)=>e.check(ry(s,i)),e.int=s=>e.check(DE(s)),e.safe=s=>e.check(DE(s)),e.positive=s=>e.check(ME(0,s)),e.nonnegative=s=>e.check(sy(0,s)),e.negative=s=>e.check(OE(0,s)),e.nonpositive=s=>e.check(ry(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 tn(e){return _3(Cb,e)}const Q$=ue("ZodNumberFormat",(e,t)=>{CU.init(e,t),Cb.init(e,t)});function DE(e){return E3(Q$,e)}const W$=ue("ZodBoolean",(e,t)=>{RU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>G3(e,n,s)});function no(e){return T3(W$,e)}const J$=ue("ZodUnknown",(e,t)=>{NU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Y3()});function ia(){return C3(J$)}const eB=ue("ZodNever",(e,t)=>{jU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Z3(e,n,s)});function tB(e){return R3(eB,e)}const nB=ue("ZodArray",(e,t)=>{AU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>e$(e,n,s,i),e.element=t.element,e.min=(n,s)=>e.check(Rh(n,s)),e.nonempty=n=>e.check(Rh(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 Gr(e,t){return U3(nB,e,t)}const rB=ue("ZodObject",(e,t)=>{OU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>t$(e,n,s,i),wt(e,"shape",()=>t.shape),e.keyof=()=>Yu(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ia()}),e.loose=()=>e.clone({...e._zod.def,catchall:ia()}),e.strict=()=>e.clone({...e._zod.def,catchall:tB()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>J4(e,n),e.safeExtend=n=>e5(e,n),e.merge=n=>t5(e,n),e.pick=n=>Q4(e,n),e.omit=n=>W4(e,n),e.partial=(...n)=>n5(fN,e,n[0]),e.required=(...n)=>r5(dN,e,n[0])});function At(e,t){const n={type:"object",shape:e??{},...De(t)};return new rB(n)}const sB=ue("ZodUnion",(e,t)=>{MU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>n$(e,n,s,i),e.options=t.options});function Rb(e,t){return new sB({type:"union",options:e,...De(t)})}const oB=ue("ZodIntersection",(e,t)=>{IU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>r$(e,n,s,i)});function iB(e,t){return new oB({type:"intersection",left:e,right:t})}const aB=ue("ZodRecord",(e,t)=>{PU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>s$(e,n,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function Zu(e,t,n){return new aB({type:"record",keyType:e,valueType:t,...De(n)})}const mv=ue("ZodEnum",(e,t)=>{DU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>X3(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 l of s)if(n.has(l))a[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new mv({...t,checks:[],...De(i),entries:a})},e.exclude=(s,i)=>{const a={...t.entries};for(const l of s)if(n.has(l))delete a[l];else throw new Error(`Key ${l} not found in enum`);return new mv({...t,checks:[],...De(i),entries:a})}});function Yu(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new mv({type:"enum",entries:n,...De(t)})}const cB=ue("ZodLiteral",(e,t)=>{zU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Q3(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 si(e,t){return new cB({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const lB=ue("ZodTransform",(e,t)=>{LU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>J3(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(wu(a,n.value,t));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(wu(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function uB(e){return new lB({type:"transform",transform:e})}const fN=ue("ZodOptional",(e,t)=>{rN.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>lN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function zE(e){return new fN({type:"optional",innerType:e})}const fB=ue("ZodExactOptional",(e,t)=>{UU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>lN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function dB(e){return new fB({type:"optional",innerType:e})}const hB=ue("ZodNullable",(e,t)=>{$U.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>o$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function LE(e){return new hB({type:"nullable",innerType:e})}const pB=ue("ZodDefault",(e,t)=>{BU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>a$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function mB(e,t){return new pB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():F1(t)}})}const gB=ue("ZodPrefault",(e,t)=>{FU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>c$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function yB(e,t){return new gB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():F1(t)}})}const dN=ue("ZodNonOptional",(e,t)=>{HU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>i$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function vB(e,t){return new dN({type:"nonoptional",innerType:e,...De(t)})}const bB=ue("ZodCatch",(e,t)=>{qU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>l$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xB(e,t){return new bB({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const SB=ue("ZodPipe",(e,t)=>{VU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>u$(e,n,s,i),e.in=t.in,e.out=t.out});function UE(e,t){return new SB({type:"pipe",in:e,out:t})}const _B=ue("ZodReadonly",(e,t)=>{KU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>f$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function wB(e){return new _B({type:"readonly",innerType:e})}const EB=ue("ZodCustom",(e,t)=>{GU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>W3(e,n)});function TB(e,t={}){return $3(EB,e,t)}function CB(e){return B3(e)}function $E(e){return w3(Cb,e)}At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:tn().int().min(0),mimeType:Fe().min(1),encrypted:no().optional(),keyId:Fe().optional()});const hN=At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i),size:tn().int().min(0),mimeType:Fe().min(1),createdAt:Fe(),expiresAt:Fe().optional(),uploadComplete:no()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:tn().int().min(0),mimeType:Fe().min(1)});At({exists:no(),uploadId:Fe().optional(),uploadUrl:Fe().url().optional(),uploadMethod:Yu(["PUT","POST"]).optional(),uploadHeaders:Zu(Fe(),Fe()).optional(),chunkSize:tn().int().optional()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});At({ok:no(),metadata:hN.optional(),error:Fe().optional()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});At({url:Fe().url(),expiresAt:Fe(),metadata:hN});At({error:Fe(),message:Fe().optional(),code:Fe().optional()});At({limit:$E().int().min(1).max(100).default(50),offset:$E().int().min(0).default(0)});const RB="json-row-frame-v1",NB="gzip",pN=Yu(["upsert","delete"]),jB=Zu(Fe(),Fe()),mN=Zu(Fe(),Rb([Fe(),Gr(Fe())])),AB=At({table:Fe(),row_id:Fe(),op:pN,payload:Zu(Fe(),ia()).nullable(),base_version:tn().int().nullable().optional()}),kB=At({clientId:Fe().min(1),clientCommitId:Fe().min(1),operations:Gr(AB).min(1),schemaVersion:tn().int().min(1)}),OB=At({opIndex:tn().int(),status:si("applied")}),MB=At({opIndex:tn().int(),status:si("conflict"),message:Fe(),server_version:tn().int(),server_row:ia()}),IB=At({opIndex:tn().int(),status:si("error"),error:Fe(),code:Fe().optional(),retriable:no().optional()}),PB=Rb([OB,MB,IB]),DB=At({ok:si(!0),status:Yu(["applied","cached","rejected"]),commitSeq:tn().int().optional(),results:Gr(PB)}),gN=At({asOfCommitSeq:tn().int(),tables:Gr(Fe()),tableIndex:tn().int(),rowCursor:Fe().nullable()}),zB=At({id:Fe().min(1),table:Fe().min(1),scopes:mN,params:Zu(Fe(),ia()).optional(),cursor:tn().int(),bootstrapState:gN.nullable().optional()}),LB=At({clientId:Fe().min(1),limitCommits:tn().int().min(1),limitSnapshotRows:tn().int().min(1).optional(),maxSnapshotPages:tn().int().min(1).optional(),dedupeRows:no().optional(),subscriptions:Gr(zB)}),UB=At({table:Fe(),row_id:Fe(),op:pN,row_json:ia().nullable(),row_version:tn().int().nullable(),scopes:jB}),$B=At({commitSeq:tn().int(),createdAt:Fe(),actorId:Fe(),changes:Gr(UB)}),BB=At({id:Fe(),byteLength:tn().int(),sha256:Fe(),encoding:si(RB),compression:si(NB)}),FB=At({table:Fe(),rows:Gr(ia()),chunks:Gr(BB).optional(),isFirstPage:no(),isLastPage:no()}),HB=At({id:Fe(),status:Yu(["active","revoked"]),scopes:mN,bootstrap:no(),bootstrapState:gN.nullable().optional(),nextCursor:tn().int(),commits:Gr($B),snapshots:Gr(FB).optional()}),qB=At({ok:si(!0),subscriptions:Gr(HB)});At({clientId:Fe().min(1),push:kB.omit({clientId:!0}).optional(),pull:LB.omit({clientId:!0}).optional()});At({ok:si(!0),push:DB.optional(),pull:qB.optional()});new TextEncoder;const VB={setAttribute(){},setAttributes(){},setStatus(){}};function KB(e){return e.level?e.level:e.error?"error":"info"}function oy(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 GB(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 ZB(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=ZB(s);i!==void 0&&(t[n]=i)}return Object.keys(t).length>0?t:null}function YB(e){return{startSpan(t,n){return e.startSpan?e.startSpan(t,s=>n(GB(s))):n(VB)}}}function XB(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 QB(e){return{log(t){const n=KB(t),{event:s,...i}=t,a=oy(e.logger,n);if(!a)return;const l=BE(i);if(!l){a(s);return}a(s,l)},tracer:YB(e),metrics:XB(e),captureException(t,n){if(e.captureException?.(t),!n)return;const s=oy(e.logger,"error")??oy(e.logger,"info");if(!s)return;const i=BE(n);if(!i){s("sync.exception.context");return}s("sync.exception.context",i)}}}function WB(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 JB(){return QB({logger:w2,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=WB(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 e6(){return JB()}function t6(e){const t=n6(e);return q4(t),e6()}function n6(e){const t=e.integrations;if(typeof t=="function")return e;const n=t??[];return n.some(i=>i.name==="BrowserTracing")?e:{...e,integrations:[L4(),...n]}}var iy={exports:{}},Jl={};var HE;function r6(){if(HE)return Jl;HE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+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:l,ref:i!==void 0?i:null,props:a}}return Jl.Fragment=t,Jl.jsx=n,Jl.jsxs=n,Jl}var qE;function s6(){return qE||(qE=1,iy.exports=r6()),iy.exports}var h=s6(),ay={exports:{}},eu={},cy={exports:{}},ly={};var VE;function o6(){return VE||(VE=1,(function(e){function t(D,K){var q=D.length;D.push(K);e:for(;0<q;){var V=q-1>>>1,U=D[V];if(0<i(U,K))D[V]=K,D[q]=U,q=V;else break e}}function n(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var K=D[0],q=D.pop();if(q!==K){D[0]=q;e:for(var V=0,U=D.length,I=U>>>1;V<I;){var H=2*(V+1)-1,W=D[H],X=H+1,oe=D[X];if(0>i(W,q))X<U&&0>i(oe,W)?(D[V]=oe,D[X]=q,V=X):(D[V]=W,D[H]=q,V=H);else if(X<U&&0>i(oe,q))D[V]=oe,D[X]=q,V=X;else break e}}return K}function i(D,K){var q=D.sortIndex-K.sortIndex;return q!==0?q:D.id-K.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 l=Date,f=l.now();e.unstable_now=function(){return l.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,k=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function R(D){for(var K=n(p);K!==null;){if(K.callback===null)s(p);else if(K.startTime<=D)s(p),K.sortIndex=K.expirationTime,t(d,K);else break;K=n(p)}}function M(D){if(w=!1,R(D),!S)if(n(d)!==null)S=!0,L||(L=!0,z());else{var K=n(p);K!==null&&ee(M,K.startTime-D)}}var L=!1,j=-1,A=5,P=-1;function G(){return T?!0:!(e.unstable_now()-P<A)}function B(){if(T=!1,L){var D=e.unstable_now();P=D;var K=!0;try{e:{S=!1,w&&(w=!1,k(j),j=-1),x=!0;var q=b;try{t:{for(R(D),y=n(d);y!==null&&!(y.expirationTime>D&&G());){var V=y.callback;if(typeof V=="function"){y.callback=null,b=y.priorityLevel;var U=V(y.expirationTime<=D);if(D=e.unstable_now(),typeof U=="function"){y.callback=U,R(D),K=!0;break t}y===n(d)&&s(d),R(D)}else s(d);y=n(d)}if(y!==null)K=!0;else{var I=n(p);I!==null&&ee(M,I.startTime-D),K=!1}}break e}finally{y=null,b=q,x=!1}K=void 0}}finally{K?z():L=!1}}}var z;if(typeof N=="function")z=function(){N(B)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,Y=Q.port2;Q.port1.onmessage=B,z=function(){Y.postMessage(null)}}else z=function(){C(B,0)};function ee(D,K){j=C(function(){D(e.unstable_now())},K)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(D){switch(b){case 1:case 2:case 3:var K=3;break;default:K=b}var q=b;b=K;try{return D()}finally{b=q}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(D,K){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var q=b;b=D;try{return K()}finally{b=q}},e.unstable_scheduleCallback=function(D,K,q){var V=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?V+q:V):q=V,D){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=q+U,D={id:g++,callback:K,priorityLevel:D,startTime:q,expirationTime:U,sortIndex:-1},q>V?(D.sortIndex=q,t(p,D),n(d)===null&&D===n(p)&&(w?(k(j),j=-1):w=!0,ee(M,q-V))):(D.sortIndex=U,t(d,D),S||x||(S=!0,L||(L=!0,z()))),D},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(D){var K=b;return function(){var q=b;b=K;try{return D.apply(this,arguments)}finally{b=q}}}})(ly)),ly}var KE;function i6(){return KE||(KE=1,cy.exports=o6()),cy.exports}var uy={exports:{}},Rn={};var GE;function a6(){if(GE)return Rn;GE=1;var e=Gu();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 l=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 Rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Rn.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)},Rn.flushSync=function(d){var p=l.T,g=s.p;try{if(l.T=null,s.p=2,d)return d()}finally{l.T=p,s.p=g,s.d.f()}},Rn.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))},Rn.prefetchDNS=function(d){typeof d=="string"&&s.d.D(d)},Rn.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})}},Rn.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)},Rn.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})}},Rn.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)},Rn.requestFormReset=function(d){s.d.r(d)},Rn.unstable_batchedUpdates=function(d,p){return d(p)},Rn.useFormState=function(d,p,g){return l.H.useFormState(d,p,g)},Rn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Rn.version="19.2.4",Rn}var ZE;function yN(){if(ZE)return uy.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(),uy.exports=a6(),uy.exports}var YE;function c6(){if(YE)return eu;YE=1;var e=i6(),t=Gu(),n=yN();function s(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}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,c=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(c=o.return),r=o.return;while(r)}return o.tag===3?c:null}function l(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 c=r,u=o;;){var m=c.return;if(m===null)break;var v=m.alternate;if(v===null){if(u=m.return,u!==null){c=u;continue}break}if(m.child===v.child){for(v=m.child;v;){if(v===c)return d(m),r;if(v===u)return d(m),o;v=v.sibling}throw Error(s(188))}if(c.return!==u.return)c=m,u=v;else{for(var E=!1,O=m.child;O;){if(O===c){E=!0,c=m,u=v;break}if(O===u){E=!0,u=m,c=v;break}O=O.sibling}if(!E){for(O=v.child;O;){if(O===c){E=!0,c=v,u=m;break}if(O===u){E=!0,u=v,c=m;break}O=O.sibling}if(!E)throw Error(s(189))}}if(c.alternate!==u)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?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"),k=Symbol.for("react.consumer"),N=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function z(r){return r===null||typeof r!="object"?null:(r=B&&r[B]||r["@@iterator"],typeof r=="function"?r:null)}var Q=Symbol.for("react.client.reference");function Y(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Q?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case M:return"Suspense";case L:return"SuspenseList";case P:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case N:return r.displayName||"Context";case k: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 A:o=r._payload,r=r._init;try{return Y(r(o))}catch{}}return null}var ee=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},V=[],U=-1;function I(r){return{current:r}}function H(r){0>U||(r.current=V[U],V[U]=null,U--)}function W(r,o){U++,V[U]=r.current,r.current=o}var X=I(null),oe=I(null),se=I(null),de=I(null);function xe(r,o){switch(W(se,o),W(oe,r),W(X,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?M_(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=M_(o),r=I_(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}H(X),W(X,r)}function he(){H(X),H(oe),H(se)}function Me(r){r.memoizedState!==null&&W(de,r);var o=X.current,c=I_(o,r.type);o!==c&&(W(oe,r),W(X,c))}function _e(r){oe.current===r&&(H(X),H(oe)),de.current===r&&(H(de),Zl._currentValue=q)}var ne,pe;function ae(r){if(ne===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);ne=o&&o[1]||"",pe=-1<c.stack.indexOf(`
60
60
  at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
61
- `+ne+r+he}var we=!1;function ve(r,o){if(!r||we)return"";we=!0;var c=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 re=ie}Reflect.construct(r,[],fe)}else{try{fe.call()}catch(ie){re=ie}r.call(fe.prototype)}}else{try{throw Error()}catch(ie){re=ie}(fe=r())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ie){if(ie&&re&&typeof ie.stack=="string")return[ie.stack,re.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],k=v[1];if(E&&k){var $=E.split(`
62
- `),te=k.split(`
61
+ `+ne+r+pe}var we=!1;function ve(r,o){if(!r||we)return"";we=!0;var c=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 re=ie}Reflect.construct(r,[],fe)}else{try{fe.call()}catch(ie){re=ie}r.call(fe.prototype)}}else{try{throw Error()}catch(ie){re=ie}(fe=r())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ie){if(ie&&re&&typeof ie.stack=="string")return[ie.stack,re.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],O=v[1];if(E&&O){var $=E.split(`
62
+ `),te=O.split(`
63
63
  `);for(m=u=0;u<$.length&&!$[u].includes("DetermineComponentFrameRoot");)u++;for(;m<te.length&&!te[m].includes("DetermineComponentFrameRoot");)m++;if(u===$.length||m===te.length)for(u=$.length-1,m=te.length-1;1<=u&&0<=m&&$[u]!==te[m];)m--;for(;1<=u&&0<=m;u--,m--)if($[u]!==te[m]){if(u!==1||m!==1)do if(u--,m--,0>m||$[u]!==te[m]){var ce=`
64
64
  `+$[u].replace(" at new "," at ");return r.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",r.displayName)),ce}while(1<=u&&0<=m);break}}}finally{we=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?ae(c):""}function Se(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="",c=null;do o+=Se(r,c),c=r,r=r.return;while(r);return o}catch(u){return`
65
65
  Error generating stack: `+u.message+`
66
- `+u.stack}}var Ue=Object.prototype.hasOwnProperty,Ie=e.unstable_scheduleCallback,Ee=e.unstable_cancelCallback,Ve=e.unstable_shouldYield,Xe=e.unstable_requestPaint,Be=e.unstable_now,We=e.unstable_getCurrentPriorityLevel,He=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,qe=e.unstable_LowPriority,mt=e.unstable_IdlePriority,lt=e.log,wr=e.unstable_setDisableYieldValue,Er=null,Qt=null;function ut(r){if(typeof lt=="function"&&wr(r),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Er,r)}catch{}}var xt=Math.clz32?Math.clz32:vn,ot=Math.log,Wt=Math.LN2;function vn(r){return r>>>=0,r===0?32:31-(ot(r)/Wt|0)|0}var kt=256,Cn=262144,er=4194304;function An(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 as(r,o,c){var u=r.pendingLanes;if(u===0)return 0;var m=0,v=r.suspendedLanes,E=r.pingedLanes;r=r.warmLanes;var k=u&134217727;return k!==0?(u=k&~v,u!==0?m=An(u):(E&=k,E!==0?m=An(E):c||(c=k&~r,c!==0&&(m=An(c))))):(k=u&~v,k!==0?m=An(k):E!==0?m=An(E):c||(c=u&~r,c!==0&&(m=An(c)))),m===0?0:o!==0&&o!==m&&(o&v)===0&&(v=m&-m,c=o&-o,v>=c||v===32&&(c&4194048)!==0)?o:m}function cs(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function _a(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 wi(){var r=er;return er<<=1,(er&62914560)===0&&(er=4194304),r}function Ei(r){for(var o=[],c=0;31>c;c++)o.push(r);return o}function ws(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function tr(r,o,c,u,m,v){var E=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var k=r.entanglements,$=r.expirationTimes,te=r.hiddenUpdates;for(c=E&~c;0<c;){var ce=31-xt(c),fe=1<<ce;k[ce]=0,$[ce]=-1;var re=te[ce];if(re!==null)for(te[ce]=null,ce=0;ce<re.length;ce++){var ie=re[ce];ie!==null&&(ie.lane&=-536870913)}c&=~fe}u!==0&&ls(r,u,0),v!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=v&~(E&~o))}function ls(r,o,c){r.pendingLanes|=o,r.suspendedLanes&=~o;var u=31-xt(o);r.entangledLanes|=o,r.entanglements[u]=r.entanglements[u]|1073741824|c&261930}function uo(r,o){var c=r.entangledLanes|=o;for(r=r.entanglements;c;){var u=31-xt(c),m=1<<u;m&o|r[u]&o&&(r[u]|=o),c&=~m}}function fo(r,o){var c=o&-o;return c=(c&42)!==0?1:nr(c),(c&(r.suspendedLanes|o))!==0?0:c}function nr(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 cl(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function af(){var r=V.p;return r!==0?r:(r=window.event,r===void 0?32:tw(r.type))}function cf(r,o){var c=V.p;try{return V.p=r,o()}finally{V.p=c}}var ho=Math.random().toString(36).slice(2),Sn="__reactFiber$"+ho,Un="__reactProps$"+ho,wa="__reactContainer$"+ho,kp="__reactEvents$"+ho,vk="__reactListeners$"+ho,bk="__reactHandles$"+ho,vx="__reactResources$"+ho,ll="__reactMarker$"+ho;function Op(r){delete r[Sn],delete r[Un],delete r[kp],delete r[vk],delete r[bk]}function Ea(r){var o=r[Sn];if(o)return o;for(var c=r.parentNode;c;){if(o=c[wa]||c[Sn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(r=U_(r);r!==null;){if(c=r[Sn])return c;r=U_(r)}return o}r=c,c=r.parentNode}return null}function Ta(r){if(r=r[Sn]||r[wa]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function ul(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(s(33))}function Ca(r){var o=r[vx];return o||(o=r[vx]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function bn(r){r[ll]=!0}var bx=new Set,xx={};function Ti(r,o){Ra(r,o),Ra(r+"Capture",o)}function Ra(r,o){for(xx[r]=o,r=0;r<o.length;r++)bx.add(o[r])}var xk=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]*$"),Sx={},_x={};function Sk(r){return Ue.call(_x,r)?!0:Ue.call(Sx,r)?!1:xk.test(r)?_x[r]=!0:(Sx[r]=!0,!1)}function lf(r,o,c){if(Sk(o))if(c===null)r.removeAttribute(o);else{switch(typeof c){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,""+c)}}function uf(r,o,c){if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+c)}}function Es(r,o,c,u){if(u===null)r.removeAttribute(c);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(o,c,""+u)}}function Tr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function wx(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function _k(r,o,c){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){c=""+E,v.call(this,E)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function Mp(r){if(!r._valueTracker){var o=wx(r)?"checked":"value";r._valueTracker=_k(r,o,""+r[o])}}function Ex(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var c=o.getValue(),u="";return r&&(u=wx(r)?r.checked?"true":"false":r.value),r=u,r!==c?(o.setValue(r),!0):!1}function ff(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 wk=/[\n"\\]/g;function Cr(r){return r.replace(wk,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Ip(r,o,c,u,m,v,E,k){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=""+Tr(o)):r.value!==""+Tr(o)&&(r.value=""+Tr(o)):E!=="submit"&&E!=="reset"||r.removeAttribute("value"),o!=null?Pp(r,E,Tr(o)):c!=null?Pp(r,E,Tr(c)):u!=null&&r.removeAttribute("value"),m==null&&v!=null&&(r.defaultChecked=!!v),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?r.name=""+Tr(k):r.removeAttribute("name")}function Tx(r,o,c,u,m,v,E,k){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),o!=null||c!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){Mp(r);return}c=c!=null?""+Tr(c):"",o=o!=null?""+Tr(o):c,k||o===r.value||(r.value=o),r.defaultValue=o}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=k?r.checked:!!u,r.defaultChecked=!!u,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(r.name=E),Mp(r)}function Pp(r,o,c){o==="number"&&ff(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function Na(r,o,c,u){if(r=r.options,o){o={};for(var m=0;m<c.length;m++)o["$"+c[m]]=!0;for(c=0;c<r.length;c++)m=o.hasOwnProperty("$"+r[c].value),r[c].selected!==m&&(r[c].selected=m),m&&u&&(r[c].defaultSelected=!0)}else{for(c=""+Tr(c),o=null,m=0;m<r.length;m++){if(r[m].value===c){r[m].selected=!0,u&&(r[m].defaultSelected=!0);return}o!==null||r[m].disabled||(o=r[m])}o!==null&&(o.selected=!0)}}function Cx(r,o,c){if(o!=null&&(o=""+Tr(o),o!==r.value&&(r.value=o),c==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=c!=null?""+Tr(c):""}function Rx(r,o,c,u){if(o==null){if(u!=null){if(c!=null)throw Error(s(92));if(ee(u)){if(1<u.length)throw Error(s(93));u=u[0]}c=u}c==null&&(c=""),o=c}c=Tr(o),r.defaultValue=c,u=r.textContent,u===c&&u!==""&&u!==null&&(r.value=u),Mp(r)}function ja(r,o){if(o){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=o;return}}r.textContent=o}var Ek=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 Nx(r,o,c){var u=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?u?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":u?r.setProperty(o,c):typeof c!="number"||c===0||Ek.has(o)?o==="float"?r.cssFloat=c:r[o]=(""+c).trim():r[o]=c+"px"}function jx(r,o,c){if(o!=null&&typeof o!="object")throw Error(s(62));if(r=r.style,c!=null){for(var u in c)!c.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)&&c[m]!==u&&Nx(r,m,u)}else for(var v in o)o.hasOwnProperty(v)&&Nx(r,v,o[v])}function Dp(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 Tk=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"]]),Ck=/^[\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 df(r){return Ck.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ts(){}var zp=null;function Lp(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Aa=null,ka=null;function Ax(r){var o=Ta(r);if(o&&(r=o.stateNode)){var c=r[Un]||null;e:switch(r=o.stateNode,o.type){case"input":if(Ip(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Cr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var u=c[o];if(u!==r&&u.form===r.form){var m=u[Un]||null;if(!m)throw Error(s(90));Ip(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(o=0;o<c.length;o++)u=c[o],u.form===r.form&&Ex(u)}break e;case"textarea":Cx(r,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&Na(r,!!c.multiple,o,!1)}}}var Up=!1;function kx(r,o,c){if(Up)return r(o,c);Up=!0;try{var u=r(o);return u}finally{if(Up=!1,(Aa!==null||ka!==null)&&(Jf(),Aa&&(o=Aa,r=ka,ka=Aa=null,Ax(o),r)))for(o=0;o<r.length;o++)Ax(r[o])}}function fl(r,o){var c=r.stateNode;if(c===null)return null;var u=c[Un]||null;if(u===null)return null;c=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(c&&typeof c!="function")throw Error(s(231,o,typeof c));return c}var Cs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$p=!1;if(Cs)try{var dl={};Object.defineProperty(dl,"passive",{get:function(){$p=!0}}),window.addEventListener("test",dl,dl),window.removeEventListener("test",dl,dl)}catch{$p=!1}var po=null,Bp=null,hf=null;function Ox(){if(hf)return hf;var r,o=Bp,c=o.length,u,m="value"in po?po.value:po.textContent,v=m.length;for(r=0;r<c&&o[r]===m[r];r++);var E=c-r;for(u=1;u<=E&&o[c-u]===m[v-u];u++);return hf=m.slice(r,1<u?1-u:void 0)}function pf(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 mf(){return!0}function Mx(){return!1}function $n(r){function o(c,u,m,v,E){this._reactName=c,this._targetInst=m,this.type=u,this.nativeEvent=v,this.target=E,this.currentTarget=null;for(var k in r)r.hasOwnProperty(k)&&(c=r[k],this[k]=c?c(v):v[k]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?mf:Mx,this.isPropagationStopped=Mx,this}return y(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=mf)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=mf)},persist:function(){},isPersistent:mf}),o}var Ci={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gf=$n(Ci),hl=y({},Ci,{view:0,detail:0}),Rk=$n(hl),Fp,Hp,pl,yf=y({},hl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vp,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!==pl&&(pl&&r.type==="mousemove"?(Fp=r.screenX-pl.screenX,Hp=r.screenY-pl.screenY):Hp=Fp=0,pl=r),Fp)},movementY:function(r){return"movementY"in r?r.movementY:Hp}}),Ix=$n(yf),Nk=y({},yf,{dataTransfer:0}),jk=$n(Nk),Ak=y({},hl,{relatedTarget:0}),qp=$n(Ak),kk=y({},Ci,{animationName:0,elapsedTime:0,pseudoElement:0}),Ok=$n(kk),Mk=y({},Ci,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Ik=$n(Mk),Pk=y({},Ci,{data:0}),Px=$n(Pk),Dk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zk={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"},Lk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uk(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=Lk[r])?!!o[r]:!1}function Vp(){return Uk}var $k=y({},hl,{key:function(r){if(r.key){var o=Dk[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=pf(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?zk[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vp,charCode:function(r){return r.type==="keypress"?pf(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?pf(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Bk=$n($k),Fk=y({},yf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dx=$n(Fk),Hk=y({},hl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vp}),qk=$n(Hk),Vk=y({},Ci,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kk=$n(Vk),Gk=y({},yf,{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}),Zk=$n(Gk),Yk=y({},Ci,{newState:0,oldState:0}),Xk=$n(Yk),Qk=[9,13,27,32],Kp=Cs&&"CompositionEvent"in window,ml=null;Cs&&"documentMode"in document&&(ml=document.documentMode);var Wk=Cs&&"TextEvent"in window&&!ml,zx=Cs&&(!Kp||ml&&8<ml&&11>=ml),Lx=" ",Ux=!1;function $x(r,o){switch(r){case"keyup":return Qk.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bx(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Oa=!1;function Jk(r,o){switch(r){case"compositionend":return Bx(o);case"keypress":return o.which!==32?null:(Ux=!0,Lx);case"textInput":return r=o.data,r===Lx&&Ux?null:r;default:return null}}function eO(r,o){if(Oa)return r==="compositionend"||!Kp&&$x(r,o)?(r=Ox(),hf=Bp=po=null,Oa=!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 zx&&o.locale!=="ko"?null:o.data;default:return null}}var tO={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 Fx(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!tO[r.type]:o==="textarea"}function Hx(r,o,c,u){Aa?ka?ka.push(u):ka=[u]:Aa=u,o=id(o,"onChange"),0<o.length&&(c=new gf("onChange","change",null,c,u),r.push({event:c,listeners:o}))}var gl=null,yl=null;function nO(r){T_(r,0)}function vf(r){var o=ul(r);if(Ex(o))return r}function qx(r,o){if(r==="change")return o}var Vx=!1;if(Cs){var Gp;if(Cs){var Zp="oninput"in document;if(!Zp){var Kx=document.createElement("div");Kx.setAttribute("oninput","return;"),Zp=typeof Kx.oninput=="function"}Gp=Zp}else Gp=!1;Vx=Gp&&(!document.documentMode||9<document.documentMode)}function Gx(){gl&&(gl.detachEvent("onpropertychange",Zx),yl=gl=null)}function Zx(r){if(r.propertyName==="value"&&vf(yl)){var o=[];Hx(o,yl,r,Lp(r)),kx(nO,o)}}function rO(r,o,c){r==="focusin"?(Gx(),gl=o,yl=c,gl.attachEvent("onpropertychange",Zx)):r==="focusout"&&Gx()}function sO(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return vf(yl)}function oO(r,o){if(r==="click")return vf(o)}function iO(r,o){if(r==="input"||r==="change")return vf(o)}function aO(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var rr=typeof Object.is=="function"?Object.is:aO;function vl(r,o){if(rr(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var c=Object.keys(r),u=Object.keys(o);if(c.length!==u.length)return!1;for(u=0;u<c.length;u++){var m=c[u];if(!Ue.call(o,m)||!rr(r[m],o[m]))return!1}return!0}function Yx(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Xx(r,o){var c=Yx(r);r=0;for(var u;c;){if(c.nodeType===3){if(u=r+c.textContent.length,r<=o&&u>=o)return{node:c,offset:o-r};r=u}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Yx(c)}}function Qx(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Qx(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function Wx(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=ff(r.document);o instanceof r.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)r=o.contentWindow;else break;o=ff(r.document)}return o}function Yp(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 cO=Cs&&"documentMode"in document&&11>=document.documentMode,Ma=null,Xp=null,bl=null,Qp=!1;function Jx(r,o,c){var u=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Qp||Ma==null||Ma!==ff(u)||(u=Ma,"selectionStart"in u&&Yp(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}),bl&&vl(bl,u)||(bl=u,u=id(Xp,"onSelect"),0<u.length&&(o=new gf("onSelect","select",null,o,c),r.push({event:o,listeners:u}),o.target=Ma)))}function Ri(r,o){var c={};return c[r.toLowerCase()]=o.toLowerCase(),c["Webkit"+r]="webkit"+o,c["Moz"+r]="moz"+o,c}var Ia={animationend:Ri("Animation","AnimationEnd"),animationiteration:Ri("Animation","AnimationIteration"),animationstart:Ri("Animation","AnimationStart"),transitionrun:Ri("Transition","TransitionRun"),transitionstart:Ri("Transition","TransitionStart"),transitioncancel:Ri("Transition","TransitionCancel"),transitionend:Ri("Transition","TransitionEnd")},Wp={},e0={};Cs&&(e0=document.createElement("div").style,"AnimationEvent"in window||(delete Ia.animationend.animation,delete Ia.animationiteration.animation,delete Ia.animationstart.animation),"TransitionEvent"in window||delete Ia.transitionend.transition);function Ni(r){if(Wp[r])return Wp[r];if(!Ia[r])return r;var o=Ia[r],c;for(c in o)if(o.hasOwnProperty(c)&&c in e0)return Wp[r]=o[c];return r}var t0=Ni("animationend"),n0=Ni("animationiteration"),r0=Ni("animationstart"),lO=Ni("transitionrun"),uO=Ni("transitionstart"),fO=Ni("transitioncancel"),s0=Ni("transitionend"),o0=new Map,Jp="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(" ");Jp.push("scrollEnd");function Qr(r,o){o0.set(r,o),Ti(o,[r])}var bf=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)},Rr=[],Pa=0,em=0;function xf(){for(var r=Pa,o=em=Pa=0;o<r;){var c=Rr[o];Rr[o++]=null;var u=Rr[o];Rr[o++]=null;var m=Rr[o];Rr[o++]=null;var v=Rr[o];if(Rr[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&&i0(c,m,v)}}function Sf(r,o,c,u){Rr[Pa++]=r,Rr[Pa++]=o,Rr[Pa++]=c,Rr[Pa++]=u,em|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function tm(r,o,c,u){return Sf(r,o,c,u),_f(r)}function ji(r,o){return Sf(r,null,null,o),_f(r)}function i0(r,o,c){r.lanes|=c;var u=r.alternate;u!==null&&(u.lanes|=c);for(var m=!1,v=r.return;v!==null;)v.childLanes|=c,u=v.alternate,u!==null&&(u.childLanes|=c),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(c),r=v.hiddenUpdates,u=r[m],u===null?r[m]=[o]:u.push(o),o.lane=c|536870912),v):null}function _f(r){if(50<Bl)throw Bl=0,ug=null,Error(s(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var Da={};function dO(r,o,c,u){this.tag=r,this.key=c,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 sr(r,o,c,u){return new dO(r,o,c,u)}function nm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Rs(r,o){var c=r.alternate;return c===null?(c=sr(r.tag,o,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=o,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,o=r.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function a0(r,o){r.flags&=65011714;var c=r.alternate;return c===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=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,o=c.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function wf(r,o,c,u,m,v){var E=0;if(u=r,typeof r=="function")nm(r)&&(E=1);else if(typeof r=="string")E=yM(r,c,X.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case P:return r=sr(31,c,o,m),r.elementType=P,r.lanes=v,r;case w:return Ai(c.children,m,v,o);case T:E=8,m|=24;break;case C:return r=sr(12,c,o,m|2),r.elementType=C,r.lanes=v,r;case M:return r=sr(13,c,o,m),r.elementType=M,r.lanes=v,r;case L:return r=sr(19,c,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 O:E=9;break e;case R:E=11;break e;case j:E=14;break e;case A:E=16,u=null;break e}E=29,c=Error(s(130,r===null?"null":typeof r,"")),u=null}return o=sr(E,c,o,m),o.elementType=r,o.type=u,o.lanes=v,o}function Ai(r,o,c,u){return r=sr(7,r,u,o),r.lanes=c,r}function rm(r,o,c){return r=sr(6,r,null,o),r.lanes=c,r}function c0(r){var o=sr(18,null,null,0);return o.stateNode=r,o}function sm(r,o,c){return o=sr(4,r.children!==null?r.children:[],r.key,o),o.lanes=c,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var l0=new WeakMap;function Nr(r,o){if(typeof r=="object"&&r!==null){var c=l0.get(r);return c!==void 0?c:(o={value:r,source:o,stack:ye(o)},l0.set(r,o),o)}return{value:r,source:o,stack:ye(o)}}var za=[],La=0,Ef=null,xl=0,jr=[],Ar=0,mo=null,us=1,fs="";function Ns(r,o){za[La++]=xl,za[La++]=Ef,Ef=r,xl=o}function u0(r,o,c){jr[Ar++]=us,jr[Ar++]=fs,jr[Ar++]=mo,mo=r;var u=us;r=fs;var m=32-xt(u)-1;u&=~(1<<m),c+=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,us=1<<32-xt(o)+m|c<<m|u,fs=v+r}else us=1<<v|c<<m|u,fs=r}function om(r){r.return!==null&&(Ns(r,1),u0(r,1,0))}function im(r){for(;r===Ef;)Ef=za[--La],za[La]=null,xl=za[--La],za[La]=null;for(;r===mo;)mo=jr[--Ar],jr[Ar]=null,fs=jr[--Ar],jr[Ar]=null,us=jr[--Ar],jr[Ar]=null}function f0(r,o){jr[Ar++]=us,jr[Ar++]=fs,jr[Ar++]=mo,us=o.id,fs=o.overflow,mo=r}var _n=null,Mt=null,rt=!1,go=null,kr=!1,am=Error(s(519));function yo(r){var o=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sl(Nr(o,r)),am}function d0(r){var o=r.stateNode,c=r.type,u=r.memoizedProps;switch(o[Sn]=r,o[Un]=u,c){case"dialog":et("cancel",o),et("close",o);break;case"iframe":case"object":case"embed":et("load",o);break;case"video":case"audio":for(c=0;c<Hl.length;c++)et(Hl[c],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),Tx(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),Rx(o,u.value,u.defaultValue,u.children)}c=u.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||u.suppressHydrationWarning===!0||j_(o.textContent,c)?(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=Ts),o=!0):o=!1,o||yo(r,!0)}function h0(r){for(_n=r.return;_n;)switch(_n.tag){case 5:case 31:case 13:kr=!1;return;case 27:case 3:kr=!0;return;default:_n=_n.return}}function Ua(r){if(r!==_n)return!1;if(!rt)return h0(r),rt=!0,!1;var o=r.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||Tg(r.type,r.memoizedProps)),c=!c),c&&Mt&&yo(r),h0(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Mt=L_(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Mt=L_(r)}else o===27?(o=Mt,ko(r.type)?(r=Ag,Ag=null,Mt=r):Mt=o):Mt=_n?Mr(r.stateNode.nextSibling):null;return!0}function ki(){Mt=_n=null,rt=!1}function cm(){var r=go;return r!==null&&(qn===null?qn=r:qn.push.apply(qn,r),go=null),r}function Sl(r){go===null?go=[r]:go.push(r)}var lm=I(null),Oi=null,js=null;function vo(r,o,c){W(lm,o._currentValue),o._currentValue=c}function As(r){r._currentValue=lm.current,H(lm)}function um(r,o,c){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===c)break;r=r.return}}function fm(r,o,c,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 k=v;v=m;for(var $=0;$<o.length;$++)if(k.context===o[$]){v.lanes|=c,k=v.alternate,k!==null&&(k.lanes|=c),um(v.return,c,r),u||(E=null);break e}v=k.next}}else if(m.tag===18){if(E=m.return,E===null)throw Error(s(341));E.lanes|=c,v=E.alternate,v!==null&&(v.lanes|=c),um(E,c,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 $a(r,o,c,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 k=m.type;rr(m.pendingProps.value,E.value)||(r!==null?r.push(k):r=[k])}}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(Zl):r=[Zl])}m=m.return}r!==null&&fm(o,r,c,u),o.flags|=262144}function Tf(r){for(r=r.firstContext;r!==null;){if(!rr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Mi(r){Oi=r,js=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function wn(r){return p0(Oi,r)}function Cf(r,o){return Oi===null&&Mi(r),p0(r,o)}function p0(r,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},js===null){if(r===null)throw Error(s(308));js=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else js=js.next=o;return c}var hO=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(c,u){r.push(u)}};this.abort=function(){o.aborted=!0,r.forEach(function(c){return c()})}},pO=e.unstable_scheduleCallback,mO=e.unstable_NormalPriority,nn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function dm(){return{controller:new hO,data:new Map,refCount:0}}function _l(r){r.refCount--,r.refCount===0&&pO(mO,function(){r.controller.abort()})}var wl=null,hm=0,Ba=0,Fa=null;function gO(r,o){if(wl===null){var c=wl=[];hm=0,Ba=gg(),Fa={status:"pending",value:void 0,then:function(u){c.push(u)}}}return hm++,o.then(m0,m0),o}function m0(){if(--hm===0&&wl!==null){Fa!==null&&(Fa.status="fulfilled");var r=wl;wl=null,Ba=0,Fa=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function yO(r,o){var c=[],u={status:"pending",value:null,reason:null,then:function(m){c.push(m)}};return r.then(function(){u.status="fulfilled",u.value=o;for(var m=0;m<c.length;m++)(0,c[m])(o)},function(m){for(u.status="rejected",u.reason=m,m=0;m<c.length;m++)(0,c[m])(void 0)}),u}var g0=D.S;D.S=function(r,o){JS=Be(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&gO(r,o),g0!==null&&g0(r,o)};var Ii=I(null);function pm(){var r=Ii.current;return r!==null?r:Nt.pooledCache}function Rf(r,o){o===null?W(Ii,Ii.current):W(Ii,o.pool)}function y0(){var r=pm();return r===null?null:{parent:nn._currentValue,pool:r}}var Ha=Error(s(460)),mm=Error(s(474)),Nf=Error(s(542)),jf={then:function(){}};function v0(r){return r=r.status,r==="fulfilled"||r==="rejected"}function b0(r,o,c){switch(c=r[c],c===void 0?r.push(o):c!==o&&(o.then(Ts,Ts),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,S0(r),r;default:if(typeof o.status=="string")o.then(Ts,Ts);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,S0(r),r}throw Di=o,Ha}}function Pi(r){try{var o=r._init;return o(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Di=c,Ha):c}}var Di=null;function x0(){if(Di===null)throw Error(s(459));var r=Di;return Di=null,r}function S0(r){if(r===Ha||r===Nf)throw Error(s(483))}var qa=null,El=0;function Af(r){var o=El;return El+=1,qa===null&&(qa=[]),b0(qa,r,o)}function Tl(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function kf(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 _0(r){function o(G,F){if(r){var J=G.deletions;J===null?(G.deletions=[F],G.flags|=16):J.push(F)}}function c(G,F){if(!r)return null;for(;F!==null;)o(G,F),F=F.sibling;return null}function u(G){for(var F=new Map;G!==null;)G.key!==null?F.set(G.key,G):F.set(G.index,G),G=G.sibling;return F}function m(G,F){return G=Rs(G,F),G.index=0,G.sibling=null,G}function v(G,F,J){return G.index=J,r?(J=G.alternate,J!==null?(J=J.index,J<F?(G.flags|=67108866,F):J):(G.flags|=67108866,F)):(G.flags|=1048576,F)}function E(G){return r&&G.alternate===null&&(G.flags|=67108866),G}function k(G,F,J,le){return F===null||F.tag!==6?(F=rm(J,G.mode,le),F.return=G,F):(F=m(F,J),F.return=G,F)}function $(G,F,J,le){var ze=J.type;return ze===w?ce(G,F,J.props.children,le,J.key):F!==null&&(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Pi(ze)===F.type)?(F=m(F,J.props),Tl(F,J),F.return=G,F):(F=wf(J.type,J.key,J.props,null,G.mode,le),Tl(F,J),F.return=G,F)}function te(G,F,J,le){return F===null||F.tag!==4||F.stateNode.containerInfo!==J.containerInfo||F.stateNode.implementation!==J.implementation?(F=sm(J,G.mode,le),F.return=G,F):(F=m(F,J.children||[]),F.return=G,F)}function ce(G,F,J,le,ze){return F===null||F.tag!==7?(F=Ai(J,G.mode,le,ze),F.return=G,F):(F=m(F,J),F.return=G,F)}function fe(G,F,J){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=rm(""+F,G.mode,J),F.return=G,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case x:return J=wf(F.type,F.key,F.props,null,G.mode,J),Tl(J,F),J.return=G,J;case S:return F=sm(F,G.mode,J),F.return=G,F;case A:return F=Pi(F),fe(G,F,J)}if(ee(F)||z(F))return F=Ai(F,G.mode,J,null),F.return=G,F;if(typeof F.then=="function")return fe(G,Af(F),J);if(F.$$typeof===N)return fe(G,Cf(G,F),J);kf(G,F)}return null}function re(G,F,J,le){var ze=F!==null?F.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ze!==null?null:k(G,F,""+J,le);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===ze?$(G,F,J,le):null;case S:return J.key===ze?te(G,F,J,le):null;case A:return J=Pi(J),re(G,F,J,le)}if(ee(J)||z(J))return ze!==null?null:ce(G,F,J,le,null);if(typeof J.then=="function")return re(G,F,Af(J),le);if(J.$$typeof===N)return re(G,F,Cf(G,J),le);kf(G,J)}return null}function ie(G,F,J,le,ze){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return G=G.get(J)||null,k(F,G,""+le,ze);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case x:return G=G.get(le.key===null?J:le.key)||null,$(F,G,le,ze);case S:return G=G.get(le.key===null?J:le.key)||null,te(F,G,le,ze);case A:return le=Pi(le),ie(G,F,J,le,ze)}if(ee(le)||z(le))return G=G.get(J)||null,ce(F,G,le,ze,null);if(typeof le.then=="function")return ie(G,F,J,Af(le),ze);if(le.$$typeof===N)return ie(G,F,J,Cf(F,le),ze);kf(F,le)}return null}function Re(G,F,J,le){for(var ze=null,ft=null,ke=F,Ye=F=0,nt=null;ke!==null&&Ye<J.length;Ye++){ke.index>Ye?(nt=ke,ke=null):nt=ke.sibling;var dt=re(G,ke,J[Ye],le);if(dt===null){ke===null&&(ke=nt);break}r&&ke&&dt.alternate===null&&o(G,ke),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt,ke=nt}if(Ye===J.length)return c(G,ke),rt&&Ns(G,Ye),ze;if(ke===null){for(;Ye<J.length;Ye++)ke=fe(G,J[Ye],le),ke!==null&&(F=v(ke,F,Ye),ft===null?ze=ke:ft.sibling=ke,ft=ke);return rt&&Ns(G,Ye),ze}for(ke=u(ke);Ye<J.length;Ye++)nt=ie(ke,G,Ye,J[Ye],le),nt!==null&&(r&&nt.alternate!==null&&ke.delete(nt.key===null?Ye:nt.key),F=v(nt,F,Ye),ft===null?ze=nt:ft.sibling=nt,ft=nt);return r&&ke.forEach(function(Do){return o(G,Do)}),rt&&Ns(G,Ye),ze}function $e(G,F,J,le){if(J==null)throw Error(s(151));for(var ze=null,ft=null,ke=F,Ye=F=0,nt=null,dt=J.next();ke!==null&&!dt.done;Ye++,dt=J.next()){ke.index>Ye?(nt=ke,ke=null):nt=ke.sibling;var Do=re(G,ke,dt.value,le);if(Do===null){ke===null&&(ke=nt);break}r&&ke&&Do.alternate===null&&o(G,ke),F=v(Do,F,Ye),ft===null?ze=Do:ft.sibling=Do,ft=Do,ke=nt}if(dt.done)return c(G,ke),rt&&Ns(G,Ye),ze;if(ke===null){for(;!dt.done;Ye++,dt=J.next())dt=fe(G,dt.value,le),dt!==null&&(F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return rt&&Ns(G,Ye),ze}for(ke=u(ke);!dt.done;Ye++,dt=J.next())dt=ie(ke,G,Ye,dt.value,le),dt!==null&&(r&&dt.alternate!==null&&ke.delete(dt.key===null?Ye:dt.key),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return r&&ke.forEach(function(NM){return o(G,NM)}),rt&&Ns(G,Ye),ze}function Ct(G,F,J,le){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 ze=J.key;F!==null;){if(F.key===ze){if(ze=J.type,ze===w){if(F.tag===7){c(G,F.sibling),le=m(F,J.props.children),le.return=G,G=le;break e}}else if(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Pi(ze)===F.type){c(G,F.sibling),le=m(F,J.props),Tl(le,J),le.return=G,G=le;break e}c(G,F);break}else o(G,F);F=F.sibling}J.type===w?(le=Ai(J.props.children,G.mode,le,J.key),le.return=G,G=le):(le=wf(J.type,J.key,J.props,null,G.mode,le),Tl(le,J),le.return=G,G=le)}return E(G);case S:e:{for(ze=J.key;F!==null;){if(F.key===ze)if(F.tag===4&&F.stateNode.containerInfo===J.containerInfo&&F.stateNode.implementation===J.implementation){c(G,F.sibling),le=m(F,J.children||[]),le.return=G,G=le;break e}else{c(G,F);break}else o(G,F);F=F.sibling}le=sm(J,G.mode,le),le.return=G,G=le}return E(G);case A:return J=Pi(J),Ct(G,F,J,le)}if(ee(J))return Re(G,F,J,le);if(z(J)){if(ze=z(J),typeof ze!="function")throw Error(s(150));return J=ze.call(J),$e(G,F,J,le)}if(typeof J.then=="function")return Ct(G,F,Af(J),le);if(J.$$typeof===N)return Ct(G,F,Cf(G,J),le);kf(G,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,F!==null&&F.tag===6?(c(G,F.sibling),le=m(F,J),le.return=G,G=le):(c(G,F),le=rm(J,G.mode,le),le.return=G,G=le),E(G)):c(G,F)}return function(G,F,J,le){try{El=0;var ze=Ct(G,F,J,le);return qa=null,ze}catch(ke){if(ke===Ha||ke===Nf)throw ke;var ft=sr(29,ke,null,G.mode);return ft.lanes=le,ft.return=G,ft}}}var zi=_0(!0),w0=_0(!1),bo=!1;function gm(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ym(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 xo(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function So(r,o,c){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=_f(r),i0(r,null,c),o}return Sf(r,u,o,c),_f(r)}function Cl(r,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var u=o.lanes;u&=r.pendingLanes,c|=u,o.lanes=c,uo(r,c)}}function vm(r,o){var c=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,c===u)){var m=null,v=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};v===null?m=v=E:v=v.next=E,c=c.next}while(c!==null);v===null?m=v=o:v=v.next=o}else m=v=o;c={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=o:r.next=o,c.lastBaseUpdate=o}var bm=!1;function Rl(){if(bm){var r=Fa;if(r!==null)throw r}}function Nl(r,o,c,u){bm=!1;var m=r.updateQueue;bo=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,k=m.shared.pending;if(k!==null){m.shared.pending=null;var $=k,te=$.next;$.next=null,E===null?v=te:E.next=te,E=$;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,k=ce.lastBaseUpdate,k!==E&&(k===null?ce.firstBaseUpdate=te:k.next=te,ce.lastBaseUpdate=$))}if(v!==null){var fe=m.baseState;E=0,ce=te=$=null,k=v;do{var re=k.lane&-536870913,ie=re!==k.lane;if(ie?(tt&re)===re:(u&re)===re){re!==0&&re===Ba&&(bm=!0),ce!==null&&(ce=ce.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Re=r,$e=k;re=o;var Ct=c;switch($e.tag){case 1:if(Re=$e.payload,typeof Re=="function"){fe=Re.call(Ct,fe,re);break e}fe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=$e.payload,re=typeof Re=="function"?Re.call(Ct,fe,re):Re,re==null)break e;fe=y({},fe,re);break e;case 2:bo=!0}}re=k.callback,re!==null&&(r.flags|=64,ie&&(r.flags|=8192),ie=m.callbacks,ie===null?m.callbacks=[re]:ie.push(re))}else ie={lane:re,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ce===null?(te=ce=ie,$=fe):ce=ce.next=ie,E|=re;if(k=k.next,k===null){if(k=m.shared.pending,k===null)break;ie=k,k=ie.next,ie.next=null,m.lastBaseUpdate=ie,m.shared.pending=null}}while(!0);ce===null&&($=fe),m.baseState=$,m.firstBaseUpdate=te,m.lastBaseUpdate=ce,v===null&&(m.shared.lanes=0),Co|=E,r.lanes=E,r.memoizedState=fe}}function E0(r,o){if(typeof r!="function")throw Error(s(191,r));r.call(o)}function T0(r,o){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)E0(c[r],o)}var Va=I(null),Of=I(0);function C0(r,o){r=Us,W(Of,r),W(Va,o),Us=r|o.baseLanes}function xm(){W(Of,Us),W(Va,Va.current)}function Sm(){Us=Of.current,H(Va),H(Of)}var or=I(null),Or=null;function _o(r){var o=r.alternate;W(Jt,Jt.current&1),W(or,r),Or===null&&(o===null||Va.current!==null||o.memoizedState!==null)&&(Or=r)}function _m(r){W(Jt,Jt.current),W(or,r),Or===null&&(Or=r)}function R0(r){r.tag===22?(W(Jt,Jt.current),W(or,r),Or===null&&(Or=r)):wo()}function wo(){W(Jt,Jt.current),W(or,or.current)}function ir(r){H(or),Or===r&&(Or=null),H(Jt)}var Jt=I(0);function Mf(r){for(var o=r;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Ng(c)||jg(c)))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 ks=0,Ze=null,Et=null,rn=null,If=!1,Ka=!1,Li=!1,Pf=0,jl=0,Ga=null,vO=0;function Kt(){throw Error(s(321))}function wm(r,o){if(o===null)return!1;for(var c=0;c<o.length&&c<r.length;c++)if(!rr(r[c],o[c]))return!1;return!0}function Em(r,o,c,u,m,v){return ks=v,Ze=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,D.H=r===null||r.memoizedState===null?uS:Um,Li=!1,v=c(u,m),Li=!1,Ka&&(v=j0(o,c,u,m)),N0(r),v}function N0(r){D.H=Ol;var o=Et!==null&&Et.next!==null;if(ks=0,rn=Et=Ze=null,If=!1,jl=0,Ga=null,o)throw Error(s(300));r===null||sn||(r=r.dependencies,r!==null&&Tf(r)&&(sn=!0))}function j0(r,o,c,u){Ze=r;var m=0;do{if(Ka&&(Ga=null),jl=0,Ka=!1,25<=m)throw Error(s(301));if(m+=1,rn=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)}D.H=fS,v=o(c,u)}while(Ka);return v}function bO(){var r=D.H,o=r.useState()[0];return o=typeof o.then=="function"?Al(o):o,r=r.useState()[0],(Et!==null?Et.memoizedState:null)!==r&&(Ze.flags|=1024),o}function Tm(){var r=Pf!==0;return Pf=0,r}function Cm(r,o,c){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~c}function Rm(r){if(If){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}If=!1}ks=0,rn=Et=Ze=null,Ka=!1,jl=Pf=0,Ga=null}function kn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Ze.memoizedState=rn=r:rn=rn.next=r,rn}function en(){if(Et===null){var r=Ze.alternate;r=r!==null?r.memoizedState:null}else r=Et.next;var o=rn===null?Ze.memoizedState:rn.next;if(o!==null)rn=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},rn===null?Ze.memoizedState=rn=r:rn=rn.next=r}return rn}function Df(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Al(r){var o=jl;return jl+=1,Ga===null&&(Ga=[]),r=b0(Ga,r,o),o=Ze,(rn===null?o.memoizedState:rn.next)===null&&(o=o.alternate,D.H=o===null||o.memoizedState===null?uS:Um),r}function zf(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Al(r);if(r.$$typeof===N)return wn(r)}throw Error(s(438,String(r)))}function Nm(r){var o=null,c=Ze.updateQueue;if(c!==null&&(o=c.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}),c===null&&(c=Df(),Ze.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(r),u=0;u<r;u++)c[u]=Z;return o.index++,c}function Os(r,o){return typeof o=="function"?o(r):o}function Lf(r){var o=en();return jm(o,Et,r)}function jm(r,o,c){var u=r.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=c;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 k=E=null,$=null,te=o,ce=!1;do{var fe=te.lane&-536870913;if(fe!==te.lane?(tt&fe)===fe:(ks&fe)===fe){var re=te.revertLane;if(re===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),fe===Ba&&(ce=!0);else if((ks&re)===re){te=te.next,re===Ba&&(ce=!0);continue}else fe={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(k=$=fe,E=v):$=$.next=fe,Ze.lanes|=re,Co|=re;fe=te.action,Li&&c(v,fe),v=te.hasEagerState?te.eagerState:c(v,fe)}else re={lane:fe,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(k=$=re,E=v):$=$.next=re,Ze.lanes|=fe,Co|=fe;te=te.next}while(te!==null&&te!==o);if($===null?E=v:$.next=k,!rr(v,r.memoizedState)&&(sn=!0,ce&&(c=Fa,c!==null)))throw c;r.memoizedState=v,r.baseState=E,r.baseQueue=$,u.lastRenderedState=v}return m===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function Am(r){var o=en(),c=o.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var u=c.dispatch,m=c.pending,v=o.memoizedState;if(m!==null){c.pending=null;var E=m=m.next;do v=r(v,E.action),E=E.next;while(E!==m);rr(v,o.memoizedState)||(sn=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),c.lastRenderedState=v}return[v,u]}function A0(r,o,c){var u=Ze,m=en(),v=rt;if(v){if(c===void 0)throw Error(s(407));c=c()}else c=o();var E=!rr((Et||m).memoizedState,c);if(E&&(m.memoizedState=c,sn=!0),m=m.queue,Mm(M0.bind(null,u,m,r),[r]),m.getSnapshot!==o||E||rn!==null&&rn.memoizedState.tag&1){if(u.flags|=2048,Za(9,{destroy:void 0},O0.bind(null,u,m,c,o),null),Nt===null)throw Error(s(349));v||(ks&127)!==0||k0(u,o,c)}return c}function k0(r,o,c){r.flags|=16384,r={getSnapshot:o,value:c},o=Ze.updateQueue,o===null?(o=Df(),Ze.updateQueue=o,o.stores=[r]):(c=o.stores,c===null?o.stores=[r]:c.push(r))}function O0(r,o,c,u){o.value=c,o.getSnapshot=u,I0(o)&&P0(r)}function M0(r,o,c){return c(function(){I0(o)&&P0(r)})}function I0(r){var o=r.getSnapshot;r=r.value;try{var c=o();return!rr(r,c)}catch{return!0}}function P0(r){var o=ji(r,2);o!==null&&Vn(o,r,2)}function km(r){var o=kn();if(typeof r=="function"){var c=r;if(r=c(),Li){ut(!0);try{c()}finally{ut(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:r},o}function D0(r,o,c,u){return r.baseState=c,jm(r,Et,typeof u=="function"?u:Os)}function xO(r,o,c,u,m){if(Bf(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)}};D.T!==null?c(!0):v.isTransition=!1,u(v),c=o.pending,c===null?(v.next=o.pending=v,z0(o,v)):(v.next=c.next,o.pending=c.next=v)}}function z0(r,o){var c=o.action,u=o.payload,m=r.state;if(o.isTransition){var v=D.T,E={};D.T=E;try{var k=c(m,u),$=D.S;$!==null&&$(E,k),L0(r,o,k)}catch(te){Om(r,o,te)}finally{v!==null&&E.types!==null&&(v.types=E.types),D.T=v}}else try{v=c(m,u),L0(r,o,v)}catch(te){Om(r,o,te)}}function L0(r,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(u){U0(r,o,u)},function(u){return Om(r,o,u)}):U0(r,o,c)}function U0(r,o,c){o.status="fulfilled",o.value=c,$0(o),r.state=c,o=r.pending,o!==null&&(c=o.next,c===o?r.pending=null:(c=c.next,o.next=c,z0(r,c)))}function Om(r,o,c){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=c,$0(o),o=o.next;while(o!==u)}r.action=null}function $0(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function B0(r,o){return o}function F0(r,o){if(rt){var c=Nt.formState;if(c!==null){e:{var u=Ze;if(rt){if(Mt){t:{for(var m=Mt,v=kr;m.nodeType!==8;){if(!v){m=null;break t}if(m=Mr(m.nextSibling),m===null){m=null;break t}}v=m.data,m=v==="F!"||v==="F"?m:null}if(m){Mt=Mr(m.nextSibling),u=m.data==="F!";break e}}yo(u)}u=!1}u&&(o=c[0])}}return c=kn(),c.memoizedState=c.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:B0,lastRenderedState:o},c.queue=u,c=aS.bind(null,Ze,u),u.dispatch=c,u=km(!1),v=Lm.bind(null,Ze,!1,u.queue),u=kn(),m={state:o,dispatch:null,action:r,pending:null},u.queue=m,c=xO.bind(null,Ze,m,v,c),m.dispatch=c,u.memoizedState=r,[o,c,!1]}function H0(r){var o=en();return q0(o,Et,r)}function q0(r,o,c){if(o=jm(r,o,B0)[0],r=Lf(Os)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Al(o)}catch(E){throw E===Ha?Nf:E}else u=o;o=en();var m=o.queue,v=m.dispatch;return c!==o.memoizedState&&(Ze.flags|=2048,Za(9,{destroy:void 0},SO.bind(null,m,c),null)),[u,v,r]}function SO(r,o){r.action=o}function V0(r){var o=en(),c=Et;if(c!==null)return q0(o,c,r);en(),o=o.memoizedState,c=en();var u=c.queue.dispatch;return c.memoizedState=r,[o,u,!1]}function Za(r,o,c,u){return r={tag:r,create:c,deps:u,inst:o,next:null},o=Ze.updateQueue,o===null&&(o=Df(),Ze.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=r.next=r:(u=c.next,c.next=r,r.next=u,o.lastEffect=r),r}function K0(){return en().memoizedState}function Uf(r,o,c,u){var m=kn();Ze.flags|=r,m.memoizedState=Za(1|o,{destroy:void 0},c,u===void 0?null:u)}function $f(r,o,c,u){var m=en();u=u===void 0?null:u;var v=m.memoizedState.inst;Et!==null&&u!==null&&wm(u,Et.memoizedState.deps)?m.memoizedState=Za(o,v,c,u):(Ze.flags|=r,m.memoizedState=Za(1|o,v,c,u))}function G0(r,o){Uf(8390656,8,r,o)}function Mm(r,o){$f(2048,8,r,o)}function _O(r){Ze.flags|=4;var o=Ze.updateQueue;if(o===null)o=Df(),Ze.updateQueue=o,o.events=[r];else{var c=o.events;c===null?o.events=[r]:c.push(r)}}function Z0(r){var o=en().memoizedState;return _O({ref:o,nextImpl:r}),function(){if((gt&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}function Y0(r,o){return $f(4,2,r,o)}function X0(r,o){return $f(4,4,r,o)}function Q0(r,o){if(typeof o=="function"){r=r();var c=o(r);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function W0(r,o,c){c=c!=null?c.concat([r]):null,$f(4,4,Q0.bind(null,o,r),c)}function Im(){}function J0(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;return o!==null&&wm(o,u[1])?u[0]:(c.memoizedState=[r,o],r)}function eS(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;if(o!==null&&wm(o,u[1]))return u[0];if(u=r(),Li){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u}function Pm(r,o,c){return c===void 0||(ks&1073741824)!==0&&(tt&261930)===0?r.memoizedState=o:(r.memoizedState=c,r=t_(),Ze.lanes|=r,Co|=r,c)}function tS(r,o,c,u){return rr(c,o)?c:Va.current!==null?(r=Pm(r,c,u),rr(r,o)||(sn=!0),r):(ks&42)===0||(ks&1073741824)!==0&&(tt&261930)===0?(sn=!0,r.memoizedState=c):(r=t_(),Ze.lanes|=r,Co|=r,o)}function nS(r,o,c,u,m){var v=V.p;V.p=v!==0&&8>v?v:8;var E=D.T,k={};D.T=k,Lm(r,!1,o,c);try{var $=m(),te=D.S;if(te!==null&&te(k,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ce=yO($,u);kl(r,o,ce,lr(r))}else kl(r,o,u,lr(r))}catch(fe){kl(r,o,{then:function(){},status:"rejected",reason:fe},lr())}finally{V.p=v,E!==null&&k.types!==null&&(E.types=k.types),D.T=E}}function wO(){}function Dm(r,o,c,u){if(r.tag!==5)throw Error(s(476));var m=rS(r).queue;nS(r,m,o,q,c===null?wO:function(){return sS(r),c(u)})}function rS(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:q},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:c},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function sS(r){var o=rS(r);o.next===null&&(o=r.alternate.memoizedState),kl(r,o.next.queue,{},lr())}function zm(){return wn(Zl)}function oS(){return en().memoizedState}function iS(){return en().memoizedState}function EO(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var c=lr();r=xo(c);var u=So(o,r,c);u!==null&&(Vn(u,o,c),Cl(u,o,c)),o={cache:dm()},r.payload=o;return}o=o.return}}function TO(r,o,c){var u=lr();c={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Bf(r)?cS(o,c):(c=tm(r,o,c,u),c!==null&&(Vn(c,r,u),lS(c,o,u)))}function aS(r,o,c){var u=lr();kl(r,o,c,u)}function kl(r,o,c,u){var m={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Bf(r))cS(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,k=v(E,c);if(m.hasEagerState=!0,m.eagerState=k,rr(k,E))return Sf(r,o,m,0),Nt===null&&xf(),!1}catch{}if(c=tm(r,o,m,u),c!==null)return Vn(c,r,u),lS(c,o,u),!0}return!1}function Lm(r,o,c,u){if(u={lane:2,revertLane:gg(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Bf(r)){if(o)throw Error(s(479))}else o=tm(r,c,u,2),o!==null&&Vn(o,r,2)}function Bf(r){var o=r.alternate;return r===Ze||o!==null&&o===Ze}function cS(r,o){Ka=If=!0;var c=r.pending;c===null?o.next=o:(o.next=c.next,c.next=o),r.pending=o}function lS(r,o,c){if((c&4194048)!==0){var u=o.lanes;u&=r.pendingLanes,c|=u,o.lanes=c,uo(r,c)}}var Ol={readContext:wn,use:zf,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};Ol.useEffectEvent=Kt;var uS={readContext:wn,use:zf,useCallback:function(r,o){return kn().memoizedState=[r,o===void 0?null:o],r},useContext:wn,useEffect:G0,useImperativeHandle:function(r,o,c){c=c!=null?c.concat([r]):null,Uf(4194308,4,Q0.bind(null,o,r),c)},useLayoutEffect:function(r,o){return Uf(4194308,4,r,o)},useInsertionEffect:function(r,o){Uf(4,2,r,o)},useMemo:function(r,o){var c=kn();o=o===void 0?null:o;var u=r();if(Li){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u},useReducer:function(r,o,c){var u=kn();if(c!==void 0){var m=c(o);if(Li){ut(!0);try{c(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=TO.bind(null,Ze,r),[u.memoizedState,r]},useRef:function(r){var o=kn();return r={current:r},o.memoizedState=r},useState:function(r){r=km(r);var o=r.queue,c=aS.bind(null,Ze,o);return o.dispatch=c,[r.memoizedState,c]},useDebugValue:Im,useDeferredValue:function(r,o){var c=kn();return Pm(c,r,o)},useTransition:function(){var r=km(!1);return r=nS.bind(null,Ze,r.queue,!0,!1),kn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,c){var u=Ze,m=kn();if(rt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=o(),Nt===null)throw Error(s(349));(tt&127)!==0||k0(u,o,c)}m.memoizedState=c;var v={value:c,getSnapshot:o};return m.queue=v,G0(M0.bind(null,u,v,r),[r]),u.flags|=2048,Za(9,{destroy:void 0},O0.bind(null,u,v,c,o),null),c},useId:function(){var r=kn(),o=Nt.identifierPrefix;if(rt){var c=fs,u=us;c=(u&~(1<<32-xt(u)-1)).toString(32)+c,o="_"+o+"R_"+c,c=Pf++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=vO++,o="_"+o+"r_"+c.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:zm,useFormState:F0,useActionState:F0,useOptimistic:function(r){var o=kn();o.memoizedState=o.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Lm.bind(null,Ze,!0,c),c.dispatch=o,[r,o]},useMemoCache:Nm,useCacheRefresh:function(){return kn().memoizedState=EO.bind(null,Ze)},useEffectEvent:function(r){var o=kn(),c={impl:r};return o.memoizedState=c,function(){if((gt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},Um={readContext:wn,use:zf,useCallback:J0,useContext:wn,useEffect:Mm,useImperativeHandle:W0,useInsertionEffect:Y0,useLayoutEffect:X0,useMemo:eS,useReducer:Lf,useRef:K0,useState:function(){return Lf(Os)},useDebugValue:Im,useDeferredValue:function(r,o){var c=en();return tS(c,Et.memoizedState,r,o)},useTransition:function(){var r=Lf(Os)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Al(r),o]},useSyncExternalStore:A0,useId:oS,useHostTransitionStatus:zm,useFormState:H0,useActionState:H0,useOptimistic:function(r,o){var c=en();return D0(c,Et,r,o)},useMemoCache:Nm,useCacheRefresh:iS};Um.useEffectEvent=Z0;var fS={readContext:wn,use:zf,useCallback:J0,useContext:wn,useEffect:Mm,useImperativeHandle:W0,useInsertionEffect:Y0,useLayoutEffect:X0,useMemo:eS,useReducer:Am,useRef:K0,useState:function(){return Am(Os)},useDebugValue:Im,useDeferredValue:function(r,o){var c=en();return Et===null?Pm(c,r,o):tS(c,Et.memoizedState,r,o)},useTransition:function(){var r=Am(Os)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Al(r),o]},useSyncExternalStore:A0,useId:oS,useHostTransitionStatus:zm,useFormState:V0,useActionState:V0,useOptimistic:function(r,o){var c=en();return Et!==null?D0(c,Et,r,o):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:Nm,useCacheRefresh:iS};fS.useEffectEvent=Z0;function $m(r,o,c,u){o=r.memoizedState,c=c(u,o),c=c==null?o:y({},o,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Bm={enqueueSetState:function(r,o,c){r=r._reactInternals;var u=lr(),m=xo(u);m.payload=o,c!=null&&(m.callback=c),o=So(r,m,u),o!==null&&(Vn(o,r,u),Cl(o,r,u))},enqueueReplaceState:function(r,o,c){r=r._reactInternals;var u=lr(),m=xo(u);m.tag=1,m.payload=o,c!=null&&(m.callback=c),o=So(r,m,u),o!==null&&(Vn(o,r,u),Cl(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var c=lr(),u=xo(c);u.tag=2,o!=null&&(u.callback=o),o=So(r,u,c),o!==null&&(Vn(o,r,c),Cl(o,r,c))}};function dS(r,o,c,u,m,v,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,v,E):o.prototype&&o.prototype.isPureReactComponent?!vl(c,u)||!vl(m,v):!0}function hS(r,o,c,u){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,u),o.state!==r&&Bm.enqueueReplaceState(o,o.state,null)}function Ui(r,o){var c=o;if("ref"in o){c={};for(var u in o)u!=="ref"&&(c[u]=o[u])}if(r=r.defaultProps){c===o&&(c=y({},c));for(var m in r)c[m]===void 0&&(c[m]=r[m])}return c}function pS(r){bf(r)}function mS(r){console.error(r)}function gS(r){bf(r)}function Ff(r,o){try{var c=r.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function yS(r,o,c){try{var u=r.onCaughtError;u(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Fm(r,o,c){return c=xo(c),c.tag=3,c.payload={element:null},c.callback=function(){Ff(r,o)},c}function vS(r){return r=xo(r),r.tag=3,r}function bS(r,o,c,u){var m=c.type.getDerivedStateFromError;if(typeof m=="function"){var v=u.value;r.payload=function(){return m(v)},r.callback=function(){yS(o,c,u)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(r.callback=function(){yS(o,c,u),typeof m!="function"&&(Ro===null?Ro=new Set([this]):Ro.add(this));var k=u.stack;this.componentDidCatch(u.value,{componentStack:k!==null?k:""})})}function CO(r,o,c,u,m){if(c.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=c.alternate,o!==null&&$a(o,c,m,!0),c=or.current,c!==null){switch(c.tag){case 31:case 13:return Or===null?ed():c.alternate===null&&Gt===0&&(Gt=3),c.flags&=-257,c.flags|=65536,c.lanes=m,u===jf?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([u]):o.add(u),hg(r,u,m)),!1;case 22:return c.flags|=65536,u===jf?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([u])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([u]):c.add(u)),hg(r,u,m)),!1}throw Error(s(435,c.tag))}return hg(r,u,m),ed(),!1}if(rt)return o=or.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=m,u!==am&&(r=Error(s(422),{cause:u}),Sl(Nr(r,c)))):(u!==am&&(o=Error(s(423),{cause:u}),Sl(Nr(o,c))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,u=Nr(u,c),m=Fm(r.stateNode,u,m),vm(r,m),Gt!==4&&(Gt=2)),!1;var v=Error(s(520),{cause:u});if(v=Nr(v,c),$l===null?$l=[v]:$l.push(v),Gt!==4&&(Gt=2),o===null)return!0;u=Nr(u,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,r=m&-m,c.lanes|=r,r=Fm(c.stateNode,u,r),vm(c,r),!1;case 1:if(o=c.type,v=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ro===null||!Ro.has(v))))return c.flags|=65536,m&=-m,c.lanes|=m,m=vS(m),bS(m,r,c,u),vm(c,m),!1}c=c.return}while(c!==null);return!1}var Hm=Error(s(461)),sn=!1;function En(r,o,c,u){o.child=r===null?w0(o,null,c,u):zi(o,r.child,c,u)}function xS(r,o,c,u,m){c=c.render;var v=o.ref;if("ref"in u){var E={};for(var k in u)k!=="ref"&&(E[k]=u[k])}else E=u;return Mi(o),u=Em(r,o,c,E,v,m),k=Tm(),r!==null&&!sn?(Cm(r,o,m),Ms(r,o,m)):(rt&&k&&om(o),o.flags|=1,En(r,o,u,m),o.child)}function SS(r,o,c,u,m){if(r===null){var v=c.type;return typeof v=="function"&&!nm(v)&&v.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=v,_S(r,o,v,u,m)):(r=wf(c.type,null,u,o,o.mode,m),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,!Qm(r,m)){var E=v.memoizedProps;if(c=c.compare,c=c!==null?c:vl,c(E,u)&&r.ref===o.ref)return Ms(r,o,m)}return o.flags|=1,r=Rs(v,u),r.ref=o.ref,r.return=o,o.child=r}function _S(r,o,c,u,m){if(r!==null){var v=r.memoizedProps;if(vl(v,u)&&r.ref===o.ref)if(sn=!1,o.pendingProps=u=v,Qm(r,m))(r.flags&131072)!==0&&(sn=!0);else return o.lanes=r.lanes,Ms(r,o,m)}return qm(r,o,c,u,m)}function wS(r,o,c,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|c:c,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 ES(r,o,v,c,u)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&Rf(o,v!==null?v.cachePool:null),v!==null?C0(o,v):xm(),R0(o);else return u=o.lanes=536870912,ES(r,o,v!==null?v.baseLanes|c:c,c,u)}else v!==null?(Rf(o,v.cachePool),C0(o,v),wo(),o.memoizedState=null):(r!==null&&Rf(o,null),xm(),wo());return En(r,o,m,c),o.child}function Ml(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function ES(r,o,c,u,m){var v=pm();return v=v===null?null:{parent:nn._currentValue,pool:v},o.memoizedState={baseLanes:c,cachePool:v},r!==null&&Rf(o,null),xm(),R0(o),r!==null&&$a(r,o,u,!0),o.childLanes=m,null}function Hf(r,o){return o=Vf({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function TS(r,o,c){return zi(o,r.child,null,c),r=Hf(o,o.pendingProps),r.flags|=2,ir(o),o.memoizedState=null,r}function RO(r,o,c){var u=o.pendingProps,m=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(rt){if(u.mode==="hidden")return r=Hf(o,u),o.lanes=536870912,Ml(null,r);if(_m(o),(r=Mt)?(r=z_(r,kr),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:mo!==null?{id:us,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=c0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw yo(o);return o.lanes=536870912,null}return Hf(o,u)}var v=r.memoizedState;if(v!==null){var E=v.dehydrated;if(_m(o),m)if(o.flags&256)o.flags&=-257,o=TS(r,o,c);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(s(558));else if(sn||$a(r,o,c,!1),m=(c&r.childLanes)!==0,sn||m){if(u=Nt,u!==null&&(E=fo(u,c),E!==0&&E!==v.retryLane))throw v.retryLane=E,ji(r,E),Vn(u,r,E),Hm;ed(),o=TS(r,o,c)}else r=v.treeContext,Mt=Mr(E.nextSibling),_n=o,rt=!0,go=null,kr=!1,r!==null&&f0(o,r),o=Hf(o,u),o.flags|=4096;return o}return r=Rs(r.child,{mode:u.mode,children:u.children}),r.ref=o.ref,o.child=r,r.return=o,r}function qf(r,o){var c=o.ref;if(c===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(r===null||r.ref!==c)&&(o.flags|=4194816)}}function qm(r,o,c,u,m){return Mi(o),c=Em(r,o,c,u,void 0,m),u=Tm(),r!==null&&!sn?(Cm(r,o,m),Ms(r,o,m)):(rt&&u&&om(o),o.flags|=1,En(r,o,c,m),o.child)}function CS(r,o,c,u,m,v){return Mi(o),o.updateQueue=null,c=j0(o,u,c,m),N0(r),u=Tm(),r!==null&&!sn?(Cm(r,o,v),Ms(r,o,v)):(rt&&u&&om(o),o.flags|=1,En(r,o,c,v),o.child)}function RS(r,o,c,u,m){if(Mi(o),o.stateNode===null){var v=Da,E=c.contextType;typeof E=="object"&&E!==null&&(v=wn(E)),v=new c(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Bm,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},gm(o),E=c.contextType,v.context=typeof E=="object"&&E!==null?wn(E):Da,v.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&($m(o,c,E,u),v.state=o.memoizedState),typeof c.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&&Bm.enqueueReplaceState(v,v.state,null),Nl(o,u,v,m),Rl(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(r===null){v=o.stateNode;var k=o.memoizedProps,$=Ui(c,k);v.props=$;var te=v.context,ce=c.contextType;E=Da,typeof ce=="object"&&ce!==null&&(E=wn(ce));var fe=c.getDerivedStateFromProps;ce=typeof fe=="function"||typeof v.getSnapshotBeforeUpdate=="function",k=o.pendingProps!==k,ce||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(k||te!==E)&&hS(o,v,u,E),bo=!1;var re=o.memoizedState;v.state=re,Nl(o,u,v,m),Rl(),te=o.memoizedState,k||re!==te||bo?(typeof fe=="function"&&($m(o,c,fe,u),te=o.memoizedState),($=bo||dS(o,c,$,u,re,te,E))?(ce||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=te),v.props=u,v.state=te,v.context=E,u=$):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,ym(r,o),E=o.memoizedProps,ce=Ui(c,E),v.props=ce,fe=o.pendingProps,re=v.context,te=c.contextType,$=Da,typeof te=="object"&&te!==null&&($=wn(te)),k=c.getDerivedStateFromProps,(te=typeof k=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(E!==fe||re!==$)&&hS(o,v,u,$),bo=!1,re=o.memoizedState,v.state=re,Nl(o,u,v,m),Rl();var ie=o.memoizedState;E!==fe||re!==ie||bo||r!==null&&r.dependencies!==null&&Tf(r.dependencies)?(typeof k=="function"&&($m(o,c,k,u),ie=o.memoizedState),(ce=bo||dS(o,c,ce,u,re,ie,$)||r!==null&&r.dependencies!==null&&Tf(r.dependencies))?(te||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&&re===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=ie),v.props=u,v.state=ie,v.context=$,u=ce):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,qf(r,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,c=u&&typeof c.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,r!==null&&u?(o.child=zi(o,r.child,null,m),o.child=zi(o,null,c,m)):En(r,o,c,m),o.memoizedState=v.state,r=o.child):r=Ms(r,o,m),r}function NS(r,o,c,u){return ki(),o.flags|=256,En(r,o,c,u),o.child}var Vm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Km(r){return{baseLanes:r,cachePool:y0()}}function Gm(r,o,c){return r=r!==null?r.childLanes&~c:0,o&&(r|=cr),r}function jS(r,o,c){var u=o.pendingProps,m=!1,v=(o.flags&128)!==0,E;if((E=v)||(E=r!==null&&r.memoizedState===null?!1:(Jt.current&2)!==0),E&&(m=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,r===null){if(rt){if(m?_o(o):wo(),(r=Mt)?(r=z_(r,kr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:mo!==null?{id:us,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=c0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw yo(o);return jg(r)?o.lanes=32:o.lanes=536870912,null}var k=u.children;return u=u.fallback,m?(wo(),m=o.mode,k=Vf({mode:"hidden",children:k},m),u=Ai(u,m,c,null),k.return=o,u.return=o,k.sibling=u,o.child=k,u=o.child,u.memoizedState=Km(c),u.childLanes=Gm(r,E,c),o.memoizedState=Vm,Ml(null,u)):(_o(o),Zm(o,k))}var $=r.memoizedState;if($!==null&&(k=$.dehydrated,k!==null)){if(v)o.flags&256?(_o(o),o.flags&=-257,o=Ym(r,o,c)):o.memoizedState!==null?(wo(),o.child=r.child,o.flags|=128,o=null):(wo(),k=u.fallback,m=o.mode,u=Vf({mode:"visible",children:u.children},m),k=Ai(k,m,c,null),k.flags|=2,u.return=o,k.return=o,u.sibling=k,o.child=u,zi(o,r.child,null,c),u=o.child,u.memoizedState=Km(c),u.childLanes=Gm(r,E,c),o.memoizedState=Vm,o=Ml(null,u));else if(_o(o),jg(k)){if(E=k.nextSibling&&k.nextSibling.dataset,E)var te=E.dgst;E=te,u=Error(s(419)),u.stack="",u.digest=E,Sl({value:u,source:null,stack:null}),o=Ym(r,o,c)}else if(sn||$a(r,o,c,!1),E=(c&r.childLanes)!==0,sn||E){if(E=Nt,E!==null&&(u=fo(E,c),u!==0&&u!==$.retryLane))throw $.retryLane=u,ji(r,u),Vn(E,r,u),Hm;Ng(k)||ed(),o=Ym(r,o,c)}else Ng(k)?(o.flags|=192,o.child=r.child,o=null):(r=$.treeContext,Mt=Mr(k.nextSibling),_n=o,rt=!0,go=null,kr=!1,r!==null&&f0(o,r),o=Zm(o,u.children),o.flags|=4096);return o}return m?(wo(),k=u.fallback,m=o.mode,$=r.child,te=$.sibling,u=Rs($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,te!==null?k=Rs(te,k):(k=Ai(k,m,c,null),k.flags|=2),k.return=o,u.return=o,u.sibling=k,o.child=u,Ml(null,u),u=o.child,k=r.child.memoizedState,k===null?k=Km(c):(m=k.cachePool,m!==null?($=nn._currentValue,m=m.parent!==$?{parent:$,pool:$}:m):m=y0(),k={baseLanes:k.baseLanes|c,cachePool:m}),u.memoizedState=k,u.childLanes=Gm(r,E,c),o.memoizedState=Vm,Ml(r.child,u)):(_o(o),c=r.child,r=c.sibling,c=Rs(c,{mode:"visible",children:u.children}),c.return=o,c.sibling=null,r!==null&&(E=o.deletions,E===null?(o.deletions=[r],o.flags|=16):E.push(r)),o.child=c,o.memoizedState=null,c)}function Zm(r,o){return o=Vf({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function Vf(r,o){return r=sr(22,r,null,o),r.lanes=0,r}function Ym(r,o,c){return zi(o,r.child,null,c),r=Zm(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function AS(r,o,c){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),um(r.return,o,c)}function Xm(r,o,c,u,m,v){var E=r.memoizedState;E===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:c,tailMode:m,treeForkCount:v}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=u,E.tail=c,E.tailMode=m,E.treeForkCount=v)}function kS(r,o,c){var u=o.pendingProps,m=u.revealOrder,v=u.tail;u=u.children;var E=Jt.current,k=(E&2)!==0;if(k?(E=E&1|2,o.flags|=128):E&=1,W(Jt,E),En(r,o,u,c),u=rt?xl:0,!k&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&AS(r,c,o);else if(r.tag===19)AS(r,c,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(c=o.child,m=null;c!==null;)r=c.alternate,r!==null&&Mf(r)===null&&(m=c),c=c.sibling;c=m,c===null?(m=o.child,o.child=null):(m=c.sibling,c.sibling=null),Xm(o,!1,m,c,v,u);break;case"backwards":case"unstable_legacy-backwards":for(c=null,m=o.child,o.child=null;m!==null;){if(r=m.alternate,r!==null&&Mf(r)===null){o.child=m;break}r=m.sibling,m.sibling=c,c=m,m=r}Xm(o,!0,c,null,v,u);break;case"together":Xm(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function Ms(r,o,c){if(r!==null&&(o.dependencies=r.dependencies),Co|=o.lanes,(c&o.childLanes)===0)if(r!==null){if($a(r,o,c,!1),(c&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,c=Rs(r,r.pendingProps),o.child=c,c.return=o;r.sibling!==null;)r=r.sibling,c=c.sibling=Rs(r,r.pendingProps),c.return=o;c.sibling=null}return o.child}function Qm(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Tf(r)))}function NO(r,o,c){switch(o.tag){case 3:xe(o,o.stateNode.containerInfo),vo(o,nn,r.memoizedState.cache),ki();break;case 27:case 5:Me(o);break;case 4:xe(o,o.stateNode.containerInfo);break;case 10:vo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,_m(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(_o(o),o.flags|=128,null):(c&o.child.childLanes)!==0?jS(r,o,c):(_o(o),r=Ms(r,o,c),r!==null?r.sibling:null);_o(o);break;case 19:var m=(r.flags&128)!==0;if(u=(c&o.childLanes)!==0,u||($a(r,o,c,!1),u=(c&o.childLanes)!==0),m){if(u)return kS(r,o,c);o.flags|=128}if(m=o.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),W(Jt,Jt.current),u)break;return null;case 22:return o.lanes=0,wS(r,o,c,o.pendingProps);case 24:vo(o,nn,r.memoizedState.cache)}return Ms(r,o,c)}function OS(r,o,c){if(r!==null)if(r.memoizedProps!==o.pendingProps)sn=!0;else{if(!Qm(r,c)&&(o.flags&128)===0)return sn=!1,NO(r,o,c);sn=(r.flags&131072)!==0}else sn=!1,rt&&(o.flags&1048576)!==0&&u0(o,xl,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(r=Pi(o.elementType),o.type=r,typeof r=="function")nm(r)?(u=Ui(r,u),o.tag=1,o=RS(null,o,r,u,c)):(o.tag=0,o=qm(null,o,r,u,c));else{if(r!=null){var m=r.$$typeof;if(m===R){o.tag=11,o=xS(null,o,r,u,c);break e}else if(m===j){o.tag=14,o=SS(null,o,r,u,c);break e}}throw o=Y(r)||r,Error(s(306,o,""))}}return o;case 0:return qm(r,o,o.type,o.pendingProps,c);case 1:return u=o.type,m=Ui(u,o.pendingProps),RS(r,o,u,m,c);case 3:e:{if(xe(o,o.stateNode.containerInfo),r===null)throw Error(s(387));u=o.pendingProps;var v=o.memoizedState;m=v.element,ym(r,o),Nl(o,u,null,c);var E=o.memoizedState;if(u=E.cache,vo(o,nn,u),u!==v.cache&&fm(o,[nn],c,!0),Rl(),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=NS(r,o,u,c);break e}else if(u!==m){m=Nr(Error(s(424)),o),Sl(m),o=NS(r,o,u,c);break e}else for(r=o.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Mt=Mr(r.firstChild),_n=o,rt=!0,go=null,kr=!0,c=w0(o,null,u,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(ki(),u===m){o=Ms(r,o,c);break e}En(r,o,u,c)}o=o.child}return o;case 26:return qf(r,o),r===null?(c=H_(o.type,null,o.pendingProps,null))?o.memoizedState=c:rt||(c=o.type,r=o.pendingProps,u=ad(se.current).createElement(c),u[Sn]=o,u[Un]=r,Tn(u,c,r),bn(u),o.stateNode=u):o.memoizedState=H_(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return Me(o),r===null&&rt&&(u=o.stateNode=$_(o.type,o.pendingProps,se.current),_n=o,kr=!0,m=Mt,ko(o.type)?(Ag=m,Mt=Mr(u.firstChild)):Mt=m),En(r,o,o.pendingProps.children,c),qf(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&rt&&((m=u=Mt)&&(u=sM(u,o.type,o.pendingProps,kr),u!==null?(o.stateNode=u,_n=o,Mt=Mr(u.firstChild),kr=!1,m=!0):m=!1),m||yo(o)),Me(o),m=o.type,v=o.pendingProps,E=r!==null?r.memoizedProps:null,u=v.children,Tg(m,v)?u=null:E!==null&&Tg(m,E)&&(o.flags|=32),o.memoizedState!==null&&(m=Em(r,o,bO,null,null,c),Zl._currentValue=m),qf(r,o),En(r,o,u,c),o.child;case 6:return r===null&&rt&&((r=c=Mt)&&(c=oM(c,o.pendingProps,kr),c!==null?(o.stateNode=c,_n=o,Mt=null,r=!0):r=!1),r||yo(o)),null;case 13:return jS(r,o,c);case 4:return xe(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=zi(o,null,u,c):En(r,o,u,c),o.child;case 11:return xS(r,o,o.type,o.pendingProps,c);case 7:return En(r,o,o.pendingProps,c),o.child;case 8:return En(r,o,o.pendingProps.children,c),o.child;case 12:return En(r,o,o.pendingProps.children,c),o.child;case 10:return u=o.pendingProps,vo(o,o.type,u.value),En(r,o,u.children,c),o.child;case 9:return m=o.type._context,u=o.pendingProps.children,Mi(o),m=wn(m),u=u(m),o.flags|=1,En(r,o,u,c),o.child;case 14:return SS(r,o,o.type,o.pendingProps,c);case 15:return _S(r,o,o.type,o.pendingProps,c);case 19:return kS(r,o,c);case 31:return RO(r,o,c);case 22:return wS(r,o,c,o.pendingProps);case 24:return Mi(o),u=wn(nn),r===null?(m=pm(),m===null&&(m=Nt,v=dm(),m.pooledCache=v,v.refCount++,v!==null&&(m.pooledCacheLanes|=c),m=v),o.memoizedState={parent:u,cache:m},gm(o),vo(o,nn,m)):((r.lanes&c)!==0&&(ym(r,o),Nl(o,null,null,c),Rl()),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),vo(o,nn,u)):(u=v.cache,vo(o,nn,u),u!==m.cache&&fm(o,[nn],c,!0))),En(r,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(s(156,o.tag))}function Is(r){r.flags|=4}function Wm(r,o,c,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(o_())r.flags|=8192;else throw Di=jf,mm}else r.flags&=-16777217}function MS(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Z_(o))if(o_())r.flags|=8192;else throw Di=jf,mm}function Kf(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?wi():536870912,r.lanes|=o,Wa|=o)}function Il(r,o){if(!rt)switch(r.tailMode){case"hidden":o=r.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var u=null;c!==null;)c.alternate!==null&&(u=c),c=c.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,c=0,u=0;if(o)for(var m=r.child;m!==null;)c|=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;)c|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=u,r.childLanes=c,o}function jO(r,o,c){var u=o.pendingProps;switch(im(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 c=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),As(nn),de(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Ua(o)?Is(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,cm())),It(o),null;case 26:var m=o.type,v=o.memoizedState;return r===null?(Is(o),v!==null?(It(o),MS(o,v)):(It(o),Wm(o,m,null,u,c))):v?v!==r.memoizedState?(Is(o),It(o),MS(o,v)):(It(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&Is(o),It(o),Wm(o,m,r,u,c)),null;case 27:if(_e(o),c=se.current,m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}r=X.current,Ua(o)?d0(o):(r=$_(m,u,c),o.stateNode=r,Is(o))}return It(o),null;case 5:if(_e(o),m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}if(v=X.current,Ua(o))d0(o);else{var E=ad(se.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[Sn]=o,v[Un]=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(Tn(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&&Is(o)}}return It(o),Wm(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,c),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(s(166));if(r=se.current,Ua(o)){if(r=o.stateNode,c=o.memoizedProps,u=null,m=_n,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}r[Sn]=o,r=!!(r.nodeValue===c||u!==null&&u.suppressHydrationWarning===!0||j_(r.nodeValue,c)),r||yo(o,!0)}else r=ad(r).createTextNode(u),r[Sn]=o,o.stateNode=r}return It(o),null;case 31:if(c=o.memoizedState,r===null||r.memoizedState!==null){if(u=Ua(o),c!==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[Sn]=o}else ki(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),r=!1}else c=cm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return o.flags&256?(ir(o),o):(ir(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=Ua(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[Sn]=o}else ki(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),m=!1}else m=cm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return o.flags&256?(ir(o),o):(ir(o),null)}return ir(o),(o.flags&128)!==0?(o.lanes=c,o):(c=u!==null,r=r!==null&&r.memoizedState!==null,c&&(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)),c!==r&&c&&(o.child.flags|=8192),Kf(o,o.updateQueue),It(o),null);case 4:return de(),r===null&&xg(o.stateNode.containerInfo),It(o),null;case 10:return As(o.type),It(o),null;case 19:if(H(Jt),u=o.memoizedState,u===null)return It(o),null;if(m=(o.flags&128)!==0,v=u.rendering,v===null)if(m)Il(u,!1);else{if(Gt!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=Mf(r),v!==null){for(o.flags|=128,Il(u,!1),r=v.updateQueue,o.updateQueue=r,Kf(o,r),o.subtreeFlags=0,r=c,c=o.child;c!==null;)a0(c,r),c=c.sibling;return W(Jt,Jt.current&1|2),rt&&Ns(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&Be()>Qf&&(o.flags|=128,m=!0,Il(u,!1),o.lanes=4194304)}else{if(!m)if(r=Mf(v),r!==null){if(o.flags|=128,m=!0,r=r.updateQueue,o.updateQueue=r,Kf(o,r),Il(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!rt)return It(o),null}else 2*Be()-u.renderingStartTime>Qf&&c!==536870912&&(o.flags|=128,m=!0,Il(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=Be(),r.sibling=null,c=Jt.current,W(Jt,m?c&1|2:c&1),rt&&Ns(o,u.treeForkCount),r):(It(o),null);case 22:case 23:return ir(o),Sm(),u=o.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(c&536870912)!==0&&(o.flags&128)===0&&(It(o),o.subtreeFlags&6&&(o.flags|=8192)):It(o),c=o.updateQueue,c!==null&&Kf(o,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==c&&(o.flags|=2048),r!==null&&H(Ii),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),As(nn),It(o),null;case 25:return null;case 30:return null}throw Error(s(156,o.tag))}function AO(r,o){switch(im(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return As(nn),de(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return _e(o),null;case 31:if(o.memoizedState!==null){if(ir(o),o.alternate===null)throw Error(s(340));ki()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(ir(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(s(340));ki()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return H(Jt),null;case 4:return de(),null;case 10:return As(o.type),null;case 22:case 23:return ir(o),Sm(),r!==null&&H(Ii),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return As(nn),null;case 25:return null;default:return null}}function IS(r,o){switch(im(o),o.tag){case 3:As(nn),de();break;case 26:case 27:case 5:_e(o);break;case 4:de();break;case 31:o.memoizedState!==null&&ir(o);break;case 13:ir(o);break;case 19:H(Jt);break;case 10:As(o.type);break;case 22:case 23:ir(o),Sm(),r!==null&&H(Ii);break;case 24:As(nn)}}function Pl(r,o){try{var c=o.updateQueue,u=c!==null?c.lastEffect:null;if(u!==null){var m=u.next;c=m;do{if((c.tag&r)===r){u=void 0;var v=c.create,E=c.inst;u=v(),E.destroy=u}c=c.next}while(c!==m)}}catch(k){_t(o,o.return,k)}}function Eo(r,o,c){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,k=E.destroy;if(k!==void 0){E.destroy=void 0,m=o;var $=c,te=k;try{te()}catch(ce){_t(m,$,ce)}}}u=u.next}while(u!==v)}}catch(ce){_t(o,o.return,ce)}}function PS(r){var o=r.updateQueue;if(o!==null){var c=r.stateNode;try{T0(o,c)}catch(u){_t(r,r.return,u)}}}function DS(r,o,c){c.props=Ui(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(u){_t(r,o,u)}}function Dl(r,o){try{var c=r.ref;if(c!==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 c=="function"?r.refCleanup=c(u):c.current=u}}catch(m){_t(r,o,m)}}function ds(r,o){var c=r.ref,u=r.refCleanup;if(c!==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 c=="function")try{c(null)}catch(m){_t(r,o,m)}else c.current=null}function zS(r){var o=r.type,c=r.memoizedProps,u=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&u.focus();break e;case"img":c.src?u.src=c.src:c.srcSet&&(u.srcset=c.srcSet)}}catch(m){_t(r,r.return,m)}}function Jm(r,o,c){try{var u=r.stateNode;WO(u,r.type,c,o),u[Un]=o}catch(m){_t(r,r.return,m)}}function LS(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ko(r.type)||r.tag===4}function eg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||LS(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&&ko(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 tg(r,o,c){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(r),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Ts));else if(u!==4&&(u===27&&ko(r.type)&&(c=r.stateNode,o=null),r=r.child,r!==null))for(tg(r,o,c),r=r.sibling;r!==null;)tg(r,o,c),r=r.sibling}function Gf(r,o,c){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?c.insertBefore(r,o):c.appendChild(r);else if(u!==4&&(u===27&&ko(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(Gf(r,o,c),r=r.sibling;r!==null;)Gf(r,o,c),r=r.sibling}function US(r){var o=r.stateNode,c=r.memoizedProps;try{for(var u=r.type,m=o.attributes;m.length;)o.removeAttributeNode(m[0]);Tn(o,u,c),o[Sn]=r,o[Un]=c}catch(v){_t(r,r.return,v)}}var Ps=!1,on=!1,ng=!1,$S=typeof WeakSet=="function"?WeakSet:Set,xn=null;function kO(r,o){if(r=r.containerInfo,wg=pd,r=Wx(r),Yp(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var u=c.getSelection&&c.getSelection();if(u&&u.rangeCount!==0){c=u.anchorNode;var m=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{c.nodeType,v.nodeType}catch{c=null;break e}var E=0,k=-1,$=-1,te=0,ce=0,fe=r,re=null;t:for(;;){for(var ie;fe!==c||m!==0&&fe.nodeType!==3||(k=E+m),fe!==v||u!==0&&fe.nodeType!==3||($=E+u),fe.nodeType===3&&(E+=fe.nodeValue.length),(ie=fe.firstChild)!==null;)re=fe,fe=ie;for(;;){if(fe===r)break t;if(re===c&&++te===m&&(k=E),re===v&&++ce===u&&($=E),(ie=fe.nextSibling)!==null)break;fe=re,re=fe.parentNode}fe=ie}c=k===-1||$===-1?null:{start:k,end:$}}else c=null}c=c||{start:0,end:0}}else c=null;for(Eg={focusedElem:r,selectionRange:c},pd=!1,xn=o;xn!==null;)if(o=xn,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,xn=r;else for(;xn!==null;){switch(o=xn,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(c=0;c<r.length;c++)m=r[c],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,c=o,m=v.memoizedProps,v=v.memoizedState,u=c.stateNode;try{var Re=Ui(c.type,m);r=u.getSnapshotBeforeUpdate(Re,v),u.__reactInternalSnapshotBeforeUpdate=r}catch($e){_t(c,c.return,$e)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,c=r.nodeType,c===9)Rg(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Rg(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,xn=r;break}xn=o.return}}function BS(r,o,c){var u=c.flags;switch(c.tag){case 0:case 11:case 15:zs(r,c),u&4&&Pl(5,c);break;case 1:if(zs(r,c),u&4)if(r=c.stateNode,o===null)try{r.componentDidMount()}catch(E){_t(c,c.return,E)}else{var m=Ui(c.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(m,o,r.__reactInternalSnapshotBeforeUpdate)}catch(E){_t(c,c.return,E)}}u&64&&PS(c),u&512&&Dl(c,c.return);break;case 3:if(zs(r,c),u&64&&(r=c.updateQueue,r!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{T0(r,o)}catch(E){_t(c,c.return,E)}}break;case 27:o===null&&u&4&&US(c);case 26:case 5:zs(r,c),o===null&&u&4&&zS(c),u&512&&Dl(c,c.return);break;case 12:zs(r,c);break;case 31:zs(r,c),u&4&&qS(r,c);break;case 13:zs(r,c),u&4&&VS(r,c),u&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=$O.bind(null,c),iM(r,c))));break;case 22:if(u=c.memoizedState!==null||Ps,!u){o=o!==null&&o.memoizedState!==null||on,m=Ps;var v=on;Ps=u,(on=o)&&!v?Ls(r,c,(c.subtreeFlags&8772)!==0):zs(r,c),Ps=m,on=v}break;case 30:break;default:zs(r,c)}}function FS(r){var o=r.alternate;o!==null&&(r.alternate=null,FS(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&Op(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 Ut=null,Bn=!1;function Ds(r,o,c){for(c=c.child;c!==null;)HS(r,o,c),c=c.sibling}function HS(r,o,c){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Er,c)}catch{}switch(c.tag){case 26:on||ds(c,o),Ds(r,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:on||ds(c,o);var u=Ut,m=Bn;ko(c.type)&&(Ut=c.stateNode,Bn=!1),Ds(r,o,c),Vl(c.stateNode),Ut=u,Bn=m;break;case 5:on||ds(c,o);case 6:if(u=Ut,m=Bn,Ut=null,Ds(r,o,c),Ut=u,Bn=m,Ut!==null)if(Bn)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(c.stateNode)}catch(v){_t(c,o,v)}else try{Ut.removeChild(c.stateNode)}catch(v){_t(c,o,v)}break;case 18:Ut!==null&&(Bn?(r=Ut,P_(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),ic(r)):P_(Ut,c.stateNode));break;case 4:u=Ut,m=Bn,Ut=c.stateNode.containerInfo,Bn=!0,Ds(r,o,c),Ut=u,Bn=m;break;case 0:case 11:case 14:case 15:Eo(2,c,o),on||Eo(4,c,o),Ds(r,o,c);break;case 1:on||(ds(c,o),u=c.stateNode,typeof u.componentWillUnmount=="function"&&DS(c,o,u)),Ds(r,o,c);break;case 21:Ds(r,o,c);break;case 22:on=(u=on)||c.memoizedState!==null,Ds(r,o,c),on=u;break;default:Ds(r,o,c)}}function qS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ic(r)}catch(c){_t(o,o.return,c)}}}function VS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ic(r)}catch(c){_t(o,o.return,c)}}function OO(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new $S),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new $S),o;default:throw Error(s(435,r.tag))}}function Zf(r,o){var c=OO(r);o.forEach(function(u){if(!c.has(u)){c.add(u);var m=BO.bind(null,r,u);u.then(m,m)}})}function Fn(r,o){var c=o.deletions;if(c!==null)for(var u=0;u<c.length;u++){var m=c[u],v=r,E=o,k=E;e:for(;k!==null;){switch(k.tag){case 27:if(ko(k.type)){Ut=k.stateNode,Bn=!1;break e}break;case 5:Ut=k.stateNode,Bn=!1;break e;case 3:case 4:Ut=k.stateNode.containerInfo,Bn=!0;break e}k=k.return}if(Ut===null)throw Error(s(160));HS(v,E,m),Ut=null,Bn=!1,v=m.alternate,v!==null&&(v.return=null),m.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)KS(o,r),o=o.sibling}var Wr=null;function KS(r,o){var c=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Fn(o,r),Hn(r),u&4&&(Eo(3,r,r.return),Pl(3,r),Eo(5,r,r.return));break;case 1:Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),u&64&&Ps&&(r=r.updateQueue,r!==null&&(u=r.callbacks,u!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?u:c.concat(u))));break;case 26:var m=Wr;if(Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),u&4){var v=c!==null?c.memoizedState:null;if(u=r.memoizedState,c===null)if(u===null)if(r.stateNode===null){e:{u=r.type,c=r.memoizedProps,m=m.ownerDocument||m;t:switch(u){case"title":v=m.getElementsByTagName("title")[0],(!v||v[ll]||v[Sn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=m.createElement(u),m.head.insertBefore(v,m.querySelector("head > title"))),Tn(v,u,c),v[Sn]=r,bn(v),u=v;break e;case"link":var E=K_("link","href",m).get(u+(c.href||""));if(E){for(var k=0;k<E.length;k++)if(v=E[k],v.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&v.getAttribute("rel")===(c.rel==null?null:c.rel)&&v.getAttribute("title")===(c.title==null?null:c.title)&&v.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(k,1);break t}}v=m.createElement(u),Tn(v,u,c),m.head.appendChild(v);break;case"meta":if(E=K_("meta","content",m).get(u+(c.content||""))){for(k=0;k<E.length;k++)if(v=E[k],v.getAttribute("content")===(c.content==null?null:""+c.content)&&v.getAttribute("name")===(c.name==null?null:c.name)&&v.getAttribute("property")===(c.property==null?null:c.property)&&v.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&v.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(k,1);break t}}v=m.createElement(u),Tn(v,u,c),m.head.appendChild(v);break;default:throw Error(s(468,u))}v[Sn]=r,bn(v),u=v}r.stateNode=u}else G_(m,r.type,r.stateNode);else r.stateNode=V_(m,u,r.memoizedProps);else v!==u?(v===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):v.count--,u===null?G_(m,r.type,r.stateNode):V_(m,u,r.memoizedProps)):u===null&&r.stateNode!==null&&Jm(r,r.memoizedProps,c.memoizedProps)}break;case 27:Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),c!==null&&u&4&&Jm(r,r.memoizedProps,c.memoizedProps);break;case 5:if(Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),r.flags&32){m=r.stateNode;try{ja(m,"")}catch(Re){_t(r,r.return,Re)}}u&4&&r.stateNode!=null&&(m=r.memoizedProps,Jm(r,m,c!==null?c.memoizedProps:m)),u&1024&&(ng=!0);break;case 6:if(Fn(o,r),Hn(r),u&4){if(r.stateNode===null)throw Error(s(162));u=r.memoizedProps,c=r.stateNode;try{c.nodeValue=u}catch(Re){_t(r,r.return,Re)}}break;case 3:if(ud=null,m=Wr,Wr=cd(o.containerInfo),Fn(o,r),Wr=m,Hn(r),u&4&&c!==null&&c.memoizedState.isDehydrated)try{ic(o.containerInfo)}catch(Re){_t(r,r.return,Re)}ng&&(ng=!1,GS(r));break;case 4:u=Wr,Wr=cd(r.stateNode.containerInfo),Fn(o,r),Hn(r),Wr=u;break;case 12:Fn(o,r),Hn(r);break;case 31:Fn(o,r),Hn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Zf(r,u)));break;case 13:Fn(o,r),Hn(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Xf=Be()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Zf(r,u)));break;case 22:m=r.memoizedState!==null;var $=c!==null&&c.memoizedState!==null,te=Ps,ce=on;if(Ps=te||m,on=ce||$,Fn(o,r),on=ce,Ps=te,Hn(r),u&8192)e:for(o=r.stateNode,o._visibility=m?o._visibility&-2:o._visibility|1,m&&(c===null||$||Ps||on||$i(r)),c=null,o=r;;){if(o.tag===5||o.tag===26){if(c===null){$=c=o;try{if(v=$.stateNode,m)E=v.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{k=$.stateNode;var fe=$.memoizedProps.style,re=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;k.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Re){_t($,$.return,Re)}}}else if(o.tag===6){if(c===null){$=o;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(Re){_t($,$.return,Re)}}}else if(o.tag===18){if(c===null){$=o;try{var ie=$.stateNode;m?D_(ie,!0):D_($.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;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}u&4&&(u=r.updateQueue,u!==null&&(c=u.retryQueue,c!==null&&(u.retryQueue=null,Zf(r,c))));break;case 19:Fn(o,r),Hn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Zf(r,u)));break;case 30:break;case 21:break;default:Fn(o,r),Hn(r)}}function Hn(r){var o=r.flags;if(o&2){try{for(var c,u=r.return;u!==null;){if(LS(u)){c=u;break}u=u.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var m=c.stateNode,v=eg(r);Gf(r,v,m);break;case 5:var E=c.stateNode;c.flags&32&&(ja(E,""),c.flags&=-33);var k=eg(r);Gf(r,k,E);break;case 3:case 4:var $=c.stateNode.containerInfo,te=eg(r);tg(r,te,$);break;default:throw Error(s(161))}}catch(ce){_t(r,r.return,ce)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function GS(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;GS(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function zs(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)BS(r,o.alternate,o),o=o.sibling}function $i(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:Eo(4,o,o.return),$i(o);break;case 1:ds(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&DS(o,o.return,c),$i(o);break;case 27:Vl(o.stateNode);case 26:case 5:ds(o,o.return),$i(o);break;case 22:o.memoizedState===null&&$i(o);break;case 30:$i(o);break;default:$i(o)}r=r.sibling}}function Ls(r,o,c){for(c=c&&(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:Ls(m,v,c),Pl(4,v);break;case 1:if(Ls(m,v,c),u=v,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(te){_t(u,u.return,te)}if(u=v,m=u.updateQueue,m!==null){var k=u.stateNode;try{var $=m.shared.hiddenCallbacks;if($!==null)for(m.shared.hiddenCallbacks=null,m=0;m<$.length;m++)E0($[m],k)}catch(te){_t(u,u.return,te)}}c&&E&64&&PS(v),Dl(v,v.return);break;case 27:US(v);case 26:case 5:Ls(m,v,c),c&&u===null&&E&4&&zS(v),Dl(v,v.return);break;case 12:Ls(m,v,c);break;case 31:Ls(m,v,c),c&&E&4&&qS(m,v);break;case 13:Ls(m,v,c),c&&E&4&&VS(m,v);break;case 22:v.memoizedState===null&&Ls(m,v,c),Dl(v,v.return);break;case 30:break;default:Ls(m,v,c)}o=o.sibling}}function rg(r,o){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&_l(c))}function sg(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&_l(r))}function Jr(r,o,c,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)ZS(r,o,c,u),o=o.sibling}function ZS(r,o,c,u){var m=o.flags;switch(o.tag){case 0:case 11:case 15:Jr(r,o,c,u),m&2048&&Pl(9,o);break;case 1:Jr(r,o,c,u);break;case 3:Jr(r,o,c,u),m&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&_l(r)));break;case 12:if(m&2048){Jr(r,o,c,u),r=o.stateNode;try{var v=o.memoizedProps,E=v.id,k=v.onPostCommit;typeof k=="function"&&k(E,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){_t(o,o.return,$)}}else Jr(r,o,c,u);break;case 31:Jr(r,o,c,u);break;case 13:Jr(r,o,c,u);break;case 23:break;case 22:v=o.stateNode,E=o.alternate,o.memoizedState!==null?v._visibility&2?Jr(r,o,c,u):zl(r,o):v._visibility&2?Jr(r,o,c,u):(v._visibility|=2,Ya(r,o,c,u,(o.subtreeFlags&10256)!==0||!1)),m&2048&&rg(E,o);break;case 24:Jr(r,o,c,u),m&2048&&sg(o.alternate,o);break;default:Jr(r,o,c,u)}}function Ya(r,o,c,u,m){for(m=m&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=r,E=o,k=c,$=u,te=E.flags;switch(E.tag){case 0:case 11:case 15:Ya(v,E,k,$,m),Pl(8,E);break;case 23:break;case 22:var ce=E.stateNode;E.memoizedState!==null?ce._visibility&2?Ya(v,E,k,$,m):zl(v,E):(ce._visibility|=2,Ya(v,E,k,$,m)),m&&te&2048&&rg(E.alternate,E);break;case 24:Ya(v,E,k,$,m),m&&te&2048&&sg(E.alternate,E);break;default:Ya(v,E,k,$,m)}o=o.sibling}}function zl(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=r,u=o,m=u.flags;switch(u.tag){case 22:zl(c,u),m&2048&&rg(u.alternate,u);break;case 24:zl(c,u),m&2048&&sg(u.alternate,u);break;default:zl(c,u)}o=o.sibling}}var Ll=8192;function Xa(r,o,c){if(r.subtreeFlags&Ll)for(r=r.child;r!==null;)YS(r,o,c),r=r.sibling}function YS(r,o,c){switch(r.tag){case 26:Xa(r,o,c),r.flags&Ll&&r.memoizedState!==null&&vM(c,Wr,r.memoizedState,r.memoizedProps);break;case 5:Xa(r,o,c);break;case 3:case 4:var u=Wr;Wr=cd(r.stateNode.containerInfo),Xa(r,o,c),Wr=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=Ll,Ll=16777216,Xa(r,o,c),Ll=u):Xa(r,o,c));break;default:Xa(r,o,c)}}function XS(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 Ul(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var u=o[c];xn=u,WS(u,r)}XS(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)QS(r),r=r.sibling}function QS(r){switch(r.tag){case 0:case 11:case 15:Ul(r),r.flags&2048&&Eo(9,r,r.return);break;case 3:Ul(r);break;case 12:Ul(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,Yf(r)):Ul(r);break;default:Ul(r)}}function Yf(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var u=o[c];xn=u,WS(u,r)}XS(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:Eo(8,o,o.return),Yf(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Yf(o));break;default:Yf(o)}r=r.sibling}}function WS(r,o){for(;xn!==null;){var c=xn;switch(c.tag){case 0:case 11:case 15:Eo(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var u=c.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:_l(c.memoizedState.cache)}if(u=c.child,u!==null)u.return=c,xn=u;else e:for(c=r;xn!==null;){u=xn;var m=u.sibling,v=u.return;if(FS(u),u===c){xn=null;break e}if(m!==null){m.return=v,xn=m;break e}xn=v}}}var MO={getCacheForType:function(r){var o=wn(nn),c=o.data.get(r);return c===void 0&&(c=r(),o.data.set(r,c)),c},cacheSignal:function(){return wn(nn).controller.signal}},IO=typeof WeakMap=="function"?WeakMap:Map,gt=0,Nt=null,Je=null,tt=0,St=0,ar=null,To=!1,Qa=!1,og=!1,Us=0,Gt=0,Co=0,Bi=0,ig=0,cr=0,Wa=0,$l=null,qn=null,ag=!1,Xf=0,JS=0,Qf=1/0,Wf=null,Ro=null,fn=0,No=null,Ja=null,$s=0,cg=0,lg=null,e_=null,Bl=0,ug=null;function lr(){return(gt&2)!==0&&tt!==0?tt&-tt:D.T!==null?gg():af()}function t_(){if(cr===0)if((tt&536870912)===0||rt){var r=Cn;Cn<<=1,(Cn&3932160)===0&&(Cn=262144),cr=r}else cr=536870912;return r=or.current,r!==null&&(r.flags|=32),cr}function Vn(r,o,c){(r===Nt&&(St===2||St===9)||r.cancelPendingCommit!==null)&&(ec(r,0),jo(r,tt,cr,!1)),ws(r,c),((gt&2)===0||r!==Nt)&&(r===Nt&&((gt&2)===0&&(Bi|=c),Gt===4&&jo(r,tt,cr,!1)),hs(r))}function n_(r,o,c){if((gt&6)!==0)throw Error(s(327));var u=!c&&(o&127)===0&&(o&r.expiredLanes)===0||cs(r,o),m=u?zO(r,o):dg(r,o,!0),v=u;do{if(m===0){Qa&&!u&&jo(r,o,0,!1);break}else{if(c=r.current.alternate,v&&!PO(c)){m=dg(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 k=r;m=$l;var $=k.current.memoizedState.isDehydrated;if($&&(ec(k,E).flags|=256),E=dg(k,E,!1),E!==2){if(og&&!$){k.errorRecoveryDisabledLanes|=v,Bi|=v,m=4;break e}v=qn,qn=m,v!==null&&(qn===null?qn=v:qn.push.apply(qn,v))}m=E}if(v=!1,m!==2)continue}}if(m===1){ec(r,0),jo(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:jo(u,o,cr,!To);break e;case 2:qn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((o&62914560)===o&&(m=Xf+300-Be(),10<m)){if(jo(u,o,cr,!To),as(u,0,!0)!==0)break e;$s=o,u.timeoutHandle=M_(r_.bind(null,u,c,qn,Wf,ag,o,cr,Bi,Wa,To,v,"Throttled",-0,0),m);break e}r_(u,c,qn,Wf,ag,o,cr,Bi,Wa,To,v,null,-0,0)}}break}while(!0);hs(r)}function r_(r,o,c,u,m,v,E,k,$,te,ce,fe,re,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:Ts},YS(o,v,fe);var Re=(v&62914560)===v?Xf-Be():(v&4194048)===v?JS-Be():0;if(Re=bM(fe,Re),Re!==null){$s=v,r.cancelPendingCommit=Re(f_.bind(null,r,o,v,c,u,m,E,k,$,ce,fe,null,re,ie)),jo(r,v,E,!te);return}}f_(r,o,v,c,u,m,E,k,$)}function PO(r){for(var o=r;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var u=0;u<c.length;u++){var m=c[u],v=m.getSnapshot;m=m.value;try{if(!rr(v(),m))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;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 jo(r,o,c,u){o&=~ig,o&=~Bi,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}c!==0&&ls(r,c,o)}function Jf(){return(gt&6)===0?(Fl(0),!1):!0}function fg(){if(Je!==null){if(St===0)var r=Je.return;else r=Je,js=Oi=null,Rm(r),qa=null,El=0,r=Je;for(;r!==null;)IS(r.alternate,r),r=r.return;Je=null}}function ec(r,o){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,tM(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),$s=0,fg(),Nt=r,Je=c=Rs(r.current,null),tt=o,St=0,ar=null,To=!1,Qa=cs(r,o),og=!1,Wa=cr=ig=Bi=Co=Gt=0,qn=$l=null,ag=!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 Us=o,xf(),c}function s_(r,o){Ze=null,D.H=Ol,o===Ha||o===Nf?(o=x0(),St=3):o===mm?(o=x0(),St=4):St=o===Hm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,ar=o,Je===null&&(Gt=1,Ff(r,Nr(o,r.current)))}function o_(){var r=or.current;return r===null?!0:(tt&4194048)===tt?Or===null:(tt&62914560)===tt||(tt&536870912)!==0?r===Or:!1}function i_(){var r=D.H;return D.H=Ol,r===null?Ol:r}function a_(){var r=D.A;return D.A=MO,r}function ed(){Gt=4,To||(tt&4194048)!==tt&&or.current!==null||(Qa=!0),(Co&134217727)===0&&(Bi&134217727)===0||Nt===null||jo(Nt,tt,cr,!1)}function dg(r,o,c){var u=gt;gt|=2;var m=i_(),v=a_();(Nt!==r||tt!==o)&&(Wf=null,ec(r,o)),o=!1;var E=Gt;e:do try{if(St!==0&&Je!==null){var k=Je,$=ar;switch(St){case 8:fg(),E=6;break e;case 3:case 2:case 9:case 6:or.current===null&&(o=!0);var te=St;if(St=0,ar=null,tc(r,k,$,te),c&&Qa){E=0;break e}break;default:te=St,St=0,ar=null,tc(r,k,$,te)}}DO(),E=Gt;break}catch(ce){s_(r,ce)}while(!0);return o&&r.shellSuspendCounter++,js=Oi=null,gt=u,D.H=m,D.A=v,Je===null&&(Nt=null,tt=0,xf()),E}function DO(){for(;Je!==null;)c_(Je)}function zO(r,o){var c=gt;gt|=2;var u=i_(),m=a_();Nt!==r||tt!==o?(Wf=null,Qf=Be()+500,ec(r,o)):Qa=cs(r,o);e:do try{if(St!==0&&Je!==null){o=Je;var v=ar;t:switch(St){case 1:St=0,ar=null,tc(r,o,v,1);break;case 2:case 9:if(v0(v)){St=0,ar=null,l_(o);break}o=function(){St!==2&&St!==9||Nt!==r||(St=7),hs(r)},v.then(o,o);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:v0(v)?(St=0,ar=null,l_(o)):(St=0,ar=null,tc(r,o,v,7));break;case 5:var E=null;switch(Je.tag){case 26:E=Je.memoizedState;case 5:case 27:var k=Je;if(E?Z_(E):k.stateNode.complete){St=0,ar=null;var $=k.sibling;if($!==null)Je=$;else{var te=k.return;te!==null?(Je=te,td(te)):Je=null}break t}}St=0,ar=null,tc(r,o,v,5);break;case 6:St=0,ar=null,tc(r,o,v,6);break;case 8:fg(),Gt=6;break e;default:throw Error(s(462))}}LO();break}catch(ce){s_(r,ce)}while(!0);return js=Oi=null,D.H=u,D.A=m,gt=c,Je!==null?0:(Nt=null,tt=0,xf(),Gt)}function LO(){for(;Je!==null&&!Ve();)c_(Je)}function c_(r){var o=OS(r.alternate,r,Us);r.memoizedProps=r.pendingProps,o===null?td(r):Je=o}function l_(r){var o=r,c=o.alternate;switch(o.tag){case 15:case 0:o=CS(c,o,o.pendingProps,o.type,void 0,tt);break;case 11:o=CS(c,o,o.pendingProps,o.type.render,o.ref,tt);break;case 5:Rm(o);default:IS(c,o),o=Je=a0(o,Us),o=OS(c,o,Us)}r.memoizedProps=r.pendingProps,o===null?td(r):Je=o}function tc(r,o,c,u){js=Oi=null,Rm(o),qa=null,El=0;var m=o.return;try{if(CO(r,m,o,c,tt)){Gt=1,Ff(r,Nr(c,r.current)),Je=null;return}}catch(v){if(m!==null)throw Je=m,v;Gt=1,Ff(r,Nr(c,r.current)),Je=null;return}o.flags&32768?(rt||u===1?r=!0:Qa||(tt&536870912)!==0?r=!1:(To=r=!0,(u===2||u===9||u===3||u===6)&&(u=or.current,u!==null&&u.tag===13&&(u.flags|=16384))),u_(o,r)):td(o)}function td(r){var o=r;do{if((o.flags&32768)!==0){u_(o,To);return}r=o.return;var c=jO(o.alternate,o,Us);if(c!==null){Je=c;return}if(o=o.sibling,o!==null){Je=o;return}Je=o=r}while(o!==null);Gt===0&&(Gt=5)}function u_(r,o){do{var c=AO(r.alternate,r);if(c!==null){c.flags&=32767,Je=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(r=r.sibling,r!==null)){Je=r;return}Je=r=c}while(r!==null);Gt=6,Je=null}function f_(r,o,c,u,m,v,E,k,$){r.cancelPendingCommit=null;do nd();while(fn!==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|=em,tr(r,c,v,E,k,$),r===Nt&&(Je=Nt=null,tt=0),Ja=o,No=r,$s=c,cg=v,lg=m,e_=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,FO(Te,function(){return g_(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=D.T,D.T=null,m=V.p,V.p=2,E=gt,gt|=4;try{kO(r,o,c)}finally{gt=E,V.p=m,D.T=u}}fn=1,d_(),h_(),p_()}}function d_(){if(fn===1){fn=0;var r=No,o=Ja,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=D.T,D.T=null;var u=V.p;V.p=2;var m=gt;gt|=4;try{KS(o,r);var v=Eg,E=Wx(r.containerInfo),k=v.focusedElem,$=v.selectionRange;if(E!==k&&k&&k.ownerDocument&&Qx(k.ownerDocument.documentElement,k)){if($!==null&&Yp(k)){var te=$.start,ce=$.end;if(ce===void 0&&(ce=te),"selectionStart"in k)k.selectionStart=te,k.selectionEnd=Math.min(ce,k.value.length);else{var fe=k.ownerDocument||document,re=fe&&fe.defaultView||window;if(re.getSelection){var ie=re.getSelection(),Re=k.textContent.length,$e=Math.min($.start,Re),Ct=$.end===void 0?$e:Math.min($.end,Re);!ie.extend&&$e>Ct&&(E=Ct,Ct=$e,$e=E);var G=Xx(k,$e),F=Xx(k,Ct);if(G&&F&&(ie.rangeCount!==1||ie.anchorNode!==G.node||ie.anchorOffset!==G.offset||ie.focusNode!==F.node||ie.focusOffset!==F.offset)){var J=fe.createRange();J.setStart(G.node,G.offset),ie.removeAllRanges(),$e>Ct?(ie.addRange(J),ie.extend(F.node,F.offset)):(J.setEnd(F.node,F.offset),ie.addRange(J))}}}}for(fe=[],ie=k;ie=ie.parentNode;)ie.nodeType===1&&fe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<fe.length;k++){var le=fe[k];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}pd=!!wg,Eg=wg=null}finally{gt=m,V.p=u,D.T=c}}r.current=o,fn=2}}function h_(){if(fn===2){fn=0;var r=No,o=Ja,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=D.T,D.T=null;var u=V.p;V.p=2;var m=gt;gt|=4;try{BS(r,o.alternate,o)}finally{gt=m,V.p=u,D.T=c}}fn=3}}function p_(){if(fn===4||fn===3){fn=0,Xe();var r=No,o=Ja,c=$s,u=e_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?fn=5:(fn=0,Ja=No=null,m_(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(Ro=null),cl(c),o=o.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Er,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=D.T,m=V.p,V.p=2,D.T=null;try{for(var v=r.onRecoverableError,E=0;E<u.length;E++){var k=u[E];v(k.value,{componentStack:k.stack})}}finally{D.T=o,V.p=m}}($s&3)!==0&&nd(),hs(r),m=r.pendingLanes,(c&261930)!==0&&(m&42)!==0?r===ug?Bl++:(Bl=0,ug=r):Bl=0,Fl(0)}}function m_(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,_l(o)))}function nd(){return d_(),h_(),p_(),g_()}function g_(){if(fn!==5)return!1;var r=No,o=cg;cg=0;var c=cl($s),u=D.T,m=V.p;try{V.p=32>c?32:c,D.T=null,c=lg,lg=null;var v=No,E=$s;if(fn=0,Ja=No=null,$s=0,(gt&6)!==0)throw Error(s(331));var k=gt;if(gt|=4,QS(v.current),ZS(v,v.current,E,c),gt=k,Fl(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Er,v)}catch{}return!0}finally{V.p=m,D.T=u,m_(r,o)}}function y_(r,o,c){o=Nr(c,o),o=Fm(r.stateNode,o,2),r=So(r,o,2),r!==null&&(ws(r,2),hs(r))}function _t(r,o,c){if(r.tag===3)y_(r,r,c);else for(;o!==null;){if(o.tag===3){y_(o,r,c);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Ro===null||!Ro.has(u))){r=Nr(c,r),c=vS(2),u=So(o,c,2),u!==null&&(bS(c,u,o,r),ws(u,2),hs(u));break}}o=o.return}}function hg(r,o,c){var u=r.pingCache;if(u===null){u=r.pingCache=new IO;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(c)||(og=!0,m.add(c),r=UO.bind(null,r,o,c),o.then(r,r))}function UO(r,o,c){var u=r.pingCache;u!==null&&u.delete(o),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Nt===r&&(tt&c)===c&&(Gt===4||Gt===3&&(tt&62914560)===tt&&300>Be()-Xf?(gt&2)===0&&ec(r,0):ig|=c,Wa===tt&&(Wa=0)),hs(r)}function v_(r,o){o===0&&(o=wi()),r=ji(r,o),r!==null&&(ws(r,o),hs(r))}function $O(r){var o=r.memoizedState,c=0;o!==null&&(c=o.retryLane),v_(r,c)}function BO(r,o){var c=0;switch(r.tag){case 31:case 13:var u=r.stateNode,m=r.memoizedState;m!==null&&(c=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),v_(r,c)}function FO(r,o){return Ie(r,o)}var rd=null,nc=null,pg=!1,sd=!1,mg=!1,Ao=0;function hs(r){r!==nc&&r.next===null&&(nc===null?rd=nc=r:nc=nc.next=r),sd=!0,pg||(pg=!0,qO())}function Fl(r,o){if(!mg&&sd){mg=!0;do for(var c=!1,u=rd;u!==null;){if(r!==0){var m=u.pendingLanes;if(m===0)var v=0;else{var E=u.suspendedLanes,k=u.pingedLanes;v=(1<<31-xt(42|r)+1)-1,v&=m&~(E&~k),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(c=!0,__(u,v))}else v=tt,v=as(u,u===Nt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||cs(u,v)||(c=!0,__(u,v));u=u.next}while(c);mg=!1}}function HO(){b_()}function b_(){sd=pg=!1;var r=0;Ao!==0&&eM()&&(r=Ao);for(var o=Be(),c=null,u=rd;u!==null;){var m=u.next,v=x_(u,o);v===0?(u.next=null,c===null?rd=m:c.next=m,m===null&&(nc=c)):(c=u,(r!==0||(v&3)!==0)&&(sd=!0)),u=m}fn!==0&&fn!==5||Fl(r),Ao!==0&&(Ao=0)}function x_(r,o){for(var c=r.suspendedLanes,u=r.pingedLanes,m=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var E=31-xt(v),k=1<<E,$=m[E];$===-1?((k&c)===0||(k&u)!==0)&&(m[E]=_a(k,o)):$<=o&&(r.expiredLanes|=k),v&=~k}if(o=Nt,c=tt,c=as(r,r===o?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,c===0||r===o&&(St===2||St===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&Ee(u),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||cs(r,c)){if(o=c&-c,o===r.callbackPriority)return o;switch(u!==null&&Ee(u),cl(c)){case 2:case 8:c=me;break;case 32:c=Te;break;case 268435456:c=mt;break;default:c=Te}return u=S_.bind(null,r),c=Ie(c,u),r.callbackPriority=o,r.callbackNode=c,o}return u!==null&&u!==null&&Ee(u),r.callbackPriority=2,r.callbackNode=null,2}function S_(r,o){if(fn!==0&&fn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(nd()&&r.callbackNode!==c)return null;var u=tt;return u=as(r,r===Nt?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:(n_(r,u,o),x_(r,Be()),r.callbackNode!=null&&r.callbackNode===c?S_.bind(null,r):null)}function __(r,o){if(nd())return null;n_(r,o,!0)}function qO(){nM(function(){(gt&6)!==0?Ie(He,HO):b_()})}function gg(){if(Ao===0){var r=Ba;r===0&&(r=kt,kt<<=1,(kt&261888)===0&&(kt=256)),Ao=r}return Ao}function w_(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:df(""+r)}function E_(r,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,r.id&&c.setAttribute("form",r.id),o.parentNode.insertBefore(c,o),r=new FormData(r),c.parentNode.removeChild(c),r}function VO(r,o,c,u,m){if(o==="submit"&&c&&c.stateNode===m){var v=w_((m[Un]||null).action),E=u.submitter;E&&(o=(o=E[Un]||null)?w_(o.formAction):E.getAttribute("formAction"),o!==null&&(v=o,E=null));var k=new gf("action","action",null,u,m);r.push({event:k,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Ao!==0){var $=E?E_(m,E):new FormData(m);Dm(c,{pending:!0,data:$,method:m.method,action:v},null,$)}}else typeof v=="function"&&(k.preventDefault(),$=E?E_(m,E):new FormData(m),Dm(c,{pending:!0,data:$,method:m.method,action:v},v,$))},currentTarget:m}]})}}for(var yg=0;yg<Jp.length;yg++){var vg=Jp[yg],KO=vg.toLowerCase(),GO=vg[0].toUpperCase()+vg.slice(1);Qr(KO,"on"+GO)}Qr(t0,"onAnimationEnd"),Qr(n0,"onAnimationIteration"),Qr(r0,"onAnimationStart"),Qr("dblclick","onDoubleClick"),Qr("focusin","onFocus"),Qr("focusout","onBlur"),Qr(lO,"onTransitionRun"),Qr(uO,"onTransitionStart"),Qr(fO,"onTransitionCancel"),Qr(s0,"onTransitionEnd"),Ra("onMouseEnter",["mouseout","mouseover"]),Ra("onMouseLeave",["mouseout","mouseover"]),Ra("onPointerEnter",["pointerout","pointerover"]),Ra("onPointerLeave",["pointerout","pointerover"]),Ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ti("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hl="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(" "),ZO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hl));function T_(r,o){o=(o&4)!==0;for(var c=0;c<r.length;c++){var u=r[c],m=u.event;u=u.listeners;e:{var v=void 0;if(o)for(var E=u.length-1;0<=E;E--){var k=u[E],$=k.instance,te=k.currentTarget;if(k=k.listener,$!==v&&m.isPropagationStopped())break e;v=k,m.currentTarget=te;try{v(m)}catch(ce){bf(ce)}m.currentTarget=null,v=$}else for(E=0;E<u.length;E++){if(k=u[E],$=k.instance,te=k.currentTarget,k=k.listener,$!==v&&m.isPropagationStopped())break e;v=k,m.currentTarget=te;try{v(m)}catch(ce){bf(ce)}m.currentTarget=null,v=$}}}}function et(r,o){var c=o[kp];c===void 0&&(c=o[kp]=new Set);var u=r+"__bubble";c.has(u)||(C_(o,r,2,!1),c.add(u))}function bg(r,o,c){var u=0;o&&(u|=4),C_(c,r,u,o)}var od="_reactListening"+Math.random().toString(36).slice(2);function xg(r){if(!r[od]){r[od]=!0,bx.forEach(function(c){c!=="selectionchange"&&(ZO.has(c)||bg(c,!1,r),bg(c,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[od]||(o[od]=!0,bg("selectionchange",!1,o))}}function C_(r,o,c,u){switch(tw(o)){case 2:var m=_M;break;case 8:m=wM;break;default:m=Pg}c=m.bind(null,o,c,r),m=void 0,!$p||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(m=!0),u?m!==void 0?r.addEventListener(o,c,{capture:!0,passive:m}):r.addEventListener(o,c,!0):m!==void 0?r.addEventListener(o,c,{passive:m}):r.addEventListener(o,c,!1)}function Sg(r,o,c,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 k=u.stateNode.containerInfo;if(k===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(;k!==null;){if(E=Ea(k),E===null)return;if($=E.tag,$===5||$===6||$===26||$===27){u=v=E;continue e}k=k.parentNode}}u=u.return}kx(function(){var te=v,ce=Lp(c),fe=[];e:{var re=o0.get(r);if(re!==void 0){var ie=gf,Re=r;switch(r){case"keypress":if(pf(c)===0)break e;case"keydown":case"keyup":ie=Bk;break;case"focusin":Re="focus",ie=qp;break;case"focusout":Re="blur",ie=qp;break;case"beforeblur":case"afterblur":ie=qp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Ix;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=jk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=qk;break;case t0:case n0:case r0:ie=Ok;break;case s0:ie=Kk;break;case"scroll":case"scrollend":ie=Rk;break;case"wheel":ie=Zk;break;case"copy":case"cut":case"paste":ie=Ik;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Dx;break;case"toggle":case"beforetoggle":ie=Xk}var $e=(o&4)!==0,Ct=!$e&&(r==="scroll"||r==="scrollend"),G=$e?re!==null?re+"Capture":null:re;$e=[];for(var F=te,J;F!==null;){var le=F;if(J=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||J===null||G===null||(le=fl(F,G),le!=null&&$e.push(ql(F,le,J))),Ct)break;F=F.return}0<$e.length&&(re=new ie(re,Re,null,c,ce),fe.push({event:re,listeners:$e}))}}if((o&7)===0){e:{if(re=r==="mouseover"||r==="pointerover",ie=r==="mouseout"||r==="pointerout",re&&c!==zp&&(Re=c.relatedTarget||c.fromElement)&&(Ea(Re)||Re[wa]))break e;if((ie||re)&&(re=ce.window===ce?ce:(re=ce.ownerDocument)?re.defaultView||re.parentWindow:window,ie?(Re=c.relatedTarget||c.toElement,ie=te,Re=Re?Ea(Re):null,Re!==null&&(Ct=a(Re),$e=Re.tag,Re!==Ct||$e!==5&&$e!==27&&$e!==6)&&(Re=null)):(ie=null,Re=te),ie!==Re)){if($e=Ix,le="onMouseLeave",G="onMouseEnter",F="mouse",(r==="pointerout"||r==="pointerover")&&($e=Dx,le="onPointerLeave",G="onPointerEnter",F="pointer"),Ct=ie==null?re:ul(ie),J=Re==null?re:ul(Re),re=new $e(le,F+"leave",ie,c,ce),re.target=Ct,re.relatedTarget=J,le=null,Ea(ce)===te&&($e=new $e(G,F+"enter",Re,c,ce),$e.target=J,$e.relatedTarget=Ct,le=$e),Ct=le,ie&&Re)t:{for($e=YO,G=ie,F=Re,J=0,le=G;le;le=$e(le))J++;le=0;for(var ze=F;ze;ze=$e(ze))le++;for(;0<J-le;)G=$e(G),J--;for(;0<le-J;)F=$e(F),le--;for(;J--;){if(G===F||F!==null&&G===F.alternate){$e=G;break t}G=$e(G),F=$e(F)}$e=null}else $e=null;ie!==null&&R_(fe,re,ie,$e,!1),Re!==null&&Ct!==null&&R_(fe,Ct,Re,$e,!0)}}e:{if(re=te?ul(te):window,ie=re.nodeName&&re.nodeName.toLowerCase(),ie==="select"||ie==="input"&&re.type==="file")var ft=qx;else if(Fx(re))if(Vx)ft=iO;else{ft=sO;var ke=rO}else ie=re.nodeName,!ie||ie.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?te&&Dp(te.elementType)&&(ft=qx):ft=oO;if(ft&&(ft=ft(r,te))){Hx(fe,ft,c,ce);break e}ke&&ke(r,re,te),r==="focusout"&&te&&re.type==="number"&&te.memoizedProps.value!=null&&Pp(re,"number",re.value)}switch(ke=te?ul(te):window,r){case"focusin":(Fx(ke)||ke.contentEditable==="true")&&(Ma=ke,Xp=te,bl=null);break;case"focusout":bl=Xp=Ma=null;break;case"mousedown":Qp=!0;break;case"contextmenu":case"mouseup":case"dragend":Qp=!1,Jx(fe,c,ce);break;case"selectionchange":if(cO)break;case"keydown":case"keyup":Jx(fe,c,ce)}var Ye;if(Kp)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 Oa?$x(r,c)&&(nt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(nt="onCompositionStart");nt&&(zx&&c.locale!=="ko"&&(Oa||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&Oa&&(Ye=Ox()):(po=ce,Bp="value"in po?po.value:po.textContent,Oa=!0)),ke=id(te,nt),0<ke.length&&(nt=new Px(nt,r,null,c,ce),fe.push({event:nt,listeners:ke}),Ye?nt.data=Ye:(Ye=Bx(c),Ye!==null&&(nt.data=Ye)))),(Ye=Wk?Jk(r,c):eO(r,c))&&(nt=id(te,"onBeforeInput"),0<nt.length&&(ke=new Px("onBeforeInput","beforeinput",null,c,ce),fe.push({event:ke,listeners:nt}),ke.data=Ye)),VO(fe,r,te,c,ce)}T_(fe,o)})}function ql(r,o,c){return{instance:r,listener:o,currentTarget:c}}function id(r,o){for(var c=o+"Capture",u=[];r!==null;){var m=r,v=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||v===null||(m=fl(r,c),m!=null&&u.unshift(ql(r,m,v)),m=fl(r,o),m!=null&&u.push(ql(r,m,v))),r.tag===3)return u;r=r.return}return[]}function YO(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function R_(r,o,c,u,m){for(var v=o._reactName,E=[];c!==null&&c!==u;){var k=c,$=k.alternate,te=k.stateNode;if(k=k.tag,$!==null&&$===u)break;k!==5&&k!==26&&k!==27||te===null||($=te,m?(te=fl(c,v),te!=null&&E.unshift(ql(c,te,$))):m||(te=fl(c,v),te!=null&&E.push(ql(c,te,$)))),c=c.return}E.length!==0&&r.push({event:o,listeners:E})}var XO=/\r\n?/g,QO=/\u0000|\uFFFD/g;function N_(r){return(typeof r=="string"?r:""+r).replace(XO,`
67
- `).replace(QO,"")}function j_(r,o){return o=N_(o),N_(r)===o}function Tt(r,o,c,u,m,v){switch(c){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||ja(r,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&ja(r,""+u);break;case"className":uf(r,"class",u);break;case"tabIndex":uf(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":uf(r,c,u);break;case"style":jx(r,u,v);break;case"data":if(o!=="object"){uf(r,"data",u);break}case"src":case"href":if(u===""&&(o!=="a"||c!=="href")){r.removeAttribute(c);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(c);break}u=df(""+u),r.setAttribute(c,u);break;case"action":case"formAction":if(typeof u=="function"){r.setAttribute(c,"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"&&(c==="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(c);break}u=df(""+u),r.setAttribute(c,u);break;case"onClick":u!=null&&(r.onclick=Ts);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(c=u.__html,c!=null){if(m.children!=null)throw Error(s(60));r.innerHTML=c}}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}c=df(""+u),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);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(c,""+u):r.removeAttribute(c);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(c,""):r.removeAttribute(c);break;case"capture":case"download":u===!0?r.setAttribute(c,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(c,u):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?r.setAttribute(c,u):r.removeAttribute(c);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?r.removeAttribute(c):r.setAttribute(c,u);break;case"popover":et("beforetoggle",r),et("toggle",r),lf(r,"popover",u);break;case"xlinkActuate":Es(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Es(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Es(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Es(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Es(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Es(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Es(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Es(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Es(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":lf(r,"is",u);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=Tk.get(c)||c,lf(r,c,u))}}function _g(r,o,c,u,m,v){switch(c){case"style":jx(r,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(c=u.__html,c!=null){if(m.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"children":typeof u=="string"?ja(r,u):(typeof u=="number"||typeof u=="bigint")&&ja(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=Ts);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xx.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(m=c.endsWith("Capture"),o=c.slice(2,m?c.length-7:void 0),v=r[Un]||null,v=v!=null?v[c]:null,typeof v=="function"&&r.removeEventListener(o,v,m),typeof u=="function")){typeof v!="function"&&v!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(o,u,m);break e}c in r?r[c]=u:u===!0?r.setAttribute(c,""):lf(r,c,u)}}}function Tn(r,o,c){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 c)if(c.hasOwnProperty(v)){var E=c[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,c,null)}}m&&Tt(r,o,"srcSet",c.srcSet,c,null),u&&Tt(r,o,"src",c.src,c,null);return;case"input":et("invalid",r);var k=v=E=m=null,$=null,te=null;for(u in c)if(c.hasOwnProperty(u)){var ce=c[u];if(ce!=null)switch(u){case"name":m=ce;break;case"type":E=ce;break;case"checked":$=ce;break;case"defaultChecked":te=ce;break;case"value":v=ce;break;case"defaultValue":k=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,o));break;default:Tt(r,o,u,ce,c,null)}}Tx(r,v,k,$,te,E,m,!1);return;case"select":et("invalid",r),u=E=v=null;for(m in c)if(c.hasOwnProperty(m)&&(k=c[m],k!=null))switch(m){case"value":v=k;break;case"defaultValue":E=k;break;case"multiple":u=k;default:Tt(r,o,m,k,c,null)}o=v,c=E,r.multiple=!!u,o!=null?Na(r,!!u,o,!1):c!=null&&Na(r,!!u,c,!0);return;case"textarea":et("invalid",r),v=m=u=null;for(E in c)if(c.hasOwnProperty(E)&&(k=c[E],k!=null))switch(E){case"value":u=k;break;case"defaultValue":m=k;break;case"children":v=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(s(91));break;default:Tt(r,o,E,k,c,null)}Rx(r,u,m,v);return;case"option":for($ in c)c.hasOwnProperty($)&&(u=c[$],u!=null)&&($==="selected"?r.selected=u&&typeof u!="function"&&typeof u!="symbol":Tt(r,o,$,u,c,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<Hl.length;u++)et(Hl[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(te in c)if(c.hasOwnProperty(te)&&(u=c[te],u!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Tt(r,o,te,u,c,null)}return;default:if(Dp(o)){for(ce in c)c.hasOwnProperty(ce)&&(u=c[ce],u!==void 0&&_g(r,o,ce,u,c,void 0));return}}for(k in c)c.hasOwnProperty(k)&&(u=c[k],u!=null&&Tt(r,o,k,u,c,null))}function WO(r,o,c,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,k=null,$=null,te=null,ce=null;for(ie in c){var fe=c[ie];if(c.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 re in u){var ie=u[re];if(fe=c[re],u.hasOwnProperty(re)&&(ie!=null||fe!=null))switch(re){case"type":v=ie;break;case"name":m=ie;break;case"checked":te=ie;break;case"defaultChecked":ce=ie;break;case"value":E=ie;break;case"defaultValue":k=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,o));break;default:ie!==fe&&Tt(r,o,re,ie,u,fe)}}Ip(r,E,k,$,te,ce,v,m);return;case"select":ie=E=k=re=null;for(v in c)if($=c[v],c.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],$=c[m],u.hasOwnProperty(m)&&(v!=null||$!=null))switch(m){case"value":re=v;break;case"defaultValue":k=v;break;case"multiple":E=v;default:v!==$&&Tt(r,o,m,v,u,$)}o=k,c=E,u=ie,re!=null?Na(r,!!c,re,!1):!!u!=!!c&&(o!=null?Na(r,!!c,o,!0):Na(r,!!c,c?[]:"",!1));return;case"textarea":ie=re=null;for(k in c)if(m=c[k],c.hasOwnProperty(k)&&m!=null&&!u.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Tt(r,o,k,null,u,m)}for(E in u)if(m=u[E],v=c[E],u.hasOwnProperty(E)&&(m!=null||v!=null))switch(E){case"value":re=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)}Cx(r,re,ie);return;case"option":for(var Re in c)re=c[Re],c.hasOwnProperty(Re)&&re!=null&&!u.hasOwnProperty(Re)&&(Re==="selected"?r.selected=!1:Tt(r,o,Re,null,u,re));for($ in u)re=u[$],ie=c[$],u.hasOwnProperty($)&&re!==ie&&(re!=null||ie!=null)&&($==="selected"?r.selected=re&&typeof re!="function"&&typeof re!="symbol":Tt(r,o,$,re,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 $e in c)re=c[$e],c.hasOwnProperty($e)&&re!=null&&!u.hasOwnProperty($e)&&Tt(r,o,$e,null,u,re);for(te in u)if(re=u[te],ie=c[te],u.hasOwnProperty(te)&&re!==ie&&(re!=null||ie!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(s(137,o));break;default:Tt(r,o,te,re,u,ie)}return;default:if(Dp(o)){for(var Ct in c)re=c[Ct],c.hasOwnProperty(Ct)&&re!==void 0&&!u.hasOwnProperty(Ct)&&_g(r,o,Ct,void 0,u,re);for(ce in u)re=u[ce],ie=c[ce],!u.hasOwnProperty(ce)||re===ie||re===void 0&&ie===void 0||_g(r,o,ce,re,u,ie);return}}for(var G in c)re=c[G],c.hasOwnProperty(G)&&re!=null&&!u.hasOwnProperty(G)&&Tt(r,o,G,null,u,re);for(fe in u)re=u[fe],ie=c[fe],!u.hasOwnProperty(fe)||re===ie||re==null&&ie==null||Tt(r,o,fe,re,u,ie)}function A_(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function JO(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,c=performance.getEntriesByType("resource"),u=0;u<c.length;u++){var m=c[u],v=m.transferSize,E=m.initiatorType,k=m.duration;if(v&&k&&A_(E)){for(E=0,k=m.responseEnd,u+=1;u<c.length;u++){var $=c[u],te=$.startTime;if(te>k)break;var ce=$.transferSize,fe=$.initiatorType;ce&&A_(fe)&&($=$.responseEnd,E+=ce*($<k?1:(k-te)/($-te)))}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 wg=null,Eg=null;function ad(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 O_(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 Tg(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 Cg=null;function eM(){var r=window.event;return r&&r.type==="popstate"?r===Cg?!1:(Cg=r,!0):(Cg=null,!1)}var M_=typeof setTimeout=="function"?setTimeout:void 0,tM=typeof clearTimeout=="function"?clearTimeout:void 0,I_=typeof Promise=="function"?Promise:void 0,nM=typeof queueMicrotask=="function"?queueMicrotask:typeof I_<"u"?function(r){return I_.resolve(null).then(r).catch(rM)}:M_;function rM(r){setTimeout(function(){throw r})}function ko(r){return r==="head"}function P_(r,o){var c=o,u=0;do{var m=c.nextSibling;if(r.removeChild(c),m&&m.nodeType===8)if(c=m.data,c==="/$"||c==="/&"){if(u===0){r.removeChild(m),ic(o);return}u--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")u++;else if(c==="html")Vl(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,Vl(c);for(var v=c.firstChild;v;){var E=v.nextSibling,k=v.nodeName;v[ll]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&v.rel.toLowerCase()==="stylesheet"||c.removeChild(v),v=E}}else c==="body"&&Vl(r.ownerDocument.body);c=m}while(c);ic(o)}function D_(r,o){var c=r;r=0;do{var u=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),u&&u.nodeType===8)if(c=u.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=u}while(c)}function Rg(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Rg(c),Op(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function sM(r,o,c,u){for(;r.nodeType===1;){var m=c;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!u&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(u){if(!r[ll])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=Mr(r.nextSibling),r===null)break}return null}function oM(r,o,c){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Mr(r.nextSibling),r===null))return null;return r}function z_(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=Mr(r.nextSibling),r===null))return null;return r}function Ng(r){return r.data==="$?"||r.data==="$~"}function jg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function iM(r,o){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||c.readyState!=="loading")o();else{var u=function(){o(),c.removeEventListener("DOMContentLoaded",u)};c.addEventListener("DOMContentLoaded",u),r._reactRetry=u}}function Mr(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 Ag=null;function L_(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(o===0)return Mr(r.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}r=r.nextSibling}return null}function U_(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return r;o--}else c!=="/$"&&c!=="/&"||o++}r=r.previousSibling}return null}function $_(r,o,c){switch(o=ad(c),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 Vl(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Op(r)}var Ir=new Map,B_=new Set;function cd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Bs=V.d;V.d={f:aM,r:cM,D:lM,C:uM,L:fM,m:dM,X:pM,S:hM,M:mM};function aM(){var r=Bs.f(),o=Jf();return r||o}function cM(r){var o=Ta(r);o!==null&&o.tag===5&&o.type==="form"?sS(o):Bs.r(r)}var rc=typeof document>"u"?null:document;function F_(r,o,c){var u=rc;if(u&&typeof o=="string"&&o){var m=Cr(o);m='link[rel="'+r+'"][href="'+m+'"]',typeof c=="string"&&(m+='[crossorigin="'+c+'"]'),B_.has(m)||(B_.add(m),r={rel:r,crossOrigin:c,href:o},u.querySelector(m)===null&&(o=u.createElement("link"),Tn(o,"link",r),bn(o),u.head.appendChild(o)))}}function lM(r){Bs.D(r),F_("dns-prefetch",r,null)}function uM(r,o){Bs.C(r,o),F_("preconnect",r,o)}function fM(r,o,c){Bs.L(r,o,c);var u=rc;if(u&&r&&o){var m='link[rel="preload"][as="'+Cr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(m+='[imagesrcset="'+Cr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(m+='[imagesizes="'+Cr(c.imageSizes)+'"]')):m+='[href="'+Cr(r)+'"]';var v=m;switch(o){case"style":v=sc(r);break;case"script":v=oc(r)}Ir.has(v)||(r=y({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:r,as:o},c),Ir.set(v,r),u.querySelector(m)!==null||o==="style"&&u.querySelector(Kl(v))||o==="script"&&u.querySelector(Gl(v))||(o=u.createElement("link"),Tn(o,"link",r),bn(o),u.head.appendChild(o)))}}function dM(r,o){Bs.m(r,o);var c=rc;if(c&&r){var u=o&&typeof o.as=="string"?o.as:"script",m='link[rel="modulepreload"][as="'+Cr(u)+'"][href="'+Cr(r)+'"]',v=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=oc(r)}if(!Ir.has(v)&&(r=y({rel:"modulepreload",href:r},o),Ir.set(v,r),c.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Gl(v)))return}u=c.createElement("link"),Tn(u,"link",r),bn(u),c.head.appendChild(u)}}}function hM(r,o,c){Bs.S(r,o,c);var u=rc;if(u&&r){var m=Ca(u).hoistableStyles,v=sc(r);o=o||"default";var E=m.get(v);if(!E){var k={loading:0,preload:null};if(E=u.querySelector(Kl(v)))k.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":o},c),(c=Ir.get(v))&&kg(r,c);var $=E=u.createElement("link");bn($),Tn($,"link",r),$._p=new Promise(function(te,ce){$.onload=te,$.onerror=ce}),$.addEventListener("load",function(){k.loading|=1}),$.addEventListener("error",function(){k.loading|=2}),k.loading|=4,ld(E,o,u)}E={type:"stylesheet",instance:E,count:1,state:k},m.set(v,E)}}}function pM(r,o){Bs.X(r,o);var c=rc;if(c&&r){var u=Ca(c).hoistableScripts,m=oc(r),v=u.get(m);v||(v=c.querySelector(Gl(m)),v||(r=y({src:r,async:!0},o),(o=Ir.get(m))&&Og(r,o),v=c.createElement("script"),bn(v),Tn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function mM(r,o){Bs.M(r,o);var c=rc;if(c&&r){var u=Ca(c).hoistableScripts,m=oc(r),v=u.get(m);v||(v=c.querySelector(Gl(m)),v||(r=y({src:r,async:!0,type:"module"},o),(o=Ir.get(m))&&Og(r,o),v=c.createElement("script"),bn(v),Tn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function H_(r,o,c,u){var m=(m=se.current)?cd(m):null;if(!m)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=sc(c.href),c=Ca(m).hoistableStyles,u=c.get(o),u||(u={type:"style",instance:null,count:0,state:null},c.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=sc(c.href);var v=Ca(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(Kl(r)))&&!v._p&&(E.instance=v,E.state.loading=5),Ir.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Ir.set(r,c),v||gM(m,r,c,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=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=oc(c),c=Ca(m).hoistableScripts,u=c.get(o),u||(u={type:"script",instance:null,count:0,state:null},c.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function sc(r){return'href="'+Cr(r)+'"'}function Kl(r){return'link[rel="stylesheet"]['+r+"]"}function q_(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function gM(r,o,c,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}),Tn(o,"link",c),bn(o),r.head.appendChild(o))}function oc(r){return'[src="'+Cr(r)+'"]'}function Gl(r){return"script[async]"+r}function V_(r,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var u=r.querySelector('style[data-href~="'+Cr(c.href)+'"]');if(u)return o.instance=u,bn(u),u;var m=y({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),bn(u),Tn(u,"style",m),ld(u,c.precedence,r),o.instance=u;case"stylesheet":m=sc(c.href);var v=r.querySelector(Kl(m));if(v)return o.state.loading|=4,o.instance=v,bn(v),v;u=q_(c),(m=Ir.get(m))&&kg(u,m),v=(r.ownerDocument||r).createElement("link"),bn(v);var E=v;return E._p=new Promise(function(k,$){E.onload=k,E.onerror=$}),Tn(v,"link",u),o.state.loading|=4,ld(v,c.precedence,r),o.instance=v;case"script":return v=oc(c.src),(m=r.querySelector(Gl(v)))?(o.instance=m,bn(m),m):(u=c,(m=Ir.get(v))&&(u=y({},c),Og(u,m)),r=r.ownerDocument||r,m=r.createElement("script"),bn(m),Tn(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,ld(u,c.precedence,r));return o.instance}function ld(r,o,c){for(var u=c.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 k=u[E];if(k.dataset.precedence===o)v=k;else if(v!==m)break}v?v.parentNode.insertBefore(r,v.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(r,o.firstChild))}function kg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function Og(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var ud=null;function K_(r,o,c){if(ud===null){var u=new Map,m=ud=new Map;m.set(c,u)}else m=ud,u=m.get(c),u||(u=new Map,m.set(c,u));if(u.has(r))return u;for(u.set(r,null),c=c.getElementsByTagName(r),m=0;m<c.length;m++){var v=c[m];if(!(v[ll]||v[Sn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var E=v.getAttribute(o)||"";E=r+E;var k=u.get(E);k?k.push(v):u.set(E,[v])}}return u}function G_(r,o,c){r=r.ownerDocument||r,r.head.insertBefore(c,o==="title"?r.querySelector("head > title"):null)}function yM(r,o,c){if(c===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 Z_(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function vM(r,o,c,u){if(c.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var m=sc(u.href),v=o.querySelector(Kl(m));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=fd.bind(r),o.then(r,r)),c.state.loading|=4,c.instance=v,bn(v);return}v=o.ownerDocument||o,u=q_(u),(m=Ir.get(m))&&kg(u,m),v=v.createElement("link"),bn(v);var E=v;E._p=new Promise(function(k,$){E.onload=k,E.onerror=$}),Tn(v,"link",u),c.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=fd.bind(r),o.addEventListener("load",c),o.addEventListener("error",c))}}var Mg=0;function bM(r,o){return r.stylesheets&&r.count===0&&hd(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var u=setTimeout(function(){if(r.stylesheets&&hd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+o);0<r.imgBytes&&Mg===0&&(Mg=62500*JO());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&hd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Mg?50:800)+o);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function fd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var dd=null;function hd(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,dd=new Map,o.forEach(xM,r),dd=null,fd.call(r))}function xM(r,o){if(!(o.state.loading&4)){var c=dd.get(r);if(c)var u=c.get(null);else{c=new Map,dd.set(r,c);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")&&(c.set(E.dataset.precedence,E),u=E)}u&&c.set(null,u)}m=o.instance,E=m.getAttribute("data-precedence"),v=c.get(E)||u,v===u&&c.set(null,m),c.set(E,m),this.count++,u=fd.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 Zl={$$typeof:N,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function SM(r,o,c,u,m,v,E,k,$){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=Ei(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ei(0),this.hiddenUpdates=Ei(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 Y_(r,o,c,u,m,v,E,k,$,te,ce,fe){return r=new SM(r,o,c,E,$,te,ce,fe,k),o=1,v===!0&&(o|=24),v=sr(3,null,null,o),r.current=v,v.stateNode=r,o=dm(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:c,cache:o},gm(v),r}function X_(r){return r?(r=Da,r):Da}function Q_(r,o,c,u,m,v){m=X_(m),u.context===null?u.context=m:u.pendingContext=m,u=xo(o),u.payload={element:c},v=v===void 0?null:v,v!==null&&(u.callback=v),c=So(r,u,o),c!==null&&(Vn(c,r,o),Cl(c,r,o))}function W_(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<o?c:o}}function Ig(r,o){W_(r,o),(r=r.alternate)&&W_(r,o)}function J_(r){if(r.tag===13||r.tag===31){var o=ji(r,67108864);o!==null&&Vn(o,r,67108864),Ig(r,67108864)}}function ew(r){if(r.tag===13||r.tag===31){var o=lr();o=nr(o);var c=ji(r,o);c!==null&&Vn(c,r,o),Ig(r,o)}}var pd=!0;function _M(r,o,c,u){var m=D.T;D.T=null;var v=V.p;try{V.p=2,Pg(r,o,c,u)}finally{V.p=v,D.T=m}}function wM(r,o,c,u){var m=D.T;D.T=null;var v=V.p;try{V.p=8,Pg(r,o,c,u)}finally{V.p=v,D.T=m}}function Pg(r,o,c,u){if(pd){var m=Dg(u);if(m===null)Sg(r,o,u,md,c),nw(r,u);else if(TM(m,r,o,c,u))u.stopPropagation();else if(nw(r,u),o&4&&-1<EM.indexOf(r)){for(;m!==null;){var v=Ta(m);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var E=An(v.pendingLanes);if(E!==0){var k=v;for(k.pendingLanes|=2,k.entangledLanes|=2;E;){var $=1<<31-xt(E);k.entanglements[1]|=$,E&=~$}hs(v),(gt&6)===0&&(Qf=Be()+500,Fl(0))}}break;case 31:case 13:k=ji(v,2),k!==null&&Vn(k,v,2),Jf(),Ig(v,2)}if(v=Dg(u),v===null&&Sg(r,o,u,md,c),v===m)break;m=v}m!==null&&u.stopPropagation()}else Sg(r,o,u,null,c)}}function Dg(r){return r=Lp(r),zg(r)}var md=null;function zg(r){if(md=null,r=Ea(r),r!==null){var o=a(r);if(o===null)r=null;else{var c=o.tag;if(c===13){if(r=l(o),r!==null)return r;r=null}else if(c===31){if(r=f(o),r!==null)return r;r=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return md=r,null}function tw(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 He:return 2;case me:return 8;case Te:case qe:return 32;case mt:return 268435456;default:return 32}default:return 32}}var Lg=!1,Oo=null,Mo=null,Io=null,Yl=new Map,Xl=new Map,Po=[],EM="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 nw(r,o){switch(r){case"focusin":case"focusout":Oo=null;break;case"dragenter":case"dragleave":Mo=null;break;case"mouseover":case"mouseout":Io=null;break;case"pointerover":case"pointerout":Yl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xl.delete(o.pointerId)}}function Ql(r,o,c,u,m,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:c,eventSystemFlags:u,nativeEvent:v,targetContainers:[m]},o!==null&&(o=Ta(o),o!==null&&J_(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,m!==null&&o.indexOf(m)===-1&&o.push(m),r)}function TM(r,o,c,u,m){switch(o){case"focusin":return Oo=Ql(Oo,r,o,c,u,m),!0;case"dragenter":return Mo=Ql(Mo,r,o,c,u,m),!0;case"mouseover":return Io=Ql(Io,r,o,c,u,m),!0;case"pointerover":var v=m.pointerId;return Yl.set(v,Ql(Yl.get(v)||null,r,o,c,u,m)),!0;case"gotpointercapture":return v=m.pointerId,Xl.set(v,Ql(Xl.get(v)||null,r,o,c,u,m)),!0}return!1}function rw(r){var o=Ea(r.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){r.blockedOn=o,cf(r.priority,function(){ew(c)});return}}else if(o===31){if(o=f(c),o!==null){r.blockedOn=o,cf(r.priority,function(){ew(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function gd(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var c=Dg(r.nativeEvent);if(c===null){c=r.nativeEvent;var u=new c.constructor(c.type,c);zp=u,c.target.dispatchEvent(u),zp=null}else return o=Ta(c),o!==null&&J_(o),r.blockedOn=c,!1;o.shift()}return!0}function sw(r,o,c){gd(r)&&c.delete(o)}function CM(){Lg=!1,Oo!==null&&gd(Oo)&&(Oo=null),Mo!==null&&gd(Mo)&&(Mo=null),Io!==null&&gd(Io)&&(Io=null),Yl.forEach(sw),Xl.forEach(sw)}function yd(r,o){r.blockedOn===o&&(r.blockedOn=null,Lg||(Lg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,CM)))}var vd=null;function ow(r){vd!==r&&(vd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){vd===r&&(vd=null);for(var o=0;o<r.length;o+=3){var c=r[o],u=r[o+1],m=r[o+2];if(typeof u!="function"){if(zg(u||c)===null)continue;break}var v=Ta(c);v!==null&&(r.splice(o,3),o-=3,Dm(v,{pending:!0,data:m,method:c.method,action:u},u,m))}}))}function ic(r){function o($){return yd($,r)}Oo!==null&&yd(Oo,r),Mo!==null&&yd(Mo,r),Io!==null&&yd(Io,r),Yl.forEach(o),Xl.forEach(o);for(var c=0;c<Po.length;c++){var u=Po[c];u.blockedOn===r&&(u.blockedOn=null)}for(;0<Po.length&&(c=Po[0],c.blockedOn===null);)rw(c),c.blockedOn===null&&Po.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(u=0;u<c.length;u+=3){var m=c[u],v=c[u+1],E=m[Un]||null;if(typeof v=="function")E||ow(c);else if(E){var k=null;if(v&&v.hasAttribute("formAction")){if(m=v,E=v[Un]||null)k=E.formAction;else if(zg(m)!==null)continue}else k=E.action;typeof k=="function"?c[u+1]=k:(c.splice(u,3),u-=3),ow(c)}}}function iw(){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(c,20)}function c(){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(c,100),function(){u=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),m!==null&&(m(),m=null)}}}function Ug(r){this._internalRoot=r}bd.prototype.render=Ug.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(s(409));var c=o.current,u=lr();Q_(c,u,r,o,null,null)},bd.prototype.unmount=Ug.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;Q_(r.current,2,null,r,null,null),Jf(),o[wa]=null}};function bd(r){this._internalRoot=r}bd.prototype.unstable_scheduleHydration=function(r){if(r){var o=af();r={blockedOn:null,target:r,priority:o};for(var c=0;c<Po.length&&o!==0&&o<Po[c].priority;c++);Po.splice(c,0,r),c===0&&rw(r)}};var aw=t.version;if(aw!=="19.2.4")throw Error(s(527,aw,"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 RM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xd.isDisabled&&xd.supportsFiber)try{Er=xd.inject(RM),Qt=xd}catch{}}return eu.createRoot=function(r,o){if(!i(r))throw Error(s(299));var c=!1,u="",m=pS,v=mS,E=gS;return o!=null&&(o.unstable_strictMode===!0&&(c=!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=Y_(r,1,!1,null,null,c,u,null,m,v,E,iw),r[wa]=o.current,xg(r),new Ug(o)},eu.hydrateRoot=function(r,o,c){if(!i(r))throw Error(s(299));var u=!1,m="",v=pS,E=mS,k=gS,$=null;return c!=null&&(c.unstable_strictMode===!0&&(u=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(v=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(k=c.onRecoverableError),c.formState!==void 0&&($=c.formState)),o=Y_(r,1,!0,o,c??null,u,m,$,v,E,k,iw),o.context=X_(null),c=o.current,u=lr(),u=nr(u),m=xo(u),m.callback=null,So(c,m,u),c=u,o.current.lanes=c,ws(o,c),hs(o),r[wa]=o.current,xg(r),new bd(o)},eu.version="19.2.4",eu}var ZE;function o6(){if(ZE)return iy.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(),iy.exports=s6(),iy.exports}var i6=o6(),Jc=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(){}},a6={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},c6=class{#e=a6;#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)}},Zi=new c6;function l6(e){setTimeout(e,0)}var ca=typeof window>"u"||"Deno"in globalThis;function Mn(){}function u6(e,t){return typeof e=="function"?e(t):e}function mv(e){return typeof e=="number"&&e>=0&&e!==1/0}function mN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Yo(e,t){return typeof e=="function"?e(t):e}function zr(e,t){return typeof e=="function"?e(t):e}function YE(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:a,queryKey:l,stale:f}=e;if(l){if(s){if(t.queryHash!==Cb(l,t.options))return!1}else if(!Eu(t.queryKey,l))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 XE(e,t){const{exact:n,status:s,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(la(t.options.mutationKey)!==la(a))return!1}else if(!Eu(t.options.mutationKey,a))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function Cb(e,t){return(t?.queryKeyHashFn||la)(e)}function la(e){return JSON.stringify(e,(t,n)=>gv(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Eu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Eu(e[n],t[n])):!1}var f6=Object.prototype.hasOwnProperty;function gN(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=QE(e)&&QE(t);if(!s&&!(gv(e)&&gv(t)))return t;const a=(s?e:Object.keys(e)).length,l=s?t:Object.keys(t),f=l.length,d=s?new Array(f):{};let p=0;for(let g=0;g<f;g++){const y=s?g:l[g],b=e[y],x=t[y];if(b===x){d[y]=b,(s?g<a:f6.call(e,y))&&p++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){d[y]=x;continue}const S=gN(b,x,n+1);d[y]=S,S===b&&p++}return a===f&&p===a?e:d}function Nh(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 QE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gv(e){if(!WE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!WE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function WE(e){return Object.prototype.toString.call(e)==="[object Object]"}function d6(e){return new Promise(t=>{Zi.setTimeout(t,e)})}function yv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?gN(e,t):t}function h6(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function p6(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Rb=Symbol();function yN(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Rb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Nb(e,t){return typeof e=="function"?e(...t):!!e}function m6(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 g6=class extends Jc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ca&&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"}},jb=new g6;function vv(){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 y6=l6;function v6(){let e=[],t=0,n=f=>{f()},s=f=>{f()},i=y6;const a=f=>{t?e.push(f):i(()=>{n(f)})},l=()=>{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||l()}return d},batchCalls:f=>(...d)=>{a(()=>{f(...d)})},schedule:a,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{i=f}}}var pn=v6(),b6=class extends Jc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ca&&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}},jh=new b6;function x6(e){return Math.min(1e3*2**e,3e4)}function vN(e){return(e??"online")==="online"?jh.isOnline():!0}var bv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function bN(e){let t=!1,n=0,s;const i=vv(),a=()=>i.status!=="pending",l=w=>{if(!a()){const T=new bv(w);b(T),e.onCancel?.(T)}},f=()=>{t=!0},d=()=>{t=!1},p=()=>jb.isFocused()&&(e.networkMode==="always"||jh.isOnline())&&e.canRun(),g=()=>vN(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 O=e.retry??(ca?0:3),N=e.retryDelay??x6,R=typeof N=="function"?N(n,C):N,M=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,C);if(t||!M){b(C);return}n++,e.onFail?.(n,C),d6(R).then(()=>p()?void 0:x()).then(()=>{t?b(C):S()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(s?.(),i),cancelRetry:f,continueRetry:d,canStart:g,start:()=>(g()?S():x().then(S),i)}}var xN=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mv(this.gcTime)&&(this.#e=Zi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ca?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Zi.clearTimeout(this.#e),this.#e=void 0)}},S6=class extends xN{#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=eT(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=eT(this.options);t.data!==void 0&&(this.setState(JE(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=yv(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(Mn).catch(Mn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>zr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Rb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Yo(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:!mN(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=yN(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)},l=(()=>{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(l,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#o({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=bN({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:f=>{f instanceof bv&&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:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.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 bv){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,...SN(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...JE(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),pn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function SN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function JE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function eT(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 _6=class extends Jc{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=vv(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#i;#a;#o;#m;#d;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),tT(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xv(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 zr(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&&!Nh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&nT(this.#t,n,this.options,t)&&this.#f(),this.updateResult(),s&&(this.#t!==n||zr(this.options.enabled,this.#t)!==zr(t.enabled,this.#t)||Yo(this.options.staleTime,this.#t)!==Yo(t.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||zr(this.options.enabled,this.#t)!==zr(t.enabled,this.#t)||i!==this.#c)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return E6(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(Mn)),t}#g(){this.#x();const e=Yo(this.options.staleTime,this.#t);if(ca||this.#s.isStale||!mv(e))return;const n=mN(this.#s.dataUpdatedAt,e)+1;this.#l=Zi.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.#c=e,!(ca||zr(this.options.enabled,this.#t)===!1||!mv(this.#c)||this.#c===0)&&(this.#u=Zi.setInterval(()=>{(this.options.refetchIntervalInBackground||jb.isFocused())&&this.#f()},this.#c))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#l&&(Zi.clearTimeout(this.#l),this.#l=void 0)}#S(){this.#u&&(Zi.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,s=this.options,i=this.#s,a=this.#r,l=this.#i,d=e!==n?e.state:this.#n,{state:p}=e;let g={...p},y=!1,b;if(t._optimisticResults){const A=this.hasListeners(),P=!A&&tT(e,t),Z=A&&nT(e,n,t,s);(P||Z)&&(g={...g,...SN(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 A;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(A=i.data,T=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,A!==void 0&&(w="success",b=yv(i?.data,A,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=yv(i?.data,b,t),this.#d=b,this.#o=null}catch(A){this.#o=A}this.#o&&(x=this.#o,b=this.#d,S=Date.now(),w="error");const C=g.fetchStatus==="fetching",O=w==="pending",N=w==="error",R=O&&C,M=b!==void 0,j={status:w,fetchStatus:g.fetchStatus,isPending:O,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&&!O,isLoadingError:N&&!M,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:N&&M,isStale:Ab(e,t),refetch:this.refetch,promise:this.#a,isEnabled:zr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=j.data!==void 0,P=j.status==="error"&&!A,Z=Q=>{P?Q.reject(j.error):A&&Q.resolve(j.data)},B=()=>{const Q=this.#a=j.promise=vv();Z(Q)},z=this.#a;switch(z.status){case"pending":e.queryHash===n.queryHash&&Z(z);break;case"fulfilled":(P||j.data!==z.value)&&B();break;case"rejected":(!P||j.error!==z.reason)&&B();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),Nh(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(l=>{const f=l;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){pn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function w6(e,t){return zr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function tT(e,t){return w6(e,t)||e.state.data!==void 0&&xv(e,t,t.refetchOnMount)}function xv(e,t,n){if(zr(t.enabled,e)!==!1&&Yo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&Ab(e,t)}return!1}function nT(e,t,n,s){return(e!==t||zr(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ab(e,n)}function Ab(e,t){return zr(t.enabled,e)!==!1&&e.isStaleByTime(Yo(t.staleTime,e))}function E6(e,t){return!Nh(e.getCurrentResult(),t)}function rT(e){return{onFetch:(t,n)=>{const s=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},d=0;const p=async()=>{let g=!1;const y=S=>{m6(S,()=>t.signal,()=>g=!0)},b=yN(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 O=(()=>{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(O),{maxPages:R}=t.options,M=T?p6:h6;return{pages:M(S.pages,N,R),pageParams:M(S.pageParams,w,R)}};if(i&&a.length){const S=i==="backward",w=S?T6:sT,T={pages:a,pageParams:l},C=w(s,T);f=await x(T,C,S)}else{const S=e??a.length;do{const w=d===0?l[0]??s.initialPageParam:sT(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 sT(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 T6(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var C6=class extends xN{#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||_N(),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=bN({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#r({type:"failed",failureCount:a,error:l})},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 l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,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(l){Promise.reject(l)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(l){Promise.reject(l)}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),pn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function _N(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var R6=class extends Jc{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 C6({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=Ad(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=Ad(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=Ad(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=Ad(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){pn.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=>XE(t,n))}findAll(e={}){return this.getAll().filter(t=>XE(e,t))}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return pn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Mn))))}};function Ad(e){return e.options.scope?.id}var N6=class extends Jc{#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),Nh(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&la(n.mutationKey)!==la(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??_N();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){pn.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)})})}},j6=class extends Jc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,i=t.queryHash??Cb(s,t);let a=this.get(i);return a||(a=new S6({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(){pn.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=>YE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>YE(e,n)):t}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},A6=class{#e;#t;#n;#s;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new j6,this.#t=e.mutationCache||new R6,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=jb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=jh.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(Yo(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,l=u6(t,a);if(l!==void 0)return this.#e.build(this,s).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return pn.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;pn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return pn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=pn.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(Mn).catch(Mn)}invalidateQueries(e,t={}){return pn.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=pn.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(Mn)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(Mn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Yo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mn).catch(Mn)}fetchInfiniteQuery(e){return e.behavior=rT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mn).catch(Mn)}ensureInfiniteQueryData(e){return e.behavior=rT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return jh.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(la(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{Eu(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(la(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{Eu(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=Cb(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===Rb&&(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()}},wN=_.createContext(void 0),_r=e=>{const t=_.useContext(wN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},k6=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(wN.Provider,{value:e,children:t})),EN=_.createContext(!1),O6=()=>_.useContext(EN);EN.Provider;function M6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var I6=_.createContext(M6()),P6=()=>_.useContext(I6),D6=(e,t,n)=>{const s=n?.state.error&&typeof e.throwOnError=="function"?Nb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},z6=e=>{_.useEffect(()=>{e.clearReset()},[e])},L6=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||Nb(n,[e.error,s])),U6=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))}},$6=(e,t)=>e.isLoading&&e.isFetching&&!t,B6=(e,t)=>e?.suspense&&t.isPending,oT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function F6(e,t,n){const s=O6(),i=P6(),a=_r(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const f=a.getQueryCache().get(l.queryHash);l._optimisticResults=s?"isRestoring":"optimistic",U6(l),D6(l,i,f),z6(i);const d=!a.getQueryCache().get(l.queryHash),[p]=_.useState(()=>new t(a,l)),g=p.getOptimisticResult(l),y=!s&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const x=y?p.subscribe(pn.batchCalls(b)):Mn;return p.updateResult(),x},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),_.useEffect(()=>{p.setOptions(l)},[l,p]),B6(l,g))throw oT(l,p,i);if(L6({result:g,errorResetBoundary:i,throwOnError:l.throwOnError,query:f,suspense:l.suspense}))throw g.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,g),l.experimental_prefetchInRender&&!ca&&$6(g,s)&&(d?oT(l,p,i):f?.promise)?.catch(Mn).finally(()=>{p.updateResult()}),l.notifyOnChangeProps?g:p.trackResult(g)}function Wn(e,t){return F6(e,_6)}function is(e,t){const n=_r(),[s]=_.useState(()=>new N6(n,e));_.useEffect(()=>{s.setOptions(e)},[s,e]);const i=_.useSyncExternalStore(_.useCallback(l=>s.subscribe(pn.batchCalls(l)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=_.useCallback((l,f)=>{s.mutate(l,f).catch(Mn)},[s]);if(i.error&&Nb(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var $t=(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))($t||{});function TN({update:e,notify:t,unwatched:n}){return{link:s,unlink:i,propagate:a,checkDirty:l,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 l(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 O=p.nextDep;if(O!==void 0){p=O;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 kb=0,Hi=0,fu=0;const Ks=[],{link:xQ,unlink:CN,propagate:SQ,checkDirty:H6,shallowPropagate:_Q}=TN({update(e){return e.depsTail!==void 0?G6(e):Z6(e)},notify(e){let t=fu,n=t;do if(Ks[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(fu=t;n<--t;){const s=Ks[n];Ks[n++]=Ks[t],Ks[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,up(e)):Q6.call(e)}});function q6(){return kb}function V6(){++kb}function K6(){--kb||X6()}function G6(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,up(e)}}function Z6(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Y6(e){const t=e.flags;if(t&16||t&32&&H6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,up(e)}}else e.flags=2}function X6(){try{for(;Hi<fu;){const e=Ks[Hi];Ks[Hi++]=void 0,Y6(e)}}finally{for(;Hi<fu;){const e=Ks[Hi];Ks[Hi++]=void 0,e.flags|=10}Hi=0,fu=0}}function Q6(){this.depsTail=void 0,this.flags=0,up(this);const e=this.subs;e!==void 0&&CN(e)}function up(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=CN(n,e)}function RN(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 Sv=[];let sh=0;const{link:iT,unlink:W6,propagate:J6,checkDirty:NN,shallowPropagate:aT}=TN({update(e){return e._update()},notify(e){Sv[_v++]=e,e.flags&=~$t.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=$t.Mutable|$t.Dirty,Ah(e))}});let kd=0,_v=0,gs;function Ah(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=W6(n,e)}function jN(){if(!(q6()>0)){for(;kd<_v;){const e=Sv[kd];Sv[kd++]=void 0,e.notify()}kd=0,_v=0}}function eF(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?$t.None:$t.Mutable,get(){return gs!==void 0&&iT(i,gs,sh),i._snapshot},subscribe(a){const l=RN(a),f={current:!1},d=tF(()=>{i.get(),f.current?l.next?.(i._snapshot):f.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=gs,f=Object.is;gs=i,++sh,i.depsTail=void 0,n&&(i.flags=$t.Mutable|$t.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{gs=l,n&&(i.flags&=~$t.RecursedCheck),Ah(i)}}};return n?(i.flags=$t.Mutable|$t.Dirty,i.get=function(){const a=i.flags;if(a&$t.Dirty||a&$t.Pending&&NN(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&aT(l)}}else a&$t.Pending&&(i.flags=a&~$t.Pending);return gs!==void 0&&iT(i,gs,sh),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(J6(l),aT(l),jN())}},i}function tF(e){const t=()=>{const s=gs;gs=n,++sh,n.depsTail=void 0,n.flags=$t.Watching|$t.RecursedCheck;try{return e()}finally{gs=s,n.flags&=~$t.RecursedCheck,Ah(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:$t.Watching|$t.RecursedCheck,notify(){const s=this.flags;s&$t.Dirty||s&$t.Pending&&NN(this.deps,this)?t():this.flags=$t.Watching},stop(){this.flags=$t.None,this.depsTail=void 0,Ah(this)}};return t(),n}let nF=class{constructor(t){this.atom=eF(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(RN(t))}};function rF(e){try{V6(),e()}finally{K6(),jN()}}const Xo="__TSR_index",cT="popstate",lT="beforeunload";function sF(e){let t=e.getLocation();const n=new Set,s=l=>{t=e.getLocation(),n.forEach(f=>f({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?s(l):t=e.getLocation()},a=async({task:l,navigateOpts:f,...d})=>{if(f?.ignoreBlocker??!1){l();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=kh(d.path,d.state);if(await b.blockerFn({currentLocation:t,nextLocation:x,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,f,d)=>{const p=t.state[Xo];f=uT(p+1,f),a({task:()=>{e.pushState(l,f),s({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:f})},replace:(l,f,d)=>{const p=t.state[Xo];f=uT(p,f),a({task:()=>{e.replaceState(l,f),s({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:f})},go:(l,f)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:f,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Xo]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(p=>p!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function uT(e,t){t||(t={});const n=Ob();return{...t,key:n,__TSR_key:n,[Xo]:e}}function oF(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let i=[];const a=()=>i,l=A=>i=A,f=(A=>A),d=(()=>kh(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=Ob();t.history.replaceState({[Xo]:0,key:A,__TSR_key:A},"")}let p=d(),g,y=!1,b=!1,x=!1,S=!1;const w=()=>p;let T,C;const O=()=>{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=(A,P,Z)=>{const B=f(P);C||(g=p),p=kh(P,Z),T={href:B,state:Z,isPush:T?.isPush||A==="push"},C||(C=Promise.resolve().then(()=>O()))},R=A=>{p=d(),j.notify({type:A})},M=async()=>{if(b){b=!1;return}const A=d(),P=A.state[Xo]-p.state[Xo],Z=P===1,B=P===-1,z=!Z&&!B||y;y=!1;const Q=z?"GO":B?"BACK":"FORWARD",Y=z?{type:"GO",index:P}:{type:B?"BACK":"FORWARD"};if(x)x=!1;else{const ee=a();if(typeof document<"u"&&ee.length){for(const D of ee)if(await D.blockerFn({currentLocation:p,nextLocation:A,action:Q})){b=!0,t.history.go(1),j.notify(Y);return}}}p=d(),j.notify(Y)},L=A=>{if(S){S=!1;return}let P=!1;const Z=a();if(typeof document<"u"&&Z.length)for(const B of Z){const z=B.enableBeforeUnload??!0;if(z===!0){P=!0;break}if(typeof z=="function"&&z()===!0){P=!0;break}}if(P)return A.preventDefault(),A.returnValue=""},j=sF({getLocation:w,getLength:()=>t.history.length,pushState:(A,P)=>N("push",A,P),replaceState:(A,P)=>N("replace",A,P),back:A=>(A&&(x=!0),S=!0,t.history.back()),forward:A=>{A&&(x=!0),S=!0,t.history.forward()},go:A=>{y=!0,t.history.go(A)},createHref:A=>f(A),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(lT,L,{capture:!0}),t.removeEventListener(cT,M)},onBlocked:()=>{g&&p!==g&&(p=g)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(lT,L,{capture:!0}),t.addEventListener(cT,M),t.history.pushState=function(...A){const P=n.apply(t.history,A);return j._ignoreSubscribers||R("PUSH"),P},t.history.replaceState=function(...A){const P=s.apply(t.history,A);return j._ignoreSubscribers||R("REPLACE"),P},j}function iF(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function kh(e,t){const n=iF(e),s=n.indexOf("#"),i=n.indexOf("?"),a=Ob();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||{[Xo]:0,key:a,__TSR_key:a}}}function Ob(){return(Math.random()+1).toString(36).substring(7)}const aF=!1;function du(e){let t;return rF(()=>{t=e()}),t}function Tu(e){return e[e.length-1]}function cF(e){return typeof e=="function"}function Fo(e,t){return cF(e)?e(t):e}const lF=Object.prototype.hasOwnProperty,fT=Object.prototype.propertyIsEnumerable;function ur(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=t,i=pT(e)&&pT(s);if(!i&&!(Oh(e)&&Oh(s)))return s;const a=i?e:dT(e);if(!a)return s;const l=i?s:dT(s);if(!l)return s;const f=a.length,d=l.length,p=i?new Array(d):{};let g=0;for(let y=0;y<d;y++){const b=i?y:l[y],x=e[b],S=s[b];if(x===S){p[b]=x,(i?y<f:lF.call(e,b))&&g++;continue}if(x===null||S===null||typeof x!="object"||typeof S!="object"){p[b]=S;continue}const w=ur(x,S,n+1);p[b]=w,w===x&&g++}return f===d&&g===f?e:p}function dT(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!fT.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(!fT.call(e,i))return!1;s.push(i)}return s}function Oh(e){if(!hT(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!hT(n)||!n.hasOwnProperty("isPrototypeOf"))}function hT(e){return Object.prototype.toString.call(e)==="[object Object]"}function pT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ra(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(!ra(e[s],t[s],n))return!1;return!0}if(Oh(e)&&Oh(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!s||t[l]!==void 0)&&!ra(e[l],t[l],n))return!1;return!0}let i=0;if(!s)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let a=0;for(const l in t)if((!s||t[l]!==void 0)&&(a++,a>i||!ra(e[l],t[l],n)))return!1;return i===a}return!1}function zc(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 vc(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function uF(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function mT(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 uF(t)}const fF=["http:","https:","mailto:","tel:"];function Mh(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function tu(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+=mT(e.slice(n,i.index))+i[0],n=t.lastIndex;s=s+mT(n?e.slice(n):e);let a=!1;return s.startsWith("//")&&(a=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:a}}function dF(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var hF="Invariant failed";function ro(e,t){if(!e)throw new Error(hF)}function Ih(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 l=t.get(a);if(l)return i(l),l.value},set(a,l){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=l,i(f);else{const d={key:a,value:l,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 Lc=0,ua=1,fa=2,Cu=3,Yi=4,AN=5;function pF(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 Mb(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]=Lc,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]=fa,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(a.charCodeAt(0)===36)return n[0]=ua,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=pF(a);if(l){const[f,d]=l,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]=Cu,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]=fa,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=e.length,n):(n[0]=ua,n[1]=t+f,n[2]=t+y,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=Lc,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function fp(e,t,n,s,i,a,l){l?.(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=Mb(d,f,t);let S;const w=f,T=x[5];switch(f=T+1,a++,x[0]){case Lc:{const O=d.substring(x[2],x[3]);if(g){const N=i.static?.get(O);if(N)S=N;else{i.static??=new Map;const R=Xi(n.fullPath??n.from);R.parent=i,R.depth=a,S=R,i.static.set(O,R)}}else{const N=O.toLowerCase(),R=i.staticInsensitive?.get(N);if(R)S=R;else{i.staticInsensitive??=new Map;const M=Xi(n.fullPath??n.from);M.parent=i,M.depth=a,S=M,i.staticInsensitive.set(N,M)}}break}case ua:{const O=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(O||N),M=O?R?O:O.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=!y&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===L);if(j)S=j;else{const A=fy(ua,n.fullPath??n.from,R,M,L);S=A,A.depth=a,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case Cu:{const O=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(O||N),M=O?R?O:O.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=!y&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===L);if(j)S=j;else{const A=fy(Cu,n.fullPath??n.from,R,M,L);S=A,A.parent=i,A.depth=a,i.optional??=[],i.optional.push(A)}break}case fa:{const O=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(O||N),M=O?R?O:O.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=fy(fa,n.fullPath??n.from,R,M,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=Xi(n.fullPath??n.from);x.kind=AN,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=Xi(n.fullPath??n.from);x.kind=Yi,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)fp(e,t,d,f,i,a,l)}function uy(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 $o(e){if(e.pathless)for(const t of e.pathless)$o(t);if(e.static)for(const t of e.static.values())$o(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())$o(t);if(e.dynamic?.length){e.dynamic.sort(uy);for(const t of e.dynamic)$o(t)}if(e.optional?.length){e.optional.sort(uy);for(const t of e.optional)$o(t)}if(e.wildcard?.length){e.wildcard.sort(uy);for(const t of e.wildcard)$o(t)}}function Xi(e){return{kind:Lc,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 fy(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 mF(e,t){const n=Xi("/"),s=new Uint16Array(6);for(const i of e)fp(!1,s,i,1,n,0);$o(n),t.masksTree=n,t.flatCache=Ih(1e3)}function gF(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=Ib(e,t.masksTree);return t.flatCache.set(e,s),s}function yF(e,t,n,s,i){e||="/",s||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);if(!l){l=Xi("/");const f=new Uint16Array(6);fp(t,f,{from:e},1,l,0),i.singleCache.set(a,l)}return Ib(s,l,n)}function vF(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=Ib(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=SF(a.route)),t.matchCache.set(s,a),a}function bF(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function xF(e,t=!1,n){const s=Xi(e.fullPath),i=new Uint16Array(6),a={},l={};let f=0;return fp(t,i,e,1,s,0,p=>{if(n?.(p,f),ro(!(p.id in a),`Duplicate routes found with id: ${String(p.id)}`),a[p.id]=p,f!==0&&p.path){const g=bF(p.fullPath);(!l[g]||p.fullPath.endsWith("/"))&&(l[g]=p)}f++}),$o(s),{processedTree:{segmentTree:s,singleCache:Ih(1e3),matchCache:Ih(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function Ib(e,t,n=!1){const s=e.split("/"),i=wF(e,s,t,n);if(!i)return null;const[a]=kN(e,s,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function kN(e,t,n){const s=_F(n.node);let i=null;const a={};let l=n.extract?.part??0,f=n.extract?.node??0,d=n.extract?.path??0,p=n.extract?.segment??0;for(;f<s.length;l++,f++,d++,p++){const g=s[f];if(g.kind===Yi)break;if(g.kind===AN){p--,l--,d--;continue}const y=t[l],b=d;if(y&&(d+=y.length),g.kind===ua){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),O=y.substring(S,y.length-T);a[C]=decodeURIComponent(O)}else{const T=x.substring(1);a[T]=decodeURIComponent(y)}}else if(g.kind===Cu){if(n.skipped&1<<f){l--,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===fa){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:l,node:f,path:d,segment:p}]}function SF(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function _F(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function wF(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Tu(t),a=i&&e!=="/",l=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:O}=y;let{extract:N,rawParams:R,parsedParams:M}=y;if(b.skipOnParamError){if(!dy(e,t,y))continue;R=y.rawParams,N=y.extract,M=y.parsedParams}s&&b.route&&b.kind!==Yi&&nu(p,y)&&(p=y);const L=x===l;if(L&&(b.route&&!a&&nu(g,y)&&(g=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const j=L?void 0:t[x];let A;if(L&&b.index){const P={node:b.index,index:x,skipped:S,depth:w+1,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M};let Z=!0;if(b.index.skipOnParamError&&(dy(e,t,P)||(Z=!1)),Z){if(T===l&&!C&&!O&&!S)return P;nu(g,P)&&(g=P)}}if(b.wildcard&&nu(d,y))for(const P of b.wildcard){const{prefix:Z,suffix:B}=P;if(Z&&(L||!(P.caseSensitive?j:A??=j.toLowerCase()).startsWith(Z)))continue;if(B){if(L)continue;const Q=t.slice(x).join("/").slice(-B.length);if((P.caseSensitive?Q:Q.toLowerCase())!==B)continue}const z={node:P,index:l,skipped:S,depth:w,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M};if(!(P.skipOnParamError&&!dy(e,t,z))){d=z;break}}if(b.optional){const P=S|1<<w,Z=w+1;for(let B=b.optional.length-1;B>=0;B--){const z=b.optional[B];f.push({node:z,index:x,skipped:P,depth:Z,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(!L)for(let B=b.optional.length-1;B>=0;B--){const z=b.optional[B],{prefix:Q,suffix:Y}=z;if(Q||Y){const ee=z.caseSensitive?j:A??=j.toLowerCase();if(Q&&!ee.startsWith(Q)||Y&&!ee.endsWith(Y))continue}f.push({node:z,index:x+1,skipped:S,depth:Z,statics:T,dynamics:C,optionals:O+1,extract:N,rawParams:R,parsedParams:M})}}if(!L&&b.dynamic&&j)for(let P=b.dynamic.length-1;P>=0;P--){const Z=b.dynamic[P],{prefix:B,suffix:z}=Z;if(B||z){const Q=Z.caseSensitive?j:A??=j.toLowerCase();if(B&&!Q.startsWith(B)||z&&!Q.endsWith(z))continue}f.push({node:Z,index:x+1,skipped:S,depth:w+1,statics:T,dynamics:C+1,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(!L&&b.staticInsensitive){const P=b.staticInsensitive.get(A??=j.toLowerCase());P&&f.push({node:P,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(!L&&b.static){const P=b.static.get(j);P&&f.push({node:P,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(b.pathless){const P=w+1;for(let Z=b.pathless.length-1;Z>=0;Z--){const B=b.pathless[Z];f.push({node:B,index:x,skipped:S,depth:P,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M})}}}if(g&&d)return nu(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 dy(e,t,n){try{const[s,i]=kN(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 nu(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===Yi)>(e.node.kind===Yi)||t.node.kind===Yi==(e.node.kind===Yi)&&t.depth>e.depth))):!0}function oh(e){return Pb(e.filter(t=>t!==void 0).join("/"))}function Pb(e){return e.replace(/\/{2,}/g,"/")}function ON(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Qo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function MN(e){return Qo(ON(e))}function Ph(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function EF(e,t,n){return Ph(e,n)===Ph(t,n)}function TF({base:e,to:t,trailingSlash:n="never",cache:s}){const i=t.startsWith("/"),a=!i&&t===".";let l;if(s){l=i?t:a?e:e+"\0"+t;const y=s.get(l);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&&Tu(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&&(Tu(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=Mb(b,0,d);const x=d[0];if(x===Lc){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===ua?p+=w||T?`${w}{$${C}}${T}`:`$${C}`:x===fa?p+=w||T?`${w}{$}${T}`:"$":p+=`${w}{-$${C}}${T}`}p=Pb(p);const g=p||"/";return l&&s&&s.set(l,g),g}function CF(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 hy(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=>yT(i,n)).join("/"):yT(s,n)}function gT({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 l=e.length;let f=0,d,p="";for(;f<l;){const y=f;d=Mb(e,y,d);const b=d[5];if(f=b+1,y===b)continue;const x=d[0];if(x===Lc){p+="/"+e.substring(y,b);continue}if(x===fa){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=hy("_splat",t,n);p+="/"+w+C+T;continue}if(x===ua){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=hy(S,t,n)??"undefined";p+="/"+w+C+T;continue}if(x===Cu){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),O=hy(S,t,n)??"";p+="/"+T+O+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:a,interpolatedPath:p||"/",isMissingParams:i}}function yT(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function yr(e){return!!e?.isNotFound}function RF(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const wv="tsr-scroll-restoration-v1_3",NF=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function jF(){const e=RF();if(!e)return null;const t=e.getItem(wv);let n=t?JSON.parse(t):{};return{state:n,set:s=>{n=Fo(s,n)||n;try{e.setItem(wv,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Od=jF(),AF=e=>e.state.__TSR_key||e.href;function kF(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 Dh=!1;function OF({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:i,location:a}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,d=l[f];Dh=!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)}}Dh=!1}function MF(e,t){if(!Od||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Od))return;e.isScrollRestorationSetup=!0,Dh=!1;const s=e.options.getScrollRestorationKey||AF;window.history.scrollRestoration="manual";const i=a=>{if(Dh||!e.isScrollRestoring)return;let l="";if(a.target===document||a.target===window)l="window";else{const d=a.target.getAttribute("data-scroll-restoration-id");d?l=`[data-scroll-restoration-id="${d}"]`:l=kF(a.target)}const f=s(e.state.location);Od.set(d=>{const p=d[f]||={},g=p[l]||={};if(l==="window")g.scrollX=window.scrollX||0,g.scrollY=window.scrollY||0;else if(l){const y=document.querySelector(l);y&&(g.scrollX=y.scrollLeft||0,g.scrollY=y.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",NF(i,100),!0),e.subscribe("onRendered",a=>{const l=s(a.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(OF({storageKey:wv,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Od.set(f=>(f[l]||={},f)))})}function IF(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 PF(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 py(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function DF(e){const t=new URLSearchParams(e),n={};for(const[s,i]of t.entries()){const a=n[s];a==null?n[s]=py(i):Array.isArray(a)?a.push(py(i)):n[s]=[a,py(i)]}return n}const zF=UF(JSON.parse),LF=$F(JSON.stringify,JSON.parse);function UF(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=DF(t);for(const s in n){const i=n[s];if(typeof i=="string")try{n[s]=e(i)}catch{}}return n}}function $F(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=PF(i,s);return a?`?${a}`:""}}const Lr="__root__";function BF(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 Br(e){return e instanceof Response&&!!e.options}const ih=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},dp=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),bc=(e,t,n=!0)=>{const s={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const l=e.matches[a];if(!l)continue;const f=e.router.getMatch(l.id);f&&Object.assign(s,f.__routeContext,f.__beforeLoadContext)}return s},IN=(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||ro(s.options.notFoundComponent);const a=e.matches.find(l=>l.routeId===s.id);ro(a,"Could not find match for route: "+s.id),e.updateMatch(a.id,l=>({...l,status:"notFound",error:t,isFetching:!1})),i&&(t.routeId=s.parentRoute.id,IN(e,t,n))},Ho=(e,t,n,s)=>{if(!(!Br(n)&&!yr(n))){if(Br(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=Br(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:i,context:bc(e,t.index),isFetching:!1,error:n})),yr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Br(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(IN(e,n,s),n)}},PN=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,ru=(e,t,n,s)=>{const{id:i,routeId:a}=e.matches[t],l=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=s,e.firstBadMatchIndex??=t,Ho(e,e.router.getMatch(i),n,s);try{l.options.onError?.(n)}catch(f){n=f,Ho(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}))},DN=(e,t,n,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!dp(e,t)&&(n.options.loader||n.options.beforeLoad||UN(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{ih(e)},i);s._nonReactive.pendingTimeout=l}},FF=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;DN(e,t,n,s);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Ho(e,a,a.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(i):i()},HF=(e,t,n,s)=>{const i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=zc(()=>{a?.resolve()});const{paramsError:l,searchError:f}=i;l&&ru(e,n,l,"PARSE_PARAMS"),f&&ru(e,n,f,"VALIDATE_SEARCH"),DN(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){du(()=>{g(),y()});return}i._nonReactive.beforeLoadPromise=zc();const b={...bc(e,n,!1),...i.__routeContext},{search:x,params:S,cause:w}=i,T=dp(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},O=R=>{if(R===void 0){du(()=>{g(),y()});return}(Br(R)||yr(R))&&(g(),ru(e,n,R,"BEFORE_LOAD")),du(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:R})),y()})};let N;try{if(N=s.options.beforeLoad(C),vc(N))return g(),N.catch(R=>{ru(e,n,R,"BEFORE_LOAD")}).then(O)}catch(R){g(),ru(e,n,R,"BEFORE_LOAD")}O(N)},qF=(e,t)=>{const{id:n,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s],a=()=>f(),l=()=>HF(e,n,t,i),f=()=>{if(PN(e,n))return;const d=FF(e,n,i);return vc(d)?d.then(l):l()};return a()},VF=(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,l,f])=>{const d=a?.meta,p=a?.links,g=a?.scripts,y=a?.styles;return{meta:d,links:p,headScripts:g,headers:f,scripts:l,styles:y}})},zN=(e,t,n,s)=>{const i=e.matchPromises[n-1],{params:a,loaderDeps:l,abortController:f,cause:d}=e.router.getMatch(t),p=bc(e,n),g=dp(e,t);return{params:a,deps:l,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}},vT=async(e,t,n,s)=>{try{const i=e.router.getMatch(t);try{(!(aF??e.router.isServer)||i.ssr===!0)&&LN(s);const a=s.options.loader?.(zN(e,t,n,s)),l=s.options.loader&&vc(a);if((l||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=l?await a:a;Ho(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:bc(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let l=a;if(l?.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:bc(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,yr(a)&&await s.options.notFoundComponent?.preload?.(),Ho(e,e.router.getMatch(t),a);try{s.options.onError?.(a)}catch(d){l=d,Ho(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:l,context:bc(e,n),status:"error",isFetching:!1}))}}catch(i){const a=e.router.getMatch(t);a&&(a._nonReactive.loaderPromise=void 0),Ho(e,a,i)}},KF=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(zN(e,s,t,x)):T,{status:O,invalid:N}=b;a=O==="success"&&(N||(C??S>w)),g&&x.options.preload===!1||(a&&!e.sync?(l=!0,(async()=>{try{await vT(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){Br(R)&&await e.router.navigate(R.options)}})()):(O!=="success"||a&&e.sync)&&await vT(e,s,t,x))}const{id:s,routeId:i}=e.matches[t];let a=!1,l=!1;const f=e.router.looseRoutesById[i];if(!PN(e,s)){const g=e.router.getMatch(s),y=dp(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&&Ho(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=zc(),b!==x.preload&&e.updateMatch(s,S=>({...S,preload:b})),await n(y,g,x,f)}}const d=e.router.getMatch(s);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const p=l?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 bT(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&ih(t);try{for(let f=0;f<t.matches.length;f++){const d=qF(t,f);vc(d)&&await d}const n=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<n;f++)t.matchPromises.push(KF(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(Br(f))throw f;!a&&yr(f)&&(a=f)}for(const f of t.matches){const{id:d,routeId:p}=f,g=t.router.looseRoutesById[p];try{const y=VF(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 l=ih(t);vc(l)&&await l}catch(n){if(yr(n)&&!t.preload){const s=ih(t);throw vc(s)&&await s,n}if(Br(n))throw n}return t.matches}async function LN(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 $N){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 UN(e){for(const t of $N)if(e.options[t]?.preload)return!0;return!1}const $N=["component","errorComponent","pendingComponent","notFoundComponent"];function GF(e){return{input:({url:t})=>{for(const n of e)t=Ev(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=BN(e[n],t);return t}}}function ZF(e){const t=MN(e.basepath),n=`/${t}`,s=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?s:s.toLowerCase();return{input:({url:l})=>{const f=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return f===i?l.pathname="/":f.startsWith(a)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=oh(["/",t,l.pathname]),l)}}function Ev(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 BN(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 sa(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 YF(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class XF{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,l=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=CF(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=oF()),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=Ih(1e3),b=this.buildRouteTree(),this.setRoutes(b)}!this.__store&&this.latestLocation&&(this.__store=new nF(WF(this.latestLocation)),MF(this));let f=!1;const d=this.options.basepath??"/",p=this.options.rewrite;if(a||i!==d||l!==p){this.basepath=d;const b=[],x=MN(d);x&&x!=="/"&&b.push(ZF({basepath:d})),p&&b.push(p),this.rewrite=b.length===0?void 0:b.length===1?b[0]:GF(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=xF(this.routeTree,this.options.caseSensitive,(s,i)=>{s.init({originalIndex:i})});return this.options.routeMasks&&mF(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 O=this.options.parseSearch(p),N=this.options.stringifySearch(O);return{href:d+N+g,publicHref:y,pathname:tu(d).path,external:!1,searchStr:N,search:ur(s?.search,O),hash:tu(g.slice(1)).path,state:ur(s?.state,b)}}const x=new URL(y,this.origin),S=Ev(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:tu(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:T,search:ur(s?.search,w),hash:tu(S.hash.slice(1)).path,state:ur(s?.state,b)}},a=i(n),{__tempLocation:l,__tempKey:f}=a.state;if(l&&(!f||f===this.tempLocationKey)){const d=i(l);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)=>TF({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=>JF({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 l=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(l);a.from;const d=a.unsafeRelative==="path"?l.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,Fo(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 B of w){const z=B.options.params?.stringify??B.options.stringifyParams;if(z)try{Object.assign(x,z(x))}catch{}}const C=n.leaveParams?b:tu(gT({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let O=g;if(n._includeValidateSearch&&this.options.search?.strict){const B={};w.forEach(z=>{if(z.options.validateSearch)try{Object.assign(B,ah(z.options.validateSearch,{...B,...O}))}catch{}}),O=B}O=eH({search:O,dest:a,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),O=ur(g,O);const N=this.options.stringifySearch(O),R=a.hash===!0?l.hash:a.hash?Fo(a.hash,l.hash):void 0,M=R?`#${R}`:"";let L=a.state===!0?l.state:a.state?Fo(a.state,l.state):{};L=ur(l.state,L);const j=`${C}${N}${M}`;let A,P,Z=!1;if(this.rewrite){const B=new URL(j,this.origin),z=BN(this.rewrite,B);A=B.href.replace(B.origin,""),z.origin!==this.origin?(P=z.href,Z=!0):P=z.pathname+z.search+z.hash}else A=dF(j),P=A;return{publicHref:P,href:A,pathname:C,search:O,searchStr:N,state:L,hash:R??"",external:Z,unmaskOnReload:a.unmaskOnReload}},i=(a={},l)=>{const f=s(a);let d=l?s(l):void 0;if(!d){const p={};if(this.options.routeMasks){const g=gF(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,Fo(b,p));l={from:n.from,...x,params:S},d=s(l)}}}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=ra(i.state,this.latestLocation.state);return d.forEach(g=>{delete i.state[g]}),p},l=Qo(this.latestLocation.href)===Qo(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=zc(()=>{f?.resolve()}),l&&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:l,href:f,...d}={})=>{if(f){const y=this.history.location.state.__TSR_index,b=kh(f,{__TSR_index:n?y:y+1}),x=new URL(b.pathname,this.origin),S=Ev(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:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),g},this.navigate=async({to:n,reloadDocument:s,href:i,publicHref:a,...l})=>{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,...l});i=i??p.publicHref,a=a??p.publicHref}const d=!f&&a?a:i;if(Mh(d,this.protocolAllowlist))return Promise.resolve();if(!l.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 l.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...l,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",...sa({resolvedLocation:p,location:d})}),this.emit({type:"onBeforeLoad",...sa({resolvedLocation:p,location:d})}),await bT({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=[];du(()=>{this.__store.setState(x=>{const S=x.matches,w=x.pendingMatches||x.matches;return g=S.filter(T=>!w.some(C=>C.id===T.id)),y=w.filter(T=>!S.some(C=>C.id===T.id)),b=w.filter(T=>S.some(C=>C.id===T.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:w,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...g.filter(T=>T.status!=="error"&&T.status!=="notFound"&&T.status!=="redirected")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[y,"onEnter"],[b,"onStay"]].forEach(([x,S])=>{x.forEach(w=>{this.looseRoutesById[w.routeId].options[S]?.(w)})})})})}})}catch(d){Br(d)?(s=d,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):yr(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 l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(f=>f.status==="error")&&(l=500),l!==void 0&&this.__store.setState(f=>({...f,statusCode:l}))},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,l=this.state.resolvedLocation,f=typeof s.types=="function"?s.types(sa({resolvedLocation:l,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:YF(a.cachedMatches.map(l=>l.id===n?s(l):l))})):this.__store.setState(a=>({...a,[i]:a[i]?.map(l=>l.id===n?s(l):l)})))})},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&&Mh(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=LN,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)),l=new Set([...a,...this.state.cachedMatches.map(f=>f.id)]);du(()=>{i.forEach(f=>{l.has(f.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,f]}))})});try{return i=await bT({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(Br(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:s});yr(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=yF(a.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,f.pathname,this.processedTree);return!d||n.params&&!ra(d.rawParams,n.params,{partial:!0})?!1:s?.includeSearch??!0?ra(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??LF,parseSearch:t.parseSearch??zF,protocolAllowlist:t.protocolAllowlist??fF}),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:l}=s;let{matchedRoutes:f}=s,d=!1;(i?i.path!=="/"&&a["**"]:Qo(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const p=d?nH(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,ee=S?._strictSearch??void 0;try{const D=ah(x.options.validateSearch,{...Y})??void 0;w={...Y,...D},T={...ee,...D},C=void 0}catch(D){let V=D;if(D instanceof zh||(V=new zh(D.message,{cause:D})),n?.throwOnError)throw V;w=Y,T={},C=V}}const O=x.options.loaderDeps?.({search:w})??"",N=O?JSON.stringify(O):"",{interpolatedPath:R,usedParams:M}=gT({path:x.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),L=x.id+R+N,j=this.getMatch(L),A=y.get(x.id),P=j?._strictParams??M;let Z;if(!j)try{xT(x,M,l,P)}catch(Y){if(yr(Y)||Br(Y)?Z=Y:Z=new QF(Y.message,{cause:Y}),n?.throwOnError)throw Z}Object.assign(a,P);const B=A?"stay":"enter";let z;if(j)z={...j,cause:B,params:A?.params??a,_strictParams:P,search:ur(A?A.search:j.search,w),_strictSearch:T};else{const Y=x.options.loader||x.options.beforeLoad||x.lazyFn||UN(x)?"pending":"success";z={id:L,ssr:x.options.ssr,index:b,routeId:x.id,params:A?.params??a,_strictParams:P,pathname:R,updatedAt:Date.now(),search:A?ur(A.search,w):w,_strictSearch:T,searchError:void 0,status:Y,isFetching:!1,error:void 0,paramsError:Z,__routeContext:void 0,_nonReactive:{loadPromise:zc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:A?ur(A.loaderDeps,O):O,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 Q=this.getParentContext(S);z.context={...Q,...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?ur(T.params,a):a,!w){const C=g[b-1],O=this.getParentContext(C);if(S.options.context){const N={deps:x.loaderDeps,params:x.params,context:O??{},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={...O,...x.__routeContext,...x.__beforeLoadContext}}}return g}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:s,parsedParams:i}=this.getMatchedRoutes(t.pathname),a=Tu(n),l={...t.search};for(const g of n)try{Object.assign(l,ah(g.options.validateSearch,l))}catch{}const f=Tu(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{xT(y,s,i??{},g)}catch{}p=g}return{matchedRoutes:n,fullPath:a.fullPath,search:l,params:p}}}class zh extends Error{}class QF extends Error{}function WF(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ah(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new zh("Async validation not supported");if(n.issues)throw new zh(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 JF({pathname:e,routesById:t,processedTree:n}){const s={},i=Qo(e);let a,l;const f=vF(i,n,!0);return f&&(a=f.route,Object.assign(s,f.rawParams),l=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[Lr]],routeParams:s,foundRoute:a,parsedParams:l}}function eH({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){return tH(n)(e,t,s??!1)}function tH(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:l,next:f})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((g,y)=>y(g),l));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:l,next:f})=>{const d=f(l);if(!t._includeValidateSearch)return d;try{return{...d,...ah(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:Fo(a.search,i):{}};t.middlewares.push(n);const s=(i,a,l)=>{if(i>=l.length)return a;const f=l[i];return f({search:a,next:p=>s(i+1,p,l)})};return function(a,l,f){return t.dest=l,t._includeValidateSearch=f,s(0,a,t.middlewares)}}function nH(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 Lr}function xT(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 rH="Error preloading route! ☝️";class FN{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=Lr:this.parentRoute||ro(!1);let a=i?Lr:s?.path;a&&a!=="/"&&(a=ON(a));const l=s?.id||a;let f=i?Lr:oh([this.parentRoute.id===Lr?"":this.parentRoute.id,l]);a===Lr&&(a="/"),f!==Lr&&(f=oh(["/",f]));const d=f===Lr?"/":oh([this.parentRoute.fullPath,a]);this._path=a,this._id=f,this._fullPath=d,this._to=Qo(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=>BF({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 sH extends FN{constructor(t){super(t)}}const Md=typeof window<"u"?_.useLayoutEffect:_.useEffect;function my(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 oH(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 iH(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function Db(e){const t=e.errorComponent??zb;return h.jsx(aH,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?_.createElement(t,{error:n,reset:s}):e.children})}class aH 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 zb({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 cH({children:e,fallback:t=null}){return HN()?h.jsx(Ic.Fragment,{children:e}):h.jsx(Ic.Fragment,{children:t})}function HN(){return Ic.useSyncExternalStore(lH,()=>!0,()=>!1)}function lH(){return()=>{}}var gy={exports:{}},yy={},vy={exports:{}},by={};var ST;function uH(){if(ST)return by;ST=1;var e=Ku();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,l=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]),l(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 by.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,by}var _T;function qN(){return _T||(_T=1,vy.exports=uH()),vy.exports}var wT;function fH(){if(wT)return yy;wT=1;var e=Ku(),t=qN();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,l=e.useEffect,f=e.useMemo,d=e.useDebugValue;return yy.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(!O){if(O=!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 A=b(L);return x!==void 0&&x(j,A)?(N=L,j):(N=L,R=A)}var O=!1,N,R,M=y===void 0?null:y;return[function(){return C(g())},M===null?void 0:function(){return C(M())}]},[g,y,b,x]);var T=i(p,S[0],S[1]);return l(function(){w.hasValue=!0,w.value=T},[T]),d(T),T},yy}var ET;function dH(){return ET||(ET=1,gy.exports=fH()),gy.exports}var VN=dH();function hH(e,t){return e===t}function pH(e,t,n=hH){const s=_.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(l);return f},[e]),i=_.useCallback(()=>e?.get(),[e]);return VN.useSyncExternalStoreWithSelector(s,i,i,t,n)}const KN=_.createContext(null);function Xr(e){const t=_.useContext(KN);return e?.warn,t}function vr(e){const t=Xr({warn:e?.router===void 0}),n=e?.router||t,s=_.useRef(void 0);return pH(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=ur(s.current,e.select(i));return s.current=a,a}return e.select(i)}return i})}const hp=_.createContext(void 0),mH=_.createContext(void 0);function Ss(e){const t=_.useContext(e.from?mH:hp);return vr({select:s=>{const i=s.matches.find(a=>e.from?e.from===a.routeId:a.id===t);if(ro(!((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 Lb(e){return Ss({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ub(e){const{select:t,...n}=e;return Ss({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function $b(e){return Ss({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 Bb(e){return Ss({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function pp(e){const t=Xr();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var hi=pN();function gH(e,t){const n=Xr(),s=iH(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:f,preload:d,preloadDelay:p,hashScrollIntoView:g,replace:y,startTransition:b,resetScroll:x,viewTransition:S,children:w,target:T,disabled:C,style:O,className:N,onClick:R,onBlur:M,onFocus:L,onMouseEnter:j,onMouseLeave:A,onTouchStart:P,ignoreBlocker:Z,params:B,search:z,hash:Q,state:Y,mask:ee,reloadDocument:D,unsafeRelative:V,from:q,_fromLocation:K,...U}=e,I=HN(),H=vr({select:He=>{const me=He.matches[He.matches.length-1];return{search:me?.search,hash:He.location.hash,path:me?.pathname}},structuralSharing:!0}),W=e.from,X=_.useMemo(()=>({...e,from:W}),[n,H,W,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),oe=_.useMemo(()=>n.buildLocation({...X}),[n,X]),se=oe.maskedLocation?oe.maskedLocation.publicHref:oe.publicHref,pe=oe.maskedLocation?oe.maskedLocation.external:oe.external,xe=_.useMemo(()=>_H(se,pe,n.history,C),[C,pe,se,n.history]),de=_.useMemo(()=>{if(xe?.external)return Mh(xe.href,n.protocolAllowlist)?void 0:xe.href;if(!wH(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),Mh(f,n.protocolAllowlist)?void 0:f}catch{}},[f,xe,n.protocolAllowlist]),Me=vr({select:He=>{if(de)return!1;if(l?.exact){if(!EF(He.location.pathname,oe.pathname,n.basepath))return!1}else{const me=Ph(He.location.pathname,n.basepath),Te=Ph(oe.pathname,n.basepath);if(!(me.startsWith(Te)&&(me.length===Te.length||me[Te.length]==="/")))return!1}return(l?.includeSearch??!0)&&!ra(He.location.search,oe.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?I&&He.location.hash===oe.hash:!0}}),_e=Me?Fo(i,{})??yH:xy,ne=Me?xy:Fo(a,{})??xy,he=[N,_e.className,ne.className].filter(Boolean).join(" "),ae=(O||_e.style||ne.style)&&{...O,..._e.style,...ne.style},[we,ve]=_.useState(!1),Se=_.useRef(!1),ye=e.reloadDocument||de?!1:d??n.options.defaultPreload,Ue=p??n.options.defaultPreloadDelay??0,Ie=_.useCallback(()=>{n.preloadRoute({...X,_builtLocation:oe}).catch(He=>{console.warn(He),console.warn(rH)})},[n,X,oe]),Ee=_.useCallback(He=>{He?.isIntersecting&&Ie()},[Ie]);oH(s,Ee,SH,{disabled:!!C||ye!=="viewport"}),_.useEffect(()=>{Se.current||!C&&ye==="render"&&(Ie(),Se.current=!0)},[C,Ie,ye]);const Ve=He=>{const me=He.currentTarget.getAttribute("target"),Te=T!==void 0?T:me;if(!C&&!EH(He)&&!He.defaultPrevented&&(!Te||Te==="_self")&&He.button===0){He.preventDefault(),hi.flushSync(()=>{ve(!0)});const qe=n.subscribe("onResolved",()=>{qe(),ve(!1)});n.navigate({...X,replace:y,resetScroll:x,hashScrollIntoView:g,startTransition:b,viewTransition:S,ignoreBlocker:Z})}};if(de)return{...U,ref:s,href:de,...w&&{children:w},...T&&{target:T},...C&&{disabled:C},...O&&{style:O},...N&&{className:N},...R&&{onClick:R},...M&&{onBlur:M},...L&&{onFocus:L},...j&&{onMouseEnter:j},...A&&{onMouseLeave:A},...P&&{onTouchStart:P}};const Xe=He=>{if(C||ye!=="intent")return;if(!Ue){Ie();return}const me=He.currentTarget;if(su.has(me))return;const Te=setTimeout(()=>{su.delete(me),Ie()},Ue);su.set(me,Te)},Be=He=>{C||ye!=="intent"||Ie()},We=He=>{if(C||!ye||!Ue)return;const me=He.currentTarget,Te=su.get(me);Te&&(clearTimeout(Te),su.delete(me))};return{...U,..._e,...ne,href:xe?.href,ref:s,onClick:lc([R,Ve]),onBlur:lc([M,We]),onFocus:lc([L,Xe]),onMouseEnter:lc([j,Xe]),onMouseLeave:lc([A,We]),onTouchStart:lc([P,Be]),disabled:!!C,target:T,...ae&&{style:ae},...he&&{className:he},...C&&vH,...Me&&bH,...I&&we&&xH}}const xy={},yH={className:"active"},vH={role:"link","aria-disabled":!0},bH={"data-status":"active","aria-current":"page"},xH={"data-transitioning":"transitioning"},su=new WeakMap,SH={rootMargin:"100px"},lc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function _H(e,t,n,s){if(!s)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function wH(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const xc=_.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:i,...a}=gH(s,t),l=typeof s.children=="function"?s.children({isActive:a["data-status"]==="active"}):s.children;if(!n){const{disabled:f,...d}=a;return _.createElement("a",d,l)}return _.createElement(n,a,l)});function EH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let TH=class extends FN{constructor(t){super(t),this.useMatch=n=>Ss({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>$b({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Ub({...n,from:this.id}),this.useLoaderData=n=>Lb({...n,from:this.id}),this.useNavigate=()=>pp({from:this.fullPath}),this.Link=Ic.forwardRef((n,s)=>h.jsx(xc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function ao(e){return new TH(e)}class CH extends sH{constructor(t){super(t),this.useMatch=n=>Ss({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>$b({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Ub({...n,from:this.id}),this.useLoaderData=n=>Lb({...n,from:this.id}),this.useNavigate=()=>pp({from:this.fullPath}),this.Link=Ic.forwardRef((n,s)=>h.jsx(xc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function RH(e){return new CH(e)}function TT(e){return typeof e=="object"?new CT(e,{silent:!0}).createRoute(e):new CT(e,{silent:!0}).createRoute}class CT{constructor(t,n){this.path=t,this.createRoute=s=>{const i=ao(s);return i.isRoot=!1,i},this.silent=n?.silent}}class RT{constructor(t){this.useMatch=n=>Ss({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>$b({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Ub({...n,from:this.options.id}),this.useLoaderData=n=>Lb({...n,from:this.options.id}),this.useNavigate=()=>{const n=Xr();return pp({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function NT(e){return typeof e=="object"?new RT(e):t=>new RT({id:e,...t})}function NH(){const e=Xr(),t=_.useRef({router:e,mounted:!1}),[n,s]=_.useState(!1),{hasPendingMatches:i,isLoading:a}=vr({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),l=my(a),f=a||n||i,d=my(f),p=a||i,g=my(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 Qo(e.latestLocation.publicHref)!==Qo(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{y()}},[e,e.history]),Md(()=>{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]),Md(()=>{l&&!a&&e.emit({type:"onLoad",...sa(e.state)})},[l,e,a]),Md(()=>{g&&!p&&e.emit({type:"onBeforeRouteMount",...sa(e.state)})},[p,g,e]),Md(()=>{if(d&&!f){const y=sa(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),y.hrefChanged&&IF(e)}},[f,d,e]),null}function jH(e){const t=vr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return h.jsx(Db,{getResetKey:()=>t,onCatch:(n,s)=>{if(yr(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(yr(n))return e.fallback?.(n);throw n},children:e.children})}function AH(){return h.jsx("p",{children:"Not Found"})}function uc(e){return h.jsx(h.Fragment,{children:e.children})}function GN(e,t,n){return t.options.notFoundComponent?h.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...n}):h.jsx(AH,{})}function kH(){return Xr().isScrollRestoring,null}const ZN=_.memo(function({matchId:t}){const n=Xr(),s=vr({select:w=>{const T=w.matches.findIndex(O=>O.id===t),C=w.matches[T];return ro(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,l=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:uc,b=f?Db:uc,x=p?jH:uc,S=i.isRoot?i.options.shellComponent??uc:uc;return h.jsxs(S,{children:[h.jsx(hp.Provider,{value:t,children:h.jsx(y,{fallback:l,children:h.jsx(b,{getResetKey:()=>s.resetKey,errorComponent:f||zb,onCatch:(w,T)=>{if(yr(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(cH,{fallback:l,children:h.jsx(jT,{matchId:t})}):h.jsx(jT,{matchId:t})})})})}),s.parentRouteId===Lr&&n.options.scrollRestoration?h.jsxs(h.Fragment,{children:[h.jsx(OH,{}),h.jsx(kH,{})]}):null]})});function OH(){const e=Xr(),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",...sa(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const jT=_.memo(function({matchId:t}){const n=Xr(),{match:s,key:i,routeId:a}=vr({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}),l=n.routesById[a],f=_.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?h.jsx(d,{},i):h.jsx(YN,{})},[i,l.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=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const p=n.getMatch(s.id);if(p&&!p._nonReactive.minPendingPromise){const g=zc();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 ro(yr(s.error)),GN(n,l,s.error);if(s.status==="redirected")throw ro(Br(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error")throw s.error;return f}),YN=_.memo(function(){const t=Xr(),n=_.useContext(hp),s=vr({select:p=>p.matches.find(g=>g.id===n)?.routeId}),i=t.routesById[s],a=vr({select:p=>{const y=p.matches.find(b=>b.id===n);return ro(y),y.globalNotFound}}),l=vr({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 GN(t,i,void 0);if(!l)return null;const d=h.jsx(ZN,{matchId:l});return s===Lr?h.jsx(_.Suspense,{fallback:f,children:d}):d});function MH(){const e=Xr(),n=e.routesById[Lr].options.pendingComponent??e.options.defaultPendingComponent,s=n?h.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?uc:_.Suspense,a=h.jsxs(i,{fallback:s,children:[h.jsx(NH,{}),h.jsx(IH,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:a}):a}function IH(){const e=Xr(),t=vr({select:i=>i.matches[0]?.id}),n=vr({select:i=>i.loadedAt}),s=t?h.jsx(ZN,{matchId:t}):null;return h.jsx(hp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:h.jsx(Db,{getResetKey:()=>n,errorComponent:zb,onCatch:void 0,children:s})})}const PH=e=>new DH(e);class DH extends XF{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=TT,globalThis.createLazyFileRoute=NT):typeof window<"u"&&(window.createFileRoute=TT,window.createLazyFileRoute=NT);function zH({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(KN.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:s}):s}function LH({router:e,...t}){return h.jsx(zH,{router:e,...t,children:h.jsx(MH,{})})}const UH=/\{[^{}]+\}/g,$H=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function BH(){return Math.random().toString(36).slice(2,11)}function FH(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:s=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:l,headers:f,requestInitExt:d=void 0,...p}={...e};d=$H()?d:void 0,t=OT(t);const g=[];async function y(b,x){const{baseUrl:S,fetch:w=s,Request:T=n,headers:C,params:O={},parseAs:N="json",querySerializer:R,bodySerializer:M=a??qH,pathSerializer:L,body:j,middleware:A=[],...P}=x||{};let Z=t;S&&(Z=OT(S)??t);let B=typeof i=="function"?i:AT(i);R&&(B=typeof R=="function"?R:AT({...typeof i=="object"?i:{},...R}));const z=L||l||HH,Q=j===void 0?void 0:M(j,kT(f,C,O.header)),Y=kT(Q===void 0||Q instanceof FormData?{}:{"Content-Type":"application/json"},f,C,O.header),ee=[...g,...A],D={redirect:"follow",...p,...P,body:Q,headers:Y};let V,q,K=new T(VH(b,{baseUrl:Z,params:O,querySerializer:B,pathSerializer:z}),D),U;for(const W in P)W in K||(K[W]=P[W]);if(ee.length){V=BH(),q=Object.freeze({baseUrl:Z,fetch:w,parseAs:N,querySerializer:B,bodySerializer:M,pathSerializer:z});for(const W of ee)if(W&&typeof W=="object"&&typeof W.onRequest=="function"){const X=await W.onRequest({request:K,schemaPath:b,params:O,options:q,id:V});if(X)if(X instanceof T)K=X;else if(X instanceof Response){U=X;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!U){try{U=await w(K,d)}catch(W){let X=W;if(ee.length)for(let oe=ee.length-1;oe>=0;oe--){const se=ee[oe];if(se&&typeof se=="object"&&typeof se.onError=="function"){const pe=await se.onError({request:K,error:X,schemaPath:b,params:O,options:q,id:V});if(pe){if(pe instanceof Response){X=void 0,U=pe;break}if(pe instanceof Error){X=pe;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(X)throw X}if(ee.length)for(let W=ee.length-1;W>=0;W--){const X=ee[W];if(X&&typeof X=="object"&&typeof X.onResponse=="function"){const oe=await X.onResponse({request:K,response:U,schemaPath:b,params:O,options:q,id:V});if(oe){if(!(oe instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");U=oe}}}}const I=U.headers.get("Content-Length");if(U.status===204||K.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 X=await U.text();return X?JSON.parse(X):void 0}return await U[N]()})(),response:U};let H=await U.text();try{H=JSON.parse(H)}catch{}return{error:H,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 mp(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 XN(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 l=s.join(",");switch(n.style){case"form":return`${e}=${l}`;case"label":return`.${l}`;case"matrix":return`;${e}=${l}`;default:return l}}for(const l in t){const f=n.style==="deepObject"?`${e}[${l}]`:l;s.push(mp(f,t[l],n))}const a=s.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function QN(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",l=(n.allowReserved===!0?t:t.map(f=>encodeURIComponent(f))).join(a);switch(n.style){case"simple":return l;case"label":return`.${l}`;case"matrix":return`;${e}=${l}`;default:return`${e}=${l}`}}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(mp(e,a,n));return n.style==="label"||n.style==="matrix"?`${s}${i.join(s)}`:i.join(s)}function AT(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(QN(i,a,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof a=="object"){s.push(XN(i,a,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}s.push(mp(i,a,e))}}return s.join("&")}}function HH(e,t){let n=e;for(const s of e.match(UH)??[]){let i=s.substring(1,s.length-1),a=!1,l="simple";if(i.endsWith("*")&&(a=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(l="label",i=i.substring(1)):i.startsWith(";")&&(l="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,QN(i,f,{style:l,explode:a}));continue}if(typeof f=="object"){n=n.replace(s,XN(i,f,{style:l,explode:a}));continue}if(l==="matrix"){n=n.replace(s,`;${mp(i,f)}`);continue}n=n.replace(s,l==="label"?`.${encodeURIComponent(f)}`:encodeURIComponent(f))}return n}function qH(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 VH(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 l of a)t.append(i,l);else a!==void 0&&t.set(i,a)}return t}function OT(e){return e.endsWith("/")?e.substring(0,e.length-1):e}class KH extends Error{error;constructor(t,n){super(t),this.error=n,this.name="ApiResponseError"}}function GH(e){if(e&&typeof e=="object"&&"error"in e){const t=e.error;if(typeof t=="string")return t}if(e&&typeof e=="object"&&"message"in e){const t=e.message;if(typeof t=="string")return t}return"Request failed"}async function Yu(e){const{data:t,error:n}=await e;if(n||!t)throw new KH(GH(n),n);return t}function ZH(e){const t=FH({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[l,f]of Object.entries(a))i.headers.set(l,f)}return i.headers.has("x-syncular-transport-path")||i.headers.set("x-syncular-transport-path",s),i}}),t}function YH(e){return ZH({baseUrl:e.serverUrl,getHeaders:()=>({Authorization:`Bearer ${e.token}`})})}async function XH(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,l=a.error,f=a.message;if(typeof l=="string"&&l.length>0)i=l;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")}}function pi(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(l=>typeof a=="function"?a(l):a)},[]);return[n,i]}const WN=_.createContext(null);function QH({children:e,defaultConfig:t=null,autoConnect:n=!1}){const[s,i]=pi("sync-console-connection",null),[a,l]=_.useState({isConnected:!1,isConnecting:!1,error:null,client:null}),f=_.useRef(null);_.useEffect(()=>{if(!(s?.serverUrl?.trim()&&s.token?.trim())&&t?.serverUrl?.trim()&&t.token?.trim()){i({serverUrl:t.serverUrl.trim(),token:t.token.trim()});return}},[i,s,t]);const d=_.useCallback(async(x,S)=>{const w=x??s;if(!w)return l(C=>({...C,error:"No connection configured"})),!1;const T={serverUrl:w.serverUrl?.trim()??"",token:w.token?.trim()??""};if(!T.serverUrl)return l(C=>({...C,error:"Server URL is required"})),!1;if(!T.token)return l(C=>({...C,error:"Token is required"})),!1;x&&(S?.persistOverride??!0)&&i(T),l(C=>({...C,isConnecting:!0,error:null}));try{const C=YH(T);return await XH(C),l({isConnected:!0,isConnecting:!1,client:C,error:null}),!0}catch(C){return l({isConnected:!1,isConnecting:!1,client:null,error:C instanceof Error?C.message:"Connection failed"}),!1}},[s,i]),p=_.useCallback(x=>{x?.clearSavedConfig&&i(null),l({isConnected:!1,isConnecting:!1,client:null,error:null})},[i]),g=_.useCallback(()=>{l(x=>({...x,error:null}))},[]),y=_.useCallback(x=>{i(x),l({isConnected:!1,isConnecting:!1,client:null,error:null})},[i]),b=_.useMemo(()=>({config:s,setConfig:y,isConnected:a.isConnected,isConnecting:a.isConnecting,error:a.error,client:a.client,connect:d,disconnect:p,clearError:g}),[s,y,a,d,p,g]);return _.useEffect(()=>{if(!n||a.isConnected||a.isConnecting)return;const x=s??t,S=WH(x);!x||!S||f.current!==S&&(f.current=S,d(x,{persistOverride:!0}))},[n,s,t,a.isConnected,a.isConnecting,d]),h.jsx(WN.Provider,{value:b,children:e})}function WH(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:`${t}\0${n}`}function Dt(){const e=_.useContext(WN);if(!e)throw new Error("useConnection must be used within a ConnectionProvider");return e}function Vt(){const{client:e}=Dt();return e}function JN(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=JN(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Fb(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=JN(e))&&(s&&(s+=" "),s+=t);return s}var JH=e=>typeof e=="number"&&e!=+e,Lh=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,MT=e=>(typeof e=="number"||e instanceof Number)&&!JH(e);function eq(){}var Uh=Symbol("NOT_FOUND");function tq(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function nq(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function rq(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 IT=e=>Array.isArray(e)?e:[e];function sq(e){const t=Array.isArray(e[0])?e[0]:e;return rq(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function oq(e,t){const n=[],{length:s}=e;for(let i=0;i<s;i++)n.push(e[i].apply(null,t));return n}function iq(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Uh},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function aq(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 Uh}function i(f,d){s(f)===Uh&&(n.unshift({key:f,value:d}),n.length>e&&n.pop())}function a(){return n}function l(){n=[]}return{get:s,put:i,getEntries:a,clear:l}}var cq=(e,t)=>e===t;function lq(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 uq(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=cq,maxSize:i=1,resultEqualityCheck:a}=n,l=lq(s);let f=0;const d=i<=1?iq(l):aq(i,l);function p(){let g=d.get(arguments);if(g===Uh){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 fq=class{constructor(e){this.value=e}deref(){return this.value}},dq=typeof WeakRef<"u"?WeakRef:fq,hq=0,PT=1;function Id(){return{s:hq,v:void 0,o:null,p:null}}function ej(e,t={}){let n=Id();const{resultEqualityCheck:s}=t;let i,a=0;function l(){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=Id(),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=Id(),S.set(x,f)):f=w}}const p=f;let g;if(f.s===PT)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 dq(g):g}return p.s=PT,p.v=g,g}return l.clearCache=()=>{n=Id(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function tj(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...i)=>{let a=0,l=0,f,d={},p=i.pop();typeof p=="object"&&(d=p,p=i.pop()),tq(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const g={...n,...d},{memoize:y,memoizeOptions:b=[],argsMemoize:x=ej,argsMemoizeOptions:S=[]}=g,w=IT(b),T=IT(S),C=sq(i),O=y(function(){return a++,p.apply(null,arguments)},...w),N=x(function(){l++;const M=oq(C,arguments);return f=O.apply(null,M),f},...T);return Object.assign(N,{resultFunc:p,memoizedResultFunc:O,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>f,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:y,argsMemoize:x})};return Object.assign(s,{withTypes:()=>s}),s}var pq=tj(ej),mq=Object.assign((e,t=pq)=>{nq(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((l,f,d)=>(l[n[d]]=f,l),{}))},{withTypes:()=>mq});function $h(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}var Sy={},_y={},wy={},DT;function gq(){return DT||(DT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,s,{signal:i,edges:a}={}){let l,f=null;const d=a!=null&&a.includes("leading"),p=a==null||a.includes("trailing"),g=()=>{f!==null&&(n.apply(l,f),l=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(),l=void 0,f=null},T=()=>{g()},C=function(...O){if(i?.aborted)return;l=this,f=O;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})(wy)),wy}var zT;function yq(){return zT||(zT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gq();function n(s,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:f=!0,maxWait:d}=a,p=Array(2);l&&(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})(_y)),_y}var LT;function vq(){return LT||(LT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yq();function n(s,i=0,a={}){const{leading:l=!0,trailing:f=!0}=a;return t.debounce(s,i,{leading:l,maxWait:i,trailing:f})}e.throttle=n})(Sy)),Sy}var Ey,UT;function bq(){return UT||(UT=1,Ey=vq().throttle),Ey}var xq=bq();const Sq=M1(xq);var $T=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 l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},bs={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},nj=(e,t,n)=>{var{width:s=bs.width,height:i=bs.height,aspect:a,maxHeight:l}=n,f=Lh(s)?e:Number(s),d=Lh(i)?t:Number(i);return a&&a>0&&(f?d=f/a:d&&(f=d*a),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:f,calculatedHeight:d}},_q={width:0,height:0,overflow:"visible"},wq={width:0,overflowX:"visible"},Eq={height:0,overflowY:"visible"},Tq={},Cq=e=>{var{width:t,height:n}=e,s=Lh(t),i=Lh(n);return s&&i?_q:s?wq:i?Eq:Tq};function Rq(e){var{width:t,height:n,aspect:s}=e,i=t,a=n;return i===void 0&&a===void 0?(i=bs.width,a=bs.height):i===void 0?i=s&&s>0?void 0:bs.width:a===void 0&&(a=s&&s>0?void 0:bs.height),{width:i,height:a}}function Tv(){return Tv=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},Tv.apply(null,arguments)}function BT(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 FT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BT(Object(n),!0).forEach(function(s){Nq(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BT(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Nq(e,t,n){return(t=jq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jq(e){var t=Aq(e,"string");return typeof t=="symbol"?t:t+""}function Aq(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 rj=_.createContext(bs.initialDimension);function kq(e){return $h(e.width)&&$h(e.height)}function sj(e){var{children:t,width:n,height:s}=e,i=_.useMemo(()=>({width:n,height:s}),[n,s]);return kq(i)?_.createElement(rj.Provider,{value:i},t):null}var Oq=()=>_.useContext(rj),Mq=_.forwardRef((e,t)=>{var{aspect:n,initialDimension:s=bs.initialDimension,width:i,height:a,minWidth:l=bs.minWidth,minHeight:f,maxHeight:d,children:p,debounce:g=bs.debounce,id:y,className:b,onResize:x,style:S={}}=e,w=_.useRef(null),T=_.useRef();T.current=x,_.useImperativeHandle(t,()=>w.current);var[C,O]=_.useState({containerWidth:s.width,containerHeight:s.height}),N=_.useCallback((A,P)=>{O(Z=>{var B=Math.round(A),z=Math.round(P);return Z.containerWidth===B&&Z.containerHeight===z?Z:{containerWidth:B,containerHeight:z}})},[]);_.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return eq;var A=z=>{var Q,Y=z[0];if(Y!=null){var{width:ee,height:D}=Y.contentRect;N(ee,D),(Q=T.current)===null||Q===void 0||Q.call(T,ee,D)}};g>0&&(A=Sq(A,g,{trailing:!0,leading:!1}));var P=new ResizeObserver(A),{width:Z,height:B}=w.current.getBoundingClientRect();return N(Z,B),P.observe(w.current),()=>{P.disconnect()}},[N,g]);var{containerWidth:R,containerHeight:M}=C;$T(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:L,calculatedHeight:j}=nj(R,M,{width:i,height:a,aspect:n,maxHeight:d});return $T(L!=null&&L>0||j!=null&&j>0,`The width(%s) and height(%s) of chart should be greater than 0,
66
+ `+u.stack}}var Ue=Object.prototype.hasOwnProperty,Ie=e.unstable_scheduleCallback,Ee=e.unstable_cancelCallback,Ve=e.unstable_shouldYield,Xe=e.unstable_requestPaint,Be=e.unstable_now,We=e.unstable_getCurrentPriorityLevel,He=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,qe=e.unstable_LowPriority,mt=e.unstable_IdlePriority,lt=e.log,wr=e.unstable_setDisableYieldValue,Er=null,Qt=null;function ut(r){if(typeof lt=="function"&&wr(r),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Er,r)}catch{}}var xt=Math.clz32?Math.clz32:vn,ot=Math.log,Wt=Math.LN2;function vn(r){return r>>>=0,r===0?32:31-(ot(r)/Wt|0)|0}var kt=256,Cn=262144,er=4194304;function An(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 as(r,o,c){var u=r.pendingLanes;if(u===0)return 0;var m=0,v=r.suspendedLanes,E=r.pingedLanes;r=r.warmLanes;var O=u&134217727;return O!==0?(u=O&~v,u!==0?m=An(u):(E&=O,E!==0?m=An(E):c||(c=O&~r,c!==0&&(m=An(c))))):(O=u&~v,O!==0?m=An(O):E!==0?m=An(E):c||(c=u&~r,c!==0&&(m=An(c)))),m===0?0:o!==0&&o!==m&&(o&v)===0&&(v=m&-m,c=o&-o,v>=c||v===32&&(c&4194048)!==0)?o:m}function cs(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function _a(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 _i(){var r=er;return er<<=1,(er&62914560)===0&&(er=4194304),r}function wi(r){for(var o=[],c=0;31>c;c++)o.push(r);return o}function ws(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function tr(r,o,c,u,m,v){var E=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var O=r.entanglements,$=r.expirationTimes,te=r.hiddenUpdates;for(c=E&~c;0<c;){var ce=31-xt(c),fe=1<<ce;O[ce]=0,$[ce]=-1;var re=te[ce];if(re!==null)for(te[ce]=null,ce=0;ce<re.length;ce++){var ie=re[ce];ie!==null&&(ie.lane&=-536870913)}c&=~fe}u!==0&&ls(r,u,0),v!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=v&~(E&~o))}function ls(r,o,c){r.pendingLanes|=o,r.suspendedLanes&=~o;var u=31-xt(o);r.entangledLanes|=o,r.entanglements[u]=r.entanglements[u]|1073741824|c&261930}function uo(r,o){var c=r.entangledLanes|=o;for(r=r.entanglements;c;){var u=31-xt(c),m=1<<u;m&o|r[u]&o&&(r[u]|=o),c&=~m}}function fo(r,o){var c=o&-o;return c=(c&42)!==0?1:nr(c),(c&(r.suspendedLanes|o))!==0?0:c}function nr(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 cl(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function cf(){var r=K.p;return r!==0?r:(r=window.event,r===void 0?32:rw(r.type))}function lf(r,o){var c=K.p;try{return K.p=r,o()}finally{K.p=c}}var ho=Math.random().toString(36).slice(2),Sn="__reactFiber$"+ho,Un="__reactProps$"+ho,wa="__reactContainer$"+ho,Op="__reactEvents$"+ho,_k="__reactListeners$"+ho,wk="__reactHandles$"+ho,xx="__reactResources$"+ho,ll="__reactMarker$"+ho;function Mp(r){delete r[Sn],delete r[Un],delete r[Op],delete r[_k],delete r[wk]}function Ea(r){var o=r[Sn];if(o)return o;for(var c=r.parentNode;c;){if(o=c[wa]||c[Sn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(r=B_(r);r!==null;){if(c=r[Sn])return c;r=B_(r)}return o}r=c,c=r.parentNode}return null}function Ta(r){if(r=r[Sn]||r[wa]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function ul(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(s(33))}function Ca(r){var o=r[xx];return o||(o=r[xx]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function bn(r){r[ll]=!0}var Sx=new Set,_x={};function Ei(r,o){Ra(r,o),Ra(r+"Capture",o)}function Ra(r,o){for(_x[r]=o,r=0;r<o.length;r++)Sx.add(o[r])}var Ek=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 Tk(r){return Ue.call(Ex,r)?!0:Ue.call(wx,r)?!1:Ek.test(r)?Ex[r]=!0:(wx[r]=!0,!1)}function uf(r,o,c){if(Tk(o))if(c===null)r.removeAttribute(o);else{switch(typeof c){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,""+c)}}function ff(r,o,c){if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+c)}}function Es(r,o,c,u){if(u===null)r.removeAttribute(c);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(o,c,""+u)}}function Tr(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 Ck(r,o,c){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){c=""+E,v.call(this,E)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function Ip(r){if(!r._valueTracker){var o=Tx(r)?"checked":"value";r._valueTracker=Ck(r,o,""+r[o])}}function Cx(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var c=o.getValue(),u="";return r&&(u=Tx(r)?r.checked?"true":"false":r.value),r=u,r!==c?(o.setValue(r),!0):!1}function df(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 Rk=/[\n"\\]/g;function Cr(r){return r.replace(Rk,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Pp(r,o,c,u,m,v,E,O){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=""+Tr(o)):r.value!==""+Tr(o)&&(r.value=""+Tr(o)):E!=="submit"&&E!=="reset"||r.removeAttribute("value"),o!=null?Dp(r,E,Tr(o)):c!=null?Dp(r,E,Tr(c)):u!=null&&r.removeAttribute("value"),m==null&&v!=null&&(r.defaultChecked=!!v),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?r.name=""+Tr(O):r.removeAttribute("name")}function Rx(r,o,c,u,m,v,E,O){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),o!=null||c!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){Ip(r);return}c=c!=null?""+Tr(c):"",o=o!=null?""+Tr(o):c,O||o===r.value||(r.value=o),r.defaultValue=o}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=O?r.checked:!!u,r.defaultChecked=!!u,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(r.name=E),Ip(r)}function Dp(r,o,c){o==="number"&&df(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function Na(r,o,c,u){if(r=r.options,o){o={};for(var m=0;m<c.length;m++)o["$"+c[m]]=!0;for(c=0;c<r.length;c++)m=o.hasOwnProperty("$"+r[c].value),r[c].selected!==m&&(r[c].selected=m),m&&u&&(r[c].defaultSelected=!0)}else{for(c=""+Tr(c),o=null,m=0;m<r.length;m++){if(r[m].value===c){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,c){if(o!=null&&(o=""+Tr(o),o!==r.value&&(r.value=o),c==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=c!=null?""+Tr(c):""}function jx(r,o,c,u){if(o==null){if(u!=null){if(c!=null)throw Error(s(92));if(ee(u)){if(1<u.length)throw Error(s(93));u=u[0]}c=u}c==null&&(c=""),o=c}c=Tr(o),r.defaultValue=c,u=r.textContent,u===c&&u!==""&&u!==null&&(r.value=u),Ip(r)}function ja(r,o){if(o){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=o;return}}r.textContent=o}var Nk=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,c){var u=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?u?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":u?r.setProperty(o,c):typeof c!="number"||c===0||Nk.has(o)?o==="float"?r.cssFloat=c:r[o]=(""+c).trim():r[o]=c+"px"}function kx(r,o,c){if(o!=null&&typeof o!="object")throw Error(s(62));if(r=r.style,c!=null){for(var u in c)!c.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)&&c[m]!==u&&Ax(r,m,u)}else for(var v in o)o.hasOwnProperty(v)&&Ax(r,v,o[v])}function zp(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 jk=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"]]),Ak=/^[\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 hf(r){return Ak.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ts(){}var Lp=null;function Up(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Aa=null,ka=null;function Ox(r){var o=Ta(r);if(o&&(r=o.stateNode)){var c=r[Un]||null;e:switch(r=o.stateNode,o.type){case"input":if(Pp(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Cr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var u=c[o];if(u!==r&&u.form===r.form){var m=u[Un]||null;if(!m)throw Error(s(90));Pp(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(o=0;o<c.length;o++)u=c[o],u.form===r.form&&Cx(u)}break e;case"textarea":Nx(r,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&Na(r,!!c.multiple,o,!1)}}}var $p=!1;function Mx(r,o,c){if($p)return r(o,c);$p=!0;try{var u=r(o);return u}finally{if($p=!1,(Aa!==null||ka!==null)&&(ed(),Aa&&(o=Aa,r=ka,ka=Aa=null,Ox(o),r)))for(o=0;o<r.length;o++)Ox(r[o])}}function fl(r,o){var c=r.stateNode;if(c===null)return null;var u=c[Un]||null;if(u===null)return null;c=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(c&&typeof c!="function")throw Error(s(231,o,typeof c));return c}var Cs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bp=!1;if(Cs)try{var dl={};Object.defineProperty(dl,"passive",{get:function(){Bp=!0}}),window.addEventListener("test",dl,dl),window.removeEventListener("test",dl,dl)}catch{Bp=!1}var po=null,Fp=null,pf=null;function Ix(){if(pf)return pf;var r,o=Fp,c=o.length,u,m="value"in po?po.value:po.textContent,v=m.length;for(r=0;r<c&&o[r]===m[r];r++);var E=c-r;for(u=1;u<=E&&o[c-u]===m[v-u];u++);return pf=m.slice(r,1<u?1-u:void 0)}function mf(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 gf(){return!0}function Px(){return!1}function $n(r){function o(c,u,m,v,E){this._reactName=c,this._targetInst=m,this.type=u,this.nativeEvent=v,this.target=E,this.currentTarget=null;for(var O in r)r.hasOwnProperty(O)&&(c=r[O],this[O]=c?c(v):v[O]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?gf:Px,this.isPropagationStopped=Px,this}return y(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=gf)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=gf)},persist:function(){},isPersistent:gf}),o}var Ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yf=$n(Ti),hl=y({},Ti,{view:0,detail:0}),kk=$n(hl),Hp,qp,pl,vf=y({},hl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kp,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!==pl&&(pl&&r.type==="mousemove"?(Hp=r.screenX-pl.screenX,qp=r.screenY-pl.screenY):qp=Hp=0,pl=r),Hp)},movementY:function(r){return"movementY"in r?r.movementY:qp}}),Dx=$n(vf),Ok=y({},vf,{dataTransfer:0}),Mk=$n(Ok),Ik=y({},hl,{relatedTarget:0}),Vp=$n(Ik),Pk=y({},Ti,{animationName:0,elapsedTime:0,pseudoElement:0}),Dk=$n(Pk),zk=y({},Ti,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Lk=$n(zk),Uk=y({},Ti,{data:0}),zx=$n(Uk),$k={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bk={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"},Fk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hk(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=Fk[r])?!!o[r]:!1}function Kp(){return Hk}var qk=y({},hl,{key:function(r){if(r.key){var o=$k[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=mf(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Bk[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kp,charCode:function(r){return r.type==="keypress"?mf(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?mf(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Vk=$n(qk),Kk=y({},vf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lx=$n(Kk),Gk=y({},hl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kp}),Zk=$n(Gk),Yk=y({},Ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xk=$n(Yk),Qk=y({},vf,{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}),Wk=$n(Qk),Jk=y({},Ti,{newState:0,oldState:0}),eO=$n(Jk),tO=[9,13,27,32],Gp=Cs&&"CompositionEvent"in window,ml=null;Cs&&"documentMode"in document&&(ml=document.documentMode);var nO=Cs&&"TextEvent"in window&&!ml,Ux=Cs&&(!Gp||ml&&8<ml&&11>=ml),$x=" ",Bx=!1;function Fx(r,o){switch(r){case"keyup":return tO.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 Oa=!1;function rO(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 sO(r,o){if(Oa)return r==="compositionend"||!Gp&&Fx(r,o)?(r=Ix(),pf=Fp=po=null,Oa=!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 oO={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"?!!oO[r.type]:o==="textarea"}function Vx(r,o,c,u){Aa?ka?ka.push(u):ka=[u]:Aa=u,o=ad(o,"onChange"),0<o.length&&(c=new yf("onChange","change",null,c,u),r.push({event:c,listeners:o}))}var gl=null,yl=null;function iO(r){R_(r,0)}function bf(r){var o=ul(r);if(Cx(o))return r}function Kx(r,o){if(r==="change")return o}var Gx=!1;if(Cs){var Zp;if(Cs){var Yp="oninput"in document;if(!Yp){var Zx=document.createElement("div");Zx.setAttribute("oninput","return;"),Yp=typeof Zx.oninput=="function"}Zp=Yp}else Zp=!1;Gx=Zp&&(!document.documentMode||9<document.documentMode)}function Yx(){gl&&(gl.detachEvent("onpropertychange",Xx),yl=gl=null)}function Xx(r){if(r.propertyName==="value"&&bf(yl)){var o=[];Vx(o,yl,r,Up(r)),Mx(iO,o)}}function aO(r,o,c){r==="focusin"?(Yx(),gl=o,yl=c,gl.attachEvent("onpropertychange",Xx)):r==="focusout"&&Yx()}function cO(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return bf(yl)}function lO(r,o){if(r==="click")return bf(o)}function uO(r,o){if(r==="input"||r==="change")return bf(o)}function fO(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var rr=typeof Object.is=="function"?Object.is:fO;function vl(r,o){if(rr(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var c=Object.keys(r),u=Object.keys(o);if(c.length!==u.length)return!1;for(u=0;u<c.length;u++){var m=c[u];if(!Ue.call(o,m)||!rr(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 c=Qx(r);r=0;for(var u;c;){if(c.nodeType===3){if(u=r+c.textContent.length,r<=o&&u>=o)return{node:c,offset:o-r};r=u}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Qx(c)}}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=df(r.document);o instanceof r.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)r=o.contentWindow;else break;o=df(r.document)}return o}function Xp(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 dO=Cs&&"documentMode"in document&&11>=document.documentMode,Ma=null,Qp=null,bl=null,Wp=!1;function t0(r,o,c){var u=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Wp||Ma==null||Ma!==df(u)||(u=Ma,"selectionStart"in u&&Xp(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}),bl&&vl(bl,u)||(bl=u,u=ad(Qp,"onSelect"),0<u.length&&(o=new yf("onSelect","select",null,o,c),r.push({event:o,listeners:u}),o.target=Ma)))}function Ci(r,o){var c={};return c[r.toLowerCase()]=o.toLowerCase(),c["Webkit"+r]="webkit"+o,c["Moz"+r]="moz"+o,c}var Ia={animationend:Ci("Animation","AnimationEnd"),animationiteration:Ci("Animation","AnimationIteration"),animationstart:Ci("Animation","AnimationStart"),transitionrun:Ci("Transition","TransitionRun"),transitionstart:Ci("Transition","TransitionStart"),transitioncancel:Ci("Transition","TransitionCancel"),transitionend:Ci("Transition","TransitionEnd")},Jp={},n0={};Cs&&(n0=document.createElement("div").style,"AnimationEvent"in window||(delete Ia.animationend.animation,delete Ia.animationiteration.animation,delete Ia.animationstart.animation),"TransitionEvent"in window||delete Ia.transitionend.transition);function Ri(r){if(Jp[r])return Jp[r];if(!Ia[r])return r;var o=Ia[r],c;for(c in o)if(o.hasOwnProperty(c)&&c in n0)return Jp[r]=o[c];return r}var r0=Ri("animationend"),s0=Ri("animationiteration"),o0=Ri("animationstart"),hO=Ri("transitionrun"),pO=Ri("transitionstart"),mO=Ri("transitioncancel"),i0=Ri("transitionend"),a0=new Map,em="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(" ");em.push("scrollEnd");function Qr(r,o){a0.set(r,o),Ei(o,[r])}var xf=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)},Rr=[],Pa=0,tm=0;function Sf(){for(var r=Pa,o=tm=Pa=0;o<r;){var c=Rr[o];Rr[o++]=null;var u=Rr[o];Rr[o++]=null;var m=Rr[o];Rr[o++]=null;var v=Rr[o];if(Rr[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&&c0(c,m,v)}}function _f(r,o,c,u){Rr[Pa++]=r,Rr[Pa++]=o,Rr[Pa++]=c,Rr[Pa++]=u,tm|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function nm(r,o,c,u){return _f(r,o,c,u),wf(r)}function Ni(r,o){return _f(r,null,null,o),wf(r)}function c0(r,o,c){r.lanes|=c;var u=r.alternate;u!==null&&(u.lanes|=c);for(var m=!1,v=r.return;v!==null;)v.childLanes|=c,u=v.alternate,u!==null&&(u.childLanes|=c),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(c),r=v.hiddenUpdates,u=r[m],u===null?r[m]=[o]:u.push(o),o.lane=c|536870912),v):null}function wf(r){if(50<Bl)throw Bl=0,fg=null,Error(s(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var Da={};function gO(r,o,c,u){this.tag=r,this.key=c,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 sr(r,o,c,u){return new gO(r,o,c,u)}function rm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Rs(r,o){var c=r.alternate;return c===null?(c=sr(r.tag,o,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=o,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,o=r.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function l0(r,o){r.flags&=65011714;var c=r.alternate;return c===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=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,o=c.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function Ef(r,o,c,u,m,v){var E=0;if(u=r,typeof r=="function")rm(r)&&(E=1);else if(typeof r=="string")E=SM(r,c,X.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case P:return r=sr(31,c,o,m),r.elementType=P,r.lanes=v,r;case w:return ji(c.children,m,v,o);case T:E=8,m|=24;break;case C:return r=sr(12,c,o,m|2),r.elementType=C,r.lanes=v,r;case M:return r=sr(13,c,o,m),r.elementType=M,r.lanes=v,r;case L:return r=sr(19,c,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 k:E=9;break e;case R:E=11;break e;case j:E=14;break e;case A:E=16,u=null;break e}E=29,c=Error(s(130,r===null?"null":typeof r,"")),u=null}return o=sr(E,c,o,m),o.elementType=r,o.type=u,o.lanes=v,o}function ji(r,o,c,u){return r=sr(7,r,u,o),r.lanes=c,r}function sm(r,o,c){return r=sr(6,r,null,o),r.lanes=c,r}function u0(r){var o=sr(18,null,null,0);return o.stateNode=r,o}function om(r,o,c){return o=sr(4,r.children!==null?r.children:[],r.key,o),o.lanes=c,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var f0=new WeakMap;function Nr(r,o){if(typeof r=="object"&&r!==null){var c=f0.get(r);return c!==void 0?c:(o={value:r,source:o,stack:ye(o)},f0.set(r,o),o)}return{value:r,source:o,stack:ye(o)}}var za=[],La=0,Tf=null,xl=0,jr=[],Ar=0,mo=null,us=1,fs="";function Ns(r,o){za[La++]=xl,za[La++]=Tf,Tf=r,xl=o}function d0(r,o,c){jr[Ar++]=us,jr[Ar++]=fs,jr[Ar++]=mo,mo=r;var u=us;r=fs;var m=32-xt(u)-1;u&=~(1<<m),c+=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,us=1<<32-xt(o)+m|c<<m|u,fs=v+r}else us=1<<v|c<<m|u,fs=r}function im(r){r.return!==null&&(Ns(r,1),d0(r,1,0))}function am(r){for(;r===Tf;)Tf=za[--La],za[La]=null,xl=za[--La],za[La]=null;for(;r===mo;)mo=jr[--Ar],jr[Ar]=null,fs=jr[--Ar],jr[Ar]=null,us=jr[--Ar],jr[Ar]=null}function h0(r,o){jr[Ar++]=us,jr[Ar++]=fs,jr[Ar++]=mo,us=o.id,fs=o.overflow,mo=r}var _n=null,Mt=null,rt=!1,go=null,kr=!1,cm=Error(s(519));function yo(r){var o=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sl(Nr(o,r)),cm}function p0(r){var o=r.stateNode,c=r.type,u=r.memoizedProps;switch(o[Sn]=r,o[Un]=u,c){case"dialog":et("cancel",o),et("close",o);break;case"iframe":case"object":case"embed":et("load",o);break;case"video":case"audio":for(c=0;c<Hl.length;c++)et(Hl[c],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)}c=u.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||u.suppressHydrationWarning===!0||k_(o.textContent,c)?(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=Ts),o=!0):o=!1,o||yo(r,!0)}function m0(r){for(_n=r.return;_n;)switch(_n.tag){case 5:case 31:case 13:kr=!1;return;case 27:case 3:kr=!0;return;default:_n=_n.return}}function Ua(r){if(r!==_n)return!1;if(!rt)return m0(r),rt=!0,!1;var o=r.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||Cg(r.type,r.memoizedProps)),c=!c),c&&Mt&&yo(r),m0(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Mt=$_(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Mt=$_(r)}else o===27?(o=Mt,ko(r.type)?(r=kg,kg=null,Mt=r):Mt=o):Mt=_n?Mr(r.stateNode.nextSibling):null;return!0}function Ai(){Mt=_n=null,rt=!1}function lm(){var r=go;return r!==null&&(qn===null?qn=r:qn.push.apply(qn,r),go=null),r}function Sl(r){go===null?go=[r]:go.push(r)}var um=I(null),ki=null,js=null;function vo(r,o,c){W(um,o._currentValue),o._currentValue=c}function As(r){r._currentValue=um.current,H(um)}function fm(r,o,c){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===c)break;r=r.return}}function dm(r,o,c,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 O=v;v=m;for(var $=0;$<o.length;$++)if(O.context===o[$]){v.lanes|=c,O=v.alternate,O!==null&&(O.lanes|=c),fm(v.return,c,r),u||(E=null);break e}v=O.next}}else if(m.tag===18){if(E=m.return,E===null)throw Error(s(341));E.lanes|=c,v=E.alternate,v!==null&&(v.lanes|=c),fm(E,c,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 $a(r,o,c,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 O=m.type;rr(m.pendingProps.value,E.value)||(r!==null?r.push(O):r=[O])}}else if(m===de.current){if(E=m.alternate,E===null)throw Error(s(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r!==null?r.push(Zl):r=[Zl])}m=m.return}r!==null&&dm(o,r,c,u),o.flags|=262144}function Cf(r){for(r=r.firstContext;r!==null;){if(!rr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Oi(r){ki=r,js=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function wn(r){return g0(ki,r)}function Rf(r,o){return ki===null&&Oi(r),g0(r,o)}function g0(r,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},js===null){if(r===null)throw Error(s(308));js=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else js=js.next=o;return c}var yO=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(c,u){r.push(u)}};this.abort=function(){o.aborted=!0,r.forEach(function(c){return c()})}},vO=e.unstable_scheduleCallback,bO=e.unstable_NormalPriority,nn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hm(){return{controller:new yO,data:new Map,refCount:0}}function _l(r){r.refCount--,r.refCount===0&&vO(bO,function(){r.controller.abort()})}var wl=null,pm=0,Ba=0,Fa=null;function xO(r,o){if(wl===null){var c=wl=[];pm=0,Ba=yg(),Fa={status:"pending",value:void 0,then:function(u){c.push(u)}}}return pm++,o.then(y0,y0),o}function y0(){if(--pm===0&&wl!==null){Fa!==null&&(Fa.status="fulfilled");var r=wl;wl=null,Ba=0,Fa=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function SO(r,o){var c=[],u={status:"pending",value:null,reason:null,then:function(m){c.push(m)}};return r.then(function(){u.status="fulfilled",u.value=o;for(var m=0;m<c.length;m++)(0,c[m])(o)},function(m){for(u.status="rejected",u.reason=m,m=0;m<c.length;m++)(0,c[m])(void 0)}),u}var v0=D.S;D.S=function(r,o){t_=Be(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&xO(r,o),v0!==null&&v0(r,o)};var Mi=I(null);function mm(){var r=Mi.current;return r!==null?r:Nt.pooledCache}function Nf(r,o){o===null?W(Mi,Mi.current):W(Mi,o.pool)}function b0(){var r=mm();return r===null?null:{parent:nn._currentValue,pool:r}}var Ha=Error(s(460)),gm=Error(s(474)),jf=Error(s(542)),Af={then:function(){}};function x0(r){return r=r.status,r==="fulfilled"||r==="rejected"}function S0(r,o,c){switch(c=r[c],c===void 0?r.push(o):c!==o&&(o.then(Ts,Ts),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,w0(r),r;default:if(typeof o.status=="string")o.then(Ts,Ts);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 Pi=o,Ha}}function Ii(r){try{var o=r._init;return o(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Pi=c,Ha):c}}var Pi=null;function _0(){if(Pi===null)throw Error(s(459));var r=Pi;return Pi=null,r}function w0(r){if(r===Ha||r===jf)throw Error(s(483))}var qa=null,El=0;function kf(r){var o=El;return El+=1,qa===null&&(qa=[]),S0(qa,r,o)}function Tl(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function Of(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,F){if(r){var J=Z.deletions;J===null?(Z.deletions=[F],Z.flags|=16):J.push(F)}}function c(Z,F){if(!r)return null;for(;F!==null;)o(Z,F),F=F.sibling;return null}function u(Z){for(var F=new Map;Z!==null;)Z.key!==null?F.set(Z.key,Z):F.set(Z.index,Z),Z=Z.sibling;return F}function m(Z,F){return Z=Rs(Z,F),Z.index=0,Z.sibling=null,Z}function v(Z,F,J){return Z.index=J,r?(J=Z.alternate,J!==null?(J=J.index,J<F?(Z.flags|=67108866,F):J):(Z.flags|=67108866,F)):(Z.flags|=1048576,F)}function E(Z){return r&&Z.alternate===null&&(Z.flags|=67108866),Z}function O(Z,F,J,le){return F===null||F.tag!==6?(F=sm(J,Z.mode,le),F.return=Z,F):(F=m(F,J),F.return=Z,F)}function $(Z,F,J,le){var ze=J.type;return ze===w?ce(Z,F,J.props.children,le,J.key):F!==null&&(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Ii(ze)===F.type)?(F=m(F,J.props),Tl(F,J),F.return=Z,F):(F=Ef(J.type,J.key,J.props,null,Z.mode,le),Tl(F,J),F.return=Z,F)}function te(Z,F,J,le){return F===null||F.tag!==4||F.stateNode.containerInfo!==J.containerInfo||F.stateNode.implementation!==J.implementation?(F=om(J,Z.mode,le),F.return=Z,F):(F=m(F,J.children||[]),F.return=Z,F)}function ce(Z,F,J,le,ze){return F===null||F.tag!==7?(F=ji(J,Z.mode,le,ze),F.return=Z,F):(F=m(F,J),F.return=Z,F)}function fe(Z,F,J){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=sm(""+F,Z.mode,J),F.return=Z,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case x:return J=Ef(F.type,F.key,F.props,null,Z.mode,J),Tl(J,F),J.return=Z,J;case S:return F=om(F,Z.mode,J),F.return=Z,F;case A:return F=Ii(F),fe(Z,F,J)}if(ee(F)||z(F))return F=ji(F,Z.mode,J,null),F.return=Z,F;if(typeof F.then=="function")return fe(Z,kf(F),J);if(F.$$typeof===N)return fe(Z,Rf(Z,F),J);Of(Z,F)}return null}function re(Z,F,J,le){var ze=F!==null?F.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ze!==null?null:O(Z,F,""+J,le);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===ze?$(Z,F,J,le):null;case S:return J.key===ze?te(Z,F,J,le):null;case A:return J=Ii(J),re(Z,F,J,le)}if(ee(J)||z(J))return ze!==null?null:ce(Z,F,J,le,null);if(typeof J.then=="function")return re(Z,F,kf(J),le);if(J.$$typeof===N)return re(Z,F,Rf(Z,J),le);Of(Z,J)}return null}function ie(Z,F,J,le,ze){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Z=Z.get(J)||null,O(F,Z,""+le,ze);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case x:return Z=Z.get(le.key===null?J:le.key)||null,$(F,Z,le,ze);case S:return Z=Z.get(le.key===null?J:le.key)||null,te(F,Z,le,ze);case A:return le=Ii(le),ie(Z,F,J,le,ze)}if(ee(le)||z(le))return Z=Z.get(J)||null,ce(F,Z,le,ze,null);if(typeof le.then=="function")return ie(Z,F,J,kf(le),ze);if(le.$$typeof===N)return ie(Z,F,J,Rf(F,le),ze);Of(F,le)}return null}function Re(Z,F,J,le){for(var ze=null,ft=null,ke=F,Ye=F=0,nt=null;ke!==null&&Ye<J.length;Ye++){ke.index>Ye?(nt=ke,ke=null):nt=ke.sibling;var dt=re(Z,ke,J[Ye],le);if(dt===null){ke===null&&(ke=nt);break}r&&ke&&dt.alternate===null&&o(Z,ke),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt,ke=nt}if(Ye===J.length)return c(Z,ke),rt&&Ns(Z,Ye),ze;if(ke===null){for(;Ye<J.length;Ye++)ke=fe(Z,J[Ye],le),ke!==null&&(F=v(ke,F,Ye),ft===null?ze=ke:ft.sibling=ke,ft=ke);return rt&&Ns(Z,Ye),ze}for(ke=u(ke);Ye<J.length;Ye++)nt=ie(ke,Z,Ye,J[Ye],le),nt!==null&&(r&&nt.alternate!==null&&ke.delete(nt.key===null?Ye:nt.key),F=v(nt,F,Ye),ft===null?ze=nt:ft.sibling=nt,ft=nt);return r&&ke.forEach(function(Do){return o(Z,Do)}),rt&&Ns(Z,Ye),ze}function $e(Z,F,J,le){if(J==null)throw Error(s(151));for(var ze=null,ft=null,ke=F,Ye=F=0,nt=null,dt=J.next();ke!==null&&!dt.done;Ye++,dt=J.next()){ke.index>Ye?(nt=ke,ke=null):nt=ke.sibling;var Do=re(Z,ke,dt.value,le);if(Do===null){ke===null&&(ke=nt);break}r&&ke&&Do.alternate===null&&o(Z,ke),F=v(Do,F,Ye),ft===null?ze=Do:ft.sibling=Do,ft=Do,ke=nt}if(dt.done)return c(Z,ke),rt&&Ns(Z,Ye),ze;if(ke===null){for(;!dt.done;Ye++,dt=J.next())dt=fe(Z,dt.value,le),dt!==null&&(F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return rt&&Ns(Z,Ye),ze}for(ke=u(ke);!dt.done;Ye++,dt=J.next())dt=ie(ke,Z,Ye,dt.value,le),dt!==null&&(r&&dt.alternate!==null&&ke.delete(dt.key===null?Ye:dt.key),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return r&&ke.forEach(function(OM){return o(Z,OM)}),rt&&Ns(Z,Ye),ze}function Ct(Z,F,J,le){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 ze=J.key;F!==null;){if(F.key===ze){if(ze=J.type,ze===w){if(F.tag===7){c(Z,F.sibling),le=m(F,J.props.children),le.return=Z,Z=le;break e}}else if(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Ii(ze)===F.type){c(Z,F.sibling),le=m(F,J.props),Tl(le,J),le.return=Z,Z=le;break e}c(Z,F);break}else o(Z,F);F=F.sibling}J.type===w?(le=ji(J.props.children,Z.mode,le,J.key),le.return=Z,Z=le):(le=Ef(J.type,J.key,J.props,null,Z.mode,le),Tl(le,J),le.return=Z,Z=le)}return E(Z);case S:e:{for(ze=J.key;F!==null;){if(F.key===ze)if(F.tag===4&&F.stateNode.containerInfo===J.containerInfo&&F.stateNode.implementation===J.implementation){c(Z,F.sibling),le=m(F,J.children||[]),le.return=Z,Z=le;break e}else{c(Z,F);break}else o(Z,F);F=F.sibling}le=om(J,Z.mode,le),le.return=Z,Z=le}return E(Z);case A:return J=Ii(J),Ct(Z,F,J,le)}if(ee(J))return Re(Z,F,J,le);if(z(J)){if(ze=z(J),typeof ze!="function")throw Error(s(150));return J=ze.call(J),$e(Z,F,J,le)}if(typeof J.then=="function")return Ct(Z,F,kf(J),le);if(J.$$typeof===N)return Ct(Z,F,Rf(Z,J),le);Of(Z,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,F!==null&&F.tag===6?(c(Z,F.sibling),le=m(F,J),le.return=Z,Z=le):(c(Z,F),le=sm(J,Z.mode,le),le.return=Z,Z=le),E(Z)):c(Z,F)}return function(Z,F,J,le){try{El=0;var ze=Ct(Z,F,J,le);return qa=null,ze}catch(ke){if(ke===Ha||ke===jf)throw ke;var ft=sr(29,ke,null,Z.mode);return ft.lanes=le,ft.return=Z,ft}}}var Di=E0(!0),T0=E0(!1),bo=!1;function ym(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vm(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 xo(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function So(r,o,c){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=wf(r),c0(r,null,c),o}return _f(r,u,o,c),wf(r)}function Cl(r,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var u=o.lanes;u&=r.pendingLanes,c|=u,o.lanes=c,uo(r,c)}}function bm(r,o){var c=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,c===u)){var m=null,v=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};v===null?m=v=E:v=v.next=E,c=c.next}while(c!==null);v===null?m=v=o:v=v.next=o}else m=v=o;c={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=o:r.next=o,c.lastBaseUpdate=o}var xm=!1;function Rl(){if(xm){var r=Fa;if(r!==null)throw r}}function Nl(r,o,c,u){xm=!1;var m=r.updateQueue;bo=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,O=m.shared.pending;if(O!==null){m.shared.pending=null;var $=O,te=$.next;$.next=null,E===null?v=te:E.next=te,E=$;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,O=ce.lastBaseUpdate,O!==E&&(O===null?ce.firstBaseUpdate=te:O.next=te,ce.lastBaseUpdate=$))}if(v!==null){var fe=m.baseState;E=0,ce=te=$=null,O=v;do{var re=O.lane&-536870913,ie=re!==O.lane;if(ie?(tt&re)===re:(u&re)===re){re!==0&&re===Ba&&(xm=!0),ce!==null&&(ce=ce.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Re=r,$e=O;re=o;var Ct=c;switch($e.tag){case 1:if(Re=$e.payload,typeof Re=="function"){fe=Re.call(Ct,fe,re);break e}fe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=$e.payload,re=typeof Re=="function"?Re.call(Ct,fe,re):Re,re==null)break e;fe=y({},fe,re);break e;case 2:bo=!0}}re=O.callback,re!==null&&(r.flags|=64,ie&&(r.flags|=8192),ie=m.callbacks,ie===null?m.callbacks=[re]:ie.push(re))}else ie={lane:re,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ce===null?(te=ce=ie,$=fe):ce=ce.next=ie,E|=re;if(O=O.next,O===null){if(O=m.shared.pending,O===null)break;ie=O,O=ie.next,ie.next=null,m.lastBaseUpdate=ie,m.shared.pending=null}}while(!0);ce===null&&($=fe),m.baseState=$,m.firstBaseUpdate=te,m.lastBaseUpdate=ce,v===null&&(m.shared.lanes=0),Co|=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 c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)C0(c[r],o)}var Va=I(null),Mf=I(0);function N0(r,o){r=Us,W(Mf,r),W(Va,o),Us=r|o.baseLanes}function Sm(){W(Mf,Us),W(Va,Va.current)}function _m(){Us=Mf.current,H(Va),H(Mf)}var or=I(null),Or=null;function _o(r){var o=r.alternate;W(Jt,Jt.current&1),W(or,r),Or===null&&(o===null||Va.current!==null||o.memoizedState!==null)&&(Or=r)}function wm(r){W(Jt,Jt.current),W(or,r),Or===null&&(Or=r)}function j0(r){r.tag===22?(W(Jt,Jt.current),W(or,r),Or===null&&(Or=r)):wo()}function wo(){W(Jt,Jt.current),W(or,or.current)}function ir(r){H(or),Or===r&&(Or=null),H(Jt)}var Jt=I(0);function If(r){for(var o=r;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||jg(c)||Ag(c)))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 ks=0,Ze=null,Et=null,rn=null,Pf=!1,Ka=!1,zi=!1,Df=0,jl=0,Ga=null,_O=0;function Kt(){throw Error(s(321))}function Em(r,o){if(o===null)return!1;for(var c=0;c<o.length&&c<r.length;c++)if(!rr(r[c],o[c]))return!1;return!0}function Tm(r,o,c,u,m,v){return ks=v,Ze=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,D.H=r===null||r.memoizedState===null?dS:$m,zi=!1,v=c(u,m),zi=!1,Ka&&(v=k0(o,c,u,m)),A0(r),v}function A0(r){D.H=Ol;var o=Et!==null&&Et.next!==null;if(ks=0,rn=Et=Ze=null,Pf=!1,jl=0,Ga=null,o)throw Error(s(300));r===null||sn||(r=r.dependencies,r!==null&&Cf(r)&&(sn=!0))}function k0(r,o,c,u){Ze=r;var m=0;do{if(Ka&&(Ga=null),jl=0,Ka=!1,25<=m)throw Error(s(301));if(m+=1,rn=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)}D.H=hS,v=o(c,u)}while(Ka);return v}function wO(){var r=D.H,o=r.useState()[0];return o=typeof o.then=="function"?Al(o):o,r=r.useState()[0],(Et!==null?Et.memoizedState:null)!==r&&(Ze.flags|=1024),o}function Cm(){var r=Df!==0;return Df=0,r}function Rm(r,o,c){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~c}function Nm(r){if(Pf){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Pf=!1}ks=0,rn=Et=Ze=null,Ka=!1,jl=Df=0,Ga=null}function kn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Ze.memoizedState=rn=r:rn=rn.next=r,rn}function en(){if(Et===null){var r=Ze.alternate;r=r!==null?r.memoizedState:null}else r=Et.next;var o=rn===null?Ze.memoizedState:rn.next;if(o!==null)rn=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},rn===null?Ze.memoizedState=rn=r:rn=rn.next=r}return rn}function zf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Al(r){var o=jl;return jl+=1,Ga===null&&(Ga=[]),r=S0(Ga,r,o),o=Ze,(rn===null?o.memoizedState:rn.next)===null&&(o=o.alternate,D.H=o===null||o.memoizedState===null?dS:$m),r}function Lf(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Al(r);if(r.$$typeof===N)return wn(r)}throw Error(s(438,String(r)))}function jm(r){var o=null,c=Ze.updateQueue;if(c!==null&&(o=c.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}),c===null&&(c=zf(),Ze.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(r),u=0;u<r;u++)c[u]=G;return o.index++,c}function Os(r,o){return typeof o=="function"?o(r):o}function Uf(r){var o=en();return Am(o,Et,r)}function Am(r,o,c){var u=r.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=c;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 O=E=null,$=null,te=o,ce=!1;do{var fe=te.lane&-536870913;if(fe!==te.lane?(tt&fe)===fe:(ks&fe)===fe){var re=te.revertLane;if(re===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),fe===Ba&&(ce=!0);else if((ks&re)===re){te=te.next,re===Ba&&(ce=!0);continue}else fe={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(O=$=fe,E=v):$=$.next=fe,Ze.lanes|=re,Co|=re;fe=te.action,zi&&c(v,fe),v=te.hasEagerState?te.eagerState:c(v,fe)}else re={lane:fe,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(O=$=re,E=v):$=$.next=re,Ze.lanes|=fe,Co|=fe;te=te.next}while(te!==null&&te!==o);if($===null?E=v:$.next=O,!rr(v,r.memoizedState)&&(sn=!0,ce&&(c=Fa,c!==null)))throw c;r.memoizedState=v,r.baseState=E,r.baseQueue=$,u.lastRenderedState=v}return m===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function km(r){var o=en(),c=o.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var u=c.dispatch,m=c.pending,v=o.memoizedState;if(m!==null){c.pending=null;var E=m=m.next;do v=r(v,E.action),E=E.next;while(E!==m);rr(v,o.memoizedState)||(sn=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),c.lastRenderedState=v}return[v,u]}function O0(r,o,c){var u=Ze,m=en(),v=rt;if(v){if(c===void 0)throw Error(s(407));c=c()}else c=o();var E=!rr((Et||m).memoizedState,c);if(E&&(m.memoizedState=c,sn=!0),m=m.queue,Im(P0.bind(null,u,m,r),[r]),m.getSnapshot!==o||E||rn!==null&&rn.memoizedState.tag&1){if(u.flags|=2048,Za(9,{destroy:void 0},I0.bind(null,u,m,c,o),null),Nt===null)throw Error(s(349));v||(ks&127)!==0||M0(u,o,c)}return c}function M0(r,o,c){r.flags|=16384,r={getSnapshot:o,value:c},o=Ze.updateQueue,o===null?(o=zf(),Ze.updateQueue=o,o.stores=[r]):(c=o.stores,c===null?o.stores=[r]:c.push(r))}function I0(r,o,c,u){o.value=c,o.getSnapshot=u,D0(o)&&z0(r)}function P0(r,o,c){return c(function(){D0(o)&&z0(r)})}function D0(r){var o=r.getSnapshot;r=r.value;try{var c=o();return!rr(r,c)}catch{return!0}}function z0(r){var o=Ni(r,2);o!==null&&Vn(o,r,2)}function Om(r){var o=kn();if(typeof r=="function"){var c=r;if(r=c(),zi){ut(!0);try{c()}finally{ut(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:r},o}function L0(r,o,c,u){return r.baseState=c,Am(r,Et,typeof u=="function"?u:Os)}function EO(r,o,c,u,m){if(Ff(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)}};D.T!==null?c(!0):v.isTransition=!1,u(v),c=o.pending,c===null?(v.next=o.pending=v,U0(o,v)):(v.next=c.next,o.pending=c.next=v)}}function U0(r,o){var c=o.action,u=o.payload,m=r.state;if(o.isTransition){var v=D.T,E={};D.T=E;try{var O=c(m,u),$=D.S;$!==null&&$(E,O),$0(r,o,O)}catch(te){Mm(r,o,te)}finally{v!==null&&E.types!==null&&(v.types=E.types),D.T=v}}else try{v=c(m,u),$0(r,o,v)}catch(te){Mm(r,o,te)}}function $0(r,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(u){B0(r,o,u)},function(u){return Mm(r,o,u)}):B0(r,o,c)}function B0(r,o,c){o.status="fulfilled",o.value=c,F0(o),r.state=c,o=r.pending,o!==null&&(c=o.next,c===o?r.pending=null:(c=c.next,o.next=c,U0(r,c)))}function Mm(r,o,c){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=c,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 c=Nt.formState;if(c!==null){e:{var u=Ze;if(rt){if(Mt){t:{for(var m=Mt,v=kr;m.nodeType!==8;){if(!v){m=null;break t}if(m=Mr(m.nextSibling),m===null){m=null;break t}}v=m.data,m=v==="F!"||v==="F"?m:null}if(m){Mt=Mr(m.nextSibling),u=m.data==="F!";break e}}yo(u)}u=!1}u&&(o=c[0])}}return c=kn(),c.memoizedState=c.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:H0,lastRenderedState:o},c.queue=u,c=lS.bind(null,Ze,u),u.dispatch=c,u=Om(!1),v=Um.bind(null,Ze,!1,u.queue),u=kn(),m={state:o,dispatch:null,action:r,pending:null},u.queue=m,c=EO.bind(null,Ze,m,v,c),m.dispatch=c,u.memoizedState=r,[o,c,!1]}function V0(r){var o=en();return K0(o,Et,r)}function K0(r,o,c){if(o=Am(r,o,H0)[0],r=Uf(Os)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Al(o)}catch(E){throw E===Ha?jf:E}else u=o;o=en();var m=o.queue,v=m.dispatch;return c!==o.memoizedState&&(Ze.flags|=2048,Za(9,{destroy:void 0},TO.bind(null,m,c),null)),[u,v,r]}function TO(r,o){r.action=o}function G0(r){var o=en(),c=Et;if(c!==null)return K0(o,c,r);en(),o=o.memoizedState,c=en();var u=c.queue.dispatch;return c.memoizedState=r,[o,u,!1]}function Za(r,o,c,u){return r={tag:r,create:c,deps:u,inst:o,next:null},o=Ze.updateQueue,o===null&&(o=zf(),Ze.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=r.next=r:(u=c.next,c.next=r,r.next=u,o.lastEffect=r),r}function Z0(){return en().memoizedState}function $f(r,o,c,u){var m=kn();Ze.flags|=r,m.memoizedState=Za(1|o,{destroy:void 0},c,u===void 0?null:u)}function Bf(r,o,c,u){var m=en();u=u===void 0?null:u;var v=m.memoizedState.inst;Et!==null&&u!==null&&Em(u,Et.memoizedState.deps)?m.memoizedState=Za(o,v,c,u):(Ze.flags|=r,m.memoizedState=Za(1|o,v,c,u))}function Y0(r,o){$f(8390656,8,r,o)}function Im(r,o){Bf(2048,8,r,o)}function CO(r){Ze.flags|=4;var o=Ze.updateQueue;if(o===null)o=zf(),Ze.updateQueue=o,o.events=[r];else{var c=o.events;c===null?o.events=[r]:c.push(r)}}function X0(r){var o=en().memoizedState;return CO({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 Bf(4,2,r,o)}function W0(r,o){return Bf(4,4,r,o)}function J0(r,o){if(typeof o=="function"){r=r();var c=o(r);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function eS(r,o,c){c=c!=null?c.concat([r]):null,Bf(4,4,J0.bind(null,o,r),c)}function Pm(){}function tS(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;return o!==null&&Em(o,u[1])?u[0]:(c.memoizedState=[r,o],r)}function nS(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;if(o!==null&&Em(o,u[1]))return u[0];if(u=r(),zi){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u}function Dm(r,o,c){return c===void 0||(ks&1073741824)!==0&&(tt&261930)===0?r.memoizedState=o:(r.memoizedState=c,r=r_(),Ze.lanes|=r,Co|=r,c)}function rS(r,o,c,u){return rr(c,o)?c:Va.current!==null?(r=Dm(r,c,u),rr(r,o)||(sn=!0),r):(ks&42)===0||(ks&1073741824)!==0&&(tt&261930)===0?(sn=!0,r.memoizedState=c):(r=r_(),Ze.lanes|=r,Co|=r,o)}function sS(r,o,c,u,m){var v=K.p;K.p=v!==0&&8>v?v:8;var E=D.T,O={};D.T=O,Um(r,!1,o,c);try{var $=m(),te=D.S;if(te!==null&&te(O,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ce=SO($,u);kl(r,o,ce,lr(r))}else kl(r,o,u,lr(r))}catch(fe){kl(r,o,{then:function(){},status:"rejected",reason:fe},lr())}finally{K.p=v,E!==null&&O.types!==null&&(E.types=O.types),D.T=E}}function RO(){}function zm(r,o,c,u){if(r.tag!==5)throw Error(s(476));var m=oS(r).queue;sS(r,m,o,q,c===null?RO:function(){return iS(r),c(u)})}function oS(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:q},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:c},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),kl(r,o.next.queue,{},lr())}function Lm(){return wn(Zl)}function aS(){return en().memoizedState}function cS(){return en().memoizedState}function NO(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var c=lr();r=xo(c);var u=So(o,r,c);u!==null&&(Vn(u,o,c),Cl(u,o,c)),o={cache:hm()},r.payload=o;return}o=o.return}}function jO(r,o,c){var u=lr();c={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Ff(r)?uS(o,c):(c=nm(r,o,c,u),c!==null&&(Vn(c,r,u),fS(c,o,u)))}function lS(r,o,c){var u=lr();kl(r,o,c,u)}function kl(r,o,c,u){var m={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Ff(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,O=v(E,c);if(m.hasEagerState=!0,m.eagerState=O,rr(O,E))return _f(r,o,m,0),Nt===null&&Sf(),!1}catch{}if(c=nm(r,o,m,u),c!==null)return Vn(c,r,u),fS(c,o,u),!0}return!1}function Um(r,o,c,u){if(u={lane:2,revertLane:yg(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ff(r)){if(o)throw Error(s(479))}else o=nm(r,c,u,2),o!==null&&Vn(o,r,2)}function Ff(r){var o=r.alternate;return r===Ze||o!==null&&o===Ze}function uS(r,o){Ka=Pf=!0;var c=r.pending;c===null?o.next=o:(o.next=c.next,c.next=o),r.pending=o}function fS(r,o,c){if((c&4194048)!==0){var u=o.lanes;u&=r.pendingLanes,c|=u,o.lanes=c,uo(r,c)}}var Ol={readContext:wn,use:Lf,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};Ol.useEffectEvent=Kt;var dS={readContext:wn,use:Lf,useCallback:function(r,o){return kn().memoizedState=[r,o===void 0?null:o],r},useContext:wn,useEffect:Y0,useImperativeHandle:function(r,o,c){c=c!=null?c.concat([r]):null,$f(4194308,4,J0.bind(null,o,r),c)},useLayoutEffect:function(r,o){return $f(4194308,4,r,o)},useInsertionEffect:function(r,o){$f(4,2,r,o)},useMemo:function(r,o){var c=kn();o=o===void 0?null:o;var u=r();if(zi){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u},useReducer:function(r,o,c){var u=kn();if(c!==void 0){var m=c(o);if(zi){ut(!0);try{c(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=jO.bind(null,Ze,r),[u.memoizedState,r]},useRef:function(r){var o=kn();return r={current:r},o.memoizedState=r},useState:function(r){r=Om(r);var o=r.queue,c=lS.bind(null,Ze,o);return o.dispatch=c,[r.memoizedState,c]},useDebugValue:Pm,useDeferredValue:function(r,o){var c=kn();return Dm(c,r,o)},useTransition:function(){var r=Om(!1);return r=sS.bind(null,Ze,r.queue,!0,!1),kn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,c){var u=Ze,m=kn();if(rt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=o(),Nt===null)throw Error(s(349));(tt&127)!==0||M0(u,o,c)}m.memoizedState=c;var v={value:c,getSnapshot:o};return m.queue=v,Y0(P0.bind(null,u,v,r),[r]),u.flags|=2048,Za(9,{destroy:void 0},I0.bind(null,u,v,c,o),null),c},useId:function(){var r=kn(),o=Nt.identifierPrefix;if(rt){var c=fs,u=us;c=(u&~(1<<32-xt(u)-1)).toString(32)+c,o="_"+o+"R_"+c,c=Df++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=_O++,o="_"+o+"r_"+c.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Lm,useFormState:q0,useActionState:q0,useOptimistic:function(r){var o=kn();o.memoizedState=o.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Um.bind(null,Ze,!0,c),c.dispatch=o,[r,o]},useMemoCache:jm,useCacheRefresh:function(){return kn().memoizedState=NO.bind(null,Ze)},useEffectEvent:function(r){var o=kn(),c={impl:r};return o.memoizedState=c,function(){if((gt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},$m={readContext:wn,use:Lf,useCallback:tS,useContext:wn,useEffect:Im,useImperativeHandle:eS,useInsertionEffect:Q0,useLayoutEffect:W0,useMemo:nS,useReducer:Uf,useRef:Z0,useState:function(){return Uf(Os)},useDebugValue:Pm,useDeferredValue:function(r,o){var c=en();return rS(c,Et.memoizedState,r,o)},useTransition:function(){var r=Uf(Os)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Al(r),o]},useSyncExternalStore:O0,useId:aS,useHostTransitionStatus:Lm,useFormState:V0,useActionState:V0,useOptimistic:function(r,o){var c=en();return L0(c,Et,r,o)},useMemoCache:jm,useCacheRefresh:cS};$m.useEffectEvent=X0;var hS={readContext:wn,use:Lf,useCallback:tS,useContext:wn,useEffect:Im,useImperativeHandle:eS,useInsertionEffect:Q0,useLayoutEffect:W0,useMemo:nS,useReducer:km,useRef:Z0,useState:function(){return km(Os)},useDebugValue:Pm,useDeferredValue:function(r,o){var c=en();return Et===null?Dm(c,r,o):rS(c,Et.memoizedState,r,o)},useTransition:function(){var r=km(Os)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Al(r),o]},useSyncExternalStore:O0,useId:aS,useHostTransitionStatus:Lm,useFormState:G0,useActionState:G0,useOptimistic:function(r,o){var c=en();return Et!==null?L0(c,Et,r,o):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:jm,useCacheRefresh:cS};hS.useEffectEvent=X0;function Bm(r,o,c,u){o=r.memoizedState,c=c(u,o),c=c==null?o:y({},o,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Fm={enqueueSetState:function(r,o,c){r=r._reactInternals;var u=lr(),m=xo(u);m.payload=o,c!=null&&(m.callback=c),o=So(r,m,u),o!==null&&(Vn(o,r,u),Cl(o,r,u))},enqueueReplaceState:function(r,o,c){r=r._reactInternals;var u=lr(),m=xo(u);m.tag=1,m.payload=o,c!=null&&(m.callback=c),o=So(r,m,u),o!==null&&(Vn(o,r,u),Cl(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var c=lr(),u=xo(c);u.tag=2,o!=null&&(u.callback=o),o=So(r,u,c),o!==null&&(Vn(o,r,c),Cl(o,r,c))}};function pS(r,o,c,u,m,v,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,v,E):o.prototype&&o.prototype.isPureReactComponent?!vl(c,u)||!vl(m,v):!0}function mS(r,o,c,u){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,u),o.state!==r&&Fm.enqueueReplaceState(o,o.state,null)}function Li(r,o){var c=o;if("ref"in o){c={};for(var u in o)u!=="ref"&&(c[u]=o[u])}if(r=r.defaultProps){c===o&&(c=y({},c));for(var m in r)c[m]===void 0&&(c[m]=r[m])}return c}function gS(r){xf(r)}function yS(r){console.error(r)}function vS(r){xf(r)}function Hf(r,o){try{var c=r.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function bS(r,o,c){try{var u=r.onCaughtError;u(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Hm(r,o,c){return c=xo(c),c.tag=3,c.payload={element:null},c.callback=function(){Hf(r,o)},c}function xS(r){return r=xo(r),r.tag=3,r}function SS(r,o,c,u){var m=c.type.getDerivedStateFromError;if(typeof m=="function"){var v=u.value;r.payload=function(){return m(v)},r.callback=function(){bS(o,c,u)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(r.callback=function(){bS(o,c,u),typeof m!="function"&&(Ro===null?Ro=new Set([this]):Ro.add(this));var O=u.stack;this.componentDidCatch(u.value,{componentStack:O!==null?O:""})})}function AO(r,o,c,u,m){if(c.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=c.alternate,o!==null&&$a(o,c,m,!0),c=or.current,c!==null){switch(c.tag){case 31:case 13:return Or===null?td():c.alternate===null&&Gt===0&&(Gt=3),c.flags&=-257,c.flags|=65536,c.lanes=m,u===Af?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([u]):o.add(u),pg(r,u,m)),!1;case 22:return c.flags|=65536,u===Af?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([u])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([u]):c.add(u)),pg(r,u,m)),!1}throw Error(s(435,c.tag))}return pg(r,u,m),td(),!1}if(rt)return o=or.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=m,u!==cm&&(r=Error(s(422),{cause:u}),Sl(Nr(r,c)))):(u!==cm&&(o=Error(s(423),{cause:u}),Sl(Nr(o,c))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,u=Nr(u,c),m=Hm(r.stateNode,u,m),bm(r,m),Gt!==4&&(Gt=2)),!1;var v=Error(s(520),{cause:u});if(v=Nr(v,c),$l===null?$l=[v]:$l.push(v),Gt!==4&&(Gt=2),o===null)return!0;u=Nr(u,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,r=m&-m,c.lanes|=r,r=Hm(c.stateNode,u,r),bm(c,r),!1;case 1:if(o=c.type,v=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ro===null||!Ro.has(v))))return c.flags|=65536,m&=-m,c.lanes|=m,m=xS(m),SS(m,r,c,u),bm(c,m),!1}c=c.return}while(c!==null);return!1}var qm=Error(s(461)),sn=!1;function En(r,o,c,u){o.child=r===null?T0(o,null,c,u):Di(o,r.child,c,u)}function _S(r,o,c,u,m){c=c.render;var v=o.ref;if("ref"in u){var E={};for(var O in u)O!=="ref"&&(E[O]=u[O])}else E=u;return Oi(o),u=Tm(r,o,c,E,v,m),O=Cm(),r!==null&&!sn?(Rm(r,o,m),Ms(r,o,m)):(rt&&O&&im(o),o.flags|=1,En(r,o,u,m),o.child)}function wS(r,o,c,u,m){if(r===null){var v=c.type;return typeof v=="function"&&!rm(v)&&v.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=v,ES(r,o,v,u,m)):(r=Ef(c.type,null,u,o,o.mode,m),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,!Wm(r,m)){var E=v.memoizedProps;if(c=c.compare,c=c!==null?c:vl,c(E,u)&&r.ref===o.ref)return Ms(r,o,m)}return o.flags|=1,r=Rs(v,u),r.ref=o.ref,r.return=o,o.child=r}function ES(r,o,c,u,m){if(r!==null){var v=r.memoizedProps;if(vl(v,u)&&r.ref===o.ref)if(sn=!1,o.pendingProps=u=v,Wm(r,m))(r.flags&131072)!==0&&(sn=!0);else return o.lanes=r.lanes,Ms(r,o,m)}return Vm(r,o,c,u,m)}function TS(r,o,c,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|c:c,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,c,u)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&Nf(o,v!==null?v.cachePool:null),v!==null?N0(o,v):Sm(),j0(o);else return u=o.lanes=536870912,CS(r,o,v!==null?v.baseLanes|c:c,c,u)}else v!==null?(Nf(o,v.cachePool),N0(o,v),wo(),o.memoizedState=null):(r!==null&&Nf(o,null),Sm(),wo());return En(r,o,m,c),o.child}function Ml(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,c,u,m){var v=mm();return v=v===null?null:{parent:nn._currentValue,pool:v},o.memoizedState={baseLanes:c,cachePool:v},r!==null&&Nf(o,null),Sm(),j0(o),r!==null&&$a(r,o,u,!0),o.childLanes=m,null}function qf(r,o){return o=Kf({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function RS(r,o,c){return Di(o,r.child,null,c),r=qf(o,o.pendingProps),r.flags|=2,ir(o),o.memoizedState=null,r}function kO(r,o,c){var u=o.pendingProps,m=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(rt){if(u.mode==="hidden")return r=qf(o,u),o.lanes=536870912,Ml(null,r);if(wm(o),(r=Mt)?(r=U_(r,kr),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:mo!==null?{id:us,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=u0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw yo(o);return o.lanes=536870912,null}return qf(o,u)}var v=r.memoizedState;if(v!==null){var E=v.dehydrated;if(wm(o),m)if(o.flags&256)o.flags&=-257,o=RS(r,o,c);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(s(558));else if(sn||$a(r,o,c,!1),m=(c&r.childLanes)!==0,sn||m){if(u=Nt,u!==null&&(E=fo(u,c),E!==0&&E!==v.retryLane))throw v.retryLane=E,Ni(r,E),Vn(u,r,E),qm;td(),o=RS(r,o,c)}else r=v.treeContext,Mt=Mr(E.nextSibling),_n=o,rt=!0,go=null,kr=!1,r!==null&&h0(o,r),o=qf(o,u),o.flags|=4096;return o}return r=Rs(r.child,{mode:u.mode,children:u.children}),r.ref=o.ref,o.child=r,r.return=o,r}function Vf(r,o){var c=o.ref;if(c===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(r===null||r.ref!==c)&&(o.flags|=4194816)}}function Vm(r,o,c,u,m){return Oi(o),c=Tm(r,o,c,u,void 0,m),u=Cm(),r!==null&&!sn?(Rm(r,o,m),Ms(r,o,m)):(rt&&u&&im(o),o.flags|=1,En(r,o,c,m),o.child)}function NS(r,o,c,u,m,v){return Oi(o),o.updateQueue=null,c=k0(o,u,c,m),A0(r),u=Cm(),r!==null&&!sn?(Rm(r,o,v),Ms(r,o,v)):(rt&&u&&im(o),o.flags|=1,En(r,o,c,v),o.child)}function jS(r,o,c,u,m){if(Oi(o),o.stateNode===null){var v=Da,E=c.contextType;typeof E=="object"&&E!==null&&(v=wn(E)),v=new c(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Fm,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},ym(o),E=c.contextType,v.context=typeof E=="object"&&E!==null?wn(E):Da,v.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Bm(o,c,E,u),v.state=o.memoizedState),typeof c.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&&Fm.enqueueReplaceState(v,v.state,null),Nl(o,u,v,m),Rl(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(r===null){v=o.stateNode;var O=o.memoizedProps,$=Li(c,O);v.props=$;var te=v.context,ce=c.contextType;E=Da,typeof ce=="object"&&ce!==null&&(E=wn(ce));var fe=c.getDerivedStateFromProps;ce=typeof fe=="function"||typeof v.getSnapshotBeforeUpdate=="function",O=o.pendingProps!==O,ce||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(O||te!==E)&&mS(o,v,u,E),bo=!1;var re=o.memoizedState;v.state=re,Nl(o,u,v,m),Rl(),te=o.memoizedState,O||re!==te||bo?(typeof fe=="function"&&(Bm(o,c,fe,u),te=o.memoizedState),($=bo||pS(o,c,$,u,re,te,E))?(ce||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=te),v.props=u,v.state=te,v.context=E,u=$):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,vm(r,o),E=o.memoizedProps,ce=Li(c,E),v.props=ce,fe=o.pendingProps,re=v.context,te=c.contextType,$=Da,typeof te=="object"&&te!==null&&($=wn(te)),O=c.getDerivedStateFromProps,(te=typeof O=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(E!==fe||re!==$)&&mS(o,v,u,$),bo=!1,re=o.memoizedState,v.state=re,Nl(o,u,v,m),Rl();var ie=o.memoizedState;E!==fe||re!==ie||bo||r!==null&&r.dependencies!==null&&Cf(r.dependencies)?(typeof O=="function"&&(Bm(o,c,O,u),ie=o.memoizedState),(ce=bo||pS(o,c,ce,u,re,ie,$)||r!==null&&r.dependencies!==null&&Cf(r.dependencies))?(te||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&&re===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=ie),v.props=u,v.state=ie,v.context=$,u=ce):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,Vf(r,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,c=u&&typeof c.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,r!==null&&u?(o.child=Di(o,r.child,null,m),o.child=Di(o,null,c,m)):En(r,o,c,m),o.memoizedState=v.state,r=o.child):r=Ms(r,o,m),r}function AS(r,o,c,u){return Ai(),o.flags|=256,En(r,o,c,u),o.child}var Km={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gm(r){return{baseLanes:r,cachePool:b0()}}function Zm(r,o,c){return r=r!==null?r.childLanes&~c:0,o&&(r|=cr),r}function kS(r,o,c){var u=o.pendingProps,m=!1,v=(o.flags&128)!==0,E;if((E=v)||(E=r!==null&&r.memoizedState===null?!1:(Jt.current&2)!==0),E&&(m=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,r===null){if(rt){if(m?_o(o):wo(),(r=Mt)?(r=U_(r,kr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:mo!==null?{id:us,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=u0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw yo(o);return Ag(r)?o.lanes=32:o.lanes=536870912,null}var O=u.children;return u=u.fallback,m?(wo(),m=o.mode,O=Kf({mode:"hidden",children:O},m),u=ji(u,m,c,null),O.return=o,u.return=o,O.sibling=u,o.child=O,u=o.child,u.memoizedState=Gm(c),u.childLanes=Zm(r,E,c),o.memoizedState=Km,Ml(null,u)):(_o(o),Ym(o,O))}var $=r.memoizedState;if($!==null&&(O=$.dehydrated,O!==null)){if(v)o.flags&256?(_o(o),o.flags&=-257,o=Xm(r,o,c)):o.memoizedState!==null?(wo(),o.child=r.child,o.flags|=128,o=null):(wo(),O=u.fallback,m=o.mode,u=Kf({mode:"visible",children:u.children},m),O=ji(O,m,c,null),O.flags|=2,u.return=o,O.return=o,u.sibling=O,o.child=u,Di(o,r.child,null,c),u=o.child,u.memoizedState=Gm(c),u.childLanes=Zm(r,E,c),o.memoizedState=Km,o=Ml(null,u));else if(_o(o),Ag(O)){if(E=O.nextSibling&&O.nextSibling.dataset,E)var te=E.dgst;E=te,u=Error(s(419)),u.stack="",u.digest=E,Sl({value:u,source:null,stack:null}),o=Xm(r,o,c)}else if(sn||$a(r,o,c,!1),E=(c&r.childLanes)!==0,sn||E){if(E=Nt,E!==null&&(u=fo(E,c),u!==0&&u!==$.retryLane))throw $.retryLane=u,Ni(r,u),Vn(E,r,u),qm;jg(O)||td(),o=Xm(r,o,c)}else jg(O)?(o.flags|=192,o.child=r.child,o=null):(r=$.treeContext,Mt=Mr(O.nextSibling),_n=o,rt=!0,go=null,kr=!1,r!==null&&h0(o,r),o=Ym(o,u.children),o.flags|=4096);return o}return m?(wo(),O=u.fallback,m=o.mode,$=r.child,te=$.sibling,u=Rs($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,te!==null?O=Rs(te,O):(O=ji(O,m,c,null),O.flags|=2),O.return=o,u.return=o,u.sibling=O,o.child=u,Ml(null,u),u=o.child,O=r.child.memoizedState,O===null?O=Gm(c):(m=O.cachePool,m!==null?($=nn._currentValue,m=m.parent!==$?{parent:$,pool:$}:m):m=b0(),O={baseLanes:O.baseLanes|c,cachePool:m}),u.memoizedState=O,u.childLanes=Zm(r,E,c),o.memoizedState=Km,Ml(r.child,u)):(_o(o),c=r.child,r=c.sibling,c=Rs(c,{mode:"visible",children:u.children}),c.return=o,c.sibling=null,r!==null&&(E=o.deletions,E===null?(o.deletions=[r],o.flags|=16):E.push(r)),o.child=c,o.memoizedState=null,c)}function Ym(r,o){return o=Kf({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function Kf(r,o){return r=sr(22,r,null,o),r.lanes=0,r}function Xm(r,o,c){return Di(o,r.child,null,c),r=Ym(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function OS(r,o,c){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),fm(r.return,o,c)}function Qm(r,o,c,u,m,v){var E=r.memoizedState;E===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:c,tailMode:m,treeForkCount:v}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=u,E.tail=c,E.tailMode=m,E.treeForkCount=v)}function MS(r,o,c){var u=o.pendingProps,m=u.revealOrder,v=u.tail;u=u.children;var E=Jt.current,O=(E&2)!==0;if(O?(E=E&1|2,o.flags|=128):E&=1,W(Jt,E),En(r,o,u,c),u=rt?xl:0,!O&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&OS(r,c,o);else if(r.tag===19)OS(r,c,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(c=o.child,m=null;c!==null;)r=c.alternate,r!==null&&If(r)===null&&(m=c),c=c.sibling;c=m,c===null?(m=o.child,o.child=null):(m=c.sibling,c.sibling=null),Qm(o,!1,m,c,v,u);break;case"backwards":case"unstable_legacy-backwards":for(c=null,m=o.child,o.child=null;m!==null;){if(r=m.alternate,r!==null&&If(r)===null){o.child=m;break}r=m.sibling,m.sibling=c,c=m,m=r}Qm(o,!0,c,null,v,u);break;case"together":Qm(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function Ms(r,o,c){if(r!==null&&(o.dependencies=r.dependencies),Co|=o.lanes,(c&o.childLanes)===0)if(r!==null){if($a(r,o,c,!1),(c&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,c=Rs(r,r.pendingProps),o.child=c,c.return=o;r.sibling!==null;)r=r.sibling,c=c.sibling=Rs(r,r.pendingProps),c.return=o;c.sibling=null}return o.child}function Wm(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Cf(r)))}function OO(r,o,c){switch(o.tag){case 3:xe(o,o.stateNode.containerInfo),vo(o,nn,r.memoizedState.cache),Ai();break;case 27:case 5:Me(o);break;case 4:xe(o,o.stateNode.containerInfo);break;case 10:vo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,wm(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(_o(o),o.flags|=128,null):(c&o.child.childLanes)!==0?kS(r,o,c):(_o(o),r=Ms(r,o,c),r!==null?r.sibling:null);_o(o);break;case 19:var m=(r.flags&128)!==0;if(u=(c&o.childLanes)!==0,u||($a(r,o,c,!1),u=(c&o.childLanes)!==0),m){if(u)return MS(r,o,c);o.flags|=128}if(m=o.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),W(Jt,Jt.current),u)break;return null;case 22:return o.lanes=0,TS(r,o,c,o.pendingProps);case 24:vo(o,nn,r.memoizedState.cache)}return Ms(r,o,c)}function IS(r,o,c){if(r!==null)if(r.memoizedProps!==o.pendingProps)sn=!0;else{if(!Wm(r,c)&&(o.flags&128)===0)return sn=!1,OO(r,o,c);sn=(r.flags&131072)!==0}else sn=!1,rt&&(o.flags&1048576)!==0&&d0(o,xl,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(r=Ii(o.elementType),o.type=r,typeof r=="function")rm(r)?(u=Li(r,u),o.tag=1,o=jS(null,o,r,u,c)):(o.tag=0,o=Vm(null,o,r,u,c));else{if(r!=null){var m=r.$$typeof;if(m===R){o.tag=11,o=_S(null,o,r,u,c);break e}else if(m===j){o.tag=14,o=wS(null,o,r,u,c);break e}}throw o=Y(r)||r,Error(s(306,o,""))}}return o;case 0:return Vm(r,o,o.type,o.pendingProps,c);case 1:return u=o.type,m=Li(u,o.pendingProps),jS(r,o,u,m,c);case 3:e:{if(xe(o,o.stateNode.containerInfo),r===null)throw Error(s(387));u=o.pendingProps;var v=o.memoizedState;m=v.element,vm(r,o),Nl(o,u,null,c);var E=o.memoizedState;if(u=E.cache,vo(o,nn,u),u!==v.cache&&dm(o,[nn],c,!0),Rl(),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,c);break e}else if(u!==m){m=Nr(Error(s(424)),o),Sl(m),o=AS(r,o,u,c);break e}else for(r=o.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Mt=Mr(r.firstChild),_n=o,rt=!0,go=null,kr=!0,c=T0(o,null,u,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Ai(),u===m){o=Ms(r,o,c);break e}En(r,o,u,c)}o=o.child}return o;case 26:return Vf(r,o),r===null?(c=V_(o.type,null,o.pendingProps,null))?o.memoizedState=c:rt||(c=o.type,r=o.pendingProps,u=cd(se.current).createElement(c),u[Sn]=o,u[Un]=r,Tn(u,c,r),bn(u),o.stateNode=u):o.memoizedState=V_(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return Me(o),r===null&&rt&&(u=o.stateNode=F_(o.type,o.pendingProps,se.current),_n=o,kr=!0,m=Mt,ko(o.type)?(kg=m,Mt=Mr(u.firstChild)):Mt=m),En(r,o,o.pendingProps.children,c),Vf(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&rt&&((m=u=Mt)&&(u=cM(u,o.type,o.pendingProps,kr),u!==null?(o.stateNode=u,_n=o,Mt=Mr(u.firstChild),kr=!1,m=!0):m=!1),m||yo(o)),Me(o),m=o.type,v=o.pendingProps,E=r!==null?r.memoizedProps:null,u=v.children,Cg(m,v)?u=null:E!==null&&Cg(m,E)&&(o.flags|=32),o.memoizedState!==null&&(m=Tm(r,o,wO,null,null,c),Zl._currentValue=m),Vf(r,o),En(r,o,u,c),o.child;case 6:return r===null&&rt&&((r=c=Mt)&&(c=lM(c,o.pendingProps,kr),c!==null?(o.stateNode=c,_n=o,Mt=null,r=!0):r=!1),r||yo(o)),null;case 13:return kS(r,o,c);case 4:return xe(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=Di(o,null,u,c):En(r,o,u,c),o.child;case 11:return _S(r,o,o.type,o.pendingProps,c);case 7:return En(r,o,o.pendingProps,c),o.child;case 8:return En(r,o,o.pendingProps.children,c),o.child;case 12:return En(r,o,o.pendingProps.children,c),o.child;case 10:return u=o.pendingProps,vo(o,o.type,u.value),En(r,o,u.children,c),o.child;case 9:return m=o.type._context,u=o.pendingProps.children,Oi(o),m=wn(m),u=u(m),o.flags|=1,En(r,o,u,c),o.child;case 14:return wS(r,o,o.type,o.pendingProps,c);case 15:return ES(r,o,o.type,o.pendingProps,c);case 19:return MS(r,o,c);case 31:return kO(r,o,c);case 22:return TS(r,o,c,o.pendingProps);case 24:return Oi(o),u=wn(nn),r===null?(m=mm(),m===null&&(m=Nt,v=hm(),m.pooledCache=v,v.refCount++,v!==null&&(m.pooledCacheLanes|=c),m=v),o.memoizedState={parent:u,cache:m},ym(o),vo(o,nn,m)):((r.lanes&c)!==0&&(vm(r,o),Nl(o,null,null,c),Rl()),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),vo(o,nn,u)):(u=v.cache,vo(o,nn,u),u!==m.cache&&dm(o,[nn],c,!0))),En(r,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(s(156,o.tag))}function Is(r){r.flags|=4}function Jm(r,o,c,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 Pi=Af,gm}else r.flags&=-16777217}function PS(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 Pi=Af,gm}function Gf(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?_i():536870912,r.lanes|=o,Wa|=o)}function Il(r,o){if(!rt)switch(r.tailMode){case"hidden":o=r.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var u=null;c!==null;)c.alternate!==null&&(u=c),c=c.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,c=0,u=0;if(o)for(var m=r.child;m!==null;)c|=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;)c|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=u,r.childLanes=c,o}function MO(r,o,c){var u=o.pendingProps;switch(am(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 c=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),As(nn),he(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Ua(o)?Is(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,lm())),It(o),null;case 26:var m=o.type,v=o.memoizedState;return r===null?(Is(o),v!==null?(It(o),PS(o,v)):(It(o),Jm(o,m,null,u,c))):v?v!==r.memoizedState?(Is(o),It(o),PS(o,v)):(It(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&Is(o),It(o),Jm(o,m,r,u,c)),null;case 27:if(_e(o),c=se.current,m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}r=X.current,Ua(o)?p0(o):(r=F_(m,u,c),o.stateNode=r,Is(o))}return It(o),null;case 5:if(_e(o),m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}if(v=X.current,Ua(o))p0(o);else{var E=cd(se.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[Sn]=o,v[Un]=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(Tn(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&&Is(o)}}return It(o),Jm(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,c),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(s(166));if(r=se.current,Ua(o)){if(r=o.stateNode,c=o.memoizedProps,u=null,m=_n,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}r[Sn]=o,r=!!(r.nodeValue===c||u!==null&&u.suppressHydrationWarning===!0||k_(r.nodeValue,c)),r||yo(o,!0)}else r=cd(r).createTextNode(u),r[Sn]=o,o.stateNode=r}return It(o),null;case 31:if(c=o.memoizedState,r===null||r.memoizedState!==null){if(u=Ua(o),c!==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[Sn]=o}else Ai(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),r=!1}else c=lm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return o.flags&256?(ir(o),o):(ir(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=Ua(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[Sn]=o}else Ai(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),m=!1}else m=lm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return o.flags&256?(ir(o),o):(ir(o),null)}return ir(o),(o.flags&128)!==0?(o.lanes=c,o):(c=u!==null,r=r!==null&&r.memoizedState!==null,c&&(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)),c!==r&&c&&(o.child.flags|=8192),Gf(o,o.updateQueue),It(o),null);case 4:return he(),r===null&&Sg(o.stateNode.containerInfo),It(o),null;case 10:return As(o.type),It(o),null;case 19:if(H(Jt),u=o.memoizedState,u===null)return It(o),null;if(m=(o.flags&128)!==0,v=u.rendering,v===null)if(m)Il(u,!1);else{if(Gt!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=If(r),v!==null){for(o.flags|=128,Il(u,!1),r=v.updateQueue,o.updateQueue=r,Gf(o,r),o.subtreeFlags=0,r=c,c=o.child;c!==null;)l0(c,r),c=c.sibling;return W(Jt,Jt.current&1|2),rt&&Ns(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&Be()>Wf&&(o.flags|=128,m=!0,Il(u,!1),o.lanes=4194304)}else{if(!m)if(r=If(v),r!==null){if(o.flags|=128,m=!0,r=r.updateQueue,o.updateQueue=r,Gf(o,r),Il(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!rt)return It(o),null}else 2*Be()-u.renderingStartTime>Wf&&c!==536870912&&(o.flags|=128,m=!0,Il(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=Be(),r.sibling=null,c=Jt.current,W(Jt,m?c&1|2:c&1),rt&&Ns(o,u.treeForkCount),r):(It(o),null);case 22:case 23:return ir(o),_m(),u=o.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(c&536870912)!==0&&(o.flags&128)===0&&(It(o),o.subtreeFlags&6&&(o.flags|=8192)):It(o),c=o.updateQueue,c!==null&&Gf(o,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==c&&(o.flags|=2048),r!==null&&H(Mi),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),As(nn),It(o),null;case 25:return null;case 30:return null}throw Error(s(156,o.tag))}function IO(r,o){switch(am(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return As(nn),he(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return _e(o),null;case 31:if(o.memoizedState!==null){if(ir(o),o.alternate===null)throw Error(s(340));Ai()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(ir(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(s(340));Ai()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return H(Jt),null;case 4:return he(),null;case 10:return As(o.type),null;case 22:case 23:return ir(o),_m(),r!==null&&H(Mi),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return As(nn),null;case 25:return null;default:return null}}function DS(r,o){switch(am(o),o.tag){case 3:As(nn),he();break;case 26:case 27:case 5:_e(o);break;case 4:he();break;case 31:o.memoizedState!==null&&ir(o);break;case 13:ir(o);break;case 19:H(Jt);break;case 10:As(o.type);break;case 22:case 23:ir(o),_m(),r!==null&&H(Mi);break;case 24:As(nn)}}function Pl(r,o){try{var c=o.updateQueue,u=c!==null?c.lastEffect:null;if(u!==null){var m=u.next;c=m;do{if((c.tag&r)===r){u=void 0;var v=c.create,E=c.inst;u=v(),E.destroy=u}c=c.next}while(c!==m)}}catch(O){_t(o,o.return,O)}}function Eo(r,o,c){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,O=E.destroy;if(O!==void 0){E.destroy=void 0,m=o;var $=c,te=O;try{te()}catch(ce){_t(m,$,ce)}}}u=u.next}while(u!==v)}}catch(ce){_t(o,o.return,ce)}}function zS(r){var o=r.updateQueue;if(o!==null){var c=r.stateNode;try{R0(o,c)}catch(u){_t(r,r.return,u)}}}function LS(r,o,c){c.props=Li(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(u){_t(r,o,u)}}function Dl(r,o){try{var c=r.ref;if(c!==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 c=="function"?r.refCleanup=c(u):c.current=u}}catch(m){_t(r,o,m)}}function ds(r,o){var c=r.ref,u=r.refCleanup;if(c!==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 c=="function")try{c(null)}catch(m){_t(r,o,m)}else c.current=null}function US(r){var o=r.type,c=r.memoizedProps,u=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&u.focus();break e;case"img":c.src?u.src=c.src:c.srcSet&&(u.srcset=c.srcSet)}}catch(m){_t(r,r.return,m)}}function eg(r,o,c){try{var u=r.stateNode;nM(u,r.type,c,o),u[Un]=o}catch(m){_t(r,r.return,m)}}function $S(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ko(r.type)||r.tag===4}function tg(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&&ko(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 ng(r,o,c){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(r),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Ts));else if(u!==4&&(u===27&&ko(r.type)&&(c=r.stateNode,o=null),r=r.child,r!==null))for(ng(r,o,c),r=r.sibling;r!==null;)ng(r,o,c),r=r.sibling}function Zf(r,o,c){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?c.insertBefore(r,o):c.appendChild(r);else if(u!==4&&(u===27&&ko(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(Zf(r,o,c),r=r.sibling;r!==null;)Zf(r,o,c),r=r.sibling}function BS(r){var o=r.stateNode,c=r.memoizedProps;try{for(var u=r.type,m=o.attributes;m.length;)o.removeAttributeNode(m[0]);Tn(o,u,c),o[Sn]=r,o[Un]=c}catch(v){_t(r,r.return,v)}}var Ps=!1,on=!1,rg=!1,FS=typeof WeakSet=="function"?WeakSet:Set,xn=null;function PO(r,o){if(r=r.containerInfo,Eg=md,r=e0(r),Xp(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var u=c.getSelection&&c.getSelection();if(u&&u.rangeCount!==0){c=u.anchorNode;var m=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{c.nodeType,v.nodeType}catch{c=null;break e}var E=0,O=-1,$=-1,te=0,ce=0,fe=r,re=null;t:for(;;){for(var ie;fe!==c||m!==0&&fe.nodeType!==3||(O=E+m),fe!==v||u!==0&&fe.nodeType!==3||($=E+u),fe.nodeType===3&&(E+=fe.nodeValue.length),(ie=fe.firstChild)!==null;)re=fe,fe=ie;for(;;){if(fe===r)break t;if(re===c&&++te===m&&(O=E),re===v&&++ce===u&&($=E),(ie=fe.nextSibling)!==null)break;fe=re,re=fe.parentNode}fe=ie}c=O===-1||$===-1?null:{start:O,end:$}}else c=null}c=c||{start:0,end:0}}else c=null;for(Tg={focusedElem:r,selectionRange:c},md=!1,xn=o;xn!==null;)if(o=xn,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,xn=r;else for(;xn!==null;){switch(o=xn,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(c=0;c<r.length;c++)m=r[c],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,c=o,m=v.memoizedProps,v=v.memoizedState,u=c.stateNode;try{var Re=Li(c.type,m);r=u.getSnapshotBeforeUpdate(Re,v),u.__reactInternalSnapshotBeforeUpdate=r}catch($e){_t(c,c.return,$e)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,c=r.nodeType,c===9)Ng(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Ng(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,xn=r;break}xn=o.return}}function HS(r,o,c){var u=c.flags;switch(c.tag){case 0:case 11:case 15:zs(r,c),u&4&&Pl(5,c);break;case 1:if(zs(r,c),u&4)if(r=c.stateNode,o===null)try{r.componentDidMount()}catch(E){_t(c,c.return,E)}else{var m=Li(c.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(m,o,r.__reactInternalSnapshotBeforeUpdate)}catch(E){_t(c,c.return,E)}}u&64&&zS(c),u&512&&Dl(c,c.return);break;case 3:if(zs(r,c),u&64&&(r=c.updateQueue,r!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{R0(r,o)}catch(E){_t(c,c.return,E)}}break;case 27:o===null&&u&4&&BS(c);case 26:case 5:zs(r,c),o===null&&u&4&&US(c),u&512&&Dl(c,c.return);break;case 12:zs(r,c);break;case 31:zs(r,c),u&4&&KS(r,c);break;case 13:zs(r,c),u&4&&GS(r,c),u&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=qO.bind(null,c),uM(r,c))));break;case 22:if(u=c.memoizedState!==null||Ps,!u){o=o!==null&&o.memoizedState!==null||on,m=Ps;var v=on;Ps=u,(on=o)&&!v?Ls(r,c,(c.subtreeFlags&8772)!==0):zs(r,c),Ps=m,on=v}break;case 30:break;default:zs(r,c)}}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&&Mp(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 Ut=null,Bn=!1;function Ds(r,o,c){for(c=c.child;c!==null;)VS(r,o,c),c=c.sibling}function VS(r,o,c){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Er,c)}catch{}switch(c.tag){case 26:on||ds(c,o),Ds(r,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:on||ds(c,o);var u=Ut,m=Bn;ko(c.type)&&(Ut=c.stateNode,Bn=!1),Ds(r,o,c),Vl(c.stateNode),Ut=u,Bn=m;break;case 5:on||ds(c,o);case 6:if(u=Ut,m=Bn,Ut=null,Ds(r,o,c),Ut=u,Bn=m,Ut!==null)if(Bn)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(c.stateNode)}catch(v){_t(c,o,v)}else try{Ut.removeChild(c.stateNode)}catch(v){_t(c,o,v)}break;case 18:Ut!==null&&(Bn?(r=Ut,z_(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),ic(r)):z_(Ut,c.stateNode));break;case 4:u=Ut,m=Bn,Ut=c.stateNode.containerInfo,Bn=!0,Ds(r,o,c),Ut=u,Bn=m;break;case 0:case 11:case 14:case 15:Eo(2,c,o),on||Eo(4,c,o),Ds(r,o,c);break;case 1:on||(ds(c,o),u=c.stateNode,typeof u.componentWillUnmount=="function"&&LS(c,o,u)),Ds(r,o,c);break;case 21:Ds(r,o,c);break;case 22:on=(u=on)||c.memoizedState!==null,Ds(r,o,c),on=u;break;default:Ds(r,o,c)}}function KS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ic(r)}catch(c){_t(o,o.return,c)}}}function GS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ic(r)}catch(c){_t(o,o.return,c)}}function DO(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 Yf(r,o){var c=DO(r);o.forEach(function(u){if(!c.has(u)){c.add(u);var m=VO.bind(null,r,u);u.then(m,m)}})}function Fn(r,o){var c=o.deletions;if(c!==null)for(var u=0;u<c.length;u++){var m=c[u],v=r,E=o,O=E;e:for(;O!==null;){switch(O.tag){case 27:if(ko(O.type)){Ut=O.stateNode,Bn=!1;break e}break;case 5:Ut=O.stateNode,Bn=!1;break e;case 3:case 4:Ut=O.stateNode.containerInfo,Bn=!0;break e}O=O.return}if(Ut===null)throw Error(s(160));VS(v,E,m),Ut=null,Bn=!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 Wr=null;function ZS(r,o){var c=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Fn(o,r),Hn(r),u&4&&(Eo(3,r,r.return),Pl(3,r),Eo(5,r,r.return));break;case 1:Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),u&64&&Ps&&(r=r.updateQueue,r!==null&&(u=r.callbacks,u!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?u:c.concat(u))));break;case 26:var m=Wr;if(Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),u&4){var v=c!==null?c.memoizedState:null;if(u=r.memoizedState,c===null)if(u===null)if(r.stateNode===null){e:{u=r.type,c=r.memoizedProps,m=m.ownerDocument||m;t:switch(u){case"title":v=m.getElementsByTagName("title")[0],(!v||v[ll]||v[Sn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=m.createElement(u),m.head.insertBefore(v,m.querySelector("head > title"))),Tn(v,u,c),v[Sn]=r,bn(v),u=v;break e;case"link":var E=Z_("link","href",m).get(u+(c.href||""));if(E){for(var O=0;O<E.length;O++)if(v=E[O],v.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&v.getAttribute("rel")===(c.rel==null?null:c.rel)&&v.getAttribute("title")===(c.title==null?null:c.title)&&v.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(O,1);break t}}v=m.createElement(u),Tn(v,u,c),m.head.appendChild(v);break;case"meta":if(E=Z_("meta","content",m).get(u+(c.content||""))){for(O=0;O<E.length;O++)if(v=E[O],v.getAttribute("content")===(c.content==null?null:""+c.content)&&v.getAttribute("name")===(c.name==null?null:c.name)&&v.getAttribute("property")===(c.property==null?null:c.property)&&v.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&v.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(O,1);break t}}v=m.createElement(u),Tn(v,u,c),m.head.appendChild(v);break;default:throw Error(s(468,u))}v[Sn]=r,bn(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?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):v.count--,u===null?Y_(m,r.type,r.stateNode):G_(m,u,r.memoizedProps)):u===null&&r.stateNode!==null&&eg(r,r.memoizedProps,c.memoizedProps)}break;case 27:Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),c!==null&&u&4&&eg(r,r.memoizedProps,c.memoizedProps);break;case 5:if(Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),r.flags&32){m=r.stateNode;try{ja(m,"")}catch(Re){_t(r,r.return,Re)}}u&4&&r.stateNode!=null&&(m=r.memoizedProps,eg(r,m,c!==null?c.memoizedProps:m)),u&1024&&(rg=!0);break;case 6:if(Fn(o,r),Hn(r),u&4){if(r.stateNode===null)throw Error(s(162));u=r.memoizedProps,c=r.stateNode;try{c.nodeValue=u}catch(Re){_t(r,r.return,Re)}}break;case 3:if(fd=null,m=Wr,Wr=ld(o.containerInfo),Fn(o,r),Wr=m,Hn(r),u&4&&c!==null&&c.memoizedState.isDehydrated)try{ic(o.containerInfo)}catch(Re){_t(r,r.return,Re)}rg&&(rg=!1,YS(r));break;case 4:u=Wr,Wr=ld(r.stateNode.containerInfo),Fn(o,r),Hn(r),Wr=u;break;case 12:Fn(o,r),Hn(r);break;case 31:Fn(o,r),Hn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Yf(r,u)));break;case 13:Fn(o,r),Hn(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Qf=Be()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Yf(r,u)));break;case 22:m=r.memoizedState!==null;var $=c!==null&&c.memoizedState!==null,te=Ps,ce=on;if(Ps=te||m,on=ce||$,Fn(o,r),on=ce,Ps=te,Hn(r),u&8192)e:for(o=r.stateNode,o._visibility=m?o._visibility&-2:o._visibility|1,m&&(c===null||$||Ps||on||Ui(r)),c=null,o=r;;){if(o.tag===5||o.tag===26){if(c===null){$=c=o;try{if(v=$.stateNode,m)E=v.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{O=$.stateNode;var fe=$.memoizedProps.style,re=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;O.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Re){_t($,$.return,Re)}}}else if(o.tag===6){if(c===null){$=o;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(Re){_t($,$.return,Re)}}}else if(o.tag===18){if(c===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;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}u&4&&(u=r.updateQueue,u!==null&&(c=u.retryQueue,c!==null&&(u.retryQueue=null,Yf(r,c))));break;case 19:Fn(o,r),Hn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Yf(r,u)));break;case 30:break;case 21:break;default:Fn(o,r),Hn(r)}}function Hn(r){var o=r.flags;if(o&2){try{for(var c,u=r.return;u!==null;){if($S(u)){c=u;break}u=u.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var m=c.stateNode,v=tg(r);Zf(r,v,m);break;case 5:var E=c.stateNode;c.flags&32&&(ja(E,""),c.flags&=-33);var O=tg(r);Zf(r,O,E);break;case 3:case 4:var $=c.stateNode.containerInfo,te=tg(r);ng(r,te,$);break;default:throw Error(s(161))}}catch(ce){_t(r,r.return,ce)}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 zs(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)HS(r,o.alternate,o),o=o.sibling}function Ui(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:Eo(4,o,o.return),Ui(o);break;case 1:ds(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&LS(o,o.return,c),Ui(o);break;case 27:Vl(o.stateNode);case 26:case 5:ds(o,o.return),Ui(o);break;case 22:o.memoizedState===null&&Ui(o);break;case 30:Ui(o);break;default:Ui(o)}r=r.sibling}}function Ls(r,o,c){for(c=c&&(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:Ls(m,v,c),Pl(4,v);break;case 1:if(Ls(m,v,c),u=v,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(te){_t(u,u.return,te)}if(u=v,m=u.updateQueue,m!==null){var O=u.stateNode;try{var $=m.shared.hiddenCallbacks;if($!==null)for(m.shared.hiddenCallbacks=null,m=0;m<$.length;m++)C0($[m],O)}catch(te){_t(u,u.return,te)}}c&&E&64&&zS(v),Dl(v,v.return);break;case 27:BS(v);case 26:case 5:Ls(m,v,c),c&&u===null&&E&4&&US(v),Dl(v,v.return);break;case 12:Ls(m,v,c);break;case 31:Ls(m,v,c),c&&E&4&&KS(m,v);break;case 13:Ls(m,v,c),c&&E&4&&GS(m,v);break;case 22:v.memoizedState===null&&Ls(m,v,c),Dl(v,v.return);break;case 30:break;default:Ls(m,v,c)}o=o.sibling}}function sg(r,o){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&_l(c))}function og(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&_l(r))}function Jr(r,o,c,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)XS(r,o,c,u),o=o.sibling}function XS(r,o,c,u){var m=o.flags;switch(o.tag){case 0:case 11:case 15:Jr(r,o,c,u),m&2048&&Pl(9,o);break;case 1:Jr(r,o,c,u);break;case 3:Jr(r,o,c,u),m&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&_l(r)));break;case 12:if(m&2048){Jr(r,o,c,u),r=o.stateNode;try{var v=o.memoizedProps,E=v.id,O=v.onPostCommit;typeof O=="function"&&O(E,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){_t(o,o.return,$)}}else Jr(r,o,c,u);break;case 31:Jr(r,o,c,u);break;case 13:Jr(r,o,c,u);break;case 23:break;case 22:v=o.stateNode,E=o.alternate,o.memoizedState!==null?v._visibility&2?Jr(r,o,c,u):zl(r,o):v._visibility&2?Jr(r,o,c,u):(v._visibility|=2,Ya(r,o,c,u,(o.subtreeFlags&10256)!==0||!1)),m&2048&&sg(E,o);break;case 24:Jr(r,o,c,u),m&2048&&og(o.alternate,o);break;default:Jr(r,o,c,u)}}function Ya(r,o,c,u,m){for(m=m&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=r,E=o,O=c,$=u,te=E.flags;switch(E.tag){case 0:case 11:case 15:Ya(v,E,O,$,m),Pl(8,E);break;case 23:break;case 22:var ce=E.stateNode;E.memoizedState!==null?ce._visibility&2?Ya(v,E,O,$,m):zl(v,E):(ce._visibility|=2,Ya(v,E,O,$,m)),m&&te&2048&&sg(E.alternate,E);break;case 24:Ya(v,E,O,$,m),m&&te&2048&&og(E.alternate,E);break;default:Ya(v,E,O,$,m)}o=o.sibling}}function zl(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=r,u=o,m=u.flags;switch(u.tag){case 22:zl(c,u),m&2048&&sg(u.alternate,u);break;case 24:zl(c,u),m&2048&&og(u.alternate,u);break;default:zl(c,u)}o=o.sibling}}var Ll=8192;function Xa(r,o,c){if(r.subtreeFlags&Ll)for(r=r.child;r!==null;)QS(r,o,c),r=r.sibling}function QS(r,o,c){switch(r.tag){case 26:Xa(r,o,c),r.flags&Ll&&r.memoizedState!==null&&_M(c,Wr,r.memoizedState,r.memoizedProps);break;case 5:Xa(r,o,c);break;case 3:case 4:var u=Wr;Wr=ld(r.stateNode.containerInfo),Xa(r,o,c),Wr=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=Ll,Ll=16777216,Xa(r,o,c),Ll=u):Xa(r,o,c));break;default:Xa(r,o,c)}}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 Ul(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var u=o[c];xn=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:Ul(r),r.flags&2048&&Eo(9,r,r.return);break;case 3:Ul(r);break;case 12:Ul(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,Xf(r)):Ul(r);break;default:Ul(r)}}function Xf(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var u=o[c];xn=u,e_(u,r)}WS(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:Eo(8,o,o.return),Xf(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Xf(o));break;default:Xf(o)}r=r.sibling}}function e_(r,o){for(;xn!==null;){var c=xn;switch(c.tag){case 0:case 11:case 15:Eo(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var u=c.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:_l(c.memoizedState.cache)}if(u=c.child,u!==null)u.return=c,xn=u;else e:for(c=r;xn!==null;){u=xn;var m=u.sibling,v=u.return;if(qS(u),u===c){xn=null;break e}if(m!==null){m.return=v,xn=m;break e}xn=v}}}var zO={getCacheForType:function(r){var o=wn(nn),c=o.data.get(r);return c===void 0&&(c=r(),o.data.set(r,c)),c},cacheSignal:function(){return wn(nn).controller.signal}},LO=typeof WeakMap=="function"?WeakMap:Map,gt=0,Nt=null,Je=null,tt=0,St=0,ar=null,To=!1,Qa=!1,ig=!1,Us=0,Gt=0,Co=0,$i=0,ag=0,cr=0,Wa=0,$l=null,qn=null,cg=!1,Qf=0,t_=0,Wf=1/0,Jf=null,Ro=null,fn=0,No=null,Ja=null,$s=0,lg=0,ug=null,n_=null,Bl=0,fg=null;function lr(){return(gt&2)!==0&&tt!==0?tt&-tt:D.T!==null?yg():cf()}function r_(){if(cr===0)if((tt&536870912)===0||rt){var r=Cn;Cn<<=1,(Cn&3932160)===0&&(Cn=262144),cr=r}else cr=536870912;return r=or.current,r!==null&&(r.flags|=32),cr}function Vn(r,o,c){(r===Nt&&(St===2||St===9)||r.cancelPendingCommit!==null)&&(ec(r,0),jo(r,tt,cr,!1)),ws(r,c),((gt&2)===0||r!==Nt)&&(r===Nt&&((gt&2)===0&&($i|=c),Gt===4&&jo(r,tt,cr,!1)),hs(r))}function s_(r,o,c){if((gt&6)!==0)throw Error(s(327));var u=!c&&(o&127)===0&&(o&r.expiredLanes)===0||cs(r,o),m=u?BO(r,o):hg(r,o,!0),v=u;do{if(m===0){Qa&&!u&&jo(r,o,0,!1);break}else{if(c=r.current.alternate,v&&!UO(c)){m=hg(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 O=r;m=$l;var $=O.current.memoizedState.isDehydrated;if($&&(ec(O,E).flags|=256),E=hg(O,E,!1),E!==2){if(ig&&!$){O.errorRecoveryDisabledLanes|=v,$i|=v,m=4;break e}v=qn,qn=m,v!==null&&(qn===null?qn=v:qn.push.apply(qn,v))}m=E}if(v=!1,m!==2)continue}}if(m===1){ec(r,0),jo(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:jo(u,o,cr,!To);break e;case 2:qn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((o&62914560)===o&&(m=Qf+300-Be(),10<m)){if(jo(u,o,cr,!To),as(u,0,!0)!==0)break e;$s=o,u.timeoutHandle=P_(o_.bind(null,u,c,qn,Jf,cg,o,cr,$i,Wa,To,v,"Throttled",-0,0),m);break e}o_(u,c,qn,Jf,cg,o,cr,$i,Wa,To,v,null,-0,0)}}break}while(!0);hs(r)}function o_(r,o,c,u,m,v,E,O,$,te,ce,fe,re,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:Ts},QS(o,v,fe);var Re=(v&62914560)===v?Qf-Be():(v&4194048)===v?t_-Be():0;if(Re=wM(fe,Re),Re!==null){$s=v,r.cancelPendingCommit=Re(h_.bind(null,r,o,v,c,u,m,E,O,$,ce,fe,null,re,ie)),jo(r,v,E,!te);return}}h_(r,o,v,c,u,m,E,O,$)}function UO(r){for(var o=r;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var u=0;u<c.length;u++){var m=c[u],v=m.getSnapshot;m=m.value;try{if(!rr(v(),m))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;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 jo(r,o,c,u){o&=~ag,o&=~$i,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}c!==0&&ls(r,c,o)}function ed(){return(gt&6)===0?(Fl(0),!1):!0}function dg(){if(Je!==null){if(St===0)var r=Je.return;else r=Je,js=ki=null,Nm(r),qa=null,El=0,r=Je;for(;r!==null;)DS(r.alternate,r),r=r.return;Je=null}}function ec(r,o){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,oM(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),$s=0,dg(),Nt=r,Je=c=Rs(r.current,null),tt=o,St=0,ar=null,To=!1,Qa=cs(r,o),ig=!1,Wa=cr=ag=$i=Co=Gt=0,qn=$l=null,cg=!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 Us=o,Sf(),c}function i_(r,o){Ze=null,D.H=Ol,o===Ha||o===jf?(o=_0(),St=3):o===gm?(o=_0(),St=4):St=o===qm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,ar=o,Je===null&&(Gt=1,Hf(r,Nr(o,r.current)))}function a_(){var r=or.current;return r===null?!0:(tt&4194048)===tt?Or===null:(tt&62914560)===tt||(tt&536870912)!==0?r===Or:!1}function c_(){var r=D.H;return D.H=Ol,r===null?Ol:r}function l_(){var r=D.A;return D.A=zO,r}function td(){Gt=4,To||(tt&4194048)!==tt&&or.current!==null||(Qa=!0),(Co&134217727)===0&&($i&134217727)===0||Nt===null||jo(Nt,tt,cr,!1)}function hg(r,o,c){var u=gt;gt|=2;var m=c_(),v=l_();(Nt!==r||tt!==o)&&(Jf=null,ec(r,o)),o=!1;var E=Gt;e:do try{if(St!==0&&Je!==null){var O=Je,$=ar;switch(St){case 8:dg(),E=6;break e;case 3:case 2:case 9:case 6:or.current===null&&(o=!0);var te=St;if(St=0,ar=null,tc(r,O,$,te),c&&Qa){E=0;break e}break;default:te=St,St=0,ar=null,tc(r,O,$,te)}}$O(),E=Gt;break}catch(ce){i_(r,ce)}while(!0);return o&&r.shellSuspendCounter++,js=ki=null,gt=u,D.H=m,D.A=v,Je===null&&(Nt=null,tt=0,Sf()),E}function $O(){for(;Je!==null;)u_(Je)}function BO(r,o){var c=gt;gt|=2;var u=c_(),m=l_();Nt!==r||tt!==o?(Jf=null,Wf=Be()+500,ec(r,o)):Qa=cs(r,o);e:do try{if(St!==0&&Je!==null){o=Je;var v=ar;t:switch(St){case 1:St=0,ar=null,tc(r,o,v,1);break;case 2:case 9:if(x0(v)){St=0,ar=null,f_(o);break}o=function(){St!==2&&St!==9||Nt!==r||(St=7),hs(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,ar=null,f_(o)):(St=0,ar=null,tc(r,o,v,7));break;case 5:var E=null;switch(Je.tag){case 26:E=Je.memoizedState;case 5:case 27:var O=Je;if(E?X_(E):O.stateNode.complete){St=0,ar=null;var $=O.sibling;if($!==null)Je=$;else{var te=O.return;te!==null?(Je=te,nd(te)):Je=null}break t}}St=0,ar=null,tc(r,o,v,5);break;case 6:St=0,ar=null,tc(r,o,v,6);break;case 8:dg(),Gt=6;break e;default:throw Error(s(462))}}FO();break}catch(ce){i_(r,ce)}while(!0);return js=ki=null,D.H=u,D.A=m,gt=c,Je!==null?0:(Nt=null,tt=0,Sf(),Gt)}function FO(){for(;Je!==null&&!Ve();)u_(Je)}function u_(r){var o=IS(r.alternate,r,Us);r.memoizedProps=r.pendingProps,o===null?nd(r):Je=o}function f_(r){var o=r,c=o.alternate;switch(o.tag){case 15:case 0:o=NS(c,o,o.pendingProps,o.type,void 0,tt);break;case 11:o=NS(c,o,o.pendingProps,o.type.render,o.ref,tt);break;case 5:Nm(o);default:DS(c,o),o=Je=l0(o,Us),o=IS(c,o,Us)}r.memoizedProps=r.pendingProps,o===null?nd(r):Je=o}function tc(r,o,c,u){js=ki=null,Nm(o),qa=null,El=0;var m=o.return;try{if(AO(r,m,o,c,tt)){Gt=1,Hf(r,Nr(c,r.current)),Je=null;return}}catch(v){if(m!==null)throw Je=m,v;Gt=1,Hf(r,Nr(c,r.current)),Je=null;return}o.flags&32768?(rt||u===1?r=!0:Qa||(tt&536870912)!==0?r=!1:(To=r=!0,(u===2||u===9||u===3||u===6)&&(u=or.current,u!==null&&u.tag===13&&(u.flags|=16384))),d_(o,r)):nd(o)}function nd(r){var o=r;do{if((o.flags&32768)!==0){d_(o,To);return}r=o.return;var c=MO(o.alternate,o,Us);if(c!==null){Je=c;return}if(o=o.sibling,o!==null){Je=o;return}Je=o=r}while(o!==null);Gt===0&&(Gt=5)}function d_(r,o){do{var c=IO(r.alternate,r);if(c!==null){c.flags&=32767,Je=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(r=r.sibling,r!==null)){Je=r;return}Je=r=c}while(r!==null);Gt=6,Je=null}function h_(r,o,c,u,m,v,E,O,$){r.cancelPendingCommit=null;do rd();while(fn!==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|=tm,tr(r,c,v,E,O,$),r===Nt&&(Je=Nt=null,tt=0),Ja=o,No=r,$s=c,lg=v,ug=m,n_=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,KO(Te,function(){return v_(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=D.T,D.T=null,m=K.p,K.p=2,E=gt,gt|=4;try{PO(r,o,c)}finally{gt=E,K.p=m,D.T=u}}fn=1,p_(),m_(),g_()}}function p_(){if(fn===1){fn=0;var r=No,o=Ja,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=D.T,D.T=null;var u=K.p;K.p=2;var m=gt;gt|=4;try{ZS(o,r);var v=Tg,E=e0(r.containerInfo),O=v.focusedElem,$=v.selectionRange;if(E!==O&&O&&O.ownerDocument&&Jx(O.ownerDocument.documentElement,O)){if($!==null&&Xp(O)){var te=$.start,ce=$.end;if(ce===void 0&&(ce=te),"selectionStart"in O)O.selectionStart=te,O.selectionEnd=Math.min(ce,O.value.length);else{var fe=O.ownerDocument||document,re=fe&&fe.defaultView||window;if(re.getSelection){var ie=re.getSelection(),Re=O.textContent.length,$e=Math.min($.start,Re),Ct=$.end===void 0?$e:Math.min($.end,Re);!ie.extend&&$e>Ct&&(E=Ct,Ct=$e,$e=E);var Z=Wx(O,$e),F=Wx(O,Ct);if(Z&&F&&(ie.rangeCount!==1||ie.anchorNode!==Z.node||ie.anchorOffset!==Z.offset||ie.focusNode!==F.node||ie.focusOffset!==F.offset)){var J=fe.createRange();J.setStart(Z.node,Z.offset),ie.removeAllRanges(),$e>Ct?(ie.addRange(J),ie.extend(F.node,F.offset)):(J.setEnd(F.node,F.offset),ie.addRange(J))}}}}for(fe=[],ie=O;ie=ie.parentNode;)ie.nodeType===1&&fe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<fe.length;O++){var le=fe[O];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}md=!!Eg,Tg=Eg=null}finally{gt=m,K.p=u,D.T=c}}r.current=o,fn=2}}function m_(){if(fn===2){fn=0;var r=No,o=Ja,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=D.T,D.T=null;var u=K.p;K.p=2;var m=gt;gt|=4;try{HS(r,o.alternate,o)}finally{gt=m,K.p=u,D.T=c}}fn=3}}function g_(){if(fn===4||fn===3){fn=0,Xe();var r=No,o=Ja,c=$s,u=n_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?fn=5:(fn=0,Ja=No=null,y_(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(Ro=null),cl(c),o=o.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Er,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=D.T,m=K.p,K.p=2,D.T=null;try{for(var v=r.onRecoverableError,E=0;E<u.length;E++){var O=u[E];v(O.value,{componentStack:O.stack})}}finally{D.T=o,K.p=m}}($s&3)!==0&&rd(),hs(r),m=r.pendingLanes,(c&261930)!==0&&(m&42)!==0?r===fg?Bl++:(Bl=0,fg=r):Bl=0,Fl(0)}}function y_(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,_l(o)))}function rd(){return p_(),m_(),g_(),v_()}function v_(){if(fn!==5)return!1;var r=No,o=lg;lg=0;var c=cl($s),u=D.T,m=K.p;try{K.p=32>c?32:c,D.T=null,c=ug,ug=null;var v=No,E=$s;if(fn=0,Ja=No=null,$s=0,(gt&6)!==0)throw Error(s(331));var O=gt;if(gt|=4,JS(v.current),XS(v,v.current,E,c),gt=O,Fl(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Er,v)}catch{}return!0}finally{K.p=m,D.T=u,y_(r,o)}}function b_(r,o,c){o=Nr(c,o),o=Hm(r.stateNode,o,2),r=So(r,o,2),r!==null&&(ws(r,2),hs(r))}function _t(r,o,c){if(r.tag===3)b_(r,r,c);else for(;o!==null;){if(o.tag===3){b_(o,r,c);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Ro===null||!Ro.has(u))){r=Nr(c,r),c=xS(2),u=So(o,c,2),u!==null&&(SS(c,u,o,r),ws(u,2),hs(u));break}}o=o.return}}function pg(r,o,c){var u=r.pingCache;if(u===null){u=r.pingCache=new LO;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(c)||(ig=!0,m.add(c),r=HO.bind(null,r,o,c),o.then(r,r))}function HO(r,o,c){var u=r.pingCache;u!==null&&u.delete(o),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Nt===r&&(tt&c)===c&&(Gt===4||Gt===3&&(tt&62914560)===tt&&300>Be()-Qf?(gt&2)===0&&ec(r,0):ag|=c,Wa===tt&&(Wa=0)),hs(r)}function x_(r,o){o===0&&(o=_i()),r=Ni(r,o),r!==null&&(ws(r,o),hs(r))}function qO(r){var o=r.memoizedState,c=0;o!==null&&(c=o.retryLane),x_(r,c)}function VO(r,o){var c=0;switch(r.tag){case 31:case 13:var u=r.stateNode,m=r.memoizedState;m!==null&&(c=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,c)}function KO(r,o){return Ie(r,o)}var sd=null,nc=null,mg=!1,od=!1,gg=!1,Ao=0;function hs(r){r!==nc&&r.next===null&&(nc===null?sd=nc=r:nc=nc.next=r),od=!0,mg||(mg=!0,ZO())}function Fl(r,o){if(!gg&&od){gg=!0;do for(var c=!1,u=sd;u!==null;){if(r!==0){var m=u.pendingLanes;if(m===0)var v=0;else{var E=u.suspendedLanes,O=u.pingedLanes;v=(1<<31-xt(42|r)+1)-1,v&=m&~(E&~O),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(c=!0,E_(u,v))}else v=tt,v=as(u,u===Nt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||cs(u,v)||(c=!0,E_(u,v));u=u.next}while(c);gg=!1}}function GO(){S_()}function S_(){od=mg=!1;var r=0;Ao!==0&&sM()&&(r=Ao);for(var o=Be(),c=null,u=sd;u!==null;){var m=u.next,v=__(u,o);v===0?(u.next=null,c===null?sd=m:c.next=m,m===null&&(nc=c)):(c=u,(r!==0||(v&3)!==0)&&(od=!0)),u=m}fn!==0&&fn!==5||Fl(r),Ao!==0&&(Ao=0)}function __(r,o){for(var c=r.suspendedLanes,u=r.pingedLanes,m=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var E=31-xt(v),O=1<<E,$=m[E];$===-1?((O&c)===0||(O&u)!==0)&&(m[E]=_a(O,o)):$<=o&&(r.expiredLanes|=O),v&=~O}if(o=Nt,c=tt,c=as(r,r===o?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,c===0||r===o&&(St===2||St===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&Ee(u),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||cs(r,c)){if(o=c&-c,o===r.callbackPriority)return o;switch(u!==null&&Ee(u),cl(c)){case 2:case 8:c=me;break;case 32:c=Te;break;case 268435456:c=mt;break;default:c=Te}return u=w_.bind(null,r),c=Ie(c,u),r.callbackPriority=o,r.callbackNode=c,o}return u!==null&&u!==null&&Ee(u),r.callbackPriority=2,r.callbackNode=null,2}function w_(r,o){if(fn!==0&&fn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(rd()&&r.callbackNode!==c)return null;var u=tt;return u=as(r,r===Nt?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:(s_(r,u,o),__(r,Be()),r.callbackNode!=null&&r.callbackNode===c?w_.bind(null,r):null)}function E_(r,o){if(rd())return null;s_(r,o,!0)}function ZO(){iM(function(){(gt&6)!==0?Ie(He,GO):S_()})}function yg(){if(Ao===0){var r=Ba;r===0&&(r=kt,kt<<=1,(kt&261888)===0&&(kt=256)),Ao=r}return Ao}function T_(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:hf(""+r)}function C_(r,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,r.id&&c.setAttribute("form",r.id),o.parentNode.insertBefore(c,o),r=new FormData(r),c.parentNode.removeChild(c),r}function YO(r,o,c,u,m){if(o==="submit"&&c&&c.stateNode===m){var v=T_((m[Un]||null).action),E=u.submitter;E&&(o=(o=E[Un]||null)?T_(o.formAction):E.getAttribute("formAction"),o!==null&&(v=o,E=null));var O=new yf("action","action",null,u,m);r.push({event:O,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Ao!==0){var $=E?C_(m,E):new FormData(m);zm(c,{pending:!0,data:$,method:m.method,action:v},null,$)}}else typeof v=="function"&&(O.preventDefault(),$=E?C_(m,E):new FormData(m),zm(c,{pending:!0,data:$,method:m.method,action:v},v,$))},currentTarget:m}]})}}for(var vg=0;vg<em.length;vg++){var bg=em[vg],XO=bg.toLowerCase(),QO=bg[0].toUpperCase()+bg.slice(1);Qr(XO,"on"+QO)}Qr(r0,"onAnimationEnd"),Qr(s0,"onAnimationIteration"),Qr(o0,"onAnimationStart"),Qr("dblclick","onDoubleClick"),Qr("focusin","onFocus"),Qr("focusout","onBlur"),Qr(hO,"onTransitionRun"),Qr(pO,"onTransitionStart"),Qr(mO,"onTransitionCancel"),Qr(i0,"onTransitionEnd"),Ra("onMouseEnter",["mouseout","mouseover"]),Ra("onMouseLeave",["mouseout","mouseover"]),Ra("onPointerEnter",["pointerout","pointerover"]),Ra("onPointerLeave",["pointerout","pointerover"]),Ei("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ei("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ei("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ei("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hl="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(" "),WO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hl));function R_(r,o){o=(o&4)!==0;for(var c=0;c<r.length;c++){var u=r[c],m=u.event;u=u.listeners;e:{var v=void 0;if(o)for(var E=u.length-1;0<=E;E--){var O=u[E],$=O.instance,te=O.currentTarget;if(O=O.listener,$!==v&&m.isPropagationStopped())break e;v=O,m.currentTarget=te;try{v(m)}catch(ce){xf(ce)}m.currentTarget=null,v=$}else for(E=0;E<u.length;E++){if(O=u[E],$=O.instance,te=O.currentTarget,O=O.listener,$!==v&&m.isPropagationStopped())break e;v=O,m.currentTarget=te;try{v(m)}catch(ce){xf(ce)}m.currentTarget=null,v=$}}}}function et(r,o){var c=o[Op];c===void 0&&(c=o[Op]=new Set);var u=r+"__bubble";c.has(u)||(N_(o,r,2,!1),c.add(u))}function xg(r,o,c){var u=0;o&&(u|=4),N_(c,r,u,o)}var id="_reactListening"+Math.random().toString(36).slice(2);function Sg(r){if(!r[id]){r[id]=!0,Sx.forEach(function(c){c!=="selectionchange"&&(WO.has(c)||xg(c,!1,r),xg(c,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[id]||(o[id]=!0,xg("selectionchange",!1,o))}}function N_(r,o,c,u){switch(rw(o)){case 2:var m=CM;break;case 8:m=RM;break;default:m=Dg}c=m.bind(null,o,c,r),m=void 0,!Bp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(m=!0),u?m!==void 0?r.addEventListener(o,c,{capture:!0,passive:m}):r.addEventListener(o,c,!0):m!==void 0?r.addEventListener(o,c,{passive:m}):r.addEventListener(o,c,!1)}function _g(r,o,c,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 O=u.stateNode.containerInfo;if(O===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(;O!==null;){if(E=Ea(O),E===null)return;if($=E.tag,$===5||$===6||$===26||$===27){u=v=E;continue e}O=O.parentNode}}u=u.return}Mx(function(){var te=v,ce=Up(c),fe=[];e:{var re=a0.get(r);if(re!==void 0){var ie=yf,Re=r;switch(r){case"keypress":if(mf(c)===0)break e;case"keydown":case"keyup":ie=Vk;break;case"focusin":Re="focus",ie=Vp;break;case"focusout":Re="blur",ie=Vp;break;case"beforeblur":case"afterblur":ie=Vp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Dx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=Mk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=Zk;break;case r0:case s0:case o0:ie=Dk;break;case i0:ie=Xk;break;case"scroll":case"scrollend":ie=kk;break;case"wheel":ie=Wk;break;case"copy":case"cut":case"paste":ie=Lk;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=eO}var $e=(o&4)!==0,Ct=!$e&&(r==="scroll"||r==="scrollend"),Z=$e?re!==null?re+"Capture":null:re;$e=[];for(var F=te,J;F!==null;){var le=F;if(J=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||J===null||Z===null||(le=fl(F,Z),le!=null&&$e.push(ql(F,le,J))),Ct)break;F=F.return}0<$e.length&&(re=new ie(re,Re,null,c,ce),fe.push({event:re,listeners:$e}))}}if((o&7)===0){e:{if(re=r==="mouseover"||r==="pointerover",ie=r==="mouseout"||r==="pointerout",re&&c!==Lp&&(Re=c.relatedTarget||c.fromElement)&&(Ea(Re)||Re[wa]))break e;if((ie||re)&&(re=ce.window===ce?ce:(re=ce.ownerDocument)?re.defaultView||re.parentWindow:window,ie?(Re=c.relatedTarget||c.toElement,ie=te,Re=Re?Ea(Re):null,Re!==null&&(Ct=a(Re),$e=Re.tag,Re!==Ct||$e!==5&&$e!==27&&$e!==6)&&(Re=null)):(ie=null,Re=te),ie!==Re)){if($e=Dx,le="onMouseLeave",Z="onMouseEnter",F="mouse",(r==="pointerout"||r==="pointerover")&&($e=Lx,le="onPointerLeave",Z="onPointerEnter",F="pointer"),Ct=ie==null?re:ul(ie),J=Re==null?re:ul(Re),re=new $e(le,F+"leave",ie,c,ce),re.target=Ct,re.relatedTarget=J,le=null,Ea(ce)===te&&($e=new $e(Z,F+"enter",Re,c,ce),$e.target=J,$e.relatedTarget=Ct,le=$e),Ct=le,ie&&Re)t:{for($e=JO,Z=ie,F=Re,J=0,le=Z;le;le=$e(le))J++;le=0;for(var ze=F;ze;ze=$e(ze))le++;for(;0<J-le;)Z=$e(Z),J--;for(;0<le-J;)F=$e(F),le--;for(;J--;){if(Z===F||F!==null&&Z===F.alternate){$e=Z;break t}Z=$e(Z),F=$e(F)}$e=null}else $e=null;ie!==null&&j_(fe,re,ie,$e,!1),Re!==null&&Ct!==null&&j_(fe,Ct,Re,$e,!0)}}e:{if(re=te?ul(te):window,ie=re.nodeName&&re.nodeName.toLowerCase(),ie==="select"||ie==="input"&&re.type==="file")var ft=Kx;else if(qx(re))if(Gx)ft=uO;else{ft=cO;var ke=aO}else ie=re.nodeName,!ie||ie.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?te&&zp(te.elementType)&&(ft=Kx):ft=lO;if(ft&&(ft=ft(r,te))){Vx(fe,ft,c,ce);break e}ke&&ke(r,re,te),r==="focusout"&&te&&re.type==="number"&&te.memoizedProps.value!=null&&Dp(re,"number",re.value)}switch(ke=te?ul(te):window,r){case"focusin":(qx(ke)||ke.contentEditable==="true")&&(Ma=ke,Qp=te,bl=null);break;case"focusout":bl=Qp=Ma=null;break;case"mousedown":Wp=!0;break;case"contextmenu":case"mouseup":case"dragend":Wp=!1,t0(fe,c,ce);break;case"selectionchange":if(dO)break;case"keydown":case"keyup":t0(fe,c,ce)}var Ye;if(Gp)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 Oa?Fx(r,c)&&(nt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(nt="onCompositionStart");nt&&(Ux&&c.locale!=="ko"&&(Oa||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&Oa&&(Ye=Ix()):(po=ce,Fp="value"in po?po.value:po.textContent,Oa=!0)),ke=ad(te,nt),0<ke.length&&(nt=new zx(nt,r,null,c,ce),fe.push({event:nt,listeners:ke}),Ye?nt.data=Ye:(Ye=Hx(c),Ye!==null&&(nt.data=Ye)))),(Ye=nO?rO(r,c):sO(r,c))&&(nt=ad(te,"onBeforeInput"),0<nt.length&&(ke=new zx("onBeforeInput","beforeinput",null,c,ce),fe.push({event:ke,listeners:nt}),ke.data=Ye)),YO(fe,r,te,c,ce)}R_(fe,o)})}function ql(r,o,c){return{instance:r,listener:o,currentTarget:c}}function ad(r,o){for(var c=o+"Capture",u=[];r!==null;){var m=r,v=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||v===null||(m=fl(r,c),m!=null&&u.unshift(ql(r,m,v)),m=fl(r,o),m!=null&&u.push(ql(r,m,v))),r.tag===3)return u;r=r.return}return[]}function JO(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,c,u,m){for(var v=o._reactName,E=[];c!==null&&c!==u;){var O=c,$=O.alternate,te=O.stateNode;if(O=O.tag,$!==null&&$===u)break;O!==5&&O!==26&&O!==27||te===null||($=te,m?(te=fl(c,v),te!=null&&E.unshift(ql(c,te,$))):m||(te=fl(c,v),te!=null&&E.push(ql(c,te,$)))),c=c.return}E.length!==0&&r.push({event:o,listeners:E})}var eM=/\r\n?/g,tM=/\u0000|\uFFFD/g;function A_(r){return(typeof r=="string"?r:""+r).replace(eM,`
67
+ `).replace(tM,"")}function k_(r,o){return o=A_(o),A_(r)===o}function Tt(r,o,c,u,m,v){switch(c){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||ja(r,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&ja(r,""+u);break;case"className":ff(r,"class",u);break;case"tabIndex":ff(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":ff(r,c,u);break;case"style":kx(r,u,v);break;case"data":if(o!=="object"){ff(r,"data",u);break}case"src":case"href":if(u===""&&(o!=="a"||c!=="href")){r.removeAttribute(c);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(c);break}u=hf(""+u),r.setAttribute(c,u);break;case"action":case"formAction":if(typeof u=="function"){r.setAttribute(c,"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"&&(c==="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(c);break}u=hf(""+u),r.setAttribute(c,u);break;case"onClick":u!=null&&(r.onclick=Ts);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(c=u.__html,c!=null){if(m.children!=null)throw Error(s(60));r.innerHTML=c}}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}c=hf(""+u),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);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(c,""+u):r.removeAttribute(c);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(c,""):r.removeAttribute(c);break;case"capture":case"download":u===!0?r.setAttribute(c,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(c,u):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?r.setAttribute(c,u):r.removeAttribute(c);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?r.removeAttribute(c):r.setAttribute(c,u);break;case"popover":et("beforetoggle",r),et("toggle",r),uf(r,"popover",u);break;case"xlinkActuate":Es(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Es(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Es(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Es(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Es(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Es(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Es(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Es(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Es(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":uf(r,"is",u);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=jk.get(c)||c,uf(r,c,u))}}function wg(r,o,c,u,m,v){switch(c){case"style":kx(r,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(c=u.__html,c!=null){if(m.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"children":typeof u=="string"?ja(r,u):(typeof u=="number"||typeof u=="bigint")&&ja(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=Ts);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_x.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(m=c.endsWith("Capture"),o=c.slice(2,m?c.length-7:void 0),v=r[Un]||null,v=v!=null?v[c]:null,typeof v=="function"&&r.removeEventListener(o,v,m),typeof u=="function")){typeof v!="function"&&v!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(o,u,m);break e}c in r?r[c]=u:u===!0?r.setAttribute(c,""):uf(r,c,u)}}}function Tn(r,o,c){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 c)if(c.hasOwnProperty(v)){var E=c[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,c,null)}}m&&Tt(r,o,"srcSet",c.srcSet,c,null),u&&Tt(r,o,"src",c.src,c,null);return;case"input":et("invalid",r);var O=v=E=m=null,$=null,te=null;for(u in c)if(c.hasOwnProperty(u)){var ce=c[u];if(ce!=null)switch(u){case"name":m=ce;break;case"type":E=ce;break;case"checked":$=ce;break;case"defaultChecked":te=ce;break;case"value":v=ce;break;case"defaultValue":O=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,o));break;default:Tt(r,o,u,ce,c,null)}}Rx(r,v,O,$,te,E,m,!1);return;case"select":et("invalid",r),u=E=v=null;for(m in c)if(c.hasOwnProperty(m)&&(O=c[m],O!=null))switch(m){case"value":v=O;break;case"defaultValue":E=O;break;case"multiple":u=O;default:Tt(r,o,m,O,c,null)}o=v,c=E,r.multiple=!!u,o!=null?Na(r,!!u,o,!1):c!=null&&Na(r,!!u,c,!0);return;case"textarea":et("invalid",r),v=m=u=null;for(E in c)if(c.hasOwnProperty(E)&&(O=c[E],O!=null))switch(E){case"value":u=O;break;case"defaultValue":m=O;break;case"children":v=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(s(91));break;default:Tt(r,o,E,O,c,null)}jx(r,u,m,v);return;case"option":for($ in c)c.hasOwnProperty($)&&(u=c[$],u!=null)&&($==="selected"?r.selected=u&&typeof u!="function"&&typeof u!="symbol":Tt(r,o,$,u,c,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<Hl.length;u++)et(Hl[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(te in c)if(c.hasOwnProperty(te)&&(u=c[te],u!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Tt(r,o,te,u,c,null)}return;default:if(zp(o)){for(ce in c)c.hasOwnProperty(ce)&&(u=c[ce],u!==void 0&&wg(r,o,ce,u,c,void 0));return}}for(O in c)c.hasOwnProperty(O)&&(u=c[O],u!=null&&Tt(r,o,O,u,c,null))}function nM(r,o,c,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,O=null,$=null,te=null,ce=null;for(ie in c){var fe=c[ie];if(c.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 re in u){var ie=u[re];if(fe=c[re],u.hasOwnProperty(re)&&(ie!=null||fe!=null))switch(re){case"type":v=ie;break;case"name":m=ie;break;case"checked":te=ie;break;case"defaultChecked":ce=ie;break;case"value":E=ie;break;case"defaultValue":O=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,o));break;default:ie!==fe&&Tt(r,o,re,ie,u,fe)}}Pp(r,E,O,$,te,ce,v,m);return;case"select":ie=E=O=re=null;for(v in c)if($=c[v],c.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],$=c[m],u.hasOwnProperty(m)&&(v!=null||$!=null))switch(m){case"value":re=v;break;case"defaultValue":O=v;break;case"multiple":E=v;default:v!==$&&Tt(r,o,m,v,u,$)}o=O,c=E,u=ie,re!=null?Na(r,!!c,re,!1):!!u!=!!c&&(o!=null?Na(r,!!c,o,!0):Na(r,!!c,c?[]:"",!1));return;case"textarea":ie=re=null;for(O in c)if(m=c[O],c.hasOwnProperty(O)&&m!=null&&!u.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:Tt(r,o,O,null,u,m)}for(E in u)if(m=u[E],v=c[E],u.hasOwnProperty(E)&&(m!=null||v!=null))switch(E){case"value":re=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,re,ie);return;case"option":for(var Re in c)re=c[Re],c.hasOwnProperty(Re)&&re!=null&&!u.hasOwnProperty(Re)&&(Re==="selected"?r.selected=!1:Tt(r,o,Re,null,u,re));for($ in u)re=u[$],ie=c[$],u.hasOwnProperty($)&&re!==ie&&(re!=null||ie!=null)&&($==="selected"?r.selected=re&&typeof re!="function"&&typeof re!="symbol":Tt(r,o,$,re,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 $e in c)re=c[$e],c.hasOwnProperty($e)&&re!=null&&!u.hasOwnProperty($e)&&Tt(r,o,$e,null,u,re);for(te in u)if(re=u[te],ie=c[te],u.hasOwnProperty(te)&&re!==ie&&(re!=null||ie!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(s(137,o));break;default:Tt(r,o,te,re,u,ie)}return;default:if(zp(o)){for(var Ct in c)re=c[Ct],c.hasOwnProperty(Ct)&&re!==void 0&&!u.hasOwnProperty(Ct)&&wg(r,o,Ct,void 0,u,re);for(ce in u)re=u[ce],ie=c[ce],!u.hasOwnProperty(ce)||re===ie||re===void 0&&ie===void 0||wg(r,o,ce,re,u,ie);return}}for(var Z in c)re=c[Z],c.hasOwnProperty(Z)&&re!=null&&!u.hasOwnProperty(Z)&&Tt(r,o,Z,null,u,re);for(fe in u)re=u[fe],ie=c[fe],!u.hasOwnProperty(fe)||re===ie||re==null&&ie==null||Tt(r,o,fe,re,u,ie)}function O_(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rM(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,c=performance.getEntriesByType("resource"),u=0;u<c.length;u++){var m=c[u],v=m.transferSize,E=m.initiatorType,O=m.duration;if(v&&O&&O_(E)){for(E=0,O=m.responseEnd,u+=1;u<c.length;u++){var $=c[u],te=$.startTime;if(te>O)break;var ce=$.transferSize,fe=$.initiatorType;ce&&O_(fe)&&($=$.responseEnd,E+=ce*($<O?1:(O-te)/($-te)))}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 Eg=null,Tg=null;function cd(r){return r.nodeType===9?r:r.ownerDocument}function M_(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 Cg(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 Rg=null;function sM(){var r=window.event;return r&&r.type==="popstate"?r===Rg?!1:(Rg=r,!0):(Rg=null,!1)}var P_=typeof setTimeout=="function"?setTimeout:void 0,oM=typeof clearTimeout=="function"?clearTimeout:void 0,D_=typeof Promise=="function"?Promise:void 0,iM=typeof queueMicrotask=="function"?queueMicrotask:typeof D_<"u"?function(r){return D_.resolve(null).then(r).catch(aM)}:P_;function aM(r){setTimeout(function(){throw r})}function ko(r){return r==="head"}function z_(r,o){var c=o,u=0;do{var m=c.nextSibling;if(r.removeChild(c),m&&m.nodeType===8)if(c=m.data,c==="/$"||c==="/&"){if(u===0){r.removeChild(m),ic(o);return}u--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")u++;else if(c==="html")Vl(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,Vl(c);for(var v=c.firstChild;v;){var E=v.nextSibling,O=v.nodeName;v[ll]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&v.rel.toLowerCase()==="stylesheet"||c.removeChild(v),v=E}}else c==="body"&&Vl(r.ownerDocument.body);c=m}while(c);ic(o)}function L_(r,o){var c=r;r=0;do{var u=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),u&&u.nodeType===8)if(c=u.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=u}while(c)}function Ng(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Ng(c),Mp(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function cM(r,o,c,u){for(;r.nodeType===1;){var m=c;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!u&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(u){if(!r[ll])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=Mr(r.nextSibling),r===null)break}return null}function lM(r,o,c){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Mr(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=Mr(r.nextSibling),r===null))return null;return r}function jg(r){return r.data==="$?"||r.data==="$~"}function Ag(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function uM(r,o){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||c.readyState!=="loading")o();else{var u=function(){o(),c.removeEventListener("DOMContentLoaded",u)};c.addEventListener("DOMContentLoaded",u),r._reactRetry=u}}function Mr(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 kg=null;function $_(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(o===0)return Mr(r.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}r=r.nextSibling}return null}function B_(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return r;o--}else c!=="/$"&&c!=="/&"||o++}r=r.previousSibling}return null}function F_(r,o,c){switch(o=cd(c),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 Vl(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Mp(r)}var Ir=new Map,H_=new Set;function ld(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Bs=K.d;K.d={f:fM,r:dM,D:hM,C:pM,L:mM,m:gM,X:vM,S:yM,M:bM};function fM(){var r=Bs.f(),o=ed();return r||o}function dM(r){var o=Ta(r);o!==null&&o.tag===5&&o.type==="form"?iS(o):Bs.r(r)}var rc=typeof document>"u"?null:document;function q_(r,o,c){var u=rc;if(u&&typeof o=="string"&&o){var m=Cr(o);m='link[rel="'+r+'"][href="'+m+'"]',typeof c=="string"&&(m+='[crossorigin="'+c+'"]'),H_.has(m)||(H_.add(m),r={rel:r,crossOrigin:c,href:o},u.querySelector(m)===null&&(o=u.createElement("link"),Tn(o,"link",r),bn(o),u.head.appendChild(o)))}}function hM(r){Bs.D(r),q_("dns-prefetch",r,null)}function pM(r,o){Bs.C(r,o),q_("preconnect",r,o)}function mM(r,o,c){Bs.L(r,o,c);var u=rc;if(u&&r&&o){var m='link[rel="preload"][as="'+Cr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(m+='[imagesrcset="'+Cr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(m+='[imagesizes="'+Cr(c.imageSizes)+'"]')):m+='[href="'+Cr(r)+'"]';var v=m;switch(o){case"style":v=sc(r);break;case"script":v=oc(r)}Ir.has(v)||(r=y({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:r,as:o},c),Ir.set(v,r),u.querySelector(m)!==null||o==="style"&&u.querySelector(Kl(v))||o==="script"&&u.querySelector(Gl(v))||(o=u.createElement("link"),Tn(o,"link",r),bn(o),u.head.appendChild(o)))}}function gM(r,o){Bs.m(r,o);var c=rc;if(c&&r){var u=o&&typeof o.as=="string"?o.as:"script",m='link[rel="modulepreload"][as="'+Cr(u)+'"][href="'+Cr(r)+'"]',v=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=oc(r)}if(!Ir.has(v)&&(r=y({rel:"modulepreload",href:r},o),Ir.set(v,r),c.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Gl(v)))return}u=c.createElement("link"),Tn(u,"link",r),bn(u),c.head.appendChild(u)}}}function yM(r,o,c){Bs.S(r,o,c);var u=rc;if(u&&r){var m=Ca(u).hoistableStyles,v=sc(r);o=o||"default";var E=m.get(v);if(!E){var O={loading:0,preload:null};if(E=u.querySelector(Kl(v)))O.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":o},c),(c=Ir.get(v))&&Og(r,c);var $=E=u.createElement("link");bn($),Tn($,"link",r),$._p=new Promise(function(te,ce){$.onload=te,$.onerror=ce}),$.addEventListener("load",function(){O.loading|=1}),$.addEventListener("error",function(){O.loading|=2}),O.loading|=4,ud(E,o,u)}E={type:"stylesheet",instance:E,count:1,state:O},m.set(v,E)}}}function vM(r,o){Bs.X(r,o);var c=rc;if(c&&r){var u=Ca(c).hoistableScripts,m=oc(r),v=u.get(m);v||(v=c.querySelector(Gl(m)),v||(r=y({src:r,async:!0},o),(o=Ir.get(m))&&Mg(r,o),v=c.createElement("script"),bn(v),Tn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function bM(r,o){Bs.M(r,o);var c=rc;if(c&&r){var u=Ca(c).hoistableScripts,m=oc(r),v=u.get(m);v||(v=c.querySelector(Gl(m)),v||(r=y({src:r,async:!0,type:"module"},o),(o=Ir.get(m))&&Mg(r,o),v=c.createElement("script"),bn(v),Tn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function V_(r,o,c,u){var m=(m=se.current)?ld(m):null;if(!m)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=sc(c.href),c=Ca(m).hoistableStyles,u=c.get(o),u||(u={type:"style",instance:null,count:0,state:null},c.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=sc(c.href);var v=Ca(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(Kl(r)))&&!v._p&&(E.instance=v,E.state.loading=5),Ir.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Ir.set(r,c),v||xM(m,r,c,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=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=oc(c),c=Ca(m).hoistableScripts,u=c.get(o),u||(u={type:"script",instance:null,count:0,state:null},c.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function sc(r){return'href="'+Cr(r)+'"'}function Kl(r){return'link[rel="stylesheet"]['+r+"]"}function K_(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function xM(r,o,c,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}),Tn(o,"link",c),bn(o),r.head.appendChild(o))}function oc(r){return'[src="'+Cr(r)+'"]'}function Gl(r){return"script[async]"+r}function G_(r,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var u=r.querySelector('style[data-href~="'+Cr(c.href)+'"]');if(u)return o.instance=u,bn(u),u;var m=y({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),bn(u),Tn(u,"style",m),ud(u,c.precedence,r),o.instance=u;case"stylesheet":m=sc(c.href);var v=r.querySelector(Kl(m));if(v)return o.state.loading|=4,o.instance=v,bn(v),v;u=K_(c),(m=Ir.get(m))&&Og(u,m),v=(r.ownerDocument||r).createElement("link"),bn(v);var E=v;return E._p=new Promise(function(O,$){E.onload=O,E.onerror=$}),Tn(v,"link",u),o.state.loading|=4,ud(v,c.precedence,r),o.instance=v;case"script":return v=oc(c.src),(m=r.querySelector(Gl(v)))?(o.instance=m,bn(m),m):(u=c,(m=Ir.get(v))&&(u=y({},c),Mg(u,m)),r=r.ownerDocument||r,m=r.createElement("script"),bn(m),Tn(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,ud(u,c.precedence,r));return o.instance}function ud(r,o,c){for(var u=c.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 O=u[E];if(O.dataset.precedence===o)v=O;else if(v!==m)break}v?v.parentNode.insertBefore(r,v.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(r,o.firstChild))}function Og(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function Mg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var fd=null;function Z_(r,o,c){if(fd===null){var u=new Map,m=fd=new Map;m.set(c,u)}else m=fd,u=m.get(c),u||(u=new Map,m.set(c,u));if(u.has(r))return u;for(u.set(r,null),c=c.getElementsByTagName(r),m=0;m<c.length;m++){var v=c[m];if(!(v[ll]||v[Sn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var E=v.getAttribute(o)||"";E=r+E;var O=u.get(E);O?O.push(v):u.set(E,[v])}}return u}function Y_(r,o,c){r=r.ownerDocument||r,r.head.insertBefore(c,o==="title"?r.querySelector("head > title"):null)}function SM(r,o,c){if(c===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 _M(r,o,c,u){if(c.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var m=sc(u.href),v=o.querySelector(Kl(m));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=dd.bind(r),o.then(r,r)),c.state.loading|=4,c.instance=v,bn(v);return}v=o.ownerDocument||o,u=K_(u),(m=Ir.get(m))&&Og(u,m),v=v.createElement("link"),bn(v);var E=v;E._p=new Promise(function(O,$){E.onload=O,E.onerror=$}),Tn(v,"link",u),c.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=dd.bind(r),o.addEventListener("load",c),o.addEventListener("error",c))}}var Ig=0;function wM(r,o){return r.stylesheets&&r.count===0&&pd(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var u=setTimeout(function(){if(r.stylesheets&&pd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+o);0<r.imgBytes&&Ig===0&&(Ig=62500*rM());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&pd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Ig?50:800)+o);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function dd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)pd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var hd=null;function pd(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,hd=new Map,o.forEach(EM,r),hd=null,dd.call(r))}function EM(r,o){if(!(o.state.loading&4)){var c=hd.get(r);if(c)var u=c.get(null);else{c=new Map,hd.set(r,c);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")&&(c.set(E.dataset.precedence,E),u=E)}u&&c.set(null,u)}m=o.instance,E=m.getAttribute("data-precedence"),v=c.get(E)||u,v===u&&c.set(null,m),c.set(E,m),this.count++,u=dd.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 Zl={$$typeof:N,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function TM(r,o,c,u,m,v,E,O,$){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=wi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wi(0),this.hiddenUpdates=wi(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,c,u,m,v,E,O,$,te,ce,fe){return r=new TM(r,o,c,E,$,te,ce,fe,O),o=1,v===!0&&(o|=24),v=sr(3,null,null,o),r.current=v,v.stateNode=r,o=hm(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:c,cache:o},ym(v),r}function W_(r){return r?(r=Da,r):Da}function J_(r,o,c,u,m,v){m=W_(m),u.context===null?u.context=m:u.pendingContext=m,u=xo(o),u.payload={element:c},v=v===void 0?null:v,v!==null&&(u.callback=v),c=So(r,u,o),c!==null&&(Vn(c,r,o),Cl(c,r,o))}function ew(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<o?c:o}}function Pg(r,o){ew(r,o),(r=r.alternate)&&ew(r,o)}function tw(r){if(r.tag===13||r.tag===31){var o=Ni(r,67108864);o!==null&&Vn(o,r,67108864),Pg(r,67108864)}}function nw(r){if(r.tag===13||r.tag===31){var o=lr();o=nr(o);var c=Ni(r,o);c!==null&&Vn(c,r,o),Pg(r,o)}}var md=!0;function CM(r,o,c,u){var m=D.T;D.T=null;var v=K.p;try{K.p=2,Dg(r,o,c,u)}finally{K.p=v,D.T=m}}function RM(r,o,c,u){var m=D.T;D.T=null;var v=K.p;try{K.p=8,Dg(r,o,c,u)}finally{K.p=v,D.T=m}}function Dg(r,o,c,u){if(md){var m=zg(u);if(m===null)_g(r,o,u,gd,c),sw(r,u);else if(jM(m,r,o,c,u))u.stopPropagation();else if(sw(r,u),o&4&&-1<NM.indexOf(r)){for(;m!==null;){var v=Ta(m);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var E=An(v.pendingLanes);if(E!==0){var O=v;for(O.pendingLanes|=2,O.entangledLanes|=2;E;){var $=1<<31-xt(E);O.entanglements[1]|=$,E&=~$}hs(v),(gt&6)===0&&(Wf=Be()+500,Fl(0))}}break;case 31:case 13:O=Ni(v,2),O!==null&&Vn(O,v,2),ed(),Pg(v,2)}if(v=zg(u),v===null&&_g(r,o,u,gd,c),v===m)break;m=v}m!==null&&u.stopPropagation()}else _g(r,o,u,null,c)}}function zg(r){return r=Up(r),Lg(r)}var gd=null;function Lg(r){if(gd=null,r=Ea(r),r!==null){var o=a(r);if(o===null)r=null;else{var c=o.tag;if(c===13){if(r=l(o),r!==null)return r;r=null}else if(c===31){if(r=f(o),r!==null)return r;r=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return gd=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 He:return 2;case me:return 8;case Te:case qe:return 32;case mt:return 268435456;default:return 32}default:return 32}}var Ug=!1,Oo=null,Mo=null,Io=null,Yl=new Map,Xl=new Map,Po=[],NM="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":Oo=null;break;case"dragenter":case"dragleave":Mo=null;break;case"mouseover":case"mouseout":Io=null;break;case"pointerover":case"pointerout":Yl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xl.delete(o.pointerId)}}function Ql(r,o,c,u,m,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:c,eventSystemFlags:u,nativeEvent:v,targetContainers:[m]},o!==null&&(o=Ta(o),o!==null&&tw(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,m!==null&&o.indexOf(m)===-1&&o.push(m),r)}function jM(r,o,c,u,m){switch(o){case"focusin":return Oo=Ql(Oo,r,o,c,u,m),!0;case"dragenter":return Mo=Ql(Mo,r,o,c,u,m),!0;case"mouseover":return Io=Ql(Io,r,o,c,u,m),!0;case"pointerover":var v=m.pointerId;return Yl.set(v,Ql(Yl.get(v)||null,r,o,c,u,m)),!0;case"gotpointercapture":return v=m.pointerId,Xl.set(v,Ql(Xl.get(v)||null,r,o,c,u,m)),!0}return!1}function ow(r){var o=Ea(r.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){r.blockedOn=o,lf(r.priority,function(){nw(c)});return}}else if(o===31){if(o=f(c),o!==null){r.blockedOn=o,lf(r.priority,function(){nw(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function yd(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var c=zg(r.nativeEvent);if(c===null){c=r.nativeEvent;var u=new c.constructor(c.type,c);Lp=u,c.target.dispatchEvent(u),Lp=null}else return o=Ta(c),o!==null&&tw(o),r.blockedOn=c,!1;o.shift()}return!0}function iw(r,o,c){yd(r)&&c.delete(o)}function AM(){Ug=!1,Oo!==null&&yd(Oo)&&(Oo=null),Mo!==null&&yd(Mo)&&(Mo=null),Io!==null&&yd(Io)&&(Io=null),Yl.forEach(iw),Xl.forEach(iw)}function vd(r,o){r.blockedOn===o&&(r.blockedOn=null,Ug||(Ug=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,AM)))}var bd=null;function aw(r){bd!==r&&(bd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bd===r&&(bd=null);for(var o=0;o<r.length;o+=3){var c=r[o],u=r[o+1],m=r[o+2];if(typeof u!="function"){if(Lg(u||c)===null)continue;break}var v=Ta(c);v!==null&&(r.splice(o,3),o-=3,zm(v,{pending:!0,data:m,method:c.method,action:u},u,m))}}))}function ic(r){function o($){return vd($,r)}Oo!==null&&vd(Oo,r),Mo!==null&&vd(Mo,r),Io!==null&&vd(Io,r),Yl.forEach(o),Xl.forEach(o);for(var c=0;c<Po.length;c++){var u=Po[c];u.blockedOn===r&&(u.blockedOn=null)}for(;0<Po.length&&(c=Po[0],c.blockedOn===null);)ow(c),c.blockedOn===null&&Po.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(u=0;u<c.length;u+=3){var m=c[u],v=c[u+1],E=m[Un]||null;if(typeof v=="function")E||aw(c);else if(E){var O=null;if(v&&v.hasAttribute("formAction")){if(m=v,E=v[Un]||null)O=E.formAction;else if(Lg(m)!==null)continue}else O=E.action;typeof O=="function"?c[u+1]=O:(c.splice(u,3),u-=3),aw(c)}}}function cw(){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(c,20)}function c(){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(c,100),function(){u=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),m!==null&&(m(),m=null)}}}function $g(r){this._internalRoot=r}xd.prototype.render=$g.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(s(409));var c=o.current,u=lr();J_(c,u,r,o,null,null)},xd.prototype.unmount=$g.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),ed(),o[wa]=null}};function xd(r){this._internalRoot=r}xd.prototype.unstable_scheduleHydration=function(r){if(r){var o=cf();r={blockedOn:null,target:r,priority:o};for(var c=0;c<Po.length&&o!==0&&o<Po[c].priority;c++);Po.splice(c,0,r),c===0&&ow(r)}};var lw=t.version;if(lw!=="19.2.4")throw Error(s(527,lw,"19.2.4"));K.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 kM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sd.isDisabled&&Sd.supportsFiber)try{Er=Sd.inject(kM),Qt=Sd}catch{}}return eu.createRoot=function(r,o){if(!i(r))throw Error(s(299));var c=!1,u="",m=gS,v=yS,E=vS;return o!=null&&(o.unstable_strictMode===!0&&(c=!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,c,u,null,m,v,E,cw),r[wa]=o.current,Sg(r),new $g(o)},eu.hydrateRoot=function(r,o,c){if(!i(r))throw Error(s(299));var u=!1,m="",v=gS,E=yS,O=vS,$=null;return c!=null&&(c.unstable_strictMode===!0&&(u=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(v=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(O=c.onRecoverableError),c.formState!==void 0&&($=c.formState)),o=Q_(r,1,!0,o,c??null,u,m,$,v,E,O,cw),o.context=W_(null),c=o.current,u=lr(),u=nr(u),m=xo(u),m.callback=null,So(c,m,u),c=u,o.current.lanes=c,ws(o,c),hs(o),r[wa]=o.current,Sg(r),new xd(o)},eu.version="19.2.4",eu}var XE;function l6(){if(XE)return ay.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(),ay.exports=c6(),ay.exports}var u6=l6(),Jc=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(){}},f6={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},d6=class{#e=f6;#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)}},Gi=new d6;function h6(e){setTimeout(e,0)}var aa=typeof window>"u"||"Deno"in globalThis;function Mn(){}function p6(e,t){return typeof e=="function"?e(t):e}function gv(e){return typeof e=="number"&&e>=0&&e!==1/0}function vN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Yo(e,t){return typeof e=="function"?e(t):e}function zr(e,t){return typeof e=="function"?e(t):e}function QE(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:a,queryKey:l,stale:f}=e;if(l){if(s){if(t.queryHash!==Nb(l,t.options))return!1}else if(!Eu(t.queryKey,l))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(ca(t.options.mutationKey)!==ca(a))return!1}else if(!Eu(t.options.mutationKey,a))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function Nb(e,t){return(t?.queryKeyHashFn||ca)(e)}function ca(e){return JSON.stringify(e,(t,n)=>yv(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Eu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Eu(e[n],t[n])):!1}var m6=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&&!(yv(e)&&yv(t)))return t;const a=(s?e:Object.keys(e)).length,l=s?t:Object.keys(t),f=l.length,d=s?new Array(f):{};let p=0;for(let g=0;g<f;g++){const y=s?g:l[g],b=e[y],x=t[y];if(b===x){d[y]=b,(s?g<a:m6.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 jh(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 yv(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 g6(e){return new Promise(t=>{Gi.setTimeout(t,e)})}function vv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?bN(e,t):t}function y6(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function v6(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var jb=Symbol();function xN(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===jb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ab(e,t){return typeof e=="function"?e(...t):!!e}function b6(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 x6=class extends Jc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!aa&&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"}},kb=new x6;function bv(){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 S6=h6;function _6(){let e=[],t=0,n=f=>{f()},s=f=>{f()},i=S6;const a=f=>{t?e.push(f):i(()=>{n(f)})},l=()=>{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||l()}return d},batchCalls:f=>(...d)=>{a(()=>{f(...d)})},schedule:a,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{i=f}}}var pn=_6(),w6=class extends Jc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!aa&&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}},Ah=new w6;function E6(e){return Math.min(1e3*2**e,3e4)}function SN(e){return(e??"online")==="online"?Ah.isOnline():!0}var xv=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=bv(),a=()=>i.status!=="pending",l=w=>{if(!a()){const T=new xv(w);b(T),e.onCancel?.(T)}},f=()=>{t=!0},d=()=>{t=!1},p=()=>kb.isFocused()&&(e.networkMode==="always"||Ah.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 k=e.retry??(aa?0:3),N=e.retryDelay??E6,R=typeof N=="function"?N(n,C):N,M=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,C);if(t||!M){b(C);return}n++,e.onFail?.(n,C),g6(R).then(()=>p()?void 0:x()).then(()=>{t?b(C):S()})})};return{promise:i,status:()=>i.status,cancel:l,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(),gv(this.gcTime)&&(this.#e=Gi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(aa?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Gi.clearTimeout(this.#e),this.#e=void 0)}},T6=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=vv(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(Mn).catch(Mn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>zr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Yo(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)},l=(()=>{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(l,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#o({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=_N({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:f=>{f instanceof xv&&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:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.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 xv){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),pn.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 C6=class extends Jc{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=bv(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#i;#a;#o;#m;#d;#h;#l;#u;#c;#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 Sv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sv(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 zr(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&&!jh(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||zr(this.options.enabled,this.#t)!==zr(t.enabled,this.#t)||Yo(this.options.staleTime,this.#t)!==Yo(t.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||zr(this.options.enabled,this.#t)!==zr(t.enabled,this.#t)||i!==this.#c)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return N6(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(Mn)),t}#g(){this.#x();const e=Yo(this.options.staleTime,this.#t);if(aa||this.#s.isStale||!gv(e))return;const n=vN(this.#s.dataUpdatedAt,e)+1;this.#l=Gi.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.#c=e,!(aa||zr(this.options.enabled,this.#t)===!1||!gv(this.#c)||this.#c===0)&&(this.#u=Gi.setInterval(()=>{(this.options.refetchIntervalInBackground||kb.isFocused())&&this.#f()},this.#c))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#l&&(Gi.clearTimeout(this.#l),this.#l=void 0)}#S(){this.#u&&(Gi.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,s=this.options,i=this.#s,a=this.#r,l=this.#i,d=e!==n?e.state:this.#n,{state:p}=e;let g={...p},y=!1,b;if(t._optimisticResults){const A=this.hasListeners(),P=!A&&rT(e,t),G=A&&sT(e,n,t,s);(P||G)&&(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 A;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(A=i.data,T=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,A!==void 0&&(w="success",b=vv(i?.data,A,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=vv(i?.data,b,t),this.#d=b,this.#o=null}catch(A){this.#o=A}this.#o&&(x=this.#o,b=this.#d,S=Date.now(),w="error");const C=g.fetchStatus==="fetching",k=w==="pending",N=w==="error",R=k&&C,M=b!==void 0,j={status:w,fetchStatus:g.fetchStatus,isPending:k,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&&!k,isLoadingError:N&&!M,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:N&&M,isStale:Ob(e,t),refetch:this.refetch,promise:this.#a,isEnabled:zr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=j.data!==void 0,P=j.status==="error"&&!A,G=Q=>{P?Q.reject(j.error):A&&Q.resolve(j.data)},B=()=>{const Q=this.#a=j.promise=bv();G(Q)},z=this.#a;switch(z.status){case"pending":e.queryHash===n.queryHash&&G(z);break;case"fulfilled":(P||j.data!==z.value)&&B();break;case"rejected":(!P||j.error!==z.reason)&&B();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),jh(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(l=>{const f=l;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){pn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function R6(e,t){return zr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function rT(e,t){return R6(e,t)||e.state.data!==void 0&&Sv(e,t,t.refetchOnMount)}function Sv(e,t,n){if(zr(t.enabled,e)!==!1&&Yo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&Ob(e,t)}return!1}function sT(e,t,n,s){return(e!==t||zr(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ob(e,n)}function Ob(e,t){return zr(t.enabled,e)!==!1&&e.isStaleByTime(Yo(t.staleTime,e))}function N6(e,t){return!jh(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||[],l=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},d=0;const p=async()=>{let g=!1;const y=S=>{b6(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 k=(()=>{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(k),{maxPages:R}=t.options,M=T?v6:y6;return{pages:M(S.pages,N,R),pageParams:M(S.pageParams,w,R)}};if(i&&a.length){const S=i==="backward",w=S?j6:iT,T={pages:a,pageParams:l},C=w(s,T);f=await x(T,C,S)}else{const S=e??a.length;do{const w=d===0?l[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 j6(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var A6=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,l)=>{this.#r({type:"failed",failureCount:a,error:l})},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 l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,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(l){Promise.reject(l)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(l){Promise.reject(l)}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),pn.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 k6=class extends Jc{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 A6({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=kd(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=kd(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=kd(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=kd(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){pn.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){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return pn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Mn))))}};function kd(e){return e.options.scope?.id}var O6=class extends Jc{#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),jh(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ca(n.mutationKey)!==ca(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){pn.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)})})}},M6=class extends Jc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,i=t.queryHash??Nb(s,t);let a=this.get(i);return a||(a=new T6({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(){pn.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){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},I6=class{#e;#t;#n;#s;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new M6,this.#t=e.mutationCache||new k6,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=kb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Ah.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(Yo(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,l=p6(t,a);if(l!==void 0)return this.#e.build(this,s).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return pn.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;pn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return pn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=pn.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(Mn).catch(Mn)}invalidateQueries(e,t={}){return pn.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=pn.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(Mn)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(Mn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Yo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mn).catch(Mn)}fetchInfiniteQuery(e){return e.behavior=oT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mn).catch(Mn)}ensureInfiniteQueryData(e){return e.behavior=oT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ah.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(ca(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{Eu(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(ca(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{Eu(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=Nb(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===jb&&(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),_r=e=>{const t=_.useContext(CN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},P6=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(CN.Provider,{value:e,children:t})),RN=_.createContext(!1),D6=()=>_.useContext(RN);RN.Provider;function z6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var L6=_.createContext(z6()),U6=()=>_.useContext(L6),$6=(e,t,n)=>{const s=n?.state.error&&typeof e.throwOnError=="function"?Ab(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},B6=e=>{_.useEffect(()=>{e.clearReset()},[e])},F6=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||Ab(n,[e.error,s])),H6=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))}},q6=(e,t)=>e.isLoading&&e.isFetching&&!t,V6=(e,t)=>e?.suspense&&t.isPending,aT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function K6(e,t,n){const s=D6(),i=U6(),a=_r(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const f=a.getQueryCache().get(l.queryHash);l._optimisticResults=s?"isRestoring":"optimistic",H6(l),$6(l,i,f),B6(i);const d=!a.getQueryCache().get(l.queryHash),[p]=_.useState(()=>new t(a,l)),g=p.getOptimisticResult(l),y=!s&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const x=y?p.subscribe(pn.batchCalls(b)):Mn;return p.updateResult(),x},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),_.useEffect(()=>{p.setOptions(l)},[l,p]),V6(l,g))throw aT(l,p,i);if(F6({result:g,errorResetBoundary:i,throwOnError:l.throwOnError,query:f,suspense:l.suspense}))throw g.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,g),l.experimental_prefetchInRender&&!aa&&q6(g,s)&&(d?aT(l,p,i):f?.promise)?.catch(Mn).finally(()=>{p.updateResult()}),l.notifyOnChangeProps?g:p.trackResult(g)}function Wn(e,t){return K6(e,C6)}function is(e,t){const n=_r(),[s]=_.useState(()=>new O6(n,e));_.useEffect(()=>{s.setOptions(e)},[s,e]);const i=_.useSyncExternalStore(_.useCallback(l=>s.subscribe(pn.batchCalls(l)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=_.useCallback((l,f)=>{s.mutate(l,f).catch(Mn)},[s]);if(i.error&&Ab(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var $t=(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))($t||{});function NN({update:e,notify:t,unwatched:n}){return{link:s,unlink:i,propagate:a,checkDirty:l,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 l(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 k=p.nextDep;if(k!==void 0){p=k;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 Mb=0,Fi=0,fu=0;const Ks=[],{link:TQ,unlink:jN,propagate:CQ,checkDirty:G6,shallowPropagate:RQ}=NN({update(e){return e.depsTail!==void 0?Q6(e):W6(e)},notify(e){let t=fu,n=t;do if(Ks[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(fu=t;n<--t;){const s=Ks[n];Ks[n++]=Ks[t],Ks[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,fp(e)):tF.call(e)}});function Z6(){return Mb}function Y6(){++Mb}function X6(){--Mb||eF()}function Q6(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,fp(e)}}function W6(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function J6(e){const t=e.flags;if(t&16||t&32&&G6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,fp(e)}}else e.flags=2}function eF(){try{for(;Fi<fu;){const e=Ks[Fi];Ks[Fi++]=void 0,J6(e)}}finally{for(;Fi<fu;){const e=Ks[Fi];Ks[Fi++]=void 0,e.flags|=10}Fi=0,fu=0}}function tF(){this.depsTail=void 0,this.flags=0,fp(this);const e=this.subs;e!==void 0&&jN(e)}function fp(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=jN(n,e)}function AN(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 _v=[];let oh=0;const{link:cT,unlink:nF,propagate:rF,checkDirty:kN,shallowPropagate:lT}=NN({update(e){return e._update()},notify(e){_v[wv++]=e,e.flags&=~$t.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=$t.Mutable|$t.Dirty,kh(e))}});let Od=0,wv=0,gs;function kh(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=nF(n,e)}function ON(){if(!(Z6()>0)){for(;Od<wv;){const e=_v[Od];_v[Od++]=void 0,e.notify()}Od=0,wv=0}}function sF(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?$t.None:$t.Mutable,get(){return gs!==void 0&&cT(i,gs,oh),i._snapshot},subscribe(a){const l=AN(a),f={current:!1},d=oF(()=>{i.get(),f.current?l.next?.(i._snapshot):f.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=gs,f=Object.is;gs=i,++oh,i.depsTail=void 0,n&&(i.flags=$t.Mutable|$t.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{gs=l,n&&(i.flags&=~$t.RecursedCheck),kh(i)}}};return n?(i.flags=$t.Mutable|$t.Dirty,i.get=function(){const a=i.flags;if(a&$t.Dirty||a&$t.Pending&&kN(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&lT(l)}}else a&$t.Pending&&(i.flags=a&~$t.Pending);return gs!==void 0&&cT(i,gs,oh),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(rF(l),lT(l),ON())}},i}function oF(e){const t=()=>{const s=gs;gs=n,++oh,n.depsTail=void 0,n.flags=$t.Watching|$t.RecursedCheck;try{return e()}finally{gs=s,n.flags&=~$t.RecursedCheck,kh(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:$t.Watching|$t.RecursedCheck,notify(){const s=this.flags;s&$t.Dirty||s&$t.Pending&&kN(this.deps,this)?t():this.flags=$t.Watching},stop(){this.flags=$t.None,this.depsTail=void 0,kh(this)}};return t(),n}let iF=class{constructor(t){this.atom=sF(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(AN(t))}};function aF(e){try{Y6(),e()}finally{X6(),ON()}}const Xo="__TSR_index",uT="popstate",fT="beforeunload";function cF(e){let t=e.getLocation();const n=new Set,s=l=>{t=e.getLocation(),n.forEach(f=>f({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?s(l):t=e.getLocation()},a=async({task:l,navigateOpts:f,...d})=>{if(f?.ignoreBlocker??!1){l();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=Oh(d.path,d.state);if(await b.blockerFn({currentLocation:t,nextLocation:x,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,f,d)=>{const p=t.state[Xo];f=dT(p+1,f),a({task:()=>{e.pushState(l,f),s({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:f})},replace:(l,f,d)=>{const p=t.state[Xo];f=dT(p,f),a({task:()=>{e.replaceState(l,f),s({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:f})},go:(l,f)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:f,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Xo]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(p=>p!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function dT(e,t){t||(t={});const n=Ib();return{...t,key:n,__TSR_key:n,[Xo]:e}}function lF(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let i=[];const a=()=>i,l=A=>i=A,f=(A=>A),d=(()=>Oh(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=Ib();t.history.replaceState({[Xo]:0,key:A,__TSR_key:A},"")}let p=d(),g,y=!1,b=!1,x=!1,S=!1;const w=()=>p;let T,C;const k=()=>{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=(A,P,G)=>{const B=f(P);C||(g=p),p=Oh(P,G),T={href:B,state:G,isPush:T?.isPush||A==="push"},C||(C=Promise.resolve().then(()=>k()))},R=A=>{p=d(),j.notify({type:A})},M=async()=>{if(b){b=!1;return}const A=d(),P=A.state[Xo]-p.state[Xo],G=P===1,B=P===-1,z=!G&&!B||y;y=!1;const Q=z?"GO":B?"BACK":"FORWARD",Y=z?{type:"GO",index:P}:{type:B?"BACK":"FORWARD"};if(x)x=!1;else{const ee=a();if(typeof document<"u"&&ee.length){for(const D of ee)if(await D.blockerFn({currentLocation:p,nextLocation:A,action:Q})){b=!0,t.history.go(1),j.notify(Y);return}}}p=d(),j.notify(Y)},L=A=>{if(S){S=!1;return}let P=!1;const G=a();if(typeof document<"u"&&G.length)for(const B of G){const z=B.enableBeforeUnload??!0;if(z===!0){P=!0;break}if(typeof z=="function"&&z()===!0){P=!0;break}}if(P)return A.preventDefault(),A.returnValue=""},j=cF({getLocation:w,getLength:()=>t.history.length,pushState:(A,P)=>N("push",A,P),replaceState:(A,P)=>N("replace",A,P),back:A=>(A&&(x=!0),S=!0,t.history.back()),forward:A=>{A&&(x=!0),S=!0,t.history.forward()},go:A=>{y=!0,t.history.go(A)},createHref:A=>f(A),flush:k,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(fT,L,{capture:!0}),t.removeEventListener(uT,M)},onBlocked:()=>{g&&p!==g&&(p=g)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(fT,L,{capture:!0}),t.addEventListener(uT,M),t.history.pushState=function(...A){const P=n.apply(t.history,A);return j._ignoreSubscribers||R("PUSH"),P},t.history.replaceState=function(...A){const P=s.apply(t.history,A);return j._ignoreSubscribers||R("REPLACE"),P},j}function uF(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Oh(e,t){const n=uF(e),s=n.indexOf("#"),i=n.indexOf("?"),a=Ib();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||{[Xo]:0,key:a,__TSR_key:a}}}function Ib(){return(Math.random()+1).toString(36).substring(7)}const fF=!1;function du(e){let t;return aF(()=>{t=e()}),t}function Tu(e){return e[e.length-1]}function dF(e){return typeof e=="function"}function Fo(e,t){return dF(e)?e(t):e}const hF=Object.prototype.hasOwnProperty,hT=Object.prototype.propertyIsEnumerable;function ur(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=t,i=gT(e)&&gT(s);if(!i&&!(Mh(e)&&Mh(s)))return s;const a=i?e:pT(e);if(!a)return s;const l=i?s:pT(s);if(!l)return s;const f=a.length,d=l.length,p=i?new Array(d):{};let g=0;for(let y=0;y<d;y++){const b=i?y:l[y],x=e[b],S=s[b];if(x===S){p[b]=x,(i?y<f:hF.call(e,b))&&g++;continue}if(x===null||S===null||typeof x!="object"||typeof S!="object"){p[b]=S;continue}const w=ur(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 Mh(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 na(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(!na(e[s],t[s],n))return!1;return!0}if(Mh(e)&&Mh(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!s||t[l]!==void 0)&&!na(e[l],t[l],n))return!1;return!0}let i=0;if(!s)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let a=0;for(const l in t)if((!s||t[l]!==void 0)&&(a++,a>i||!na(e[l],t[l],n)))return!1;return i===a}return!1}function zc(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 vc(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function pF(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 pF(t)}const mF=["http:","https:","mailto:","tel:"];function Ih(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function tu(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 gF(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var yF="Invariant failed";function ro(e,t){if(!e)throw new Error(yF)}function Ph(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 l=t.get(a);if(l)return i(l),l.value},set(a,l){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=l,i(f);else{const d={key:a,value:l,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 Lc=0,la=1,ua=2,Cu=3,Zi=4,MN=5;function vF(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 Pb(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]=Lc,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]=ua,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(a.charCodeAt(0)===36)return n[0]=la,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=vF(a);if(l){const[f,d]=l,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]=Cu,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]=ua,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=e.length,n):(n[0]=la,n[1]=t+f,n[2]=t+y,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=Lc,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function dp(e,t,n,s,i,a,l){l?.(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=Pb(d,f,t);let S;const w=f,T=x[5];switch(f=T+1,a++,x[0]){case Lc:{const k=d.substring(x[2],x[3]);if(g){const N=i.static?.get(k);if(N)S=N;else{i.static??=new Map;const R=Yi(n.fullPath??n.from);R.parent=i,R.depth=a,S=R,i.static.set(k,R)}}else{const N=k.toLowerCase(),R=i.staticInsensitive?.get(N);if(R)S=R;else{i.staticInsensitive??=new Map;const M=Yi(n.fullPath??n.from);M.parent=i,M.depth=a,S=M,i.staticInsensitive.set(N,M)}}break}case la:{const k=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(k||N),M=k?R?k:k.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=!y&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===L);if(j)S=j;else{const A=dy(la,n.fullPath??n.from,R,M,L);S=A,A.depth=a,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case Cu:{const k=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(k||N),M=k?R?k:k.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=!y&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===L);if(j)S=j;else{const A=dy(Cu,n.fullPath??n.from,R,M,L);S=A,A.parent=i,A.depth=a,i.optional??=[],i.optional.push(A)}break}case ua:{const k=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(k||N),M=k?R?k:k.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=dy(ua,n.fullPath??n.from,R,M,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=Yi(n.fullPath??n.from);x.kind=MN,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=Yi(n.fullPath??n.from);x.kind=Zi,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)dp(e,t,d,f,i,a,l)}function fy(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 $o(e){if(e.pathless)for(const t of e.pathless)$o(t);if(e.static)for(const t of e.static.values())$o(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())$o(t);if(e.dynamic?.length){e.dynamic.sort(fy);for(const t of e.dynamic)$o(t)}if(e.optional?.length){e.optional.sort(fy);for(const t of e.optional)$o(t)}if(e.wildcard?.length){e.wildcard.sort(fy);for(const t of e.wildcard)$o(t)}}function Yi(e){return{kind:Lc,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 dy(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 bF(e,t){const n=Yi("/"),s=new Uint16Array(6);for(const i of e)dp(!1,s,i,1,n,0);$o(n),t.masksTree=n,t.flatCache=Ph(1e3)}function xF(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 SF(e,t,n,s,i){e||="/",s||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);if(!l){l=Yi("/");const f=new Uint16Array(6);dp(t,f,{from:e},1,l,0),i.singleCache.set(a,l)}return Db(s,l,n)}function _F(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(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=TF(a.route)),t.matchCache.set(s,a),a}function wF(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function EF(e,t=!1,n){const s=Yi(e.fullPath),i=new Uint16Array(6),a={},l={};let f=0;return dp(t,i,e,1,s,0,p=>{if(n?.(p,f),ro(!(p.id in a),`Duplicate routes found with id: ${String(p.id)}`),a[p.id]=p,f!==0&&p.path){const g=wF(p.fullPath);(!l[g]||p.fullPath.endsWith("/"))&&(l[g]=p)}f++}),$o(s),{processedTree:{segmentTree:s,singleCache:Ph(1e3),matchCache:Ph(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function Db(e,t,n=!1){const s=e.split("/"),i=RF(e,s,t,n);if(!i)return null;const[a]=IN(e,s,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function IN(e,t,n){const s=CF(n.node);let i=null;const a={};let l=n.extract?.part??0,f=n.extract?.node??0,d=n.extract?.path??0,p=n.extract?.segment??0;for(;f<s.length;l++,f++,d++,p++){const g=s[f];if(g.kind===Zi)break;if(g.kind===MN){p--,l--,d--;continue}const y=t[l],b=d;if(y&&(d+=y.length),g.kind===la){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),k=y.substring(S,y.length-T);a[C]=decodeURIComponent(k)}else{const T=x.substring(1);a[T]=decodeURIComponent(y)}}else if(g.kind===Cu){if(n.skipped&1<<f){l--,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===ua){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:l,node:f,path:d,segment:p}]}function TF(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function CF(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function RF(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Tu(t),a=i&&e!=="/",l=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:k}=y;let{extract:N,rawParams:R,parsedParams:M}=y;if(b.skipOnParamError){if(!hy(e,t,y))continue;R=y.rawParams,N=y.extract,M=y.parsedParams}s&&b.route&&b.kind!==Zi&&nu(p,y)&&(p=y);const L=x===l;if(L&&(b.route&&!a&&nu(g,y)&&(g=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const j=L?void 0:t[x];let A;if(L&&b.index){const P={node:b.index,index:x,skipped:S,depth:w+1,statics:T,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M};let G=!0;if(b.index.skipOnParamError&&(hy(e,t,P)||(G=!1)),G){if(T===l&&!C&&!k&&!S)return P;nu(g,P)&&(g=P)}}if(b.wildcard&&nu(d,y))for(const P of b.wildcard){const{prefix:G,suffix:B}=P;if(G&&(L||!(P.caseSensitive?j:A??=j.toLowerCase()).startsWith(G)))continue;if(B){if(L)continue;const Q=t.slice(x).join("/").slice(-B.length);if((P.caseSensitive?Q:Q.toLowerCase())!==B)continue}const z={node:P,index:l,skipped:S,depth:w,statics:T,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M};if(!(P.skipOnParamError&&!hy(e,t,z))){d=z;break}}if(b.optional){const P=S|1<<w,G=w+1;for(let B=b.optional.length-1;B>=0;B--){const z=b.optional[B];f.push({node:z,index:x,skipped:P,depth:G,statics:T,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M})}if(!L)for(let B=b.optional.length-1;B>=0;B--){const z=b.optional[B],{prefix:Q,suffix:Y}=z;if(Q||Y){const ee=z.caseSensitive?j:A??=j.toLowerCase();if(Q&&!ee.startsWith(Q)||Y&&!ee.endsWith(Y))continue}f.push({node:z,index:x+1,skipped:S,depth:G,statics:T,dynamics:C,optionals:k+1,extract:N,rawParams:R,parsedParams:M})}}if(!L&&b.dynamic&&j)for(let P=b.dynamic.length-1;P>=0;P--){const G=b.dynamic[P],{prefix:B,suffix:z}=G;if(B||z){const Q=G.caseSensitive?j:A??=j.toLowerCase();if(B&&!Q.startsWith(B)||z&&!Q.endsWith(z))continue}f.push({node:G,index:x+1,skipped:S,depth:w+1,statics:T,dynamics:C+1,optionals:k,extract:N,rawParams:R,parsedParams:M})}if(!L&&b.staticInsensitive){const P=b.staticInsensitive.get(A??=j.toLowerCase());P&&f.push({node:P,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M})}if(!L&&b.static){const P=b.static.get(j);P&&f.push({node:P,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M})}if(b.pathless){const P=w+1;for(let G=b.pathless.length-1;G>=0;G--){const B=b.pathless[G];f.push({node:B,index:x,skipped:S,depth:P,statics:T,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M})}}}if(g&&d)return nu(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 hy(e,t,n){try{const[s,i]=IN(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 nu(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===Zi)>(e.node.kind===Zi)||t.node.kind===Zi==(e.node.kind===Zi)&&t.depth>e.depth))):!0}function ih(e){return zb(e.filter(t=>t!==void 0).join("/"))}function zb(e){return e.replace(/\/{2,}/g,"/")}function PN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Qo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function DN(e){return Qo(PN(e))}function Dh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function NF(e,t,n){return Dh(e,n)===Dh(t,n)}function jF({base:e,to:t,trailingSlash:n="never",cache:s}){const i=t.startsWith("/"),a=!i&&t===".";let l;if(s){l=i?t:a?e:e+"\0"+t;const y=s.get(l);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&&Tu(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&&(Tu(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=Pb(b,0,d);const x=d[0];if(x===Lc){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===la?p+=w||T?`${w}{$${C}}${T}`:`$${C}`:x===ua?p+=w||T?`${w}{$}${T}`:"$":p+=`${w}{-$${C}}${T}`}p=zb(p);const g=p||"/";return l&&s&&s.set(l,g),g}function AF(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 py(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 l=e.length;let f=0,d,p="";for(;f<l;){const y=f;d=Pb(e,y,d);const b=d[5];if(f=b+1,y===b)continue;const x=d[0];if(x===Lc){p+="/"+e.substring(y,b);continue}if(x===ua){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=py("_splat",t,n);p+="/"+w+C+T;continue}if(x===la){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=py(S,t,n)??"undefined";p+="/"+w+C+T;continue}if(x===Cu){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),k=py(S,t,n)??"";p+="/"+T+k+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 yr(e){return!!e?.isNotFound}function kF(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Ev="tsr-scroll-restoration-v1_3",OF=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function MF(){const e=kF();if(!e)return null;const t=e.getItem(Ev);let n=t?JSON.parse(t):{};return{state:n,set:s=>{n=Fo(s,n)||n;try{e.setItem(Ev,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Md=MF(),IF=e=>e.state.__TSR_key||e.href;function PF(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 zh=!1;function DF({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:i,location:a}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,d=l[f];zh=!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)}}zh=!1}function zF(e,t){if(!Md||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Md))return;e.isScrollRestorationSetup=!0,zh=!1;const s=e.options.getScrollRestorationKey||IF;window.history.scrollRestoration="manual";const i=a=>{if(zh||!e.isScrollRestoring)return;let l="";if(a.target===document||a.target===window)l="window";else{const d=a.target.getAttribute("data-scroll-restoration-id");d?l=`[data-scroll-restoration-id="${d}"]`:l=PF(a.target)}const f=s(e.state.location);Md.set(d=>{const p=d[f]||={},g=p[l]||={};if(l==="window")g.scrollX=window.scrollX||0,g.scrollY=window.scrollY||0;else if(l){const y=document.querySelector(l);y&&(g.scrollX=y.scrollLeft||0,g.scrollY=y.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",OF(i,100),!0),e.subscribe("onRendered",a=>{const l=s(a.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(DF({storageKey:Ev,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Md.set(f=>(f[l]||={},f)))})}function LF(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 UF(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 my(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function $F(e){const t=new URLSearchParams(e),n={};for(const[s,i]of t.entries()){const a=n[s];a==null?n[s]=my(i):Array.isArray(a)?a.push(my(i)):n[s]=[a,my(i)]}return n}const BF=HF(JSON.parse),FF=qF(JSON.stringify,JSON.parse);function HF(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=$F(t);for(const s in n){const i=n[s];if(typeof i=="string")try{n[s]=e(i)}catch{}}return n}}function qF(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=UF(i,s);return a?`?${a}`:""}}const Lr="__root__";function VF(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 Br(e){return e instanceof Response&&!!e.options}const ah=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},hp=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),bc=(e,t,n=!0)=>{const s={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const l=e.matches[a];if(!l)continue;const f=e.router.getMatch(l.id);f&&Object.assign(s,f.__routeContext,f.__beforeLoadContext)}return s},zN=(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||ro(s.options.notFoundComponent);const a=e.matches.find(l=>l.routeId===s.id);ro(a,"Could not find match for route: "+s.id),e.updateMatch(a.id,l=>({...l,status:"notFound",error:t,isFetching:!1})),i&&(t.routeId=s.parentRoute.id,zN(e,t,n))},Ho=(e,t,n,s)=>{if(!(!Br(n)&&!yr(n))){if(Br(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=Br(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:i,context:bc(e,t.index),isFetching:!1,error:n})),yr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Br(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(zN(e,n,s),n)}},LN=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,ru=(e,t,n,s)=>{const{id:i,routeId:a}=e.matches[t],l=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=s,e.firstBadMatchIndex??=t,Ho(e,e.router.getMatch(i),n,s);try{l.options.onError?.(n)}catch(f){n=f,Ho(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}))},UN=(e,t,n,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!hp(e,t)&&(n.options.loader||n.options.beforeLoad||FN(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{ah(e)},i);s._nonReactive.pendingTimeout=l}},KF=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;UN(e,t,n,s);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Ho(e,a,a.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(i):i()},GF=(e,t,n,s)=>{const i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=zc(()=>{a?.resolve()});const{paramsError:l,searchError:f}=i;l&&ru(e,n,l,"PARSE_PARAMS"),f&&ru(e,n,f,"VALIDATE_SEARCH"),UN(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){du(()=>{g(),y()});return}i._nonReactive.beforeLoadPromise=zc();const b={...bc(e,n,!1),...i.__routeContext},{search:x,params:S,cause:w}=i,T=hp(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},k=R=>{if(R===void 0){du(()=>{g(),y()});return}(Br(R)||yr(R))&&(g(),ru(e,n,R,"BEFORE_LOAD")),du(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:R})),y()})};let N;try{if(N=s.options.beforeLoad(C),vc(N))return g(),N.catch(R=>{ru(e,n,R,"BEFORE_LOAD")}).then(k)}catch(R){g(),ru(e,n,R,"BEFORE_LOAD")}k(N)},ZF=(e,t)=>{const{id:n,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s],a=()=>f(),l=()=>GF(e,n,t,i),f=()=>{if(LN(e,n))return;const d=KF(e,n,i);return vc(d)?d.then(l):l()};return a()},YF=(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,l,f])=>{const d=a?.meta,p=a?.links,g=a?.scripts,y=a?.styles;return{meta:d,links:p,headScripts:g,headers:f,scripts:l,styles:y}})},$N=(e,t,n,s)=>{const i=e.matchPromises[n-1],{params:a,loaderDeps:l,abortController:f,cause:d}=e.router.getMatch(t),p=bc(e,n),g=hp(e,t);return{params:a,deps:l,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{(!(fF??e.router.isServer)||i.ssr===!0)&&BN(s);const a=s.options.loader?.($N(e,t,n,s)),l=s.options.loader&&vc(a);if((l||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=l?await a:a;Ho(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:bc(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let l=a;if(l?.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:bc(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,yr(a)&&await s.options.notFoundComponent?.preload?.(),Ho(e,e.router.getMatch(t),a);try{s.options.onError?.(a)}catch(d){l=d,Ho(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:l,context:bc(e,n),status:"error",isFetching:!1}))}}catch(i){const a=e.router.getMatch(t);a&&(a._nonReactive.loaderPromise=void 0),Ho(e,a,i)}},XF=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($N(e,s,t,x)):T,{status:k,invalid:N}=b;a=k==="success"&&(N||(C??S>w)),g&&x.options.preload===!1||(a&&!e.sync?(l=!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){Br(R)&&await e.router.navigate(R.options)}})()):(k!=="success"||a&&e.sync)&&await xT(e,s,t,x))}const{id:s,routeId:i}=e.matches[t];let a=!1,l=!1;const f=e.router.looseRoutesById[i];if(!LN(e,s)){const g=e.router.getMatch(s),y=hp(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&&Ho(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=zc(),b!==x.preload&&e.updateMatch(s,S=>({...S,preload:b})),await n(y,g,x,f)}}const d=e.router.getMatch(s);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const p=l?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)&&ah(t);try{for(let f=0;f<t.matches.length;f++){const d=ZF(t,f);vc(d)&&await d}const n=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<n;f++)t.matchPromises.push(XF(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(Br(f))throw f;!a&&yr(f)&&(a=f)}for(const f of t.matches){const{id:d,routeId:p}=f,g=t.router.looseRoutesById[p];try{const y=YF(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 l=ah(t);vc(l)&&await l}catch(n){if(yr(n)&&!t.preload){const s=ah(t);throw vc(s)&&await s,n}if(Br(n))throw n}return t.matches}async function BN(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 HN){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 FN(e){for(const t of HN)if(e.options[t]?.preload)return!0;return!1}const HN=["component","errorComponent","pendingComponent","notFoundComponent"];function QF(e){return{input:({url:t})=>{for(const n of e)t=Tv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=qN(e[n],t);return t}}}function WF(e){const t=DN(e.basepath),n=`/${t}`,s=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?s:s.toLowerCase();return{input:({url:l})=>{const f=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return f===i?l.pathname="/":f.startsWith(a)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=ih(["/",t,l.pathname]),l)}}function Tv(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 qN(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 ra(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 JF(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class eH{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,l=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=AF(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=lF()),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=Ph(1e3),b=this.buildRouteTree(),this.setRoutes(b)}!this.__store&&this.latestLocation&&(this.__store=new iF(nH(this.latestLocation)),zF(this));let f=!1;const d=this.options.basepath??"/",p=this.options.rewrite;if(a||i!==d||l!==p){this.basepath=d;const b=[],x=DN(d);x&&x!=="/"&&b.push(WF({basepath:d})),p&&b.push(p),this.rewrite=b.length===0?void 0:b.length===1?b[0]:QF(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=EF(this.routeTree,this.options.caseSensitive,(s,i)=>{s.init({originalIndex:i})});return this.options.routeMasks&&bF(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 k=this.options.parseSearch(p),N=this.options.stringifySearch(k);return{href:d+N+g,publicHref:y,pathname:tu(d).path,external:!1,searchStr:N,search:ur(s?.search,k),hash:tu(g.slice(1)).path,state:ur(s?.state,b)}}const x=new URL(y,this.origin),S=Tv(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:tu(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:T,search:ur(s?.search,w),hash:tu(S.hash.slice(1)).path,state:ur(s?.state,b)}},a=i(n),{__tempLocation:l,__tempKey:f}=a.state;if(l&&(!f||f===this.tempLocationKey)){const d=i(l);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)=>jF({base:n,to:zb(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=>rH({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 l=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(l);a.from;const d=a.unsafeRelative==="path"?l.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,Fo(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 B of w){const z=B.options.params?.stringify??B.options.stringifyParams;if(z)try{Object.assign(x,z(x))}catch{}}const C=n.leaveParams?b:tu(vT({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let k=g;if(n._includeValidateSearch&&this.options.search?.strict){const B={};w.forEach(z=>{if(z.options.validateSearch)try{Object.assign(B,ch(z.options.validateSearch,{...B,...k}))}catch{}}),k=B}k=sH({search:k,dest:a,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),k=ur(g,k);const N=this.options.stringifySearch(k),R=a.hash===!0?l.hash:a.hash?Fo(a.hash,l.hash):void 0,M=R?`#${R}`:"";let L=a.state===!0?l.state:a.state?Fo(a.state,l.state):{};L=ur(l.state,L);const j=`${C}${N}${M}`;let A,P,G=!1;if(this.rewrite){const B=new URL(j,this.origin),z=qN(this.rewrite,B);A=B.href.replace(B.origin,""),z.origin!==this.origin?(P=z.href,G=!0):P=z.pathname+z.search+z.hash}else A=gF(j),P=A;return{publicHref:P,href:A,pathname:C,search:k,searchStr:N,state:L,hash:R??"",external:G,unmaskOnReload:a.unmaskOnReload}},i=(a={},l)=>{const f=s(a);let d=l?s(l):void 0;if(!d){const p={};if(this.options.routeMasks){const g=xF(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,Fo(b,p));l={from:n.from,...x,params:S},d=s(l)}}}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=na(i.state,this.latestLocation.state);return d.forEach(g=>{delete i.state[g]}),p},l=Qo(this.latestLocation.href)===Qo(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=zc(()=>{f?.resolve()}),l&&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:l,href:f,...d}={})=>{if(f){const y=this.history.location.state.__TSR_index,b=Oh(f,{__TSR_index:n?y:y+1}),x=new URL(b.pathname,this.origin),S=Tv(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:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),g},this.navigate=async({to:n,reloadDocument:s,href:i,publicHref:a,...l})=>{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,...l});i=i??p.publicHref,a=a??p.publicHref}const d=!f&&a?a:i;if(Ih(d,this.protocolAllowlist))return Promise.resolve();if(!l.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 l.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...l,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",...ra({resolvedLocation:p,location:d})}),this.emit({type:"onBeforeLoad",...ra({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=[];du(()=>{this.__store.setState(x=>{const S=x.matches,w=x.pendingMatches||x.matches;return g=S.filter(T=>!w.some(C=>C.id===T.id)),y=w.filter(T=>!S.some(C=>C.id===T.id)),b=w.filter(T=>S.some(C=>C.id===T.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:w,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...g.filter(T=>T.status!=="error"&&T.status!=="notFound"&&T.status!=="redirected")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[y,"onEnter"],[b,"onStay"]].forEach(([x,S])=>{x.forEach(w=>{this.looseRoutesById[w.routeId].options[S]?.(w)})})})})}})}catch(d){Br(d)?(s=d,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):yr(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 l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(f=>f.status==="error")&&(l=500),l!==void 0&&this.__store.setState(f=>({...f,statusCode:l}))},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,l=this.state.resolvedLocation,f=typeof s.types=="function"?s.types(ra({resolvedLocation:l,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:JF(a.cachedMatches.map(l=>l.id===n?s(l):l))})):this.__store.setState(a=>({...a,[i]:a[i]?.map(l=>l.id===n?s(l):l)})))})},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&&Ih(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=BN,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)),l=new Set([...a,...this.state.cachedMatches.map(f=>f.id)]);du(()=>{i.forEach(f=>{l.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(Br(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:s});yr(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=SF(a.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,f.pathname,this.processedTree);return!d||n.params&&!na(d.rawParams,n.params,{partial:!0})?!1:s?.includeSearch??!0?na(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??FF,parseSearch:t.parseSearch??BF,protocolAllowlist:t.protocolAllowlist??mF}),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:l}=s;let{matchedRoutes:f}=s,d=!1;(i?i.path!=="/"&&a["**"]:Qo(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const p=d?iH(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,ee=S?._strictSearch??void 0;try{const D=ch(x.options.validateSearch,{...Y})??void 0;w={...Y,...D},T={...ee,...D},C=void 0}catch(D){let K=D;if(D instanceof Lh||(K=new Lh(D.message,{cause:D})),n?.throwOnError)throw K;w=Y,T={},C=K}}const k=x.options.loaderDeps?.({search:w})??"",N=k?JSON.stringify(k):"",{interpolatedPath:R,usedParams:M}=vT({path:x.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),L=x.id+R+N,j=this.getMatch(L),A=y.get(x.id),P=j?._strictParams??M;let G;if(!j)try{_T(x,M,l,P)}catch(Y){if(yr(Y)||Br(Y)?G=Y:G=new tH(Y.message,{cause:Y}),n?.throwOnError)throw G}Object.assign(a,P);const B=A?"stay":"enter";let z;if(j)z={...j,cause:B,params:A?.params??a,_strictParams:P,search:ur(A?A.search:j.search,w),_strictSearch:T};else{const Y=x.options.loader||x.options.beforeLoad||x.lazyFn||FN(x)?"pending":"success";z={id:L,ssr:x.options.ssr,index:b,routeId:x.id,params:A?.params??a,_strictParams:P,pathname:R,updatedAt:Date.now(),search:A?ur(A.search,w):w,_strictSearch:T,searchError:void 0,status:Y,isFetching:!1,error:void 0,paramsError:G,__routeContext:void 0,_nonReactive:{loadPromise:zc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:A?ur(A.loaderDeps,k):k,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 Q=this.getParentContext(S);z.context={...Q,...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?ur(T.params,a):a,!w){const C=g[b-1],k=this.getParentContext(C);if(S.options.context){const N={deps:x.loaderDeps,params:x.params,context:k??{},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={...k,...x.__routeContext,...x.__beforeLoadContext}}}return g}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:s,parsedParams:i}=this.getMatchedRoutes(t.pathname),a=Tu(n),l={...t.search};for(const g of n)try{Object.assign(l,ch(g.options.validateSearch,l))}catch{}const f=Tu(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:l,params:p}}}class Lh extends Error{}class tH extends Error{}function nH(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ch(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Lh("Async validation not supported");if(n.issues)throw new Lh(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 rH({pathname:e,routesById:t,processedTree:n}){const s={},i=Qo(e);let a,l;const f=_F(i,n,!0);return f&&(a=f.route,Object.assign(s,f.rawParams),l=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[Lr]],routeParams:s,foundRoute:a,parsedParams:l}}function sH({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){return oH(n)(e,t,s??!1)}function oH(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:l,next:f})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((g,y)=>y(g),l));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:l,next:f})=>{const d=f(l);if(!t._includeValidateSearch)return d;try{return{...d,...ch(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:Fo(a.search,i):{}};t.middlewares.push(n);const s=(i,a,l)=>{if(i>=l.length)return a;const f=l[i];return f({search:a,next:p=>s(i+1,p,l)})};return function(a,l,f){return t.dest=l,t._includeValidateSearch=f,s(0,a,t.middlewares)}}function iH(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 Lr}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 aH="Error preloading route! ☝️";class VN{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=Lr:this.parentRoute||ro(!1);let a=i?Lr:s?.path;a&&a!=="/"&&(a=PN(a));const l=s?.id||a;let f=i?Lr:ih([this.parentRoute.id===Lr?"":this.parentRoute.id,l]);a===Lr&&(a="/"),f!==Lr&&(f=ih(["/",f]));const d=f===Lr?"/":ih([this.parentRoute.fullPath,a]);this._path=a,this._id=f,this._fullPath=d,this._to=Qo(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=>VF({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 cH extends VN{constructor(t){super(t)}}const Id=typeof window<"u"?_.useLayoutEffect:_.useEffect;function gy(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 lH(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 uH(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function Lb(e){const t=e.errorComponent??Ub;return h.jsx(fH,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?_.createElement(t,{error:n,reset:s}):e.children})}class fH 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 Ub({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 dH({children:e,fallback:t=null}){return KN()?h.jsx(Ic.Fragment,{children:e}):h.jsx(Ic.Fragment,{children:t})}function KN(){return Ic.useSyncExternalStore(hH,()=>!0,()=>!1)}function hH(){return()=>{}}var yy={exports:{}},vy={},by={exports:{}},xy={};var wT;function pH(){if(wT)return xy;wT=1;var e=Gu();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,l=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]),l(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 xy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,xy}var ET;function GN(){return ET||(ET=1,by.exports=pH()),by.exports}var TT;function mH(){if(TT)return vy;TT=1;var e=Gu(),t=GN();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,l=e.useEffect,f=e.useMemo,d=e.useDebugValue;return vy.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(!k){if(k=!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 A=b(L);return x!==void 0&&x(j,A)?(N=L,j):(N=L,R=A)}var k=!1,N,R,M=y===void 0?null:y;return[function(){return C(g())},M===null?void 0:function(){return C(M())}]},[g,y,b,x]);var T=i(p,S[0],S[1]);return l(function(){w.hasValue=!0,w.value=T},[T]),d(T),T},vy}var CT;function gH(){return CT||(CT=1,yy.exports=mH()),yy.exports}var ZN=gH();function yH(e,t){return e===t}function vH(e,t,n=yH){const s=_.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(l);return f},[e]),i=_.useCallback(()=>e?.get(),[e]);return ZN.useSyncExternalStoreWithSelector(s,i,i,t,n)}const YN=_.createContext(null);function Xr(e){const t=_.useContext(YN);return e?.warn,t}function vr(e){const t=Xr({warn:e?.router===void 0}),n=e?.router||t,s=_.useRef(void 0);return vH(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=ur(s.current,e.select(i));return s.current=a,a}return e.select(i)}return i})}const pp=_.createContext(void 0),bH=_.createContext(void 0);function Ss(e){const t=_.useContext(e.from?bH:pp);return vr({select:s=>{const i=s.matches.find(a=>e.from?e.from===a.routeId:a.id===t);if(ro(!((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 $b(e){return Ss({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Bb(e){const{select:t,...n}=e;return Ss({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Fb(e){return Ss({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 Hb(e){return Ss({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mp(e){const t=Xr();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var hi=yN();function xH(e,t){const n=Xr(),s=uH(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:f,preload:d,preloadDelay:p,hashScrollIntoView:g,replace:y,startTransition:b,resetScroll:x,viewTransition:S,children:w,target:T,disabled:C,style:k,className:N,onClick:R,onBlur:M,onFocus:L,onMouseEnter:j,onMouseLeave:A,onTouchStart:P,ignoreBlocker:G,params:B,search:z,hash:Q,state:Y,mask:ee,reloadDocument:D,unsafeRelative:K,from:q,_fromLocation:V,...U}=e,I=KN(),H=vr({select:He=>{const me=He.matches[He.matches.length-1];return{search:me?.search,hash:He.location.hash,path:me?.pathname}},structuralSharing:!0}),W=e.from,X=_.useMemo(()=>({...e,from:W}),[n,H,W,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),oe=_.useMemo(()=>n.buildLocation({...X}),[n,X]),se=oe.maskedLocation?oe.maskedLocation.publicHref:oe.publicHref,de=oe.maskedLocation?oe.maskedLocation.external:oe.external,xe=_.useMemo(()=>CH(se,de,n.history,C),[C,de,se,n.history]),he=_.useMemo(()=>{if(xe?.external)return Ih(xe.href,n.protocolAllowlist)?void 0:xe.href;if(!RH(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),Ih(f,n.protocolAllowlist)?void 0:f}catch{}},[f,xe,n.protocolAllowlist]),Me=vr({select:He=>{if(he)return!1;if(l?.exact){if(!NF(He.location.pathname,oe.pathname,n.basepath))return!1}else{const me=Dh(He.location.pathname,n.basepath),Te=Dh(oe.pathname,n.basepath);if(!(me.startsWith(Te)&&(me.length===Te.length||me[Te.length]==="/")))return!1}return(l?.includeSearch??!0)&&!na(He.location.search,oe.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?I&&He.location.hash===oe.hash:!0}}),_e=Me?Fo(i,{})??SH:Sy,ne=Me?Sy:Fo(a,{})??Sy,pe=[N,_e.className,ne.className].filter(Boolean).join(" "),ae=(k||_e.style||ne.style)&&{...k,..._e.style,...ne.style},[we,ve]=_.useState(!1),Se=_.useRef(!1),ye=e.reloadDocument||he?!1:d??n.options.defaultPreload,Ue=p??n.options.defaultPreloadDelay??0,Ie=_.useCallback(()=>{n.preloadRoute({...X,_builtLocation:oe}).catch(He=>{console.warn(He),console.warn(aH)})},[n,X,oe]),Ee=_.useCallback(He=>{He?.isIntersecting&&Ie()},[Ie]);lH(s,Ee,TH,{disabled:!!C||ye!=="viewport"}),_.useEffect(()=>{Se.current||!C&&ye==="render"&&(Ie(),Se.current=!0)},[C,Ie,ye]);const Ve=He=>{const me=He.currentTarget.getAttribute("target"),Te=T!==void 0?T:me;if(!C&&!NH(He)&&!He.defaultPrevented&&(!Te||Te==="_self")&&He.button===0){He.preventDefault(),hi.flushSync(()=>{ve(!0)});const qe=n.subscribe("onResolved",()=>{qe(),ve(!1)});n.navigate({...X,replace:y,resetScroll:x,hashScrollIntoView:g,startTransition:b,viewTransition:S,ignoreBlocker:G})}};if(he)return{...U,ref:s,href:he,...w&&{children:w},...T&&{target:T},...C&&{disabled:C},...k&&{style:k},...N&&{className:N},...R&&{onClick:R},...M&&{onBlur:M},...L&&{onFocus:L},...j&&{onMouseEnter:j},...A&&{onMouseLeave:A},...P&&{onTouchStart:P}};const Xe=He=>{if(C||ye!=="intent")return;if(!Ue){Ie();return}const me=He.currentTarget;if(su.has(me))return;const Te=setTimeout(()=>{su.delete(me),Ie()},Ue);su.set(me,Te)},Be=He=>{C||ye!=="intent"||Ie()},We=He=>{if(C||!ye||!Ue)return;const me=He.currentTarget,Te=su.get(me);Te&&(clearTimeout(Te),su.delete(me))};return{...U,..._e,...ne,href:xe?.href,ref:s,onClick:lc([R,Ve]),onBlur:lc([M,We]),onFocus:lc([L,Xe]),onMouseEnter:lc([j,Xe]),onMouseLeave:lc([A,We]),onTouchStart:lc([P,Be]),disabled:!!C,target:T,...ae&&{style:ae},...pe&&{className:pe},...C&&_H,...Me&&wH,...I&&we&&EH}}const Sy={},SH={className:"active"},_H={role:"link","aria-disabled":!0},wH={"data-status":"active","aria-current":"page"},EH={"data-transitioning":"transitioning"},su=new WeakMap,TH={rootMargin:"100px"},lc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function CH(e,t,n,s){if(!s)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function RH(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const xc=_.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:i,...a}=xH(s,t),l=typeof s.children=="function"?s.children({isActive:a["data-status"]==="active"}):s.children;if(!n){const{disabled:f,...d}=a;return _.createElement("a",d,l)}return _.createElement(n,a,l)});function NH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let jH=class extends VN{constructor(t){super(t),this.useMatch=n=>Ss({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Hb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Bb({...n,from:this.id}),this.useLoaderData=n=>$b({...n,from:this.id}),this.useNavigate=()=>mp({from:this.fullPath}),this.Link=Ic.forwardRef((n,s)=>h.jsx(xc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function ao(e){return new jH(e)}class AH extends cH{constructor(t){super(t),this.useMatch=n=>Ss({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Hb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Bb({...n,from:this.id}),this.useLoaderData=n=>$b({...n,from:this.id}),this.useNavigate=()=>mp({from:this.fullPath}),this.Link=Ic.forwardRef((n,s)=>h.jsx(xc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function kH(e){return new AH(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=ao(s);return i.isRoot=!1,i},this.silent=n?.silent}}class jT{constructor(t){this.useMatch=n=>Ss({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Hb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Bb({...n,from:this.options.id}),this.useLoaderData=n=>$b({...n,from:this.options.id}),this.useNavigate=()=>{const n=Xr();return mp({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 OH(){const e=Xr(),t=_.useRef({router:e,mounted:!1}),[n,s]=_.useState(!1),{hasPendingMatches:i,isLoading:a}=vr({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),l=gy(a),f=a||n||i,d=gy(f),p=a||i,g=gy(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 Qo(e.latestLocation.publicHref)!==Qo(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{y()}},[e,e.history]),Id(()=>{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]),Id(()=>{l&&!a&&e.emit({type:"onLoad",...ra(e.state)})},[l,e,a]),Id(()=>{g&&!p&&e.emit({type:"onBeforeRouteMount",...ra(e.state)})},[p,g,e]),Id(()=>{if(d&&!f){const y=ra(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),y.hrefChanged&&LF(e)}},[f,d,e]),null}function MH(e){const t=vr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return h.jsx(Lb,{getResetKey:()=>t,onCatch:(n,s)=>{if(yr(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(yr(n))return e.fallback?.(n);throw n},children:e.children})}function IH(){return h.jsx("p",{children:"Not Found"})}function uc(e){return h.jsx(h.Fragment,{children:e.children})}function XN(e,t,n){return t.options.notFoundComponent?h.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...n}):h.jsx(IH,{})}function PH(){return Xr().isScrollRestoring,null}const QN=_.memo(function({matchId:t}){const n=Xr(),s=vr({select:w=>{const T=w.matches.findIndex(k=>k.id===t),C=w.matches[T];return ro(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,l=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:uc,b=f?Lb:uc,x=p?MH:uc,S=i.isRoot?i.options.shellComponent??uc:uc;return h.jsxs(S,{children:[h.jsx(pp.Provider,{value:t,children:h.jsx(y,{fallback:l,children:h.jsx(b,{getResetKey:()=>s.resetKey,errorComponent:f||Ub,onCatch:(w,T)=>{if(yr(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(dH,{fallback:l,children:h.jsx(kT,{matchId:t})}):h.jsx(kT,{matchId:t})})})})}),s.parentRouteId===Lr&&n.options.scrollRestoration?h.jsxs(h.Fragment,{children:[h.jsx(DH,{}),h.jsx(PH,{})]}):null]})});function DH(){const e=Xr(),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",...ra(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const kT=_.memo(function({matchId:t}){const n=Xr(),{match:s,key:i,routeId:a}=vr({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}),l=n.routesById[a],f=_.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?h.jsx(d,{},i):h.jsx(WN,{})},[i,l.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=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const p=n.getMatch(s.id);if(p&&!p._nonReactive.minPendingPromise){const g=zc();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 ro(yr(s.error)),XN(n,l,s.error);if(s.status==="redirected")throw ro(Br(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error")throw s.error;return f}),WN=_.memo(function(){const t=Xr(),n=_.useContext(pp),s=vr({select:p=>p.matches.find(g=>g.id===n)?.routeId}),i=t.routesById[s],a=vr({select:p=>{const y=p.matches.find(b=>b.id===n);return ro(y),y.globalNotFound}}),l=vr({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 XN(t,i,void 0);if(!l)return null;const d=h.jsx(QN,{matchId:l});return s===Lr?h.jsx(_.Suspense,{fallback:f,children:d}):d});function zH(){const e=Xr(),n=e.routesById[Lr].options.pendingComponent??e.options.defaultPendingComponent,s=n?h.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?uc:_.Suspense,a=h.jsxs(i,{fallback:s,children:[h.jsx(OH,{}),h.jsx(LH,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:a}):a}function LH(){const e=Xr(),t=vr({select:i=>i.matches[0]?.id}),n=vr({select:i=>i.loadedAt}),s=t?h.jsx(QN,{matchId:t}):null;return h.jsx(pp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:h.jsx(Lb,{getResetKey:()=>n,errorComponent:Ub,onCatch:void 0,children:s})})}const UH=e=>new $H(e);class $H extends eH{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=RT,globalThis.createLazyFileRoute=AT):typeof window<"u"&&(window.createFileRoute=RT,window.createLazyFileRoute=AT);function BH({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(YN.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:s}):s}function FH({router:e,...t}){return h.jsx(BH,{router:e,...t,children:h.jsx(zH,{})})}const HH=/\{[^{}]+\}/g,qH=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function VH(){return Math.random().toString(36).slice(2,11)}function KH(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:s=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:l,headers:f,requestInitExt:d=void 0,...p}={...e};d=qH()?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:k={},parseAs:N="json",querySerializer:R,bodySerializer:M=a??ZH,pathSerializer:L,body:j,middleware:A=[],...P}=x||{};let G=t;S&&(G=IT(S)??t);let B=typeof i=="function"?i:OT(i);R&&(B=typeof R=="function"?R:OT({...typeof i=="object"?i:{},...R}));const z=L||l||GH,Q=j===void 0?void 0:M(j,MT(f,C,k.header)),Y=MT(Q===void 0||Q instanceof FormData?{}:{"Content-Type":"application/json"},f,C,k.header),ee=[...g,...A],D={redirect:"follow",...p,...P,body:Q,headers:Y};let K,q,V=new T(YH(b,{baseUrl:G,params:k,querySerializer:B,pathSerializer:z}),D),U;for(const W in P)W in V||(V[W]=P[W]);if(ee.length){K=VH(),q=Object.freeze({baseUrl:G,fetch:w,parseAs:N,querySerializer:B,bodySerializer:M,pathSerializer:z});for(const W of ee)if(W&&typeof W=="object"&&typeof W.onRequest=="function"){const X=await W.onRequest({request:V,schemaPath:b,params:k,options:q,id:K});if(X)if(X instanceof T)V=X;else if(X instanceof Response){U=X;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!U){try{U=await w(V,d)}catch(W){let X=W;if(ee.length)for(let oe=ee.length-1;oe>=0;oe--){const se=ee[oe];if(se&&typeof se=="object"&&typeof se.onError=="function"){const de=await se.onError({request:V,error:X,schemaPath:b,params:k,options:q,id:K});if(de){if(de instanceof Response){X=void 0,U=de;break}if(de instanceof Error){X=de;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(X)throw X}if(ee.length)for(let W=ee.length-1;W>=0;W--){const X=ee[W];if(X&&typeof X=="object"&&typeof X.onResponse=="function"){const oe=await X.onResponse({request:V,response:U,schemaPath:b,params:k,options:q,id:K});if(oe){if(!(oe instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");U=oe}}}}const I=U.headers.get("Content-Length");if(U.status===204||V.method==="HEAD"||I==="0"&&!U.headers.get("Transfer-Encoding")?.includes("chunked"))return U.ok?{data:void 0,response:U}:{error:void 0,response:U};if(U.ok)return{data:await(async()=>{if(N==="stream")return U.body;if(N==="json"&&!I){const X=await U.text();return X?JSON.parse(X):void 0}return await U[N]()})(),response:U};let H=await U.text();try{H=JSON.parse(H)}catch{}return{error:H,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 gp(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 JN(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 l=s.join(",");switch(n.style){case"form":return`${e}=${l}`;case"label":return`.${l}`;case"matrix":return`;${e}=${l}`;default:return l}}for(const l in t){const f=n.style==="deepObject"?`${e}[${l}]`:l;s.push(gp(f,t[l],n))}const a=s.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function ej(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",l=(n.allowReserved===!0?t:t.map(f=>encodeURIComponent(f))).join(a);switch(n.style){case"simple":return l;case"label":return`.${l}`;case"matrix":return`;${e}=${l}`;default:return`${e}=${l}`}}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(gp(e,a,n));return n.style==="label"||n.style==="matrix"?`${s}${i.join(s)}`:i.join(s)}function OT(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(ej(i,a,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof a=="object"){s.push(JN(i,a,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}s.push(gp(i,a,e))}}return s.join("&")}}function GH(e,t){let n=e;for(const s of e.match(HH)??[]){let i=s.substring(1,s.length-1),a=!1,l="simple";if(i.endsWith("*")&&(a=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(l="label",i=i.substring(1)):i.startsWith(";")&&(l="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,ej(i,f,{style:l,explode:a}));continue}if(typeof f=="object"){n=n.replace(s,JN(i,f,{style:l,explode:a}));continue}if(l==="matrix"){n=n.replace(s,`;${gp(i,f)}`);continue}n=n.replace(s,l==="label"?`.${encodeURIComponent(f)}`:encodeURIComponent(f))}return n}function ZH(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 YH(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 MT(...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 l of a)t.append(i,l);else a!==void 0&&t.set(i,a)}return t}function IT(e){return e.endsWith("/")?e.substring(0,e.length-1):e}class XH extends Error{error;constructor(t,n){super(t),this.error=n,this.name="ApiResponseError"}}function QH(e){if(e&&typeof e=="object"&&"error"in e){const t=e.error;if(typeof t=="string")return t}if(e&&typeof e=="object"&&"message"in e){const t=e.message;if(typeof t=="string")return t}return"Request failed"}async function Xu(e){const{data:t,error:n}=await e;if(n||!t)throw new XH(QH(n),n);return t}function WH(e){const t=KH({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[l,f]of Object.entries(a))i.headers.set(l,f)}return i.headers.has("x-syncular-transport-path")||i.headers.set("x-syncular-transport-path",s),i}}),t}function JH(e){return WH({baseUrl:e.serverUrl,getHeaders:()=>({Authorization:`Bearer ${e.token}`})})}async function eq(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,l=a.error,f=a.message;if(typeof l=="string"&&l.length>0)i=l;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 Ru="sync-console-connection";function Cv(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:{serverUrl:t,token:n}}function tj(e){return typeof window>"u"?null:e==="local"?window.localStorage:e==="session"?window.sessionStorage:null}function PT(e){const t=tj(e);if(!t)return null;try{const n=t.getItem(Ru);return n?Cv(JSON.parse(n)):null}catch{return null}}function tq(e,t){const n=tj(e);if(n)try{if(!t){n.removeItem(Ru);return}n.setItem(Ru,JSON.stringify(t))}catch{}}const nj=_.createContext(null);function nq({children:e,defaultConfig:t=null,autoConnect:n=!1,storageMode:s="session"}){const[i,a]=_.useState(()=>PT(s));_.useEffect(()=>{const w=PT(s);a(w)},[s]),_.useEffect(()=>{typeof window>"u"||(s!=="local"&&window.localStorage.removeItem(Ru),s==="memory"&&window.sessionStorage.removeItem(Ru))},[s]);const l=_.useCallback(w=>{const T=Cv(w);a(T),tq(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()){l({serverUrl:t.serverUrl.trim(),token:t.token.trim()});return}},[l,i,t]);const g=_.useCallback(async(w,T)=>{const C=w??i;if(!C)return d(N=>({...N,error:"No connection configured"})),!1;const k=Cv(C);if(!k){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)&&l(k),d(N=>({...N,isConnecting:!0,error:null}));try{const N=JH(k);return await eq(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,l]),y=_.useCallback(w=>{w?.clearSavedConfig&&l(null),d({isConnected:!1,isConnecting:!1,client:null,error:null})},[l]),b=_.useCallback(()=>{d(w=>({...w,error:null}))},[]),x=_.useCallback(w=>{l(w),d({isConnected:!1,isConnecting:!1,client:null,error:null})},[l]),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=rq(w);!w||!T||p.current!==T&&(p.current=T,g(w,{persistOverride:!0}))},[n,i,t,f.isConnected,f.isConnecting,g]),h.jsx(nj.Provider,{value:S,children:e})}function rq(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:`${t}\0${n}`}function Dt(){const e=_.useContext(nj);if(!e)throw new Error("useConnection must be used within a ConnectionProvider");return e}function Vt(){const{client:e}=Dt();return e}function rj(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=rj(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function qb(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=rj(e))&&(s&&(s+=" "),s+=t);return s}var sq=e=>typeof e=="number"&&e!=+e,Uh=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,DT=e=>(typeof e=="number"||e instanceof Number)&&!sq(e);function oq(){}var $h=Symbol("NOT_FOUND");function iq(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function aq(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function cq(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 lq(e){const t=Array.isArray(e[0])?e[0]:e;return cq(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function uq(e,t){const n=[],{length:s}=e;for(let i=0;i<s;i++)n.push(e[i].apply(null,t));return n}function fq(e){let t;return{get(n){return t&&e(t.key,n)?t.value:$h},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function dq(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 $h}function i(f,d){s(f)===$h&&(n.unshift({key:f,value:d}),n.length>e&&n.pop())}function a(){return n}function l(){n=[]}return{get:s,put:i,getEntries:a,clear:l}}var hq=(e,t)=>e===t;function pq(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 mq(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=hq,maxSize:i=1,resultEqualityCheck:a}=n,l=pq(s);let f=0;const d=i<=1?fq(l):dq(i,l);function p(){let g=d.get(arguments);if(g===$h){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 gq=class{constructor(e){this.value=e}deref(){return this.value}},yq=typeof WeakRef<"u"?WeakRef:gq,vq=0,LT=1;function Pd(){return{s:vq,v:void 0,o:null,p:null}}function sj(e,t={}){let n=Pd();const{resultEqualityCheck:s}=t;let i,a=0;function l(){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=Pd(),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=Pd(),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 yq(g):g}return p.s=LT,p.v=g,g}return l.clearCache=()=>{n=Pd(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function oj(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...i)=>{let a=0,l=0,f,d={},p=i.pop();typeof p=="object"&&(d=p,p=i.pop()),iq(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const g={...n,...d},{memoize:y,memoizeOptions:b=[],argsMemoize:x=sj,argsMemoizeOptions:S=[]}=g,w=zT(b),T=zT(S),C=lq(i),k=y(function(){return a++,p.apply(null,arguments)},...w),N=x(function(){l++;const M=uq(C,arguments);return f=k.apply(null,M),f},...T);return Object.assign(N,{resultFunc:p,memoizedResultFunc:k,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>f,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:y,argsMemoize:x})};return Object.assign(s,{withTypes:()=>s}),s}var bq=oj(sj),xq=Object.assign((e,t=bq)=>{aq(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((l,f,d)=>(l[n[d]]=f,l),{}))},{withTypes:()=>xq});function Bh(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}var _y={},wy={},Ey={},UT;function Sq(){return UT||(UT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,s,{signal:i,edges:a}={}){let l,f=null;const d=a!=null&&a.includes("leading"),p=a==null||a.includes("trailing"),g=()=>{f!==null&&(n.apply(l,f),l=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(),l=void 0,f=null},T=()=>{g()},C=function(...k){if(i?.aborted)return;l=this,f=k;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})(Ey)),Ey}var $T;function _q(){return $T||($T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sq();function n(s,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:f=!0,maxWait:d}=a,p=Array(2);l&&(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})(wy)),wy}var BT;function wq(){return BT||(BT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_q();function n(s,i=0,a={}){const{leading:l=!0,trailing:f=!0}=a;return t.debounce(s,i,{leading:l,maxWait:i,trailing:f})}e.throttle=n})(_y)),_y}var Ty,FT;function Eq(){return FT||(FT=1,Ty=wq().throttle),Ty}var Tq=Eq();const Cq=D1(Tq);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 l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},bs={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},ij=(e,t,n)=>{var{width:s=bs.width,height:i=bs.height,aspect:a,maxHeight:l}=n,f=Uh(s)?e:Number(s),d=Uh(i)?t:Number(i);return a&&a>0&&(f?d=f/a:d&&(f=d*a),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:f,calculatedHeight:d}},Rq={width:0,height:0,overflow:"visible"},Nq={width:0,overflowX:"visible"},jq={height:0,overflowY:"visible"},Aq={},kq=e=>{var{width:t,height:n}=e,s=Uh(t),i=Uh(n);return s&&i?Rq:s?Nq:i?jq:Aq};function Oq(e){var{width:t,height:n,aspect:s}=e,i=t,a=n;return i===void 0&&a===void 0?(i=bs.width,a=bs.height):i===void 0?i=s&&s>0?void 0:bs.width:a===void 0&&(a=s&&s>0?void 0:bs.height),{width:i,height:a}}function Rv(){return Rv=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},Rv.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){Mq(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 Mq(e,t,n){return(t=Iq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iq(e){var t=Pq(e,"string");return typeof t=="symbol"?t:t+""}function Pq(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 aj=_.createContext(bs.initialDimension);function Dq(e){return Bh(e.width)&&Bh(e.height)}function cj(e){var{children:t,width:n,height:s}=e,i=_.useMemo(()=>({width:n,height:s}),[n,s]);return Dq(i)?_.createElement(aj.Provider,{value:i},t):null}var zq=()=>_.useContext(aj),Lq=_.forwardRef((e,t)=>{var{aspect:n,initialDimension:s=bs.initialDimension,width:i,height:a,minWidth:l=bs.minWidth,minHeight:f,maxHeight:d,children:p,debounce:g=bs.debounce,id:y,className:b,onResize:x,style:S={}}=e,w=_.useRef(null),T=_.useRef();T.current=x,_.useImperativeHandle(t,()=>w.current);var[C,k]=_.useState({containerWidth:s.width,containerHeight:s.height}),N=_.useCallback((A,P)=>{k(G=>{var B=Math.round(A),z=Math.round(P);return G.containerWidth===B&&G.containerHeight===z?G:{containerWidth:B,containerHeight:z}})},[]);_.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return oq;var A=z=>{var Q,Y=z[0];if(Y!=null){var{width:ee,height:D}=Y.contentRect;N(ee,D),(Q=T.current)===null||Q===void 0||Q.call(T,ee,D)}};g>0&&(A=Cq(A,g,{trailing:!0,leading:!1}));var P=new ResizeObserver(A),{width:G,height:B}=w.current.getBoundingClientRect();return N(G,B),P.observe(w.current),()=>{P.disconnect()}},[N,g]);var{containerWidth:R,containerHeight:M}=C;HT(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:L,calculatedHeight:j}=ij(R,M,{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
68
  please check the style of container, or the props width(%s) and height(%s),
69
69
  or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
70
- height and width.`,L,j,i,a,l,f,n),_.createElement("div",{id:y?"".concat(y):void 0,className:Fb("recharts-responsive-container",b),style:FT(FT({},S),{},{width:i,height:a,minWidth:l,minHeight:f,maxHeight:d}),ref:w},_.createElement("div",{style:Cq({width:i,height:a})},_.createElement(sj,{width:L,height:j},p)))}),Iq=_.forwardRef((e,t)=>{var n=Oq();if($h(n.width)&&$h(n.height))return e.children;var{width:s,height:i}=Rq({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=nj(void 0,void 0,{width:s,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return MT(a)&&MT(l)?_.createElement(sj,{width:a,height:l},e.children):_.createElement(Mq,Tv({},e,{width:s,height:i,ref:t}))});const Pq=(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},Dq=(e,t)=>({classGroupId:e,validator:t}),oj=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Bh="-",HT=[],zq="arbitrary..",Lq=e=>{const t=$q(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Uq(l);const f=l.split(Bh),d=f[0]===""&&f.length>1?1:0;return ij(f,d,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const d=s[l],p=n[l];return d?p?Pq(p,d):d:p||HT}return n[l]||HT}}},ij=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const p=ij(e,t+1,a);if(p)return p}const l=n.validators;if(l===null)return;const f=t===0?e.join(Bh):e.slice(t).join(Bh),d=l.length;for(let p=0;p<d;p++){const g=l[p];if(g.validator(f))return g.classGroupId}},Uq=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?zq+s:void 0})(),$q=e=>{const{theme:t,classGroups:n}=e;return Bq(n,t)},Bq=(e,t)=>{const n=oj();for(const s in e){const i=e[s];Hb(i,n,s,t)}return n},Hb=(e,t,n,s)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];Fq(l,t,n,s)}},Fq=(e,t,n,s)=>{if(typeof e=="string"){Hq(e,t,n);return}if(typeof e=="function"){qq(e,t,n,s);return}Vq(e,t,n,s)},Hq=(e,t,n)=>{const s=e===""?t:aj(t,e);s.classGroupId=n},qq=(e,t,n,s)=>{if(Kq(e)){Hb(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(Dq(n,e))},Vq=(e,t,n,s)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[f,d]=i[l];Hb(d,aj(t,f),n,s)}},aj=(e,t)=>{let n=e;const s=t.split(Bh),i=s.length;for(let a=0;a<i;a++){const l=s[a];let f=n.nextPart.get(l);f||(f=oj(),n.nextPart.set(l,f)),n=f}return n},Kq=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Gq=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const i=(a,l)=>{n[a]=l,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=s[a])!==void 0)return i(a,l),l},set(a,l){a in n?n[a]=l:i(a,l)}}},Cv="!",qT=":",Zq=[],VT=(e,t,n,s,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),Yq=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=i=>{const a=[];let l=0,f=0,d=0,p;const g=i.length;for(let w=0;w<g;w++){const T=i[w];if(l===0&&f===0){if(T===qT){a.push(i.slice(d,w)),d=w+1;continue}if(T==="/"){p=w;continue}}T==="["?l++:T==="]"?l--:T==="("?f++:T===")"&&f--}const y=a.length===0?i:i.slice(d);let b=y,x=!1;y.endsWith(Cv)?(b=y.slice(0,-1),x=!0):y.startsWith(Cv)&&(b=y.slice(1),x=!0);const S=p&&p>d?p-d:void 0;return VT(a,x,b,S)};if(t){const i=t+qT,a=s;s=l=>l.startsWith(i)?a(l.slice(i.length)):VT(Zq,!1,l,void 0,!0)}if(n){const i=s;s=a=>n({className:a,parseClassName:i})}return s},Xq=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 l=n[a],f=l[0]==="[",d=t.has(l);f||d?(i.length>0&&(i.sort(),s.push(...i),i=[]),s.push(l)):i.push(l)}return i.length>0&&(i.sort(),s.push(...i)),s}},Qq=e=>({cache:Gq(e.cacheSize),parseClassName:Yq(e),sortModifiers:Xq(e),...Lq(e)}),Wq=/\s+/,Jq=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],f=e.trim().split(Wq);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 O=b.length===0?"":b.length===1?b[0]:a(b).join(":"),N=x?O+Cv:O,R=N+C;if(l.indexOf(R)>-1)continue;l.push(R);const M=i(C,T);for(let L=0;L<M.length;++L){const j=M[L];l.push(N+j)}d=g+(d.length>0?" "+d:d)}return d},e9=(...e)=>{let t=0,n,s,i="";for(;t<e.length;)(n=e[t++])&&(s=cj(n))&&(i&&(i+=" "),i+=s);return i},cj=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=cj(e[s]))&&(n&&(n+=" "),n+=t);return n},t9=(e,...t)=>{let n,s,i,a;const l=d=>{const p=t.reduce((g,y)=>y(g),e());return n=Qq(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=Jq(d,n);return i(d,g),g};return a=l,(...d)=>a(e9(...d))},n9=[],dn=e=>{const t=n=>n[e]||n9;return t.isThemeGetter=!0,t},lj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,uj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,r9=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,s9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,o9=/\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$/,i9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,a9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,c9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Lo=e=>r9.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Uo=e=>!!e&&Number.isInteger(Number(e)),Ty=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),Hs=e=>s9.test(e),fj=()=>!0,l9=e=>o9.test(e)&&!i9.test(e),qb=()=>!1,u9=e=>a9.test(e),f9=e=>c9.test(e),d9=e=>!Ne(e)&&!je(e),h9=e=>mi(e,pj,qb),Ne=e=>lj.test(e),qi=e=>mi(e,mj,l9),KT=e=>mi(e,S9,Qe),p9=e=>mi(e,yj,fj),m9=e=>mi(e,gj,qb),GT=e=>mi(e,dj,qb),g9=e=>mi(e,hj,f9),Pd=e=>mi(e,vj,u9),je=e=>uj.test(e),ou=e=>va(e,mj),y9=e=>va(e,gj),ZT=e=>va(e,dj),v9=e=>va(e,pj),b9=e=>va(e,hj),Dd=e=>va(e,vj,!0),x9=e=>va(e,yj,!0),mi=(e,t,n)=>{const s=lj.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},va=(e,t,n=!1)=>{const s=uj.exec(e);return s?s[1]?t(s[1]):n:!1},dj=e=>e==="position"||e==="percentage",hj=e=>e==="image"||e==="url",pj=e=>e==="length"||e==="size"||e==="bg-size",mj=e=>e==="length",S9=e=>e==="number",gj=e=>e==="family-name",yj=e=>e==="number"||e==="weight",vj=e=>e==="shadow",_9=()=>{const e=dn("color"),t=dn("font"),n=dn("text"),s=dn("font-weight"),i=dn("tracking"),a=dn("leading"),l=dn("breakpoint"),f=dn("container"),d=dn("spacing"),p=dn("radius"),g=dn("shadow"),y=dn("inset-shadow"),b=dn("text-shadow"),x=dn("drop-shadow"),S=dn("blur"),w=dn("perspective"),T=dn("aspect"),C=dn("ease"),O=dn("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"],M=()=>[...R(),je,Ne],L=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],A=()=>[je,Ne,d],P=()=>[Lo,"full","auto",...A()],Z=()=>[Uo,"none","subgrid",je,Ne],B=()=>["auto",{span:["full",Uo,je,Ne]},Uo,je,Ne],z=()=>[Uo,"auto",je,Ne],Q=()=>["auto","min","max","fr",je,Ne],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...A()],V=()=>[Lo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],q=()=>[Lo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],K=()=>[Lo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],U=()=>[e,je,Ne],I=()=>[...R(),ZT,GT,{position:[je,Ne]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",v9,h9,{size:[je,Ne]}],X=()=>[Ty,ou,qi],oe=()=>["","none","full",p,je,Ne],se=()=>["",Qe,ou,qi],pe=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[Qe,Ty,ZT,GT],Me=()=>["","none",S,je,Ne],_e=()=>["none",Qe,je,Ne],ne=()=>["none",Qe,je,Ne],he=()=>[Qe,je,Ne],ae=()=>[Lo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hs],breakpoint:[Hs],color:[fj],container:[Hs],"drop-shadow":[Hs],ease:["in","out","in-out"],font:[d9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hs],shadow:[Hs],spacing:["px",Qe],text:[Hs],"text-shadow":[Hs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Lo,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:M()}],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:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Uo,"auto",je,Ne]}],basis:[{basis:[Lo,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,Lo,"auto","initial","none",Ne]}],grow:[{grow:["",Qe,je,Ne]}],shrink:[{shrink:["",Qe,je,Ne]}],order:[{order:[Uo,"first","last","none",je,Ne]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:B()}],"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":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...K()]}],"min-block-size":[{"min-block":["auto",...K()]}],"max-block-size":[{"max-block":["none",...K()]}],w:[{w:[f,"screen",...V()]}],"min-w":[{"min-w":[f,"screen","none",...V()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...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,ou,qi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,x9,p9]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ty,Ne]}],"font-family":[{font:[y9,m9,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,KT]}],leading:[{leading:[a,...A()]}],"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,qi]}],"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:A()}],"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:H()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Uo,je,Ne],radial:["",je,Ne],conic:[Uo,je,Ne]},b9,g9]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"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,ou,qi]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",g,Dd,Pd]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",y,Dd,Pd]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Qe,qi]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",b,Dd,Pd]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Qe,je,Ne]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[je,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Ne]}],filter:[{filter:["","none",je,Ne]}],blur:[{blur:Me()}],brightness:[{brightness:[Qe,je,Ne]}],contrast:[{contrast:[Qe,je,Ne]}],"drop-shadow":[{"drop-shadow":["","none",x,Dd,Pd]}],"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":Me()}],"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":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",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",O,je,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,je,Ne]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[je,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je,Ne]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Qe,ou,qi,KT]}],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"]}},w9=t9(_9);function ge(...e){return w9(Fb(e))}const E9={light:"",dark:".dark"},bj=_.createContext(null);function T9(){const e=_.useContext(bj);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const C9=_.forwardRef(({id:e,className:t,children:n,config:s,...i},a)=>{const l=_.useId(),f=`chart-${e||l.replace(/:/g,"")}`;return h.jsx(bj.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(R9,{config:s,id:f}),h.jsx(Iq,{initialDimension:{width:1,height:1},children:n})]})})});C9.displayName="ChartContainer";function R9({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(E9).map(([s,i])=>{const a=n.map(([l,f])=>{const d=f.theme?.[s]??f.color;return d?` --color-${l}: ${d};`:null}).filter(Boolean).join(`
70
+ height and width.`,L,j,i,a,l,f,n),_.createElement("div",{id:y?"".concat(y):void 0,className:qb("recharts-responsive-container",b),style:VT(VT({},S),{},{width:i,height:a,minWidth:l,minHeight:f,maxHeight:d}),ref:w},_.createElement("div",{style:kq({width:i,height:a})},_.createElement(cj,{width:L,height:j},p)))}),Uq=_.forwardRef((e,t)=>{var n=zq();if(Bh(n.width)&&Bh(n.height))return e.children;var{width:s,height:i}=Oq({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=ij(void 0,void 0,{width:s,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return DT(a)&&DT(l)?_.createElement(cj,{width:a,height:l},e.children):_.createElement(Lq,Rv({},e,{width:s,height:i,ref:t}))});const $q=(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},Bq=(e,t)=>({classGroupId:e,validator:t}),lj=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Fh="-",KT=[],Fq="arbitrary..",Hq=e=>{const t=Vq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return qq(l);const f=l.split(Fh),d=f[0]===""&&f.length>1?1:0;return uj(f,d,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const d=s[l],p=n[l];return d?p?$q(p,d):d:p||KT}return n[l]||KT}}},uj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const p=uj(e,t+1,a);if(p)return p}const l=n.validators;if(l===null)return;const f=t===0?e.join(Fh):e.slice(t).join(Fh),d=l.length;for(let p=0;p<d;p++){const g=l[p];if(g.validator(f))return g.classGroupId}},qq=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?Fq+s:void 0})(),Vq=e=>{const{theme:t,classGroups:n}=e;return Kq(n,t)},Kq=(e,t)=>{const n=lj();for(const s in e){const i=e[s];Vb(i,n,s,t)}return n},Vb=(e,t,n,s)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];Gq(l,t,n,s)}},Gq=(e,t,n,s)=>{if(typeof e=="string"){Zq(e,t,n);return}if(typeof e=="function"){Yq(e,t,n,s);return}Xq(e,t,n,s)},Zq=(e,t,n)=>{const s=e===""?t:fj(t,e);s.classGroupId=n},Yq=(e,t,n,s)=>{if(Qq(e)){Vb(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(Bq(n,e))},Xq=(e,t,n,s)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[f,d]=i[l];Vb(d,fj(t,f),n,s)}},fj=(e,t)=>{let n=e;const s=t.split(Fh),i=s.length;for(let a=0;a<i;a++){const l=s[a];let f=n.nextPart.get(l);f||(f=lj(),n.nextPart.set(l,f)),n=f}return n},Qq=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Wq=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const i=(a,l)=>{n[a]=l,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=s[a])!==void 0)return i(a,l),l},set(a,l){a in n?n[a]=l:i(a,l)}}},Nv="!",GT=":",Jq=[],ZT=(e,t,n,s,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),e9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=i=>{const a=[];let l=0,f=0,d=0,p;const g=i.length;for(let w=0;w<g;w++){const T=i[w];if(l===0&&f===0){if(T===GT){a.push(i.slice(d,w)),d=w+1;continue}if(T==="/"){p=w;continue}}T==="["?l++:T==="]"?l--:T==="("?f++:T===")"&&f--}const y=a.length===0?i:i.slice(d);let b=y,x=!1;y.endsWith(Nv)?(b=y.slice(0,-1),x=!0):y.startsWith(Nv)&&(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=l=>l.startsWith(i)?a(l.slice(i.length)):ZT(Jq,!1,l,void 0,!0)}if(n){const i=s;s=a=>n({className:a,parseClassName:i})}return s},t9=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 l=n[a],f=l[0]==="[",d=t.has(l);f||d?(i.length>0&&(i.sort(),s.push(...i),i=[]),s.push(l)):i.push(l)}return i.length>0&&(i.sort(),s.push(...i)),s}},n9=e=>({cache:Wq(e.cacheSize),parseClassName:e9(e),sortModifiers:t9(e),...Hq(e)}),r9=/\s+/,s9=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],f=e.trim().split(r9);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 k=b.length===0?"":b.length===1?b[0]:a(b).join(":"),N=x?k+Nv:k,R=N+C;if(l.indexOf(R)>-1)continue;l.push(R);const M=i(C,T);for(let L=0;L<M.length;++L){const j=M[L];l.push(N+j)}d=g+(d.length>0?" "+d:d)}return d},o9=(...e)=>{let t=0,n,s,i="";for(;t<e.length;)(n=e[t++])&&(s=dj(n))&&(i&&(i+=" "),i+=s);return i},dj=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=dj(e[s]))&&(n&&(n+=" "),n+=t);return n},i9=(e,...t)=>{let n,s,i,a;const l=d=>{const p=t.reduce((g,y)=>y(g),e());return n=n9(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=s9(d,n);return i(d,g),g};return a=l,(...d)=>a(o9(...d))},a9=[],dn=e=>{const t=n=>n[e]||a9;return t.isThemeGetter=!0,t},hj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,pj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,c9=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,l9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,u9=/\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$/,f9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,d9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,h9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Lo=e=>c9.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Uo=e=>!!e&&Number.isInteger(Number(e)),Cy=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),Hs=e=>l9.test(e),mj=()=>!0,p9=e=>u9.test(e)&&!f9.test(e),Kb=()=>!1,m9=e=>d9.test(e),g9=e=>h9.test(e),y9=e=>!Ne(e)&&!je(e),v9=e=>pi(e,vj,Kb),Ne=e=>hj.test(e),Hi=e=>pi(e,bj,p9),YT=e=>pi(e,C9,Qe),b9=e=>pi(e,Sj,mj),x9=e=>pi(e,xj,Kb),XT=e=>pi(e,gj,Kb),S9=e=>pi(e,yj,g9),Dd=e=>pi(e,_j,m9),je=e=>pj.test(e),ou=e=>ya(e,bj),_9=e=>ya(e,xj),QT=e=>ya(e,gj),w9=e=>ya(e,vj),E9=e=>ya(e,yj),zd=e=>ya(e,_j,!0),T9=e=>ya(e,Sj,!0),pi=(e,t,n)=>{const s=hj.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},ya=(e,t,n=!1)=>{const s=pj.exec(e);return s?s[1]?t(s[1]):n:!1},gj=e=>e==="position"||e==="percentage",yj=e=>e==="image"||e==="url",vj=e=>e==="length"||e==="size"||e==="bg-size",bj=e=>e==="length",C9=e=>e==="number",xj=e=>e==="family-name",Sj=e=>e==="number"||e==="weight",_j=e=>e==="shadow",R9=()=>{const e=dn("color"),t=dn("font"),n=dn("text"),s=dn("font-weight"),i=dn("tracking"),a=dn("leading"),l=dn("breakpoint"),f=dn("container"),d=dn("spacing"),p=dn("radius"),g=dn("shadow"),y=dn("inset-shadow"),b=dn("text-shadow"),x=dn("drop-shadow"),S=dn("blur"),w=dn("perspective"),T=dn("aspect"),C=dn("ease"),k=dn("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"],M=()=>[...R(),je,Ne],L=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],A=()=>[je,Ne,d],P=()=>[Lo,"full","auto",...A()],G=()=>[Uo,"none","subgrid",je,Ne],B=()=>["auto",{span:["full",Uo,je,Ne]},Uo,je,Ne],z=()=>[Uo,"auto",je,Ne],Q=()=>["auto","min","max","fr",je,Ne],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...A()],K=()=>[Lo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],q=()=>[Lo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],V=()=>[Lo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],U=()=>[e,je,Ne],I=()=>[...R(),QT,XT,{position:[je,Ne]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",w9,v9,{size:[je,Ne]}],X=()=>[Cy,ou,Hi],oe=()=>["","none","full",p,je,Ne],se=()=>["",Qe,ou,Hi],de=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[Qe,Cy,QT,XT],Me=()=>["","none",S,je,Ne],_e=()=>["none",Qe,je,Ne],ne=()=>["none",Qe,je,Ne],pe=()=>[Qe,je,Ne],ae=()=>[Lo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hs],breakpoint:[Hs],color:[mj],container:[Hs],"drop-shadow":[Hs],ease:["in","out","in-out"],font:[y9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hs],shadow:[Hs],spacing:["px",Qe],text:[Hs],"text-shadow":[Hs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Lo,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:M()}],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:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Uo,"auto",je,Ne]}],basis:[{basis:[Lo,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,Lo,"auto","initial","none",Ne]}],grow:[{grow:["",Qe,je,Ne]}],shrink:[{shrink:["",Qe,je,Ne]}],order:[{order:[Uo,"first","last","none",je,Ne]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:B()}],"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":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[f,"screen",...K()]}],"min-w":[{"min-w":[f,"screen","none",...K()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,ou,Hi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,T9,b9]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cy,Ne]}],"font-family":[{font:[_9,x9,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,...A()]}],"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:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",je,Hi]}],"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:A()}],"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:H()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Uo,je,Ne],radial:["",je,Ne],conic:[Uo,je,Ne]},E9,S9]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"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:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,je,Ne]}],"outline-w":[{outline:["",Qe,ou,Hi]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",g,zd,Dd]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",y,zd,Dd]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Qe,Hi]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",b,zd,Dd]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Qe,je,Ne]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[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:H()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Ne]}],filter:[{filter:["","none",je,Ne]}],blur:[{blur:Me()}],brightness:[{brightness:[Qe,je,Ne]}],contrast:[{contrast:[Qe,je,Ne]}],"drop-shadow":[{"drop-shadow":["","none",x,zd,Dd]}],"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":Me()}],"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":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",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",k,je,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,je,Ne]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[je,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je,Ne]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Qe,ou,Hi,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"]}},N9=i9(R9);function ge(...e){return N9(qb(e))}const j9={light:"",dark:".dark"},wj=_.createContext(null);function A9(){const e=_.useContext(wj);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const k9=_.forwardRef(({id:e,className:t,children:n,config:s,...i},a)=>{const l=_.useId(),f=`chart-${e||l.replace(/:/g,"")}`;return h.jsx(wj.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(O9,{config:s,id:f}),h.jsx(Uq,{initialDimension:{width:1,height:1},children:n})]})})});k9.displayName="ChartContainer";function O9({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(j9).map(([s,i])=>{const a=n.map(([l,f])=>{const d=f.theme?.[s]??f.color;return d?` --color-${l}: ${d};`:null}).filter(Boolean).join(`
71
71
  `);return`${i} [data-chart='${t}'] {
72
72
  ${a}
73
73
  }`}).join(`
74
- `)}})}const N9=_.forwardRef(({active:e,className:t,color:n,formatter:s,hideIndicator:i=!1,hideLabel:a=!1,indicator:l="dot",label:f,labelClassName:d,labelFormatter:p,labelKey:g,nameKey:y,payload:b},x)=>{const{config:S}=T9(),w=_.useMemo(()=>{if(a||!b?.length)return null;const C=b[0];if(!C)return null;const O=`${g||C.dataKey||C.name||"value"}`,N=YT(S,C,O),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&&l!=="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,O)=>{const N=`${y||C.name||C.dataKey||"value"}`,R=YT(S,C,N),M=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",l==="dot"?"items-center":null),children:s&&C.value!==void 0&&C.name?s(C.value,C.name,C,O,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]",l==="dot"?"h-2.5 w-2.5":null,l==="line"?"w-1":null,l==="dashed"?"w-0 border-[1.5px] border-dashed bg-transparent":null,T&&l==="dashed"?"my-0.5":null),style:{"--color-bg":M,"--color-border":M}}),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)})})]})});N9.displayName="ChartTooltipContent";function YT(e,t,n){const s=t.payload?.[n],i=typeof s=="string"?s:null,a=typeof t.dataKey=="string"?t.dataKey:null,l=typeof t.name=="string"?t.name:null;return e[i??a??l??n]}const j9=["1h","6h","24h","7d"],xj=_.forwardRef(({className:e,bars:t,activeRange:n="1h",onRangeChange:s,startLabel:i="-1h",midLabel:a="-30m",endLabel:l="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:j9.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:l})]})]}));xj.displayName="ActivityBars";const XT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,QT=Fb,gi=(e,t)=>n=>{var s;if(t?.variants==null)return QT(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(p=>{const g=n?.[p],y=a?.[p];if(g===null)return null;const b=XT(g)||XT(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 QT(e,l,d,n?.class,n?.className)},A9=gi("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"}}),Gn=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("input",{ref:s,className:ge(A9({variant:t,className:e})),...n}));Gn.displayName="Input";function gp({controlled:e,default:t,name:n,state:s="value"}){const{current:i}=_.useRef(e!==void 0),[a,l]=_.useState(t),f=i?e:a,d=_.useCallback(p=>{i||l(p)},[]);return[f,d]}const WT={};function zn(e,t){const n=_.useRef(WT);return n.current===WT&&(n.current=e(t)),n}const Cy=I1[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],k9=Cy&&Cy!==_.useLayoutEffect?Cy:e=>e();function Ae(e){const t=zn(O9).current;return t.next=e,k9(t.effect),t.trampoline}function O9(){const e={next:void 0,callback:M9,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function M9(){}function so(e,t,n,s){const i=zn(Sj).current;return P9(i,e,t,n,s)&&_j(i,[e,t,n,s]),i.callback}function I9(e){const t=zn(Sj).current;return D9(t,e)&&_j(t,e),t.callback}function Sj(){return{callback:null,cleanup:null,refs:[]}}function P9(e,t,n,s,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==i}function D9(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function _j(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 l=a(n);typeof l=="function"&&(s[i]=l);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 l=s[i];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}const z9=()=>{},Le=typeof document<"u"?_.useLayoutEffect:z9,wj={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},yp={...wj,position:"fixed",top:0,left:0},Ej={...wj,position:"absolute"};function jn(){}const Ru=Object.freeze([]),an=Object.freeze({});function yn(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 L9=parseInt(_.version,10);function Vb(e){return L9>=e}function JT(e){if(!_.isValidElement(e))return null;const t=e,n=t.props;return(Vb(19)?n?.ref:t.ref)??null}function Rv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function U9(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 $9(e,t){return typeof e=="function"?e(t):e}function B9(e,t){return typeof e=="function"?e(t):e}const hu={};function oi(e,t,n,s,i){let a={...Nv(e,hu)};return t&&(a=lu(a,t)),n&&(a=lu(a,n)),s&&(a=lu(a,s)),i&&(a=lu(a,i)),a}function F9(e){if(e.length===0)return hu;if(e.length===1)return Nv(e[0],hu);let t={...Nv(e[0],hu)};for(let n=1;n<e.length;n+=1)t=lu(t,e[n]);return t}function lu(e,t){return Tj(t)?t(e):H9(e,t)}function H9(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=Rv(e.style,s);break}case"className":{e[n]=Cj(e.className,s);break}default:q9(n,s)?e[n]=V9(e[n],s):e[n]=s}}return e}function q9(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 Tj(e){return typeof e=="function"}function Nv(e,t){return Tj(e)?e(t):e??hu}function V9(e,t){return t?e?n=>{if(K9(n)){const i=n;jv(i);const a=t(i);return i.baseUIHandlerPrevented||e?.(i),a}const s=t(n);return e?.(n),s}:t:e}function jv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Cj(e,t){return t?e?t+" "+e:t:e}function K9(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const G9={style:{transition:"none"}},Z9="data-base-ui-click-trigger",Y9={fallbackAxisSide:"none"},X9={fallbackAxisSide:"end"},Q9={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function zt(e,t,n={}){const s=t.render,i=W9(t,n);if(n.enabled===!1)return null;const a=n.state??an;return e8(e,s,i,a)}function W9(e,t={}){const{className:n,style:s,render:i}=e,{state:a=an,ref:l,props:f,stateAttributesMapping:d,enabled:p=!0}=t,g=p?$9(n,a):void 0,y=p?B9(s,a):void 0,b=p?U9(a,d):an,x=p?Rv(b,Array.isArray(f)?F9(f):f)??an:an;return typeof document<"u"&&(p?Array.isArray(l)?x.ref=I9([x.ref,JT(i),...l]):x.ref=so(x.ref,JT(i),l):so(null,null)),p?(g!==void 0&&(x.className=Cj(x.className,g)),y!==void 0&&(x.style=Rv(x.style,y)),x):an}const J9=Symbol.for("react.lazy");function e8(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const i=oi(n,t.props);i.ref=n.ref;let a=t;return a?.$$typeof===J9&&(a=_.Children.toArray(t)[0]),_.cloneElement(a,i)}if(e&&typeof e=="string")return t8(e,n);throw new Error(yn(8))}function t8(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 n8={...I1};let eC=0;function r8(e,t="mui"){const[n,s]=_.useState(e),i=e||n;return _.useEffect(()=>{n==null&&(eC+=1,s(`${t}-${eC}`))},[n,t]),i}const tC=n8.useId;function Xu(e,t){if(tC!==void 0){const n=tC();return e??(t?`${t}-${n}`:n)}return r8(e,t)}function br(e){return Xu(e,"base-ui")}function vp(){return typeof window<"u"}function yi(e){return Kb(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _s(e){var t;return(t=(Kb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kb(e){return vp()?e instanceof Node||e instanceof un(e).Node:!1}function jt(e){return vp()?e instanceof Element||e instanceof un(e).Element:!1}function Zt(e){return vp()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function Av(e){return!vp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}const s8=new Set(["inline","contents"]);function vi(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=xr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!s8.has(i)}const o8=new Set(["table","td","th"]);function i8(e){return o8.has(yi(e))}const a8=[":popover-open",":modal"];function bp(e){return a8.some(t=>{try{return e.matches(t)}catch{return!1}})}const c8=["transform","translate","scale","rotate","perspective"],l8=["transform","translate","scale","rotate","perspective","filter"],u8=["paint","layout","strict","content"];function Gb(e){const t=xp(),n=jt(e)?xr(e):e;return c8.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)||l8.some(s=>(n.willChange||"").includes(s))||u8.some(s=>(n.contain||"").includes(s))}function f8(e){let t=oo(e);for(;Zt(t)&&!Ys(t);){if(Gb(t))return t;if(bp(t))return null;t=oo(t)}return null}function xp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const d8=new Set(["html","body","#document"]);function Ys(e){return d8.has(yi(e))}function xr(e){return un(e).getComputedStyle(e)}function Sp(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oo(e){if(yi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Av(e)&&e.host||_s(e);return Av(t)?t.host:t}function Rj(e){const t=oo(e);return Ys(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zt(t)&&vi(t)?t:Rj(t)}function Wo(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Rj(e),a=i===((s=e.ownerDocument)==null?void 0:s.body),l=un(i);if(a){const f=kv(l);return t.concat(l,l.visualViewport||[],vi(i)?i:[],f&&n?Wo(f):[])}return t.concat(i,Wo(i,[],n))}function kv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Nj=_.createContext(void 0);function jj(e=!1){const t=_.useContext(Nj);if(t===void 0&&!e)throw new Error(yn(16));return t}function h8(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:i=0,isNativeButton:a}=e,l=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||l)||!a&&n)&&(p["aria-disabled"]=n),a&&(!t||f)&&(p.disabled=n),p},[s,n,t,l,f,a,i])}}function el(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=e,a=_.useRef(null),l=jj(!0)!==void 0,f=Ae(()=>{const b=a.current;return!!(b?.tagName==="A"&&b?.href)}),{props:d}=h8({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:s,isNativeButton:i}),p=_.useCallback(()=>{const b=a.current;p8(b)&&l&&t&&d.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,d.disabled,l]);Le(p,[p]);const g=_.useCallback((b={})=>{const{onClick:x,onMouseDown:S,onKeyUp:w,onKeyDown:T,onPointerDown:C,...O}=b;return oi({type:i?"button":void 0,onClick(R){if(t){R.preventDefault();return}x?.(R)},onMouseDown(R){t||S?.(R)},onKeyDown(R){if(t||(jv(R),T?.(R)),R.baseUIHandlerPrevented)return;const M=R.target===R.currentTarget&&!i&&!f()&&!t,L=R.key==="Enter",j=R.key===" ";M&&((j||L)&&R.preventDefault(),L&&x?.(R))},onKeyUp(R){t||(jv(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,O)},[t,d,i,f]),y=Ae(b=>{a.current=b,p()});return{getButtonProps:g,buttonRef:y}}function p8(e){return Zt(e)&&e.tagName==="BUTTON"}const Aj=_.createContext(void 0);function m8(){const e=_.useContext(Aj);if(e===void 0)throw new Error(yn(63));return e}let nC=(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 _p={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},bi={valid(e){return e===null?null:e?{[nC.valid]:""}:{[nC.invalid]:""}}};let rC=(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 kj={...bi,checked(e){return e?{[rC.checked]:""}:{[rC.unchecked]:""}}};function Ov(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const g8=_.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:jn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function tl(){return _.useContext(g8)}const Oj=_.createContext({invalid:void 0,name:void 0,validityData:{state:_p,errors:[],error:"",value:"",initialValue:null},setValidityData:jn,disabled:void 0,touched:!1,setTouched:jn,dirty:!1,setDirty:jn,filled:!1,setFilled:jn,focused:!1,setFocused:jn,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=an)=>e,getInputValidationProps:(e=an)=>e,inputRef:{current:null},commit:async()=>{}}});function xi(e=!0){const t=_.useContext(Oj);if(t.setValidityData===jn&&!e)throw new Error(yn(28));return t}function Mj(e){const{enabled:t=!0,value:n,id:s,name:i,controlRef:a,commit:l}=e,{formRef:f}=tl(),{invalid:d,markedDirtyRef:p,validityData:g,setValidityData:y}=xi(),b=Ae(e.getValue);Le(()=>{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]),Le(()=>{!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?hi.flushSync(()=>l(S)):l(S)}})},[l,a,t,f,b,s,d,p,i,g,n]),Le(()=>{const x=f.current.fields;return()=>{s&&x.delete(s)}},[f,s])}const Ij=_.createContext({controlId:void 0,registerControlId:jn,labelId:void 0,setLabelId:jn,messageIds:[],setMessageIds:jn,getDescriptionProps:e=>e});function co(){return _.useContext(Ij)}function Pj(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:i,registerControlId:a}=co(),l=br(t),f=n?i:void 0,d=zn(()=>Symbol("labelable-control")),p=_.useRef(!1),g=_.useRef(t!=null),y=Ae(()=>{!p.current||a===jn||(p.current=!1,a(d.current,void 0))});return Le(()=>{if(a===jn)return;let b;if(n){const x=s?.current;jt(x)&&x.closest("label")!=null?b=t??null:b=f??l}else if(t!=null)g.current=!0,b=t;else if(g.current)b=l;else{y();return}if(b===void 0){y();return}p.current=!0,a(d.current,b)},[t,s,f,a,n,l,d,y]),_.useEffect(()=>y,[y]),i??l}const ii="none",sC="trigger-press",Mv="trigger-hover",Dj="outside-press",Ry="item-press",zj="focus-out",y8="escape-key",v8="cancel-open",b8="imperative-action",x8="window-resize";function Yt(e,t,n,s){let i=!1,a=!1;const l=s??an;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,...l}}function Lj(e,t){const n=_.useRef(e),s=Ae(t);Le(()=>{n.current!==e&&s(n.current)},[e,s]),Le(()=>{n.current=e},[e])}const S8=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a,id:l,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:O}=tl(),{state:N,setTouched:R,setDirty:M,validityData:L,setFilled:j,setFocused:A,shouldValidateOnChange:P,validationMode:Z,disabled:B,name:z,validation:Q}=xi(),{labelId:Y}=co(),ee=B||x,D=z??d,V=Ae(g),q=_.useRef(null),K=so(q,f,Q.inputRef),U=_.useRef(null),I=br(),H=Pj({id:l,implicit:!1,controlRef:U}),W=p?void 0:H,[X,oe]=gp({controlled:s,default:!!a,name:"Switch",state:"checked"});Mj({id:I,commit:Q.commit,value:X,controlRef:U,name:D,getValue:()=>X}),Le(()=>{q.current&&j(q.current.checked)},[q,j]),Lj(X,()=>{O(D),M(X!==L.initialValue),j(X),P()?Q.commit(X):Q.commit(X,!0)});const{getButtonProps:se,buttonRef:pe}=el({disabled:ee,native:p}),xe={id:p?H:I,role:"switch","aria-checked":X,"aria-readonly":y||void 0,"aria-required":b||void 0,"aria-labelledby":Y,onFocus(){ee||A(!0)},onBlur(){const ne=q.current;!ne||ee||(R(!0),A(!1),Z==="onBlur"&&Q.commit(ne.checked))},onClick(ne){y||ee||(ne.preventDefault(),q.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ne.shiftKey,ctrlKey:ne.ctrlKey,altKey:ne.altKey,metaKey:ne.metaKey})))}},de=_.useMemo(()=>oi({checked:X,disabled:ee,id:W,name:D,required:b,style:D?Ej:yp,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:K,onChange(ne){if(ne.nativeEvent.defaultPrevented)return;const he=ne.target.checked,ae=Yt(ii,ne.nativeEvent);V?.(he,ae),!ae.isCanceled&&oe(he)},onFocus(){U.current?.focus()}},Q.getInputValidationProps,T!==void 0?{value:T}:an),[X,ee,K,W,D,V,b,oe,Q,T]),Me=_.useMemo(()=>({...N,checked:X,disabled:ee,readOnly:y,required:b}),[N,X,ee,y,b]),_e=zt("span",t,{state:Me,ref:[n,U,pe],props:[xe,Q.getValidationProps,C,se],stateAttributesMapping:kj});return h.jsxs(Aj.Provider,{value:Me,children:[_e,!X&&D&&w!==void 0&&h.jsx("input",{type:"hidden",name:D,value:w}),h.jsx("input",{...de})]})}),_8=_.forwardRef(function(t,n){const{render:s,className:i,...a}=t,{state:l}=xi(),f=m8(),d={...l,...f};return zt("span",t,{state:d,ref:n,stateAttributesMapping:kj,props:a})}),wp=_.forwardRef(({className:e,...t},n)=>h.jsx(S8,{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(_8,{className:"block w-[14px] h-[14px] bg-white rounded-full transition-transform data-[checked]:translate-x-4 absolute top-0.5 left-0.5"})}));wp.displayName="Switch";const Uj=_.forwardRef(({className:e,enabled:t=!0,onEnabledChange:n,thresholds:s,onThresholdsChange:i,...a},l)=>{function f(d,p){const g=Number(p);Number.isFinite(g)&&i?.({...s,[d]:g})}return h.jsxs("div",{ref:l,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(wp,{checked:t,onCheckedChange:d=>n?.(d)})]}),h.jsxs("div",{className:"p-4 space-y-3",children:[h.jsx(Ny,{label:"P90 latency threshold",value:s.p90Latency,onChange:d=>f("p90Latency",d)}),h.jsx(Ny,{label:"Error rate threshold",value:s.errorRate,onChange:d=>f("errorRate",d)}),h.jsx(Ny,{label:"Client lag threshold",value:s.clientLag,onChange:d=>f("clientLag",d)})]})]})});Uj.displayName="AlertsConfig";function Ny({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(Gn,{variant:"mono",type:"number",value:t,onChange:s=>n(s.target.value),className:"w-[100px] text-[11px] px-2 py-1 text-right"})]})}const w8=gi("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"}}),mn=_.forwardRef(({className:e,variant:t,style:n,...s},i)=>h.jsx("span",{ref:i,className:ge(w8({variant:t,className:e})),style:{lineHeight:1,...n},...s}));mn.displayName="Badge";const nl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"table",className:ge("w-full",e),...t}));nl.displayName="Table";const rl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));rl.displayName="TableHeader";const sl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));sl.displayName="TableBody";const os=_.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}));os.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 E8={relay:"relay",admin:"flow",proxy:"ghost"},T8=_.forwardRef(({className:e,keys:t,onCreateKey:n,onRotateKey:s,onRevokeKey:i,...a},l)=>h.jsx("div",{ref:l,className:ge("w-full",e),...a,children:h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{children:"Name"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"Prefix"}),h.jsx(ht,{children:"Created"})]})}),h.jsx(sl,{children:t.map((f,d)=>h.jsxs(os,{className:"group relative",children:[h.jsx(pt,{children:h.jsx("span",{className:"text-white truncate",children:f.name})}),h.jsx(pt,{children:h.jsx(mn,{variant:E8[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}`))})]})}));T8.displayName="ApiKeysTable";const $j=_.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(l=>h.jsx("div",{className:"w-0.5 h-1.5 bg-healthy rounded-sm animate-[heartbeat_1.2s_ease-in-out_infinite]",style:{animationDelay:`${l}s`}},l))}),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(l=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:l.label}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:l.value})]},l.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})]})]}));$j.displayName="BottomBar";const Bj=_.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))]}));Bj.displayName="CommitTable";const Fj=gi("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"}}),Oe=_.forwardRef(({className:e,variant:t,size:n,...s},i)=>h.jsx("button",{ref:i,className:ge(Fj({variant:t,size:n,className:e})),...s}));Oe.displayName="Button";const Hj=_.forwardRef(({className:e,isConnected:t=!1,isConnecting:n=!1,isTestingConnection:s=!1,serverUrl:i,onServerUrlChange:a,consoleToken:l,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(mn,{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(Gn,{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(Gn,{id:"console-token",variant:"mono",type:"password",value:l,onChange:S=>f?.(S.target.value)})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(Oe,{variant:"primary",size:"md",onClick:d,disabled:n,children:n?"Connecting...":"Save + Connect"}),h.jsx(Oe,{variant:"default",size:"md",onClick:g,disabled:n||s,children:s?"Testing...":"Test Connection"}),h.jsx(Oe,{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})]})]}));Hj.displayName="ConnectionForm";const C8=gi("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"}}),Pt=_.forwardRef(({className:e,size:t,...n},s)=>h.jsxs("svg",{ref:s,className:ge(C8({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"})]}));Pt.displayName="Spinner";function R8({className:e,state:t}){switch(t){case"connected":return h.jsx(mn,{variant:"healthy",className:e,children:"Connected"});case"disconnected":return h.jsx(mn,{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(Pt,{size:"sm"}),"Connecting"]});case"not-configured":return h.jsx(mn,{variant:"ghost",className:e,children:"Not configured"})}}const Zb=_.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}));Zb.displayName="Card";const N8=_.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}));N8.displayName="CardHeader";const j8=_.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));j8.displayName="CardTitle";const Yb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("p-4",e),...t}));Yb.displayName="CardContent";const A8=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-4 py-2.5 border-t border-border",e),...t}));A8.displayName="CardFooter";function Xb({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 qj=_.forwardRef(({className:e,groups:t,searchValue:n,searchPlaceholder:s="Filter by client or actor...",onSearchChange:i,actions:a,...l},f)=>h.jsxs("div",{ref:f,className:ge("px-5 py-3 border-b border-border flex items-center gap-4 flex-wrap",e),...l,children:[t.map((d,p)=>h.jsx(k8,{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})]}));qj.displayName="FilterBar";function k8({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 O8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const M8={online:"healthy",syncing:"syncing",offline:"offline"},I8={realtime:"flow",polling:"ghost"},P8=_.forwardRef(({className:e,client:t,headSeq:n,onEvict:s,...i},a)=>{const l=Math.max(0,n-t.cursor),f=Math.min(100,t.cursor/n*100),d=O8(l);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(mn,{variant:M8[t.status],children:t.status}),h.jsx(mn,{variant:I8[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:l===0?"Caught up":`${l} behind`})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(jy,{label:"Actor",value:t.actor}),h.jsx(jy,{label:"Dialect",value:t.dialect}),h.jsx(jy,{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(mn,{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"]})]})]})});P8.displayName="FleetCard";function jy({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 Vj=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const D8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const z8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const oC=e=>{const t=z8(e);return t.charAt(0).toUpperCase()+t.slice(1)};var L8={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 U8=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const $8=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:l,...f},d)=>_.createElement("svg",{ref:d,...L8,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:Vj("lucide",i),...!a&&!U8(f)&&{"aria-hidden":"true"},...f},[...l.map(([p,g])=>_.createElement(p,g)),...Array.isArray(a)?a:[a]]));const Qb=(e,t)=>{const n=_.forwardRef(({className:s,...i},a)=>_.createElement($8,{ref:a,iconNode:t,className:Vj(`lucide-${D8(oC(e))}`,`lucide-${e}`,s),...i}));return n.displayName=oC(e),n};const B8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],F8=Qb("arrow-left",B8);const H8=[["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"}]],q8=Qb("settings",H8);const V8=[["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"}]],K8=Qb("user-x",V8);function G8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const Z8={online:"healthy",syncing:"syncing",offline:"offline"},Kj=_.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(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{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(sl,{children:t.map(l=>{const f=Math.max(0,n-l.cursor),d=n>0?Math.min(100,l.cursor/n*100):100,p=G8(f);return h.jsxs(os,{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:l.id,children:l.id.length>18?`${l.id.substring(0,18)}…`:l.id})]})}),h.jsx(pt,{className:"w-[70px]",children:h.jsx(mn,{variant:Z8[l.status],children:l.status})}),h.jsx(pt,{className:"w-[60px]",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.type})}),h.jsx(pt,{className:"w-[80px]",children:h.jsxs("span",{className:"font-mono text-[11px] text-white font-medium",children:["#",l.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:l.dialect})}),h.jsx(pt,{className:"flex-1",children:h.jsx(mn,{variant:l.mode==="realtime"?"flow":"ghost",children:l.mode})}),s&&h.jsxs("button",{type:"button",title:"Evict client",onClick:()=>s(l.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(K8,{size:10}),"evict"]})]},l.id)})})]})}));Kj.displayName="FleetTable";const Gj=_.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((l,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:l.table}),h.jsx("span",{className:"w-[100px] truncate",children:l.dependsOn?h.jsx(mn,{variant:"ghost",children:l.dependsOn}):h.jsx("span",{className:"text-neutral-600",children:"—"})}),h.jsx("span",{className:"w-[70px] text-right text-neutral-500 truncate",children:l.chunkTtl})]},`${l.table}:${f}`))]})});Gj.displayName="HandlersTable";const Y8={flow:"bg-flow",healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",relay:"bg-relay",muted:"bg-neutral-500"},Zj=_.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(X8,{item:i,showDivider:a>0},i.label))}));Zj.displayName="KpiStrip";function X8({item:e,showDivider:t}){const n=Y8[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 Yj=_.forwardRef(({className:e,buckets:t,successRate:n=99.6,successLabel:s="success",...i},a)=>{const l=n/100*88,f=88-l;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:`${l} ${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})]})]})]})});Yj.displayName="LatencyPercentilesBar";const Q8={PUSH:"syncing",PULL:"healthy",ACK:"flow"},Xj=_.forwardRef(({className:e,entries:t,isConnected:n=!0,maxVisible:s=20,maxHeight:i,...a},l)=>{const f=t.slice(0,s);return h.jsxs("div",{ref:l,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(mn,{variant:Q8[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}`))})]})});Xj.displayName="LiveActivityFeed";const W8={syncing:"bg-syncing",flow:"bg-flow",healthy:"bg-healthy",offline:"bg-offline"},Ep=_.forwardRef(({className:e,title:t,description:n,dotColor:s="syncing",stats:i,actionLabel:a,actionVariant:l="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",W8[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(Oe,{variant:l,size:"md",onClick:d,children:[f,a]})]})]}));Ep.displayName="MaintenanceCard";function J8({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Zb,{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(Yb,{className:s,children:t})]})}const Qj=_.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(Oe,{variant:"default",size:"sm",onClick:n,children:"Reset defaults"})]}),h.jsx("div",{className:"p-4 space-y-4",children:t.map((a,l)=>h.jsx(eV,{row:a,showDivider:l>0},a.label))})]}));Qj.displayName="PreferencesPanel";function eV({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(wp,{checked:e.checked,onCheckedChange:n=>e.onCheckedChange(n)})]})})]})}function Wb({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Zb,{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(Yb,{className:s,children:t})]})}const tV={commit:"text-flow",push:"text-syncing",pull:"text-healthy"},nV={applied:"text-healthy",error:"text-offline",cached:"text-syncing"},Wj=_.forwardRef(({className:e,entries:t,filterBar:n,pagination:s,onEntryClick:i,selectedEntryId:a,...l},f)=>h.jsxs("div",{ref:f,className:ge("h-full flex flex-col",e),...l,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(rV,{entry:d,isSelected:a===d.id,onClick:i},`${d.id}-${p}`))}),s]}));Wj.displayName="StreamLog";function rV({entry:e,isSelected:t,onClick:n}){const s=tV[e.type]??"text-neutral-500",i=nV[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]"),l=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:l}):h.jsx("div",{className:a,children:l})}function sV(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const Jj=_.forwardRef(({className:e,clients:t,headSeq:n,maxLag:s,minSeq:i,...a},l)=>{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:l,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=sV(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"})]})]})]})]})});Jj.displayName="SyncHorizon";function oV(e){const t=_.useRef(!0);t.current&&(t.current=!1,e())}const iV=_.createContext(void 0);function Jb(e){const t=_.useContext(iV);if(t===void 0)throw new Error(yn(72));return t}const aV=[];function ex(e){_.useEffect(e,aV)}const iu=0;class ai{static create(){return new ai}currentId=iu;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=iu,n()},t)}isStarted(){return this.currentId!==iu}clear=()=>{this.currentId!==iu&&(clearTimeout(this.currentId),this.currentId=iu)};disposeEffect=()=>this.clear}function rs(){const e=zn(ai.create).current;return ex(e.disposeEffect),e}function Jo(e){const t=zn(cV,e).current;return t.next=e,Le(t.effect),t}function cV(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Rt(e){return e?.ownerDocument||document}const ol=typeof navigator<"u",Ay=fV(),eA=hV(),tA=dV(),tx=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),nA=Ay.platform==="MacIntel"&&Ay.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Ay.platform),lV=ol&&/apple/i.test(navigator.vendor),Iv=ol&&/android/i.test(eA)||/android/i.test(tA);ol&&eA.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const uV=tA.includes("jsdom/");function fV(){if(!ol)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 dV(){if(!ol)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function hV(){if(!ol)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Pv="data-base-ui-focusable",rA="active",sA="selected",oA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ky="ArrowLeft",Oy="ArrowRight",pV="ArrowUp",mV="ArrowDown";function Bo(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Ot(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Av(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function gV(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(Ot(s,n))return!s.hasAttribute("data-trigger-disabled");return!1}function Ur(e){return"composedPath"in e?e.composedPath()[0]:e.target}function es(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 yV(e){return e.matches("html,body")}function iA(e){return Zt(e)&&e.matches(oA)}function iC(e){return e?e.getAttribute("role")==="combobox"&&iA(e):!1}function Fh(e){return e?e.hasAttribute(Pv)?e:e.querySelector(`[${Pv}]`)||e:null}function Sc(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...Sc(e,i.id,n)])}function aC(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 Ki(e){e.preventDefault(),e.stopPropagation()}function vV(e){return"nativeEvent"in e}function bV(e){return e.pointerType===""&&e.isTrusted?!0:Iv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function xV(e){return uV?!1:!Iv&&e.width===0&&e.height===0||Iv&&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 SV(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function _V(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const wV=["top","right","bottom","left"],Uc=Math.min,dr=Math.max,Hh=Math.round,pc=Math.floor,xs=e=>({x:e,y:e}),EV={left:"right",right:"left",bottom:"top",top:"bottom"},TV={start:"end",end:"start"};function Dv(e,t,n){return dr(e,Uc(t,n))}function io(e,t){return typeof e=="function"?e(t):e}function Zn(e){return e.split("-")[0]}function Si(e){return e.split("-")[1]}function nx(e){return e==="x"?"y":"x"}function rx(e){return e==="y"?"height":"width"}const CV=new Set(["top","bottom"]);function Fr(e){return CV.has(Zn(e))?"y":"x"}function sx(e){return nx(Fr(e))}function RV(e,t,n){n===void 0&&(n=!1);const s=Si(e),i=sx(e),a=rx(i);let l=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=qh(l)),[l,qh(l)]}function NV(e){const t=qh(e);return[zv(e),t,zv(t)]}function zv(e){return e.replace(/start|end/g,t=>TV[t])}const cC=["left","right"],lC=["right","left"],jV=["top","bottom"],AV=["bottom","top"];function kV(e,t,n){switch(e){case"top":case"bottom":return n?t?lC:cC:t?cC:lC;case"left":case"right":return t?jV:AV;default:return[]}}function OV(e,t,n,s){const i=Si(e);let a=kV(Zn(e),n==="start",s);return i&&(a=a.map(l=>l+"-"+i),t&&(a=a.concat(a.map(zv)))),a}function qh(e){return e.replace(/left|right|bottom|top/g,t=>EV[t])}function MV(e){return{top:0,right:0,bottom:0,left:0,...e}}function aA(e){return typeof e!="number"?MV(e):{top:e,right:e,bottom:e,left:e}}function Vh(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 zd(e,t,n){return Math.floor(e/t)!==n}function ch(e,t){return t<0||t>=e.current.length}function IV(e,t){return fr(e,{disabledIndices:t})}function PV(e,t){return fr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function fr(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&&pu(e,a,s));return a}function DV(e,{event:t,orientation:n,loopFocus:s,rtl:i,cols:a,disabledIndices:l,minIndex:f,maxIndex:d,prevIndex:p,stopEvent:g=!1}){let y=p;const b=[],x={};let S=!1;{let C=null,O=-1;e.current.forEach((N,R)=>{if(N==null)return;const M=N.closest('[role="row"]');M&&(S=!0),(M!==C||O===-1)&&(C=M,O+=1,b[O]=[]),b[O].push(R),x[R]=O})}const w=S&&b.length>0&&b.some(C=>C.length!==a);function T(C){if(!w||p===-1)return;const O=x[p];if(O==null)return;const N=b[O].indexOf(p);let R=C==="up"?O-1:O+1;s&&(R<0?R=b.length-1:R>=b.length&&(R=0));const M=new Set;for(;R>=0&&R<b.length&&!M.has(R);){M.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 A=j;A>=0;A-=1){const P=L[A];if(!pu(e,P,l))return P}R=C==="up"?R-1:R+1,s&&(R<0?R=b.length-1:R>=b.length&&(R=0))}}if(t.key===pV){const C=T("up");if(C!==void 0)g&&Ki(t),y=C;else{if(g&&Ki(t),p===-1)y=d;else if(y=fr(e,{startingIndex:y,amount:a,decrement:!0,disabledIndices:l}),s&&(p-a<f||y<0)){const O=p%a,N=d%a,R=d-(N-O);N===O?y=d:y=N>O?R:R-a}ch(e,y)&&(y=p)}}if(t.key===mV){const C=T("down");C!==void 0?(g&&Ki(t),y=C):(g&&Ki(t),p===-1?y=f:(y=fr(e,{startingIndex:p,amount:a,disabledIndices:l}),s&&p+a>d&&(y=fr(e,{startingIndex:p%a-a,amount:a,disabledIndices:l}))),ch(e,y)&&(y=p))}if(n==="both"){const C=pc(p/a);t.key===(i?ky:Oy)&&(g&&Ki(t),p%a!==a-1?(y=fr(e,{startingIndex:p,disabledIndices:l}),s&&zd(y,a,C)&&(y=fr(e,{startingIndex:p-p%a-1,disabledIndices:l}))):s&&(y=fr(e,{startingIndex:p-p%a-1,disabledIndices:l})),zd(y,a,C)&&(y=p)),t.key===(i?Oy:ky)&&(g&&Ki(t),p%a!==0?(y=fr(e,{startingIndex:p,decrement:!0,disabledIndices:l}),s&&zd(y,a,C)&&(y=fr(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:l}))):s&&(y=fr(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:l})),zd(y,a,C)&&(y=p));const O=pc(d/a)===C;ch(e,y)&&(s&&O?y=t.key===(i?Oy:ky)?d:fr(e,{startingIndex:p-p%a-1,disabledIndices:l}):y=p)}return y}function zV(e,t,n){const s=[];let i=0;return e.forEach(({width:a,height:l},f)=>{let d=!1;for(n&&(i=0);!d;){const p=[];for(let g=0;g<a;g+=1)for(let y=0;y<l;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 LV(e,t,n,s,i){if(e===-1)return-1;const a=n.indexOf(e),l=t[e];switch(i){case"tl":return a;case"tr":return l?a+l.width-1:a;case"bl":return l?a+(l.height-1)*s:a;case"br":return n.lastIndexOf(e);default:return-1}}function UV(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function pu(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 $V=["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] *)"],Kh=$V.join(","),cA=typeof Element>"u",$c=cA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gh=!cA&&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},Zh=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",l=a||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Zh(t.parentNode));return l},BV=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},lA=function(t,n,s){if(Zh(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Kh));return n&&$c.call(t,Kh)&&i.unshift(t),i=i.filter(s),i},Yh=function(t,n,s){for(var i=[],a=Array.from(t);a.length;){var l=a.shift();if(!Zh(l,!1))if(l.tagName==="SLOT"){var f=l.assignedElements(),d=f.length?f:l.children,p=Yh(d,!0,s);s.flatten?i.push.apply(i,p):i.push({scopeParent:l,candidates:p})}else{var g=$c.call(l,Kh);g&&s.filter(l)&&(n||!t.includes(l))&&i.push(l);var y=l.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(l),b=!Zh(y,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(l));if(y&&b){var x=Yh(y===!0?l.children:y.children,!0,s);s.flatten?i.push.apply(i,x):i.push({scopeParent:l,candidates:x})}else a.unshift.apply(a,l.children)}}return i},uA=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},fA=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||BV(t))&&!uA(t)?0:t.tabIndex},FV=function(t,n){var s=fA(t);return s<0&&n&&!uA(t)?0:s},HV=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},dA=function(t){return t.tagName==="INPUT"},qV=function(t){return dA(t)&&t.type==="hidden"},VV=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},KV=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},GV=function(t){if(!t.name)return!0;var n=t.form||Gh(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(l){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",l.message),!1}var a=KV(i,t.form);return!a||a===t},ZV=function(t){return dA(t)&&t.type==="radio"},YV=function(t){return ZV(t)&&!GV(t)},XV=function(t){var n,s=t&&Gh(t),i=(n=s)===null||n===void 0?void 0:n.host,a=!1;if(s&&s!==t){var l,f,d;for(a=!!((l=i)!==null&&l!==void 0&&(f=l.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=Gh(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},uC=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},QV=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 l=$c.call(t,"details>summary:first-of-type"),f=l?t.parentElement:t;if($c.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=Gh(t);if(p&&!p.shadowRoot&&i(p)===!0)return uC(t);t.assignedSlot?t=t.assignedSlot:!p&&g!==t.ownerDocument?t=g.host:t=p}t=d}if(XV(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return uC(t);return!1},WV=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 $c.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Lv=function(t,n){return!(n.disabled||qV(n)||QV(n,t)||VV(n)||WV(n))},Uv=function(t,n){return!(YV(n)||fA(n)<0||!Lv(t,n))},JV=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},hA=function(t){var n=[],s=[];return t.forEach(function(i,a){var l=!!i.scopeParent,f=l?i.scopeParent:i,d=FV(f,l),p=l?hA(i.candidates):f;d===0?l?n.push.apply(n,p):n.push(f):s.push({documentOrder:a,tabIndex:d,item:i,isScope:l,content:p})}),s.sort(HV).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},Tp=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Yh([t],n.includeContainer,{filter:Uv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:JV}):s=lA(t,n.includeContainer,Uv.bind(null,n)),hA(s)},eK=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Yh([t],n.includeContainer,{filter:Lv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=lA(t,n.includeContainer,Lv.bind(null,n)),s},pA=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return $c.call(t,Kh)===!1?!1:Uv(n,t)};const Qu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function mA(e,t){const n=Tp(e,Qu()),s=n.length;if(s===0)return;const i=Bo(Rt(e)),a=n.indexOf(i),l=a===-1?t===1?0:s-1:a+t;return n[l]}function gA(e){return mA(Rt(e).body,1)||e}function yA(e){return mA(Rt(e).body,-1)||e}function mu(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Ot(n,s)}function tK(e){Tp(e,Qu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function fC(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 nK(){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 rK=_.createContext(null),sK=_.createContext(null),Cp=()=>_.useContext(rK)?.id||null,Rp=e=>{const t=_.useContext(sK);return e??t};function Nu(e){return`data-base-ui-${e}`}const Ld=null;class oK{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 Ud=new oK;class ys{static create(){return new ys}static request(t){return Ud.request(t)}static cancel(t){return Ud.cancel(t)}currentId=Ld;request(t){this.cancel(),this.currentId=Ud.request(()=>{this.currentId=Ld,t()})}cancel=()=>{this.currentId!==Ld&&(Ud.cancel(this.currentId),this.currentId=Ld)};disposeEffect=()=>this.cancel}function ox(){const e=zn(ys.create).current;return ex(e.disposeEffect),e}const Xh=_.forwardRef(function(t,n){const[s,i]=_.useState();Le(()=>{lV&&i("button")},[]);const a={tabIndex:0,role:s};return h.jsx("span",{...t,ref:n,style:yp,"aria-hidden":s?void 0:!0,...a,"data-base-ui-focus-guard":""})});let dC=0;function My(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:i=!1}=t;s&&cancelAnimationFrame(dC);const a=()=>e?.focus({preventScroll:n});i?a():dC=requestAnimationFrame(a)}const _c={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function hC(e){return e==="inert"?_c.inert:e==="aria-hidden"?_c["aria-hidden"]:_c.none}let $d=new WeakSet,Bd={},Iy=0;const vA=e=>e&&(e.host||vA(e.parentNode)),iK=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=vA(n);return e.contains(s)?s:null}).filter(n=>n!=null);function aK(e,t,n,s){const i="data-base-ui-inert",a=s?"inert":n?"aria-hidden":null,l=iK(t,e),f=new Set,d=new Set(l),p=[];Bd[i]||(Bd[i]=new WeakMap);const g=Bd[i];l.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(yi(S)!=="script")if(f.has(S))b(S);else{const w=a?S.getAttribute(a):null,T=w!==null&&w!=="false",C=hC(a),O=(C.get(S)||0)+1,N=(g.get(S)||0)+1;C.set(S,O),g.set(S,N),p.push(S),O===1&&T&&$d.add(S),N===1&&S.setAttribute(i,""),!T&&a&&S.setAttribute(a,a==="inert"?"":"true")}})}return Iy+=1,()=>{p.forEach(x=>{const S=hC(a),T=(S.get(x)||0)-1,C=(g.get(x)||0)-1;S.set(x,T),g.set(x,C),T||(!$d.has(x)&&a&&x.removeAttribute(a),$d.delete(x)),C||x.removeAttribute(i)}),Iy-=1,Iy||(_c.inert=new WeakMap,_c["aria-hidden"]=new WeakMap,_c.none=new WeakMap,$d=new WeakSet,Bd={})}}function cK(e,t=!1,n=!1){const s=Rt(e[0]).body;return aK(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const bA=_.createContext(null),xA=()=>_.useContext(bA),lK=Nu("portal");function SA(e={}){const{ref:t,container:n,componentProps:s=an,elementProps:i}=e,a=Xu(),f=xA()?.portalNode,[d,p]=_.useState(null),[g,y]=_.useState(null),b=Ae(T=>{T!==null&&y(T)}),x=_.useRef(null);Le(()=>{if(n===null){x.current&&(x.current=null,y(null),p(null));return}if(a==null)return;const T=(n&&(Kb(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=zt("div",s,{ref:[t,b],props:[{id:a,[lK]:""},i]});return{portalNode:g,portalSubtree:d&&S?hi.createPortal(S,d):null}}const _A=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,renderGuards:f,...d}=t,{portalNode:p,portalSubtree:g}=SA({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,O=w?.open,N=typeof f=="boolean"?f:!!w&&!w.modal&&w.open&&!!p;_.useEffect(()=>{if(!p||C)return;function M(L){p&&L.relatedTarget&&mu(L)&&(L.type==="focusin"?fC:tK)(p)}return p.addEventListener("focusin",M,!0),p.addEventListener("focusout",M,!0),()=>{p.removeEventListener("focusin",M,!0),p.removeEventListener("focusout",M,!0)}},[p,C]),_.useEffect(()=>{!p||O||fC(p)},[O,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(bA.Provider,{value:R,children:[N&&p&&h.jsx(Xh,{"data-type":"outside",ref:y,onFocus:M=>{if(mu(M,p))x.current?.focus();else{const L=w?w.domReference:null;yA(L)?.focus()}}}),N&&p&&h.jsx("span",{"aria-owns":p.id,style:Q9}),p&&hi.createPortal(s,p),N&&p&&h.jsx(Xh,{"data-type":"outside",ref:b,onFocus:M=>{if(mu(M,p))S.current?.focus();else{const L=w?w.domReference:null;gA(L)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Yt(zj,M.nativeEvent))}}})]})]})});function qs(e){return e==null?e:"current"in e?e.current:e}function uK(e,t){const n=un(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 pC=20;let qo=[];function ix(){qo=qo.filter(e=>e.deref()?.isConnected)}function fK(e){ix(),e&&yi(e)!=="body"&&(qo.push(new WeakRef(e)),qo.length>pC&&(qo=qo.slice(-pC)))}function Py(){return ix(),qo[qo.length-1]?.deref()}function dK(e){if(!e)return null;const t=Qu();return pA(e,t)?e:Tp(e,t)[0]||e}function hK(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():xr(e).display!=="none"}function mC(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Qu(),i=eK(e,n).filter(l=>{const f=l.getAttribute("data-tabindex")||"";return pA(l,n)||l.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 wA(e){const{context:t,children:n,disabled:s=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:l=!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:O,dataRef:N}=S.context,R=Ae(()=>N.current.floatingContext?.nodeId),M=i===!1,L=iC(T)&&M,j=_.useRef(["content"]),A=Jo(i),P=Jo(a),Z=Jo(p),B=Rp(x),z=xA(),Q=_.useRef(null),Y=_.useRef(null),ee=_.useRef(!1),D=_.useRef(!1),V=_.useRef(!1),q=_.useRef(-1),K=_.useRef(""),U=_.useRef(""),I=_.useRef(null),H=_.useRef(null),W=so(I,b,z?.beforeInsideRef),X=so(H,z?.afterInsideRef),oe=rs(),se=rs(),pe=ox(),xe=z!=null,de=Fh(C),Me=Ae((he=de)=>he?Tp(he,Qu()):[]),_e=Ae(he=>{const ae=Me(he);return j.current.map(()=>ae).filter(Boolean).flat()});_.useEffect(()=>{if(s||!f)return;function he(we){we.key==="Tab"&&Ot(de,Bo(Rt(de)))&&Me().length===0&&!L&&Ki(we)}const ae=Rt(de);return ae.addEventListener("keydown",he),()=>{ae.removeEventListener("keydown",he)}},[s,T,de,f,j,L,Me,_e]),_.useEffect(()=>{if(s||!w)return;const he=Rt(de);function ae(){V.current=!1}function we(Se){const ye=Ur(Se),Ue=Ot(C,ye)||Ot(T,ye)||Ot(z?.portalNode,ye);V.current=!Ue,U.current=Se.pointerType||"keyboard",ye?.closest(`[${Z9}]`)&&(D.current=!0)}function ve(){U.current="keyboard"}return he.addEventListener("pointerdown",we,!0),he.addEventListener("pointerup",ae,!0),he.addEventListener("pointercancel",ae,!0),he.addEventListener("keydown",ve,!0),()=>{he.removeEventListener("pointerdown",we,!0),he.removeEventListener("pointerup",ae,!0),he.removeEventListener("pointercancel",ae,!0),he.removeEventListener("keydown",ve,!0)}},[s,C,T,de,w,z]),_.useEffect(()=>{if(s||!d)return;const he=Rt(de);function ae(){D.current=!0,se.start(0,()=>{D.current=!1})}function we(Ie){const Ee=Ur(Ie),Xe=Me().indexOf(Ee);Xe!==-1&&(q.current=Xe)}function ve(Ie){const Ee=Ie.relatedTarget,Ve=Ie.currentTarget,Xe=Ur(Ie);queueMicrotask(()=>{const Be=R(),We=S.context.triggerElements,He=Ee?.hasAttribute(Nu("focus-guard"))&&[I.current,H.current,z?.beforeInsideRef.current,z?.afterInsideRef.current,z?.beforeOutsideRef.current,z?.afterOutsideRef.current,qs(y),qs(g)].includes(Ee),me=!(Ot(T,Ee)||Ot(C,Ee)||Ot(Ee,C)||Ot(z?.portalNode,Ee)||Ee!=null&&We.hasElement(Ee)||We.hasMatchingElement(Te=>Ot(Te,Ee))||He||B&&(Sc(B.nodesRef.current,Be).find(Te=>Ot(Te.context?.elements.floating,Ee)||Ot(Te.context?.elements.domReference,Ee))||aC(B.nodesRef.current,Be).find(Te=>[Te.context?.elements.floating,Fh(Te.context?.elements.floating)].includes(Ee)||Te.context?.elements.domReference===Ee)));if(Ve===T&&de&&mC(de,j),l&&Ve!==T&&!hK(Xe)&&Bo(he)===he.body){if(Zt(de)&&(de.focus(),l==="popup")){pe.request(()=>{de.focus()});return}const Te=q.current,qe=Me(),mt=qe[Te]||qe[qe.length-1]||de;Zt(mt)&&mt.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(L||!f)&&Ee&&me&&!D.current&&(L||Ee!==Py())&&(ee.current=!0,S.setOpen(!1,Yt(zj,Ie)))})}function Se(){V.current||(N.current.insideReactTree=!0,oe.start(0,()=>{N.current.insideReactTree=!1}))}const ye=Zt(T)?T:null,Ue=[];if(!(!C&&!ye))return ye&&(ye.addEventListener("focusout",ve),ye.addEventListener("pointerdown",ae),Ue.push(()=>{ye.removeEventListener("focusout",ve),ye.removeEventListener("pointerdown",ae)})),C&&(C.addEventListener("focusin",we),C.addEventListener("focusout",ve),z&&(C.addEventListener("focusout",Se,!0),Ue.push(()=>{C.removeEventListener("focusout",Se,!0)})),Ue.push(()=>{C.removeEventListener("focusin",we),C.removeEventListener("focusout",ve)})),()=>{Ue.forEach(Ie=>{Ie()})}},[s,T,C,de,f,B,z,S,d,l,Me,L,R,j,N,oe,se,pe,g,y]),_.useEffect(()=>{if(s||!C||!w)return;const he=Array.from(z?.portalNode?.querySelectorAll(`[${Nu("portal")}]`)||[]),we=(B?aC(B.nodesRef.current,R()):[]).find(Se=>iC(Se.context?.elements.domReference||null))?.context?.elements.domReference,ve=[C,we,...he,Q.current,Y.current,I.current,H.current,z?.beforeOutsideRef.current,z?.afterOutsideRef.current,qs(y),qs(g),L?T:null].filter(Se=>Se!=null);return cK(ve,f||L)},[w,s,T,C,f,j,z,L,B,R,g,y]),Le(()=>{if(!w||s||!Zt(de))return;const he=Rt(de),ae=Bo(he);queueMicrotask(()=>{const we=_e(de),ve=A.current,Se=typeof ve=="function"?ve(Z.current||""):ve;if(Se===void 0||Se===!1)return;let ye;Se===!0||Se===null?ye=we[0]||de:ye=qs(Se),ye=ye||we[0]||de,!Ot(de,ae)&&My(ye,{preventScroll:ye===de})})},[s,w,de,M,_e,A,Z]),Le(()=>{if(s||!de)return;const he=Rt(de),ae=Bo(he);fK(ae);function we(ye){if(ye.open||(K.current=uK(ye.nativeEvent,U.current)),ye.reason===Mv&&ye.nativeEvent.type==="mouseleave"&&(ee.current=!0),ye.reason===Dj)if(ye.nested)ee.current=!1;else if(bV(ye.nativeEvent)||xV(ye.nativeEvent))ee.current=!1;else{let Ue=!1;document.createElement("div").focus({get preventScroll(){return Ue=!0,!1}}),Ue?ee.current=!1:ee.current=!0}}O.on("openchange",we);const ve=he.createElement("span");ve.setAttribute("tabindex","-1"),ve.setAttribute("aria-hidden","true"),Object.assign(ve.style,yp),xe&&T&&T.insertAdjacentElement("afterend",ve);function Se(){const ye=P.current;let Ue=typeof ye=="function"?ye(K.current):ye;if(Ue===void 0||Ue===!1)return null;if(Ue===null&&(Ue=!0),typeof Ue=="boolean"){const Ee=T||Py();return Ee&&Ee.isConnected?Ee:ve}const Ie=T||Py()||ve;return qs(Ue)||Ie}return()=>{O.off("openchange",we);const ye=Bo(he),Ue=Ot(C,ye)||B&&Sc(B.nodesRef.current,R(),!1).some(Ee=>Ot(Ee.context?.elements.floating,ye)),Ie=Se();queueMicrotask(()=>{const Ee=dK(Ie),Ve=typeof P.current!="boolean";P.current&&!ee.current&&Zt(Ee)&&(!(!Ve&&Ee!==ye&&ye!==he.body)||Ue)&&Ee.focus({preventScroll:!0}),ve.remove(),ee.current=!1})}},[s,C,de,P,N,O,B,xe,T,R]),Le(()=>{if(!tx||w||!C)return;const he=Bo(Rt(C));!Zt(he)||!iA(he)||Ot(C,he)&&he.blur()},[w,C]),Le(()=>{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]),Le(()=>{if(!(s||!de))return mC(de,j),()=>{queueMicrotask(ix)}},[s,de,j]);const ne=!s&&(f?!L:!0)&&(xe||f);return h.jsxs(_.Fragment,{children:[ne&&h.jsx(Xh,{"data-type":"inside",ref:W,onFocus:he=>{if(f){const ae=_e();My(ae[ae.length-1])}else z?.portalNode&&(ee.current=!1,mu(he,z.portalNode)?gA(T)?.focus():qs(y??z.beforeOutsideRef)?.focus())}}),n,ne&&h.jsx(Xh,{"data-type":"inside",ref:X,onFocus:he=>{f?My(_e()[0]):z?.portalNode&&(d&&(ee.current=!0),mu(he,z.portalNode)?yA(T)?.focus():qs(g??z.afterOutsideRef)?.focus())}})]})}function gC(e,t,n){let{reference:s,floating:i}=e;const a=Fr(t),l=sx(t),f=rx(l),d=Zn(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(Si(t)){case"start":x[l]-=b*(n&&p?-1:1);break;case"end":x[l]+=b*(n&&p?-1:1);break}return x}async function pK(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:a,rects:l,elements:f,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:b=!1,padding:x=0}=io(t,e),S=aA(x),T=f[b?y==="floating"?"reference":"floating":y],C=Vh(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})),O=y==="floating"?{x:s,y:i,width:l.floating.width,height:l.floating.height}:l.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},M=Vh(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:O,offsetParent:N,strategy:d}):O);return{top:(C.top-M.top+S.top)/R.y,bottom:(M.bottom-C.bottom+S.bottom)/R.y,left:(C.left-M.left+S.left)/R.x,right:(M.right-C.right+S.right)/R.x}}const mK=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:a=[],platform:l}=n,f=a.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y}=gC(p,s,d),b=s,x={},S=0;for(let T=0;T<f.length;T++){var w;const{name:C,fn:O}=f[T],{x:N,y:R,data:M,reset:L}=await O({x:g,y,initialPlacement:s,placement:b,strategy:i,middlewareData:x,rects:p,platform:{...l,detectOverflow:(w=l.detectOverflow)!=null?w:pK},elements:{reference:e,floating:t}});g=N??g,y=R??y,x={...x,[C]:{...x[C],...M}},L&&S<=50&&(S++,typeof L=="object"&&(L.placement&&(b=L.placement),L.rects&&(p=L.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):L.rects),{x:g,y}=gC(p,b,d)),T=-1)}return{x:g,y,placement:b,strategy:i,middlewareData:x}},gK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:i,middlewareData:a,rects:l,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}=io(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const C=Zn(i),O=Fr(f),N=Zn(f)===f,R=await(d.isRTL==null?void 0:d.isRTL(p.floating)),M=b||(N||!w?[qh(f)]:NV(f)),L=S!=="none";!b&&L&&M.push(...OV(f,w,S,R));const j=[f,...M],A=await d.detectOverflow(t,T),P=[];let Z=((s=a.flip)==null?void 0:s.overflows)||[];if(g&&P.push(A[C]),y){const Y=RV(i,l,R);P.push(A[Y[0]],A[Y[1]])}if(Z=[...Z,{placement:i,overflows:P}],!P.every(Y=>Y<=0)){var B,z;const Y=(((B=a.flip)==null?void 0:B.index)||0)+1,ee=j[Y];if(ee&&(!(y==="alignment"?O!==Fr(ee):!1)||Z.every(q=>Fr(q.placement)===O?q.overflows[0]>0:!0)))return{data:{index:Y,overflows:Z},reset:{placement:ee}};let D=(z=Z.filter(V=>V.overflows[0]<=0).sort((V,q)=>V.overflows[1]-q.overflows[1])[0])==null?void 0:z.placement;if(!D)switch(x){case"bestFit":{var Q;const V=(Q=Z.filter(q=>{if(L){const K=Fr(q.placement);return K===O||K==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(K=>K>0).reduce((K,U)=>K+U,0)]).sort((q,K)=>q[1]-K[1])[0])==null?void 0:Q[0];V&&(D=V);break}case"initialPlacement":D=f;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function yC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vC(e){return wV.some(t=>e[t]>=0)}const yK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...a}=io(e,t);switch(i){case"referenceHidden":{const l=await s.detectOverflow(t,{...a,elementContext:"reference"}),f=yC(l,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:vC(f)}}}case"escaped":{const l=await s.detectOverflow(t,{...a,altBoundary:!0}),f=yC(l,n.floating);return{data:{escapedOffsets:f,escaped:vC(f)}}}default:return{}}}}},EA=new Set(["left","top"]);async function vK(e,t){const{placement:n,platform:s,elements:i}=e,a=await(s.isRTL==null?void 0:s.isRTL(i.floating)),l=Zn(n),f=Si(n),d=Fr(n)==="y",p=EA.has(l)?-1:1,g=a&&d?-1:1,y=io(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 bK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:i,y:a,placement:l,middlewareData:f}=t,d=await vK(t,e);return l===((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:l}}}}},xK=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:l=!0,crossAxis:f=!1,limiter:d={fn:C=>{let{x:O,y:N}=C;return{x:O,y:N}}},...p}=io(e,t),g={x:n,y:s},y=await a.detectOverflow(t,p),b=Fr(Zn(i)),x=nx(b);let S=g[x],w=g[b];if(l){const C=x==="y"?"top":"left",O=x==="y"?"bottom":"right",N=S+y[C],R=S-y[O];S=Dv(N,S,R)}if(f){const C=b==="y"?"top":"left",O=b==="y"?"bottom":"right",N=w+y[C],R=w-y[O];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]:l,[b]:f}}}}}},SK=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:i,rects:a,middlewareData:l}=t,{offset:f=0,mainAxis:d=!0,crossAxis:p=!0}=io(e,t),g={x:n,y:s},y=Fr(i),b=nx(y);let x=g[b],S=g[y];const w=io(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,M=a.reference[b]+a.reference[N]-T.mainAxis;x<R?x=R:x>M&&(x=M)}if(p){var C,O;const N=b==="y"?"width":"height",R=EA.has(Zn(i)),M=a.reference[y]-a.floating[N]+(R&&((C=l.offset)==null?void 0:C[y])||0)+(R?0:T.crossAxis),L=a.reference[y]+a.reference[N]+(R?0:((O=l.offset)==null?void 0:O[y])||0)-(R?T.crossAxis:0);S<M?S=M:S>L&&(S=L)}return{[b]:x,[y]:S}}}},_K=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:a,platform:l,elements:f}=t,{apply:d=()=>{},...p}=io(e,t),g=await l.detectOverflow(t,p),y=Zn(i),b=Si(i),x=Fr(i)==="y",{width:S,height:w}=a.floating;let T,C;y==="top"||y==="bottom"?(T=y,C=b===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(C=y,T=b==="end"?"top":"bottom");const O=w-g.top-g.bottom,N=S-g.left-g.right,R=Uc(w-g[T],O),M=Uc(S-g[C],N),L=!t.middlewareData.shift;let j=R,A=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(j=O),L&&!b){const Z=dr(g.left,0),B=dr(g.right,0),z=dr(g.top,0),Q=dr(g.bottom,0);x?A=S-2*(Z!==0||B!==0?Z+B:dr(g.left,g.right)):j=w-2*(z!==0||Q!==0?z+Q:dr(g.top,g.bottom))}await d({...t,availableWidth:A,availableHeight:j});const P=await l.getDimensions(f.floating);return S!==P.width||w!==P.height?{reset:{rects:!0}}:{}}}};function TA(e){const t=xr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=Zt(e),a=i?e.offsetWidth:n,l=i?e.offsetHeight:s,f=Hh(n)!==a||Hh(s)!==l;return f&&(n=a,s=l),{width:n,height:s,$:f}}function ax(e){return jt(e)?e:e.contextElement}function wc(e){const t=ax(e);if(!Zt(t))return xs(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:a}=TA(t);let l=(a?Hh(n.width):n.width)/s,f=(a?Hh(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const wK=xs(0);function CA(e){const t=un(e);return!xp()||!t.visualViewport?wK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function EK(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==un(e)?!1:t}function da(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=ax(e);let l=xs(1);t&&(s?jt(s)&&(l=wc(s)):l=wc(e));const f=EK(a,n,s)?CA(a):xs(0);let d=(i.left+f.x)/l.x,p=(i.top+f.y)/l.y,g=i.width/l.x,y=i.height/l.y;if(a){const b=un(a),x=s&&jt(s)?un(s):s;let S=b,w=kv(S);for(;w&&s&&x!==S;){const T=wc(w),C=w.getBoundingClientRect(),O=xr(w),N=C.left+(w.clientLeft+parseFloat(O.paddingLeft))*T.x,R=C.top+(w.clientTop+parseFloat(O.paddingTop))*T.y;d*=T.x,p*=T.y,g*=T.x,y*=T.y,d+=N,p+=R,S=un(w),w=kv(S)}}return Vh({width:g,height:y,x:d,y:p})}function Np(e,t){const n=Sp(e).scrollLeft;return t?t.left+n:da(_s(e)).left+n}function RA(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-Np(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function TK(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const a=i==="fixed",l=_s(s),f=t?bp(t.floating):!1;if(s===l||f&&a)return n;let d={scrollLeft:0,scrollTop:0},p=xs(1);const g=xs(0),y=Zt(s);if((y||!y&&!a)&&((yi(s)!=="body"||vi(l))&&(d=Sp(s)),Zt(s))){const x=da(s);p=wc(s),g.x=x.x+s.clientLeft,g.y=x.y+s.clientTop}const b=l&&!y&&!a?RA(l,d):xs(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 CK(e){return Array.from(e.getClientRects())}function RK(e){const t=_s(e),n=Sp(e),s=e.ownerDocument.body,i=dr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),a=dr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let l=-n.scrollLeft+Np(e);const f=-n.scrollTop;return xr(s).direction==="rtl"&&(l+=dr(t.clientWidth,s.clientWidth)-i),{width:i,height:a,x:l,y:f}}const bC=25;function NK(e,t){const n=un(e),s=_s(e),i=n.visualViewport;let a=s.clientWidth,l=s.clientHeight,f=0,d=0;if(i){a=i.width,l=i.height;const g=xp();(!g||g&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const p=Np(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<=bC&&(a-=S)}else p<=bC&&(a+=p);return{width:a,height:l,x:f,y:d}}const jK=new Set(["absolute","fixed"]);function AK(e,t){const n=da(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zt(e)?wc(e):xs(1),l=e.clientWidth*a.x,f=e.clientHeight*a.y,d=i*a.x,p=s*a.y;return{width:l,height:f,x:d,y:p}}function xC(e,t,n){let s;if(t==="viewport")s=NK(e,n);else if(t==="document")s=RK(_s(e));else if(jt(t))s=AK(t,n);else{const i=CA(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Vh(s)}function NA(e,t){const n=oo(e);return n===t||!jt(n)||Ys(n)?!1:xr(n).position==="fixed"||NA(n,t)}function kK(e,t){const n=t.get(e);if(n)return n;let s=Wo(e,[],!1).filter(f=>jt(f)&&yi(f)!=="body"),i=null;const a=xr(e).position==="fixed";let l=a?oo(e):e;for(;jt(l)&&!Ys(l);){const f=xr(l),d=Gb(l);!d&&f.position==="fixed"&&(i=null),(a?!d&&!i:!d&&f.position==="static"&&!!i&&jK.has(i.position)||vi(l)&&!d&&NA(e,l))?s=s.filter(g=>g!==l):i=f,l=oo(l)}return t.set(e,s),s}function OK(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const l=[...n==="clippingAncestors"?bp(t)?[]:kK(t,this._c):[].concat(n),s],f=l[0],d=l.reduce((p,g)=>{const y=xC(t,g,i);return p.top=dr(y.top,p.top),p.right=Uc(y.right,p.right),p.bottom=Uc(y.bottom,p.bottom),p.left=dr(y.left,p.left),p},xC(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function MK(e){const{width:t,height:n}=TA(e);return{width:t,height:n}}function IK(e,t,n){const s=Zt(t),i=_s(t),a=n==="fixed",l=da(e,!0,a,t);let f={scrollLeft:0,scrollTop:0};const d=xs(0);function p(){d.x=Np(i)}if(s||!s&&!a)if((yi(t)!=="body"||vi(i))&&(f=Sp(t)),s){const x=da(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?RA(i,f):xs(0),y=l.left+f.scrollLeft-d.x-g.x,b=l.top+f.scrollTop-d.y-g.y;return{x:y,y:b,width:l.width,height:l.height}}function Dy(e){return xr(e).position==="static"}function SC(e,t){if(!Zt(e)||xr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _s(e)===n&&(n=n.ownerDocument.body),n}function jA(e,t){const n=un(e);if(bp(e))return n;if(!Zt(e)){let i=oo(e);for(;i&&!Ys(i);){if(jt(i)&&!Dy(i))return i;i=oo(i)}return n}let s=SC(e,t);for(;s&&i8(s)&&Dy(s);)s=SC(s,t);return s&&Ys(s)&&Dy(s)&&!Gb(s)?n:s||f8(e)||n}const PK=async function(e){const t=this.getOffsetParent||jA,n=this.getDimensions,s=await n(e.floating);return{reference:IK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function DK(e){return xr(e).direction==="rtl"}const zK={convertOffsetParentRelativeRectToViewportRelativeRect:TK,getDocumentElement:_s,getClippingRect:OK,getOffsetParent:jA,getElementRects:PK,getClientRects:CK,getDimensions:MK,getScale:wc,isElement:jt,isRTL:DK};function AA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function LK(e,t){let n=null,s;const i=_s(e);function a(){var f;clearTimeout(s),(f=n)==null||f.disconnect(),n=null}function l(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=pc(y),w=pc(i.clientWidth-(g+b)),T=pc(i.clientHeight-(y+x)),C=pc(g),N={rootMargin:-S+"px "+-w+"px "+-T+"px "+-C+"px",threshold:dr(0,Uc(1,d))||1};let R=!0;function M(L){const j=L[0].intersectionRatio;if(j!==d){if(!R)return l();j?l(!1,j):s=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!AA(p,e.getBoundingClientRect())&&l(),R=!1}try{n=new IntersectionObserver(M,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(M,N)}n.observe(e)}return l(!0),a}function _C(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=s,p=ax(e),g=i||a?[...p?Wo(p):[],...Wo(t)]:[];g.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),a&&C.addEventListener("resize",n)});const y=p&&f?LK(p,n):null;let b=-1,x=null;l&&(x=new ResizeObserver(C=>{let[O]=C;O&&O.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?da(e):null;d&&T();function T(){const C=da(e);w&&!AA(w,C)&&n(),w=C,S=requestAnimationFrame(T)}return n(),()=>{var C;g.forEach(O=>{i&&O.removeEventListener("scroll",n),a&&O.removeEventListener("resize",n)}),y?.(),(C=x)==null||C.disconnect(),x=null,d&&cancelAnimationFrame(S)}}const UK=bK,$K=xK,BK=gK,FK=_K,HK=yK,qK=SK,VK=(e,t,n)=>{const s=new Map,i={platform:zK,...n},a={...i.platform,_c:s};return mK(e,t,{...i,platform:a})};var KK=typeof document<"u",GK=function(){},lh=KK?_.useLayoutEffect:GK;function Qh(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(!Qh(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)&&!Qh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function kA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wC(e,t){const n=kA(e);return Math.round(t*n)/n}function zy(e){const t=_.useRef(e);return lh(()=>{t.current=e}),t}function ZK(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:a,floating:l}={},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);Qh(b,s)||x(s);const[S,w]=_.useState(null),[T,C]=_.useState(null),O=_.useCallback(q=>{q!==L.current&&(L.current=q,w(q))},[]),N=_.useCallback(q=>{q!==j.current&&(j.current=q,C(q))},[]),R=a||S,M=l||T,L=_.useRef(null),j=_.useRef(null),A=_.useRef(g),P=d!=null,Z=zy(d),B=zy(i),z=zy(p),Q=_.useCallback(()=>{if(!L.current||!j.current)return;const q={placement:t,strategy:n,middleware:b};B.current&&(q.platform=B.current),VK(L.current,j.current,q).then(K=>{const U={...K,isPositioned:z.current!==!1};Y.current&&!Qh(A.current,U)&&(A.current=U,hi.flushSync(()=>{y(U)}))})},[b,t,n,B,z]);lh(()=>{p===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,y(q=>({...q,isPositioned:!1})))},[p]);const Y=_.useRef(!1);lh(()=>(Y.current=!0,()=>{Y.current=!1}),[]),lh(()=>{if(R&&(L.current=R),M&&(j.current=M),R&&M){if(Z.current)return Z.current(R,M,Q);Q()}},[R,M,Q,Z,P]);const ee=_.useMemo(()=>({reference:L,floating:j,setReference:O,setFloating:N}),[O,N]),D=_.useMemo(()=>({reference:R,floating:M}),[R,M]),V=_.useMemo(()=>{const q={position:n,left:0,top:0};if(!D.floating)return q;const K=wC(D.floating,g.x),U=wC(D.floating,g.y);return f?{...q,transform:"translate("+K+"px, "+U+"px)",...kA(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:U}},[n,f,D.floating,g.x,g.y]);return _.useMemo(()=>({...g,update:Q,refs:ee,elements:D,floatingStyles:V}),[g,Q,ee,D,V])}const YK=(e,t)=>({...UK(e),options:[e,t]}),XK=(e,t)=>({...$K(e),options:[e,t]}),QK=(e,t)=>({...qK(e),options:[e,t]}),WK=(e,t)=>({...BK(e),options:[e,t]}),JK=(e,t)=>({...FK(e),options:[e,t]}),e7=(e,t)=>({...HK(e),options:[e,t]}),t7={intentional:"onClick",sloppy:"onPointerDown"};function n7(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function r7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("referenceElement"),l=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,O=Rp(C),N=Ae(typeof y=="function"?y:()=>!1),R=typeof y=="function"?N:y,M=_.useRef(!1),{escapeKey:L,outsidePress:j}=n7(T),A=_.useRef(null),P=rs(),Z=rs(),B=Ae(()=>{Z.clear(),d.current.insideReactTree=!1}),z=_.useRef(!1),Q=_.useRef(""),Y=Ae(ne=>{Q.current=ne.pointerType}),ee=Ae(()=>{const ne=Q.current,he=ne==="pen"||!ne?"mouse":ne,ae=typeof b=="function"?b():b;return typeof ae=="string"?ae:ae[he]}),D=Ae(ne=>{if(!s||!p||!g||ne.key!=="Escape"||z.current)return;const he=d.current.floatingContext?.nodeId,ae=O?Sc(O.nodesRef.current,he):[];if(!L&&ae.length>0){let Se=!0;if(ae.forEach(ye=>{ye.context?.open&&!ye.context.dataRef.current.__escapeKeyBubbles&&(Se=!1)}),!Se)return}const we=vV(ne)?ne.nativeEvent:ne,ve=Yt(y8,we);n.setOpen(!1,ve),!L&&!ve.isPropagationAllowed&&ne.stopPropagation()}),V=Ae(ne=>{const he=ee();return he==="intentional"&&ne.type!=="click"||he==="sloppy"&&ne.type==="click"}),q=Ae(()=>{d.current.insideReactTree=!0,Z.start(0,B)}),K=Ae((ne,he=!1)=>{if(V(ne)){B();return}if(d.current.insideReactTree){B();return}if(ee()==="intentional"&&he||typeof R=="function"&&!R(ne))return;const ae=Ur(ne),we=`[${Nu("inert")}]`,ve=Rt(n.select("floatingElement")).querySelectorAll(we),Se=n.context.triggerElements;if(ae&&(Se.hasElement(ae)||Se.hasMatchingElement(Ve=>Ot(Ve,ae))))return;let ye=jt(ae)?ae:null;for(;ye&&!Ys(ye);){const Ve=oo(ye);if(Ys(Ve)||!jt(Ve))break;ye=Ve}if(ve.length&&jt(ae)&&!yV(ae)&&!Ot(ae,n.select("floatingElement"))&&Array.from(ve).every(Ve=>!Ot(ye,Ve)))return;if(Zt(ae)&&!("touches"in ne)){const Ve=Ys(ae),Xe=xr(ae),Be=/auto|scroll/,We=Ve||Be.test(Xe.overflowX),He=Ve||Be.test(Xe.overflowY),me=We&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,Te=He&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,qe=Xe.direction==="rtl",mt=Te&&(qe?ne.offsetX<=ae.offsetWidth-ae.clientWidth:ne.offsetX>ae.clientWidth),lt=me&&ne.offsetY>ae.clientHeight;if(mt||lt)return}const Ue=d.current.floatingContext?.nodeId,Ie=O&&Sc(O.nodesRef.current,Ue).some(Ve=>es(ne,Ve.context?.elements.floating));if(es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||Ie)return;const Ee=O?Sc(O.nodesRef.current,Ue):[];if(Ee.length>0){let Ve=!0;if(Ee.forEach(Xe=>{Xe.context?.open&&!Xe.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}n.setOpen(!1,Yt(Dj,ne)),B()}),U=Ae(ne=>{ee()!=="sloppy"||ne.pointerType==="touch"||!n.select("open")||!p||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||K(ne)}),I=Ae(ne=>{if(ee()!=="sloppy"||!n.select("open")||!p||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement")))return;const he=ne.touches[0];he&&(A.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}),H=Ae(ne=>{const he=Ur(ne);function ae(){I(ne),he?.removeEventListener(ne.type,ae)}he?.addEventListener(ne.type,ae)}),W=Ae(ne=>{const he=M.current;if(M.current=!1,P.clear(),ne.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const ae=Ur(ne);function we(){ne.type==="pointerdown"?U(ne):K(ne,he),ae?.removeEventListener(ne.type,we)}ae?.addEventListener(ne.type,we)}),X=Ae(ne=>{if(ee()!=="sloppy"||!A.current||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement")))return;const he=ne.touches[0];if(!he)return;const ae=Math.abs(he.clientX-A.current.startX),we=Math.abs(he.clientY-A.current.startY),ve=Math.sqrt(ae*ae+we*we);ve>5&&(A.current.dismissOnTouchEnd=!0),ve>10&&(K(ne),P.clear(),A.current=null)}),oe=Ae(ne=>{const he=Ur(ne);function ae(){X(ne),he?.removeEventListener(ne.type,ae)}he?.addEventListener(ne.type,ae)}),se=Ae(ne=>{ee()!=="sloppy"||!A.current||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&K(ne),P.clear(),A.current=null)}),pe=Ae(ne=>{const he=Ur(ne);function ae(){se(ne),he?.removeEventListener(ne.type,ae)}he?.addEventListener(ne.type,ae)});_.useEffect(()=>{if(!s||!p)return;d.current.__escapeKeyBubbles=L,d.current.__outsidePressBubbles=j;const ne=new ai;function he(ye){n.setOpen(!1,Yt(ii,ye))}function ae(){ne.clear(),z.current=!0}function we(){ne.start(xp()?5:0,()=>{z.current=!1})}const ve=Rt(i);ve.addEventListener("pointerdown",Y,!0),g&&(ve.addEventListener("keydown",D),ve.addEventListener("compositionstart",ae),ve.addEventListener("compositionend",we)),R&&(ve.addEventListener("click",W,!0),ve.addEventListener("pointerdown",W,!0),ve.addEventListener("touchstart",H,!0),ve.addEventListener("touchmove",oe,!0),ve.addEventListener("touchend",pe,!0),ve.addEventListener("mousedown",W,!0));let Se=[];return w&&(jt(l)&&(Se=Wo(l)),jt(i)&&(Se=Se.concat(Wo(i))),!jt(a)&&a&&a.contextElement&&(Se=Se.concat(Wo(a.contextElement)))),Se=Se.filter(ye=>ye!==ve.defaultView?.visualViewport),Se.forEach(ye=>{ye.addEventListener("scroll",he,{passive:!0})}),()=>{ve.removeEventListener("pointerdown",Y,!0),g&&(ve.removeEventListener("keydown",D),ve.removeEventListener("compositionstart",ae),ve.removeEventListener("compositionend",we)),R&&(ve.removeEventListener("click",W,!0),ve.removeEventListener("pointerdown",W,!0),ve.removeEventListener("touchstart",H,!0),ve.removeEventListener("touchmove",oe,!0),ve.removeEventListener("touchend",pe,!0),ve.removeEventListener("mousedown",W,!0)),Se.forEach(ye=>{ye.removeEventListener("scroll",he)}),ne.clear(),M.current=!1}},[d,i,a,l,g,R,s,f,w,p,L,j,D,K,W,U,H,oe,pe,Y,n]),_.useEffect(B,[R,B]);const xe=_.useMemo(()=>({onKeyDown:D,...x&&{[t7[S]]:ne=>{n.setOpen(!1,Yt(sC,ne.nativeEvent))},...S!=="intentional"&&{onClick(ne){n.setOpen(!1,Yt(sC,ne.nativeEvent))}}}}),[D,n,x,S]),de=Ae(ne=>{const he=Ur(ne.nativeEvent);!Ot(n.select("floatingElement"),he)||ne.button!==0||(M.current=!0)}),Me=Ae(ne=>{!s||!p||ne.button!==0||(M.current=!0)}),_e=_.useMemo(()=>({onKeyDown:D,onPointerDown:de,onMouseDown:de,onMouseUp:de,onClickCapture:q,onMouseDownCapture(ne){q(),Me(ne)},onPointerDownCapture(ne){q(),Me(ne)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[D,de,q,Me]);return _.useMemo(()=>p?{reference:xe,floating:_e,trigger:xe}:{},[p,xe,_e])}tj({memoize:uq,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Pe=(e,t,n,s,i,a,...l)=>{if(l.length>0)throw new Error(yn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var s7=qN();const o7=Vb(19),i7=o7?c7:l7;function at(e,t,n,s,i){return i7(e,t,n,s,i)}function a7(e,t,n,s,i){const a=_.useCallback(()=>t(e.getSnapshot(),n,s,i),[e,t,n,s,i]);return s7.useSyncExternalStore(e.subscribe,a,a)}function c7(e,t,n,s,i){return a7(e,t,n,s,i)}function l7(e,t,n,s,i){return VN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,s,i))}class u7{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 OA extends u7{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}useSyncedValue(t,n){_.useDebugValue(t),Le(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const s=this;Le(()=>(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);Le(()=>{n.update(t)},[n,...s])}useControlledProp(t,n){_.useDebugValue(t);const s=n!==void 0;Le(()=>{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??jn);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 l=s(a);if(!Object.is(i,l)){const f=i;i=l,n(l,f,this)}})}}const f7={open:Pe(e=>e.open),domReferenceElement:Pe(e=>e.domReferenceElement),referenceElement:Pe(e=>e.positionReference??e.referenceElement),floatingElement:Pe(e=>e.floatingElement),floatingId:Pe(e=>e.floatingId)};class cx extends OA{constructor(t){const{nested:n,noEmit:s,onOpenChange:i,triggerElements:a,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:nK(),nested:n,noEmit:s,triggerElements:a},f7)}setOpen=(t,n)=>{if((!t||!this.state.open||_V(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 jp(e,t=!1,n=!1){const[s,i]=_.useState(e&&t?"idle":void 0),[a,l]=_.useState(e);return e&&!a&&(l(!0),i("starting")),!e&&a&&s!=="ending"&&!n&&i("ending"),!e&&!a&&s==="ending"&&i(void 0),Le(()=>{if(!e&&a&&s!=="ending"&&n){const f=ys.request(()=>{i("ending")});return()=>{ys.cancel(f)}}},[e,a,s,n]),Le(()=>{if(!e||t)return;const f=ys.request(()=>{i(void 0)});return()=>{ys.cancel(f)}},[t,e]),Le(()=>{if(!e||!t)return;e&&a&&s!=="idle"&&i("starting");const f=ys.request(()=>{i("idle")});return()=>{ys.cancel(f)}},[t,e,a,i,s]),_.useMemo(()=>({mounted:a,setMounted:l,transitionStatus:s}),[a,s])}let ju=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const d7={[ju.startingStyle]:""},h7={[ju.endingStyle]:""},ba={transitionStatus(e){return e==="starting"?d7:e==="ending"?h7:null}};function p7(e,t=!1,n=!0){const s=ox();return Ae((i,a=null)=>{s.cancel();function l(){hi.flushSync(i)}const f=qs(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=ju.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||l()}).catch(()=>{const x=d.getAnimations();if(n){if(a?.aborted)return;l()}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 xa(e){const{enabled:t=!0,open:n,ref:s,onComplete:i}=e,a=Ae(i),l=p7(s,n,!1);_.useEffect(()=>{if(!t)return;const f=new AbortController;return l(a,f.signal),()=>{f.abort()}},[t,n,a,l])}function m7(e){const t=e.useState("open");Le(()=>{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 g7(e,t,n){const{mounted:s,setMounted:i,transitionStatus:a}=jp(e);t.useSyncedValues({mounted:s,transitionStatus:a});const l=Ae(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),f=t.useState("preventUnmountingOnClose");return xa({enabled:!f,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:a}}class lx{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 y7(){return new cx({open:!1,floatingElement:null,referenceElement:null,triggerElements:new lx,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function v7(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:y7(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:an,inactiveTriggerProps:an,popupProps:an}}const Fd=Pe(e=>e.triggerIdProp??e.activeTriggerId),b7={open:Pe(e=>e.openProp??e.open),mounted:Pe(e=>e.mounted),transitionStatus:Pe(e=>e.transitionStatus),floatingRootContext:Pe(e=>e.floatingRootContext),preventUnmountingOnClose:Pe(e=>e.preventUnmountingOnClose),payload:Pe(e=>e.payload),activeTriggerId:Fd,activeTriggerElement:Pe(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Pe((e,t)=>t!==void 0&&Fd(e)===t),isOpenedByTrigger:Pe((e,t)=>t!==void 0&&Fd(e)===t&&e.open),isMountedByTrigger:Pe((e,t)=>t!==void 0&&Fd(e)===t&&e.mounted),triggerProps:Pe((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Pe(e=>e.popupProps),popupElement:Pe(e=>e.popupElement),positionerElement:Pe(e=>e.positionerElement)};function x7(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,i=Xu(),a=Cp()!=null,l=zn(()=>new cx({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:new lx,floatingId:i,nested:a,noEmit:!1})).current;return Le(()=>{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),l.update(f)},[t,i,s.reference,s.floating,l]),l.context.onOpenChange=n,l.context.nested=a,l.context.noEmit=!1,l}function S7(e={}){const{nodeId:t,externalTree:n}=e,s=x7(e),i=e.rootContext||s,a={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[l,f]=_.useState(null),d=_.useRef(null),p=Rp(n);Le(()=>{a.domReference&&(d.current=a.domReference)},[a.domReference]);const g=ZK({...e,elements:{...a,...l&&{reference:l}}}),y=_.useCallback(j=>{const A=jt(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;f(A),g.refs.setReference(A)},[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]),O=_.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"),M=i.useState("floatingId"),L=_.useMemo(()=>({...g,dataRef:i.context.dataRef,open:R,onOpenChange:i.setOpen,events:i.context.events,floatingId:M,refs:O,elements:N,nodeId:t,rootStore:i}),[g,O,N,t,i,R,M]);return Le(()=>{i.context.dataRef.current.floatingContext=L;const j=p?.nodesRef.current.find(A=>A.id===t);j&&(j.context=L)}),_.useMemo(()=>({...g,context:L,refs:O,elements:N,rootStore:i}),[g,O,N,L,i])}function _7(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:i}=e,a=Xu(),l=Cp()!=null,f=t.useState("open"),d=t.useState("activeTriggerElement"),p=t.useState(s?"popupElement":"positionerElement"),g=t.context.triggerElements,y=zn(()=>new cx({open:f,referenceElement:d,floatingElement:p,triggerElements:g,onOpenChange:i,floatingId:a,nested:l,noEmit:n})).current;return Le(()=>{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=l,y.context.noEmit=n,y}const EC=Nu("safe-polygon"),w7=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${oA}`;function E7(e){return e?!!e.closest(w7):!1}class ux{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 ai,this.restTimeout=new ai,this.handleCloseOptions=void 0}static create(){return new ux}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function T7(e){const t=zn(ux.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),ex(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const C7=new Set(["click","mousedown"]);function R7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:f=!0,closeDelay:d=0}=t,p=T7(n),g=Rp(),y=Cp(),b=Ae(()=>p.interactedInside?!0:l.current.openEvent?C7.has(l.current.openEvent.type):!1),x=Ae(()=>{const N=l.current.openEvent?.type;return N?.includes("mouse")&&N!=="mousedown"}),S=Ae(N=>gV(N,n.context.triggerElements)),w=_.useCallback((N,R=!0)=>{const M=N7(d,p.pointerType);M&&!p.handler?p.openChangeTimeout.start(M,()=>n.setOpen(!1,Yt(Mv,N))):R&&(p.openChangeTimeout.clear(),n.setOpen(!1,Yt(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(EC),p.performedPointerEventsMutation=!1}}),O=Ae(N=>{const R=Ur(N);if(!E7(R)){p.interactedInside=!1;return}p.interactedInside=!0});Le(()=>{s||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,T(),C())},[s,p,T,C]),_.useEffect(()=>()=>{T()},[T]),_.useEffect(()=>C,[C]),Le(()=>{if(f&&s&&p.handleCloseOptions?.blockPointerEvents&&x()&&jt(a)&&i){p.performedPointerEventsMutation=!0;const N=Rt(i).body;N.setAttribute(EC,"");const R=a,M=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",M.style.pointerEvents="auto",()=>{N.style.pointerEvents="",R.style.pointerEvents="",M.style.pointerEvents=""}}},[f,s,a,i,p,x,g,y]),_.useEffect(()=>{if(!f)return;function N(j){b()||!l.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 M(j){b()||w(j,!1)}const L=i;return L&&(L.addEventListener("mouseleave",N),L.addEventListener("mouseenter",R),L.addEventListener("mouseleave",M),L.addEventListener("pointerdown",O,!0)),()=>{L&&(L.removeEventListener("mouseleave",N),L.removeEventListener("mouseenter",R),L.removeEventListener("mouseleave",M),L.removeEventListener("pointerdown",O,!0))}},[f,i,n,l,b,S,w,C,T,O,p])}function N7(e,t){return t&&!SV(t)?0:typeof e=="function"?e():e}function j7(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=>Hd(p,e,"reference"),t),l=_.useCallback(p=>Hd(p,e,"floating"),n),f=_.useCallback(p=>Hd(p,e,"item"),s),d=_.useCallback(p=>Hd(p,e,"trigger"),i);return _.useMemo(()=>({getReferenceProps:a,getFloatingProps:l,getItemProps:f,getTriggerProps:d}),[a,l,f,d])}function Hd(e,t,n){const s=new Map,i=n==="item",a={};n==="floating"&&(a.tabIndex=-1,a[Pv]="");for(const l in e)i&&e&&(l===rA||l===sA)||(a[l]=e[l]);for(let l=0;l<t.length;l+=1){let f;const d=t[l]?.[n];typeof d=="function"?f=e?d(e):null:f=d,f&&TC(a,f,i,s)}return TC(a,e,i,s),a}function TC(e,t,n,s){for(const i in t){const a=t[i];n&&(i===rA||i===sA)||(i.startsWith("on")?(s.has(i)||s.set(i,[]),typeof a=="function"&&(s.get(i)?.push(a),e[i]=(...l)=>s.get(i)?.map(f=>f(...l)).find(f=>f!==void 0))):e[i]=a)}}const A7=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function k7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingId"),a=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:f="dialog"}=t,d=Xu(),p=a?.id||d,g=_.useMemo(()=>Fh(l)?.id||i,[l,i]),y=A7.get(f)??f,x=Cp()!=null,S=_.useMemo(()=>y==="tooltip"||f==="label"?an:{"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 O={id:g,...y&&{role:y}};return y==="tooltip"||f==="label"?O:{...O,...y==="menu"&&{"aria-labelledby":p}}},[y,g,p,f]),C=_.useCallback(({active:O,selected:N})=>{const R={role:"option",...O&&{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 Qi=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ju.startingStyle]="startingStyle",e[e.endingStyle=ju.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),CC=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const O7={[CC.popupOpen]:"",[CC.pressed]:""},M7={[Qi.open]:""},I7={[Qi.closed]:""},P7={[Qi.anchorHidden]:""},D7={open(e){return e?O7:null}},il={open(e){return e?M7:I7},anchorHidden(e){return e?P7:null}},MA=_.createContext(void 0);function z7(){const e=_.useContext(MA);if(e===void 0)throw new Error(yn(70));return e}const L7=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,...f}=t,{portalNode:d,portalSubtree:p}=SA({container:i,ref:n,componentProps:t,elementProps:f});return!p&&!d?null:h.jsxs(_.Fragment,{children:[p,d&&hi.createPortal(s,d)]})}),U7=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t;return Jb().useState("mounted")||s?h.jsx(MA.Provider,{value:s,children:h.jsx(L7,{ref:n,...i})}):null}),IA=_.createContext(void 0);function $7(){const e=_.useContext(IA);if(e===void 0)throw new Error(yn(71));return e}const B7=_.createContext(void 0);function PA(){return _.useContext(B7)?.direction??"ltr"}const F7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:i,rects:a,platform:l,elements:f,middlewareData:d}=t,{element:p,padding:g=0,offsetParent:y="real"}=io(e,t)||{};if(p==null)return{};const b=aA(g),x={x:n,y:s},S=sx(i),w=rx(S),T=await l.getDimensions(p),C=S==="y",O=C?"top":"left",N=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=a.reference[w]+a.reference[S]-x[S]-a.floating[w],L=x[S]-a.reference[S],j=y==="real"?await l.getOffsetParent?.(p):f.floating;let A=f.floating[R]||a.floating[w];(!A||!await l.isElement?.(j))&&(A=f.floating[R]||a.floating[w]);const P=M/2-L/2,Z=A/2-T[w]/2-1,B=Math.min(b[O],Z),z=Math.min(b[N],Z),Q=B,Y=A-T[w]-z,ee=A/2-T[w]/2+P,D=Dv(Q,ee,Y),V=!d.arrow&&Si(i)!=null&&ee!==D&&a.reference[w]/2-(ee<Q?B:z)-T[w]/2<0,q=V?ee<Q?ee-Q:ee-Y:0;return{[S]:x[S]+q,data:{[S]:D,centerOffset:ee-D-q,...V&&{alignmentOffset:q}},reset:V}}}),H7=(e,t)=>({...F7(e),options:[e,t]}),q7={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 e7().fn(e)).data?.referenceHidden||a}}}},uh={sideX:"left",sideY:"top"},V7={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:s},elements:{floating:i},platform:a,strategy:l,placement:f}=e,d=un(i),p=d.getComputedStyle(i);if(!(p.transitionDuration!=="0s"&&p.transitionDuration!==""))return{x:t,y:n,data:uh};const y=await a.getOffsetParent?.(i);let b={width:0,height:0};if(l==="fixed"&&d?.visualViewport)b={width:d.visualViewport.width,height:d.visualViewport.height};else if(y===d){const O=Rt(i);b={width:O.documentElement.clientWidth,height:O.documentElement.clientHeight}}else await a.isElement?.(y)&&(b=await a.getDimensions(y));const x=Zn(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":uh.sideX,C=x==="top"?"bottom":uh.sideY;return{x:S,y:w,data:{sideX:T,sideY:C}}}};function DA(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 RC(e,t,n){const{rects:s,placement:i}=e;return{side:DA(t,Zn(i),n),align:Si(i)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function zA(e){const{anchor:t,positionMethod:n="absolute",side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:l=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:O,lazyFlip:N=!1,externalTree:R}=e,[M,L]=_.useState(null);!S&&M!==null&&L(null);const j=w.side||"flip",A=w.align||"flip",P=w.fallbackAxisSide||"end",Z=typeof t=="function"?t:void 0,B=Ae(Z),z=Z?B:t,Q=Jo(t),ee=PA()==="rtl",D=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ee?"left":"right","inline-start":ee?"right":"left"}[s],V=a==="center"?D:`${D}-${a}`;let q=d;const K=1,U=s==="bottom"?K:0,I=s==="top"?K:0,H=s==="right"?K:0,W=s==="left"?K:0;typeof q=="number"?q={top:q+U,right:q+W,bottom:q+I,left:q+H}:q&&(q={top:(q.top||0)+U,right:(q.right||0)+W,bottom:(q.bottom||0)+I,left:(q.left||0)+H});const X={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:q},oe=_.useRef(null),se=Jo(i),pe=Jo(l),Me=[YK(ot=>{const Wt=RC(ot,s,ee),vn=typeof se.current=="function"?se.current(Wt):se.current,kt=typeof pe.current=="function"?pe.current(Wt):pe.current;return{mainAxis:vn,crossAxis:kt,alignmentAxis:kt}},[typeof i!="function"?i:0,typeof l!="function"?l:0,ee,s])],_e=A==="none"&&j!=="shift",ne=!_e&&(p||T||j==="shift"),he=j==="none"?null:WK({...X,padding:{top:q.top+K,right:q.right+K,bottom:q.bottom+K,left:q.left+K},mainAxis:!T&&j==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:P}),ae=_e?null:XK(ot=>{const Wt=Rt(ot.elements.floating).documentElement;return{...X,rootBoundary:T?{x:0,y:0,width:Wt.clientWidth,height:Wt.clientHeight}:void 0,mainAxis:A!=="none",crossAxis:ne,limiter:p||T?void 0:QK(vn=>{if(!oe.current)return{};const{width:kt,height:Cn}=oe.current.getBoundingClientRect(),er=Fr(Zn(vn.placement)),An=er==="y"?kt:Cn,as=er==="y"?q.left+q.right:q.top+q.bottom;return{offset:An/2+as/2}})}},[X,p,T,q,A]);j==="shift"||A==="shift"||a==="center"?Me.push(ae,he):Me.push(he,ae),Me.push(JK({...X,apply({elements:{floating:ot},rects:{reference:Wt},availableWidth:vn,availableHeight:kt}){const Cn=ot.style;Cn.setProperty("--available-width",`${vn}px`),Cn.setProperty("--available-height",`${kt}px`),Cn.setProperty("--anchor-width",`${Wt.width}px`),Cn.setProperty("--anchor-height",`${Wt.height}px`)}}),H7(()=>({element:oe.current||document.createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(ot){const{elements:Wt,middlewareData:vn,placement:kt,rects:Cn,y:er}=ot,An=Zn(kt),as=Fr(An),cs=oe.current,_a=vn.arrow?.x||0,wi=vn.arrow?.y||0,Ei=cs?.clientWidth||0,ws=cs?.clientHeight||0,tr=_a+Ei/2,ls=wi+ws/2,uo=Math.abs(vn.shift?.y||0),fo=Cn.reference.height/2,nr=typeof i=="function"?i(RC(ot,s,ee)):i,cl=uo>nr,af={top:`${tr}px calc(100% + ${nr}px)`,bottom:`${tr}px ${-nr}px`,left:`calc(100% + ${nr}px) ${ls}px`,right:`${-nr}px ${ls}px`}[An],cf=`${tr}px ${Cn.reference.y+fo-er}px`;return Wt.floating.style.setProperty("--transform-origin",ne&&as==="y"&&cl?cf:af),{}}},q7,O),Le(()=>{!S&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[S,x]);const we=_.useMemo(()=>({elementResize:!y&&typeof ResizeObserver<"u",layoutShift:!y&&typeof IntersectionObserver<"u"}),[y]),{refs:ve,elements:Se,x:ye,y:Ue,middlewareData:Ie,update:Ee,placement:Ve,context:Xe,isPositioned:Be,floatingStyles:We}=S7({rootContext:x,placement:V,middleware:Me,strategy:n,whileElementsMounted:b?void 0:(...ot)=>_C(...ot,we),nodeId:C,externalTree:R}),{sideX:He,sideY:me}=Ie.adaptiveOrigin||uh,Te=Be?n:"fixed",qe=_.useMemo(()=>{const ot=O?{position:Te,[He]:ye,[me]:Ue}:{position:Te,...We};return Be||(ot.opacity=0),ot},[O,Te,He,ye,me,Ue,We,Be]),mt=_.useRef(null);Le(()=>{if(!S)return;const ot=Q.current,Wt=typeof ot=="function"?ot():ot,kt=(NC(Wt)?Wt.current:Wt)||null||null;kt!==mt.current&&(ve.setPositionReference(kt),mt.current=kt)},[S,ve,z,Q]),_.useEffect(()=>{if(!S)return;const ot=Q.current;typeof ot!="function"&&NC(ot)&&ot.current!==mt.current&&(ve.setPositionReference(ot.current),mt.current=ot.current)},[S,ve,z,Q]),_.useEffect(()=>{if(b&&S&&Se.domReference&&Se.floating)return _C(Se.domReference,Se.floating,Ee,we)},[b,S,Se,Ee,we]);const lt=Zn(Ve),wr=DA(s,lt,ee),Er=Si(Ve)||"center",Qt=!!Ie.hide?.referenceHidden;Le(()=>{N&&S&&Be&&L(lt)},[N,S,Be,lt]);const ut=_.useMemo(()=>({position:"absolute",top:Ie.arrow?.y,left:Ie.arrow?.x}),[Ie.arrow]),xt=Ie.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:qe,arrowStyles:ut,arrowRef:oe,arrowUncentered:xt,side:wr,align:Er,physicalSide:lt,anchorHidden:Qt,refs:ve,context:Xe,isPositioned:Be,update:Ee}),[qe,ut,oe,xt,wr,Er,lt,Qt,ve,Xe,Be,Ee])}function NC(e){return e!=null&&"current"in e}function Ap(e){return e==="starting"?G9:an}const K7=_.forwardRef(function(t,n){const{render:s,className:i,anchor:a,positionMethod:l="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=X9,...C}=t,O=Jb(),N=z7(),R=O.useState("open"),M=O.useState("mounted"),L=O.useState("trackCursorAxis"),j=O.useState("disableHoverablePopup"),A=O.useState("floatingRootContext"),P=O.useState("instantType"),Z=O.useState("transitionStatus"),B=O.useState("hasViewport"),z=zA({anchor:a,positionMethod:l,floatingRootContext:A,mounted:M,side:f,sideOffset:p,align:d,alignOffset:g,collisionBoundary:y,collisionPadding:b,sticky:S,arrowPadding:x,disableAnchorTracking:w,keepMounted:N,collisionAvoidance:T,adaptiveOrigin:B?V7:void 0}),Q=_.useMemo(()=>{const V={};return(!R||L==="both"||j)&&(V.pointerEvents="none"),{role:"presentation",hidden:!M,style:{...z.positionerStyles,...V}}},[R,L,j,M,z.positionerStyles]),Y=_.useMemo(()=>({open:R,side:z.side,align:z.align,anchorHidden:z.anchorHidden,instant:L!=="none"?"tracking-cursor":P}),[R,z.side,z.align,z.anchorHidden,L,P]),ee=_.useMemo(()=>({...Y,arrowRef:z.arrowRef,arrowStyles:z.arrowStyles,arrowUncentered:z.arrowUncentered}),[Y,z.arrowRef,z.arrowStyles,z.arrowUncentered]),D=zt("div",t,{state:Y,props:[Q,Ap(Z),C],ref:[n,O.useStateSetter("positionerElement")],stateAttributesMapping:il});return h.jsx(IA.Provider,{value:ee,children:D})}),G7={...il,...ba},Z7=_.forwardRef(function(t,n){const{className:s,render:i,...a}=t,l=Jb(),{side:f,align:d}=$7(),p=l.useState("open"),g=l.useState("instantType"),y=l.useState("transitionStatus"),b=l.useState("popupProps"),x=l.useState("floatingRootContext");xa({open:p,ref:l.context.popupRef,onComplete(){p&&l.context.onOpenChangeComplete?.(!0)}});const S=l.useState("disabled"),w=l.useState("closeDelay");return R7(x,{enabled:!S,closeDelay:w}),zt("div",t,{state:{open:p,side:f,align:d,instant:g,transitionStatus:y},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[b,Ap(y),a],stateAttributesMapping:G7})});function fx(e){return Vb(19)?e:e?"true":void 0}const Y7=_.forwardRef(({className:e,sideOffset:t=4,children:n,...s},i)=>h.jsx(U7,{children:h.jsx(K7,{sideOffset:t,children:h.jsx(Z7,{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})})}));Y7.displayName="TooltipContent";function jC(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const LA=_.forwardRef(({className:e,clients:t,positions:n,relayClientIds:s=[],serverPosition:i={x:420,y:190},relayPosition:a={x:780,y:190},viewBox:l={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,A)=>{const P=s.includes(j.id),Z=P?S:b,B=P?w:x,z=P?240:260,Q=P?130:150,Y=C*A-Math.PI/2;T[j.id]={x:Z+z*Math.cos(Y),y:B+Q*Math.sin(Y)}});const O={};if(n)for(const j of n)O[j.clientId]={x:j.x,y:j.y};function N(j){return O[j]??T[j]??{x:600,y:190}}const R=f??t.length+2,M=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:[M," 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 ${l.width} ${l.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 A=N(j.id),P=s.includes(j.id),Z=P?S:b,B=P?w:x,z=jC(j.status),Q=j.status==="syncing"?2.5:1.5;if(j.status==="offline")return h.jsx("line",{x1:Z,y1:B,x2:A.x,y2:A.y,stroke:z,strokeWidth:1,strokeDasharray:"3 6",opacity:.2},`line-${j.id}`);const Y=j.status==="syncing"?"1.2s":"2.8s",ee=`${Number.parseFloat(Y)/2}s`;return h.jsxs("g",{children:[h.jsx("line",{x1:Z,y1:B,x2:A.x,y2:A.y,stroke:z,strokeWidth:Q,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${Z},${B} L${A.x},${A.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:ee,repeatCount:"indefinite",path:`M${A.x},${A.y} L${Z},${B}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.5;0.5;0",dur:Y,begin:ee,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 A=N(j.id),P=jC(j.status),Z=j.status==="offline"?.25:1,B=j.actor.replace("user-","").replace("svc-",""),z=s.includes(j.id);return h.jsxs("g",{opacity:Z,children:[h.jsx("circle",{cx:A.x,cy:A.y,r:20,fill:"#0c0c0c",stroke:P,strokeWidth:1.5}),h.jsx("circle",{cx:A.x,cy:A.y,r:5,fill:P}),h.jsx("text",{x:A.x,y:A.y+32,textAnchor:"middle",fill:"#555",fontFamily:"JetBrains Mono, monospace",fontSize:9,children:B}),h.jsxs("text",{x:A.x,y:A.y+42,textAnchor:"middle",fill:"#333",fontFamily:"JetBrains Mono, monospace",fontSize:7,children:[j.type,z?" · relay":""]})]},`node-${j.id}`)})]})]})});LA.displayName="TopologyHero";let AC=(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 UA(e){return _.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[AC.checked]:""}:{[AC.unchecked]:""}},...bi}),[e.indeterminate])}const X7=_.createContext({disabled:!1});function Q7(){return _.useContext(X7)}const W7=_.createContext(void 0);function J7(e=!0){const t=_.useContext(W7);if(t===void 0&&!e)throw new Error(yn(3));return t}const $A=_.createContext(void 0);function eG(){const e=_.useContext($A);if(e===void 0)throw new Error(yn(14));return e}const tG="data-parent",nG=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a=!1,disabled:l=!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:O=!1,...N}=t,{clearErrors:R}=tl(),{disabled:M,name:L,setDirty:j,setFilled:A,setFocused:P,setTouched:Z,state:B,validationMode:z,validityData:Q,shouldValidateOnChange:Y,validation:ee}=xi(),D=Q7(),{labelId:V,controlId:q,registerControlId:K,getDescriptionProps:U}=co(),I=J7(),H=I?.parent,W=H&&I.allValues,X=M||D.disabled||I?.disabled||l,oe=L??g,se=C??oe,pe=br(),xe=br();let de=q;W?de=b?xe:`${H.id}-${se}`:f&&(de=f);let Me={};W&&(b?Me=I.parent.getParentProps():se&&(Me=I.parent.getChildProps(se)));const _e=Ae(y),{checked:ne=s,indeterminate:he=d,onCheckedChange:ae,...we}=Me,ve=I?.value,Se=I?.setValue,ye=I?.defaultValue,Ue=_.useRef(null),Ie=zn(()=>Symbol("checkbox-control")),Ee=_.useRef(!1),{getButtonProps:Ve,buttonRef:Xe}=el({disabled:X,native:O}),Be=I?.validation??ee,[We,He]=gp({controlled:se&&ve&&!b?ve.includes(se):ne,default:se&&ye&&!b?ye.includes(se):a,name:"Checkbox",state:"checked"});Le(()=>{K!==jn&&(Ee.current=!0,K(Ie.current,de))},[de,I,K,b,Ie]),_.useEffect(()=>{const ut=Ie.current;return()=>{!Ee.current||K===jn||(Ee.current=!1,K(ut,void 0))}},[K,Ie]),Mj({enabled:!I,id:pe,commit:Be.commit,value:We,controlRef:Ue,name:oe,getValue:()=>We});const me=_.useRef(null),Te=so(p,me,Be.inputRef);Le(()=>{me.current&&(me.current.indeterminate=he,We&&A(!0))},[We,he,A]),Lj(We,()=>{I&&!b||(R(oe),A(We),j(We!==Q.initialValue),Y()?Be.commit(We):Be.commit(We,!0))});const qe=oi({checked:We,disabled:X,name:b?void 0:oe,id:O?void 0:de??void 0,required:w,ref:Te,style:oe?Ej:yp,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ut){if(ut.nativeEvent.defaultPrevented)return;const xt=ut.target.checked,ot=Yt(ii,ut.nativeEvent);if(ae?.(xt,ot),_e(xt,ot),!ot.isCanceled&&(He(xt),se&&ve&&Se&&!b)){const Wt=xt?[...ve,se]:ve.filter(vn=>vn!==se);Se(Wt,ot)}},onFocus(){Ue.current?.focus()}},C!==void 0?{value:(I?We&&C:C)||""}:an,U,I?Be.getValidationProps:Be.getInputValidationProps),mt=W?!!ne:We,lt=W&&he||d;_.useEffect(()=>{if(!H||!se)return;const ut=H.disabledStatesRef.current;return ut.set(se,X),()=>{ut.delete(se)}},[H,X,se]);const wr=_.useMemo(()=>({...B,checked:mt,disabled:X,readOnly:x,required:w,indeterminate:lt}),[B,mt,X,x,w,lt]),Er=UA(wr),Qt=zt("span",t,{state:wr,ref:[Xe,Ue,n,I?.registerControlRef],props:[{id:O?de??void 0:pe,role:"checkbox","aria-checked":he?"mixed":We,"aria-readonly":x||void 0,"aria-required":w||void 0,"aria-labelledby":V,[tG]:b?"":void 0,onFocus(){P(!0)},onBlur(){const ut=me.current;ut&&(Z(!0),P(!1),z==="onBlur"&&Be.commit(I?ve:ut.checked))},onClick(ut){x||X||(ut.preventDefault(),me.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ut.shiftKey,ctrlKey:ut.ctrlKey,altKey:ut.altKey,metaKey:ut.metaKey})))}},U,Be.getValidationProps,N,we,Ve],stateAttributesMapping:Er});return h.jsxs($A.Provider,{value:wr,children:[Qt,!We&&!I&&oe&&!b&&T!==void 0&&h.jsx("input",{type:"hidden",name:oe,value:T}),h.jsx("input",{...qe})]})}),rG=_.forwardRef(function(t,n){const{render:s,className:i,keepMounted:a=!1,...l}=t,f=eG(),d=f.checked||f.indeterminate,{mounted:p,transitionStatus:g,setMounted:y}=jp(d),b=_.useRef(null),x={...f,transitionStatus:g};xa({open:d,ref:b,onComplete(){d||y(!1)}});const S=UA(f),w=_.useMemo(()=>({...S,...ba,...bi}),[S]),T=a||p,C=zt("span",t,{ref:[n,b],state:x,stateAttributesMapping:w,props:l});return T?C:null}),$v=_.forwardRef(({className:e,label:t,...n},s)=>{const i=h.jsx(nG,{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(rG,{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});$v.displayName="Checkbox";const sG=_.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function oG(e=!1){const t=_.useContext(sG);if(!t&&!e)throw new Error(yn(86));return t}const iG=function(t){const n=br(),[s,i]=_.useState(t.initialControlId===void 0?n:t.initialControlId),[a,l]=_.useState(void 0),[f,d]=_.useState([]),p=zn(()=>new Map),{messageIds:g}=co(),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 O;for(const N of T.values()){if(C!==void 0&&N===C)return C;O===void 0&&(O=N)}return O})}),b=_.useCallback(S=>oi({"aria-describedby":g.concat(f).join(" ")||void 0},S),[g,f]),x=_.useMemo(()=>({controlId:s,registerControlId:y,labelId:a,setLabelId:l,messageIds:f,setMessageIds:d,getDescriptionProps:b}),[s,y,a,l,f,d,b]);return h.jsx(Ij.Provider,{value:x,children:t.children})},fh=Object.keys(_p);function aG(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of fh)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function cG(e){const{formRef:t,clearErrors:n}=tl(),{setValidityData:s,validate:i,validityData:a,validationDebounceTime:l,invalid:f,markedDirtyRef:d,state:p,name:g,shouldValidateOnChange:y}=e,{controlId:b,getDescriptionProps:x}=co(),S=rs(),w=_.useRef(null),T=Ae(async(N,R=!1)=>{const M=w.current;if(!M)return;if(R){if(p.valid!==!1)return;const Q=M.validity;if(!Q.valueMissing){const ee={value:N,state:{..._p,valid:!0},error:"",errors:[],initialValue:a.initialValue};if(M.setCustomValidity(""),b){const D=t.current.fields.get(b);D&&t.current.fields.set(b,{...D,...Ov(ee,!1)})}s(ee);return}const Y=fh.reduce((ee,D)=>(ee[D]=Q[D],ee),{});if(!Y.valid&&!aG(Y))return}function L(Q){const Y=fh.reduce((D,V)=>(D[V]=Q.validity[V],D),{});let ee=!1;for(const D of fh)if(D!=="valid"){if(D==="valueMissing"&&Y[D])ee=!0;else if(Y[D])return Y}return ee&&!d.current&&(Y.valid=!0,Y.valueMissing=!1),Y}S.clear();let j=null,A=[];const P=L(M);let Z;const B=y();if(M.validationMessage&&!B)Z=M.validationMessage,A=[M.validationMessage];else{const Q=Array.from(t.current.fields.values()).reduce((ee,D)=>(D.name&&(ee[D.name]=D.getValue()),ee),{}),Y=i(N,Q);typeof Y=="object"&&Y!==null&&"then"in Y?j=await Y:j=Y,j!==null?(P.valid=!1,P.customError=!0,Array.isArray(j)?(A=j,M.setCustomValidity(j.join(`
75
- `))):j&&(A=[j],M.setCustomValidity(j))):B&&(M.setCustomValidity(""),P.customError=!1,M.validationMessage?(Z=M.validationMessage,A=[M.validationMessage]):M.validity.valid&&!P.valid&&(P.valid=!0))}const z={value:N,state:P,error:Z??(Array.isArray(j)?j[0]:j??""),errors:A,initialValue:a.initialValue};if(b){const Q=t.current.fields.get(b);Q&&t.current.fields.set(b,{...Q,...Ov(z,f)})}s(z)}),C=_.useCallback((N={})=>oi(x,p.valid===!1?{"aria-invalid":!0}:an,N),[x,p.valid]),O=_.useCallback((N={})=>oi({onChange(R){if(R.nativeEvent.defaultPrevented)return;if(n(g),!y()){T(R.currentTarget.value,!0);return}if(f)return;const M=R.currentTarget;if(M.value===""){T(M.value);return}S.clear(),l?S.start(l,()=>{T(M.value)}):T(M.value)}},C(N)),[C,n,g,S,T,f,l,y]);return _.useMemo(()=>({getValidationProps:C,getInputValidationProps:O,inputRef:w,commit:T}),[C,O,T])}const lG=_.forwardRef(function(t,n){const{errors:s,validationMode:i,submitAttemptedRef:a}=tl(),{render:l,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:O}=oG(),N=Ae(d||(()=>null)),R=O||b,[M,L]=_.useState(!1),[j,A]=_.useState(!1),[P,Z]=_.useState(!1),[B,z]=_.useState(!1),Q=S??j,Y=w??M,ee=_.useRef(!1),D=Ae(xe=>{S===void 0&&(xe&&(ee.current=!0),A(xe))}),V=Ae(xe=>{w===void 0&&L(xe)}),q=Ae(()=>g==="onChange"||g==="onSubmit"&&a.current),K=!!(x||y&&{}.hasOwnProperty.call(s,y)&&s[y]!==void 0),[U,I]=_.useState({state:_p,error:"",errors:[],value:null,initialValue:null}),H=!K&&U.state.valid,W=_.useMemo(()=>({disabled:R,touched:Y,dirty:Q,valid:H,filled:P,focused:B}),[R,Y,Q,H,P,B]),X=cG({setValidityData:I,validate:N,validityData:U,validationDebounceTime:p,invalid:K,markedDirtyRef:ee,state:W,name:y,shouldValidateOnChange:q}),oe=_.useCallback(()=>{ee.current=!0,X.commit(U.value)},[X,U]);_.useImperativeHandle(T,()=>({validate:oe}),[oe]);const se=_.useMemo(()=>({invalid:K,name:y,validityData:U,setValidityData:I,disabled:R,touched:Y,setTouched:V,dirty:Q,setDirty:D,filled:P,setFilled:Z,focused:B,setFocused:z,validate:N,validationMode:g,validationDebounceTime:p,shouldValidateOnChange:q,state:W,markedDirtyRef:ee,validation:X}),[K,y,U,R,Y,V,Q,D,P,Z,B,z,N,g,p,q,W,X]),pe=zt("div",t,{ref:n,state:W,props:C,stateAttributesMapping:bi});return h.jsx(Oj.Provider,{value:se,children:pe})}),uG=_.forwardRef(function(t,n){return h.jsx(iG,{children:h.jsx(lG,{...t,ref:n})})}),fG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,nativeLabel:l=!0,...f}=t,d=xi(!1),{controlId:p,setLabelId:g,labelId:y}=co(),b=br(a),x=_.useRef(null),S=Ae(T=>{if(Ur(T.nativeEvent)?.closest("button,input,select,textarea")||(!T.defaultPrevented&&T.detail>1&&T.preventDefault(),l||!p))return;const O=Rt(T.currentTarget).getElementById(p);Zt(O)&&O.focus({focusVisible:!0})});return Le(()=>(b&&g(b),()=>{g(void 0)}),[b,g]),zt("label",t,{ref:[n,x],state:d.state,props:[{id:y},l?{htmlFor:p??void 0,onMouseDown:S}:{onClick:S,onPointerDown(T){T.preventDefault()}},f],stateAttributesMapping:bi})}),dG={...bi,...ba},hG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,match:l,...f}=t,d=br(i),{validityData:p,state:g,name:y}=xi(!1),{setMessageIds:b}=co(),{errors:x}=tl(),S=y?x[y]:null;let w=!1;S||l===!0?w=!0:l?w=!!p.state[l]:w=p.state.valid===!1;const{mounted:T,transitionStatus:C,setMounted:O}=jp(w);Le(()=>{if(!(!w||!d))return b(z=>z.concat(d)),()=>{b(z=>z.filter(Q=>Q!==d))}},[w,d,b]);const N=_.useRef(null),[R,M]=_.useState(null),[L,j]=_.useState(null),A=S||(p.errors.length>1?h.jsx("ul",{children:p.errors.map(z=>h.jsx("li",{children:z},z))}):p.error);let P=p.error;S!=null?P=Array.isArray(S)?JSON.stringify(S):S:p.errors.length>1&&(P=JSON.stringify(p.errors)),w&&P!==L&&(j(P),M(A)),xa({open:w,ref:N,onComplete(){w||O(!1)}});const Z={...g,transitionStatus:C},B=zt("div",t,{ref:[n,N],state:Z,props:[{id:d,children:w?A:R},f],stateAttributesMapping:dG,enabled:T});return T?B:null}),pG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,...l}=t,f=br(i),d=xi(!1),{setMessageIds:p}=co();return Le(()=>{if(f)return p(y=>y.concat(f)),()=>{p(y=>y.filter(b=>b!==f))}},[f,p]),zt("p",t,{ref:n,state:d.state,props:[{id:f},l],stateAttributesMapping:bi})}),ms=uG,ts=_.forwardRef(({className:e,...t},n)=>h.jsx(fG,{ref:n,className:ge("font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",e),...t}));ts.displayName="FieldLabel";const mc=_.forwardRef(({className:e,...t},n)=>h.jsx(pG,{ref:n,className:ge("font-mono text-[9px] text-neutral-600 mt-0.5",e),...t}));mc.displayName="FieldDescription";const mG=_.forwardRef(({className:e,...t},n)=>h.jsx(hG,{ref:n,className:ge("font-mono text-[10px] text-offline mt-1",e),...t}));mG.displayName="FieldError";const gG=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge(e),...t}));gG.displayName="FieldContent";const yG=_.createContext(null),vG=_.createContext(null);function Wu(){const e=_.useContext(yG);if(e===null)throw new Error(yn(60));return e}function BA(){const e=_.useContext(vG);if(e===null)throw new Error(yn(61));return e}function Bc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function bG(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:Bc(t,s,n))}function Ly(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:Bc(s,t,n))}function xG(e,t,n){return e.filter(s=>!Bc(t,s,n))}function kC(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function SG(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function _G(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(SG(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 wG(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?kC(e.value):kC(e)}const it={id:Pe(e=>e.id),modal:Pe(e=>e.modal),multiple:Pe(e=>e.multiple),items:Pe(e=>e.items),itemToStringLabel:Pe(e=>e.itemToStringLabel),itemToStringValue:Pe(e=>e.itemToStringValue),isItemEqualToValue:Pe(e=>e.isItemEqualToValue),value:Pe(e=>e.value),hasSelectedValue:Pe(e=>{const{value:t,multiple:n,itemToStringValue:s}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:wG(t,s)!==""}),hasNullItemLabel:Pe((e,t)=>t?_G(e.items):!1),open:Pe(e=>e.open),mounted:Pe(e=>e.mounted),forceMount:Pe(e=>e.forceMount),transitionStatus:Pe(e=>e.transitionStatus),openMethod:Pe(e=>e.openMethod),activeIndex:Pe(e=>e.activeIndex),selectedIndex:Pe(e=>e.selectedIndex),isActive:Pe((e,t)=>e.activeIndex===t),isSelected:Pe((e,t,n)=>{const s=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(a=>Bc(n,a,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Bc(n,i,s)}),isSelectedByFocus:Pe((e,t)=>e.selectedIndex===t),popupProps:Pe(e=>e.popupProps),triggerProps:Pe(e=>e.triggerProps),triggerElement:Pe(e=>e.triggerElement),positionerElement:Pe(e=>e.positionerElement),listElement:Pe(e=>e.listElement),scrollUpArrowVisible:Pe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Pe(e=>e.scrollDownArrowVisible),hasScrollArrows:Pe(e=>e.hasScrollArrows)};function EG(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 TG(e){const[t,n]=_.useState(null),s=Ae((f,d)=>{e||n(d||(nA?"touch":""))}),i=_.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:l}=EG(s);return _.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:l}}),[t,i,a,l])}function CG(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,l=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,l,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 qd=2,RG=400,OC=200,NG={...D7,...bi,value:()=>null},jG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,disabled:l=!1,nativeButton:f=!0,...d}=t,{setTouched:p,setFocused:g,validationMode:y,state:b,disabled:x}=xi(),{labelId:S}=co(),{store:w,setOpen:T,selectionRef:C,validation:O,readOnly:N,required:R,alignItemWithTriggerActiveRef:M,disabled:L,keyboardActiveRef:j}=Wu(),A=x||L||l,P=at(w,it.open),Z=at(w,it.value),B=at(w,it.triggerProps),z=at(w,it.positionerElement),Q=at(w,it.listElement),Y=at(w,it.id),ee=at(w,it.hasSelectedValue),D=!ee&&P,V=at(w,it.hasNullItemLabel,D),q=a??Y;Pj({id:q});const K=Jo(z),U=_.useRef(null),{getButtonProps:I,buttonRef:H}=el({disabled:A,native:f}),W=Ae(ne=>{w.set("triggerElement",ne)}),X=so(n,U,H,W),oe=rs(),se=rs(),pe=rs(),xe=rs();_.useEffect(()=>{if(P)return!(ee||V)?pe.start(RG,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}):xe.start(OC,()=>{C.current.allowUnselectedMouseUp=!0,pe.start(OC,()=>{C.current.allowSelectedMouseUp=!0})}),()=>{pe.clear(),xe.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},se.clear()},[P,ee,V,C,se,pe,xe]);const de=_.useMemo(()=>Q?.id??Fh(z)?.id,[Q,z]),Me=oi(B,{id:q,role:"combobox","aria-expanded":P?"true":"false","aria-haspopup":"listbox","aria-controls":P?de:void 0,"aria-labelledby":S,"aria-readonly":N||void 0,"aria-required":R||void 0,tabIndex:A?-1:0,ref:X,onFocus(ne){g(!0),P&&M.current&&T(!1,Yt(ii,ne.nativeEvent)),oe.start(0,()=>{w.set("forceMount",!0)})},onBlur(ne){Ot(z,ne.relatedTarget)||(p(!0),g(!1),y==="onBlur"&&O.commit(Z))},onPointerMove(){j.current=!1},onKeyDown(){j.current=!0},onMouseDown(ne){if(P)return;const he=Rt(ne.currentTarget);function ae(we){if(!U.current)return;const ve=we.target;if(Ot(U.current,ve)||Ot(K.current,ve)||ve===U.current)return;const Se=CG(U.current);we.clientX>=Se.left-qd&&we.clientX<=Se.right+qd&&we.clientY>=Se.top-qd&&we.clientY<=Se.bottom+qd||T(!1,Yt(v8,we))}se.start(0,()=>{he.addEventListener("mouseup",ae,{once:!0})})}},O.getValidationProps,d,I);Me.role="combobox";const _e={...b,open:P,disabled:A,value:Z,readOnly:N,placeholder:!ee};return zt("button",t,{ref:[n,U],state:_e,stateAttributesMapping:NG,props:Me})}),AG=_.createContext(void 0),kG=_.forwardRef(function(t,n){const{store:s}=Wu(),i=at(s,it.mounted),a=at(s,it.forceMount);return i||a?h.jsx(AG.Provider,{value:!0,children:h.jsx(_A,{ref:n,...t})}):null});let MC={},IC={},PC="";function OG(e){if(typeof document>"u")return!1;const t=Rt(e);return un(t).innerWidth-t.documentElement.clientWidth>0}function MG(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=vi(s)?s:i,l=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=l,s.style.scrollbarGutter=f,d===p}function IG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=vi(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 PG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=un(n);let a=0,l=0,f=!1;const d=ys.create();if(tx&&(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,l=n.scrollLeft,MC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},PC=n.style.scrollBehavior,IC={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,O=n.scrollWidth>n.clientWidth,N=b.overflowY==="scroll"||x.overflowY==="scroll",R=b.overflowX==="scroll"||x.overflowX==="scroll",M=Math.max(0,i.innerWidth-s.clientWidth),L=Math.max(0,i.innerHeight-s.clientHeight),j=parseFloat(x.marginTop)+parseFloat(x.marginBottom),A=parseFloat(x.marginLeft)+parseFloat(x.marginRight),P=vi(n)?n:s;if(f=MG(e),f){n.style.scrollbarGutter=T,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(C||N)&&(n.style.overflowY="scroll"),(O||R)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:j||L?`calc(100dvh - ${j+L}px)`:"100dvh",width:A||M?`calc(100vw - ${A+M}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=a,s.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function g(){Object.assign(n.style,MC),Object.assign(s.style,IC),f||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=PC)}function y(){g(),d.request(p)}return p(),i.addEventListener("resize",y),()=>{d.cancel(),g(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",y)}}class DG{lockCount=0;restore=null;timeoutLock=ai.create();timeoutUnlock=ai.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=un(s).getComputedStyle(s).overflowY;if(i==="hidden"||i==="clip"){this.restore=jn;return}const a=nA||!OG(t);this.restore=a?IG(t):PG(t)}}const zG=new DG;function FA(e=!0,t=null){Le(()=>{if(e)return zG.acquire(t)},[e,t])}const HA=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function LG(){return _.useContext(HA)}function qA(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:i}=e,a=Ae(i),l=_.useRef(0),f=zn($G).current,d=zn(UG).current,[p,g]=_.useState(0),y=_.useRef(p),b=Ae((C,O)=>{d.set(C,O??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(BG).forEach((N,R)=>{const M=d.get(N)??{};C.set(N,{...M,index:R})}),C},[d,p]);Le(()=>{if(typeof MutationObserver!="function"||S.size===0)return;const C=new MutationObserver(O=>{const N=new Set,R=M=>N.has(M)?N.delete(M):N.add(M);O.forEach(M=>{M.removedNodes.forEach(R),M.addedNodes.forEach(R)}),N.size===0&&(y.current+=1,g(y.current))});return S.forEach((O,N)=>{N.parentElement&&C.observe(N.parentElement,{childList:!0})}),()=>{C.disconnect()}},[S]),Le(()=>{y.current===p&&(n.current.length!==S.size&&(n.current.length=S.size),s&&s.current.length!==S.size&&(s.current.length=S.size),l.current=S.size),a(S)},[a,S,n,s,p]),Le(()=>()=>{n.current=[]},[n]),Le(()=>()=>{s&&(s.current=[])},[s]);const w=Ae(C=>(f.add(C),()=>{f.delete(C)}));Le(()=>{f.forEach(C=>C(S))},[f,S]);const T=_.useMemo(()=>({register:b,unregister:x,subscribeMapChange:w,elementsRef:n,labelsRef:s,nextIndexRef:l}),[b,x,w,n,s,l]);return h.jsx(HA.Provider,{value:T,children:t})}function UG(){return new Map}function $G(){return new Set}function BG(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 VA=_.createContext(void 0);function FG(){const e=_.useContext(VA);if(!e)throw new Error(yn(59));return e}const KA=_.forwardRef(function(t,n){const{cutout:s,...i}=t;let a;if(s){const l=s?.getBoundingClientRect();a=`polygon(
74
+ `)}})}const M9=_.forwardRef(({active:e,className:t,color:n,formatter:s,hideIndicator:i=!1,hideLabel:a=!1,indicator:l="dot",label:f,labelClassName:d,labelFormatter:p,labelKey:g,nameKey:y,payload:b},x)=>{const{config:S}=A9(),w=_.useMemo(()=>{if(a||!b?.length)return null;const C=b[0];if(!C)return null;const k=`${g||C.dataKey||C.name||"value"}`,N=WT(S,C,k),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&&l!=="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,k)=>{const N=`${y||C.name||C.dataKey||"value"}`,R=WT(S,C,N),M=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",l==="dot"?"items-center":null),children:s&&C.value!==void 0&&C.name?s(C.value,C.name,C,k,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]",l==="dot"?"h-2.5 w-2.5":null,l==="line"?"w-1":null,l==="dashed"?"w-0 border-[1.5px] border-dashed bg-transparent":null,T&&l==="dashed"?"my-0.5":null),style:{"--color-bg":M,"--color-border":M}}),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)})})]})});M9.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,l=typeof t.name=="string"?t.name:null;return e[i??a??l??n]}const I9=["1h","6h","24h","7d"],Ej=_.forwardRef(({className:e,bars:t,activeRange:n="1h",onRangeChange:s,startLabel:i="-1h",midLabel:a="-30m",endLabel:l="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:I9.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:l})]})]}));Ej.displayName="ActivityBars";const JT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eC=qb,mi=(e,t)=>n=>{var s;if(t?.variants==null)return eC(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=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,l,d,n?.class,n?.className)},P9=mi("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"}}),Gn=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("input",{ref:s,className:ge(P9({variant:t,className:e})),...n}));Gn.displayName="Input";function yp({controlled:e,default:t,name:n,state:s="value"}){const{current:i}=_.useRef(e!==void 0),[a,l]=_.useState(t),f=i?e:a,d=_.useCallback(p=>{i||l(p)},[]);return[f,d]}const tC={};function zn(e,t){const n=_.useRef(tC);return n.current===tC&&(n.current=e(t)),n}const Ry=z1[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],D9=Ry&&Ry!==_.useLayoutEffect?Ry:e=>e();function Ae(e){const t=zn(z9).current;return t.next=e,D9(t.effect),t.trampoline}function z9(){const e={next:void 0,callback:L9,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function L9(){}function so(e,t,n,s){const i=zn(Tj).current;return $9(i,e,t,n,s)&&Cj(i,[e,t,n,s]),i.callback}function U9(e){const t=zn(Tj).current;return B9(t,e)&&Cj(t,e),t.callback}function Tj(){return{callback:null,cleanup:null,refs:[]}}function $9(e,t,n,s,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==i}function B9(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function Cj(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 l=a(n);typeof l=="function"&&(s[i]=l);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 l=s[i];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}const F9=()=>{},Le=typeof document<"u"?_.useLayoutEffect:F9,Rj={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},vp={...Rj,position:"fixed",top:0,left:0},Nj={...Rj,position:"absolute"};function jn(){}const Nu=Object.freeze([]),an=Object.freeze({});function yn(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 H9=parseInt(_.version,10);function Gb(e){return H9>=e}function nC(e){if(!_.isValidElement(e))return null;const t=e,n=t.props;return(Gb(19)?n?.ref:t.ref)??null}function jv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function q9(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 V9(e,t){return typeof e=="function"?e(t):e}function K9(e,t){return typeof e=="function"?e(t):e}const hu={};function oi(e,t,n,s,i){let a={...Av(e,hu)};return t&&(a=lu(a,t)),n&&(a=lu(a,n)),s&&(a=lu(a,s)),i&&(a=lu(a,i)),a}function G9(e){if(e.length===0)return hu;if(e.length===1)return Av(e[0],hu);let t={...Av(e[0],hu)};for(let n=1;n<e.length;n+=1)t=lu(t,e[n]);return t}function lu(e,t){return jj(t)?t(e):Z9(e,t)}function Z9(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=jv(e.style,s);break}case"className":{e[n]=Aj(e.className,s);break}default:Y9(n,s)?e[n]=X9(e[n],s):e[n]=s}}return e}function Y9(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 jj(e){return typeof e=="function"}function Av(e,t){return jj(e)?e(t):e??hu}function X9(e,t){return t?e?n=>{if(Q9(n)){const i=n;kv(i);const a=t(i);return i.baseUIHandlerPrevented||e?.(i),a}const s=t(n);return e?.(n),s}:t:e}function kv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Aj(e,t){return t?e?t+" "+e:t:e}function Q9(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const W9={style:{transition:"none"}},J9="data-base-ui-click-trigger",e8={fallbackAxisSide:"none"},t8={fallbackAxisSide:"end"},n8={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function zt(e,t,n={}){const s=t.render,i=r8(t,n);if(n.enabled===!1)return null;const a=n.state??an;return o8(e,s,i,a)}function r8(e,t={}){const{className:n,style:s,render:i}=e,{state:a=an,ref:l,props:f,stateAttributesMapping:d,enabled:p=!0}=t,g=p?V9(n,a):void 0,y=p?K9(s,a):void 0,b=p?q9(a,d):an,x=p?jv(b,Array.isArray(f)?G9(f):f)??an:an;return typeof document<"u"&&(p?Array.isArray(l)?x.ref=U9([x.ref,nC(i),...l]):x.ref=so(x.ref,nC(i),l):so(null,null)),p?(g!==void 0&&(x.className=Aj(x.className,g)),y!==void 0&&(x.style=jv(x.style,y)),x):an}const s8=Symbol.for("react.lazy");function o8(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const i=oi(n,t.props);i.ref=n.ref;let a=t;return a?.$$typeof===s8&&(a=_.Children.toArray(t)[0]),_.cloneElement(a,i)}if(e&&typeof e=="string")return i8(e,n);throw new Error(yn(8))}function i8(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 a8={...z1};let rC=0;function c8(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=a8.useId;function Qu(e,t){if(sC!==void 0){const n=sC();return e??(t?`${t}-${n}`:n)}return c8(e,t)}function br(e){return Qu(e,"base-ui")}function bp(){return typeof window<"u"}function gi(e){return Zb(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _s(e){var t;return(t=(Zb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zb(e){return bp()?e instanceof Node||e instanceof un(e).Node:!1}function jt(e){return bp()?e instanceof Element||e instanceof un(e).Element:!1}function Zt(e){return bp()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function Ov(e){return!bp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}const l8=new Set(["inline","contents"]);function yi(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=xr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!l8.has(i)}const u8=new Set(["table","td","th"]);function f8(e){return u8.has(gi(e))}const d8=[":popover-open",":modal"];function xp(e){return d8.some(t=>{try{return e.matches(t)}catch{return!1}})}const h8=["transform","translate","scale","rotate","perspective"],p8=["transform","translate","scale","rotate","perspective","filter"],m8=["paint","layout","strict","content"];function Yb(e){const t=Sp(),n=jt(e)?xr(e):e;return h8.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)||p8.some(s=>(n.willChange||"").includes(s))||m8.some(s=>(n.contain||"").includes(s))}function g8(e){let t=oo(e);for(;Zt(t)&&!Ys(t);){if(Yb(t))return t;if(xp(t))return null;t=oo(t)}return null}function Sp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const y8=new Set(["html","body","#document"]);function Ys(e){return y8.has(gi(e))}function xr(e){return un(e).getComputedStyle(e)}function _p(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oo(e){if(gi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ov(e)&&e.host||_s(e);return Ov(t)?t.host:t}function kj(e){const t=oo(e);return Ys(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zt(t)&&yi(t)?t:kj(t)}function Wo(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=kj(e),a=i===((s=e.ownerDocument)==null?void 0:s.body),l=un(i);if(a){const f=Mv(l);return t.concat(l,l.visualViewport||[],yi(i)?i:[],f&&n?Wo(f):[])}return t.concat(i,Wo(i,[],n))}function Mv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Oj=_.createContext(void 0);function Mj(e=!1){const t=_.useContext(Oj);if(t===void 0&&!e)throw new Error(yn(16));return t}function v8(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:i=0,isNativeButton:a}=e,l=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||l)||!a&&n)&&(p["aria-disabled"]=n),a&&(!t||f)&&(p.disabled=n),p},[s,n,t,l,f,a,i])}}function el(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=e,a=_.useRef(null),l=Mj(!0)!==void 0,f=Ae(()=>{const b=a.current;return!!(b?.tagName==="A"&&b?.href)}),{props:d}=v8({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:s,isNativeButton:i}),p=_.useCallback(()=>{const b=a.current;b8(b)&&l&&t&&d.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,d.disabled,l]);Le(p,[p]);const g=_.useCallback((b={})=>{const{onClick:x,onMouseDown:S,onKeyUp:w,onKeyDown:T,onPointerDown:C,...k}=b;return oi({type:i?"button":void 0,onClick(R){if(t){R.preventDefault();return}x?.(R)},onMouseDown(R){t||S?.(R)},onKeyDown(R){if(t||(kv(R),T?.(R)),R.baseUIHandlerPrevented)return;const M=R.target===R.currentTarget&&!i&&!f()&&!t,L=R.key==="Enter",j=R.key===" ";M&&((j||L)&&R.preventDefault(),L&&x?.(R))},onKeyUp(R){t||(kv(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,k)},[t,d,i,f]),y=Ae(b=>{a.current=b,p()});return{getButtonProps:g,buttonRef:y}}function b8(e){return Zt(e)&&e.tagName==="BUTTON"}const Ij=_.createContext(void 0);function x8(){const e=_.useContext(Ij);if(e===void 0)throw new Error(yn(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 wp={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},vi={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={...vi,checked(e){return e?{[iC.checked]:""}:{[iC.unchecked]:""}}};function Iv(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const S8=_.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:jn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function tl(){return _.useContext(S8)}const Dj=_.createContext({invalid:void 0,name:void 0,validityData:{state:wp,errors:[],error:"",value:"",initialValue:null},setValidityData:jn,disabled:void 0,touched:!1,setTouched:jn,dirty:!1,setDirty:jn,filled:!1,setFilled:jn,focused:!1,setFocused:jn,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=an)=>e,getInputValidationProps:(e=an)=>e,inputRef:{current:null},commit:async()=>{}}});function bi(e=!0){const t=_.useContext(Dj);if(t.setValidityData===jn&&!e)throw new Error(yn(28));return t}function zj(e){const{enabled:t=!0,value:n,id:s,name:i,controlRef:a,commit:l}=e,{formRef:f}=tl(),{invalid:d,markedDirtyRef:p,validityData:g,setValidityData:y}=bi(),b=Ae(e.getValue);Le(()=>{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]),Le(()=>{!t||!s||f.current.fields.set(s,{getValue:b,name:i,controlRef:a,validityData:Iv(g,d),validate(x=!0){let S=n;S===void 0&&(S=b()),p.current=!0,x?hi.flushSync(()=>l(S)):l(S)}})},[l,a,t,f,b,s,d,p,i,g,n]),Le(()=>{const x=f.current.fields;return()=>{s&&x.delete(s)}},[f,s])}const Lj=_.createContext({controlId:void 0,registerControlId:jn,labelId:void 0,setLabelId:jn,messageIds:[],setMessageIds:jn,getDescriptionProps:e=>e});function co(){return _.useContext(Lj)}function Uj(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:i,registerControlId:a}=co(),l=br(t),f=n?i:void 0,d=zn(()=>Symbol("labelable-control")),p=_.useRef(!1),g=_.useRef(t!=null),y=Ae(()=>{!p.current||a===jn||(p.current=!1,a(d.current,void 0))});return Le(()=>{if(a===jn)return;let b;if(n){const x=s?.current;jt(x)&&x.closest("label")!=null?b=t??null:b=f??l}else if(t!=null)g.current=!0,b=t;else if(g.current)b=l;else{y();return}if(b===void 0){y();return}p.current=!0,a(d.current,b)},[t,s,f,a,n,l,d,y]),_.useEffect(()=>y,[y]),i??l}const ii="none",aC="trigger-press",Pv="trigger-hover",$j="outside-press",Ny="item-press",Bj="focus-out",_8="escape-key",w8="cancel-open",E8="imperative-action",T8="window-resize";function Yt(e,t,n,s){let i=!1,a=!1;const l=s??an;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,...l}}function Fj(e,t){const n=_.useRef(e),s=Ae(t);Le(()=>{n.current!==e&&s(n.current)},[e,s]),Le(()=>{n.current=e},[e])}const C8=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a,id:l,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:k}=tl(),{state:N,setTouched:R,setDirty:M,validityData:L,setFilled:j,setFocused:A,shouldValidateOnChange:P,validationMode:G,disabled:B,name:z,validation:Q}=bi(),{labelId:Y}=co(),ee=B||x,D=z??d,K=Ae(g),q=_.useRef(null),V=so(q,f,Q.inputRef),U=_.useRef(null),I=br(),H=Uj({id:l,implicit:!1,controlRef:U}),W=p?void 0:H,[X,oe]=yp({controlled:s,default:!!a,name:"Switch",state:"checked"});zj({id:I,commit:Q.commit,value:X,controlRef:U,name:D,getValue:()=>X}),Le(()=>{q.current&&j(q.current.checked)},[q,j]),Fj(X,()=>{k(D),M(X!==L.initialValue),j(X),P()?Q.commit(X):Q.commit(X,!0)});const{getButtonProps:se,buttonRef:de}=el({disabled:ee,native:p}),xe={id:p?H:I,role:"switch","aria-checked":X,"aria-readonly":y||void 0,"aria-required":b||void 0,"aria-labelledby":Y,onFocus(){ee||A(!0)},onBlur(){const ne=q.current;!ne||ee||(R(!0),A(!1),G==="onBlur"&&Q.commit(ne.checked))},onClick(ne){y||ee||(ne.preventDefault(),q.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ne.shiftKey,ctrlKey:ne.ctrlKey,altKey:ne.altKey,metaKey:ne.metaKey})))}},he=_.useMemo(()=>oi({checked:X,disabled:ee,id:W,name:D,required:b,style:D?Nj:vp,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(ne){if(ne.nativeEvent.defaultPrevented)return;const pe=ne.target.checked,ae=Yt(ii,ne.nativeEvent);K?.(pe,ae),!ae.isCanceled&&oe(pe)},onFocus(){U.current?.focus()}},Q.getInputValidationProps,T!==void 0?{value:T}:an),[X,ee,V,W,D,K,b,oe,Q,T]),Me=_.useMemo(()=>({...N,checked:X,disabled:ee,readOnly:y,required:b}),[N,X,ee,y,b]),_e=zt("span",t,{state:Me,ref:[n,U,de],props:[xe,Q.getValidationProps,C,se],stateAttributesMapping:Pj});return h.jsxs(Ij.Provider,{value:Me,children:[_e,!X&&D&&w!==void 0&&h.jsx("input",{type:"hidden",name:D,value:w}),h.jsx("input",{...he})]})}),R8=_.forwardRef(function(t,n){const{render:s,className:i,...a}=t,{state:l}=bi(),f=x8(),d={...l,...f};return zt("span",t,{state:d,ref:n,stateAttributesMapping:Pj,props:a})}),Ep=_.forwardRef(({className:e,...t},n)=>h.jsx(C8,{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(R8,{className:"block w-[14px] h-[14px] bg-white rounded-full transition-transform data-[checked]:translate-x-4 absolute top-0.5 left-0.5"})}));Ep.displayName="Switch";const Hj=_.forwardRef(({className:e,enabled:t=!0,onEnabledChange:n,thresholds:s,onThresholdsChange:i,...a},l)=>{function f(d,p){const g=Number(p);Number.isFinite(g)&&i?.({...s,[d]:g})}return h.jsxs("div",{ref:l,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(Ep,{checked:t,onCheckedChange:d=>n?.(d)})]}),h.jsxs("div",{className:"p-4 space-y-3",children:[h.jsx(jy,{label:"P90 latency threshold",value:s.p90Latency,onChange:d=>f("p90Latency",d)}),h.jsx(jy,{label:"Error rate threshold",value:s.errorRate,onChange:d=>f("errorRate",d)}),h.jsx(jy,{label:"Client lag threshold",value:s.clientLag,onChange:d=>f("clientLag",d)})]})]})});Hj.displayName="AlertsConfig";function jy({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(Gn,{variant:"mono",type:"number",value:t,onChange:s=>n(s.target.value),className:"w-[100px] text-[11px] px-2 py-1 text-right"})]})}const N8=mi("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"}}),mn=_.forwardRef(({className:e,variant:t,style:n,...s},i)=>h.jsx("span",{ref:i,className:ge(N8({variant:t,className:e})),style:{lineHeight:1,...n},...s}));mn.displayName="Badge";const nl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"table",className:ge("w-full",e),...t}));nl.displayName="Table";const rl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));rl.displayName="TableHeader";const sl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));sl.displayName="TableBody";const os=_.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}));os.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 j8={relay:"relay",admin:"flow",proxy:"ghost"},A8=_.forwardRef(({className:e,keys:t,onCreateKey:n,onRotateKey:s,onRevokeKey:i,...a},l)=>h.jsx("div",{ref:l,className:ge("w-full",e),...a,children:h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{children:"Name"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"Prefix"}),h.jsx(ht,{children:"Created"})]})}),h.jsx(sl,{children:t.map((f,d)=>h.jsxs(os,{className:"group relative",children:[h.jsx(pt,{children:h.jsx("span",{className:"text-white truncate",children:f.name})}),h.jsx(pt,{children:h.jsx(mn,{variant:j8[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}`))})]})}));A8.displayName="ApiKeysTable";const qj=_.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(l=>h.jsx("div",{className:"w-0.5 h-1.5 bg-healthy rounded-sm animate-[heartbeat_1.2s_ease-in-out_infinite]",style:{animationDelay:`${l}s`}},l))}),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(l=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:l.label}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:l.value})]},l.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})]})]}));qj.displayName="BottomBar";const Vj=_.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))]}));Vj.displayName="CommitTable";const Kj=mi("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"}}),Oe=_.forwardRef(({className:e,variant:t,size:n,...s},i)=>h.jsx("button",{ref:i,className:ge(Kj({variant:t,size:n,className:e})),...s}));Oe.displayName="Button";const Gj=_.forwardRef(({className:e,isConnected:t=!1,isConnecting:n=!1,isTestingConnection:s=!1,serverUrl:i,onServerUrlChange:a,consoleToken:l,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(mn,{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(Gn,{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(Gn,{id:"console-token",variant:"mono",type:"password",value:l,onChange:S=>f?.(S.target.value)})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(Oe,{variant:"primary",size:"md",onClick:d,disabled:n,children:n?"Connecting...":"Save + Connect"}),h.jsx(Oe,{variant:"default",size:"md",onClick:g,disabled:n||s,children:s?"Testing...":"Test Connection"}),h.jsx(Oe,{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})]})]}));Gj.displayName="ConnectionForm";const k8=mi("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"}}),Pt=_.forwardRef(({className:e,size:t,...n},s)=>h.jsxs("svg",{ref:s,className:ge(k8({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"})]}));Pt.displayName="Spinner";function O8({className:e,state:t}){switch(t){case"connected":return h.jsx(mn,{variant:"healthy",className:e,children:"Connected"});case"disconnected":return h.jsx(mn,{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(Pt,{size:"sm"}),"Connecting"]});case"not-configured":return h.jsx(mn,{variant:"ghost",className:e,children:"Not configured"})}}const Xb=_.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}));Xb.displayName="Card";const M8=_.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}));M8.displayName="CardHeader";const I8=_.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));I8.displayName="CardTitle";const Qb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("p-4",e),...t}));Qb.displayName="CardContent";const P8=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-4 py-2.5 border-t border-border",e),...t}));P8.displayName="CardFooter";function Wb({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 Zj=_.forwardRef(({className:e,groups:t,searchValue:n,searchPlaceholder:s="Filter by client or actor...",onSearchChange:i,actions:a,...l},f)=>h.jsxs("div",{ref:f,className:ge("px-5 py-3 border-b border-border flex items-center gap-4 flex-wrap",e),...l,children:[t.map((d,p)=>h.jsx(D8,{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})]}));Zj.displayName="FilterBar";function D8({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 z8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const L8={online:"healthy",syncing:"syncing",offline:"offline"},U8={realtime:"flow",polling:"ghost"},$8=_.forwardRef(({className:e,client:t,headSeq:n,onEvict:s,...i},a)=>{const l=Math.max(0,n-t.cursor),f=Math.min(100,t.cursor/n*100),d=z8(l);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(mn,{variant:L8[t.status],children:t.status}),h.jsx(mn,{variant:U8[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:l===0?"Caught up":`${l} behind`})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(Ay,{label:"Actor",value:t.actor}),h.jsx(Ay,{label:"Dialect",value:t.dialect}),h.jsx(Ay,{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(mn,{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"]})]})]})});$8.displayName="FleetCard";function Ay({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 Yj=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const B8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const F8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const cC=e=>{const t=F8(e);return t.charAt(0).toUpperCase()+t.slice(1)};var H8={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 q8=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const V8=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:l,...f},d)=>_.createElement("svg",{ref:d,...H8,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:Yj("lucide",i),...!a&&!q8(f)&&{"aria-hidden":"true"},...f},[...l.map(([p,g])=>_.createElement(p,g)),...Array.isArray(a)?a:[a]]));const Jb=(e,t)=>{const n=_.forwardRef(({className:s,...i},a)=>_.createElement(V8,{ref:a,iconNode:t,className:Yj(`lucide-${B8(cC(e))}`,`lucide-${e}`,s),...i}));return n.displayName=cC(e),n};const K8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],G8=Jb("arrow-left",K8);const Z8=[["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"}]],Y8=Jb("settings",Z8);const X8=[["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"}]],Q8=Jb("user-x",X8);function W8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const J8={online:"healthy",syncing:"syncing",offline:"offline"},Xj=_.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(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{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(sl,{children:t.map(l=>{const f=Math.max(0,n-l.cursor),d=n>0?Math.min(100,l.cursor/n*100):100,p=W8(f);return h.jsxs(os,{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:l.id,children:l.id.length>18?`${l.id.substring(0,18)}…`:l.id})]})}),h.jsx(pt,{className:"w-[70px]",children:h.jsx(mn,{variant:J8[l.status],children:l.status})}),h.jsx(pt,{className:"w-[60px]",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.type})}),h.jsx(pt,{className:"w-[80px]",children:h.jsxs("span",{className:"font-mono text-[11px] text-white font-medium",children:["#",l.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:l.dialect})}),h.jsx(pt,{className:"flex-1",children:h.jsx(mn,{variant:l.mode==="realtime"?"flow":"ghost",children:l.mode})}),s&&h.jsxs("button",{type:"button",title:"Evict client",onClick:()=>s(l.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(Q8,{size:10}),"evict"]})]},l.id)})})]})}));Xj.displayName="FleetTable";const Qj=_.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((l,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:l.table}),h.jsx("span",{className:"w-[100px] truncate",children:l.dependsOn?h.jsx(mn,{variant:"ghost",children:l.dependsOn}):h.jsx("span",{className:"text-neutral-600",children:"—"})}),h.jsx("span",{className:"w-[70px] text-right text-neutral-500 truncate",children:l.chunkTtl})]},`${l.table}:${f}`))]})});Qj.displayName="HandlersTable";const eV={flow:"bg-flow",healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",relay:"bg-relay",muted:"bg-neutral-500"},Wj=_.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(tV,{item:i,showDivider:a>0},i.label))}));Wj.displayName="KpiStrip";function tV({item:e,showDivider:t}){const n=eV[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 Jj=_.forwardRef(({className:e,buckets:t,successRate:n=99.6,successLabel:s="success",...i},a)=>{const l=n/100*88,f=88-l;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:`${l} ${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})]})]})]})});Jj.displayName="LatencyPercentilesBar";const nV={PUSH:"syncing",PULL:"healthy",ACK:"flow"},eA=_.forwardRef(({className:e,entries:t,isConnected:n=!0,maxVisible:s=20,maxHeight:i,...a},l)=>{const f=t.slice(0,s);return h.jsxs("div",{ref:l,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(mn,{variant:nV[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}`))})]})});eA.displayName="LiveActivityFeed";const rV={syncing:"bg-syncing",flow:"bg-flow",healthy:"bg-healthy",offline:"bg-offline"},Tp=_.forwardRef(({className:e,title:t,description:n,dotColor:s="syncing",stats:i,actionLabel:a,actionVariant:l="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",rV[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(Oe,{variant:l,size:"md",onClick:d,children:[f,a]})]})]}));Tp.displayName="MaintenanceCard";function sV({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Xb,{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(Qb,{className:s,children:t})]})}const tA=_.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(Oe,{variant:"default",size:"sm",onClick:n,children:"Reset defaults"})]}),h.jsx("div",{className:"p-4 space-y-4",children:t.map((a,l)=>h.jsx(oV,{row:a,showDivider:l>0},a.label))})]}));tA.displayName="PreferencesPanel";function oV({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(Ep,{checked:e.checked,onCheckedChange:n=>e.onCheckedChange(n)})]})})]})}function ex({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Xb,{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(Qb,{className:s,children:t})]})}const iV={commit:"text-flow",push:"text-syncing",pull:"text-healthy"},aV={applied:"text-healthy",error:"text-offline",cached:"text-syncing"},nA=_.forwardRef(({className:e,entries:t,filterBar:n,pagination:s,onEntryClick:i,selectedEntryId:a,...l},f)=>h.jsxs("div",{ref:f,className:ge("h-full flex flex-col",e),...l,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(cV,{entry:d,isSelected:a===d.id,onClick:i},`${d.id}-${p}`))}),s]}));nA.displayName="StreamLog";function cV({entry:e,isSelected:t,onClick:n}){const s=iV[e.type]??"text-neutral-500",i=aV[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]"),l=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:l}):h.jsx("div",{className:a,children:l})}function lV(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const rA=_.forwardRef(({className:e,clients:t,headSeq:n,maxLag:s,minSeq:i,...a},l)=>{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:l,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=lV(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"})]})]})]})]})});rA.displayName="SyncHorizon";function uV(e){const t=_.useRef(!0);t.current&&(t.current=!1,e())}const fV=_.createContext(void 0);function tx(e){const t=_.useContext(fV);if(t===void 0)throw new Error(yn(72));return t}const dV=[];function nx(e){_.useEffect(e,dV)}const iu=0;class ai{static create(){return new ai}currentId=iu;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=iu,n()},t)}isStarted(){return this.currentId!==iu}clear=()=>{this.currentId!==iu&&(clearTimeout(this.currentId),this.currentId=iu)};disposeEffect=()=>this.clear}function rs(){const e=zn(ai.create).current;return nx(e.disposeEffect),e}function Jo(e){const t=zn(hV,e).current;return t.next=e,Le(t.effect),t}function hV(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Rt(e){return e?.ownerDocument||document}const ol=typeof navigator<"u",ky=gV(),sA=vV(),oA=yV(),rx=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),iA=ky.platform==="MacIntel"&&ky.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(ky.platform),pV=ol&&/apple/i.test(navigator.vendor),Dv=ol&&/android/i.test(sA)||/android/i.test(oA);ol&&sA.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const mV=oA.includes("jsdom/");function gV(){if(!ol)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 yV(){if(!ol)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function vV(){if(!ol)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const zv="data-base-ui-focusable",aA="active",cA="selected",lA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Oy="ArrowLeft",My="ArrowRight",bV="ArrowUp",xV="ArrowDown";function Bo(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Ot(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Ov(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function SV(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(Ot(s,n))return!s.hasAttribute("data-trigger-disabled");return!1}function Ur(e){return"composedPath"in e?e.composedPath()[0]:e.target}function es(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 _V(e){return e.matches("html,body")}function uA(e){return Zt(e)&&e.matches(lA)}function lC(e){return e?e.getAttribute("role")==="combobox"&&uA(e):!1}function Hh(e){return e?e.hasAttribute(zv)?e:e.querySelector(`[${zv}]`)||e:null}function Sc(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...Sc(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 Vi(e){e.preventDefault(),e.stopPropagation()}function wV(e){return"nativeEvent"in e}function EV(e){return e.pointerType===""&&e.isTrusted?!0:Dv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function TV(e){return mV?!1:!Dv&&e.width===0&&e.height===0||Dv&&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 CV(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function RV(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const NV=["top","right","bottom","left"],Uc=Math.min,dr=Math.max,qh=Math.round,pc=Math.floor,xs=e=>({x:e,y:e}),jV={left:"right",right:"left",bottom:"top",top:"bottom"},AV={start:"end",end:"start"};function Lv(e,t,n){return dr(e,Uc(t,n))}function io(e,t){return typeof e=="function"?e(t):e}function Zn(e){return e.split("-")[0]}function xi(e){return e.split("-")[1]}function sx(e){return e==="x"?"y":"x"}function ox(e){return e==="y"?"height":"width"}const kV=new Set(["top","bottom"]);function Fr(e){return kV.has(Zn(e))?"y":"x"}function ix(e){return sx(Fr(e))}function OV(e,t,n){n===void 0&&(n=!1);const s=xi(e),i=ix(e),a=ox(i);let l=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Vh(l)),[l,Vh(l)]}function MV(e){const t=Vh(e);return[Uv(e),t,Uv(t)]}function Uv(e){return e.replace(/start|end/g,t=>AV[t])}const fC=["left","right"],dC=["right","left"],IV=["top","bottom"],PV=["bottom","top"];function DV(e,t,n){switch(e){case"top":case"bottom":return n?t?dC:fC:t?fC:dC;case"left":case"right":return t?IV:PV;default:return[]}}function zV(e,t,n,s){const i=xi(e);let a=DV(Zn(e),n==="start",s);return i&&(a=a.map(l=>l+"-"+i),t&&(a=a.concat(a.map(Uv)))),a}function Vh(e){return e.replace(/left|right|bottom|top/g,t=>jV[t])}function LV(e){return{top:0,right:0,bottom:0,left:0,...e}}function fA(e){return typeof e!="number"?LV(e):{top:e,right:e,bottom:e,left:e}}function Kh(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 Ld(e,t,n){return Math.floor(e/t)!==n}function lh(e,t){return t<0||t>=e.current.length}function UV(e,t){return fr(e,{disabledIndices:t})}function $V(e,t){return fr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function fr(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&&pu(e,a,s));return a}function BV(e,{event:t,orientation:n,loopFocus:s,rtl:i,cols:a,disabledIndices:l,minIndex:f,maxIndex:d,prevIndex:p,stopEvent:g=!1}){let y=p;const b=[],x={};let S=!1;{let C=null,k=-1;e.current.forEach((N,R)=>{if(N==null)return;const M=N.closest('[role="row"]');M&&(S=!0),(M!==C||k===-1)&&(C=M,k+=1,b[k]=[]),b[k].push(R),x[R]=k})}const w=S&&b.length>0&&b.some(C=>C.length!==a);function T(C){if(!w||p===-1)return;const k=x[p];if(k==null)return;const N=b[k].indexOf(p);let R=C==="up"?k-1:k+1;s&&(R<0?R=b.length-1:R>=b.length&&(R=0));const M=new Set;for(;R>=0&&R<b.length&&!M.has(R);){M.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 A=j;A>=0;A-=1){const P=L[A];if(!pu(e,P,l))return P}R=C==="up"?R-1:R+1,s&&(R<0?R=b.length-1:R>=b.length&&(R=0))}}if(t.key===bV){const C=T("up");if(C!==void 0)g&&Vi(t),y=C;else{if(g&&Vi(t),p===-1)y=d;else if(y=fr(e,{startingIndex:y,amount:a,decrement:!0,disabledIndices:l}),s&&(p-a<f||y<0)){const k=p%a,N=d%a,R=d-(N-k);N===k?y=d:y=N>k?R:R-a}lh(e,y)&&(y=p)}}if(t.key===xV){const C=T("down");C!==void 0?(g&&Vi(t),y=C):(g&&Vi(t),p===-1?y=f:(y=fr(e,{startingIndex:p,amount:a,disabledIndices:l}),s&&p+a>d&&(y=fr(e,{startingIndex:p%a-a,amount:a,disabledIndices:l}))),lh(e,y)&&(y=p))}if(n==="both"){const C=pc(p/a);t.key===(i?Oy:My)&&(g&&Vi(t),p%a!==a-1?(y=fr(e,{startingIndex:p,disabledIndices:l}),s&&Ld(y,a,C)&&(y=fr(e,{startingIndex:p-p%a-1,disabledIndices:l}))):s&&(y=fr(e,{startingIndex:p-p%a-1,disabledIndices:l})),Ld(y,a,C)&&(y=p)),t.key===(i?My:Oy)&&(g&&Vi(t),p%a!==0?(y=fr(e,{startingIndex:p,decrement:!0,disabledIndices:l}),s&&Ld(y,a,C)&&(y=fr(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:l}))):s&&(y=fr(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:l})),Ld(y,a,C)&&(y=p));const k=pc(d/a)===C;lh(e,y)&&(s&&k?y=t.key===(i?My:Oy)?d:fr(e,{startingIndex:p-p%a-1,disabledIndices:l}):y=p)}return y}function FV(e,t,n){const s=[];let i=0;return e.forEach(({width:a,height:l},f)=>{let d=!1;for(n&&(i=0);!d;){const p=[];for(let g=0;g<a;g+=1)for(let y=0;y<l;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 HV(e,t,n,s,i){if(e===-1)return-1;const a=n.indexOf(e),l=t[e];switch(i){case"tl":return a;case"tr":return l?a+l.width-1:a;case"bl":return l?a+(l.height-1)*s:a;case"br":return n.lastIndexOf(e);default:return-1}}function qV(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function pu(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 VV=["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] *)"],Gh=VV.join(","),dA=typeof Element>"u",$c=dA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zh=!dA&&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},Yh=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",l=a||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Yh(t.parentNode));return l},KV=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},hA=function(t,n,s){if(Yh(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Gh));return n&&$c.call(t,Gh)&&i.unshift(t),i=i.filter(s),i},Xh=function(t,n,s){for(var i=[],a=Array.from(t);a.length;){var l=a.shift();if(!Yh(l,!1))if(l.tagName==="SLOT"){var f=l.assignedElements(),d=f.length?f:l.children,p=Xh(d,!0,s);s.flatten?i.push.apply(i,p):i.push({scopeParent:l,candidates:p})}else{var g=$c.call(l,Gh);g&&s.filter(l)&&(n||!t.includes(l))&&i.push(l);var y=l.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(l),b=!Yh(y,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(l));if(y&&b){var x=Xh(y===!0?l.children:y.children,!0,s);s.flatten?i.push.apply(i,x):i.push({scopeParent:l,candidates:x})}else a.unshift.apply(a,l.children)}}return i},pA=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},mA=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||KV(t))&&!pA(t)?0:t.tabIndex},GV=function(t,n){var s=mA(t);return s<0&&n&&!pA(t)?0:s},ZV=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},gA=function(t){return t.tagName==="INPUT"},YV=function(t){return gA(t)&&t.type==="hidden"},XV=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},QV=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},WV=function(t){if(!t.name)return!0;var n=t.form||Zh(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(l){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",l.message),!1}var a=QV(i,t.form);return!a||a===t},JV=function(t){return gA(t)&&t.type==="radio"},eK=function(t){return JV(t)&&!WV(t)},tK=function(t){var n,s=t&&Zh(t),i=(n=s)===null||n===void 0?void 0:n.host,a=!1;if(s&&s!==t){var l,f,d;for(a=!!((l=i)!==null&&l!==void 0&&(f=l.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=Zh(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},nK=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 l=$c.call(t,"details>summary:first-of-type"),f=l?t.parentElement:t;if($c.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=Zh(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(tK(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return hC(t);return!1},rK=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 $c.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},$v=function(t,n){return!(n.disabled||YV(n)||nK(n,t)||XV(n)||rK(n))},Bv=function(t,n){return!(eK(n)||mA(n)<0||!$v(t,n))},sK=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},yA=function(t){var n=[],s=[];return t.forEach(function(i,a){var l=!!i.scopeParent,f=l?i.scopeParent:i,d=GV(f,l),p=l?yA(i.candidates):f;d===0?l?n.push.apply(n,p):n.push(f):s.push({documentOrder:a,tabIndex:d,item:i,isScope:l,content:p})}),s.sort(ZV).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},Cp=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Xh([t],n.includeContainer,{filter:Bv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:sK}):s=hA(t,n.includeContainer,Bv.bind(null,n)),yA(s)},oK=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Xh([t],n.includeContainer,{filter:$v.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=hA(t,n.includeContainer,$v.bind(null,n)),s},vA=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return $c.call(t,Gh)===!1?!1:Bv(n,t)};const Wu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function bA(e,t){const n=Cp(e,Wu()),s=n.length;if(s===0)return;const i=Bo(Rt(e)),a=n.indexOf(i),l=a===-1?t===1?0:s-1:a+t;return n[l]}function xA(e){return bA(Rt(e).body,1)||e}function SA(e){return bA(Rt(e).body,-1)||e}function mu(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Ot(n,s)}function iK(e){Cp(e,Wu()).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 aK(){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 cK=_.createContext(null),lK=_.createContext(null),Rp=()=>_.useContext(cK)?.id||null,Np=e=>{const t=_.useContext(lK);return e??t};function ju(e){return`data-base-ui-${e}`}const Ud=null;class uK{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 $d=new uK;class ys{static create(){return new ys}static request(t){return $d.request(t)}static cancel(t){return $d.cancel(t)}currentId=Ud;request(t){this.cancel(),this.currentId=$d.request(()=>{this.currentId=Ud,t()})}cancel=()=>{this.currentId!==Ud&&($d.cancel(this.currentId),this.currentId=Ud)};disposeEffect=()=>this.cancel}function ax(){const e=zn(ys.create).current;return nx(e.disposeEffect),e}const Qh=_.forwardRef(function(t,n){const[s,i]=_.useState();Le(()=>{pV&&i("button")},[]);const a={tabIndex:0,role:s};return h.jsx("span",{...t,ref:n,style:vp,"aria-hidden":s?void 0:!0,...a,"data-base-ui-focus-guard":""})});let mC=0;function Iy(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 _c={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function gC(e){return e==="inert"?_c.inert:e==="aria-hidden"?_c["aria-hidden"]:_c.none}let Bd=new WeakSet,Fd={},Py=0;const _A=e=>e&&(e.host||_A(e.parentNode)),fK=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=_A(n);return e.contains(s)?s:null}).filter(n=>n!=null);function dK(e,t,n,s){const i="data-base-ui-inert",a=s?"inert":n?"aria-hidden":null,l=fK(t,e),f=new Set,d=new Set(l),p=[];Fd[i]||(Fd[i]=new WeakMap);const g=Fd[i];l.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(gi(S)!=="script")if(f.has(S))b(S);else{const w=a?S.getAttribute(a):null,T=w!==null&&w!=="false",C=gC(a),k=(C.get(S)||0)+1,N=(g.get(S)||0)+1;C.set(S,k),g.set(S,N),p.push(S),k===1&&T&&Bd.add(S),N===1&&S.setAttribute(i,""),!T&&a&&S.setAttribute(a,a==="inert"?"":"true")}})}return Py+=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||(!Bd.has(x)&&a&&x.removeAttribute(a),Bd.delete(x)),C||x.removeAttribute(i)}),Py-=1,Py||(_c.inert=new WeakMap,_c["aria-hidden"]=new WeakMap,_c.none=new WeakMap,Bd=new WeakSet,Fd={})}}function hK(e,t=!1,n=!1){const s=Rt(e[0]).body;return dK(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const wA=_.createContext(null),EA=()=>_.useContext(wA),pK=ju("portal");function TA(e={}){const{ref:t,container:n,componentProps:s=an,elementProps:i}=e,a=Qu(),f=EA()?.portalNode,[d,p]=_.useState(null),[g,y]=_.useState(null),b=Ae(T=>{T!==null&&y(T)}),x=_.useRef(null);Le(()=>{if(n===null){x.current&&(x.current=null,y(null),p(null));return}if(a==null)return;const T=(n&&(Zb(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=zt("div",s,{ref:[t,b],props:[{id:a,[pK]:""},i]});return{portalNode:g,portalSubtree:d&&S?hi.createPortal(S,d):null}}const CA=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,renderGuards:f,...d}=t,{portalNode:p,portalSubtree:g}=TA({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,k=w?.open,N=typeof f=="boolean"?f:!!w&&!w.modal&&w.open&&!!p;_.useEffect(()=>{if(!p||C)return;function M(L){p&&L.relatedTarget&&mu(L)&&(L.type==="focusin"?pC:iK)(p)}return p.addEventListener("focusin",M,!0),p.addEventListener("focusout",M,!0),()=>{p.removeEventListener("focusin",M,!0),p.removeEventListener("focusout",M,!0)}},[p,C]),_.useEffect(()=>{!p||k||pC(p)},[k,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(wA.Provider,{value:R,children:[N&&p&&h.jsx(Qh,{"data-type":"outside",ref:y,onFocus:M=>{if(mu(M,p))x.current?.focus();else{const L=w?w.domReference:null;SA(L)?.focus()}}}),N&&p&&h.jsx("span",{"aria-owns":p.id,style:n8}),p&&hi.createPortal(s,p),N&&p&&h.jsx(Qh,{"data-type":"outside",ref:b,onFocus:M=>{if(mu(M,p))S.current?.focus();else{const L=w?w.domReference:null;xA(L)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Yt(Bj,M.nativeEvent))}}})]})]})});function qs(e){return e==null?e:"current"in e?e.current:e}function mK(e,t){const n=un(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 qo=[];function cx(){qo=qo.filter(e=>e.deref()?.isConnected)}function gK(e){cx(),e&&gi(e)!=="body"&&(qo.push(new WeakRef(e)),qo.length>yC&&(qo=qo.slice(-yC)))}function Dy(){return cx(),qo[qo.length-1]?.deref()}function yK(e){if(!e)return null;const t=Wu();return vA(e,t)?e:Cp(e,t)[0]||e}function vK(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():xr(e).display!=="none"}function vC(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Wu(),i=oK(e,n).filter(l=>{const f=l.getAttribute("data-tabindex")||"";return vA(l,n)||l.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 RA(e){const{context:t,children:n,disabled:s=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:l=!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:k,dataRef:N}=S.context,R=Ae(()=>N.current.floatingContext?.nodeId),M=i===!1,L=lC(T)&&M,j=_.useRef(["content"]),A=Jo(i),P=Jo(a),G=Jo(p),B=Np(x),z=EA(),Q=_.useRef(null),Y=_.useRef(null),ee=_.useRef(!1),D=_.useRef(!1),K=_.useRef(!1),q=_.useRef(-1),V=_.useRef(""),U=_.useRef(""),I=_.useRef(null),H=_.useRef(null),W=so(I,b,z?.beforeInsideRef),X=so(H,z?.afterInsideRef),oe=rs(),se=rs(),de=ax(),xe=z!=null,he=Hh(C),Me=Ae((pe=he)=>pe?Cp(pe,Wu()):[]),_e=Ae(pe=>{const ae=Me(pe);return j.current.map(()=>ae).filter(Boolean).flat()});_.useEffect(()=>{if(s||!f)return;function pe(we){we.key==="Tab"&&Ot(he,Bo(Rt(he)))&&Me().length===0&&!L&&Vi(we)}const ae=Rt(he);return ae.addEventListener("keydown",pe),()=>{ae.removeEventListener("keydown",pe)}},[s,T,he,f,j,L,Me,_e]),_.useEffect(()=>{if(s||!w)return;const pe=Rt(he);function ae(){K.current=!1}function we(Se){const ye=Ur(Se),Ue=Ot(C,ye)||Ot(T,ye)||Ot(z?.portalNode,ye);K.current=!Ue,U.current=Se.pointerType||"keyboard",ye?.closest(`[${J9}]`)&&(D.current=!0)}function ve(){U.current="keyboard"}return pe.addEventListener("pointerdown",we,!0),pe.addEventListener("pointerup",ae,!0),pe.addEventListener("pointercancel",ae,!0),pe.addEventListener("keydown",ve,!0),()=>{pe.removeEventListener("pointerdown",we,!0),pe.removeEventListener("pointerup",ae,!0),pe.removeEventListener("pointercancel",ae,!0),pe.removeEventListener("keydown",ve,!0)}},[s,C,T,he,w,z]),_.useEffect(()=>{if(s||!d)return;const pe=Rt(he);function ae(){D.current=!0,se.start(0,()=>{D.current=!1})}function we(Ie){const Ee=Ur(Ie),Xe=Me().indexOf(Ee);Xe!==-1&&(q.current=Xe)}function ve(Ie){const Ee=Ie.relatedTarget,Ve=Ie.currentTarget,Xe=Ur(Ie);queueMicrotask(()=>{const Be=R(),We=S.context.triggerElements,He=Ee?.hasAttribute(ju("focus-guard"))&&[I.current,H.current,z?.beforeInsideRef.current,z?.afterInsideRef.current,z?.beforeOutsideRef.current,z?.afterOutsideRef.current,qs(y),qs(g)].includes(Ee),me=!(Ot(T,Ee)||Ot(C,Ee)||Ot(Ee,C)||Ot(z?.portalNode,Ee)||Ee!=null&&We.hasElement(Ee)||We.hasMatchingElement(Te=>Ot(Te,Ee))||He||B&&(Sc(B.nodesRef.current,Be).find(Te=>Ot(Te.context?.elements.floating,Ee)||Ot(Te.context?.elements.domReference,Ee))||uC(B.nodesRef.current,Be).find(Te=>[Te.context?.elements.floating,Hh(Te.context?.elements.floating)].includes(Ee)||Te.context?.elements.domReference===Ee)));if(Ve===T&&he&&vC(he,j),l&&Ve!==T&&!vK(Xe)&&Bo(pe)===pe.body){if(Zt(he)&&(he.focus(),l==="popup")){de.request(()=>{he.focus()});return}const Te=q.current,qe=Me(),mt=qe[Te]||qe[qe.length-1]||he;Zt(mt)&&mt.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(L||!f)&&Ee&&me&&!D.current&&(L||Ee!==Dy())&&(ee.current=!0,S.setOpen(!1,Yt(Bj,Ie)))})}function Se(){K.current||(N.current.insideReactTree=!0,oe.start(0,()=>{N.current.insideReactTree=!1}))}const ye=Zt(T)?T:null,Ue=[];if(!(!C&&!ye))return ye&&(ye.addEventListener("focusout",ve),ye.addEventListener("pointerdown",ae),Ue.push(()=>{ye.removeEventListener("focusout",ve),ye.removeEventListener("pointerdown",ae)})),C&&(C.addEventListener("focusin",we),C.addEventListener("focusout",ve),z&&(C.addEventListener("focusout",Se,!0),Ue.push(()=>{C.removeEventListener("focusout",Se,!0)})),Ue.push(()=>{C.removeEventListener("focusin",we),C.removeEventListener("focusout",ve)})),()=>{Ue.forEach(Ie=>{Ie()})}},[s,T,C,he,f,B,z,S,d,l,Me,L,R,j,N,oe,se,de,g,y]),_.useEffect(()=>{if(s||!C||!w)return;const pe=Array.from(z?.portalNode?.querySelectorAll(`[${ju("portal")}]`)||[]),we=(B?uC(B.nodesRef.current,R()):[]).find(Se=>lC(Se.context?.elements.domReference||null))?.context?.elements.domReference,ve=[C,we,...pe,Q.current,Y.current,I.current,H.current,z?.beforeOutsideRef.current,z?.afterOutsideRef.current,qs(y),qs(g),L?T:null].filter(Se=>Se!=null);return hK(ve,f||L)},[w,s,T,C,f,j,z,L,B,R,g,y]),Le(()=>{if(!w||s||!Zt(he))return;const pe=Rt(he),ae=Bo(pe);queueMicrotask(()=>{const we=_e(he),ve=A.current,Se=typeof ve=="function"?ve(G.current||""):ve;if(Se===void 0||Se===!1)return;let ye;Se===!0||Se===null?ye=we[0]||he:ye=qs(Se),ye=ye||we[0]||he,!Ot(he,ae)&&Iy(ye,{preventScroll:ye===he})})},[s,w,he,M,_e,A,G]),Le(()=>{if(s||!he)return;const pe=Rt(he),ae=Bo(pe);gK(ae);function we(ye){if(ye.open||(V.current=mK(ye.nativeEvent,U.current)),ye.reason===Pv&&ye.nativeEvent.type==="mouseleave"&&(ee.current=!0),ye.reason===$j)if(ye.nested)ee.current=!1;else if(EV(ye.nativeEvent)||TV(ye.nativeEvent))ee.current=!1;else{let Ue=!1;document.createElement("div").focus({get preventScroll(){return Ue=!0,!1}}),Ue?ee.current=!1:ee.current=!0}}k.on("openchange",we);const ve=pe.createElement("span");ve.setAttribute("tabindex","-1"),ve.setAttribute("aria-hidden","true"),Object.assign(ve.style,vp),xe&&T&&T.insertAdjacentElement("afterend",ve);function Se(){const ye=P.current;let Ue=typeof ye=="function"?ye(V.current):ye;if(Ue===void 0||Ue===!1)return null;if(Ue===null&&(Ue=!0),typeof Ue=="boolean"){const Ee=T||Dy();return Ee&&Ee.isConnected?Ee:ve}const Ie=T||Dy()||ve;return qs(Ue)||Ie}return()=>{k.off("openchange",we);const ye=Bo(pe),Ue=Ot(C,ye)||B&&Sc(B.nodesRef.current,R(),!1).some(Ee=>Ot(Ee.context?.elements.floating,ye)),Ie=Se();queueMicrotask(()=>{const Ee=yK(Ie),Ve=typeof P.current!="boolean";P.current&&!ee.current&&Zt(Ee)&&(!(!Ve&&Ee!==ye&&ye!==pe.body)||Ue)&&Ee.focus({preventScroll:!0}),ve.remove(),ee.current=!1})}},[s,C,he,P,N,k,B,xe,T,R]),Le(()=>{if(!rx||w||!C)return;const pe=Bo(Rt(C));!Zt(pe)||!uA(pe)||Ot(C,pe)&&pe.blur()},[w,C]),Le(()=>{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]),Le(()=>{if(!(s||!he))return vC(he,j),()=>{queueMicrotask(cx)}},[s,he,j]);const ne=!s&&(f?!L:!0)&&(xe||f);return h.jsxs(_.Fragment,{children:[ne&&h.jsx(Qh,{"data-type":"inside",ref:W,onFocus:pe=>{if(f){const ae=_e();Iy(ae[ae.length-1])}else z?.portalNode&&(ee.current=!1,mu(pe,z.portalNode)?xA(T)?.focus():qs(y??z.beforeOutsideRef)?.focus())}}),n,ne&&h.jsx(Qh,{"data-type":"inside",ref:X,onFocus:pe=>{f?Iy(_e()[0]):z?.portalNode&&(d&&(ee.current=!0),mu(pe,z.portalNode)?SA(T)?.focus():qs(g??z.afterOutsideRef)?.focus())}})]})}function bC(e,t,n){let{reference:s,floating:i}=e;const a=Fr(t),l=ix(t),f=ox(l),d=Zn(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(xi(t)){case"start":x[l]-=b*(n&&p?-1:1);break;case"end":x[l]+=b*(n&&p?-1:1);break}return x}async function bK(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:a,rects:l,elements:f,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:b=!1,padding:x=0}=io(t,e),S=fA(x),T=f[b?y==="floating"?"reference":"floating":y],C=Kh(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})),k=y==="floating"?{x:s,y:i,width:l.floating.width,height:l.floating.height}:l.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},M=Kh(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:k,offsetParent:N,strategy:d}):k);return{top:(C.top-M.top+S.top)/R.y,bottom:(M.bottom-C.bottom+S.bottom)/R.y,left:(C.left-M.left+S.left)/R.x,right:(M.right-C.right+S.right)/R.x}}const xK=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:a=[],platform:l}=n,f=a.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.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:k}=f[T],{x:N,y:R,data:M,reset:L}=await k({x:g,y,initialPlacement:s,placement:b,strategy:i,middlewareData:x,rects:p,platform:{...l,detectOverflow:(w=l.detectOverflow)!=null?w:bK},elements:{reference:e,floating:t}});g=N??g,y=R??y,x={...x,[C]:{...x[C],...M}},L&&S<=50&&(S++,typeof L=="object"&&(L.placement&&(b=L.placement),L.rects&&(p=L.rects===!0?await l.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}},SK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:i,middlewareData:a,rects:l,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}=io(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const C=Zn(i),k=Fr(f),N=Zn(f)===f,R=await(d.isRTL==null?void 0:d.isRTL(p.floating)),M=b||(N||!w?[Vh(f)]:MV(f)),L=S!=="none";!b&&L&&M.push(...zV(f,w,S,R));const j=[f,...M],A=await d.detectOverflow(t,T),P=[];let G=((s=a.flip)==null?void 0:s.overflows)||[];if(g&&P.push(A[C]),y){const Y=OV(i,l,R);P.push(A[Y[0]],A[Y[1]])}if(G=[...G,{placement:i,overflows:P}],!P.every(Y=>Y<=0)){var B,z;const Y=(((B=a.flip)==null?void 0:B.index)||0)+1,ee=j[Y];if(ee&&(!(y==="alignment"?k!==Fr(ee):!1)||G.every(q=>Fr(q.placement)===k?q.overflows[0]>0:!0)))return{data:{index:Y,overflows:G},reset:{placement:ee}};let D=(z=G.filter(K=>K.overflows[0]<=0).sort((K,q)=>K.overflows[1]-q.overflows[1])[0])==null?void 0:z.placement;if(!D)switch(x){case"bestFit":{var Q;const K=(Q=G.filter(q=>{if(L){const V=Fr(q.placement);return V===k||V==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(V=>V>0).reduce((V,U)=>V+U,0)]).sort((q,V)=>q[1]-V[1])[0])==null?void 0:Q[0];K&&(D=K);break}case"initialPlacement":D=f;break}if(i!==D)return{reset:{placement:D}}}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 NV.some(t=>e[t]>=0)}const _K=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...a}=io(e,t);switch(i){case"referenceHidden":{const l=await s.detectOverflow(t,{...a,elementContext:"reference"}),f=xC(l,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:SC(f)}}}case"escaped":{const l=await s.detectOverflow(t,{...a,altBoundary:!0}),f=xC(l,n.floating);return{data:{escapedOffsets:f,escaped:SC(f)}}}default:return{}}}}},NA=new Set(["left","top"]);async function wK(e,t){const{placement:n,platform:s,elements:i}=e,a=await(s.isRTL==null?void 0:s.isRTL(i.floating)),l=Zn(n),f=xi(n),d=Fr(n)==="y",p=NA.has(l)?-1:1,g=a&&d?-1:1,y=io(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 EK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:i,y:a,placement:l,middlewareData:f}=t,d=await wK(t,e);return l===((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:l}}}}},TK=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:l=!0,crossAxis:f=!1,limiter:d={fn:C=>{let{x:k,y:N}=C;return{x:k,y:N}}},...p}=io(e,t),g={x:n,y:s},y=await a.detectOverflow(t,p),b=Fr(Zn(i)),x=sx(b);let S=g[x],w=g[b];if(l){const C=x==="y"?"top":"left",k=x==="y"?"bottom":"right",N=S+y[C],R=S-y[k];S=Lv(N,S,R)}if(f){const C=b==="y"?"top":"left",k=b==="y"?"bottom":"right",N=w+y[C],R=w-y[k];w=Lv(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]:l,[b]:f}}}}}},CK=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:i,rects:a,middlewareData:l}=t,{offset:f=0,mainAxis:d=!0,crossAxis:p=!0}=io(e,t),g={x:n,y:s},y=Fr(i),b=sx(y);let x=g[b],S=g[y];const w=io(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,M=a.reference[b]+a.reference[N]-T.mainAxis;x<R?x=R:x>M&&(x=M)}if(p){var C,k;const N=b==="y"?"width":"height",R=NA.has(Zn(i)),M=a.reference[y]-a.floating[N]+(R&&((C=l.offset)==null?void 0:C[y])||0)+(R?0:T.crossAxis),L=a.reference[y]+a.reference[N]+(R?0:((k=l.offset)==null?void 0:k[y])||0)-(R?T.crossAxis:0);S<M?S=M:S>L&&(S=L)}return{[b]:x,[y]:S}}}},RK=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:a,platform:l,elements:f}=t,{apply:d=()=>{},...p}=io(e,t),g=await l.detectOverflow(t,p),y=Zn(i),b=xi(i),x=Fr(i)==="y",{width:S,height:w}=a.floating;let T,C;y==="top"||y==="bottom"?(T=y,C=b===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(C=y,T=b==="end"?"top":"bottom");const k=w-g.top-g.bottom,N=S-g.left-g.right,R=Uc(w-g[T],k),M=Uc(S-g[C],N),L=!t.middlewareData.shift;let j=R,A=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(j=k),L&&!b){const G=dr(g.left,0),B=dr(g.right,0),z=dr(g.top,0),Q=dr(g.bottom,0);x?A=S-2*(G!==0||B!==0?G+B:dr(g.left,g.right)):j=w-2*(z!==0||Q!==0?z+Q:dr(g.top,g.bottom))}await d({...t,availableWidth:A,availableHeight:j});const P=await l.getDimensions(f.floating);return S!==P.width||w!==P.height?{reset:{rects:!0}}:{}}}};function jA(e){const t=xr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=Zt(e),a=i?e.offsetWidth:n,l=i?e.offsetHeight:s,f=qh(n)!==a||qh(s)!==l;return f&&(n=a,s=l),{width:n,height:s,$:f}}function lx(e){return jt(e)?e:e.contextElement}function wc(e){const t=lx(e);if(!Zt(t))return xs(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:a}=jA(t);let l=(a?qh(n.width):n.width)/s,f=(a?qh(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const NK=xs(0);function AA(e){const t=un(e);return!Sp()||!t.visualViewport?NK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jK(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==un(e)?!1:t}function fa(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=lx(e);let l=xs(1);t&&(s?jt(s)&&(l=wc(s)):l=wc(e));const f=jK(a,n,s)?AA(a):xs(0);let d=(i.left+f.x)/l.x,p=(i.top+f.y)/l.y,g=i.width/l.x,y=i.height/l.y;if(a){const b=un(a),x=s&&jt(s)?un(s):s;let S=b,w=Mv(S);for(;w&&s&&x!==S;){const T=wc(w),C=w.getBoundingClientRect(),k=xr(w),N=C.left+(w.clientLeft+parseFloat(k.paddingLeft))*T.x,R=C.top+(w.clientTop+parseFloat(k.paddingTop))*T.y;d*=T.x,p*=T.y,g*=T.x,y*=T.y,d+=N,p+=R,S=un(w),w=Mv(S)}}return Kh({width:g,height:y,x:d,y:p})}function jp(e,t){const n=_p(e).scrollLeft;return t?t.left+n:fa(_s(e)).left+n}function kA(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-jp(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function AK(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const a=i==="fixed",l=_s(s),f=t?xp(t.floating):!1;if(s===l||f&&a)return n;let d={scrollLeft:0,scrollTop:0},p=xs(1);const g=xs(0),y=Zt(s);if((y||!y&&!a)&&((gi(s)!=="body"||yi(l))&&(d=_p(s)),Zt(s))){const x=fa(s);p=wc(s),g.x=x.x+s.clientLeft,g.y=x.y+s.clientTop}const b=l&&!y&&!a?kA(l,d):xs(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 kK(e){return Array.from(e.getClientRects())}function OK(e){const t=_s(e),n=_p(e),s=e.ownerDocument.body,i=dr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),a=dr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let l=-n.scrollLeft+jp(e);const f=-n.scrollTop;return xr(s).direction==="rtl"&&(l+=dr(t.clientWidth,s.clientWidth)-i),{width:i,height:a,x:l,y:f}}const _C=25;function MK(e,t){const n=un(e),s=_s(e),i=n.visualViewport;let a=s.clientWidth,l=s.clientHeight,f=0,d=0;if(i){a=i.width,l=i.height;const g=Sp();(!g||g&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const p=jp(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:l,x:f,y:d}}const IK=new Set(["absolute","fixed"]);function PK(e,t){const n=fa(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zt(e)?wc(e):xs(1),l=e.clientWidth*a.x,f=e.clientHeight*a.y,d=i*a.x,p=s*a.y;return{width:l,height:f,x:d,y:p}}function wC(e,t,n){let s;if(t==="viewport")s=MK(e,n);else if(t==="document")s=OK(_s(e));else if(jt(t))s=PK(t,n);else{const i=AA(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Kh(s)}function OA(e,t){const n=oo(e);return n===t||!jt(n)||Ys(n)?!1:xr(n).position==="fixed"||OA(n,t)}function DK(e,t){const n=t.get(e);if(n)return n;let s=Wo(e,[],!1).filter(f=>jt(f)&&gi(f)!=="body"),i=null;const a=xr(e).position==="fixed";let l=a?oo(e):e;for(;jt(l)&&!Ys(l);){const f=xr(l),d=Yb(l);!d&&f.position==="fixed"&&(i=null),(a?!d&&!i:!d&&f.position==="static"&&!!i&&IK.has(i.position)||yi(l)&&!d&&OA(e,l))?s=s.filter(g=>g!==l):i=f,l=oo(l)}return t.set(e,s),s}function zK(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const l=[...n==="clippingAncestors"?xp(t)?[]:DK(t,this._c):[].concat(n),s],f=l[0],d=l.reduce((p,g)=>{const y=wC(t,g,i);return p.top=dr(y.top,p.top),p.right=Uc(y.right,p.right),p.bottom=Uc(y.bottom,p.bottom),p.left=dr(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 LK(e){const{width:t,height:n}=jA(e);return{width:t,height:n}}function UK(e,t,n){const s=Zt(t),i=_s(t),a=n==="fixed",l=fa(e,!0,a,t);let f={scrollLeft:0,scrollTop:0};const d=xs(0);function p(){d.x=jp(i)}if(s||!s&&!a)if((gi(t)!=="body"||yi(i))&&(f=_p(t)),s){const x=fa(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?kA(i,f):xs(0),y=l.left+f.scrollLeft-d.x-g.x,b=l.top+f.scrollTop-d.y-g.y;return{x:y,y:b,width:l.width,height:l.height}}function zy(e){return xr(e).position==="static"}function EC(e,t){if(!Zt(e)||xr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _s(e)===n&&(n=n.ownerDocument.body),n}function MA(e,t){const n=un(e);if(xp(e))return n;if(!Zt(e)){let i=oo(e);for(;i&&!Ys(i);){if(jt(i)&&!zy(i))return i;i=oo(i)}return n}let s=EC(e,t);for(;s&&f8(s)&&zy(s);)s=EC(s,t);return s&&Ys(s)&&zy(s)&&!Yb(s)?n:s||g8(e)||n}const $K=async function(e){const t=this.getOffsetParent||MA,n=this.getDimensions,s=await n(e.floating);return{reference:UK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function BK(e){return xr(e).direction==="rtl"}const FK={convertOffsetParentRelativeRectToViewportRelativeRect:AK,getDocumentElement:_s,getClippingRect:zK,getOffsetParent:MA,getElementRects:$K,getClientRects:kK,getDimensions:LK,getScale:wc,isElement:jt,isRTL:BK};function IA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function HK(e,t){let n=null,s;const i=_s(e);function a(){var f;clearTimeout(s),(f=n)==null||f.disconnect(),n=null}function l(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=pc(y),w=pc(i.clientWidth-(g+b)),T=pc(i.clientHeight-(y+x)),C=pc(g),N={rootMargin:-S+"px "+-w+"px "+-T+"px "+-C+"px",threshold:dr(0,Uc(1,d))||1};let R=!0;function M(L){const j=L[0].intersectionRatio;if(j!==d){if(!R)return l();j?l(!1,j):s=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!IA(p,e.getBoundingClientRect())&&l(),R=!1}try{n=new IntersectionObserver(M,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(M,N)}n.observe(e)}return l(!0),a}function TC(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=s,p=lx(e),g=i||a?[...p?Wo(p):[],...Wo(t)]:[];g.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),a&&C.addEventListener("resize",n)});const y=p&&f?HK(p,n):null;let b=-1,x=null;l&&(x=new ResizeObserver(C=>{let[k]=C;k&&k.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?fa(e):null;d&&T();function T(){const C=fa(e);w&&!IA(w,C)&&n(),w=C,S=requestAnimationFrame(T)}return n(),()=>{var C;g.forEach(k=>{i&&k.removeEventListener("scroll",n),a&&k.removeEventListener("resize",n)}),y?.(),(C=x)==null||C.disconnect(),x=null,d&&cancelAnimationFrame(S)}}const qK=EK,VK=TK,KK=SK,GK=RK,ZK=_K,YK=CK,XK=(e,t,n)=>{const s=new Map,i={platform:FK,...n},a={...i.platform,_c:s};return xK(e,t,{...i,platform:a})};var QK=typeof document<"u",WK=function(){},uh=QK?_.useLayoutEffect:WK;function Wh(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(!Wh(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)&&!Wh(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 Ly(e){const t=_.useRef(e);return uh(()=>{t.current=e}),t}function JK(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:a,floating:l}={},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);Wh(b,s)||x(s);const[S,w]=_.useState(null),[T,C]=_.useState(null),k=_.useCallback(q=>{q!==L.current&&(L.current=q,w(q))},[]),N=_.useCallback(q=>{q!==j.current&&(j.current=q,C(q))},[]),R=a||S,M=l||T,L=_.useRef(null),j=_.useRef(null),A=_.useRef(g),P=d!=null,G=Ly(d),B=Ly(i),z=Ly(p),Q=_.useCallback(()=>{if(!L.current||!j.current)return;const q={placement:t,strategy:n,middleware:b};B.current&&(q.platform=B.current),XK(L.current,j.current,q).then(V=>{const U={...V,isPositioned:z.current!==!1};Y.current&&!Wh(A.current,U)&&(A.current=U,hi.flushSync(()=>{y(U)}))})},[b,t,n,B,z]);uh(()=>{p===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,y(q=>({...q,isPositioned:!1})))},[p]);const Y=_.useRef(!1);uh(()=>(Y.current=!0,()=>{Y.current=!1}),[]),uh(()=>{if(R&&(L.current=R),M&&(j.current=M),R&&M){if(G.current)return G.current(R,M,Q);Q()}},[R,M,Q,G,P]);const ee=_.useMemo(()=>({reference:L,floating:j,setReference:k,setFloating:N}),[k,N]),D=_.useMemo(()=>({reference:R,floating:M}),[R,M]),K=_.useMemo(()=>{const q={position:n,left:0,top:0};if(!D.floating)return q;const V=CC(D.floating,g.x),U=CC(D.floating,g.y);return f?{...q,transform:"translate("+V+"px, "+U+"px)",...PA(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:U}},[n,f,D.floating,g.x,g.y]);return _.useMemo(()=>({...g,update:Q,refs:ee,elements:D,floatingStyles:K}),[g,Q,ee,D,K])}const e7=(e,t)=>({...qK(e),options:[e,t]}),t7=(e,t)=>({...VK(e),options:[e,t]}),n7=(e,t)=>({...YK(e),options:[e,t]}),r7=(e,t)=>({...KK(e),options:[e,t]}),s7=(e,t)=>({...GK(e),options:[e,t]}),o7=(e,t)=>({...ZK(e),options:[e,t]}),i7={intentional:"onClick",sloppy:"onPointerDown"};function a7(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function c7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("referenceElement"),l=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,k=Np(C),N=Ae(typeof y=="function"?y:()=>!1),R=typeof y=="function"?N:y,M=_.useRef(!1),{escapeKey:L,outsidePress:j}=a7(T),A=_.useRef(null),P=rs(),G=rs(),B=Ae(()=>{G.clear(),d.current.insideReactTree=!1}),z=_.useRef(!1),Q=_.useRef(""),Y=Ae(ne=>{Q.current=ne.pointerType}),ee=Ae(()=>{const ne=Q.current,pe=ne==="pen"||!ne?"mouse":ne,ae=typeof b=="function"?b():b;return typeof ae=="string"?ae:ae[pe]}),D=Ae(ne=>{if(!s||!p||!g||ne.key!=="Escape"||z.current)return;const pe=d.current.floatingContext?.nodeId,ae=k?Sc(k.nodesRef.current,pe):[];if(!L&&ae.length>0){let Se=!0;if(ae.forEach(ye=>{ye.context?.open&&!ye.context.dataRef.current.__escapeKeyBubbles&&(Se=!1)}),!Se)return}const we=wV(ne)?ne.nativeEvent:ne,ve=Yt(_8,we);n.setOpen(!1,ve),!L&&!ve.isPropagationAllowed&&ne.stopPropagation()}),K=Ae(ne=>{const pe=ee();return pe==="intentional"&&ne.type!=="click"||pe==="sloppy"&&ne.type==="click"}),q=Ae(()=>{d.current.insideReactTree=!0,G.start(0,B)}),V=Ae((ne,pe=!1)=>{if(K(ne)){B();return}if(d.current.insideReactTree){B();return}if(ee()==="intentional"&&pe||typeof R=="function"&&!R(ne))return;const ae=Ur(ne),we=`[${ju("inert")}]`,ve=Rt(n.select("floatingElement")).querySelectorAll(we),Se=n.context.triggerElements;if(ae&&(Se.hasElement(ae)||Se.hasMatchingElement(Ve=>Ot(Ve,ae))))return;let ye=jt(ae)?ae:null;for(;ye&&!Ys(ye);){const Ve=oo(ye);if(Ys(Ve)||!jt(Ve))break;ye=Ve}if(ve.length&&jt(ae)&&!_V(ae)&&!Ot(ae,n.select("floatingElement"))&&Array.from(ve).every(Ve=>!Ot(ye,Ve)))return;if(Zt(ae)&&!("touches"in ne)){const Ve=Ys(ae),Xe=xr(ae),Be=/auto|scroll/,We=Ve||Be.test(Xe.overflowX),He=Ve||Be.test(Xe.overflowY),me=We&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,Te=He&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,qe=Xe.direction==="rtl",mt=Te&&(qe?ne.offsetX<=ae.offsetWidth-ae.clientWidth:ne.offsetX>ae.clientWidth),lt=me&&ne.offsetY>ae.clientHeight;if(mt||lt)return}const Ue=d.current.floatingContext?.nodeId,Ie=k&&Sc(k.nodesRef.current,Ue).some(Ve=>es(ne,Ve.context?.elements.floating));if(es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||Ie)return;const Ee=k?Sc(k.nodesRef.current,Ue):[];if(Ee.length>0){let Ve=!0;if(Ee.forEach(Xe=>{Xe.context?.open&&!Xe.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}n.setOpen(!1,Yt($j,ne)),B()}),U=Ae(ne=>{ee()!=="sloppy"||ne.pointerType==="touch"||!n.select("open")||!p||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||V(ne)}),I=Ae(ne=>{if(ee()!=="sloppy"||!n.select("open")||!p||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement")))return;const pe=ne.touches[0];pe&&(A.current={startTime:Date.now(),startX:pe.clientX,startY:pe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}),H=Ae(ne=>{const pe=Ur(ne);function ae(){I(ne),pe?.removeEventListener(ne.type,ae)}pe?.addEventListener(ne.type,ae)}),W=Ae(ne=>{const pe=M.current;if(M.current=!1,P.clear(),ne.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const ae=Ur(ne);function we(){ne.type==="pointerdown"?U(ne):V(ne,pe),ae?.removeEventListener(ne.type,we)}ae?.addEventListener(ne.type,we)}),X=Ae(ne=>{if(ee()!=="sloppy"||!A.current||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement")))return;const pe=ne.touches[0];if(!pe)return;const ae=Math.abs(pe.clientX-A.current.startX),we=Math.abs(pe.clientY-A.current.startY),ve=Math.sqrt(ae*ae+we*we);ve>5&&(A.current.dismissOnTouchEnd=!0),ve>10&&(V(ne),P.clear(),A.current=null)}),oe=Ae(ne=>{const pe=Ur(ne);function ae(){X(ne),pe?.removeEventListener(ne.type,ae)}pe?.addEventListener(ne.type,ae)}),se=Ae(ne=>{ee()!=="sloppy"||!A.current||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&V(ne),P.clear(),A.current=null)}),de=Ae(ne=>{const pe=Ur(ne);function ae(){se(ne),pe?.removeEventListener(ne.type,ae)}pe?.addEventListener(ne.type,ae)});_.useEffect(()=>{if(!s||!p)return;d.current.__escapeKeyBubbles=L,d.current.__outsidePressBubbles=j;const ne=new ai;function pe(ye){n.setOpen(!1,Yt(ii,ye))}function ae(){ne.clear(),z.current=!0}function we(){ne.start(Sp()?5:0,()=>{z.current=!1})}const ve=Rt(i);ve.addEventListener("pointerdown",Y,!0),g&&(ve.addEventListener("keydown",D),ve.addEventListener("compositionstart",ae),ve.addEventListener("compositionend",we)),R&&(ve.addEventListener("click",W,!0),ve.addEventListener("pointerdown",W,!0),ve.addEventListener("touchstart",H,!0),ve.addEventListener("touchmove",oe,!0),ve.addEventListener("touchend",de,!0),ve.addEventListener("mousedown",W,!0));let Se=[];return w&&(jt(l)&&(Se=Wo(l)),jt(i)&&(Se=Se.concat(Wo(i))),!jt(a)&&a&&a.contextElement&&(Se=Se.concat(Wo(a.contextElement)))),Se=Se.filter(ye=>ye!==ve.defaultView?.visualViewport),Se.forEach(ye=>{ye.addEventListener("scroll",pe,{passive:!0})}),()=>{ve.removeEventListener("pointerdown",Y,!0),g&&(ve.removeEventListener("keydown",D),ve.removeEventListener("compositionstart",ae),ve.removeEventListener("compositionend",we)),R&&(ve.removeEventListener("click",W,!0),ve.removeEventListener("pointerdown",W,!0),ve.removeEventListener("touchstart",H,!0),ve.removeEventListener("touchmove",oe,!0),ve.removeEventListener("touchend",de,!0),ve.removeEventListener("mousedown",W,!0)),Se.forEach(ye=>{ye.removeEventListener("scroll",pe)}),ne.clear(),M.current=!1}},[d,i,a,l,g,R,s,f,w,p,L,j,D,V,W,U,H,oe,de,Y,n]),_.useEffect(B,[R,B]);const xe=_.useMemo(()=>({onKeyDown:D,...x&&{[i7[S]]:ne=>{n.setOpen(!1,Yt(aC,ne.nativeEvent))},...S!=="intentional"&&{onClick(ne){n.setOpen(!1,Yt(aC,ne.nativeEvent))}}}}),[D,n,x,S]),he=Ae(ne=>{const pe=Ur(ne.nativeEvent);!Ot(n.select("floatingElement"),pe)||ne.button!==0||(M.current=!0)}),Me=Ae(ne=>{!s||!p||ne.button!==0||(M.current=!0)}),_e=_.useMemo(()=>({onKeyDown:D,onPointerDown:he,onMouseDown:he,onMouseUp:he,onClickCapture:q,onMouseDownCapture(ne){q(),Me(ne)},onPointerDownCapture(ne){q(),Me(ne)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[D,he,q,Me]);return _.useMemo(()=>p?{reference:xe,floating:_e,trigger:xe}:{},[p,xe,_e])}oj({memoize:mq,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Pe=(e,t,n,s,i,a,...l)=>{if(l.length>0)throw new Error(yn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var l7=GN();const u7=Gb(19),f7=u7?h7:p7;function at(e,t,n,s,i){return f7(e,t,n,s,i)}function d7(e,t,n,s,i){const a=_.useCallback(()=>t(e.getSnapshot(),n,s,i),[e,t,n,s,i]);return l7.useSyncExternalStore(e.subscribe,a,a)}function h7(e,t,n,s,i){return d7(e,t,n,s,i)}function p7(e,t,n,s,i){return ZN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,s,i))}class m7{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 DA extends m7{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}useSyncedValue(t,n){_.useDebugValue(t),Le(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const s=this;Le(()=>(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);Le(()=>{n.update(t)},[n,...s])}useControlledProp(t,n){_.useDebugValue(t);const s=n!==void 0;Le(()=>{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??jn);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 l=s(a);if(!Object.is(i,l)){const f=i;i=l,n(l,f,this)}})}}const g7={open:Pe(e=>e.open),domReferenceElement:Pe(e=>e.domReferenceElement),referenceElement:Pe(e=>e.positionReference??e.referenceElement),floatingElement:Pe(e=>e.floatingElement),floatingId:Pe(e=>e.floatingId)};class ux extends DA{constructor(t){const{nested:n,noEmit:s,onOpenChange:i,triggerElements:a,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:aK(),nested:n,noEmit:s,triggerElements:a},g7)}setOpen=(t,n)=>{if((!t||!this.state.open||RV(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 Ap(e,t=!1,n=!1){const[s,i]=_.useState(e&&t?"idle":void 0),[a,l]=_.useState(e);return e&&!a&&(l(!0),i("starting")),!e&&a&&s!=="ending"&&!n&&i("ending"),!e&&!a&&s==="ending"&&i(void 0),Le(()=>{if(!e&&a&&s!=="ending"&&n){const f=ys.request(()=>{i("ending")});return()=>{ys.cancel(f)}}},[e,a,s,n]),Le(()=>{if(!e||t)return;const f=ys.request(()=>{i(void 0)});return()=>{ys.cancel(f)}},[t,e]),Le(()=>{if(!e||!t)return;e&&a&&s!=="idle"&&i("starting");const f=ys.request(()=>{i("idle")});return()=>{ys.cancel(f)}},[t,e,a,i,s]),_.useMemo(()=>({mounted:a,setMounted:l,transitionStatus:s}),[a,s])}let Au=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const y7={[Au.startingStyle]:""},v7={[Au.endingStyle]:""},va={transitionStatus(e){return e==="starting"?y7:e==="ending"?v7:null}};function b7(e,t=!1,n=!0){const s=ax();return Ae((i,a=null)=>{s.cancel();function l(){hi.flushSync(i)}const f=qs(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=Au.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||l()}).catch(()=>{const x=d.getAnimations();if(n){if(a?.aborted)return;l()}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 ba(e){const{enabled:t=!0,open:n,ref:s,onComplete:i}=e,a=Ae(i),l=b7(s,n,!1);_.useEffect(()=>{if(!t)return;const f=new AbortController;return l(a,f.signal),()=>{f.abort()}},[t,n,a,l])}function x7(e){const t=e.useState("open");Le(()=>{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 S7(e,t,n){const{mounted:s,setMounted:i,transitionStatus:a}=Ap(e);t.useSyncedValues({mounted:s,transitionStatus:a});const l=Ae(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),f=t.useState("preventUnmountingOnClose");return ba({enabled:!f,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:a}}class fx{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 _7(){return new ux({open:!1,floatingElement:null,referenceElement:null,triggerElements:new fx,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function w7(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:_7(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:an,inactiveTriggerProps:an,popupProps:an}}const Hd=Pe(e=>e.triggerIdProp??e.activeTriggerId),E7={open:Pe(e=>e.openProp??e.open),mounted:Pe(e=>e.mounted),transitionStatus:Pe(e=>e.transitionStatus),floatingRootContext:Pe(e=>e.floatingRootContext),preventUnmountingOnClose:Pe(e=>e.preventUnmountingOnClose),payload:Pe(e=>e.payload),activeTriggerId:Hd,activeTriggerElement:Pe(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Pe((e,t)=>t!==void 0&&Hd(e)===t),isOpenedByTrigger:Pe((e,t)=>t!==void 0&&Hd(e)===t&&e.open),isMountedByTrigger:Pe((e,t)=>t!==void 0&&Hd(e)===t&&e.mounted),triggerProps:Pe((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Pe(e=>e.popupProps),popupElement:Pe(e=>e.popupElement),positionerElement:Pe(e=>e.positionerElement)};function T7(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,i=Qu(),a=Rp()!=null,l=zn(()=>new ux({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:new fx,floatingId:i,nested:a,noEmit:!1})).current;return Le(()=>{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),l.update(f)},[t,i,s.reference,s.floating,l]),l.context.onOpenChange=n,l.context.nested=a,l.context.noEmit=!1,l}function C7(e={}){const{nodeId:t,externalTree:n}=e,s=T7(e),i=e.rootContext||s,a={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[l,f]=_.useState(null),d=_.useRef(null),p=Np(n);Le(()=>{a.domReference&&(d.current=a.domReference)},[a.domReference]);const g=JK({...e,elements:{...a,...l&&{reference:l}}}),y=_.useCallback(j=>{const A=jt(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;f(A),g.refs.setReference(A)},[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]),k=_.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"),M=i.useState("floatingId"),L=_.useMemo(()=>({...g,dataRef:i.context.dataRef,open:R,onOpenChange:i.setOpen,events:i.context.events,floatingId:M,refs:k,elements:N,nodeId:t,rootStore:i}),[g,k,N,t,i,R,M]);return Le(()=>{i.context.dataRef.current.floatingContext=L;const j=p?.nodesRef.current.find(A=>A.id===t);j&&(j.context=L)}),_.useMemo(()=>({...g,context:L,refs:k,elements:N,rootStore:i}),[g,k,N,L,i])}function R7(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:i}=e,a=Qu(),l=Rp()!=null,f=t.useState("open"),d=t.useState("activeTriggerElement"),p=t.useState(s?"popupElement":"positionerElement"),g=t.context.triggerElements,y=zn(()=>new ux({open:f,referenceElement:d,floatingElement:p,triggerElements:g,onOpenChange:i,floatingId:a,nested:l,noEmit:n})).current;return Le(()=>{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=l,y.context.noEmit=n,y}const RC=ju("safe-polygon"),N7=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${lA}`;function j7(e){return e?!!e.closest(N7):!1}class dx{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 ai,this.restTimeout=new ai,this.handleCloseOptions=void 0}static create(){return new dx}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function A7(e){const t=zn(dx.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),nx(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const k7=new Set(["click","mousedown"]);function O7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:f=!0,closeDelay:d=0}=t,p=A7(n),g=Np(),y=Rp(),b=Ae(()=>p.interactedInside?!0:l.current.openEvent?k7.has(l.current.openEvent.type):!1),x=Ae(()=>{const N=l.current.openEvent?.type;return N?.includes("mouse")&&N!=="mousedown"}),S=Ae(N=>SV(N,n.context.triggerElements)),w=_.useCallback((N,R=!0)=>{const M=M7(d,p.pointerType);M&&!p.handler?p.openChangeTimeout.start(M,()=>n.setOpen(!1,Yt(Pv,N))):R&&(p.openChangeTimeout.clear(),n.setOpen(!1,Yt(Pv,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}}),k=Ae(N=>{const R=Ur(N);if(!j7(R)){p.interactedInside=!1;return}p.interactedInside=!0});Le(()=>{s||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,T(),C())},[s,p,T,C]),_.useEffect(()=>()=>{T()},[T]),_.useEffect(()=>C,[C]),Le(()=>{if(f&&s&&p.handleCloseOptions?.blockPointerEvents&&x()&&jt(a)&&i){p.performedPointerEventsMutation=!0;const N=Rt(i).body;N.setAttribute(RC,"");const R=a,M=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",M.style.pointerEvents="auto",()=>{N.style.pointerEvents="",R.style.pointerEvents="",M.style.pointerEvents=""}}},[f,s,a,i,p,x,g,y]),_.useEffect(()=>{if(!f)return;function N(j){b()||!l.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 M(j){b()||w(j,!1)}const L=i;return L&&(L.addEventListener("mouseleave",N),L.addEventListener("mouseenter",R),L.addEventListener("mouseleave",M),L.addEventListener("pointerdown",k,!0)),()=>{L&&(L.removeEventListener("mouseleave",N),L.removeEventListener("mouseenter",R),L.removeEventListener("mouseleave",M),L.removeEventListener("pointerdown",k,!0))}},[f,i,n,l,b,S,w,C,T,k,p])}function M7(e,t){return t&&!CV(t)?0:typeof e=="function"?e():e}function I7(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=>qd(p,e,"reference"),t),l=_.useCallback(p=>qd(p,e,"floating"),n),f=_.useCallback(p=>qd(p,e,"item"),s),d=_.useCallback(p=>qd(p,e,"trigger"),i);return _.useMemo(()=>({getReferenceProps:a,getFloatingProps:l,getItemProps:f,getTriggerProps:d}),[a,l,f,d])}function qd(e,t,n){const s=new Map,i=n==="item",a={};n==="floating"&&(a.tabIndex=-1,a[zv]="");for(const l in e)i&&e&&(l===aA||l===cA)||(a[l]=e[l]);for(let l=0;l<t.length;l+=1){let f;const d=t[l]?.[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===aA||i===cA)||(i.startsWith("on")?(s.has(i)||s.set(i,[]),typeof a=="function"&&(s.get(i)?.push(a),e[i]=(...l)=>s.get(i)?.map(f=>f(...l)).find(f=>f!==void 0))):e[i]=a)}}const P7=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function D7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingId"),a=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:f="dialog"}=t,d=Qu(),p=a?.id||d,g=_.useMemo(()=>Hh(l)?.id||i,[l,i]),y=P7.get(f)??f,x=Rp()!=null,S=_.useMemo(()=>y==="tooltip"||f==="label"?an:{"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 k={id:g,...y&&{role:y}};return y==="tooltip"||f==="label"?k:{...k,...y==="menu"&&{"aria-labelledby":p}}},[y,g,p,f]),C=_.useCallback(({active:k,selected:N})=>{const R={role:"option",...k&&{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 Xi=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Au.startingStyle]="startingStyle",e[e.endingStyle=Au.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 z7={[jC.popupOpen]:"",[jC.pressed]:""},L7={[Xi.open]:""},U7={[Xi.closed]:""},$7={[Xi.anchorHidden]:""},B7={open(e){return e?z7:null}},il={open(e){return e?L7:U7},anchorHidden(e){return e?$7:null}},zA=_.createContext(void 0);function F7(){const e=_.useContext(zA);if(e===void 0)throw new Error(yn(70));return e}const H7=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,...f}=t,{portalNode:d,portalSubtree:p}=TA({container:i,ref:n,componentProps:t,elementProps:f});return!p&&!d?null:h.jsxs(_.Fragment,{children:[p,d&&hi.createPortal(s,d)]})}),q7=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t;return tx().useState("mounted")||s?h.jsx(zA.Provider,{value:s,children:h.jsx(H7,{ref:n,...i})}):null}),LA=_.createContext(void 0);function V7(){const e=_.useContext(LA);if(e===void 0)throw new Error(yn(71));return e}const K7=_.createContext(void 0);function UA(){return _.useContext(K7)?.direction??"ltr"}const G7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:i,rects:a,platform:l,elements:f,middlewareData:d}=t,{element:p,padding:g=0,offsetParent:y="real"}=io(e,t)||{};if(p==null)return{};const b=fA(g),x={x:n,y:s},S=ix(i),w=ox(S),T=await l.getDimensions(p),C=S==="y",k=C?"top":"left",N=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=a.reference[w]+a.reference[S]-x[S]-a.floating[w],L=x[S]-a.reference[S],j=y==="real"?await l.getOffsetParent?.(p):f.floating;let A=f.floating[R]||a.floating[w];(!A||!await l.isElement?.(j))&&(A=f.floating[R]||a.floating[w]);const P=M/2-L/2,G=A/2-T[w]/2-1,B=Math.min(b[k],G),z=Math.min(b[N],G),Q=B,Y=A-T[w]-z,ee=A/2-T[w]/2+P,D=Lv(Q,ee,Y),K=!d.arrow&&xi(i)!=null&&ee!==D&&a.reference[w]/2-(ee<Q?B:z)-T[w]/2<0,q=K?ee<Q?ee-Q:ee-Y:0;return{[S]:x[S]+q,data:{[S]:D,centerOffset:ee-D-q,...K&&{alignmentOffset:q}},reset:K}}}),Z7=(e,t)=>({...G7(e),options:[e,t]}),Y7={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 o7().fn(e)).data?.referenceHidden||a}}}},fh={sideX:"left",sideY:"top"},X7={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:s},elements:{floating:i},platform:a,strategy:l,placement:f}=e,d=un(i),p=d.getComputedStyle(i);if(!(p.transitionDuration!=="0s"&&p.transitionDuration!==""))return{x:t,y:n,data:fh};const y=await a.getOffsetParent?.(i);let b={width:0,height:0};if(l==="fixed"&&d?.visualViewport)b={width:d.visualViewport.width,height:d.visualViewport.height};else if(y===d){const k=Rt(i);b={width:k.documentElement.clientWidth,height:k.documentElement.clientHeight}}else await a.isElement?.(y)&&(b=await a.getDimensions(y));const x=Zn(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":fh.sideX,C=x==="top"?"bottom":fh.sideY;return{x:S,y:w,data:{sideX:T,sideY:C}}}};function $A(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:$A(t,Zn(i),n),align:xi(i)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function BA(e){const{anchor:t,positionMethod:n="absolute",side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:l=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:k,lazyFlip:N=!1,externalTree:R}=e,[M,L]=_.useState(null);!S&&M!==null&&L(null);const j=w.side||"flip",A=w.align||"flip",P=w.fallbackAxisSide||"end",G=typeof t=="function"?t:void 0,B=Ae(G),z=G?B:t,Q=Jo(t),ee=UA()==="rtl",D=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ee?"left":"right","inline-start":ee?"right":"left"}[s],K=a==="center"?D:`${D}-${a}`;let q=d;const V=1,U=s==="bottom"?V:0,I=s==="top"?V:0,H=s==="right"?V:0,W=s==="left"?V:0;typeof q=="number"?q={top:q+U,right:q+W,bottom:q+I,left:q+H}:q&&(q={top:(q.top||0)+U,right:(q.right||0)+W,bottom:(q.bottom||0)+I,left:(q.left||0)+H});const X={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:q},oe=_.useRef(null),se=Jo(i),de=Jo(l),Me=[e7(ot=>{const Wt=AC(ot,s,ee),vn=typeof se.current=="function"?se.current(Wt):se.current,kt=typeof de.current=="function"?de.current(Wt):de.current;return{mainAxis:vn,crossAxis:kt,alignmentAxis:kt}},[typeof i!="function"?i:0,typeof l!="function"?l:0,ee,s])],_e=A==="none"&&j!=="shift",ne=!_e&&(p||T||j==="shift"),pe=j==="none"?null:r7({...X,padding:{top:q.top+V,right:q.right+V,bottom:q.bottom+V,left:q.left+V},mainAxis:!T&&j==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:P}),ae=_e?null:t7(ot=>{const Wt=Rt(ot.elements.floating).documentElement;return{...X,rootBoundary:T?{x:0,y:0,width:Wt.clientWidth,height:Wt.clientHeight}:void 0,mainAxis:A!=="none",crossAxis:ne,limiter:p||T?void 0:n7(vn=>{if(!oe.current)return{};const{width:kt,height:Cn}=oe.current.getBoundingClientRect(),er=Fr(Zn(vn.placement)),An=er==="y"?kt:Cn,as=er==="y"?q.left+q.right:q.top+q.bottom;return{offset:An/2+as/2}})}},[X,p,T,q,A]);j==="shift"||A==="shift"||a==="center"?Me.push(ae,pe):Me.push(pe,ae),Me.push(s7({...X,apply({elements:{floating:ot},rects:{reference:Wt},availableWidth:vn,availableHeight:kt}){const Cn=ot.style;Cn.setProperty("--available-width",`${vn}px`),Cn.setProperty("--available-height",`${kt}px`),Cn.setProperty("--anchor-width",`${Wt.width}px`),Cn.setProperty("--anchor-height",`${Wt.height}px`)}}),Z7(()=>({element:oe.current||document.createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(ot){const{elements:Wt,middlewareData:vn,placement:kt,rects:Cn,y:er}=ot,An=Zn(kt),as=Fr(An),cs=oe.current,_a=vn.arrow?.x||0,_i=vn.arrow?.y||0,wi=cs?.clientWidth||0,ws=cs?.clientHeight||0,tr=_a+wi/2,ls=_i+ws/2,uo=Math.abs(vn.shift?.y||0),fo=Cn.reference.height/2,nr=typeof i=="function"?i(AC(ot,s,ee)):i,cl=uo>nr,cf={top:`${tr}px calc(100% + ${nr}px)`,bottom:`${tr}px ${-nr}px`,left:`calc(100% + ${nr}px) ${ls}px`,right:`${-nr}px ${ls}px`}[An],lf=`${tr}px ${Cn.reference.y+fo-er}px`;return Wt.floating.style.setProperty("--transform-origin",ne&&as==="y"&&cl?lf:cf),{}}},Y7,k),Le(()=>{!S&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[S,x]);const we=_.useMemo(()=>({elementResize:!y&&typeof ResizeObserver<"u",layoutShift:!y&&typeof IntersectionObserver<"u"}),[y]),{refs:ve,elements:Se,x:ye,y:Ue,middlewareData:Ie,update:Ee,placement:Ve,context:Xe,isPositioned:Be,floatingStyles:We}=C7({rootContext:x,placement:K,middleware:Me,strategy:n,whileElementsMounted:b?void 0:(...ot)=>TC(...ot,we),nodeId:C,externalTree:R}),{sideX:He,sideY:me}=Ie.adaptiveOrigin||fh,Te=Be?n:"fixed",qe=_.useMemo(()=>{const ot=k?{position:Te,[He]:ye,[me]:Ue}:{position:Te,...We};return Be||(ot.opacity=0),ot},[k,Te,He,ye,me,Ue,We,Be]),mt=_.useRef(null);Le(()=>{if(!S)return;const ot=Q.current,Wt=typeof ot=="function"?ot():ot,kt=(kC(Wt)?Wt.current:Wt)||null||null;kt!==mt.current&&(ve.setPositionReference(kt),mt.current=kt)},[S,ve,z,Q]),_.useEffect(()=>{if(!S)return;const ot=Q.current;typeof ot!="function"&&kC(ot)&&ot.current!==mt.current&&(ve.setPositionReference(ot.current),mt.current=ot.current)},[S,ve,z,Q]),_.useEffect(()=>{if(b&&S&&Se.domReference&&Se.floating)return TC(Se.domReference,Se.floating,Ee,we)},[b,S,Se,Ee,we]);const lt=Zn(Ve),wr=$A(s,lt,ee),Er=xi(Ve)||"center",Qt=!!Ie.hide?.referenceHidden;Le(()=>{N&&S&&Be&&L(lt)},[N,S,Be,lt]);const ut=_.useMemo(()=>({position:"absolute",top:Ie.arrow?.y,left:Ie.arrow?.x}),[Ie.arrow]),xt=Ie.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:qe,arrowStyles:ut,arrowRef:oe,arrowUncentered:xt,side:wr,align:Er,physicalSide:lt,anchorHidden:Qt,refs:ve,context:Xe,isPositioned:Be,update:Ee}),[qe,ut,oe,xt,wr,Er,lt,Qt,ve,Xe,Be,Ee])}function kC(e){return e!=null&&"current"in e}function kp(e){return e==="starting"?W9:an}const Q7=_.forwardRef(function(t,n){const{render:s,className:i,anchor:a,positionMethod:l="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=t8,...C}=t,k=tx(),N=F7(),R=k.useState("open"),M=k.useState("mounted"),L=k.useState("trackCursorAxis"),j=k.useState("disableHoverablePopup"),A=k.useState("floatingRootContext"),P=k.useState("instantType"),G=k.useState("transitionStatus"),B=k.useState("hasViewport"),z=BA({anchor:a,positionMethod:l,floatingRootContext:A,mounted:M,side:f,sideOffset:p,align:d,alignOffset:g,collisionBoundary:y,collisionPadding:b,sticky:S,arrowPadding:x,disableAnchorTracking:w,keepMounted:N,collisionAvoidance:T,adaptiveOrigin:B?X7:void 0}),Q=_.useMemo(()=>{const K={};return(!R||L==="both"||j)&&(K.pointerEvents="none"),{role:"presentation",hidden:!M,style:{...z.positionerStyles,...K}}},[R,L,j,M,z.positionerStyles]),Y=_.useMemo(()=>({open:R,side:z.side,align:z.align,anchorHidden:z.anchorHidden,instant:L!=="none"?"tracking-cursor":P}),[R,z.side,z.align,z.anchorHidden,L,P]),ee=_.useMemo(()=>({...Y,arrowRef:z.arrowRef,arrowStyles:z.arrowStyles,arrowUncentered:z.arrowUncentered}),[Y,z.arrowRef,z.arrowStyles,z.arrowUncentered]),D=zt("div",t,{state:Y,props:[Q,kp(G),C],ref:[n,k.useStateSetter("positionerElement")],stateAttributesMapping:il});return h.jsx(LA.Provider,{value:ee,children:D})}),W7={...il,...va},J7=_.forwardRef(function(t,n){const{className:s,render:i,...a}=t,l=tx(),{side:f,align:d}=V7(),p=l.useState("open"),g=l.useState("instantType"),y=l.useState("transitionStatus"),b=l.useState("popupProps"),x=l.useState("floatingRootContext");ba({open:p,ref:l.context.popupRef,onComplete(){p&&l.context.onOpenChangeComplete?.(!0)}});const S=l.useState("disabled"),w=l.useState("closeDelay");return O7(x,{enabled:!S,closeDelay:w}),zt("div",t,{state:{open:p,side:f,align:d,instant:g,transitionStatus:y},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[b,kp(y),a],stateAttributesMapping:W7})});function hx(e){return Gb(19)?e:e?"true":void 0}const eG=_.forwardRef(({className:e,sideOffset:t=4,children:n,...s},i)=>h.jsx(q7,{children:h.jsx(Q7,{sideOffset:t,children:h.jsx(J7,{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})})}));eG.displayName="TooltipContent";function OC(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const FA=_.forwardRef(({className:e,clients:t,positions:n,relayClientIds:s=[],serverPosition:i={x:420,y:190},relayPosition:a={x:780,y:190},viewBox:l={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,A)=>{const P=s.includes(j.id),G=P?S:b,B=P?w:x,z=P?240:260,Q=P?130:150,Y=C*A-Math.PI/2;T[j.id]={x:G+z*Math.cos(Y),y:B+Q*Math.sin(Y)}});const k={};if(n)for(const j of n)k[j.clientId]={x:j.x,y:j.y};function N(j){return k[j]??T[j]??{x:600,y:190}}const R=f??t.length+2,M=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:[M," 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 ${l.width} ${l.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 A=N(j.id),P=s.includes(j.id),G=P?S:b,B=P?w:x,z=OC(j.status),Q=j.status==="syncing"?2.5:1.5;if(j.status==="offline")return h.jsx("line",{x1:G,y1:B,x2:A.x,y2:A.y,stroke:z,strokeWidth:1,strokeDasharray:"3 6",opacity:.2},`line-${j.id}`);const Y=j.status==="syncing"?"1.2s":"2.8s",ee=`${Number.parseFloat(Y)/2}s`;return h.jsxs("g",{children:[h.jsx("line",{x1:G,y1:B,x2:A.x,y2:A.y,stroke:z,strokeWidth:Q,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${G},${B} L${A.x},${A.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:ee,repeatCount:"indefinite",path:`M${A.x},${A.y} L${G},${B}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.5;0.5;0",dur:Y,begin:ee,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 A=N(j.id),P=OC(j.status),G=j.status==="offline"?.25:1,B=j.actor.replace("user-","").replace("svc-",""),z=s.includes(j.id);return h.jsxs("g",{opacity:G,children:[h.jsx("circle",{cx:A.x,cy:A.y,r:20,fill:"#0c0c0c",stroke:P,strokeWidth:1.5}),h.jsx("circle",{cx:A.x,cy:A.y,r:5,fill:P}),h.jsx("text",{x:A.x,y:A.y+32,textAnchor:"middle",fill:"#555",fontFamily:"JetBrains Mono, monospace",fontSize:9,children:B}),h.jsxs("text",{x:A.x,y:A.y+42,textAnchor:"middle",fill:"#333",fontFamily:"JetBrains Mono, monospace",fontSize:7,children:[j.type,z?" · relay":""]})]},`node-${j.id}`)})]})]})});FA.displayName="TopologyHero";let MC=(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 HA(e){return _.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[MC.checked]:""}:{[MC.unchecked]:""}},...vi}),[e.indeterminate])}const tG=_.createContext({disabled:!1});function nG(){return _.useContext(tG)}const rG=_.createContext(void 0);function sG(e=!0){const t=_.useContext(rG);if(t===void 0&&!e)throw new Error(yn(3));return t}const qA=_.createContext(void 0);function oG(){const e=_.useContext(qA);if(e===void 0)throw new Error(yn(14));return e}const iG="data-parent",aG=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a=!1,disabled:l=!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:k=!1,...N}=t,{clearErrors:R}=tl(),{disabled:M,name:L,setDirty:j,setFilled:A,setFocused:P,setTouched:G,state:B,validationMode:z,validityData:Q,shouldValidateOnChange:Y,validation:ee}=bi(),D=nG(),{labelId:K,controlId:q,registerControlId:V,getDescriptionProps:U}=co(),I=sG(),H=I?.parent,W=H&&I.allValues,X=M||D.disabled||I?.disabled||l,oe=L??g,se=C??oe,de=br(),xe=br();let he=q;W?he=b?xe:`${H.id}-${se}`:f&&(he=f);let Me={};W&&(b?Me=I.parent.getParentProps():se&&(Me=I.parent.getChildProps(se)));const _e=Ae(y),{checked:ne=s,indeterminate:pe=d,onCheckedChange:ae,...we}=Me,ve=I?.value,Se=I?.setValue,ye=I?.defaultValue,Ue=_.useRef(null),Ie=zn(()=>Symbol("checkbox-control")),Ee=_.useRef(!1),{getButtonProps:Ve,buttonRef:Xe}=el({disabled:X,native:k}),Be=I?.validation??ee,[We,He]=yp({controlled:se&&ve&&!b?ve.includes(se):ne,default:se&&ye&&!b?ye.includes(se):a,name:"Checkbox",state:"checked"});Le(()=>{V!==jn&&(Ee.current=!0,V(Ie.current,he))},[he,I,V,b,Ie]),_.useEffect(()=>{const ut=Ie.current;return()=>{!Ee.current||V===jn||(Ee.current=!1,V(ut,void 0))}},[V,Ie]),zj({enabled:!I,id:de,commit:Be.commit,value:We,controlRef:Ue,name:oe,getValue:()=>We});const me=_.useRef(null),Te=so(p,me,Be.inputRef);Le(()=>{me.current&&(me.current.indeterminate=pe,We&&A(!0))},[We,pe,A]),Fj(We,()=>{I&&!b||(R(oe),A(We),j(We!==Q.initialValue),Y()?Be.commit(We):Be.commit(We,!0))});const qe=oi({checked:We,disabled:X,name:b?void 0:oe,id:k?void 0:he??void 0,required:w,ref:Te,style:oe?Nj:vp,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ut){if(ut.nativeEvent.defaultPrevented)return;const xt=ut.target.checked,ot=Yt(ii,ut.nativeEvent);if(ae?.(xt,ot),_e(xt,ot),!ot.isCanceled&&(He(xt),se&&ve&&Se&&!b)){const Wt=xt?[...ve,se]:ve.filter(vn=>vn!==se);Se(Wt,ot)}},onFocus(){Ue.current?.focus()}},C!==void 0?{value:(I?We&&C:C)||""}:an,U,I?Be.getValidationProps:Be.getInputValidationProps),mt=W?!!ne:We,lt=W&&pe||d;_.useEffect(()=>{if(!H||!se)return;const ut=H.disabledStatesRef.current;return ut.set(se,X),()=>{ut.delete(se)}},[H,X,se]);const wr=_.useMemo(()=>({...B,checked:mt,disabled:X,readOnly:x,required:w,indeterminate:lt}),[B,mt,X,x,w,lt]),Er=HA(wr),Qt=zt("span",t,{state:wr,ref:[Xe,Ue,n,I?.registerControlRef],props:[{id:k?he??void 0:de,role:"checkbox","aria-checked":pe?"mixed":We,"aria-readonly":x||void 0,"aria-required":w||void 0,"aria-labelledby":K,[iG]:b?"":void 0,onFocus(){P(!0)},onBlur(){const ut=me.current;ut&&(G(!0),P(!1),z==="onBlur"&&Be.commit(I?ve:ut.checked))},onClick(ut){x||X||(ut.preventDefault(),me.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ut.shiftKey,ctrlKey:ut.ctrlKey,altKey:ut.altKey,metaKey:ut.metaKey})))}},U,Be.getValidationProps,N,we,Ve],stateAttributesMapping:Er});return h.jsxs(qA.Provider,{value:wr,children:[Qt,!We&&!I&&oe&&!b&&T!==void 0&&h.jsx("input",{type:"hidden",name:oe,value:T}),h.jsx("input",{...qe})]})}),cG=_.forwardRef(function(t,n){const{render:s,className:i,keepMounted:a=!1,...l}=t,f=oG(),d=f.checked||f.indeterminate,{mounted:p,transitionStatus:g,setMounted:y}=Ap(d),b=_.useRef(null),x={...f,transitionStatus:g};ba({open:d,ref:b,onComplete(){d||y(!1)}});const S=HA(f),w=_.useMemo(()=>({...S,...va,...vi}),[S]),T=a||p,C=zt("span",t,{ref:[n,b],state:x,stateAttributesMapping:w,props:l});return T?C:null}),Fv=_.forwardRef(({className:e,label:t,...n},s)=>{const i=h.jsx(aG,{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(cG,{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});Fv.displayName="Checkbox";const lG=_.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function uG(e=!1){const t=_.useContext(lG);if(!t&&!e)throw new Error(yn(86));return t}const fG=function(t){const n=br(),[s,i]=_.useState(t.initialControlId===void 0?n:t.initialControlId),[a,l]=_.useState(void 0),[f,d]=_.useState([]),p=zn(()=>new Map),{messageIds:g}=co(),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 k;for(const N of T.values()){if(C!==void 0&&N===C)return C;k===void 0&&(k=N)}return k})}),b=_.useCallback(S=>oi({"aria-describedby":g.concat(f).join(" ")||void 0},S),[g,f]),x=_.useMemo(()=>({controlId:s,registerControlId:y,labelId:a,setLabelId:l,messageIds:f,setMessageIds:d,getDescriptionProps:b}),[s,y,a,l,f,d,b]);return h.jsx(Lj.Provider,{value:x,children:t.children})},dh=Object.keys(wp);function dG(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of dh)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function hG(e){const{formRef:t,clearErrors:n}=tl(),{setValidityData:s,validate:i,validityData:a,validationDebounceTime:l,invalid:f,markedDirtyRef:d,state:p,name:g,shouldValidateOnChange:y}=e,{controlId:b,getDescriptionProps:x}=co(),S=rs(),w=_.useRef(null),T=Ae(async(N,R=!1)=>{const M=w.current;if(!M)return;if(R){if(p.valid!==!1)return;const Q=M.validity;if(!Q.valueMissing){const ee={value:N,state:{...wp,valid:!0},error:"",errors:[],initialValue:a.initialValue};if(M.setCustomValidity(""),b){const D=t.current.fields.get(b);D&&t.current.fields.set(b,{...D,...Iv(ee,!1)})}s(ee);return}const Y=dh.reduce((ee,D)=>(ee[D]=Q[D],ee),{});if(!Y.valid&&!dG(Y))return}function L(Q){const Y=dh.reduce((D,K)=>(D[K]=Q.validity[K],D),{});let ee=!1;for(const D of dh)if(D!=="valid"){if(D==="valueMissing"&&Y[D])ee=!0;else if(Y[D])return Y}return ee&&!d.current&&(Y.valid=!0,Y.valueMissing=!1),Y}S.clear();let j=null,A=[];const P=L(M);let G;const B=y();if(M.validationMessage&&!B)G=M.validationMessage,A=[M.validationMessage];else{const Q=Array.from(t.current.fields.values()).reduce((ee,D)=>(D.name&&(ee[D.name]=D.getValue()),ee),{}),Y=i(N,Q);typeof Y=="object"&&Y!==null&&"then"in Y?j=await Y:j=Y,j!==null?(P.valid=!1,P.customError=!0,Array.isArray(j)?(A=j,M.setCustomValidity(j.join(`
75
+ `))):j&&(A=[j],M.setCustomValidity(j))):B&&(M.setCustomValidity(""),P.customError=!1,M.validationMessage?(G=M.validationMessage,A=[M.validationMessage]):M.validity.valid&&!P.valid&&(P.valid=!0))}const z={value:N,state:P,error:G??(Array.isArray(j)?j[0]:j??""),errors:A,initialValue:a.initialValue};if(b){const Q=t.current.fields.get(b);Q&&t.current.fields.set(b,{...Q,...Iv(z,f)})}s(z)}),C=_.useCallback((N={})=>oi(x,p.valid===!1?{"aria-invalid":!0}:an,N),[x,p.valid]),k=_.useCallback((N={})=>oi({onChange(R){if(R.nativeEvent.defaultPrevented)return;if(n(g),!y()){T(R.currentTarget.value,!0);return}if(f)return;const M=R.currentTarget;if(M.value===""){T(M.value);return}S.clear(),l?S.start(l,()=>{T(M.value)}):T(M.value)}},C(N)),[C,n,g,S,T,f,l,y]);return _.useMemo(()=>({getValidationProps:C,getInputValidationProps:k,inputRef:w,commit:T}),[C,k,T])}const pG=_.forwardRef(function(t,n){const{errors:s,validationMode:i,submitAttemptedRef:a}=tl(),{render:l,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:k}=uG(),N=Ae(d||(()=>null)),R=k||b,[M,L]=_.useState(!1),[j,A]=_.useState(!1),[P,G]=_.useState(!1),[B,z]=_.useState(!1),Q=S??j,Y=w??M,ee=_.useRef(!1),D=Ae(xe=>{S===void 0&&(xe&&(ee.current=!0),A(xe))}),K=Ae(xe=>{w===void 0&&L(xe)}),q=Ae(()=>g==="onChange"||g==="onSubmit"&&a.current),V=!!(x||y&&{}.hasOwnProperty.call(s,y)&&s[y]!==void 0),[U,I]=_.useState({state:wp,error:"",errors:[],value:null,initialValue:null}),H=!V&&U.state.valid,W=_.useMemo(()=>({disabled:R,touched:Y,dirty:Q,valid:H,filled:P,focused:B}),[R,Y,Q,H,P,B]),X=hG({setValidityData:I,validate:N,validityData:U,validationDebounceTime:p,invalid:V,markedDirtyRef:ee,state:W,name:y,shouldValidateOnChange:q}),oe=_.useCallback(()=>{ee.current=!0,X.commit(U.value)},[X,U]);_.useImperativeHandle(T,()=>({validate:oe}),[oe]);const se=_.useMemo(()=>({invalid:V,name:y,validityData:U,setValidityData:I,disabled:R,touched:Y,setTouched:K,dirty:Q,setDirty:D,filled:P,setFilled:G,focused:B,setFocused:z,validate:N,validationMode:g,validationDebounceTime:p,shouldValidateOnChange:q,state:W,markedDirtyRef:ee,validation:X}),[V,y,U,R,Y,K,Q,D,P,G,B,z,N,g,p,q,W,X]),de=zt("div",t,{ref:n,state:W,props:C,stateAttributesMapping:vi});return h.jsx(Dj.Provider,{value:se,children:de})}),mG=_.forwardRef(function(t,n){return h.jsx(fG,{children:h.jsx(pG,{...t,ref:n})})}),gG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,nativeLabel:l=!0,...f}=t,d=bi(!1),{controlId:p,setLabelId:g,labelId:y}=co(),b=br(a),x=_.useRef(null),S=Ae(T=>{if(Ur(T.nativeEvent)?.closest("button,input,select,textarea")||(!T.defaultPrevented&&T.detail>1&&T.preventDefault(),l||!p))return;const k=Rt(T.currentTarget).getElementById(p);Zt(k)&&k.focus({focusVisible:!0})});return Le(()=>(b&&g(b),()=>{g(void 0)}),[b,g]),zt("label",t,{ref:[n,x],state:d.state,props:[{id:y},l?{htmlFor:p??void 0,onMouseDown:S}:{onClick:S,onPointerDown(T){T.preventDefault()}},f],stateAttributesMapping:vi})}),yG={...vi,...va},vG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,match:l,...f}=t,d=br(i),{validityData:p,state:g,name:y}=bi(!1),{setMessageIds:b}=co(),{errors:x}=tl(),S=y?x[y]:null;let w=!1;S||l===!0?w=!0:l?w=!!p.state[l]:w=p.state.valid===!1;const{mounted:T,transitionStatus:C,setMounted:k}=Ap(w);Le(()=>{if(!(!w||!d))return b(z=>z.concat(d)),()=>{b(z=>z.filter(Q=>Q!==d))}},[w,d,b]);const N=_.useRef(null),[R,M]=_.useState(null),[L,j]=_.useState(null),A=S||(p.errors.length>1?h.jsx("ul",{children:p.errors.map(z=>h.jsx("li",{children:z},z))}):p.error);let P=p.error;S!=null?P=Array.isArray(S)?JSON.stringify(S):S:p.errors.length>1&&(P=JSON.stringify(p.errors)),w&&P!==L&&(j(P),M(A)),ba({open:w,ref:N,onComplete(){w||k(!1)}});const G={...g,transitionStatus:C},B=zt("div",t,{ref:[n,N],state:G,props:[{id:d,children:w?A:R},f],stateAttributesMapping:yG,enabled:T});return T?B:null}),bG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,...l}=t,f=br(i),d=bi(!1),{setMessageIds:p}=co();return Le(()=>{if(f)return p(y=>y.concat(f)),()=>{p(y=>y.filter(b=>b!==f))}},[f,p]),zt("p",t,{ref:n,state:d.state,props:[{id:f},l],stateAttributesMapping:vi})}),ms=mG,ts=_.forwardRef(({className:e,...t},n)=>h.jsx(gG,{ref:n,className:ge("font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",e),...t}));ts.displayName="FieldLabel";const mc=_.forwardRef(({className:e,...t},n)=>h.jsx(bG,{ref:n,className:ge("font-mono text-[9px] text-neutral-600 mt-0.5",e),...t}));mc.displayName="FieldDescription";const xG=_.forwardRef(({className:e,...t},n)=>h.jsx(vG,{ref:n,className:ge("font-mono text-[10px] text-offline mt-1",e),...t}));xG.displayName="FieldError";const SG=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge(e),...t}));SG.displayName="FieldContent";const _G=_.createContext(null),wG=_.createContext(null);function Ju(){const e=_.useContext(_G);if(e===null)throw new Error(yn(60));return e}function VA(){const e=_.useContext(wG);if(e===null)throw new Error(yn(61));return e}function Bc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function EG(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:Bc(t,s,n))}function Uy(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:Bc(s,t,n))}function TG(e,t,n){return e.filter(s=>!Bc(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 CG(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function RG(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(CG(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 NG(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:Pe(e=>e.id),modal:Pe(e=>e.modal),multiple:Pe(e=>e.multiple),items:Pe(e=>e.items),itemToStringLabel:Pe(e=>e.itemToStringLabel),itemToStringValue:Pe(e=>e.itemToStringValue),isItemEqualToValue:Pe(e=>e.isItemEqualToValue),value:Pe(e=>e.value),hasSelectedValue:Pe(e=>{const{value:t,multiple:n,itemToStringValue:s}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:NG(t,s)!==""}),hasNullItemLabel:Pe((e,t)=>t?RG(e.items):!1),open:Pe(e=>e.open),mounted:Pe(e=>e.mounted),forceMount:Pe(e=>e.forceMount),transitionStatus:Pe(e=>e.transitionStatus),openMethod:Pe(e=>e.openMethod),activeIndex:Pe(e=>e.activeIndex),selectedIndex:Pe(e=>e.selectedIndex),isActive:Pe((e,t)=>e.activeIndex===t),isSelected:Pe((e,t,n)=>{const s=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(a=>Bc(n,a,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Bc(n,i,s)}),isSelectedByFocus:Pe((e,t)=>e.selectedIndex===t),popupProps:Pe(e=>e.popupProps),triggerProps:Pe(e=>e.triggerProps),triggerElement:Pe(e=>e.triggerElement),positionerElement:Pe(e=>e.positionerElement),listElement:Pe(e=>e.listElement),scrollUpArrowVisible:Pe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Pe(e=>e.scrollDownArrowVisible),hasScrollArrows:Pe(e=>e.hasScrollArrows)};function jG(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 AG(e){const[t,n]=_.useState(null),s=Ae((f,d)=>{e||n(d||(iA?"touch":""))}),i=_.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:l}=jG(s);return _.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:l}}),[t,i,a,l])}function kG(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,l=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,l,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 Vd=2,OG=400,PC=200,MG={...B7,...vi,value:()=>null},IG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,disabled:l=!1,nativeButton:f=!0,...d}=t,{setTouched:p,setFocused:g,validationMode:y,state:b,disabled:x}=bi(),{labelId:S}=co(),{store:w,setOpen:T,selectionRef:C,validation:k,readOnly:N,required:R,alignItemWithTriggerActiveRef:M,disabled:L,keyboardActiveRef:j}=Ju(),A=x||L||l,P=at(w,it.open),G=at(w,it.value),B=at(w,it.triggerProps),z=at(w,it.positionerElement),Q=at(w,it.listElement),Y=at(w,it.id),ee=at(w,it.hasSelectedValue),D=!ee&&P,K=at(w,it.hasNullItemLabel,D),q=a??Y;Uj({id:q});const V=Jo(z),U=_.useRef(null),{getButtonProps:I,buttonRef:H}=el({disabled:A,native:f}),W=Ae(ne=>{w.set("triggerElement",ne)}),X=so(n,U,H,W),oe=rs(),se=rs(),de=rs(),xe=rs();_.useEffect(()=>{if(P)return!(ee||K)?de.start(OG,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}):xe.start(PC,()=>{C.current.allowUnselectedMouseUp=!0,de.start(PC,()=>{C.current.allowSelectedMouseUp=!0})}),()=>{de.clear(),xe.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},se.clear()},[P,ee,K,C,se,de,xe]);const he=_.useMemo(()=>Q?.id??Hh(z)?.id,[Q,z]),Me=oi(B,{id:q,role:"combobox","aria-expanded":P?"true":"false","aria-haspopup":"listbox","aria-controls":P?he:void 0,"aria-labelledby":S,"aria-readonly":N||void 0,"aria-required":R||void 0,tabIndex:A?-1:0,ref:X,onFocus(ne){g(!0),P&&M.current&&T(!1,Yt(ii,ne.nativeEvent)),oe.start(0,()=>{w.set("forceMount",!0)})},onBlur(ne){Ot(z,ne.relatedTarget)||(p(!0),g(!1),y==="onBlur"&&k.commit(G))},onPointerMove(){j.current=!1},onKeyDown(){j.current=!0},onMouseDown(ne){if(P)return;const pe=Rt(ne.currentTarget);function ae(we){if(!U.current)return;const ve=we.target;if(Ot(U.current,ve)||Ot(V.current,ve)||ve===U.current)return;const Se=kG(U.current);we.clientX>=Se.left-Vd&&we.clientX<=Se.right+Vd&&we.clientY>=Se.top-Vd&&we.clientY<=Se.bottom+Vd||T(!1,Yt(w8,we))}se.start(0,()=>{pe.addEventListener("mouseup",ae,{once:!0})})}},k.getValidationProps,d,I);Me.role="combobox";const _e={...b,open:P,disabled:A,value:G,readOnly:N,placeholder:!ee};return zt("button",t,{ref:[n,U],state:_e,stateAttributesMapping:MG,props:Me})}),PG=_.createContext(void 0),DG=_.forwardRef(function(t,n){const{store:s}=Ju(),i=at(s,it.mounted),a=at(s,it.forceMount);return i||a?h.jsx(PG.Provider,{value:!0,children:h.jsx(CA,{ref:n,...t})}):null});let DC={},zC={},LC="";function zG(e){if(typeof document>"u")return!1;const t=Rt(e);return un(t).innerWidth-t.documentElement.clientWidth>0}function LG(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=yi(s)?s:i,l=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=l,s.style.scrollbarGutter=f,d===p}function UG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=yi(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 $G(e){const t=Rt(e),n=t.documentElement,s=t.body,i=un(n);let a=0,l=0,f=!1;const d=ys.create();if(rx&&(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,l=n.scrollLeft,DC={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,k=n.scrollWidth>n.clientWidth,N=b.overflowY==="scroll"||x.overflowY==="scroll",R=b.overflowX==="scroll"||x.overflowX==="scroll",M=Math.max(0,i.innerWidth-s.clientWidth),L=Math.max(0,i.innerHeight-s.clientHeight),j=parseFloat(x.marginTop)+parseFloat(x.marginBottom),A=parseFloat(x.marginLeft)+parseFloat(x.marginRight),P=yi(n)?n:s;if(f=LG(e),f){n.style.scrollbarGutter=T,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(C||N)&&(n.style.overflowY="scroll"),(k||R)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:j||L?`calc(100dvh - ${j+L}px)`:"100dvh",width:A||M?`calc(100vw - ${A+M}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=a,s.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function g(){Object.assign(n.style,DC),Object.assign(s.style,zC),f||(n.scrollTop=a,n.scrollLeft=l,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 BG{lockCount=0;restore=null;timeoutLock=ai.create();timeoutUnlock=ai.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=un(s).getComputedStyle(s).overflowY;if(i==="hidden"||i==="clip"){this.restore=jn;return}const a=iA||!zG(t);this.restore=a?UG(t):$G(t)}}const FG=new BG;function KA(e=!0,t=null){Le(()=>{if(e)return FG.acquire(t)},[e,t])}const GA=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function HG(){return _.useContext(GA)}function ZA(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:i}=e,a=Ae(i),l=_.useRef(0),f=zn(VG).current,d=zn(qG).current,[p,g]=_.useState(0),y=_.useRef(p),b=Ae((C,k)=>{d.set(C,k??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(KG).forEach((N,R)=>{const M=d.get(N)??{};C.set(N,{...M,index:R})}),C},[d,p]);Le(()=>{if(typeof MutationObserver!="function"||S.size===0)return;const C=new MutationObserver(k=>{const N=new Set,R=M=>N.has(M)?N.delete(M):N.add(M);k.forEach(M=>{M.removedNodes.forEach(R),M.addedNodes.forEach(R)}),N.size===0&&(y.current+=1,g(y.current))});return S.forEach((k,N)=>{N.parentElement&&C.observe(N.parentElement,{childList:!0})}),()=>{C.disconnect()}},[S]),Le(()=>{y.current===p&&(n.current.length!==S.size&&(n.current.length=S.size),s&&s.current.length!==S.size&&(s.current.length=S.size),l.current=S.size),a(S)},[a,S,n,s,p]),Le(()=>()=>{n.current=[]},[n]),Le(()=>()=>{s&&(s.current=[])},[s]);const w=Ae(C=>(f.add(C),()=>{f.delete(C)}));Le(()=>{f.forEach(C=>C(S))},[f,S]);const T=_.useMemo(()=>({register:b,unregister:x,subscribeMapChange:w,elementsRef:n,labelsRef:s,nextIndexRef:l}),[b,x,w,n,s,l]);return h.jsx(GA.Provider,{value:T,children:t})}function qG(){return new Map}function VG(){return new Set}function KG(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 YA=_.createContext(void 0);function GG(){const e=_.useContext(YA);if(!e)throw new Error(yn(59));return e}const XA=_.forwardRef(function(t,n){const{cutout:s,...i}=t;let a;if(s){const l=s?.getBoundingClientRect();a=`polygon(
76
76
  0% 0%,
77
77
  100% 0%,
78
78
  100% 100%,
@@ -83,4 +83,4 @@ ${a}
83
83
  ${l.right}px ${l.bottom}px,
84
84
  ${l.right}px ${l.top}px,
85
85
  ${l.left}px ${l.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 Wh(e,t){e&&Object.assign(e.style,t)}const HG={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},qG={position:"fixed"},VG=_.forwardRef(function(t,n){const{anchor:s,positionMethod:i="absolute",className:a,render:l,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=Y9,...O}=t,{store:N,listRef:R,labelsRef:M,alignItemWithTriggerActiveRef:L,selectedItemTextRef:j,valuesRef:A,initialValueRef:P,popupRef:Z,setValue:B}=Wu(),z=BA(),Q=at(N,it.open),Y=at(N,it.mounted),ee=at(N,it.modal),D=at(N,it.value),V=at(N,it.openMethod),q=at(N,it.positionerElement),K=at(N,it.triggerElement),U=at(N,it.isItemEqualToValue),I=at(N,it.transitionStatus),H=_.useRef(null),W=_.useRef(null),[X,oe]=_.useState(T),se=Y&&X&&V!=="touch";!Y&&X!==T&&oe(T),Le(()=>{Y||(it.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),it.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,Y]),_.useImperativeHandle(L,()=>se),FA((se||ee)&&Q&&V!=="touch",K);const pe=zA({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??se,collisionAvoidance:C,keepMounted:!0}),xe=se?"none":pe.side,de=se?qG:pe.positionerStyles,Me=_.useMemo(()=>{const Se={};return Q||(Se.pointerEvents="none"),{role:"presentation",hidden:!Y,style:{...de,...Se}}},[Q,Y,de]),_e={open:Q,side:xe,align:pe.align,anchorHidden:pe.anchorHidden},ne=Ae(Se=>{N.set("positionerElement",Se)}),he=zt("div",t,{ref:[n,ne],state:_e,stateAttributesMapping:il,props:[Me,Ap(I),O]}),ae=_.useRef(0),we=Ae(Se=>{if(Se.size===0&&ae.current===0||A.current.length===0)return;const ye=ae.current;if(ae.current=Se.size,Se.size===ye)return;const Ue=Yt(ii);if(ye!==0&&!N.state.multiple&&D!==null&&Ly(A.current,D,U)===-1){const Ee=P.current,Xe=Ee!=null&&Ly(A.current,Ee,U)!==-1?Ee:null;B(Xe,Ue),Xe===null&&(N.set("selectedIndex",null),j.current=null)}if(ye!==0&&N.state.multiple&&Array.isArray(D)){const Ie=Ve=>Ly(A.current,Ve,U)!==-1,Ee=D.filter(Ve=>Ie(Ve));(Ee.length!==D.length||Ee.some(Ve=>!bG(D,Ve,U)))&&(B(Ee,Ue),Ee.length===0&&(N.set("selectedIndex",null),j.current=null))}if(Q&&se){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ie={height:""};Wh(q,Ie),Wh(Z.current,Ie)}}),ve=_.useMemo(()=>({...pe,side:xe,alignItemWithTriggerActive:se,setControlledAlignItemWithTrigger:oe,scrollUpArrowRef:H,scrollDownArrowRef:W}),[pe,xe,se,oe]);return h.jsx(qA,{elementsRef:R,labelsRef:M,onMapChange:we,children:h.jsxs(VA.Provider,{value:ve,children:[Y&&ee&&h.jsx(KA,{inert:fx(!Q),cutout:K}),he]})})});function GA(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 Vd="base-ui-disable-scrollbar",DC={className:Vd,getElement(e){return h.jsx("style",{nonce:e,href:Vd,precedence:"base-ui:low",children:`.${Vd}{scrollbar-width:none}.${Vd}::-webkit-scrollbar{display:none}`})}},KG=_.createContext(void 0);function ZA(e){return _.useContext(KG)}const Ec="ArrowUp",Wi="ArrowDown",Au="ArrowLeft",Tc="ArrowRight",Ju="Home",ef="End",YA=new Set([Au,Tc]),GG=new Set([Au,Tc,Ju,ef]),XA=new Set([Ec,Wi]),ZG=new Set([Ec,Wi,Ju,ef]),QA=new Set([...YA,...XA]),YG=new Set([...QA,Ju,ef]),WA=new Set([Ec,Wi,Au,Tc,Ju,ef]),XG="Shift",QG="Control",WG="Alt",JG="Meta",eZ=new Set([XG,QG,WG,JG]);function tZ(e){return Zt(e)&&e.tagName==="INPUT"}function zC(e){return!!(tZ(e)&&e.selectionStart!=null||Zt(e)&&e.tagName==="TEXTAREA")}function LC(e,t,n,s){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop;const l=e.clientWidth<e.scrollWidth,f=e.clientHeight<e.scrollHeight;if(l&&s!=="vertical"){const d=UC(e,t,"left"),p=Kd(e),g=Kd(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=UC(e,t,"top"),p=Kd(e),g=Kd(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 UC(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 Kd(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 Uy(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const nZ=_.createContext(void 0),rZ={disableStyleElements:!1};function sZ(){return _.useContext(nZ)??rZ}const Vi=1,oZ={...il,...ba},iZ=_.forwardRef(function(t,n){const{render:s,className:i,finalFocus:a,...l}=t,{store:f,popupRef:d,onOpenChangeComplete:p,setOpen:g,valueRef:y,selectedItemTextRef:b,keyboardActiveRef:x,multiple:S,handleScrollArrowVisibility:w,scrollHandlerRef:T,highlightItemOnHover:C}=Wu(),{side:O,align:N,alignItemWithTriggerActive:R,setControlledAlignItemWithTrigger:M,scrollDownArrowRef:L,scrollUpArrowRef:j}=FG(),A=ZA()!=null,P=BA(),{nonce:Z,disableStyleElements:B}=sZ(),z=rs(),Q=at(f,it.id),Y=at(f,it.open),ee=at(f,it.mounted),D=at(f,it.popupProps),V=at(f,it.transitionStatus),q=at(f,it.triggerElement),K=at(f,it.positionerElement),U=at(f,it.listElement),I=_.useRef(0),H=_.useRef(!1),W=_.useRef(0),X=_.useRef(!1),oe=_.useRef({}),se=ox(),pe=Ae(_e=>{if(!K||!d.current||!X.current)return;if(H.current||!R){w();return}const ne=K.style.top==="0px",he=K.style.bottom==="0px",ae=K.getBoundingClientRect().height,we=Rt(K),ve=getComputedStyle(K),Se=parseFloat(ve.marginTop),ye=parseFloat(ve.marginBottom),Ue=$C(getComputedStyle(d.current)),Ie=Math.min(we.documentElement.clientHeight-Se-ye,Ue),Ee=_e.scrollTop,Ve=BC(_e);let Xe=0,Be=null,We=!1,He=!1;const me=qe=>{K.style.height=`${qe}px`},Te=(qe,mt)=>{const lt=Uy(qe,0,Ie-ae);lt>0&&me(ae+lt),_e.scrollTop=mt,Ie-(ae+lt)<=Vi&&(H.current=!0),w()};if(ne){const qe=Ve-Ee,mt=ae+qe,lt=Math.min(mt,Ie);if(Xe=lt,qe<=Vi){Te(qe,Ve);return}Ie-lt>Vi?He=!0:We=!0}else if(he){const qe=Ee,mt=ae+qe,lt=Math.min(mt,Ie),wr=mt-Ie;if(Xe=lt,qe<=Vi){Te(qe,0);return}Ie-lt>Vi?Be=0:(We=!0,Ee<Ve&&(Be=Ee-(qe-wr)))}if(Xe=Math.ceil(Xe),Xe!==0&&me(Xe),He||Be!=null){const qe=BC(_e),mt=He?qe:Uy(Be,0,qe);Math.abs(_e.scrollTop-mt)>Vi&&(_e.scrollTop=mt)}(We||Xe>=Ie-Vi)&&(H.current=!0),w()});_.useImperativeHandle(T,()=>pe,[pe]),xa({open:Y,ref:d,onComplete(){Y&&p?.(!0)}});const xe={open:Y,transitionStatus:V,side:O,align:N};Le(()=>{!K||!d.current||Object.keys(oe.current).length||(oe.current={top:K.style.top||"0",left:K.style.left||"0",right:K.style.right,height:K.style.height,bottom:K.style.bottom,minHeight:K.style.minHeight,maxHeight:K.style.maxHeight,marginTop:K.style.marginTop,marginBottom:K.style.marginBottom})},[d,K]),Le(()=>{Y||R||(X.current=!1,H.current=!1,I.current=0,W.current=0,Wh(K,oe.current))},[Y,R,K,d]),Le(()=>{const _e=d.current;if(!(!Y||!q||!K||!_e||f.state.transitionStatus==="ending")){if(!R){X.current=!0,se.request(w),_e.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const ne=aZ(_e);_e.style.removeProperty("--transform-origin");try{const he=getComputedStyle(K),ae=getComputedStyle(_e),we=Rt(q),ve=un(K),Se=q.getBoundingClientRect(),ye=K.getBoundingClientRect(),Ue=Se.left,Ie=Se.height,Ee=U||_e,Ve=Ee.scrollHeight,Xe=parseFloat(ae.borderBottomWidth),Be=parseFloat(he.marginTop)||10,We=parseFloat(he.marginBottom)||10,He=parseFloat(he.minHeight)||100,me=$C(ae),Te=5,qe=5,mt=20,lt=we.documentElement.clientHeight-Be-We,wr=we.documentElement.clientWidth,Er=lt-Se.bottom+Ie,Qt=b.current,ut=y.current;let xt,ot=0,Wt=0;if(Qt&&ut){const tr=ut.getBoundingClientRect();xt=Qt.getBoundingClientRect();const ls=tr.left-Ue,uo=xt.left-ye.left,fo=tr.top-Se.top+tr.height/2,nr=xt.top-ye.top+xt.height/2;ot=ls-uo,Wt=nr-fo}const vn=Er+Wt+We+Xe;let kt=Math.min(lt,vn);const Cn=lt-Be-We,er=vn-kt,An=Math.max(Te,Ue+ot),as=wr-qe,cs=Math.max(0,An+ye.width-as);K.style.left=`${An-cs}px`,K.style.height=`${kt}px`,K.style.maxHeight="auto",K.style.marginTop=`${Be}px`,K.style.marginBottom=`${We}px`,_e.style.height="100%";const _a=Ee.scrollHeight-Ee.clientHeight,wi=er>=_a;wi&&(kt=Math.min(lt,ye.height)-(er-_a));const Ei=Se.top<mt||Se.bottom>lt-mt||kt<Math.min(Ve,He),ws=(ve.visualViewport?.scale??1)!==1&&tx;if(Ei||ws){X.current=!0,Wh(K,oe.current),hi.flushSync(()=>M(!1));return}if(wi){const tr=Math.max(0,lt-vn);K.style.top=ye.height>=Cn?"0":`${tr}px`,K.style.height=`${kt}px`,Ee.scrollTop=Ee.scrollHeight-Ee.clientHeight,I.current=Math.max(He,kt)}else K.style.bottom="0",I.current=Math.max(He,kt),Ee.scrollTop=er;if(xt){const tr=ye.top,ls=ye.height,uo=xt.top+xt.height/2,fo=ls>0?(uo-tr)/ls*100:50,nr=Uy(fo,0,100);_e.style.setProperty("--transform-origin",`50% ${nr}%`)}(I.current===lt||kt>=me)&&(H.current=!0),w(),setTimeout(()=>{X.current=!0})}finally{ne()}})}},[f,Y,K,q,y,b,d,w,R,M,se,L,j,U]),_.useEffect(()=>{if(!R||!K||!Y)return;const _e=un(K);function ne(he){g(!1,Yt(x8,he))}return _e.addEventListener("resize",ne),()=>{_e.removeEventListener("resize",ne)}},[g,R,K,Y]);const de={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${Q}-list`},onKeyDown(_e){x.current=!0,A&&WA.has(_e.key)&&_e.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(_e){if(!C||GA(_e)||_e.pointerType==="touch")return;const ne=_e.currentTarget;z.start(0,()=>{f.set("activeIndex",null),ne.focus({preventScroll:!0})})},onScroll(_e){U||pe(_e.currentTarget)},...R&&{style:U?{height:"100%"}:HG}},Me=zt("div",t,{ref:[n,d],state:xe,stateAttributesMapping:oZ,props:[D,de,Ap(V),{className:!U&&R?DC.className:void 0},l]});return h.jsxs(_.Fragment,{children:[!B&&DC.getElement(Z),h.jsx(wA,{context:P,modal:!1,disabled:!ee,returnFocus:a,restoreFocus:!0,children:Me})]})});function $C(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function BC(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const FC=[["transform","none"],["scale","1"],["translate","0 0"]];function aZ(e){const{style:t}=e,n={};for(const[s,i]of FC)n[s]=t.getPropertyValue(s),t.setProperty(s,i,"important");return()=>{for(const[s]of FC){const i=n[s];i?t.setProperty(s,i):t.removeProperty(s)}}}let JA=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function dx(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:i,index:a}=e,{register:l,unregister:f,subscribeMapChange:d,elementsRef:p,labelsRef:g,nextIndexRef:y}=LG(),b=_.useRef(-1),[x,S]=_.useState(a??(i===JA.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 O=t!==void 0;g.current[x]=O?t:s?.current?.textContent??C.textContent}},[x,p,g,t,s]);return Le(()=>{if(a!=null)return;const C=w.current;if(C)return l(C,n),()=>{f(C)}},[a,l,f,n]),Le(()=>{if(a==null)return d(C=>{const O=w.current?C.get(w.current)?.index:null;O!=null&&S(O)})},[a,d,S]),_.useMemo(()=>({ref:T,index:x}),[x,T])}const cZ=_.createContext(void 0),lZ=_.memo(_.forwardRef(function(t,n){const{render:s,className:i,value:a=null,label:l,disabled:f=!1,nativeButton:d=!1,...p}=t,g=_.useRef(null),y=dx({label:l,textRef:g,indexGuessBehavior:JA.GuessFromOrder}),{store:b,getItemProps:x,setOpen:S,setValue:w,selectionRef:T,typingRef:C,valuesRef:O,keyboardActiveRef:N,multiple:R,highlightItemOnHover:M}=Wu(),L=rs(),j=at(b,it.isActive,y.index),A=at(b,it.isSelected,y.index,a),P=at(b,it.isSelectedByFocus,y.index),Z=at(b,it.isItemEqualToValue),B=y.index,z=B!==-1,Q=_.useRef(null),Y=Jo(B);Le(()=>{if(!z)return;const se=O.current;return se[B]=a,()=>{delete se[B]}},[z,B,a,O]),Le(()=>{if(!z)return;const se=b.state.value;let pe=se;R&&Array.isArray(se)&&se.length>0&&(pe=se[se.length-1]),pe!==void 0&&Bc(a,pe,Z)&&b.set("selectedIndex",B)},[z,B,R,Z,b,a]);const ee={disabled:f,selected:A,highlighted:j},D=x({active:j,selected:A});D.onFocus=void 0,D.id=void 0;const V=_.useRef(null),q=_.useRef("mouse"),K=_.useRef(!1),{getButtonProps:U,buttonRef:I}=el({disabled:f,focusableWhenDisabled:!0,native:d});function H(se){const pe=b.state.value;if(R){const xe=Array.isArray(pe)?pe:[],de=A?xG(xe,a,Z):[...xe,a];w(de,Yt(Ry,se))}else w(a,Yt(Ry,se)),S(!1,Yt(Ry,se))}const W={role:"option","aria-selected":A,tabIndex:j?0:-1,onFocus(){b.set("activeIndex",B)},onMouseEnter(){!N.current&&b.state.selectedIndex===null&&M&&b.set("activeIndex",B)},onMouseMove(){M&&b.set("activeIndex",B)},onMouseLeave(se){!M||N.current||GA(se)||L.start(0,()=>{b.state.activeIndex===B&&b.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(se){V.current=se.key,b.set("activeIndex",B)},onClick(se){K.current=!1,!(se.type==="keydown"&&V.current===null)&&(f||V.current===" "&&C.current||q.current!=="touch"&&!j||(V.current=null,H(se.nativeEvent)))},onPointerEnter(se){q.current=se.pointerType},onPointerDown(se){q.current=se.pointerType,K.current=!0},onMouseUp(se){if(f)return;if(K.current){K.current=!1;return}const pe=!T.current.allowSelectedMouseUp&&A,xe=!T.current.allowUnselectedMouseUp&&!A;pe||xe||q.current!=="touch"&&!j||H(se.nativeEvent)}},X=zt("div",t,{ref:[I,n,y.ref,Q],state:ee,props:[D,W,p,U]}),oe=_.useMemo(()=>({selected:A,indexRef:Y,textRef:g,selectedByFocus:P,hasRegistered:z}),[A,Y,g,P,z]);return h.jsx(cZ.Provider,{value:oe,children:X})})),uZ=_.forwardRef(({className:e,children:t,...n},s)=>h.jsx(jG,{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}));uZ.displayName="SelectTrigger";const fZ=_.forwardRef(({className:e,portalProps:t,positionerProps:n,...s},i)=>h.jsx(kG,{...t,children:h.jsx(VG,{...n,children:h.jsx(iZ,{ref:i,className:ge("bg-panel border border-border rounded-md py-1 shadow-lg z-50",e),...s})})}));fZ.displayName="SelectContent";const dZ=_.forwardRef(({className:e,...t},n)=>h.jsx(lZ,{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}));dZ.displayName="SelectItem";const hZ=_.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}));hZ.displayName="Textarea";const ek=_.createContext(void 0);function pZ(e=!0){const t=_.useContext(ek);if(t===void 0&&!e)throw new Error(yn(7));return t}function tk(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=jj(),{ref:i,index:a}=dx(e),l=n===a,f=_.useRef(null),d=so(i,f);return{compositeProps:_.useMemo(()=>({tabIndex:l?0:-1,onFocus(){s(a)},onMouseMove(){const g=f.current;if(!t||!g)return;const y=g.hasAttribute("disabled")||g.ariaDisabled==="true";!l&&!y&&g.focus()}}),[l,s,a,t]),compositeRef:d,index:a}}function mZ(e){const{render:t,className:n,state:s=an,props:i=Ru,refs:a=Ru,metadata:l,stateAttributesMapping:f,tag:d="div",...p}=e,{compositeProps:g,compositeRef:y}=tk({metadata:l});return zt(d,e,{state:s,ref:[...a,y],props:[g,...i,p],stateAttributesMapping:f})}const gZ=_.forwardRef(function(t,n){const{className:s,defaultPressed:i=!1,disabled:a=!1,form:l,onPressedChange:f,pressed:d,render:p,type:g,value:y,nativeButton:b=!0,...x}=t,S=br(y||void 0),w=pZ(),T=w?.value??[],C=w?void 0:i,O=(a||w?.disabled)??!1,[N,R]=gp({controlled:w?S!==void 0&&T.indexOf(S)>-1:d,default:C,name:"Toggle",state:"pressed"}),M=Ae((z,Q)=>{S&&w?.setGroupValue?.(S,z,Q),f?.(z,Q)}),{getButtonProps:L,buttonRef:j}=el({disabled:O,native:b}),A={disabled:O,pressed:N},P=[j,n],Z=[{"aria-pressed":N,onClick(z){const Q=!N,Y=Yt(ii,z.nativeEvent);M(Q,Y),!Y.isCanceled&&R(Q)}},x,L],B=zt("button",t,{enabled:!w,state:A,ref:P,props:Z});return w?h.jsx(mZ,{tag:"button",render:p,className:s,state:A,refs:P,props:Z}):B}),Dr=_.forwardRef(({className:e,...t},n)=>h.jsx(gZ,{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}));Dr.displayName="Toggle";function yZ(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const nk="data-composite-item-active",vZ=[];function bZ(e){const{itemSizes:t,cols:n=1,loopFocus:s=!0,dense:i=!1,orientation:a="both",direction:l,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:p,enableHomeAndEndKeys:g=!1,stopEventPropagation:y=!1,disabledIndices:b,modifierKeys:x=vZ}=e,[S,w]=_.useState(0),T=n>1,C=_.useRef(null),O=so(C,p),N=_.useRef([]),R=_.useRef(!1),M=f??S,L=Ae((P,Z=!1)=>{if((d??w)(P),Z){const B=N.current[P];LC(C.current,B,l,a)}}),j=Ae(P=>{if(P.size===0||R.current)return;R.current=!0;const Z=Array.from(P.keys()),B=Z.find(Q=>Q?.hasAttribute(nk))??null,z=B?Z.indexOf(B):-1;z!==-1&&L(z),LC(C.current,B,l,a)}),A=_.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,ref:O,onFocus(P){!C.current||!zC(P.target)||P.target.setSelectionRange(0,P.target.value.length??0)},onKeyDown(P){const Z=g?YG:QA;if(!Z.has(P.key)||xZ(P,x)||!C.current)return;const z=l==="rtl",Q=z?Au:Tc,Y={horizontal:Q,vertical:Wi,both:Q}[a],ee=z?Tc:Au,D={horizontal:ee,vertical:Ec,both:ee}[a];if(zC(P.target)&&!yZ(P.target)){const W=P.target.selectionStart,X=P.target.selectionEnd,oe=P.target.value??"";if(W==null||P.shiftKey||W!==X||P.key!==D&&W<oe.length||P.key!==Y&&W>0)return}let V=M;const q=IV(N,b),K=PV(N,b);if(T){const W=t||Array.from({length:N.current.length},()=>({width:1,height:1})),X=zV(W,n,i),oe=X.findIndex(pe=>pe!=null&&!pu(N,pe,b)),se=X.reduce((pe,xe,de)=>xe!=null&&!pu(N,xe,b)?de:pe,-1);V=X[DV({current:X.map(pe=>pe?N.current[pe]:null)},{event:P,orientation:a,loopFocus:s,cols:n,disabledIndices:UV([...b||N.current.map((pe,xe)=>pu(N,xe)?xe:void 0),void 0],X),minIndex:oe,maxIndex:se,prevIndex:LV(M>K?q:M,W,X,n,P.key===Wi?"bl":P.key===Tc?"tr":"tl"),rtl:z})]}const U={horizontal:[Q],vertical:[Wi],both:[Q,Wi]}[a],I={horizontal:[ee],vertical:[Ec],both:[ee,Ec]}[a],H=T?Z:{horizontal:g?GG:YA,vertical:g?ZG:XA,both:Z}[a];g&&(P.key===Ju?V=q:P.key===ef&&(V=K)),V===M&&(U.includes(P.key)||I.includes(P.key))&&(s&&V===K&&U.includes(P.key)?V=q:s&&V===q&&I.includes(P.key)?V=K:V=fr(N,{startingIndex:V,decrement:I.includes(P.key),disabledIndices:b})),V!==M&&!ch(N,V)&&(y&&P.stopPropagation(),H.has(P.key)&&P.preventDefault(),L(V,!0),queueMicrotask(()=>{N.current[V]?.focus()}))}}),[n,i,l,b,N,g,M,T,t,s,O,x,L,a,y]);return _.useMemo(()=>({props:A,highlightedIndex:M,onHighlightedIndexChange:L,elementsRef:N,disabledIndices:b,onMapChange:j,relayKeyboardEvent:A.onKeyDown}),[A,M,L,N,b,j])}function xZ(e,t){for(const n of eZ.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function rk(e){const{render:t,className:n,refs:s=Ru,props:i=Ru,state:a=an,stateAttributesMapping:l,highlightedIndex:f,onHighlightedIndexChange:d,orientation:p,dense:g,itemSizes:y,loopFocus:b,cols:x,enableHomeAndEndKeys:S,onMapChange:w,stopEventPropagation:T=!0,rootRef:C,disabledIndices:O,modifierKeys:N,highlightItemOnHover:R=!1,tag:M="div",...L}=e,j=PA(),{props:A,highlightedIndex:P,onHighlightedIndexChange:Z,elementsRef:B,onMapChange:z,relayKeyboardEvent:Q}=bZ({itemSizes:y,cols:x,loopFocus:b,dense:g,orientation:p,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:T,enableHomeAndEndKeys:S,direction:j,disabledIndices:O,modifierKeys:N}),Y=zt(M,e,{state:a,ref:s,props:[A,...i,L],stateAttributesMapping:l}),ee=_.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:Z,highlightItemOnHover:R,relayKeyboardEvent:Q}),[P,Z,R,Q]);return h.jsx(Nj.Provider,{value:ee,children:h.jsx(qA,{elementsRef:B,onMapChange:D=>{w?.(D),z(D)},children:Y})})}let SZ=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const HC={multiple(e){return e?{[SZ.multiple]:""}:null}},_Z=_.forwardRef(function(t,n){const{defaultValue:s,disabled:i=!1,loopFocus:a=!0,onValueChange:l,orientation:f="horizontal",multiple:d=!1,value:p,className:g,render:y,...b}=t,x=ZA(),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,O]=gp({controlled:p,default:S,name:"ToggleGroup",state:"value"}),N=Ae((A,P,Z)=>{let B;if(d?(B=C.slice(),P?B.push(A):B.splice(C.indexOf(A),1)):B=P?[A]:[],Array.isArray(B)){if(l?.(B,Z),Z.isCanceled)return;O(B)}}),R={disabled:T,multiple:d,orientation:f},M=_.useMemo(()=>({disabled:T,orientation:f,setGroupValue:N,value:C,isValueInitialized:w}),[T,f,N,C,w]),L={role:"group"},j=zt("div",t,{enabled:!!x,state:R,ref:n,props:[L,b],stateAttributesMapping:HC});return h.jsx(ek.Provider,{value:M,children:x?j:h.jsx(rk,{render:y,className:g,state:R,refs:[n],props:[L,b],stateAttributesMapping:HC,loopFocus:a,enableHomeAndEndKeys:!0})})}),dh=_.forwardRef(({className:e,...t},n)=>h.jsx(_Z,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));dh.displayName="ToggleGroup";const wZ=ge(Fj({variant:"secondary",size:"sm"}),"h-7 whitespace-nowrap uppercase tracking-[0.08em] leading-none no-underline");function sk({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 EZ({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 l=a.id===t,f=()=>n?.(a.id);return s?h.jsx("span",{children:s(a,{active:l,onClick:f})},a.id):h.jsx(sk,{active:l,onClick:f,children:a.label},a.id)})})}const TZ=gi("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}}),CZ={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 RZ({color:e,size:t,glow:n,pulse:s,className:i}){return h.jsx("span",{className:ge(TZ({color:e,size:t,glow:n}),s&&"dot-pulse",i),style:n?{boxShadow:CZ[e??"healthy"]}:void 0})}const NZ="0.0.6-85",jZ={version:NZ},AZ=jZ.version;function kZ({label:e,className:t}){return h.jsxs("div",{className:ge("flex items-center gap-3",t),children:[h.jsx(RZ,{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",AZ]})]})}function OZ({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 MZ=gi("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"}}),In=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("div",{ref:s,role:"alert",className:ge(MZ({variant:t,className:e})),...n}));In.displayName="Alert";const tf=_.forwardRef(({className:e,...t},n)=>h.jsx("h5",{ref:n,className:ge("font-medium text-white mb-1",e),...t}));tf.displayName="AlertTitle";const Pn=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("text-neutral-400",e),...t}));Pn.displayName="AlertDescription";const ok=_.createContext(void 0);function al(e){const t=_.useContext(ok);if(e===!1&&t===void 0)throw new Error(yn(27));return t}const IZ={...il,...ba},hx=_.forwardRef(function(t,n){const{render:s,className:i,forceRender:a=!1,...l}=t,{store:f}=al(),d=f.useState("open"),p=f.useState("nested"),g=f.useState("mounted"),y=f.useState("transitionStatus");return zt("div",t,{state:{open:d,transitionStatus:y},ref:[f.context.backdropRef,n],stateAttributesMapping:IZ,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!p})}),ik=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=al(),d=br(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),zt("p",t,{ref:n,props:[{id:d},l]})});let PZ=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),DZ=(function(e){return e[e.open=Qi.open]="open",e[e.closed=Qi.closed]="closed",e[e.startingStyle=Qi.startingStyle]="startingStyle",e[e.endingStyle=Qi.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const ak=_.createContext(void 0);function zZ(){const e=_.useContext(ak);if(e===void 0)throw new Error(yn(26));return e}const LZ={...il,...ba,nestedDialogOpen(e){return e?{[DZ.nestedDialogOpen]:""}:null}},ck=_.forwardRef(function(t,n){const{className:s,finalFocus:i,initialFocus:a,render:l,...f}=t,{store:d}=al(),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"),O=d.useState("openMethod"),N=d.useState("titleElementId"),R=d.useState("transitionStatus"),M=d.useState("role");zZ(),xa({open:C,ref:d.context.popupRef,onComplete(){C&&d.context.onOpenChangeComplete?.(!0)}});function L(B){return B==="touch"?d.context.popupRef.current:!0}const j=a===void 0?L:a,A=T>0,Z=zt("div",t,{state:{open:C,nested:w,transitionStatus:R,nestedDialogOpen:A},props:[b,{"aria-labelledby":N??void 0,"aria-describedby":p??void 0,role:M,tabIndex:-1,hidden:!S,onKeyDown(B){WA.has(B.key)&&B.stopPropagation()},style:{[PZ.nestedDialogs]:T}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:LZ});return h.jsx(wA,{context:y,openInteractionType:O,disabled:!S,closeOnFocusOut:!g,initialFocus:j,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:Z})}),lk=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t,{store:a}=al(),l=a.useState("mounted"),f=a.useState("modal"),d=a.useState("open");return l||s?h.jsx(ak.Provider,{value:s,children:h.jsxs(_A,{ref:n,...i,children:[l&&f===!0&&h.jsx(KA,{ref:a.context.internalBackdropRef,inert:fx(!d)}),t.children]})}):null});function UZ(e){const{store:t,parentContext:n,actionsRef:s}=e,i=t.useState("open"),a=t.useState("disablePointerDismissal"),l=t.useState("modal"),f=t.useState("popupElement"),{openMethod:d,triggerProps:p,reset:g}=TG(i);m7(t);const{forceUnmount:y}=g7(i,t,()=>{g()}),b=Ae(Z=>{const B=Yt(Z);return B.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},B}),x=_.useCallback(()=>{t.setOpen(!1,b(b8))},[t,b]);_.useImperativeHandle(s,()=>({unmount:y,close:x}),[y,x]);const S=_7({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,T]=_.useState(0),C=w===0,O=k7(S),N=r7(S,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(Z){if(!t.context.outsidePressEnabledRef.current||"button"in Z&&Z.button!==0||"touches"in Z&&Z.touches.length!==1)return!1;const B=Ur(Z);if(C&&!a){const z=B;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===z||t.context.backdropRef.current===z||Ot(z,f)&&!z?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});FA(i&&l===!0,f);const{getReferenceProps:R,getFloatingProps:M,getTriggerProps:L}=j7([O,N]);t.useContextCallback("onNestedDialogOpen",Z=>{T(Z+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]),A=_.useMemo(()=>L(p),[L,p]),P=_.useMemo(()=>M(),[M]);t.useSyncedValues({openMethod:d,activeTriggerProps:j,inactiveTriggerProps:A,popupProps:P,floatingRootContext:S,nestedOpenDialogCount:w})}const $Z={...b7,modal:Pe(e=>e.modal),nested:Pe(e=>e.nested),nestedOpenDialogCount:Pe(e=>e.nestedOpenDialogCount),disablePointerDismissal:Pe(e=>e.disablePointerDismissal),openMethod:Pe(e=>e.openMethod),descriptionElementId:Pe(e=>e.descriptionElementId),titleElementId:Pe(e=>e.titleElementId),viewportElement:Pe(e=>e.viewportElement),role:Pe(e=>e.role)};class BZ extends OA{constructor(t){super(FZ(t),{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new lx,onOpenChange:void 0,onOpenChangeComplete:void 0},$Z)}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 FZ(e={}){return{...v7(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function HZ(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:l=!1,modal:f=!0,actionsRef:d,handle:p,triggerId:g,defaultTriggerId:y=null}=e,b=al(!0),x=!!b,S=zn(()=>p?.store??new BZ({open:s,openProp:n,activeTriggerId:y,triggerIdProp:g,modal:f,disablePointerDismissal:l,nested:x})).current;oV(()=>{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:l,nested:x,modal:f}),S.useContextCallback("onOpenChange",i),S.useContextCallback("onOpenChangeComplete",a);const w=S.useState("payload");UZ({store:S,actionsRef:d,parentContext:b?.store.context});const T=_.useMemo(()=>({store:S}),[S]);return h.jsx(ok.Provider,{value:T,children:typeof t=="function"?t({payload:w}):t})}const uk=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=al(),d=br(a);return f.useSyncedValueWithCleanup("titleElementId",d),zt("h2",t,{ref:n,props:[{id:d},l]})}),$r=HZ,qZ=_.forwardRef(({className:e,...t},n)=>h.jsx(hx,{ref:n,className:ge("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));qZ.displayName="DialogOverlay";const hr=_.forwardRef(({className:e,children:t,...n},s)=>h.jsxs(lk,{children:[h.jsx(hx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(ck,{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})]}));hr.displayName="DialogContent";const pr=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));pr.displayName="DialogHeader";const Nn=_.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}));Nn.displayName="DialogFooter";const mr=_.forwardRef(({className:e,...t},n)=>h.jsx(uk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));mr.displayName="DialogTitle";const VZ=_.forwardRef(({className:e,...t},n)=>h.jsx(ik,{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));VZ.displayName="DialogDescription";const px=_.forwardRef(({className:e,page:t,totalPages:n,totalItems:s,onPageChange:i,...a},l)=>h.jsxs("div",{ref:l,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(Oe,{size:"sm",variant:"default",disabled:t<=1,onClick:()=>i(t-1),children:"Prev"}),h.jsx(Oe,{size:"sm",variant:"default",disabled:t>=n,onClick:()=>i(t+1),children:"Next"})]})]}));px.displayName="Pagination";const KZ=_.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}));KZ.displayName="Separator";const GZ=gi("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"}}),ZZ=_.forwardRef(({className:e,side:t,children:n,...s},i)=>h.jsxs(lk,{children:[h.jsx(hx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(ck,{ref:i,className:ge(GZ({side:t,className:e})),...s,children:n})]}));ZZ.displayName="SheetContent";const YZ=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));YZ.displayName="SheetHeader";const XZ=_.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}));XZ.displayName="SheetFooter";const QZ=_.forwardRef(({className:e,...t},n)=>h.jsx(uk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));QZ.displayName="SheetTitle";const WZ=_.forwardRef(({className:e,...t},n)=>h.jsx(ik,{ref:n,className:ge("text-sm text-neutral-400",e),...t}));WZ.displayName="SheetDescription";const JZ=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("rounded-md bg-neutral-800 animate-pulse",e),...t}));JZ.displayName="Skeleton";const eY=_.createContext(void 0);function mx(){const e=_.useContext(eY);if(e===void 0)throw new Error(yn(64));return e}let tY=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const fk={tabActivationDirection:e=>({[tY.activationDirection]:e})},dk=_.createContext(void 0);function nY(){const e=_.useContext(dk);if(e===void 0)throw new Error(yn(65));return e}const rY=_.forwardRef(function(t,n){const{className:s,disabled:i=!1,render:a,value:l,id:f,nativeButton:d=!0,...p}=t,{value:g,getTabPanelIdByValue:y,orientation:b}=mx(),{activateOnFocus:x,highlightedTabIndex:S,onTabActivation:w,setHighlightedTabIndex:T,tabsListElement:C}=nY(),O=br(f),N=_.useMemo(()=>({disabled:i,id:O,value:l}),[i,O,l]),{compositeProps:R,compositeRef:M,index:L}=tk({metadata:N}),j=l===g,A=_.useRef(!1);Le(()=>{if(A.current){A.current=!1;return}if(!(j&&L>-1&&S!==L))return;const K=C;if(K!=null){const U=Bo(Rt(K));if(U&&Ot(K,U))return}i||T(L)},[j,L,S,T,i,C]);const{getButtonProps:P,buttonRef:Z}=el({disabled:i,native:d,focusableWhenDisabled:!0}),B=y(l),z=_.useRef(!1),Q=_.useRef(!1);function Y(K){j||i||w(l,Yt(ii,K.nativeEvent,void 0,{activationDirection:"none"}))}function ee(K){j||(L>-1&&!i&&T(L),!i&&x&&(!z.current||z.current&&Q.current)&&w(l,Yt(ii,K.nativeEvent,void 0,{activationDirection:"none"})))}function D(K){if(j||i)return;z.current=!0;function U(){z.current=!1,Q.current=!1}(!K.button||K.button===0)&&(Q.current=!0,Rt(K.currentTarget).addEventListener("pointerup",U,{once:!0}))}return zt("button",t,{state:{disabled:i,active:j,orientation:b},ref:[n,Z,M],props:[R,{role:"tab","aria-controls":B,"aria-selected":j,id:O,onClick:Y,onFocus:ee,onPointerDown:D,[nk]:j?"":void 0,onKeyDownCapture(){A.current=!0}},p,P]})});let sY=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const oY={...fk,...ba},iY=_.forwardRef(function(t,n){const{className:s,value:i,render:a,keepMounted:l=!1,...f}=t,{value:d,getTabIdByPanelValue:p,orientation:g,tabActivationDirection:y,registerMountedTabPanel:b,unregisterMountedTabPanel:x}=mx(),S=br(),w=_.useMemo(()=>({id:S,value:i}),[S,i]),{ref:T,index:C}=dx({metadata:w}),O=i===d,{mounted:N,transitionStatus:R,setMounted:M}=jp(O),L=!N,j=p(i),A={hidden:L,orientation:g,tabActivationDirection:y,transitionStatus:R},P=_.useRef(null),Z=zt("div",t,{state:A,ref:[n,T,P],props:[{"aria-labelledby":j,hidden:L,id:S,role:"tabpanel",tabIndex:O?0:-1,inert:fx(!O),[sY.index]:C},f],stateAttributesMapping:oY});return xa({open:O,ref:P,onComplete(){O||M(!1)}}),Le(()=>{if(!(L&&!l)&&S!=null)return b(i,S),()=>{x(i,S)}},[L,l,i,S,b,x]),l||N?Z:null}),aY=_.forwardRef(function(t,n){const{activateOnFocus:s=!1,className:i,loopFocus:a=!0,render:l,...f}=t,{getTabElementBySelectedValue:d,onValueChange:p,orientation:g,value:y,setTabMap:b,tabActivationDirection:x}=mx(),[S,w]=_.useState(0),[T,C]=_.useState(null),O=cY(y,g,T,d),N=Ae((j,A)=>{if(j!==y){const P=O(j);A.activationDirection=P,p(j,A)}}),R={orientation:g,tabActivationDirection:x},M={"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(dk.Provider,{value:L,children:h.jsx(rk,{render:l,className:i,state:R,refs:[n,C],props:[M,f],stateAttributesMapping:fk,highlightedIndex:S,enableHomeAndEndKeys:!0,loopFocus:a,orientation:g,onHighlightedIndexChange:w,onMapChange:b,disabledIndices:Ru})})});function qC(e,t){const{left:n,top:s}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect(),l=n-i,f=s-a;return{left:l,top:f}}function cY(e,t,n,s){const[i,a]=_.useState(null);return Le(()=>{if(e==null||n==null){a(null);return}const l=s(e);if(l==null){a(null);return}const{left:f,top:d}=qC(l,n);a(t==="horizontal"?f:d)},[t,s,n,e]),_.useCallback(l=>{if(l===e)return"none";if(l==null)return a(null),"none";if(l!=null&&n!=null){const f=s(l);if(f!=null){const{left:d,top:p}=qC(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 lY=_.forwardRef(({className:e,...t},n)=>h.jsx(aY,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));lY.displayName="TabsList";const uY=gi("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"}}),fY=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx(rY,{ref:s,className:ge(uY({variant:t,className:e})),...n}));fY.displayName="TabsTrigger";const dY=_.forwardRef(({className:e,...t},n)=>h.jsx(iY,{ref:n,className:ge("outline-none",e),...t}));dY.displayName="TabsContent";const hY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[11px] text-neutral-300",e),...t}));hY.displayName="Text";const pY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));pY.displayName="TextMuted";const mY=_.forwardRef(({className:e,...t},n)=>h.jsx("code",{ref:n,className:ge("font-mono text-[11px] text-white",e),...t}));mY.displayName="TextCode";const gY=_.forwardRef(({className:e,...t},n)=>h.jsx("span",{ref:n,className:ge("font-mono text-[9px] uppercase tracking-wider text-neutral-500",e),...t}));gY.displayName="TextLabel";const yY=_.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}));yY.displayName="CodeBlock";const vY="console:instance-id";function Lt(){const[e,t]=pi(vY,""),n=e.trim();return _.useMemo(()=>({instanceId:n.length>0?n:void 0,rawInstanceId:e,setInstanceId:t,clearInstanceId:()=>t("")}),[n,e,t])}const Jn={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 _i(e,t){return e===0?!1:e??t}function nf(e,t){return t?{...e,instanceId:t}:e}function Sa(e){return encodeURIComponent(String(e))}function Ln(e,t,n){const s=e.endsWith("/")?e.slice(0,-1):e,i=n?.toString();return`${s}${t}${i?`?${i}`:""}`}function rf(e={}){const t=Vt(),{instanceId:n}=Lt(),s=e.instanceId??n,i=nf(e.partitionId?{partitionId:e.partitionId}:{},s);return Wn({queryKey:Jn.stats({partitionId:e.partitionId,instanceId:s}),queryFn:()=>{if(!t)throw new Error("Not connected");return Yu(t.GET("/console/stats",{params:{query:i}}))},enabled:!!t,refetchInterval:_i(e.refetchIntervalMs,5e3)})}function bY(e={},t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=e.instanceId??i;return Wn({queryKey:Jn.timeseries({...e,instanceId:a}),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");const l=new URLSearchParams;e.interval&&l.set("interval",e.interval),e.range&&l.set("range",e.range),e.partitionId&&l.set("partitionId",e.partitionId),a&&l.set("instanceId",a);const f=await fetch(`${s.serverUrl}/console/stats/timeseries?${l}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!f.ok)throw new Error("Failed to fetch timeseries stats");return f.json()},enabled:(t.enabled??!0)&&!!n&&!!s,refetchInterval:_i(t.refetchIntervalMs,3e4)})}function xY(e={},t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=e.instanceId??i;return Wn({queryKey:Jn.latency({...e,instanceId:a}),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");const l=new URLSearchParams;e.range&&l.set("range",e.range),e.partitionId&&l.set("partitionId",e.partitionId),a&&l.set("instanceId",a);const f=await fetch(`${s.serverUrl}/console/stats/latency?${l}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!f.ok)throw new Error("Failed to fetch latency stats");return f.json()},enabled:(t.enabled??!0)&&!!n&&!!s,refetchInterval:_i(t.refetchIntervalMs,3e4)})}function SY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=nf({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return Wn({queryKey:Jn.commits({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Yu(n.GET("/console/commits",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function _Y(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.commitDetail(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Commit sequence is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/commits/${Sa(e)}${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch commit detail");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function wY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=nf({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},i);return Wn({queryKey:Jn.timeline({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Yu(n.GET("/console/timeline",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function hk(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=nf({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return Wn({queryKey:Jn.clients({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Yu(n.GET("/console/clients",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function EY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.eventDetail(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Event id is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/events/${Sa(e)}${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch event detail");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function TY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.eventPayload(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Event id is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/events/${Sa(e)}/payload${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch event payload");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function CY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.handlers(i),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;i&&a.set("instanceId",i);const l=await fetch(Ln(n.serverUrl,"/console/handlers",a),{headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch handlers");return l.json()},enabled:!!t&&!!n})}function RY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.prunePreview(i),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;i&&a.set("instanceId",i);const l=await fetch(Ln(n.serverUrl,"/console/prune/preview",a),{method:"POST",headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch prune preview");return l.json()},enabled:!!t&&!!n&&(e.enabled??!0)})}function NY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=nf({limit:e.limit,offset:e.offset,operationType:e.operationType,partitionId:e.partitionId},i);return Wn({queryKey:Jn.operations({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Yu(n.GET("/console/operations",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function jY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async({clientId:i,partitionId:a,instanceId:l})=>{if(!e||!t)throw new Error("Not connected");const f=l??n,d=new URLSearchParams;a&&d.set("partitionId",a),f&&d.set("instanceId",f);const p=await fetch(Ln(t.serverUrl,`/console/clients/${Sa(i)}`,d),{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!p.ok)throw new Error("Failed to evict client");return p.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","clients"]}),s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function AY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Ln(t.serverUrl,"/console/prune",i),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!a.ok)throw new Error("Failed to prune");return a.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","commits"]}),s.invalidateQueries({queryKey:["console","timeline"]}),s.invalidateQueries({queryKey:["console","prune","preview"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function kY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Ln(t.serverUrl,"/console/compact",i),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!a.ok)throw new Error("Failed to compact");return a.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function OY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=i.instanceId??n,l=new URLSearchParams;a&&l.set("instanceId",a);const f=await fetch(Ln(t.serverUrl,"/console/notify-data-change",l),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify({tables:i.tables,partitionId:i.partitionId})});if(!f.ok)throw new Error("Failed to notify data change");return f.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","commits"]}),s.invalidateQueries({queryKey:["console","timeline"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function MY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.apiKeys({...e,instanceId:i}),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;e.limit!==void 0&&a.set("limit",String(e.limit)),e.offset!==void 0&&a.set("offset",String(e.offset)),e.type&&a.set("type",e.type),e.status&&a.set("status",e.status),e.expiresWithinDays!==void 0&&a.set("expiresWithinDays",String(e.expiresWithinDays)),i&&a.set("instanceId",i);const l=await fetch(Ln(n.serverUrl,"/console/api-keys",a),{headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch API keys");return l.json()},enabled:!!t&&!!n})}function IY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,"/console/api-keys",a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok)throw new Error("Failed to create API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function PY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(i)}`,a),{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to revoke API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function DY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,"/console/api-keys/bulk-revoke",a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok)throw new Error("Failed to bulk revoke API keys");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function zY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(i)}/rotate`,a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to rotate API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function LY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(i)}/rotate/stage`,a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to stage-rotate API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function UY(e={}){const{config:t}=Dt();return Wn({queryKey:Jn.storage({prefix:e.prefix,cursor:e.cursor,limit:e.limit}),queryFn:async()=>{if(!t)throw new Error("Not connected");const n=new URLSearchParams;e.prefix&&n.set("prefix",e.prefix),e.cursor&&n.set("cursor",e.cursor),e.limit&&n.set("limit",String(e.limit));const s=await fetch(Ln(t.serverUrl,"/console/storage",n),{method:"GET",headers:{Authorization:`Bearer ${t.token}`}});if(!s.ok)throw new Error("Failed to list blobs");return s.json()},enabled:!!t,refetchInterval:_i(e.refetchIntervalMs,3e4)})}function $Y(){const{config:e}=Dt(),t=_r();return is({mutationFn:async n=>{if(!e)throw new Error("Not connected");const s=encodeURIComponent(n),i=await fetch(Ln(e.serverUrl,`/console/storage/${s}`,new URLSearchParams),{method:"DELETE",headers:{Authorization:`Bearer ${e.token}`}});if(!i.ok)throw new Error("Failed to delete blob");return i.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["console","storage"]})}})}function BY(){const{config:e}=Dt();return async t=>{if(!e)throw new Error("Not connected");const n=encodeURIComponent(t),s=await fetch(Ln(e.serverUrl,`/console/storage/${n}/download`,new URLSearchParams),{method:"GET",headers:{Authorization:`Bearer ${e.token}`}});if(!s.ok)throw new Error("Failed to download blob");const i=await s.blob(),a=URL.createObjectURL(i),l=document.createElement("a");l.href=a,l.download=t.split("/").pop()||t,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)}}const FY="console:partition-id";function sf(){const[e,t]=pi(FY,""),n=e.trim();return _.useMemo(()=>({partitionId:n.length>0?n:void 0,rawPartitionId:e,setPartitionId:t,clearPartitionId:()=>t("")}),[n,e,t])}const VC={refreshInterval:5,timeFormat:"relative",showSparklines:!0,pageSize:20};function of(){const[e,t]=pi("console:preferences",VC);return{preferences:e,setPreferences:t,updatePreference:(i,a)=>{t(l=>({...l,[i]:a}))},resetPreferences:()=>{t(VC)}}}const HY=[{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"}],qY=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],gx="syncular-console-root";function VY(e){e.classList.add(gx)}const KY=[{suffix:"",label:"Command"},{suffix:"/stream",label:"Stream"},{suffix:"/fleet",label:"Fleet"},{suffix:"/ops",label:"Ops"},{suffix:"/storage",label:"Storage"},{suffix:"/config",label:"Config"}];function GY(e){const t=e?.trim()??"";return!t||t==="/"?"":(t.startsWith("/")?t:`/${t}`).replace(/\/+$/g,"")}function $y(e,t){return e?t?`${e}${t}`:e:t||"/"}function ZY({basePath:e,appHref:t,modeBadge:n}){const{connect:s,config:i,isConnected:a,isConnecting:l}=Dt(),{preferences:f}=of(),{instanceId:d,rawInstanceId:p,setInstanceId:g,clearInstanceId:y}=Lt(),{partitionId:b,rawPartitionId:x,setPartitionId:S,clearPartitionId:w}=sf(),T=vr({select:P=>P.location.pathname}),{data:C}=rf({refetchIntervalMs:f.refreshInterval*1e3,partitionId:b,instanceId:d}),O=GY(e),N=_.useMemo(()=>KY.map(P=>({...P,id:$y(O,P.suffix)})),[O]),R=$y(O,""),M=$y(O,"/config"),L=l?"connecting":a?"connected":i?"disconnected":"not-configured",j=N.find(P=>P.suffix===""?T===R||T===`${R}/`:T.startsWith(P.id))?.id??R,A=C?[{label:"HEAD",value:`#${C.maxCommitSeq}`},{label:"COMMITS",value:`${C.commitCount}`},{label:"CHANGES",value:`${C.changeCount}`},{label:"CLIENTS",value:`${C.activeClientCount}/${C.clientCount}`}]:[];return h.jsxs("div",{className:`${gx} h-screen bg-background text-foreground flex flex-col`,children:[h.jsx(OZ,{brand:h.jsx(xc,{to:R,children:h.jsx(kZ,{label:"console"})}),center:h.jsx(EZ,{items:N,activeId:j,renderItem:(P,{active:Z})=>h.jsx(xc,{to:P.id,children:h.jsx(sk,{active:Z,children:P.label})},P.id)}),right:h.jsxs("div",{className:"flex items-center gap-2",children:[n?h.jsx(mn,{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(Gn,{variant:"mono",value:p,onChange:P=>g(P.target.value),onBlur:P=>g(P.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),d?h.jsx(Oe,{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(Gn,{variant:"mono",value:x,onChange:P=>S(P.target.value),onBlur:P=>S(P.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),b?h.jsx(Oe,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:w,children:"All"}):null]}),h.jsx(R8,{state:L}),h.jsx(xc,{to:M,children:h.jsx(Oe,{variant:T===M?"secondary":"ghost",size:"icon",children:h.jsx(q8,{className:"h-3 w-3"})})}),t?h.jsxs("a",{href:t,className:wZ,children:[h.jsx(F8,{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===M?h.jsx("div",{style:{animation:"pageIn 0.3s ease-out"},children:h.jsx(YN,{})},T):h.jsx(YY,{configPath:M,hasSavedConfig:!!i,isConnecting:l,onConnect:()=>{s()}})})}),a&&h.jsx($j,{isLive:a,metrics:A,uptime:"--"})]})}function YY({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(Oe,{variant:"default",onClick:s,disabled:n,children:n?"Connecting...":"Connect"}),h.jsx(xc,{to:e,children:h.jsx(Oe,{variant:"link",children:"Configure connection"})})]})]})}const lo=RH({component:ZY});function XY(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("swServer")==="1"}function QY(e={}){const{maxEvents:t=100,enabled:n=!0,staleAfterMs:s=65e3,replayLimit:i=100,partitionId:a,instanceId:l}=e,{config:f,isConnected:d}=Dt(),{instanceId:p}=Lt(),g=l??p,[y,b]=_.useState([]),[x,S]=_.useState(!1),[w,T]=_.useState("disconnected"),[C,O]=_.useState(null),N=_.useRef(null),R=_.useRef(null),M=_.useRef(null),L=_.useRef(0),j=_.useRef(0),A=_.useRef(null),P=_.useRef(null),Z=_.useCallback(()=>{b([]),A.current=null,P.current=null},[]);return _.useEffect(()=>{if(!n||!d||!f?.serverUrl||!f?.token)return;let B=!1;const z=Number.isFinite(i)?Math.max(1,Math.min(500,Math.floor(i))):100;if(XY()||typeof WebSocket>"u"){T("connecting"),S(!1);let K=null,U=!1;const I=async()=>{if(!(B||U)){U=!0;try{const H=new URL(f.serverUrl,window.location.origin),W=H.pathname.endsWith("/")?H.pathname.slice(0,-1):H.pathname;H.pathname=`${W}/console/events`,H.search="",H.searchParams.set("limit",String(z)),H.searchParams.set("offset","0"),a&&H.searchParams.set("partitionId",a);const X=await fetch(H.toString(),{headers:{Authorization:`Bearer ${f.token}`}});if(!X.ok)throw new Error(`Live event polling failed (${X.status})`);const oe=await X.json(),pe=(Array.isArray(oe.items)?oe.items:[]).filter(Me=>g?Me.instanceId===g:!0).sort((Me,_e)=>Me.eventId-_e.eventId),xe=P.current??-1,de=pe.filter(Me=>Me.eventId>xe);if(de.length>0){const Me=de.map(ne=>({type:ne.eventType,timestamp:ne.createdAt,data:ne})).reverse();b(ne=>[...Me,...ne].slice(0,t));const _e=de[de.length-1];P.current=_e.eventId,A.current=_e.createdAt}else if(pe.length>0){const Me=pe[pe.length-1];P.current=Math.max(P.current??-1,Me.eventId),A.current=Me.createdAt}O(null),S(!0),T("connected")}catch(H){B||(S(!1),T("disconnected"),O(H instanceof Error?H:new Error("Live event polling failed")))}finally{U=!1}}};return I(),K=setInterval(()=>{I()},2e3),()=>{B=!0,K&&clearInterval(K),S(!1),T("disconnected")}}const Y=()=>{R.current&&(clearTimeout(R.current),R.current=null)},ee=()=>{M.current&&(clearInterval(M.current),M.current=null)},D=()=>{if(B||R.current)return;L.current+=1;const K=Math.min(3e4,1e3*2**Math.max(0,L.current-1)),U=Math.floor(K*.2*Math.random()),I=K+U;R.current=setTimeout(()=>{R.current=null,B||q()},I)},V=()=>{j.current=Date.now(),S(!0),T("connected")},q=()=>{if(B)return;T("connecting"),Y();const K=(()=>{const I=new URL(f.serverUrl,window.location.origin);I.protocol=I.protocol==="https:"?"wss:":"ws:";const H=I.pathname.endsWith("/")?I.pathname.slice(0,-1):I.pathname;return I.pathname=`${H}/console/events/live`,I.search="",I.searchParams.set("token",f.token),A.current&&I.searchParams.set("since",A.current),I.searchParams.set("replayLimit",String(z)),a&&I.searchParams.set("partitionId",a),g&&I.searchParams.set("instanceId",g),I.toString()})(),U=new WebSocket(K);N.current=U,U.onopen=()=>{if(B){U.close();return}L.current=0,V(),O(null),ee(),M.current=setInterval(()=>{const I=N.current;if(!I||I.readyState!==WebSocket.OPEN)return;const H=j.current;!H||Date.now()-H<=s||(S(!1),T("stale"),I.close())},1e3)},U.onclose=()=>{B||(S(!1),T("disconnected"),ee(),D())},U.onerror=()=>{B||O(new Error("WebSocket connection failed"))},U.onmessage=I=>{try{const H=JSON.parse(I.data),W=H.type;if(V(),W==="connected"||W==="heartbeat")return;const X={type:W,timestamp:H.timestamp||new Date().toISOString(),data:H};if(a&&X.data.partitionId!==a||g&&X.data.instanceId!==g)return;const oe=Date.parse(A.current??""),se=Date.parse(X.timestamp);Number.isFinite(se)&&(!Number.isFinite(oe)||se>oe)&&(A.current=X.timestamp),b(pe=>[X,...pe].slice(0,t))}catch{}}};return q(),()=>{B=!0,Y(),ee(),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:Z}}function WY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=i.toString(),l=await fetch(`${t.serverUrl}/console/events${a?`?${a}`:""}`,{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to clear events");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","events"]})}})}const JY=_.createContext(null);function pk(){const[e,t]=pi("console:time-range","24h");return{range:e,setRange:t}}const eX=[{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 tX(e){const t=e.toLowerCase();for(const n of eX)if(t.includes(n.hint))return n.type;return"client"}function nX(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 rX(e,t){return typeof e.lagCommitCount=="number"?Math.max(0,e.lagCommitCount):t?Math.max(0,t.maxCommitSeq-e.cursor):0}function sX(e,t){return e.activityState==="stale"?"offline":t>0?"syncing":"online"}function oX(e,t){return e.length<=16?e:`${e.slice(0,12)}-${t+1}`}function iX(e,t,n={}){const s=n.maxNodes??10;return e.slice(0,s).map((i,a)=>{const l=rX(i,t),f=sX(i,l);return{id:oX(i.clientId,a),type:tX(i.clientId),status:f,cursor:Math.max(0,i.cursor),actor:i.actorId,mode:i.connectionMode,dialect:nX(i.clientId),scopes:Object.keys(i.effectiveScopes||{}),lastSeen:i.updatedAt}})}const aX={enabled:!1,thresholds:{p90Latency:500,errorRate:5,clientLag:100}};function KC(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 cX(e){const t=e.length>1&&e.endsWith("/")?e.slice(0,-1):e;return t==="/console"||t.startsWith("/console/")?"/console/stream":"/stream"}function lX(){const e=pp(),t=_.useMemo(()=>typeof window>"u"?"/stream":cX(window.location.pathname),[]),n=pk(),{range:s}=n,{preferences:i}=of(),{partitionId:a}=sf(),l=i.refreshInterval*1e3,[f]=pi("console:alert-config",aX),[d,p]=_.useState("1h"),{data:g}=rf({refetchIntervalMs:l,partitionId:a}),{data:y}=bY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:b}=xY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:x}=SY({limit:5,partitionId:a},{refetchIntervalMs:l}),{data:S}=hk({limit:12,offset:0,partitionId:a},{refetchIntervalMs:l}),{events:w,isConnected:T}=QY({maxEvents:8,partitionId:a}),C=_.useMemo(()=>{const z=y?.buckets??[];let Q=0,Y=0;for(const D of z)Q+=D.pushCount+D.pullCount,Y+=D.errorCount;const ee=Q>0?Y/Q*100:0;return{totalEvents:Q,errorRate:ee}},[y?.buckets]),O=_.useMemo(()=>S?.items?iX(S.items,g,{maxNodes:12}):[],[S?.items,g]),N=O.filter(z=>z.status!=="offline").length,R=O.filter(z=>z.status==="offline").length,M=_.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:KC(z.timestamp,i.timeFormat)})),[w,i.timeFormat]),j=_.useMemo(()=>{const z=y?.buckets;if(!z?.length)return[];const Q=Math.max(...z.map(Y=>Math.max(Y.pushCount,Y.pullCount)),1);return z.map(Y=>({pushPercent:Q>0?Y.pushCount/Q*100:0,pullPercent:Q>0?Y.pullCount/Q*100:0}))},[y?.buckets]),A=_.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]),P=_.useMemo(()=>x?.items?x.items.map(z=>({seq:z.commitSeq,actor:z.actorId,changes:z.changeCount,tables:(z.affectedTables??[]).join(", "),time:KC(z.createdAt,i.timeFormat)})):[],[x?.items,i.timeFormat]),Z=_.useMemo(()=>Math.max(0,100-C.errorRate),[C.errorRate]),B=_.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(JY.Provider,{value:n,children:h.jsxs("div",{className:"flex flex-col",children:[B.length>0&&h.jsx("div",{className:"px-6 pb-4",children:h.jsxs(In,{variant:"destructive",children:[h.jsx(tf,{children:"Threshold Exceeded"}),h.jsx(Pn,{children:B.map((z,Q)=>h.jsx("span",{className:"block",children:z},Q))})]})}),h.jsx(LA,{clients:O,totalNodes:O.length+2,onlineCount:N,offlineCount:R,relayClientIds:[]}),h.jsx(Zj,{items:M}),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(xj,{bars:j,activeRange:d,onRangeChange:p})}),h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(Yj,{buckets:A,successRate:Z})}),h.jsx("div",{className:"border-r border-border",children:h.jsx(Bj,{commits:P,onViewAll:()=>e({href:t})})})]}),h.jsx(Xj,{entries:L,isConnected:T,maxVisible:20,maxHeight:"calc(100vh - 200px)"})]})]})}):h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})})}function uX(){return h.jsx(lX,{})}function fX({children:e}){return h.jsxs("div",{className:"space-y-4 px-5 py-5",children:[h.jsx(dX,{}),h.jsx(yX,{}),h.jsx(vX,{}),e]})}function dX(){const{clearError:e,config:t,connect:n,disconnect:s,error:i,isConnected:a,isConnecting:l}=Dt(),[f,d]=_.useState(t?.serverUrl??"/api"),[p,g]=_.useState(t?.token??""),[y,b]=_.useState(null),[x,S]=_.useState(!1),[w,T]=_.useState(null),[C,O]=pi("console:disconnect-clear-saved-config",!1);_.useEffect(()=>{const j=new URLSearchParams(window.location.search),A=j.get("token"),P=j.get("server");A&&(g(A),window.history.replaceState({},"",window.location.pathname)),P&&d(P)},[]),_.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)},M=async()=>{S(!0),b(null),T(null);const j=performance.now();try{const A=f.trim(),P=p.trim();if(!A||!P)throw new Error("Missing server URL or token");if(!(await fetch(`${A}/console/stats`,{headers:{Authorization:`Bearer ${P}`}})).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(Hj,{isConnected:a,isConnecting:l,isTestingConnection:x,serverUrl:f,onServerUrlChange:d,consoleToken:p,onConsoleTokenChange:g,onSaveAndConnect:N,onDisconnect:R,onTestConnection:M,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(wp,{checked:C,onCheckedChange:O})]})})})}const hX=1440*60*1e3;function GC(e){const t=e.trim();if(!t)return null;const n=Number.parseInt(t,10);return!Number.isInteger(n)||n<=0?null:n}function By(e){if(!e)return"Never";const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():"Invalid date"}function pX(e){return e.length===0?"all scopes":e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`}function mX(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*hX?"expiring":"active"}function gX(e){return e==="revoked"?"destructive":e==="expired"?"offline":e==="expiring"?"syncing":"healthy"}function yX(){const[e,t]=_.useState("all"),[n,s]=_.useState("all"),[i,a]=_.useState("14"),[l,f]=_.useState(!1),[d,p]=_.useState(!1),[g,y]=_.useState(""),[b,x]=_.useState("relay"),[S,w]=_.useState(""),[T,C]=_.useState(""),[O,N]=_.useState(""),[R,M]=_.useState(null),[L,j]=_.useState([]),[A,P]=_.useState(null),[Z,B]=_.useState(null),[z,Q]=_.useState(null),[Y,ee]=_.useState(null),[D,V]=_.useState(null),[q,K]=_.useState(null),[U,I]=_.useState(null),H=_.useMemo(()=>GC(i),[i]),W=H??14,X=_.useMemo(()=>GC(O),[O]),oe=O.trim().length>0,se=!oe||X!==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:xe,isLoading:de,error:Me}=MY(pe),_e=IY(),ne=DY(),he=PY(),ae=zY(),we=LY();_.useEffect(()=>{const me=new Set((xe?.items??[]).map(Te=>Te.keyId));j(Te=>Te.filter(qe=>me.has(qe)))},[xe?.items]);const ve=async()=>{try{const me=T.split(",").map(qe=>qe.trim()).filter(qe=>qe.length>0),Te=await _e.mutateAsync({name:g,keyType:b,actorId:S||void 0,scopeKeys:me.length>0?me:void 0,expiresInDays:oe?X??void 0:void 0});M(Te.secretKey),y(""),w(""),C(""),N("")}catch{}},Se=me=>{navigator.clipboard.writeText(me),B(me),setTimeout(()=>B(null),2e3)},ye=async()=>{if(z)try{await he.mutateAsync(z)}finally{Q(null)}},Ue=async()=>{if(L.length!==0)try{const me=await ne.mutateAsync({keyIds:L});P(me),j([])}catch{}},Ie=async()=>{if(Y)try{const me=await we.mutateAsync(Y.keyId);V({oldKeyId:Y.keyId,oldKeyName:Y.name,secretKey:me.secretKey})}catch{}},Ee=async()=>{if(D)try{await he.mutateAsync(D.oldKeyId)}finally{V(null),ee(null)}},Ve=async()=>{if(q)try{const me=await ae.mutateAsync(q);I(me.secretKey)}finally{K(null)}};if(de)return h.jsx("div",{className:"flex h-[200px] items-center justify-center",children:h.jsx(Pt,{size:"lg"})});if(Me)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: ",Me.message]})});const Xe=(xe?.items??[]).filter(me=>me.revokedAt===null).map(me=>me.keyId),Be=Xe.length>0&&Xe.every(me=>L.includes(me)),We=L.length>0,He=(xe?.items??[]).filter(me=>L.includes(me.keyId)).map(me=>me.name);return h.jsxs(h.Fragment,{children:[h.jsxs(Wb,{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(Oe,{size:"sm",variant:"destructive",onClick:()=>p(!0),disabled:L.length===0,children:["Revoke Selected (",L.length,")"]}),h.jsx(Oe,{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(ms,{children:[h.jsx(ts,{children:"Type filter"}),h.jsxs(dh,{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(Dr,{value:"all",children:"all"}),h.jsx(Dr,{value:"relay",children:"relay"}),h.jsx(Dr,{value:"proxy",children:"proxy"}),h.jsx(Dr,{value:"admin",children:"admin"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Status filter"}),h.jsxs(dh,{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(Dr,{value:"all",children:"all"}),h.jsx(Dr,{value:"active",children:"active"}),h.jsx(Dr,{value:"revoked",children:"revoked"}),h.jsx(Dr,{value:"expiring",children:"expiring"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-expiring-window",children:"Expiring window (days)"}),h.jsx(mc,{children:"Used when status filter is set to expiring."}),h.jsx(Gn,{id:"api-key-expiring-window",placeholder:"14",value:i,inputMode:"numeric",onChange:me=>a(me.target.value)}),H===null&&i.trim().length>0?h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."}):null]})]}),xe?.items.length===0?h.jsx(Xb,{message:"No API keys match the current filters."}):h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{className:"w-[28px]",children:h.jsx($v,{checked:Be,indeterminate:!Be&&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(sl,{children:(xe?.items??[]).map(me=>{const Te=mX(me,W);return h.jsxs(os,{className:"group relative",children:[h.jsx(pt,{className:"w-[28px]",children:h.jsx($v,{checked:L.includes(me.keyId),onCheckedChange:qe=>{j(mt=>qe?[...new Set([...mt,me.keyId])]:mt.filter(lt=>lt!==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(mn,{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:pX(me.scopeKeys)})}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:By(me.createdAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:By(me.lastUsedAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:By(me.expiresAt)}),h.jsx(pt,{className:"flex-1",children:h.jsx(mn,{variant:gX(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:()=>ee(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:()=>K(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:()=>Q(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($r,{open:l,onOpenChange:f,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Create API Key"})}),R?h.jsx(ZC,{copiedKeyId:Z,onClose:()=>{M(null),f(!1)},onCopy:Se,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(ms,{children:[h.jsx(ts,{htmlFor:"api-key-name",children:"Name"}),h.jsx(Gn,{id:"api-key-name",placeholder:"Backend Relay Key",value:g,onChange:me=>y(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Key type"}),h.jsxs(dh,{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(Dr,{value:"relay",children:"relay"}),h.jsx(Dr,{value:"proxy",children:"proxy"}),h.jsx(Dr,{value:"admin",children:"admin"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-actor-id",children:"Actor ID (optional)"}),h.jsx(mc,{children:"Pin this key to a fixed actor ID"}),h.jsx(Gn,{id:"api-key-actor-id",placeholder:"actor-123",value:S,onChange:me=>w(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-scope-keys",children:"Scope keys (optional)"}),h.jsx(mc,{children:"Comma-separated list of allowed scope keys"}),h.jsx(Gn,{id:"api-key-scope-keys",placeholder:"scope-a, scope-b",value:T,onChange:me=>C(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-expires-days",children:"Expires in days (optional)"}),h.jsx(mc,{children:"Leave empty to keep the key non-expiring."}),h.jsx(Gn,{id:"api-key-expires-days",placeholder:"30",value:O,inputMode:"numeric",onChange:me=>N(me.target.value)}),se?null:h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>f(!1),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:ve,disabled:_e.isPending||!g||!se,children:_e.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Creating..."]}):"Create"})]})]})]})}),h.jsx($r,{open:d,onOpenChange:me=>{p(me),me||P(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Bulk Revoke API Keys"})}),A?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(In,{variant:"destructive",children:h.jsxs(Pn,{children:["Requested ",A.requestedCount," keys. Revoked"," ",A.revokedCount,", already revoked"," ",A.alreadyRevokedCount,", not found"," ",A.notFoundCount,"."]})}),h.jsx(Nn,{children:h.jsx(Oe,{variant:"primary",onClick:()=>{p(!1),P(null)},children:"Done"})})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:"This revokes selected keys immediately and cannot be undone."})}),h.jsxs("p",{className:"font-mono text-[10px] text-neutral-500",children:["Selected keys: ",He.slice(0,5).join(", "),He.length>5?` +${He.length-5} more`:""]})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>p(!1),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:Ue,disabled:ne.isPending||L.length===0,children:ne.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke Selected"})]})]})]})}),h.jsx($r,{open:Y!==null||D!==null,onOpenChange:()=>{ee(null),V(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Stage Rotate API Key"})}),D?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsx(In,{variant:"default",children:h.jsxs(Pn,{children:["Replacement key created for ",D.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:D.secretKey}),h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>Se(D.secretKey),children:Z===D.secretKey?"Copied":"Copy"})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>{V(null),ee(null)},children:"Keep Old Key Active"}),h.jsx(Oe,{variant:"destructive",onClick:Ee,disabled:he.isPending,children:he.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{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(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>ee(null),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:Ie,disabled:we.isPending||!Y,children:we.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Staging..."]}):"Create Replacement Key"})]})]})]})}),h.jsx($r,{open:z!==null,onOpenChange:()=>Q(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Revoke API Key"})}),h.jsx("div",{className:"px-5 py-4",children:h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:"Revoking a key immediately invalidates it for all requests."})})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>Q(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:ye,disabled:he.isPending,children:he.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke"})]})]})}),h.jsx($r,{open:q!==null||U!==null,onOpenChange:()=>{K(null),I(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Rotate API Key"})}),U?h.jsx(ZC,{copiedKeyId:Z,onClose:()=>I(null),onCopy:Se,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(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>K(null),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:Ve,disabled:ae.isPending,children:ae.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Rotating..."]}):"Rotate"})]})]})]})})]})}function vX(){const{preferences:e,updatePreference:t,resetPreferences:n}=of(),s=[{type:"filter",label:"Auto-refresh interval",options:HY.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:qY.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(Qj,{rows:s,onResetDefaults:n})}function ZC({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(In,{variant:"destructive",children:h.jsx(Pn,{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(Oe,{variant:"default",size:"sm",onClick:()=>n(s),children:e===s?"Copied":"Copy"})]}),h.jsx(Nn,{children:h.jsx(Oe,{variant:"primary",onClick:t,children:"Done"})})]})}function bX(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 xX(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 SX(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),l=Math.floor(a/60),f=Math.floor(l/60),d=Math.floor(f/24);return a<60?"just now":l<60?`${l}m ago`:f<24?`${f}h ago`:`${d}d ago`}catch{return e}}function _X(e,t,n){return{id:e.clientId,type:bX(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:xX(e.clientId),scopes:Object.keys(e.effectiveScopes??{}),lastSeen:SX(e.updatedAt,n)}}function wX({emptyState:e}={}){const[t,n]=_.useState(1),[s,i]=_.useState(null),{preferences:a}=of(),{partitionId:l}=sf(),f=a.pageSize,d=a.refreshInterval*1e3,{data:p,isLoading:g}=rf({refetchIntervalMs:d,partitionId:l}),{data:y,isLoading:b,error:x}=hk({limit:f,offset:(t-1)*f,partitionId:l},{refetchIntervalMs:d}),S=jY(),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:l})}finally{i(null)}};if(b||g)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{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 O=(y?.items??[]).map(N=>_X(N,T,a.timeFormat));return h.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5",children:[O.length>0&&h.jsx(Jj,{clients:O,headSeq:T}),O.length===0?e??h.jsx(J8,{children:h.jsx(Xb,{message:"No clients yet"})}):h.jsx(Kj,{clients:O,headSeq:T,onEvict:N=>{const R=y?.items.find(M=>M.clientId===N);i(R?.clientId??N)}}),w>1&&h.jsx(px,{page:t,totalPages:w,totalItems:y?.total??0,onPageChange:n}),h.jsx($r,{open:s!==null,onOpenChange:()=>i(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{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(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>i(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:C,disabled:S.isPending,children:S.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Evicting..."]}):"Evict"})]})]})})]})}const EX={latencyThresholdMs:1e3,errorRateThreshold:5,clientLagThreshold:50,enabled:!1};function TX(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 CX(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);return Array.from(new Set(t))}function RX(e){switch(e){case"notify_data_change":return"Notify";case"evict_client":return"Evict";case"compact":return"Compact";default:return"Prune"}}function YC(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function NX(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function jX(e){const t=YC(e.requestPayload),n=YC(e.resultPayload);if(e.operationType==="notify_data_change"){const a=NX(t?.tables),l=n?.commitSeq;return`${a.length} table${a.length===1?"":"s"} -> commit #${typeof l=="number"?l:"?"}`}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 AX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function kX(){const{partitionId:e}=sf();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(OX,{}),h.jsx(zX,{})]}),h.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[h.jsx(MX,{partitionId:e}),h.jsx(IX,{partitionId:e}),h.jsx(PX,{partitionId:e})]}),h.jsx(DX,{partitionId:e})]})}function OX(){const{data:e,isLoading:t,error:n}=CY();if(t)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{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?TX(i.snapshotChunkTtlMs):"default"}));return h.jsx(Gj,{handlers:s,tableCount:e?.items.length??0})}function MX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=rf({partitionId:e}),{data:f,isLoading:d,refetch:p}=RY({enabled:!1}),g=AY(),y=async()=>{n(!0),i(null),await p()},b=async()=>{const S=await g.mutateAsync();i(S.deletedCommits)};if(l)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{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(Ep,{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($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Prune Old Commits"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(In,{variant:"default",children:[h.jsx(tf,{children:"Pruning Complete"}),h.jsxs(Pn,{children:["Successfully deleted ",h.jsx("strong",{children:s})," commits."]})]}):d?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Pt,{size:"sm"})}):f?h.jsxs(h.Fragment,{children:[h.jsx(In,{variant:f.commitsToDelete>0?"destructive":"default",children:h.jsx(Pn,{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(mn,{variant:f.commitsToDelete>0?"offline":"ghost",children:f.commitsToDelete})]})]})]}):null}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Oe,{variant:"destructive",onClick:b,disabled:g.isPending||d||(f?.commitsToDelete??0)===0,children:g.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Pruning..."]}):"Prune Now"})]})]})})]})}function IX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=rf({partitionId:e}),f=kY(),d=()=>{n(!0),i(null)},p=async()=>{const y=await f.mutateAsync();i(y.deletedChanges)};if(l)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{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(Ep,{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($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Compact Changes"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(In,{variant:"default",children:[h.jsx(tf,{children:"Compaction Complete"}),h.jsxs(Pn,{children:["Successfully removed ",h.jsx("strong",{children:s})," redundant changes."]})]}):h.jsx(In,{variant:"default",children:h.jsx(Pn,{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(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Oe,{variant:"primary",onClick:p,disabled:f.isPending,children:f.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Compacting..."]}):"Compact Now"})]})]})})]})}function PX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState("tasks"),[a,l]=_.useState(e??""),[f,d]=_.useState(null),[p,g]=_.useState(null),y=OY(),b=CX(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(Ep,{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($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Notify External Data Change"})}),h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[f?h.jsxs(In,{variant:"default",children:[h.jsx(tf,{children:"Notification Sent"}),h.jsxs(Pn,{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(In,{variant:"default",children:h.jsx(Pn,{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(In,{variant:"destructive",children:h.jsx(Pn,{children:p})}):null,h.jsxs(ms,{children:[h.jsx(ts,{children:"Tables (comma-separated)"}),h.jsx(Gn,{value:s,onChange:T=>i(T.target.value),placeholder:"tasks, notes",disabled:y.isPending}),h.jsx(mc,{children:"Enter one or more table names affected by the external change."})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Partition ID (optional)"}),h.jsx(Gn,{value:a,onChange:T=>l(T.target.value),placeholder:"default",disabled:y.isPending})]})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:f?"Close":"Cancel"}),f?null:h.jsx(Oe,{variant:"primary",onClick:w,disabled:y.isPending,children:y.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Notifying..."]}):"Notify Data Change"})]})]})})]})}function DX({partitionId:e}){const[t,n]=_.useState("all"),{data:s,isLoading:i,error:a}=NY({limit:20,offset:0,operationType:t==="all"?void 0:t,partitionId:e},{refetchIntervalMs:5e3});return h.jsx(Wb,{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(Oe,{variant:t==="all"?"default":"ghost",size:"sm",onClick:()=>n("all"),children:"All"}),h.jsx(Oe,{variant:t==="prune"?"default":"ghost",size:"sm",onClick:()=>n("prune"),children:"Prune"}),h.jsx(Oe,{variant:t==="compact"?"default":"ghost",size:"sm",onClick:()=>n("compact"),children:"Compact"}),h.jsx(Oe,{variant:t==="notify_data_change"?"default":"ghost",size:"sm",onClick:()=>n("notify_data_change"),children:"Notify"}),h.jsx(Oe,{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(Pt,{size:"lg"})}):a?h.jsx(In,{variant:"destructive",children:h.jsxs(Pn,{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(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{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(sl,{children:(s?.items??[]).map((l,f)=>h.jsxs(os,{children:[h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:AX(l.createdAt)}),h.jsx(pt,{children:h.jsx(mn,{variant:"ghost",children:RX(l.operationType)})}),h.jsx(pt,{className:"font-mono text-xs",children:l.consoleUserId??"system"}),h.jsx(pt,{className:"font-mono text-xs",children:l.targetClientId??l.partitionId??(l.operationType==="notify_data_change"?"partition default":"global")}),h.jsx(pt,{className:"font-mono text-xs text-neutral-300",children:jX(l)})]},`${l.operationId}:${l.createdAt}:${f}`))})]})})})}function zX(){const[e,t]=pi("console:alert-config",EX),n={p90Latency:e.latencyThresholdMs,errorRate:e.errorRateThreshold,clientLag:e.clientLagThreshold},s=a=>{t(l=>({...l,latencyThresholdMs:a.p90Latency,errorRateThreshold:a.errorRate,clientLagThreshold:a.clientLag}))},i=a=>{t(l=>({...l,enabled:a}))};return h.jsx(Uj,{enabled:e.enabled,onEnabledChange:i,thresholds:n,onThresholdsChange:s})}function LX(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 UX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function $X(){const[e,t]=_.useState(""),[n,s]=_.useState(void 0),[i,a]=_.useState(void 0),[l,f]=_.useState([]),[d,p]=_.useState(null),{data:g,isLoading:y,error:b}=UY({prefix:n,cursor:i,limit:100}),x=$Y(),S=BY();function w(){const M=e.trim();s(M.length>0?M:void 0),a(void 0),f([])}function T(){t(""),s(void 0),a(void 0),f([])}function C(){g?.cursor&&(f(M=>[...M,i??""]),a(g.cursor))}function O(){f(M=>{const L=[...M],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(Pt,{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(Wb,{title:"Storage",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Gn,{placeholder:"Prefix filter...",value:e,onChange:M=>t(M.target.value),onKeyDown:M=>{M.key==="Enter"&&w()},className:"h-7 w-48 text-xs"}),h.jsx(Oe,{variant:"default",size:"sm",onClick:w,children:"Filter"}),n&&h.jsx(Oe,{variant:"ghost",size:"sm",onClick:T,children:"Clear"})]}),children:R.length===0?h.jsx(Xb,{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(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{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(sl,{children:R.map(M=>h.jsxs(os,{children:[h.jsx(pt,{className:"font-mono text-xs max-w-[320px]",title:M.key,children:M.key}),h.jsx(pt,{className:"font-mono text-xs text-neutral-400 whitespace-nowrap",children:LX(M.size)}),h.jsx(pt,{children:M.httpMetadata?.contentType?h.jsx(mn,{variant:"ghost",children:M.httpMetadata.contentType}):h.jsx("span",{className:"text-neutral-500 text-xs",children:"--"})}),h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:UX(M.uploaded)}),h.jsx(pt,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>{S(M.key)},children:"Download"}),h.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>p(M.key),children:"Delete"})]})})]},M.key))})]})}),h.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[h.jsx(Oe,{variant:"ghost",size:"sm",disabled:l.length===0,onClick:O,children:"Previous"}),h.jsx(Oe,{variant:"ghost",size:"sm",disabled:!g?.truncated,onClick:C,children:"Next"})]})]})}),h.jsx($r,{open:d!==null,onOpenChange:()=>p(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{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(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>p(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:N,disabled:x.isPending,children:x.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"})," Deleting..."]}):"Delete"})]})]})})]})}const BX={};function au(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 FX(e){const t=e.split(/\s+/).map(i=>i.trim()).filter(i=>i.length>0),n={},s=[];for(const i of t){const[a="",...l]=i.split(":"),f=l.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 HX(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 Gd(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function qX(e,t){return e?`#${e.federatedCommitId??(t?`${t}:${e.commitSeq}`:String(e.commitSeq))}`:"#?"}function VX(e,t){return e?`E${e.federatedEventId??(t?`${t}:${e.eventId}`:e.eventId)}`:"E?"}function KX(e,t,n){return!e||!t?null:e.replaceAll("{traceId}",encodeURIComponent(t)).replaceAll("{spanId}",encodeURIComponent(n??""))}function yx({initialSelectedEntryId:e}={}){const{preferences:t}=of(),{partitionId:n}=sf(),{range:s,setRange:i}=pk(),a=t.pageSize,l=t.refreshInterval*1e3,f=BX?.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),[O,N]=_.useState(!1),[R,M]=_.useState(e??null),L=_.useRef(!1),j=_.useMemo(()=>FX(S),[S]),A=_.useMemo(()=>new Date(Date.now()-HX(s)).toISOString(),[s]),{data:P,isLoading:Z,refetch:B}=wY({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:A},{refetchIntervalMs:l}),z=WY(),Q=R?.startsWith("#")?R.slice(1):void 0,Y=R?.startsWith("E")?R.slice(1):void 0,ee=Q&&Q!=="?"?Q:void 0,D=Y&&Y!=="?"?Y:void 0,{data:V,isLoading:q,error:K}=_Y(ee,{enabled:ee!==void 0,partitionId:n}),{data:U,isLoading:I,error:H}=EY(D,{enabled:D!==void 0,partitionId:n}),{data:W,isLoading:X,error:oe}=TY(D,{enabled:D!==void 0&&!!U?.payloadRef,partitionId:n}),se=_.useMemo(()=>KX(f,U?.traceId??null,U?.spanId??null),[U?.spanId,U?.traceId,f]);_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{e&&M(e)},[e]),_.useEffect(()=>{if(!L.current){L.current=!0;return}M(null)},[]),_.useEffect(()=>{C(1),M(null)},[]);const xe=_.useMemo(()=>(P?.items??[]).map(we=>{const ve=we.instanceId??we.commit?.instanceId??we.event?.instanceId,Se=ve?`[${ve}] `:"";if(we.type==="commit"&&we.commit){const Ue=we.commit;return{type:"commit",id:qX(Ue,ve),outcome:"--",duration:"--",actor:Ue.actorId,client:Ue.clientId,detail:`${Se}${Ue.changeCount} chg | ${(Ue.affectedTables??[]).join(", ")}`,time:au(we.timestamp,t.timeFormat)}}const ye=we.event;return ye?{type:ye.eventType,id:VX(ye,ve),outcome:ye.outcome,duration:`${ye.durationMs}ms`,actor:ye.actorId,client:ye.clientId,detail:`${Se}${(ye.tables??[]).join(", ")||"--"}`,time:au(we.timestamp,t.timeFormat)}:{type:"pull",id:"E?",outcome:"unknown",duration:"--",actor:"",client:"",detail:"--",time:au(we.timestamp,t.timeFormat)}}),[t.timeFormat,P?.items]),de=P?.total??0,Me=Math.max(1,Math.ceil(de/a)),_e=Z,ne=[{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 he(){z.mutate(void 0,{onSuccess:()=>{N(!1),B()}})}return h.jsxs("div",{className:"flex flex-col h-full",children:[_e&&xe.length===0?h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})}):h.jsx(Wj,{entries:xe,selectedEntryId:R,onEntryClick:ae=>M(ae.id),filterBar:h.jsx(qj,{groups:ne,searchValue:S,searchPlaceholder:"Use actor:, client:, table:, request:, trace: or free text...",onSearchChange:w,actions:h.jsxs(h.Fragment,{children:[h.jsx(Oe,{size:"sm",variant:"ghost",onClick:()=>{B()},children:"Refresh"}),h.jsx(Oe,{size:"sm",variant:"ghost",children:"Export"}),h.jsx(Oe,{size:"sm",variant:"destructive",onClick:()=>N(!0),children:"Clear"})]})}),pagination:h.jsx(px,{page:T,totalPages:Me,totalItems:de,onPageChange:C})}),h.jsx($r,{open:R!==null,onOpenChange:ae=>{ae||M(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:ee!==void 0?`Commit #${ee}`:D!==void 0?`Event E${D}`:"Entry details"})}),h.jsx("div",{className:"px-5 py-4 space-y-3 max-h-[70vh] overflow-y-auto",children:q||I?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Pt,{size:"sm"})}):K||H?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:au(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:Gd(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??"--"}),se&&h.jsx("a",{href:se,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(Oe,{variant:"ghost",size:"sm",onClick:()=>M(`#${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:au(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:Gd(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"}),X?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Pt,{size:"sm"}),h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:"Loading payload snapshot..."})]}):oe?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:Gd(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:Gd(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(Nn,{children:h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>M(null),children:"Close"})})]})}),h.jsx($r,{open:O,onOpenChange:ae=>{ae||N(!1)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{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(Nn,{children:[h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>N(!1),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",size:"sm",onClick:he,disabled:z.isPending,children:z.isPending?"Clearing...":"Clear all"})]})]})})]})}const GX=ao({getParentRoute:()=>lo,path:"/config",component:fX}),ZX=ao({getParentRoute:()=>lo,path:"/fleet",component:wX}),YX=ao({getParentRoute:()=>lo,path:"/",component:uX});function XX(){const{seq:e}=mk.useParams();return h.jsx(yx,{initialSelectedEntryId:`#${e}`})}const mk=ao({getParentRoute:()=>lo,path:"/investigate/commit/$seq",component:XX});function QX(){const{id:e}=gk.useParams();return h.jsx(yx,{initialSelectedEntryId:`E${e}`})}const gk=ao({getParentRoute:()=>lo,path:"/investigate/event/$id",component:QX}),WX=ao({getParentRoute:()=>lo,path:"/ops",component:kX}),JX=ao({getParentRoute:()=>lo,path:"/storage",component:$X}),eQ=ao({getParentRoute:()=>lo,path:"/stream",component:yx}),tQ=lo.addChildren([YX,eQ,mk,gk,ZX,WX,JX,GX]),nQ="syncular-console-basepath",rQ="syncular-console-server-url",sQ="syncular-console-token";function oQ(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Bv(e){const t=globalThis.document;if(!t)return;const n=t.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return oQ(n)}function yk(e){return!e||e==="/"?"/":(e.startsWith("/")?e:`/${e}`).replace(/\/+$/g,"")||"/"}function iQ(){return yk(Bv(nQ))}function aQ(){const e=Bv(rQ),t=Bv(sQ);return!e||!t?null:{serverUrl:e,token:t}}function cQ(){return new A6({defaultOptions:{queries:{staleTime:5e3,retry:1}}})}function lQ(e){return yk(e??iQ())}function uQ(e){const[t]=_.useState(()=>cQ()),n=_.useMemo(()=>PH({routeTree:tQ,basepath:lQ(e.basePath)}),[e.basePath]),s=e.defaultConfig===void 0?aQ():e.defaultConfig,i=e.autoConnect??e.defaultConfig===void 0;return h.jsx(k6,{client:t,children:h.jsx(QH,{defaultConfig:s,autoConnect:i,children:h.jsx(LH,{router:n})})})}function fQ(e){return h.jsx("div",{className:gx,children:h.jsx(uQ,{...e})})}function dQ(e){const t=document.querySelector(e);if(!t)throw new Error(`Unable to mount console: ${e} not found`);return t}function hQ(e,t={}){const n=dQ(e);VY(n);const s=i6.createRoot(n),i=h.jsx(fQ,{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 pQ={};const mQ="syncular-sentry-dsn",gQ="syncular-sentry-environment",yQ="syncular-sentry-release";function gu(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Fy(e){if(typeof document>"u")return;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return gu(t)}function Hy(e){if(!(typeof process>"u"))return gu(pQ[e])}function qy(e){for(const t of e)if(t)return t}function vQ(){const e=qy([gu(globalThis.__SYNCULAR_SENTRY_DSN__),Fy(mQ),Hy("SYNCULAR_SENTRY_DSN")]);if(!e)return null;const t=qy([gu(globalThis.__SYNCULAR_SENTRY_ENVIRONMENT__),Fy(gQ),Hy("SYNCULAR_SENTRY_ENVIRONMENT")]),n=qy([gu(globalThis.__SYNCULAR_SENTRY_RELEASE__),Fy(yQ),Hy("SYNCULAR_SENTRY_RELEASE")]);return{dsn:e,environment:t,release:n,enableLogs:!0,tracesSampleRate:.2,tracePropagationTargets:[/^https?:\/\/.*\/api\/.*/]}}const XC=vQ();XC&&QB(XC);hQ("#root");
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 Jh(e,t){e&&Object.assign(e.style,t)}const ZG={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},YG={position:"fixed"},XG=_.forwardRef(function(t,n){const{anchor:s,positionMethod:i="absolute",className:a,render:l,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=e8,...k}=t,{store:N,listRef:R,labelsRef:M,alignItemWithTriggerActiveRef:L,selectedItemTextRef:j,valuesRef:A,initialValueRef:P,popupRef:G,setValue:B}=Ju(),z=VA(),Q=at(N,it.open),Y=at(N,it.mounted),ee=at(N,it.modal),D=at(N,it.value),K=at(N,it.openMethod),q=at(N,it.positionerElement),V=at(N,it.triggerElement),U=at(N,it.isItemEqualToValue),I=at(N,it.transitionStatus),H=_.useRef(null),W=_.useRef(null),[X,oe]=_.useState(T),se=Y&&X&&K!=="touch";!Y&&X!==T&&oe(T),Le(()=>{Y||(it.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),it.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,Y]),_.useImperativeHandle(L,()=>se),KA((se||ee)&&Q&&K!=="touch",V);const de=BA({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??se,collisionAvoidance:C,keepMounted:!0}),xe=se?"none":de.side,he=se?YG:de.positionerStyles,Me=_.useMemo(()=>{const Se={};return Q||(Se.pointerEvents="none"),{role:"presentation",hidden:!Y,style:{...he,...Se}}},[Q,Y,he]),_e={open:Q,side:xe,align:de.align,anchorHidden:de.anchorHidden},ne=Ae(Se=>{N.set("positionerElement",Se)}),pe=zt("div",t,{ref:[n,ne],state:_e,stateAttributesMapping:il,props:[Me,kp(I),k]}),ae=_.useRef(0),we=Ae(Se=>{if(Se.size===0&&ae.current===0||A.current.length===0)return;const ye=ae.current;if(ae.current=Se.size,Se.size===ye)return;const Ue=Yt(ii);if(ye!==0&&!N.state.multiple&&D!==null&&Uy(A.current,D,U)===-1){const Ee=P.current,Xe=Ee!=null&&Uy(A.current,Ee,U)!==-1?Ee:null;B(Xe,Ue),Xe===null&&(N.set("selectedIndex",null),j.current=null)}if(ye!==0&&N.state.multiple&&Array.isArray(D)){const Ie=Ve=>Uy(A.current,Ve,U)!==-1,Ee=D.filter(Ve=>Ie(Ve));(Ee.length!==D.length||Ee.some(Ve=>!EG(D,Ve,U)))&&(B(Ee,Ue),Ee.length===0&&(N.set("selectedIndex",null),j.current=null))}if(Q&&se){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ie={height:""};Jh(q,Ie),Jh(G.current,Ie)}}),ve=_.useMemo(()=>({...de,side:xe,alignItemWithTriggerActive:se,setControlledAlignItemWithTrigger:oe,scrollUpArrowRef:H,scrollDownArrowRef:W}),[de,xe,se,oe]);return h.jsx(ZA,{elementsRef:R,labelsRef:M,onMapChange:we,children:h.jsxs(YA.Provider,{value:ve,children:[Y&&ee&&h.jsx(XA,{inert:hx(!Q),cutout:V}),pe]})})});function QA(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 Kd="base-ui-disable-scrollbar",UC={className:Kd,getElement(e){return h.jsx("style",{nonce:e,href:Kd,precedence:"base-ui:low",children:`.${Kd}{scrollbar-width:none}.${Kd}::-webkit-scrollbar{display:none}`})}},QG=_.createContext(void 0);function WA(e){return _.useContext(QG)}const Ec="ArrowUp",Qi="ArrowDown",ku="ArrowLeft",Tc="ArrowRight",ef="Home",tf="End",JA=new Set([ku,Tc]),WG=new Set([ku,Tc,ef,tf]),ek=new Set([Ec,Qi]),JG=new Set([Ec,Qi,ef,tf]),tk=new Set([...JA,...ek]),eZ=new Set([...tk,ef,tf]),nk=new Set([Ec,Qi,ku,Tc,ef,tf]),tZ="Shift",nZ="Control",rZ="Alt",sZ="Meta",oZ=new Set([tZ,nZ,rZ,sZ]);function iZ(e){return Zt(e)&&e.tagName==="INPUT"}function $C(e){return!!(iZ(e)&&e.selectionStart!=null||Zt(e)&&e.tagName==="TEXTAREA")}function BC(e,t,n,s){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop;const l=e.clientWidth<e.scrollWidth,f=e.clientHeight<e.scrollHeight;if(l&&s!=="vertical"){const d=FC(e,t,"left"),p=Gd(e),g=Gd(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=Gd(e),g=Gd(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 Gd(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 $y(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const aZ=_.createContext(void 0),cZ={disableStyleElements:!1};function lZ(){return _.useContext(aZ)??cZ}const qi=1,uZ={...il,...va},fZ=_.forwardRef(function(t,n){const{render:s,className:i,finalFocus:a,...l}=t,{store:f,popupRef:d,onOpenChangeComplete:p,setOpen:g,valueRef:y,selectedItemTextRef:b,keyboardActiveRef:x,multiple:S,handleScrollArrowVisibility:w,scrollHandlerRef:T,highlightItemOnHover:C}=Ju(),{side:k,align:N,alignItemWithTriggerActive:R,setControlledAlignItemWithTrigger:M,scrollDownArrowRef:L,scrollUpArrowRef:j}=GG(),A=WA()!=null,P=VA(),{nonce:G,disableStyleElements:B}=lZ(),z=rs(),Q=at(f,it.id),Y=at(f,it.open),ee=at(f,it.mounted),D=at(f,it.popupProps),K=at(f,it.transitionStatus),q=at(f,it.triggerElement),V=at(f,it.positionerElement),U=at(f,it.listElement),I=_.useRef(0),H=_.useRef(!1),W=_.useRef(0),X=_.useRef(!1),oe=_.useRef({}),se=ax(),de=Ae(_e=>{if(!V||!d.current||!X.current)return;if(H.current||!R){w();return}const ne=V.style.top==="0px",pe=V.style.bottom==="0px",ae=V.getBoundingClientRect().height,we=Rt(V),ve=getComputedStyle(V),Se=parseFloat(ve.marginTop),ye=parseFloat(ve.marginBottom),Ue=HC(getComputedStyle(d.current)),Ie=Math.min(we.documentElement.clientHeight-Se-ye,Ue),Ee=_e.scrollTop,Ve=qC(_e);let Xe=0,Be=null,We=!1,He=!1;const me=qe=>{V.style.height=`${qe}px`},Te=(qe,mt)=>{const lt=$y(qe,0,Ie-ae);lt>0&&me(ae+lt),_e.scrollTop=mt,Ie-(ae+lt)<=qi&&(H.current=!0),w()};if(ne){const qe=Ve-Ee,mt=ae+qe,lt=Math.min(mt,Ie);if(Xe=lt,qe<=qi){Te(qe,Ve);return}Ie-lt>qi?He=!0:We=!0}else if(pe){const qe=Ee,mt=ae+qe,lt=Math.min(mt,Ie),wr=mt-Ie;if(Xe=lt,qe<=qi){Te(qe,0);return}Ie-lt>qi?Be=0:(We=!0,Ee<Ve&&(Be=Ee-(qe-wr)))}if(Xe=Math.ceil(Xe),Xe!==0&&me(Xe),He||Be!=null){const qe=qC(_e),mt=He?qe:$y(Be,0,qe);Math.abs(_e.scrollTop-mt)>qi&&(_e.scrollTop=mt)}(We||Xe>=Ie-qi)&&(H.current=!0),w()});_.useImperativeHandle(T,()=>de,[de]),ba({open:Y,ref:d,onComplete(){Y&&p?.(!0)}});const xe={open:Y,transitionStatus:K,side:k,align:N};Le(()=>{!V||!d.current||Object.keys(oe.current).length||(oe.current={top:V.style.top||"0",left:V.style.left||"0",right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[d,V]),Le(()=>{Y||R||(X.current=!1,H.current=!1,I.current=0,W.current=0,Jh(V,oe.current))},[Y,R,V,d]),Le(()=>{const _e=d.current;if(!(!Y||!q||!V||!_e||f.state.transitionStatus==="ending")){if(!R){X.current=!0,se.request(w),_e.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const ne=dZ(_e);_e.style.removeProperty("--transform-origin");try{const pe=getComputedStyle(V),ae=getComputedStyle(_e),we=Rt(q),ve=un(V),Se=q.getBoundingClientRect(),ye=V.getBoundingClientRect(),Ue=Se.left,Ie=Se.height,Ee=U||_e,Ve=Ee.scrollHeight,Xe=parseFloat(ae.borderBottomWidth),Be=parseFloat(pe.marginTop)||10,We=parseFloat(pe.marginBottom)||10,He=parseFloat(pe.minHeight)||100,me=HC(ae),Te=5,qe=5,mt=20,lt=we.documentElement.clientHeight-Be-We,wr=we.documentElement.clientWidth,Er=lt-Se.bottom+Ie,Qt=b.current,ut=y.current;let xt,ot=0,Wt=0;if(Qt&&ut){const tr=ut.getBoundingClientRect();xt=Qt.getBoundingClientRect();const ls=tr.left-Ue,uo=xt.left-ye.left,fo=tr.top-Se.top+tr.height/2,nr=xt.top-ye.top+xt.height/2;ot=ls-uo,Wt=nr-fo}const vn=Er+Wt+We+Xe;let kt=Math.min(lt,vn);const Cn=lt-Be-We,er=vn-kt,An=Math.max(Te,Ue+ot),as=wr-qe,cs=Math.max(0,An+ye.width-as);V.style.left=`${An-cs}px`,V.style.height=`${kt}px`,V.style.maxHeight="auto",V.style.marginTop=`${Be}px`,V.style.marginBottom=`${We}px`,_e.style.height="100%";const _a=Ee.scrollHeight-Ee.clientHeight,_i=er>=_a;_i&&(kt=Math.min(lt,ye.height)-(er-_a));const wi=Se.top<mt||Se.bottom>lt-mt||kt<Math.min(Ve,He),ws=(ve.visualViewport?.scale??1)!==1&&rx;if(wi||ws){X.current=!0,Jh(V,oe.current),hi.flushSync(()=>M(!1));return}if(_i){const tr=Math.max(0,lt-vn);V.style.top=ye.height>=Cn?"0":`${tr}px`,V.style.height=`${kt}px`,Ee.scrollTop=Ee.scrollHeight-Ee.clientHeight,I.current=Math.max(He,kt)}else V.style.bottom="0",I.current=Math.max(He,kt),Ee.scrollTop=er;if(xt){const tr=ye.top,ls=ye.height,uo=xt.top+xt.height/2,fo=ls>0?(uo-tr)/ls*100:50,nr=$y(fo,0,100);_e.style.setProperty("--transform-origin",`50% ${nr}%`)}(I.current===lt||kt>=me)&&(H.current=!0),w(),setTimeout(()=>{X.current=!0})}finally{ne()}})}},[f,Y,V,q,y,b,d,w,R,M,se,L,j,U]),_.useEffect(()=>{if(!R||!V||!Y)return;const _e=un(V);function ne(pe){g(!1,Yt(T8,pe))}return _e.addEventListener("resize",ne),()=>{_e.removeEventListener("resize",ne)}},[g,R,V,Y]);const he={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${Q}-list`},onKeyDown(_e){x.current=!0,A&&nk.has(_e.key)&&_e.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(_e){if(!C||QA(_e)||_e.pointerType==="touch")return;const ne=_e.currentTarget;z.start(0,()=>{f.set("activeIndex",null),ne.focus({preventScroll:!0})})},onScroll(_e){U||de(_e.currentTarget)},...R&&{style:U?{height:"100%"}:ZG}},Me=zt("div",t,{ref:[n,d],state:xe,stateAttributesMapping:uZ,props:[D,he,kp(K),{className:!U&&R?UC.className:void 0},l]});return h.jsxs(_.Fragment,{children:[!B&&UC.getElement(G),h.jsx(RA,{context:P,modal:!1,disabled:!ee,returnFocus:a,restoreFocus:!0,children:Me})]})});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 dZ(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 rk=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function px(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:i,index:a}=e,{register:l,unregister:f,subscribeMapChange:d,elementsRef:p,labelsRef:g,nextIndexRef:y}=HG(),b=_.useRef(-1),[x,S]=_.useState(a??(i===rk.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 k=t!==void 0;g.current[x]=k?t:s?.current?.textContent??C.textContent}},[x,p,g,t,s]);return Le(()=>{if(a!=null)return;const C=w.current;if(C)return l(C,n),()=>{f(C)}},[a,l,f,n]),Le(()=>{if(a==null)return d(C=>{const k=w.current?C.get(w.current)?.index:null;k!=null&&S(k)})},[a,d,S]),_.useMemo(()=>({ref:T,index:x}),[x,T])}const hZ=_.createContext(void 0),pZ=_.memo(_.forwardRef(function(t,n){const{render:s,className:i,value:a=null,label:l,disabled:f=!1,nativeButton:d=!1,...p}=t,g=_.useRef(null),y=px({label:l,textRef:g,indexGuessBehavior:rk.GuessFromOrder}),{store:b,getItemProps:x,setOpen:S,setValue:w,selectionRef:T,typingRef:C,valuesRef:k,keyboardActiveRef:N,multiple:R,highlightItemOnHover:M}=Ju(),L=rs(),j=at(b,it.isActive,y.index),A=at(b,it.isSelected,y.index,a),P=at(b,it.isSelectedByFocus,y.index),G=at(b,it.isItemEqualToValue),B=y.index,z=B!==-1,Q=_.useRef(null),Y=Jo(B);Le(()=>{if(!z)return;const se=k.current;return se[B]=a,()=>{delete se[B]}},[z,B,a,k]),Le(()=>{if(!z)return;const se=b.state.value;let de=se;R&&Array.isArray(se)&&se.length>0&&(de=se[se.length-1]),de!==void 0&&Bc(a,de,G)&&b.set("selectedIndex",B)},[z,B,R,G,b,a]);const ee={disabled:f,selected:A,highlighted:j},D=x({active:j,selected:A});D.onFocus=void 0,D.id=void 0;const K=_.useRef(null),q=_.useRef("mouse"),V=_.useRef(!1),{getButtonProps:U,buttonRef:I}=el({disabled:f,focusableWhenDisabled:!0,native:d});function H(se){const de=b.state.value;if(R){const xe=Array.isArray(de)?de:[],he=A?TG(xe,a,G):[...xe,a];w(he,Yt(Ny,se))}else w(a,Yt(Ny,se)),S(!1,Yt(Ny,se))}const W={role:"option","aria-selected":A,tabIndex:j?0:-1,onFocus(){b.set("activeIndex",B)},onMouseEnter(){!N.current&&b.state.selectedIndex===null&&M&&b.set("activeIndex",B)},onMouseMove(){M&&b.set("activeIndex",B)},onMouseLeave(se){!M||N.current||QA(se)||L.start(0,()=>{b.state.activeIndex===B&&b.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(se){K.current=se.key,b.set("activeIndex",B)},onClick(se){V.current=!1,!(se.type==="keydown"&&K.current===null)&&(f||K.current===" "&&C.current||q.current!=="touch"&&!j||(K.current=null,H(se.nativeEvent)))},onPointerEnter(se){q.current=se.pointerType},onPointerDown(se){q.current=se.pointerType,V.current=!0},onMouseUp(se){if(f)return;if(V.current){V.current=!1;return}const de=!T.current.allowSelectedMouseUp&&A,xe=!T.current.allowUnselectedMouseUp&&!A;de||xe||q.current!=="touch"&&!j||H(se.nativeEvent)}},X=zt("div",t,{ref:[I,n,y.ref,Q],state:ee,props:[D,W,p,U]}),oe=_.useMemo(()=>({selected:A,indexRef:Y,textRef:g,selectedByFocus:P,hasRegistered:z}),[A,Y,g,P,z]);return h.jsx(hZ.Provider,{value:oe,children:X})})),mZ=_.forwardRef(({className:e,children:t,...n},s)=>h.jsx(IG,{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}));mZ.displayName="SelectTrigger";const gZ=_.forwardRef(({className:e,portalProps:t,positionerProps:n,...s},i)=>h.jsx(DG,{...t,children:h.jsx(XG,{...n,children:h.jsx(fZ,{ref:i,className:ge("bg-panel border border-border rounded-md py-1 shadow-lg z-50",e),...s})})}));gZ.displayName="SelectContent";const yZ=_.forwardRef(({className:e,...t},n)=>h.jsx(pZ,{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}));yZ.displayName="SelectItem";const vZ=_.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}));vZ.displayName="Textarea";const sk=_.createContext(void 0);function bZ(e=!0){const t=_.useContext(sk);if(t===void 0&&!e)throw new Error(yn(7));return t}function ok(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=Mj(),{ref:i,index:a}=px(e),l=n===a,f=_.useRef(null),d=so(i,f);return{compositeProps:_.useMemo(()=>({tabIndex:l?0:-1,onFocus(){s(a)},onMouseMove(){const g=f.current;if(!t||!g)return;const y=g.hasAttribute("disabled")||g.ariaDisabled==="true";!l&&!y&&g.focus()}}),[l,s,a,t]),compositeRef:d,index:a}}function xZ(e){const{render:t,className:n,state:s=an,props:i=Nu,refs:a=Nu,metadata:l,stateAttributesMapping:f,tag:d="div",...p}=e,{compositeProps:g,compositeRef:y}=ok({metadata:l});return zt(d,e,{state:s,ref:[...a,y],props:[g,...i,p],stateAttributesMapping:f})}const SZ=_.forwardRef(function(t,n){const{className:s,defaultPressed:i=!1,disabled:a=!1,form:l,onPressedChange:f,pressed:d,render:p,type:g,value:y,nativeButton:b=!0,...x}=t,S=br(y||void 0),w=bZ(),T=w?.value??[],C=w?void 0:i,k=(a||w?.disabled)??!1,[N,R]=yp({controlled:w?S!==void 0&&T.indexOf(S)>-1:d,default:C,name:"Toggle",state:"pressed"}),M=Ae((z,Q)=>{S&&w?.setGroupValue?.(S,z,Q),f?.(z,Q)}),{getButtonProps:L,buttonRef:j}=el({disabled:k,native:b}),A={disabled:k,pressed:N},P=[j,n],G=[{"aria-pressed":N,onClick(z){const Q=!N,Y=Yt(ii,z.nativeEvent);M(Q,Y),!Y.isCanceled&&R(Q)}},x,L],B=zt("button",t,{enabled:!w,state:A,ref:P,props:G});return w?h.jsx(xZ,{tag:"button",render:p,className:s,state:A,refs:P,props:G}):B}),Dr=_.forwardRef(({className:e,...t},n)=>h.jsx(SZ,{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}));Dr.displayName="Toggle";function _Z(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const ik="data-composite-item-active",wZ=[];function EZ(e){const{itemSizes:t,cols:n=1,loopFocus:s=!0,dense:i=!1,orientation:a="both",direction:l,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:p,enableHomeAndEndKeys:g=!1,stopEventPropagation:y=!1,disabledIndices:b,modifierKeys:x=wZ}=e,[S,w]=_.useState(0),T=n>1,C=_.useRef(null),k=so(C,p),N=_.useRef([]),R=_.useRef(!1),M=f??S,L=Ae((P,G=!1)=>{if((d??w)(P),G){const B=N.current[P];BC(C.current,B,l,a)}}),j=Ae(P=>{if(P.size===0||R.current)return;R.current=!0;const G=Array.from(P.keys()),B=G.find(Q=>Q?.hasAttribute(ik))??null,z=B?G.indexOf(B):-1;z!==-1&&L(z),BC(C.current,B,l,a)}),A=_.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,ref:k,onFocus(P){!C.current||!$C(P.target)||P.target.setSelectionRange(0,P.target.value.length??0)},onKeyDown(P){const G=g?eZ:tk;if(!G.has(P.key)||TZ(P,x)||!C.current)return;const z=l==="rtl",Q=z?ku:Tc,Y={horizontal:Q,vertical:Qi,both:Q}[a],ee=z?Tc:ku,D={horizontal:ee,vertical:Ec,both:ee}[a];if($C(P.target)&&!_Z(P.target)){const W=P.target.selectionStart,X=P.target.selectionEnd,oe=P.target.value??"";if(W==null||P.shiftKey||W!==X||P.key!==D&&W<oe.length||P.key!==Y&&W>0)return}let K=M;const q=UV(N,b),V=$V(N,b);if(T){const W=t||Array.from({length:N.current.length},()=>({width:1,height:1})),X=FV(W,n,i),oe=X.findIndex(de=>de!=null&&!pu(N,de,b)),se=X.reduce((de,xe,he)=>xe!=null&&!pu(N,xe,b)?he:de,-1);K=X[BV({current:X.map(de=>de?N.current[de]:null)},{event:P,orientation:a,loopFocus:s,cols:n,disabledIndices:qV([...b||N.current.map((de,xe)=>pu(N,xe)?xe:void 0),void 0],X),minIndex:oe,maxIndex:se,prevIndex:HV(M>V?q:M,W,X,n,P.key===Qi?"bl":P.key===Tc?"tr":"tl"),rtl:z})]}const U={horizontal:[Q],vertical:[Qi],both:[Q,Qi]}[a],I={horizontal:[ee],vertical:[Ec],both:[ee,Ec]}[a],H=T?G:{horizontal:g?WG:JA,vertical:g?JG:ek,both:G}[a];g&&(P.key===ef?K=q:P.key===tf&&(K=V)),K===M&&(U.includes(P.key)||I.includes(P.key))&&(s&&K===V&&U.includes(P.key)?K=q:s&&K===q&&I.includes(P.key)?K=V:K=fr(N,{startingIndex:K,decrement:I.includes(P.key),disabledIndices:b})),K!==M&&!lh(N,K)&&(y&&P.stopPropagation(),H.has(P.key)&&P.preventDefault(),L(K,!0),queueMicrotask(()=>{N.current[K]?.focus()}))}}),[n,i,l,b,N,g,M,T,t,s,k,x,L,a,y]);return _.useMemo(()=>({props:A,highlightedIndex:M,onHighlightedIndexChange:L,elementsRef:N,disabledIndices:b,onMapChange:j,relayKeyboardEvent:A.onKeyDown}),[A,M,L,N,b,j])}function TZ(e,t){for(const n of oZ.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function ak(e){const{render:t,className:n,refs:s=Nu,props:i=Nu,state:a=an,stateAttributesMapping:l,highlightedIndex:f,onHighlightedIndexChange:d,orientation:p,dense:g,itemSizes:y,loopFocus:b,cols:x,enableHomeAndEndKeys:S,onMapChange:w,stopEventPropagation:T=!0,rootRef:C,disabledIndices:k,modifierKeys:N,highlightItemOnHover:R=!1,tag:M="div",...L}=e,j=UA(),{props:A,highlightedIndex:P,onHighlightedIndexChange:G,elementsRef:B,onMapChange:z,relayKeyboardEvent:Q}=EZ({itemSizes:y,cols:x,loopFocus:b,dense:g,orientation:p,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:T,enableHomeAndEndKeys:S,direction:j,disabledIndices:k,modifierKeys:N}),Y=zt(M,e,{state:a,ref:s,props:[A,...i,L],stateAttributesMapping:l}),ee=_.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:G,highlightItemOnHover:R,relayKeyboardEvent:Q}),[P,G,R,Q]);return h.jsx(Oj.Provider,{value:ee,children:h.jsx(ZA,{elementsRef:B,onMapChange:D=>{w?.(D),z(D)},children:Y})})}let CZ=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const KC={multiple(e){return e?{[CZ.multiple]:""}:null}},RZ=_.forwardRef(function(t,n){const{defaultValue:s,disabled:i=!1,loopFocus:a=!0,onValueChange:l,orientation:f="horizontal",multiple:d=!1,value:p,className:g,render:y,...b}=t,x=WA(),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,k]=yp({controlled:p,default:S,name:"ToggleGroup",state:"value"}),N=Ae((A,P,G)=>{let B;if(d?(B=C.slice(),P?B.push(A):B.splice(C.indexOf(A),1)):B=P?[A]:[],Array.isArray(B)){if(l?.(B,G),G.isCanceled)return;k(B)}}),R={disabled:T,multiple:d,orientation:f},M=_.useMemo(()=>({disabled:T,orientation:f,setGroupValue:N,value:C,isValueInitialized:w}),[T,f,N,C,w]),L={role:"group"},j=zt("div",t,{enabled:!!x,state:R,ref:n,props:[L,b],stateAttributesMapping:KC});return h.jsx(sk.Provider,{value:M,children:x?j:h.jsx(ak,{render:y,className:g,state:R,refs:[n],props:[L,b],stateAttributesMapping:KC,loopFocus:a,enableHomeAndEndKeys:!0})})}),hh=_.forwardRef(({className:e,...t},n)=>h.jsx(RZ,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));hh.displayName="ToggleGroup";const NZ=ge(Kj({variant:"secondary",size:"sm"}),"h-7 whitespace-nowrap uppercase tracking-[0.08em] leading-none no-underline");function ck({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 jZ({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 l=a.id===t,f=()=>n?.(a.id);return s?h.jsx("span",{children:s(a,{active:l,onClick:f})},a.id):h.jsx(ck,{active:l,onClick:f,children:a.label},a.id)})})}const AZ=mi("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}}),kZ={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 OZ({color:e,size:t,glow:n,pulse:s,className:i}){return h.jsx("span",{className:ge(AZ({color:e,size:t,glow:n}),s&&"dot-pulse",i),style:n?{boxShadow:kZ[e??"healthy"]}:void 0})}const MZ="0.0.6-86",IZ={version:MZ},PZ=IZ.version;function DZ({label:e,className:t}){return h.jsxs("div",{className:ge("flex items-center gap-3",t),children:[h.jsx(OZ,{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",PZ]})]})}function zZ({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 LZ=mi("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"}}),In=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("div",{ref:s,role:"alert",className:ge(LZ({variant:t,className:e})),...n}));In.displayName="Alert";const nf=_.forwardRef(({className:e,...t},n)=>h.jsx("h5",{ref:n,className:ge("font-medium text-white mb-1",e),...t}));nf.displayName="AlertTitle";const Pn=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("text-neutral-400",e),...t}));Pn.displayName="AlertDescription";const lk=_.createContext(void 0);function al(e){const t=_.useContext(lk);if(e===!1&&t===void 0)throw new Error(yn(27));return t}const UZ={...il,...va},mx=_.forwardRef(function(t,n){const{render:s,className:i,forceRender:a=!1,...l}=t,{store:f}=al(),d=f.useState("open"),p=f.useState("nested"),g=f.useState("mounted"),y=f.useState("transitionStatus");return zt("div",t,{state:{open:d,transitionStatus:y},ref:[f.context.backdropRef,n],stateAttributesMapping:UZ,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!p})}),uk=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=al(),d=br(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),zt("p",t,{ref:n,props:[{id:d},l]})});let $Z=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),BZ=(function(e){return e[e.open=Xi.open]="open",e[e.closed=Xi.closed]="closed",e[e.startingStyle=Xi.startingStyle]="startingStyle",e[e.endingStyle=Xi.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const fk=_.createContext(void 0);function FZ(){const e=_.useContext(fk);if(e===void 0)throw new Error(yn(26));return e}const HZ={...il,...va,nestedDialogOpen(e){return e?{[BZ.nestedDialogOpen]:""}:null}},dk=_.forwardRef(function(t,n){const{className:s,finalFocus:i,initialFocus:a,render:l,...f}=t,{store:d}=al(),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"),k=d.useState("openMethod"),N=d.useState("titleElementId"),R=d.useState("transitionStatus"),M=d.useState("role");FZ(),ba({open:C,ref:d.context.popupRef,onComplete(){C&&d.context.onOpenChangeComplete?.(!0)}});function L(B){return B==="touch"?d.context.popupRef.current:!0}const j=a===void 0?L:a,A=T>0,G=zt("div",t,{state:{open:C,nested:w,transitionStatus:R,nestedDialogOpen:A},props:[b,{"aria-labelledby":N??void 0,"aria-describedby":p??void 0,role:M,tabIndex:-1,hidden:!S,onKeyDown(B){nk.has(B.key)&&B.stopPropagation()},style:{[$Z.nestedDialogs]:T}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:HZ});return h.jsx(RA,{context:y,openInteractionType:k,disabled:!S,closeOnFocusOut:!g,initialFocus:j,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:G})}),hk=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t,{store:a}=al(),l=a.useState("mounted"),f=a.useState("modal"),d=a.useState("open");return l||s?h.jsx(fk.Provider,{value:s,children:h.jsxs(CA,{ref:n,...i,children:[l&&f===!0&&h.jsx(XA,{ref:a.context.internalBackdropRef,inert:hx(!d)}),t.children]})}):null});function qZ(e){const{store:t,parentContext:n,actionsRef:s}=e,i=t.useState("open"),a=t.useState("disablePointerDismissal"),l=t.useState("modal"),f=t.useState("popupElement"),{openMethod:d,triggerProps:p,reset:g}=AG(i);x7(t);const{forceUnmount:y}=S7(i,t,()=>{g()}),b=Ae(G=>{const B=Yt(G);return B.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},B}),x=_.useCallback(()=>{t.setOpen(!1,b(E8))},[t,b]);_.useImperativeHandle(s,()=>({unmount:y,close:x}),[y,x]);const S=R7({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,T]=_.useState(0),C=w===0,k=D7(S),N=c7(S,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(G){if(!t.context.outsidePressEnabledRef.current||"button"in G&&G.button!==0||"touches"in G&&G.touches.length!==1)return!1;const B=Ur(G);if(C&&!a){const z=B;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===z||t.context.backdropRef.current===z||Ot(z,f)&&!z?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});KA(i&&l===!0,f);const{getReferenceProps:R,getFloatingProps:M,getTriggerProps:L}=I7([k,N]);t.useContextCallback("onNestedDialogOpen",G=>{T(G+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]),A=_.useMemo(()=>L(p),[L,p]),P=_.useMemo(()=>M(),[M]);t.useSyncedValues({openMethod:d,activeTriggerProps:j,inactiveTriggerProps:A,popupProps:P,floatingRootContext:S,nestedOpenDialogCount:w})}const VZ={...E7,modal:Pe(e=>e.modal),nested:Pe(e=>e.nested),nestedOpenDialogCount:Pe(e=>e.nestedOpenDialogCount),disablePointerDismissal:Pe(e=>e.disablePointerDismissal),openMethod:Pe(e=>e.openMethod),descriptionElementId:Pe(e=>e.descriptionElementId),titleElementId:Pe(e=>e.titleElementId),viewportElement:Pe(e=>e.viewportElement),role:Pe(e=>e.role)};class KZ extends DA{constructor(t){super(GZ(t),{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new fx,onOpenChange:void 0,onOpenChangeComplete:void 0},VZ)}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 GZ(e={}){return{...w7(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function ZZ(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:l=!1,modal:f=!0,actionsRef:d,handle:p,triggerId:g,defaultTriggerId:y=null}=e,b=al(!0),x=!!b,S=zn(()=>p?.store??new KZ({open:s,openProp:n,activeTriggerId:y,triggerIdProp:g,modal:f,disablePointerDismissal:l,nested:x})).current;uV(()=>{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:l,nested:x,modal:f}),S.useContextCallback("onOpenChange",i),S.useContextCallback("onOpenChangeComplete",a);const w=S.useState("payload");qZ({store:S,actionsRef:d,parentContext:b?.store.context});const T=_.useMemo(()=>({store:S}),[S]);return h.jsx(lk.Provider,{value:T,children:typeof t=="function"?t({payload:w}):t})}const pk=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=al(),d=br(a);return f.useSyncedValueWithCleanup("titleElementId",d),zt("h2",t,{ref:n,props:[{id:d},l]})}),$r=ZZ,YZ=_.forwardRef(({className:e,...t},n)=>h.jsx(mx,{ref:n,className:ge("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));YZ.displayName="DialogOverlay";const hr=_.forwardRef(({className:e,children:t,...n},s)=>h.jsxs(hk,{children:[h.jsx(mx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(dk,{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})]}));hr.displayName="DialogContent";const pr=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));pr.displayName="DialogHeader";const Nn=_.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}));Nn.displayName="DialogFooter";const mr=_.forwardRef(({className:e,...t},n)=>h.jsx(pk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));mr.displayName="DialogTitle";const XZ=_.forwardRef(({className:e,...t},n)=>h.jsx(uk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));XZ.displayName="DialogDescription";const gx=_.forwardRef(({className:e,page:t,totalPages:n,totalItems:s,onPageChange:i,...a},l)=>h.jsxs("div",{ref:l,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(Oe,{size:"sm",variant:"default",disabled:t<=1,onClick:()=>i(t-1),children:"Prev"}),h.jsx(Oe,{size:"sm",variant:"default",disabled:t>=n,onClick:()=>i(t+1),children:"Next"})]})]}));gx.displayName="Pagination";const QZ=_.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}));QZ.displayName="Separator";const WZ=mi("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"}}),JZ=_.forwardRef(({className:e,side:t,children:n,...s},i)=>h.jsxs(hk,{children:[h.jsx(mx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(dk,{ref:i,className:ge(WZ({side:t,className:e})),...s,children:n})]}));JZ.displayName="SheetContent";const eY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));eY.displayName="SheetHeader";const tY=_.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}));tY.displayName="SheetFooter";const nY=_.forwardRef(({className:e,...t},n)=>h.jsx(pk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));nY.displayName="SheetTitle";const rY=_.forwardRef(({className:e,...t},n)=>h.jsx(uk,{ref:n,className:ge("text-sm text-neutral-400",e),...t}));rY.displayName="SheetDescription";const sY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("rounded-md bg-neutral-800 animate-pulse",e),...t}));sY.displayName="Skeleton";const oY=_.createContext(void 0);function yx(){const e=_.useContext(oY);if(e===void 0)throw new Error(yn(64));return e}let iY=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const mk={tabActivationDirection:e=>({[iY.activationDirection]:e})},gk=_.createContext(void 0);function aY(){const e=_.useContext(gk);if(e===void 0)throw new Error(yn(65));return e}const cY=_.forwardRef(function(t,n){const{className:s,disabled:i=!1,render:a,value:l,id:f,nativeButton:d=!0,...p}=t,{value:g,getTabPanelIdByValue:y,orientation:b}=yx(),{activateOnFocus:x,highlightedTabIndex:S,onTabActivation:w,setHighlightedTabIndex:T,tabsListElement:C}=aY(),k=br(f),N=_.useMemo(()=>({disabled:i,id:k,value:l}),[i,k,l]),{compositeProps:R,compositeRef:M,index:L}=ok({metadata:N}),j=l===g,A=_.useRef(!1);Le(()=>{if(A.current){A.current=!1;return}if(!(j&&L>-1&&S!==L))return;const V=C;if(V!=null){const U=Bo(Rt(V));if(U&&Ot(V,U))return}i||T(L)},[j,L,S,T,i,C]);const{getButtonProps:P,buttonRef:G}=el({disabled:i,native:d,focusableWhenDisabled:!0}),B=y(l),z=_.useRef(!1),Q=_.useRef(!1);function Y(V){j||i||w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"}))}function ee(V){j||(L>-1&&!i&&T(L),!i&&x&&(!z.current||z.current&&Q.current)&&w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"})))}function D(V){if(j||i)return;z.current=!0;function U(){z.current=!1,Q.current=!1}(!V.button||V.button===0)&&(Q.current=!0,Rt(V.currentTarget).addEventListener("pointerup",U,{once:!0}))}return zt("button",t,{state:{disabled:i,active:j,orientation:b},ref:[n,G,M],props:[R,{role:"tab","aria-controls":B,"aria-selected":j,id:k,onClick:Y,onFocus:ee,onPointerDown:D,[ik]:j?"":void 0,onKeyDownCapture(){A.current=!0}},p,P]})});let lY=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const uY={...mk,...va},fY=_.forwardRef(function(t,n){const{className:s,value:i,render:a,keepMounted:l=!1,...f}=t,{value:d,getTabIdByPanelValue:p,orientation:g,tabActivationDirection:y,registerMountedTabPanel:b,unregisterMountedTabPanel:x}=yx(),S=br(),w=_.useMemo(()=>({id:S,value:i}),[S,i]),{ref:T,index:C}=px({metadata:w}),k=i===d,{mounted:N,transitionStatus:R,setMounted:M}=Ap(k),L=!N,j=p(i),A={hidden:L,orientation:g,tabActivationDirection:y,transitionStatus:R},P=_.useRef(null),G=zt("div",t,{state:A,ref:[n,T,P],props:[{"aria-labelledby":j,hidden:L,id:S,role:"tabpanel",tabIndex:k?0:-1,inert:hx(!k),[lY.index]:C},f],stateAttributesMapping:uY});return ba({open:k,ref:P,onComplete(){k||M(!1)}}),Le(()=>{if(!(L&&!l)&&S!=null)return b(i,S),()=>{x(i,S)}},[L,l,i,S,b,x]),l||N?G:null}),dY=_.forwardRef(function(t,n){const{activateOnFocus:s=!1,className:i,loopFocus:a=!0,render:l,...f}=t,{getTabElementBySelectedValue:d,onValueChange:p,orientation:g,value:y,setTabMap:b,tabActivationDirection:x}=yx(),[S,w]=_.useState(0),[T,C]=_.useState(null),k=hY(y,g,T,d),N=Ae((j,A)=>{if(j!==y){const P=k(j);A.activationDirection=P,p(j,A)}}),R={orientation:g,tabActivationDirection:x},M={"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(gk.Provider,{value:L,children:h.jsx(ak,{render:l,className:i,state:R,refs:[n,C],props:[M,f],stateAttributesMapping:mk,highlightedIndex:S,enableHomeAndEndKeys:!0,loopFocus:a,orientation:g,onHighlightedIndexChange:w,onMapChange:b,disabledIndices:Nu})})});function GC(e,t){const{left:n,top:s}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect(),l=n-i,f=s-a;return{left:l,top:f}}function hY(e,t,n,s){const[i,a]=_.useState(null);return Le(()=>{if(e==null||n==null){a(null);return}const l=s(e);if(l==null){a(null);return}const{left:f,top:d}=GC(l,n);a(t==="horizontal"?f:d)},[t,s,n,e]),_.useCallback(l=>{if(l===e)return"none";if(l==null)return a(null),"none";if(l!=null&&n!=null){const f=s(l);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 pY=_.forwardRef(({className:e,...t},n)=>h.jsx(dY,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));pY.displayName="TabsList";const mY=mi("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"}}),gY=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx(cY,{ref:s,className:ge(mY({variant:t,className:e})),...n}));gY.displayName="TabsTrigger";const yY=_.forwardRef(({className:e,...t},n)=>h.jsx(fY,{ref:n,className:ge("outline-none",e),...t}));yY.displayName="TabsContent";const vY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[11px] text-neutral-300",e),...t}));vY.displayName="Text";const bY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));bY.displayName="TextMuted";const xY=_.forwardRef(({className:e,...t},n)=>h.jsx("code",{ref:n,className:ge("font-mono text-[11px] text-white",e),...t}));xY.displayName="TextCode";const SY=_.forwardRef(({className:e,...t},n)=>h.jsx("span",{ref:n,className:ge("font-mono text-[9px] uppercase tracking-wider text-neutral-500",e),...t}));SY.displayName="TextLabel";const _Y=_.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}));_Y.displayName="CodeBlock";function xa(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(l=>typeof a=="function"?a(l):a)},[]);return[n,i]}const wY="console:instance-id";function Lt(){const[e,t]=xa(wY,""),n=e.trim();return _.useMemo(()=>({instanceId:n.length>0?n:void 0,rawInstanceId:e,setInstanceId:t,clearInstanceId:()=>t("")}),[n,e,t])}const Jn={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 Si(e,t){return e===0?!1:e??t}function rf(e,t){return t?{...e,instanceId:t}:e}function Sa(e){return encodeURIComponent(String(e))}function Ln(e,t,n){const s=e.endsWith("/")?e.slice(0,-1):e,i=n?.toString();return`${s}${t}${i?`?${i}`:""}`}function sf(e={}){const t=Vt(),{instanceId:n}=Lt(),s=e.instanceId??n,i=rf(e.partitionId?{partitionId:e.partitionId}:{},s);return Wn({queryKey:Jn.stats({partitionId:e.partitionId,instanceId:s}),queryFn:()=>{if(!t)throw new Error("Not connected");return Xu(t.GET("/console/stats",{params:{query:i}}))},enabled:!!t,refetchInterval:Si(e.refetchIntervalMs,5e3)})}function EY(e={},t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=e.instanceId??i;return Wn({queryKey:Jn.timeseries({...e,instanceId:a}),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");const l=new URLSearchParams;e.interval&&l.set("interval",e.interval),e.range&&l.set("range",e.range),e.partitionId&&l.set("partitionId",e.partitionId),a&&l.set("instanceId",a);const f=await fetch(`${s.serverUrl}/console/stats/timeseries?${l}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!f.ok)throw new Error("Failed to fetch timeseries stats");return f.json()},enabled:(t.enabled??!0)&&!!n&&!!s,refetchInterval:Si(t.refetchIntervalMs,3e4)})}function TY(e={},t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=e.instanceId??i;return Wn({queryKey:Jn.latency({...e,instanceId:a}),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");const l=new URLSearchParams;e.range&&l.set("range",e.range),e.partitionId&&l.set("partitionId",e.partitionId),a&&l.set("instanceId",a);const f=await fetch(`${s.serverUrl}/console/stats/latency?${l}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!f.ok)throw new Error("Failed to fetch latency stats");return f.json()},enabled:(t.enabled??!0)&&!!n&&!!s,refetchInterval:Si(t.refetchIntervalMs,3e4)})}function CY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return Wn({queryKey:Jn.commits({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/commits",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function RY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.commitDetail(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Commit sequence is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/commits/${Sa(e)}${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch commit detail");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function NY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({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},i);return Wn({queryKey:Jn.timeline({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/timeline",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function yk(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return Wn({queryKey:Jn.clients({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/clients",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function jY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.eventDetail(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Event id is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/events/${Sa(e)}${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch event detail");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function AY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.eventPayload(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Event id is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/events/${Sa(e)}/payload${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch event payload");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function kY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.handlers(i),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;i&&a.set("instanceId",i);const l=await fetch(Ln(n.serverUrl,"/console/handlers",a),{headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch handlers");return l.json()},enabled:!!t&&!!n})}function OY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.prunePreview(i),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;i&&a.set("instanceId",i);const l=await fetch(Ln(n.serverUrl,"/console/prune/preview",a),{method:"POST",headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch prune preview");return l.json()},enabled:!!t&&!!n&&(e.enabled??!0)})}function MY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({limit:e.limit,offset:e.offset,operationType:e.operationType,partitionId:e.partitionId},i);return Wn({queryKey:Jn.operations({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/operations",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function IY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async({clientId:i,partitionId:a,instanceId:l})=>{if(!e||!t)throw new Error("Not connected");const f=l??n,d=new URLSearchParams;a&&d.set("partitionId",a),f&&d.set("instanceId",f);const p=await fetch(Ln(t.serverUrl,`/console/clients/${Sa(i)}`,d),{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!p.ok)throw new Error("Failed to evict client");return p.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","clients"]}),s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function PY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Ln(t.serverUrl,"/console/prune",i),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!a.ok)throw new Error("Failed to prune");return a.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","commits"]}),s.invalidateQueries({queryKey:["console","timeline"]}),s.invalidateQueries({queryKey:["console","prune","preview"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function DY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Ln(t.serverUrl,"/console/compact",i),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!a.ok)throw new Error("Failed to compact");return a.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function zY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=i.instanceId??n,l=new URLSearchParams;a&&l.set("instanceId",a);const f=await fetch(Ln(t.serverUrl,"/console/notify-data-change",l),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify({tables:i.tables,partitionId:i.partitionId})});if(!f.ok)throw new Error("Failed to notify data change");return f.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","commits"]}),s.invalidateQueries({queryKey:["console","timeline"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function LY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.apiKeys({...e,instanceId:i}),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;e.limit!==void 0&&a.set("limit",String(e.limit)),e.offset!==void 0&&a.set("offset",String(e.offset)),e.type&&a.set("type",e.type),e.status&&a.set("status",e.status),e.expiresWithinDays!==void 0&&a.set("expiresWithinDays",String(e.expiresWithinDays)),i&&a.set("instanceId",i);const l=await fetch(Ln(n.serverUrl,"/console/api-keys",a),{headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch API keys");return l.json()},enabled:!!t&&!!n})}function UY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,"/console/api-keys",a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok)throw new Error("Failed to create API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function $Y(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(i)}`,a),{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to revoke API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function BY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,"/console/api-keys/bulk-revoke",a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok)throw new Error("Failed to bulk revoke API keys");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function FY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(i)}/rotate`,a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to rotate API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function HY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(i)}/rotate/stage`,a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to stage-rotate API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function qY(e={}){const{config:t}=Dt();return Wn({queryKey:Jn.storage({prefix:e.prefix,cursor:e.cursor,limit:e.limit}),queryFn:async()=>{if(!t)throw new Error("Not connected");const n=new URLSearchParams;e.prefix&&n.set("prefix",e.prefix),e.cursor&&n.set("cursor",e.cursor),e.limit&&n.set("limit",String(e.limit));const s=await fetch(Ln(t.serverUrl,"/console/storage",n),{method:"GET",headers:{Authorization:`Bearer ${t.token}`}});if(!s.ok)throw new Error("Failed to list blobs");return s.json()},enabled:!!t,refetchInterval:Si(e.refetchIntervalMs,3e4)})}function VY(){const{config:e}=Dt(),t=_r();return is({mutationFn:async n=>{if(!e)throw new Error("Not connected");const s=encodeURIComponent(n),i=await fetch(Ln(e.serverUrl,`/console/storage/${s}`,new URLSearchParams),{method:"DELETE",headers:{Authorization:`Bearer ${e.token}`}});if(!i.ok)throw new Error("Failed to delete blob");return i.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["console","storage"]})}})}function KY(){const{config:e}=Dt();return async t=>{if(!e)throw new Error("Not connected");const n=encodeURIComponent(t),s=await fetch(Ln(e.serverUrl,`/console/storage/${n}/download`,new URLSearchParams),{method:"GET",headers:{Authorization:`Bearer ${e.token}`}});if(!s.ok)throw new Error("Failed to download blob");const i=await s.blob(),a=URL.createObjectURL(i),l=document.createElement("a");l.href=a,l.download=t.split("/").pop()||t,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)}}const GY="console:partition-id";function of(){const[e,t]=xa(GY,""),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 af(){const[e,t]=xa("console:preferences",ZC);return{preferences:e,setPreferences:t,updatePreference:(i,a)=>{t(l=>({...l,[i]:a}))},resetPreferences:()=>{t(ZC)}}}const ZY=[{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"}],YY=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],vx="syncular-console-root";function XY(e){e.classList.add(vx)}const QY=[{suffix:"",label:"Command"},{suffix:"/stream",label:"Stream"},{suffix:"/fleet",label:"Fleet"},{suffix:"/ops",label:"Ops"},{suffix:"/storage",label:"Storage"},{suffix:"/config",label:"Config"}];function WY(e){const t=e?.trim()??"";return!t||t==="/"?"":(t.startsWith("/")?t:`/${t}`).replace(/\/+$/g,"")}function By(e,t){return e?t?`${e}${t}`:e:t||"/"}function JY({basePath:e,appHref:t,modeBadge:n}){const{connect:s,config:i,isConnected:a,isConnecting:l}=Dt(),{preferences:f}=af(),{instanceId:d,rawInstanceId:p,setInstanceId:g,clearInstanceId:y}=Lt(),{partitionId:b,rawPartitionId:x,setPartitionId:S,clearPartitionId:w}=of(),T=vr({select:P=>P.location.pathname}),{data:C}=sf({refetchIntervalMs:f.refreshInterval*1e3,partitionId:b,instanceId:d}),k=WY(e),N=_.useMemo(()=>QY.map(P=>({...P,id:By(k,P.suffix)})),[k]),R=By(k,""),M=By(k,"/config"),L=l?"connecting":a?"connected":i?"disconnected":"not-configured",j=N.find(P=>P.suffix===""?T===R||T===`${R}/`:T.startsWith(P.id))?.id??R,A=C?[{label:"HEAD",value:`#${C.maxCommitSeq}`},{label:"COMMITS",value:`${C.commitCount}`},{label:"CHANGES",value:`${C.changeCount}`},{label:"CLIENTS",value:`${C.activeClientCount}/${C.clientCount}`}]:[];return h.jsxs("div",{className:`${vx} h-screen bg-background text-foreground flex flex-col`,children:[h.jsx(zZ,{brand:h.jsx(xc,{to:R,children:h.jsx(DZ,{label:"console"})}),center:h.jsx(jZ,{items:N,activeId:j,renderItem:(P,{active:G})=>h.jsx(xc,{to:P.id,children:h.jsx(ck,{active:G,children:P.label})},P.id)}),right:h.jsxs("div",{className:"flex items-center gap-2",children:[n?h.jsx(mn,{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(Gn,{variant:"mono",value:p,onChange:P=>g(P.target.value),onBlur:P=>g(P.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),d?h.jsx(Oe,{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(Gn,{variant:"mono",value:x,onChange:P=>S(P.target.value),onBlur:P=>S(P.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),b?h.jsx(Oe,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:w,children:"All"}):null]}),h.jsx(O8,{state:L}),h.jsx(xc,{to:M,children:h.jsx(Oe,{variant:T===M?"secondary":"ghost",size:"icon",children:h.jsx(Y8,{className:"h-3 w-3"})})}),t?h.jsxs("a",{href:t,className:NZ,children:[h.jsx(G8,{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===M?h.jsx("div",{style:{animation:"pageIn 0.3s ease-out"},children:h.jsx(WN,{})},T):h.jsx(eX,{configPath:M,hasSavedConfig:!!i,isConnecting:l,onConnect:()=>{s()}})})}),a&&h.jsx(qj,{isLive:a,metrics:A,uptime:"--"})]})}function eX({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(Oe,{variant:"default",onClick:s,disabled:n,children:n?"Connecting...":"Connect"}),h.jsx(xc,{to:e,children:h.jsx(Oe,{variant:"link",children:"Configure connection"})})]})]})}const lo=kH({component:JY});function tX(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("swServer")==="1"}function nX(e={}){const{maxEvents:t=100,enabled:n=!0,staleAfterMs:s=65e3,replayLimit:i=100,partitionId:a,instanceId:l}=e,{config:f,isConnected:d}=Dt(),{instanceId:p}=Lt(),g=l??p,[y,b]=_.useState([]),[x,S]=_.useState(!1),[w,T]=_.useState("disconnected"),[C,k]=_.useState(null),N=_.useRef(null),R=_.useRef(null),M=_.useRef(null),L=_.useRef(0),j=_.useRef(0),A=_.useRef(null),P=_.useRef(null),G=_.useCallback(()=>{b([]),A.current=null,P.current=null},[]);return _.useEffect(()=>{if(!n||!d||!f?.serverUrl||!f?.token)return;let B=!1;const z=Number.isFinite(i)?Math.max(1,Math.min(500,Math.floor(i))):100;if(tX()||typeof WebSocket>"u"){T("connecting"),S(!1);let V=null,U=!1;const I=async()=>{if(!(B||U)){U=!0;try{const H=new URL(f.serverUrl,window.location.origin),W=H.pathname.endsWith("/")?H.pathname.slice(0,-1):H.pathname;H.pathname=`${W}/console/events`,H.search="",H.searchParams.set("limit",String(z)),H.searchParams.set("offset","0"),a&&H.searchParams.set("partitionId",a);const X=await fetch(H.toString(),{headers:{Authorization:`Bearer ${f.token}`}});if(!X.ok)throw new Error(`Live event polling failed (${X.status})`);const oe=await X.json(),de=(Array.isArray(oe.items)?oe.items:[]).filter(Me=>g?Me.instanceId===g:!0).sort((Me,_e)=>Me.eventId-_e.eventId),xe=P.current??-1,he=de.filter(Me=>Me.eventId>xe);if(he.length>0){const Me=he.map(ne=>({type:ne.eventType,timestamp:ne.createdAt,data:ne})).reverse();b(ne=>[...Me,...ne].slice(0,t));const _e=he[he.length-1];P.current=_e.eventId,A.current=_e.createdAt}else if(de.length>0){const Me=de[de.length-1];P.current=Math.max(P.current??-1,Me.eventId),A.current=Me.createdAt}k(null),S(!0),T("connected")}catch(H){B||(S(!1),T("disconnected"),k(H instanceof Error?H:new Error("Live event polling failed")))}finally{U=!1}}};return I(),V=setInterval(()=>{I()},2e3),()=>{B=!0,V&&clearInterval(V),S(!1),T("disconnected")}}const Y=()=>{R.current&&(clearTimeout(R.current),R.current=null)},ee=()=>{M.current&&(clearInterval(M.current),M.current=null)},D=()=>{if(B||R.current)return;L.current+=1;const V=Math.min(3e4,1e3*2**Math.max(0,L.current-1)),U=Math.floor(V*.2*Math.random()),I=V+U;R.current=setTimeout(()=>{R.current=null,B||q()},I)},K=()=>{j.current=Date.now(),S(!0),T("connected")},q=()=>{if(B)return;T("connecting"),Y();const V=(()=>{const I=new URL(f.serverUrl,window.location.origin);I.protocol=I.protocol==="https:"?"wss:":"ws:";const H=I.pathname.endsWith("/")?I.pathname.slice(0,-1):I.pathname;return I.pathname=`${H}/console/events/live`,I.search="",A.current&&I.searchParams.set("since",A.current),I.searchParams.set("replayLimit",String(z)),a&&I.searchParams.set("partitionId",a),g&&I.searchParams.set("instanceId",g),I.toString()})(),U=new WebSocket(V);N.current=U,U.onopen=()=>{if(B){U.close();return}L.current=0,k(null),T("connecting"),S(!1);try{U.send(JSON.stringify({type:"auth",token:f.token}))}catch{U.close();return}ee(),M.current=setInterval(()=>{const I=N.current;if(!I||I.readyState!==WebSocket.OPEN)return;const H=j.current;!H||Date.now()-H<=s||(S(!1),T("stale"),I.close())},1e3)},U.onclose=()=>{B||(S(!1),T("disconnected"),ee(),D())},U.onerror=()=>{B||k(new Error("WebSocket connection failed"))},U.onmessage=I=>{try{const H=JSON.parse(I.data),W=H.type;if(K(),W==="connected"||W==="heartbeat"||W==="auth_required")return;if(W==="error"){const de=typeof H.message=="string"?H.message:"Live events authentication failed";k(new Error(de));return}const X={type:W,timestamp:H.timestamp||new Date().toISOString(),data:H};if(a&&X.data.partitionId!==a||g&&X.data.instanceId!==g)return;const oe=Date.parse(A.current??""),se=Date.parse(X.timestamp);Number.isFinite(se)&&(!Number.isFinite(oe)||se>oe)&&(A.current=X.timestamp),b(de=>[X,...de].slice(0,t))}catch{}}};return q(),()=>{B=!0,Y(),ee(),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:G}}function rX(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=i.toString(),l=await fetch(`${t.serverUrl}/console/events${a?`?${a}`:""}`,{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to clear events");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","events"]})}})}const sX=_.createContext(null);function vk(){const[e,t]=xa("console:time-range","24h");return{range:e,setRange:t}}const oX=[{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 iX(e){const t=e.toLowerCase();for(const n of oX)if(t.includes(n.hint))return n.type;return"client"}function aX(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 cX(e,t){return typeof e.lagCommitCount=="number"?Math.max(0,e.lagCommitCount):t?Math.max(0,t.maxCommitSeq-e.cursor):0}function lX(e,t){return e.activityState==="stale"?"offline":t>0?"syncing":"online"}function uX(e,t){return e.length<=16?e:`${e.slice(0,12)}-${t+1}`}function fX(e,t,n={}){const s=n.maxNodes??10;return e.slice(0,s).map((i,a)=>{const l=cX(i,t),f=lX(i,l);return{id:uX(i.clientId,a),type:iX(i.clientId),status:f,cursor:Math.max(0,i.cursor),actor:i.actorId,mode:i.connectionMode,dialect:aX(i.clientId),scopes:Object.keys(i.effectiveScopes||{}),lastSeen:i.updatedAt}})}const dX={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 hX(e){const t=e.length>1&&e.endsWith("/")?e.slice(0,-1):e;return t==="/console"||t.startsWith("/console/")?"/console/stream":"/stream"}function pX(){const e=mp(),t=_.useMemo(()=>typeof window>"u"?"/stream":hX(window.location.pathname),[]),n=vk(),{range:s}=n,{preferences:i}=af(),{partitionId:a}=of(),l=i.refreshInterval*1e3,[f]=xa("console:alert-config",dX),[d,p]=_.useState("1h"),{data:g}=sf({refetchIntervalMs:l,partitionId:a}),{data:y}=EY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:b}=TY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:x}=CY({limit:5,partitionId:a},{refetchIntervalMs:l}),{data:S}=yk({limit:12,offset:0,partitionId:a},{refetchIntervalMs:l}),{events:w,isConnected:T}=nX({maxEvents:8,partitionId:a}),C=_.useMemo(()=>{const z=y?.buckets??[];let Q=0,Y=0;for(const D of z)Q+=D.pushCount+D.pullCount,Y+=D.errorCount;const ee=Q>0?Y/Q*100:0;return{totalEvents:Q,errorRate:ee}},[y?.buckets]),k=_.useMemo(()=>S?.items?fX(S.items,g,{maxNodes:12}):[],[S?.items,g]),N=k.filter(z=>z.status!=="offline").length,R=k.filter(z=>z.status==="offline").length,M=_.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 Q=Math.max(...z.map(Y=>Math.max(Y.pushCount,Y.pullCount)),1);return z.map(Y=>({pushPercent:Q>0?Y.pushCount/Q*100:0,pullPercent:Q>0?Y.pullCount/Q*100:0}))},[y?.buckets]),A=_.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]),P=_.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]),G=_.useMemo(()=>Math.max(0,100-C.errorRate),[C.errorRate]),B=_.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(sX.Provider,{value:n,children:h.jsxs("div",{className:"flex flex-col",children:[B.length>0&&h.jsx("div",{className:"px-6 pb-4",children:h.jsxs(In,{variant:"destructive",children:[h.jsx(nf,{children:"Threshold Exceeded"}),h.jsx(Pn,{children:B.map((z,Q)=>h.jsx("span",{className:"block",children:z},Q))})]})}),h.jsx(FA,{clients:k,totalNodes:k.length+2,onlineCount:N,offlineCount:R,relayClientIds:[]}),h.jsx(Wj,{items:M}),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(Ej,{bars:j,activeRange:d,onRangeChange:p})}),h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(Jj,{buckets:A,successRate:G})}),h.jsx("div",{className:"border-r border-border",children:h.jsx(Vj,{commits:P,onViewAll:()=>e({href:t})})})]}),h.jsx(eA,{entries:L,isConnected:T,maxVisible:20,maxHeight:"calc(100vh - 200px)"})]})]})}):h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})})}function mX(){return h.jsx(pX,{})}function gX({children:e}){return h.jsxs("div",{className:"space-y-4 px-5 py-5",children:[h.jsx(yX,{}),h.jsx(_X,{}),h.jsx(wX,{}),e]})}function yX(){const{clearError:e,config:t,connect:n,disconnect:s,error:i,isConnected:a,isConnecting:l}=Dt(),[f,d]=_.useState(t?.serverUrl??"/api"),[p,g]=_.useState(t?.token??""),[y,b]=_.useState(null),[x,S]=_.useState(!1),[w,T]=_.useState(null),[C,k]=xa("console:disconnect-clear-saved-config",!1);_.useEffect(()=>{const j=new URLSearchParams(window.location.search),A=j.get("server");let P=!1;if(A&&(d(A),j.delete("server"),P=!0),j.has("token")&&(j.delete("token"),P=!0),P){const G=j.toString(),B=G?`${window.location.pathname}?${G}`:window.location.pathname;window.history.replaceState({},"",B)}},[]),_.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)},M=async()=>{S(!0),b(null),T(null);const j=performance.now();try{const A=f.trim(),P=p.trim();if(!A||!P)throw new Error("Missing server URL or token");if(!(await fetch(`${A}/console/stats`,{headers:{Authorization:`Bearer ${P}`}})).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(Gj,{isConnected:a,isConnecting:l,isTestingConnection:x,serverUrl:f,onServerUrlChange:d,consoleToken:p,onConsoleTokenChange:g,onSaveAndConnect:N,onDisconnect:R,onTestConnection:M,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(Ep,{checked:C,onCheckedChange:k})]})})})}const vX=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 Fy(e){if(!e)return"Never";const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():"Invalid date"}function bX(e){return e.length===0?"all scopes":e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`}function xX(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*vX?"expiring":"active"}function SX(e){return e==="revoked"?"destructive":e==="expired"?"offline":e==="expiring"?"syncing":"healthy"}function _X(){const[e,t]=_.useState("all"),[n,s]=_.useState("all"),[i,a]=_.useState("14"),[l,f]=_.useState(!1),[d,p]=_.useState(!1),[g,y]=_.useState(""),[b,x]=_.useState("relay"),[S,w]=_.useState(""),[T,C]=_.useState(""),[k,N]=_.useState(""),[R,M]=_.useState(null),[L,j]=_.useState([]),[A,P]=_.useState(null),[G,B]=_.useState(null),[z,Q]=_.useState(null),[Y,ee]=_.useState(null),[D,K]=_.useState(null),[q,V]=_.useState(null),[U,I]=_.useState(null),H=_.useMemo(()=>XC(i),[i]),W=H??14,X=_.useMemo(()=>XC(k),[k]),oe=k.trim().length>0,se=!oe||X!==null,de=_.useMemo(()=>({type:e==="all"?void 0:e,status:n==="all"?void 0:n,expiresWithinDays:n==="expiring"?W:void 0}),[e,n,W]),{data:xe,isLoading:he,error:Me}=LY(de),_e=UY(),ne=BY(),pe=$Y(),ae=FY(),we=HY();_.useEffect(()=>{const me=new Set((xe?.items??[]).map(Te=>Te.keyId));j(Te=>Te.filter(qe=>me.has(qe)))},[xe?.items]);const ve=async()=>{try{const me=T.split(",").map(qe=>qe.trim()).filter(qe=>qe.length>0),Te=await _e.mutateAsync({name:g,keyType:b,actorId:S||void 0,scopeKeys:me.length>0?me:void 0,expiresInDays:oe?X??void 0:void 0});M(Te.secretKey),y(""),w(""),C(""),N("")}catch{}},Se=me=>{navigator.clipboard.writeText(me),B(me),setTimeout(()=>B(null),2e3)},ye=async()=>{if(z)try{await pe.mutateAsync(z)}finally{Q(null)}},Ue=async()=>{if(L.length!==0)try{const me=await ne.mutateAsync({keyIds:L});P(me),j([])}catch{}},Ie=async()=>{if(Y)try{const me=await we.mutateAsync(Y.keyId);K({oldKeyId:Y.keyId,oldKeyName:Y.name,secretKey:me.secretKey})}catch{}},Ee=async()=>{if(D)try{await pe.mutateAsync(D.oldKeyId)}finally{K(null),ee(null)}},Ve=async()=>{if(q)try{const me=await ae.mutateAsync(q);I(me.secretKey)}finally{V(null)}};if(he)return h.jsx("div",{className:"flex h-[200px] items-center justify-center",children:h.jsx(Pt,{size:"lg"})});if(Me)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: ",Me.message]})});const Xe=(xe?.items??[]).filter(me=>me.revokedAt===null).map(me=>me.keyId),Be=Xe.length>0&&Xe.every(me=>L.includes(me)),We=L.length>0,He=(xe?.items??[]).filter(me=>L.includes(me.keyId)).map(me=>me.name);return h.jsxs(h.Fragment,{children:[h.jsxs(ex,{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(Oe,{size:"sm",variant:"destructive",onClick:()=>p(!0),disabled:L.length===0,children:["Revoke Selected (",L.length,")"]}),h.jsx(Oe,{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(ms,{children:[h.jsx(ts,{children:"Type filter"}),h.jsxs(hh,{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(Dr,{value:"all",children:"all"}),h.jsx(Dr,{value:"relay",children:"relay"}),h.jsx(Dr,{value:"proxy",children:"proxy"}),h.jsx(Dr,{value:"admin",children:"admin"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Status filter"}),h.jsxs(hh,{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(Dr,{value:"all",children:"all"}),h.jsx(Dr,{value:"active",children:"active"}),h.jsx(Dr,{value:"revoked",children:"revoked"}),h.jsx(Dr,{value:"expiring",children:"expiring"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-expiring-window",children:"Expiring window (days)"}),h.jsx(mc,{children:"Used when status filter is set to expiring."}),h.jsx(Gn,{id:"api-key-expiring-window",placeholder:"14",value:i,inputMode:"numeric",onChange:me=>a(me.target.value)}),H===null&&i.trim().length>0?h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."}):null]})]}),xe?.items.length===0?h.jsx(Wb,{message:"No API keys match the current filters."}):h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{className:"w-[28px]",children:h.jsx(Fv,{checked:Be,indeterminate:!Be&&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(sl,{children:(xe?.items??[]).map(me=>{const Te=xX(me,W);return h.jsxs(os,{className:"group relative",children:[h.jsx(pt,{className:"w-[28px]",children:h.jsx(Fv,{checked:L.includes(me.keyId),onCheckedChange:qe=>{j(mt=>qe?[...new Set([...mt,me.keyId])]:mt.filter(lt=>lt!==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(mn,{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:bX(me.scopeKeys)})}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Fy(me.createdAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Fy(me.lastUsedAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Fy(me.expiresAt)}),h.jsx(pt,{className:"flex-1",children:h.jsx(mn,{variant:SX(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:()=>ee(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:()=>V(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:()=>Q(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($r,{open:l,onOpenChange:f,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Create API Key"})}),R?h.jsx(QC,{copiedKeyId:G,onClose:()=>{M(null),f(!1)},onCopy:Se,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(ms,{children:[h.jsx(ts,{htmlFor:"api-key-name",children:"Name"}),h.jsx(Gn,{id:"api-key-name",placeholder:"Backend Relay Key",value:g,onChange:me=>y(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Key type"}),h.jsxs(hh,{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(Dr,{value:"relay",children:"relay"}),h.jsx(Dr,{value:"proxy",children:"proxy"}),h.jsx(Dr,{value:"admin",children:"admin"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-actor-id",children:"Actor ID (optional)"}),h.jsx(mc,{children:"Pin this key to a fixed actor ID"}),h.jsx(Gn,{id:"api-key-actor-id",placeholder:"actor-123",value:S,onChange:me=>w(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-scope-keys",children:"Scope keys (optional)"}),h.jsx(mc,{children:"Comma-separated list of allowed scope keys"}),h.jsx(Gn,{id:"api-key-scope-keys",placeholder:"scope-a, scope-b",value:T,onChange:me=>C(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-expires-days",children:"Expires in days (optional)"}),h.jsx(mc,{children:"Leave empty to keep the key non-expiring."}),h.jsx(Gn,{id:"api-key-expires-days",placeholder:"30",value:k,inputMode:"numeric",onChange:me=>N(me.target.value)}),se?null:h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>f(!1),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:ve,disabled:_e.isPending||!g||!se,children:_e.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Creating..."]}):"Create"})]})]})]})}),h.jsx($r,{open:d,onOpenChange:me=>{p(me),me||P(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Bulk Revoke API Keys"})}),A?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(In,{variant:"destructive",children:h.jsxs(Pn,{children:["Requested ",A.requestedCount," keys. Revoked"," ",A.revokedCount,", already revoked"," ",A.alreadyRevokedCount,", not found"," ",A.notFoundCount,"."]})}),h.jsx(Nn,{children:h.jsx(Oe,{variant:"primary",onClick:()=>{p(!1),P(null)},children:"Done"})})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:"This revokes selected keys immediately and cannot be undone."})}),h.jsxs("p",{className:"font-mono text-[10px] text-neutral-500",children:["Selected keys: ",He.slice(0,5).join(", "),He.length>5?` +${He.length-5} more`:""]})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>p(!1),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:Ue,disabled:ne.isPending||L.length===0,children:ne.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke Selected"})]})]})]})}),h.jsx($r,{open:Y!==null||D!==null,onOpenChange:()=>{ee(null),K(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Stage Rotate API Key"})}),D?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsx(In,{variant:"default",children:h.jsxs(Pn,{children:["Replacement key created for ",D.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:D.secretKey}),h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>Se(D.secretKey),children:G===D.secretKey?"Copied":"Copy"})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>{K(null),ee(null)},children:"Keep Old Key Active"}),h.jsx(Oe,{variant:"destructive",onClick:Ee,disabled:pe.isPending,children:pe.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{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(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>ee(null),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:Ie,disabled:we.isPending||!Y,children:we.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Staging..."]}):"Create Replacement Key"})]})]})]})}),h.jsx($r,{open:z!==null,onOpenChange:()=>Q(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Revoke API Key"})}),h.jsx("div",{className:"px-5 py-4",children:h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:"Revoking a key immediately invalidates it for all requests."})})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>Q(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:ye,disabled:pe.isPending,children:pe.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke"})]})]})}),h.jsx($r,{open:q!==null||U!==null,onOpenChange:()=>{V(null),I(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Rotate API Key"})}),U?h.jsx(QC,{copiedKeyId:G,onClose:()=>I(null),onCopy:Se,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(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>V(null),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:Ve,disabled:ae.isPending,children:ae.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Rotating..."]}):"Rotate"})]})]})]})})]})}function wX(){const{preferences:e,updatePreference:t,resetPreferences:n}=af(),s=[{type:"filter",label:"Auto-refresh interval",options:ZY.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:YY.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(tA,{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(In,{variant:"destructive",children:h.jsx(Pn,{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(Oe,{variant:"default",size:"sm",onClick:()=>n(s),children:e===s?"Copied":"Copy"})]}),h.jsx(Nn,{children:h.jsx(Oe,{variant:"primary",onClick:t,children:"Done"})})]})}function EX(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 TX(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 CX(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),l=Math.floor(a/60),f=Math.floor(l/60),d=Math.floor(f/24);return a<60?"just now":l<60?`${l}m ago`:f<24?`${f}h ago`:`${d}d ago`}catch{return e}}function RX(e,t,n){return{id:e.clientId,type:EX(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:TX(e.clientId),scopes:Object.keys(e.effectiveScopes??{}),lastSeen:CX(e.updatedAt,n)}}function NX({emptyState:e}={}){const[t,n]=_.useState(1),[s,i]=_.useState(null),{preferences:a}=af(),{partitionId:l}=of(),f=a.pageSize,d=a.refreshInterval*1e3,{data:p,isLoading:g}=sf({refetchIntervalMs:d,partitionId:l}),{data:y,isLoading:b,error:x}=yk({limit:f,offset:(t-1)*f,partitionId:l},{refetchIntervalMs:d}),S=IY(),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:l})}finally{i(null)}};if(b||g)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{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 k=(y?.items??[]).map(N=>RX(N,T,a.timeFormat));return h.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5",children:[k.length>0&&h.jsx(rA,{clients:k,headSeq:T}),k.length===0?e??h.jsx(sV,{children:h.jsx(Wb,{message:"No clients yet"})}):h.jsx(Xj,{clients:k,headSeq:T,onEvict:N=>{const R=y?.items.find(M=>M.clientId===N);i(R?.clientId??N)}}),w>1&&h.jsx(gx,{page:t,totalPages:w,totalItems:y?.total??0,onPageChange:n}),h.jsx($r,{open:s!==null,onOpenChange:()=>i(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{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(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>i(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:C,disabled:S.isPending,children:S.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Evicting..."]}):"Evict"})]})]})})]})}const jX={latencyThresholdMs:1e3,errorRateThreshold:5,clientLagThreshold:50,enabled:!1};function AX(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 kX(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);return Array.from(new Set(t))}function OX(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 MX(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function IX(e){const t=WC(e.requestPayload),n=WC(e.resultPayload);if(e.operationType==="notify_data_change"){const a=MX(t?.tables),l=n?.commitSeq;return`${a.length} table${a.length===1?"":"s"} -> commit #${typeof l=="number"?l:"?"}`}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 PX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function DX(){const{partitionId:e}=of();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(zX,{}),h.jsx(FX,{})]}),h.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[h.jsx(LX,{partitionId:e}),h.jsx(UX,{partitionId:e}),h.jsx($X,{partitionId:e})]}),h.jsx(BX,{partitionId:e})]})}function zX(){const{data:e,isLoading:t,error:n}=kY();if(t)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{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?AX(i.snapshotChunkTtlMs):"default"}));return h.jsx(Qj,{handlers:s,tableCount:e?.items.length??0})}function LX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=sf({partitionId:e}),{data:f,isLoading:d,refetch:p}=OY({enabled:!1}),g=PY(),y=async()=>{n(!0),i(null),await p()},b=async()=>{const S=await g.mutateAsync();i(S.deletedCommits)};if(l)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{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(Tp,{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($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Prune Old Commits"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(In,{variant:"default",children:[h.jsx(nf,{children:"Pruning Complete"}),h.jsxs(Pn,{children:["Successfully deleted ",h.jsx("strong",{children:s})," commits."]})]}):d?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Pt,{size:"sm"})}):f?h.jsxs(h.Fragment,{children:[h.jsx(In,{variant:f.commitsToDelete>0?"destructive":"default",children:h.jsx(Pn,{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(mn,{variant:f.commitsToDelete>0?"offline":"ghost",children:f.commitsToDelete})]})]})]}):null}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Oe,{variant:"destructive",onClick:b,disabled:g.isPending||d||(f?.commitsToDelete??0)===0,children:g.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Pruning..."]}):"Prune Now"})]})]})})]})}function UX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=sf({partitionId:e}),f=DY(),d=()=>{n(!0),i(null)},p=async()=>{const y=await f.mutateAsync();i(y.deletedChanges)};if(l)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{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(Tp,{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($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Compact Changes"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(In,{variant:"default",children:[h.jsx(nf,{children:"Compaction Complete"}),h.jsxs(Pn,{children:["Successfully removed ",h.jsx("strong",{children:s})," redundant changes."]})]}):h.jsx(In,{variant:"default",children:h.jsx(Pn,{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(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Oe,{variant:"primary",onClick:p,disabled:f.isPending,children:f.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Compacting..."]}):"Compact Now"})]})]})})]})}function $X({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState("tasks"),[a,l]=_.useState(e??""),[f,d]=_.useState(null),[p,g]=_.useState(null),y=zY(),b=kX(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(Tp,{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($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Notify External Data Change"})}),h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[f?h.jsxs(In,{variant:"default",children:[h.jsx(nf,{children:"Notification Sent"}),h.jsxs(Pn,{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(In,{variant:"default",children:h.jsx(Pn,{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(In,{variant:"destructive",children:h.jsx(Pn,{children:p})}):null,h.jsxs(ms,{children:[h.jsx(ts,{children:"Tables (comma-separated)"}),h.jsx(Gn,{value:s,onChange:T=>i(T.target.value),placeholder:"tasks, notes",disabled:y.isPending}),h.jsx(mc,{children:"Enter one or more table names affected by the external change."})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Partition ID (optional)"}),h.jsx(Gn,{value:a,onChange:T=>l(T.target.value),placeholder:"default",disabled:y.isPending})]})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:f?"Close":"Cancel"}),f?null:h.jsx(Oe,{variant:"primary",onClick:w,disabled:y.isPending,children:y.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Notifying..."]}):"Notify Data Change"})]})]})})]})}function BX({partitionId:e}){const[t,n]=_.useState("all"),{data:s,isLoading:i,error:a}=MY({limit:20,offset:0,operationType:t==="all"?void 0:t,partitionId:e},{refetchIntervalMs:5e3});return h.jsx(ex,{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(Oe,{variant:t==="all"?"default":"ghost",size:"sm",onClick:()=>n("all"),children:"All"}),h.jsx(Oe,{variant:t==="prune"?"default":"ghost",size:"sm",onClick:()=>n("prune"),children:"Prune"}),h.jsx(Oe,{variant:t==="compact"?"default":"ghost",size:"sm",onClick:()=>n("compact"),children:"Compact"}),h.jsx(Oe,{variant:t==="notify_data_change"?"default":"ghost",size:"sm",onClick:()=>n("notify_data_change"),children:"Notify"}),h.jsx(Oe,{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(Pt,{size:"lg"})}):a?h.jsx(In,{variant:"destructive",children:h.jsxs(Pn,{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(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{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(sl,{children:(s?.items??[]).map((l,f)=>h.jsxs(os,{children:[h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:PX(l.createdAt)}),h.jsx(pt,{children:h.jsx(mn,{variant:"ghost",children:OX(l.operationType)})}),h.jsx(pt,{className:"font-mono text-xs",children:l.consoleUserId??"system"}),h.jsx(pt,{className:"font-mono text-xs",children:l.targetClientId??l.partitionId??(l.operationType==="notify_data_change"?"partition default":"global")}),h.jsx(pt,{className:"font-mono text-xs text-neutral-300",children:IX(l)})]},`${l.operationId}:${l.createdAt}:${f}`))})]})})})}function FX(){const[e,t]=xa("console:alert-config",jX),n={p90Latency:e.latencyThresholdMs,errorRate:e.errorRateThreshold,clientLag:e.clientLagThreshold},s=a=>{t(l=>({...l,latencyThresholdMs:a.p90Latency,errorRateThreshold:a.errorRate,clientLagThreshold:a.clientLag}))},i=a=>{t(l=>({...l,enabled:a}))};return h.jsx(Hj,{enabled:e.enabled,onEnabledChange:i,thresholds:n,onThresholdsChange:s})}function HX(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 qX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function VX(){const[e,t]=_.useState(""),[n,s]=_.useState(void 0),[i,a]=_.useState(void 0),[l,f]=_.useState([]),[d,p]=_.useState(null),{data:g,isLoading:y,error:b}=qY({prefix:n,cursor:i,limit:100}),x=VY(),S=KY();function w(){const M=e.trim();s(M.length>0?M:void 0),a(void 0),f([])}function T(){t(""),s(void 0),a(void 0),f([])}function C(){g?.cursor&&(f(M=>[...M,i??""]),a(g.cursor))}function k(){f(M=>{const L=[...M],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(Pt,{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(ex,{title:"Storage",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Gn,{placeholder:"Prefix filter...",value:e,onChange:M=>t(M.target.value),onKeyDown:M=>{M.key==="Enter"&&w()},className:"h-7 w-48 text-xs"}),h.jsx(Oe,{variant:"default",size:"sm",onClick:w,children:"Filter"}),n&&h.jsx(Oe,{variant:"ghost",size:"sm",onClick:T,children:"Clear"})]}),children:R.length===0?h.jsx(Wb,{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(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{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(sl,{children:R.map(M=>h.jsxs(os,{children:[h.jsx(pt,{className:"font-mono text-xs max-w-[320px]",title:M.key,children:M.key}),h.jsx(pt,{className:"font-mono text-xs text-neutral-400 whitespace-nowrap",children:HX(M.size)}),h.jsx(pt,{children:M.httpMetadata?.contentType?h.jsx(mn,{variant:"ghost",children:M.httpMetadata.contentType}):h.jsx("span",{className:"text-neutral-500 text-xs",children:"--"})}),h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:qX(M.uploaded)}),h.jsx(pt,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>{S(M.key)},children:"Download"}),h.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>p(M.key),children:"Delete"})]})})]},M.key))})]})}),h.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[h.jsx(Oe,{variant:"ghost",size:"sm",disabled:l.length===0,onClick:k,children:"Previous"}),h.jsx(Oe,{variant:"ghost",size:"sm",disabled:!g?.truncated,onClick:C,children:"Next"})]})]})}),h.jsx($r,{open:d!==null,onOpenChange:()=>p(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{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(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>p(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:N,disabled:x.isPending,children:x.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"})," Deleting..."]}):"Delete"})]})]})})]})}const KX={};function au(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 GX(e){const t=e.split(/\s+/).map(i=>i.trim()).filter(i=>i.length>0),n={},s=[];for(const i of t){const[a="",...l]=i.split(":"),f=l.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 ZX(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 Zd(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function YX(e,t){return e?`#${e.federatedCommitId??(t?`${t}:${e.commitSeq}`:String(e.commitSeq))}`:"#?"}function XX(e,t){return e?`E${e.federatedEventId??(t?`${t}:${e.eventId}`:e.eventId)}`:"E?"}function QX(e,t,n){return!e||!t?null:e.replaceAll("{traceId}",encodeURIComponent(t)).replaceAll("{spanId}",encodeURIComponent(n??""))}function bx({initialSelectedEntryId:e}={}){const{preferences:t}=af(),{partitionId:n}=of(),{range:s,setRange:i}=vk(),a=t.pageSize,l=t.refreshInterval*1e3,f=KX?.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),[k,N]=_.useState(!1),[R,M]=_.useState(e??null),L=_.useRef(!1),j=_.useMemo(()=>GX(S),[S]),A=_.useMemo(()=>new Date(Date.now()-ZX(s)).toISOString(),[s]),{data:P,isLoading:G,refetch:B}=NY({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:A},{refetchIntervalMs:l}),z=rX(),Q=R?.startsWith("#")?R.slice(1):void 0,Y=R?.startsWith("E")?R.slice(1):void 0,ee=Q&&Q!=="?"?Q:void 0,D=Y&&Y!=="?"?Y:void 0,{data:K,isLoading:q,error:V}=RY(ee,{enabled:ee!==void 0,partitionId:n}),{data:U,isLoading:I,error:H}=jY(D,{enabled:D!==void 0,partitionId:n}),{data:W,isLoading:X,error:oe}=AY(D,{enabled:D!==void 0&&!!U?.payloadRef,partitionId:n}),se=_.useMemo(()=>QX(f,U?.traceId??null,U?.spanId??null),[U?.spanId,U?.traceId,f]);_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{e&&M(e)},[e]),_.useEffect(()=>{if(!L.current){L.current=!0;return}M(null)},[]),_.useEffect(()=>{C(1),M(null)},[]);const xe=_.useMemo(()=>(P?.items??[]).map(we=>{const ve=we.instanceId??we.commit?.instanceId??we.event?.instanceId,Se=ve?`[${ve}] `:"";if(we.type==="commit"&&we.commit){const Ue=we.commit;return{type:"commit",id:YX(Ue,ve),outcome:"--",duration:"--",actor:Ue.actorId,client:Ue.clientId,detail:`${Se}${Ue.changeCount} chg | ${(Ue.affectedTables??[]).join(", ")}`,time:au(we.timestamp,t.timeFormat)}}const ye=we.event;return ye?{type:ye.eventType,id:XX(ye,ve),outcome:ye.outcome,duration:`${ye.durationMs}ms`,actor:ye.actorId,client:ye.clientId,detail:`${Se}${(ye.tables??[]).join(", ")||"--"}`,time:au(we.timestamp,t.timeFormat)}:{type:"pull",id:"E?",outcome:"unknown",duration:"--",actor:"",client:"",detail:"--",time:au(we.timestamp,t.timeFormat)}}),[t.timeFormat,P?.items]),he=P?.total??0,Me=Math.max(1,Math.ceil(he/a)),_e=G,ne=[{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 pe(){z.mutate(void 0,{onSuccess:()=>{N(!1),B()}})}return h.jsxs("div",{className:"flex flex-col h-full",children:[_e&&xe.length===0?h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})}):h.jsx(nA,{entries:xe,selectedEntryId:R,onEntryClick:ae=>M(ae.id),filterBar:h.jsx(Zj,{groups:ne,searchValue:S,searchPlaceholder:"Use actor:, client:, table:, request:, trace: or free text...",onSearchChange:w,actions:h.jsxs(h.Fragment,{children:[h.jsx(Oe,{size:"sm",variant:"ghost",onClick:()=>{B()},children:"Refresh"}),h.jsx(Oe,{size:"sm",variant:"ghost",children:"Export"}),h.jsx(Oe,{size:"sm",variant:"destructive",onClick:()=>N(!0),children:"Clear"})]})}),pagination:h.jsx(gx,{page:T,totalPages:Me,totalItems:he,onPageChange:C})}),h.jsx($r,{open:R!==null,onOpenChange:ae=>{ae||M(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:ee!==void 0?`Commit #${ee}`:D!==void 0?`Event E${D}`:"Entry details"})}),h.jsx("div",{className:"px-5 py-4 space-y-3 max-h-[70vh] overflow-y-auto",children:q||I?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Pt,{size:"sm"})}):V||H?h.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load details."}):K?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:K.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:K.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:K.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:au(K.createdAt,t.timeFormat)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Changes"}),h.jsx("div",{className:"text-neutral-100",children:K.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:K.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"}),K.changes.length===0?h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No changes recorded."}):K.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:Zd(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??"--"}),se&&h.jsx("a",{href:se,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(Oe,{variant:"ghost",size:"sm",onClick:()=>M(`#${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:au(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:Zd(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"}),X?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Pt,{size:"sm"}),h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:"Loading payload snapshot..."})]}):oe?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:Zd(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:Zd(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(Nn,{children:h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>M(null),children:"Close"})})]})}),h.jsx($r,{open:k,onOpenChange:ae=>{ae||N(!1)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{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(Nn,{children:[h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>N(!1),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",size:"sm",onClick:pe,disabled:z.isPending,children:z.isPending?"Clearing...":"Clear all"})]})]})})]})}const WX=ao({getParentRoute:()=>lo,path:"/config",component:gX}),JX=ao({getParentRoute:()=>lo,path:"/fleet",component:NX}),eQ=ao({getParentRoute:()=>lo,path:"/",component:mX});function tQ(){const{seq:e}=bk.useParams();return h.jsx(bx,{initialSelectedEntryId:`#${e}`})}const bk=ao({getParentRoute:()=>lo,path:"/investigate/commit/$seq",component:tQ});function nQ(){const{id:e}=xk.useParams();return h.jsx(bx,{initialSelectedEntryId:`E${e}`})}const xk=ao({getParentRoute:()=>lo,path:"/investigate/event/$id",component:nQ}),rQ=ao({getParentRoute:()=>lo,path:"/ops",component:DX}),sQ=ao({getParentRoute:()=>lo,path:"/storage",component:VX}),oQ=ao({getParentRoute:()=>lo,path:"/stream",component:bx}),iQ=lo.addChildren([eQ,oQ,bk,xk,JX,rQ,sQ,WX]),aQ="syncular-console-basepath",cQ="syncular-console-server-url",lQ="syncular-console-token";function uQ(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Hv(e){const t=globalThis.document;if(!t)return;const n=t.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return uQ(n)}function Sk(e){return!e||e==="/"?"/":(e.startsWith("/")?e:`/${e}`).replace(/\/+$/g,"")||"/"}function fQ(){return Sk(Hv(aQ))}function dQ(){const e=Hv(cQ),t=Hv(lQ);return!e||!t?null:{serverUrl:e,token:t}}function hQ(){return new I6({defaultOptions:{queries:{staleTime:5e3,retry:1}}})}function pQ(e){return Sk(e??fQ())}function mQ(e){const[t]=_.useState(()=>hQ()),n=_.useMemo(()=>UH({routeTree:iQ,basepath:pQ(e.basePath)}),[e.basePath]),s=e.defaultConfig===void 0?dQ():e.defaultConfig,i=e.autoConnect??e.defaultConfig===void 0;return h.jsx(P6,{client:t,children:h.jsx(nq,{defaultConfig:s,autoConnect:i,storageMode:e.storageMode,children:h.jsx(FH,{router:n})})})}function gQ(e){return h.jsx("div",{className:vx,children:h.jsx(mQ,{...e})})}function yQ(e){const t=document.querySelector(e);if(!t)throw new Error(`Unable to mount console: ${e} not found`);return t}function vQ(e,t={}){const n=yQ(e);XY(n);const s=u6.createRoot(n),i=h.jsx(gQ,{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 bQ={};const xQ="syncular-sentry-dsn",SQ="syncular-sentry-environment",_Q="syncular-sentry-release";function gu(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Hy(e){if(typeof document>"u")return;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return gu(t)}function qy(e){if(!(typeof process>"u"))return gu(bQ[e])}function Vy(e){for(const t of e)if(t)return t}function wQ(){const e=Vy([gu(globalThis.__SYNCULAR_SENTRY_DSN__),Hy(xQ),qy("SYNCULAR_SENTRY_DSN")]);if(!e)return null;const t=Vy([gu(globalThis.__SYNCULAR_SENTRY_ENVIRONMENT__),Hy(SQ),qy("SYNCULAR_SENTRY_ENVIRONMENT")]),n=Vy([gu(globalThis.__SYNCULAR_SENTRY_RELEASE__),Hy(_Q),qy("SYNCULAR_SENTRY_RELEASE")]);return{dsn:e,environment:t,release:n,enableLogs:!0,tracesSampleRate:.2,tracePropagationTargets:[/^https?:\/\/.*\/api\/.*/]}}const JC=wQ();JC&&t6(JC);vQ("#root");