@syncular/console 0.0.6-46 → 0.0.6-48

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 AM(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 Re=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ct=globalThis,Ji="10.39.0";function ha(){return Wh(ct),ct}function Wh(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ji,t[Ji]=t[Ji]||{}}function Bc(e,t,n=ct){const s=n.__SENTRY__=n.__SENTRY__||{},i=s[Ji]=s[Ji]||{};return i[e]||(i[e]=t())}const kM=["debug","info","warn","error","log","assert","trace"],OM="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 MM(){Fv().enabled=!0}function IM(){Fv().enabled=!1}function QC(){return Fv().enabled}function PM(...e){Bv("log",...e)}function DM(...e){Bv("warn",...e)}function zM(...e){Bv("error",...e)}function Bv(e,...t){Re&&QC()&&pa(()=>{ct.console[e](`${OM}[${e}]:`,...t)})}function Fv(){return Re?Bc("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const be={enable:MM,disable:IM,isEnabled:QC,log:PM,warn:DM,error:zM},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 UM(a.slice(i))}}function LM(e){return Array.isArray(e)?JC(...e):e}function UM(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 Lg="<anonymous>";function Xs(e){try{return!e||typeof e!="function"?Lg:e.name||Lg}catch{return Lg}}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){Re&&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){Re&&be.error(`Error while triggering instrumentation handler.
1
+ function kM(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 Re=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ct=globalThis,Ji="10.39.0";function ha(){return Wh(ct),ct}function Wh(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ji,t[Ji]=t[Ji]||{}}function Bc(e,t,n=ct){const s=n.__SENTRY__=n.__SENTRY__||{},i=s[Ji]=s[Ji]||{};return i[e]||(i[e]=t())}const OM=["debug","info","warn","error","log","assert","trace"],MM="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 IM(){Fv().enabled=!0}function PM(){Fv().enabled=!1}function QC(){return Fv().enabled}function DM(...e){Bv("log",...e)}function zM(...e){Bv("warn",...e)}function LM(...e){Bv("error",...e)}function Bv(e,...t){Re&&QC()&&pa(()=>{ct.console[e](`${MM}[${e}]:`,...t)})}function Fv(){return Re?Bc("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const be={enable:IM,disable:PM,isEnabled:QC,log:DM,warn:zM,error:LM},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 $M(a.slice(i))}}function UM(e){return Array.isArray(e)?JC(...e):e}function $M(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 Lg="<anonymous>";function Xs(e){try{return!e||typeof e!="function"?Lg:e.name||Lg}catch{return Lg}}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){Re&&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){Re&&be.error(`Error while triggering instrumentation handler.
3
3
  Type: ${e}
4
4
  Name: ${Xs(s)}
5
- Error:`,i)}}let Ug=null;function tR(e){const t="error";ci(t,e),li(t,$M)}function $M(){Ug=ct.onerror,ct.onerror=function(e,t,n,s,i){return Hr("error",{column:s,error:i,line:n,msg:e,url:t}),Ug?Ug.apply(this,arguments):!1},ct.onerror.__SENTRY_INSTRUMENTED__=!0}let $g=null;function nR(e){const t="unhandledrejection";ci(t,e),li(t,BM)}function BM(){$g=ct.onunhandledrejection,ct.onunhandledrejection=function(e){return Hr("unhandledrejection",e),$g?$g.apply(this,arguments):!0},ct.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const rR=Object.prototype.toString;function Jh(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 Fc(e,t){return rR.call(e)===`[object ${t}]`}function sR(e){return Fc(e,"ErrorEvent")}function dw(e){return Fc(e,"DOMError")}function FM(e){return Fc(e,"DOMException")}function Gs(e){return Fc(e,"String")}function ep(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Tc(e){return e===null||ep(e)||typeof e!="object"&&typeof e!="function"}function pu(e){return Fc(e,"Object")}function tp(e){return typeof Event<"u"&&Qs(e,Event)}function HM(e){return typeof Element<"u"&&Qs(e,Element)}function qM(e){return Fc(e,"RegExp")}function Hc(e){return!!(e?.then&&typeof e.then=="function")}function VM(e){return pu(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 Hv(e){return typeof Request<"u"&&Qs(e,Request)}const qv=ct,KM=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||KM;for(;n&&a++<s&&(p=GM(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 GM(e,t){const n=e,s=[];if(!n?.tagName)return"";if(qv.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}s.push(n.tagName.toLowerCase());const i=t?.length?t.filter(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 Nu(){try{return qv.document.location.href}catch{return""}}function iR(e){if(!qv.HTMLElement)return null;let t=e;const n=5;for(let s=0;s<n;s++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function 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{Re&&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{Re&&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 Vv(e){return e.__sentry_original__}function cR(e){if(Jh(e))return{message:e.message,name:e.name,stack:e.stack,...pw(e)};if(tp(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 HM(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 ZM(e){const t=Object.keys(cR(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let ac;function ju(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 Ko(){return ju(()=>Math.random())}function Au(){return ju(()=>Date.now())}function qy(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)?qM(t)?t.test(e):Gs(t)?n?e===t:e.includes(t):!1:!1}function Go(e,t=[],n=!1){return t.some(s=>Yd(e,s,n))}function YM(){const e=ct;return e.crypto||e.msCrypto}let Bg;function XM(){return Ko()*16}function qr(e=YM()){try{if(e?.randomUUID)return ju(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Bg||(Bg="10000000100040008000"+1e11),Bg.replace(/[018]/g,t=>(t^(XM()&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 Vy(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 Cc(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(QM(e))return!0;try{Yn(e,"__sentry_captured__",!0)}catch{}return!1}function QM(e){try{return e.__sentry_captured__}catch{}}const uR=1e3;function ma(){return Au()/uR}function WM(){const{performance:e}=ct;if(!e?.now||!e.timeOrigin)return ma;const t=e.timeOrigin;return()=>(t+ju(()=>e.now()))/uR}let yw;function cn(){return(yw??(yw=WM()))()}let Fg=null;function JM(){const{performance:e}=ct;if(!e?.now)return;const t=3e5,n=ju(()=>e.now()),s=Au(),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 Fg===null&&(Fg=JM()),Fg}function eI(e){const t=cn(),n={sid:qr(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>nI(n)};return e&&Rc(n,e),n}function Rc(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 tI(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Rc(e,n)}function nI(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 ku(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]=ku(s[i],t[i],n-1));return s}function Ws(){return qr()}function Zs(){return qr().substring(16)}const Ky="_sentrySpan";function Nc(e,t){t?Yn(e,Ky,t):delete e[Ky]}function jc(e){return e[Ky]}const rI=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:Ko()}}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,Nc(t,jc(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&&Rc(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():pu(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,Nc(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ws(),sampleRand:Ko()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const s=typeof n=="number"?n:rI;if(s<=0)return this;const i={timestamp:ma(),...t,message:t.message?qy(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:jc(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=ku(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 Re&&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 Re&&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):(Re&&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 sI(){return Bc("defaultCurrentScope",()=>new Js)}function oI(){return Bc("defaultIsolationScope",()=>new Js)}class iI{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 Hc(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 Ac(){const e=ha(),t=Wh(e);return t.stack=t.stack||new iI(sI(),oI())}function aI(e){return Ac().withScope(e)}function cI(e,t){const n=Ac();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function vw(e){return Ac().withScope(()=>e(Ac().getIsolationScope()))}function lI(){return{withIsolationScope:vw,withScope:aI,withSetScope:cI,withSetIsolationScope:(e,t)=>vw(t),getCurrentScope:()=>Ac().getScope(),getIsolationScope:()=>Ac().getIsolationScope()}}function qc(e){const t=Wh(e);return t.acs?t.acs:lI()}function bt(){const e=ha();return qc(e).getCurrentScope()}function ss(){const e=ha();return qc(e).getIsolationScope()}function uI(){return Bc("globalScope",()=>new Js)}function Ou(...e){const t=ha(),n=qc(t);if(e.length===2){const[s,i]=e;return s?n.withSetScope(s,i):n.withScope(i)}return n.withScope(e[0])}function gt(){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 ys="sentry.source",Kv="sentry.sample_rate",dR="sentry.previous_trace_sample_rate",eo="sentry.op",mn="sentry.origin",mu="sentry.idle_span_finish_reason",Mu="sentry.measurement_unit",Iu="sentry.measurement_value",bw="sentry.custom_span_name",Gv="sentry.profile_id",Vc="sentry.exclusive_time",fI="sentry.link.type",dI="gen_ai.conversation.id",hI=0,Zv=1,hn=2;function pI(e){if(e<400&&e>=100)return{code:Zv};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=pI(t);n.message!=="unknown_error"&&e.setStatus(n)}const pR="_sentryScope",mR="_sentryIsolationScope";function mI(e){try{const t=ct.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function gI(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function yI(e,t,n){e&&(Yn(e,mR,mI(n)),Yn(e,pR,t))}function ph(e){const t=e;return{scope:t[pR],isolationScope:gI(t[mR])}}const Yv="sentry-",vI=/^sentry-/,bI=8192;function gR(e){const t=SI(e);if(!t)return;const n=Object.entries(t).reduce((s,[i,a])=>{if(i.match(vI)){const l=i.slice(Yv.length);s[l]=a}return s},{});if(Object.keys(n).length>0)return n}function xI(e){if(!e)return;const t=Object.entries(e).reduce((n,[s,i])=>(i&&(n[`${Yv}${s}`]=i),n),{});return _I(t)}function SI(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 _I(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>bI?(Re&&be.warn(`Not adding key: ${n} with val: ${s} to baggage header due to exceeding baggage size limits.`),t):l},"")}const wI=/^o(\d+)\./,EI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function TI(e){return e==="http"||e==="https"}function Kc(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 CI(e){const t=EI.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 RI(e){if(!Re)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+$/)?TI(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 NI(e){return e.match(wI)?.[1]}function jI(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let s;return t.orgId?s=String(t.orgId):n&&(s=NI(n)),s}function AI(e){const t=typeof e=="string"?CI(e):yR(e);if(!(!t||!RI(t)))return t}function gu(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const vR=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function kI(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 OI(e,t){const n=kI(e),s=gR(t);if(!n?.traceId)return{traceId:Ws(),sampleRand:Ko()};const i=MI(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 MI(e,t){const n=gu(t?.sample_rand);if(n!==void 0)return n;const s=gu(t?.sample_rate);return s&&e?.parentSampled!==void 0?e.parentSampled?Ko()*s:s+Ko()*(1-s):Ko()}const SR=0,Xv=1;let Sw=!1;function II(e){const{spanId:t,traceId:n}=e.spanContext(),{data:s,op:i,parent_span_id:a,status:l,origin:f,links:d}=mt(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:mt(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 PI(e){const{traceId:t,spanId:n}=e.spanContext(),s=ui(e);return bR(t,n,s)}function DI(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===Xv,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 mt(e){if(LI(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(zI(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[mn],links:wR(d)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function zI(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function LI(e){return typeof e.getSpanJSON=="function"}function ui(e){const{traceFlags:t}=e.spanContext();return t===Xv}function ER(e){if(!(!e||e.code===hI))return e.code===Zv?"ok":e.message||"internal_error"}const ta="_sentryChildSpans",Gy="_sentryRootSpan";function TR(e,t){const n=e[Gy]||e;Yn(t,Gy,n),e[ta]?e[ta].add(t):Yn(e,ta,new Set([t]))}function UI(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[Gy]||e}function Xn(){const e=ha(),t=qc(e);return t.getActiveSpan?t.getActiveSpan():jc(bt())}function Zy(){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 $I(){if(ww)return;function e(){const t=Xn(),n=t&&Dn(t);if(n){const s="internal_error";Re&&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 rs(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||gt()?.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(FI(n)){if(Yd(e.description,n))return Re&&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 Re&&Ew(e),!0}return!1}function BI(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 FI(e){return typeof e=="string"||e instanceof RegExp}const Qv="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||Qv,release:n.release,public_key:s,trace_id:e,org_id:jI(t)};return t.emit("createDsc",i),i}function Wv(e,t){const n=t.getPropagationContext();return n.dsc||RR(n.traceId,e)}function to(e){const t=gt();if(!t)return{};const n=Dn(e),s=mt(n),i=s.data,a=n.spanContext().traceState,l=a?.get("sentry.sample_rate")??i[Kv]??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[ys],x=s.description;return b!=="url"&&x&&(y.transaction=x),rs()&&(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 qs(e,t=100,n=1/0){try{return Yy("",e,t,n)}catch(s){return{ERROR:`**non-serializable** (${s})`}}}function NR(e,t=3,n=100*1024){const s=qs(e,t);return KI(s)>n?NR(e,t-1,n):s}function Yy(e,t,n=1/0,s=1/0,i=GI()){const[a,l]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const f=HI(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 Yy("",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]=Yy(x,S,d-1,s,i),y++}return l(t),g}function HI(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(VM(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=qI(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function qI(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function VI(e){return~-encodeURI(e).split(/%..|./).length}function KI(e){return VI(JSON.stringify(e))}function GI(){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 ZI(e,t){const[n,s]=e;return[n,[...s,t]]}function Xy(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 YI(e,t){return Xy(e,(n,s)=>t.includes(s))}function Qy(e){const t=Wh(ct);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function XI(e){const[t,n]=e;let s=JSON.stringify(t);function i(a){typeof s=="string"?s=typeof a=="string"?s+a:[Qy(s),a]:s.push(typeof a=="string"?Qy(a):a)}for(const a of n){const[l,f]=a;if(i(`
5
+ Error:`,i)}}let Ug=null;function tR(e){const t="error";ci(t,e),li(t,BM)}function BM(){Ug=ct.onerror,ct.onerror=function(e,t,n,s,i){return Hr("error",{column:s,error:i,line:n,msg:e,url:t}),Ug?Ug.apply(this,arguments):!1},ct.onerror.__SENTRY_INSTRUMENTED__=!0}let $g=null;function nR(e){const t="unhandledrejection";ci(t,e),li(t,FM)}function FM(){$g=ct.onunhandledrejection,ct.onunhandledrejection=function(e){return Hr("unhandledrejection",e),$g?$g.apply(this,arguments):!0},ct.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const rR=Object.prototype.toString;function Jh(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 Fc(e,t){return rR.call(e)===`[object ${t}]`}function sR(e){return Fc(e,"ErrorEvent")}function dw(e){return Fc(e,"DOMError")}function HM(e){return Fc(e,"DOMException")}function Ks(e){return Fc(e,"String")}function ep(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Tc(e){return e===null||ep(e)||typeof e!="object"&&typeof e!="function"}function pu(e){return Fc(e,"Object")}function tp(e){return typeof Event<"u"&&Qs(e,Event)}function qM(e){return typeof Element<"u"&&Qs(e,Element)}function VM(e){return Fc(e,"RegExp")}function Hc(e){return!!(e?.then&&typeof e.then=="function")}function GM(e){return pu(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 Hv(e){return typeof Request<"u"&&Qs(e,Request)}const qv=ct,KM=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||KM;for(;n&&a++<s&&(p=ZM(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 ZM(e,t){const n=e,s=[];if(!n?.tagName)return"";if(qv.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}s.push(n.tagName.toLowerCase());const i=t?.length?t.filter(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&&Ks(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 Nu(){try{return qv.document.location.href}catch{return""}}function iR(e){if(!qv.HTMLElement)return null;let t=e;const n=5;for(let s=0;s<n;s++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function 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{Re&&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{Re&&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 Vv(e){return e.__sentry_original__}function cR(e){if(Jh(e))return{message:e.message,name:e.name,stack:e.stack,...pw(e)};if(tp(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 qM(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 YM(e){const t=Object.keys(cR(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let ac;function ju(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 Go(){return ju(()=>Math.random())}function Au(){return ju(()=>Date.now())}function qy(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 Ks(e)?VM(t)?t.test(e):Ks(t)?n?e===t:e.includes(t):!1:!1}function Ko(e,t=[],n=!1){return t.some(s=>Yd(e,s,n))}function XM(){const e=ct;return e.crypto||e.msCrypto}let Bg;function QM(){return Go()*16}function qr(e=XM()){try{if(e?.randomUUID)return ju(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Bg||(Bg="10000000100040008000"+1e11),Bg.replace(/[018]/g,t=>(t^(QM()&15)>>t/4).toString(16))}function lR(e){return e.exception?.values?.[0]}function Ki(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 Vy(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 Cc(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(WM(e))return!0;try{Yn(e,"__sentry_captured__",!0)}catch{}return!1}function WM(e){try{return e.__sentry_captured__}catch{}}const uR=1e3;function ma(){return Au()/uR}function JM(){const{performance:e}=ct;if(!e?.now||!e.timeOrigin)return ma;const t=e.timeOrigin;return()=>(t+ju(()=>e.now()))/uR}let yw;function cn(){return(yw??(yw=JM()))()}let Fg=null;function eI(){const{performance:e}=ct;if(!e?.now)return;const t=3e5,n=ju(()=>e.now()),s=Au(),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 Fg===null&&(Fg=eI()),Fg}function tI(e){const t=cn(),n={sid:qr(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>rI(n)};return e&&Rc(n,e),n}function Rc(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 nI(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Rc(e,n)}function rI(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 ku(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]=ku(s[i],t[i],n-1));return s}function Ws(){return qr()}function Zs(){return qr().substring(16)}const Gy="_sentrySpan";function Nc(e,t){t?Yn(e,Gy,t):delete e[Gy]}function jc(e){return e[Gy]}const sI=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:Go()}}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,Nc(t,jc(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&&Rc(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():pu(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,Nc(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ws(),sampleRand:Go()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const s=typeof n=="number"?n:sI;if(s<=0)return this;const i={timestamp:ma(),...t,message:t.message?qy(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:jc(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=ku(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 Re&&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 Re&&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):(Re&&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 oI(){return Bc("defaultCurrentScope",()=>new Js)}function iI(){return Bc("defaultIsolationScope",()=>new Js)}class aI{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 Hc(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 Ac(){const e=ha(),t=Wh(e);return t.stack=t.stack||new aI(oI(),iI())}function cI(e){return Ac().withScope(e)}function lI(e,t){const n=Ac();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function vw(e){return Ac().withScope(()=>e(Ac().getIsolationScope()))}function uI(){return{withIsolationScope:vw,withScope:cI,withSetScope:lI,withSetIsolationScope:(e,t)=>vw(t),getCurrentScope:()=>Ac().getScope(),getIsolationScope:()=>Ac().getIsolationScope()}}function qc(e){const t=Wh(e);return t.acs?t.acs:uI()}function bt(){const e=ha();return qc(e).getCurrentScope()}function ss(){const e=ha();return qc(e).getIsolationScope()}function fI(){return Bc("globalScope",()=>new Js)}function Ou(...e){const t=ha(),n=qc(t);if(e.length===2){const[s,i]=e;return s?n.withSetScope(s,i):n.withScope(i)}return n.withScope(e[0])}function gt(){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 ys="sentry.source",Gv="sentry.sample_rate",dR="sentry.previous_trace_sample_rate",eo="sentry.op",gn="sentry.origin",mu="sentry.idle_span_finish_reason",Mu="sentry.measurement_unit",Iu="sentry.measurement_value",bw="sentry.custom_span_name",Kv="sentry.profile_id",Vc="sentry.exclusive_time",dI="sentry.link.type",hI="gen_ai.conversation.id",pI=0,Zv=1,hn=2;function mI(e){if(e<400&&e>=100)return{code:Zv};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=mI(t);n.message!=="unknown_error"&&e.setStatus(n)}const pR="_sentryScope",mR="_sentryIsolationScope";function gI(e){try{const t=ct.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function yI(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function vI(e,t,n){e&&(Yn(e,mR,gI(n)),Yn(e,pR,t))}function ph(e){const t=e;return{scope:t[pR],isolationScope:yI(t[mR])}}const Yv="sentry-",bI=/^sentry-/,xI=8192;function gR(e){const t=_I(e);if(!t)return;const n=Object.entries(t).reduce((s,[i,a])=>{if(i.match(bI)){const l=i.slice(Yv.length);s[l]=a}return s},{});if(Object.keys(n).length>0)return n}function SI(e){if(!e)return;const t=Object.entries(e).reduce((n,[s,i])=>(i&&(n[`${Yv}${s}`]=i),n),{});return wI(t)}function _I(e){if(!(!e||!Ks(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 wI(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>xI?(Re&&be.warn(`Not adding key: ${n} with val: ${s} to baggage header due to exceeding baggage size limits.`),t):l},"")}const EI=/^o(\d+)\./,TI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function CI(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 RI(e){const t=TI.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 NI(e){if(!Re)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+$/)?CI(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 jI(e){return e.match(EI)?.[1]}function AI(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let s;return t.orgId?s=String(t.orgId):n&&(s=jI(n)),s}function kI(e){const t=typeof e=="string"?RI(e):yR(e);if(!(!t||!NI(t)))return t}function gu(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const vR=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function OI(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 MI(e,t){const n=OI(e),s=gR(t);if(!n?.traceId)return{traceId:Ws(),sampleRand:Go()};const i=II(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 II(e,t){const n=gu(t?.sample_rand);if(n!==void 0)return n;const s=gu(t?.sample_rate);return s&&e?.parentSampled!==void 0?e.parentSampled?Go()*s:s+Go()*(1-s):Go()}const SR=0,Xv=1;let Sw=!1;function PI(e){const{spanId:t,traceId:n}=e.spanContext(),{data:s,op:i,parent_span_id:a,status:l,origin:f,links:d}=mt(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:mt(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 DI(e){const{traceId:t,spanId:n}=e.spanContext(),s=ui(e);return bR(t,n,s)}function zI(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===Xv,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 mt(e){if(UI(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(LI(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 LI(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function UI(e){return typeof e.getSpanJSON=="function"}function ui(e){const{traceFlags:t}=e.spanContext();return t===Xv}function ER(e){if(!(!e||e.code===pI))return e.code===Zv?"ok":e.message||"internal_error"}const ta="_sentryChildSpans",Ky="_sentryRootSpan";function TR(e,t){const n=e[Ky]||e;Yn(t,Ky,n),e[ta]?e[ta].add(t):Yn(e,ta,new Set([t]))}function $I(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[Ky]||e}function Xn(){const e=ha(),t=qc(e);return t.getActiveSpan?t.getActiveSpan():jc(bt())}function Zy(){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 BI(){if(ww)return;function e(){const t=Xn(),n=t&&Dn(t);if(n){const s="internal_error";Re&&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 rs(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||gt()?.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(HI(n)){if(Yd(e.description,n))return Re&&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 Re&&Ew(e),!0}return!1}function FI(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 HI(e){return typeof e=="string"||e instanceof RegExp}const Qv="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||Qv,release:n.release,public_key:s,trace_id:e,org_id:AI(t)};return t.emit("createDsc",i),i}function Wv(e,t){const n=t.getPropagationContext();return n.dsc||RR(n.traceId,e)}function to(e){const t=gt();if(!t)return{};const n=Dn(e),s=mt(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[ys],x=s.description;return b!=="url"&&x&&(y.transaction=x),rs()&&(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 qs(e,t=100,n=1/0){try{return Yy("",e,t,n)}catch(s){return{ERROR:`**non-serializable** (${s})`}}}function NR(e,t=3,n=100*1024){const s=qs(e,t);return KI(s)>n?NR(e,t-1,n):s}function Yy(e,t,n=1/0,s=1/0,i=ZI()){const[a,l]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const f=qI(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 Yy("",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]=Yy(x,S,d-1,s,i),y++}return l(t),g}function qI(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(GM(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=VI(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function VI(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function GI(e){return~-encodeURI(e).split(/%..|./).length}function KI(e){return GI(JSON.stringify(e))}function ZI(){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 YI(e,t){const[n,s]=e;return[n,[...s,t]]}function Xy(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 XI(e,t){return Xy(e,(n,s)=>t.includes(s))}function Qy(e){const t=Wh(ct);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function QI(e){const[t,n]=e;let s=JSON.stringify(t);function i(a){typeof s=="string"?s=typeof a=="string"?s+a:[Qy(s),a]:s.push(typeof a=="string"?Qy(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(qs(f))}i(d)}}return typeof s=="string"?s:QI(s)}function QI(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 WI(e){return[{type:"span"},e]}function JI(e){const t=typeof e.data=="string"?Qy(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const eP={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 eP[e]}function jR(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function tP(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:Kc(s)},...i&&{trace:i}}}function nP(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 rP(e,t,n,s){const i=jR(n),a={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!s&&t&&{dsn:Kc(t)}},l="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return ga(a,[l])}function sP(e,t,n,s){const i=jR(n),a=e.type&&e.type!=="replay_event"?e.type:"event";nP(e,n?.sdk);const l=tP(e,i,s,t);return delete e.sdkProcessingMetadata,ga(l,[[{type:a},e]])}function oP(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:Kc(i)}},{beforeSendSpan:f,ignoreSpans:d}=t?.getOptions()||{},p=d?.length?e.filter(x=>!mh(mt(x),d)):e,g=e.length-p.length;g&&t?.recordDroppedEvent("before_send","span",g);const y=f?x=>{const S=mt(x),w=f(S);return w||(Zy(),S)}:mt,b=[];for(const x of p){const S=y(x);S&&b.push(WI(S))}return ga(l,b)}function iP(e){if(!Re)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:s}=mt(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}=mt(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(qs(f))}i(d)}}return typeof s=="string"?s:WI(s)}function WI(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 JI(e){return[{type:"span"},e]}function eP(e){const t=typeof e.data=="string"?Qy(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const tP={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 tP[e]}function jR(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function nP(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 rP(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 sP(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 oP(e,t,n,s){const i=jR(n),a=e.type&&e.type!=="replay_event"?e.type:"event";rP(e,n?.sdk);const l=nP(e,i,s,t);return delete e.sdkProcessingMetadata,ga(l,[[{type:a},e]])}function iP(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(mt(x),d)):e,g=e.length-p.length;g&&t?.recordDroppedEvent("before_send","span",g);const y=f?x=>{const S=mt(x),w=f(S);return w||(Zy(),S)}:mt,b=[];for(const x of p){const S=y(x);S&&b.push(JI(S))}return ga(l,b)}function aP(e){if(!Re)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:s}=mt(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}=mt(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 aP(e){if(!Re)return;const{description:t="< unknown name >",op:n="< unknown op >"}=mt(e),{spanId:s}=e.spanContext(),a=Dn(e)===e,l=`[Tracing] Finishing "${n}" ${a?"root ":""}span "${t}" with ID ${s}`;be.log(l)}function cP(e,t,n,s=Xn()){const i=s&&Dn(s);i&&(Re&&be.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[Iu]:t,[Mu]:n}))}function Cw(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const s=n.attributes||{},i=s[Mu],a=s[Iu];typeof i=="string"&&typeof a=="number"&&(t[n.name]={value:a,unit:i})}),t}const Rw=1e3;class np{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({[mn]:"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?Xv: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(ys,"custom"),this}end(t){this._endTime||(this._endTime=ea(t),aP(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[mn],profile_id:this._attributes[Gv],exclusive_time:this._attributes[Vc],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){Re&&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=gt();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===Dn(this)))return;if(this._isStandaloneSpan){this._sampled?uP(oP([this],t)):(Re&&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(mt(this)))return;this._name||(Re&&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&&!lP(g)).map(g=>mt(g)).filter(jw),l=this._attributes[ys];delete this._attributes[bw],a.forEach(g=>{delete g.data[bw]});const f={contexts:{trace:II(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&&(Re&&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 lP(e){return e instanceof np&&e.isStandaloneSpan()}function uP(e){const t=gt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function fP(e,t,n=()=>{},s=()=>{}){let i;try{i=e()}catch(a){throw t(a),n(),a}return dP(i,t,n,s)}function dP(e,t,n,s){return Hc(e)?e.then(i=>(n(),s(i),i),i=>{throw t(i),n(),i}):(n(),s(e),e)}function hP(e,t,n){if(!rs(e))return[!1];let s,i;typeof e.tracesSampler=="function"?(i=e.tracesSampler({...t,inheritOrSampleWith:f=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):f}),s=!0):t.parentSampled!==void 0?i=t.parentSampled:typeof e.tracesSampleRate<"u"&&(i=e.tracesSampleRate,s=!0);const a=gu(i);if(a===void 0)return Re&&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 Re&&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||Re&&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=eb();if(n.startSpan)return n.startSpan(e,t);const s=MR(e),{forceTransaction:i,parentSpan:a,scope:l}=e,f=l?.clone();return Ou(f,()=>mP(a)(()=>{const p=bt(),g=IR(p,a),b=e.onlyIfParent&&!g?new ei:OR({parentSpan:g,spanArguments:s,forceTransaction:i,scope:p});return Nc(p,b),fP(()=>t(b),()=>{const{status:x}=mt(b);b.isRecording()&&(!x||x==="ok")&&b.setStatus({code:hn,message:"internal_error"})},()=>{b.end()})}))}function Gc(e){const t=eb();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=MR(e),{forceTransaction:s,parentSpan:i}=e;return(e.scope?l=>Ou(e.scope,l):i!==void 0?l=>Jv(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 Jv(e,t){const n=eb();return n.withActiveSpan?n.withActiveSpan(e,t):Ou(s=>(Nc(s,e||void 0),t(s)))}function OR({parentSpan:e,spanArguments:t,forceTransaction:n,scope:s}){if(!rs()){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=ss();let a;if(e&&!n)a=pP(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 iP(a),yI(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 eb(){const e=ha();return qc(e)}function Aw(e,t,n){const s=gt(),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]:hP(i,{name:a,parentSampled:f,attributes:d,parentSampleRate:gu(p.dsc?.sample_rate)},p.sampleRand),x=new np({...e,attributes:{[ys]:"custom",[Kv]:y!==void 0&&b?y:void 0,...d},sampled:g});return!g&&s&&(Re&&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 pP(e,t,n){const{spanId:s,traceId:i}=e.spanContext(),a=t.getScopeData().sdkProcessingMetadata[AR]?!1:ui(e),l=a?new np({...n,parentSpanId:s,traceId:i,sampled:a}):new ei({traceId:i});TR(e,l);const f=gt();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=jc(e);if(!n)return;const s=gt();return(s?s.getOptions():{}).parentSpanIsAlwaysRootSpan?Dn(n):n}function mP(e){return e!==void 0?t=>Jv(e,t):t=>t()}const Wd={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},gP="heartbeatFailed",yP="idleTimeout",vP="finalTimeout",bP="externalFinish";function PR(e,t={}){const n=new Map;let s=!1,i,a=bP,l=!t.disableAutoFinish;const f=[],{idleTimeout:d=Wd.idleTimeout,finalTimeout:p=Wd.finalTimeout,childSpanTimeout:g=Wd.childSpanTimeout,beforeSpanEnd:y,trimIdleSpanEndTimestamp:b=!0}=t,x=gt();if(!x||!rs()){const j=new ei,A={sample_rate:"0",sampled:"false",...to(j)};return Qd(j,A),j}const S=bt(),w=Xn(),T=xP(e);T.end=new Proxy(T.end,{apply(j,A,P){if(y&&y(T),A instanceof ei)return;const[Q,...B]=P,U=Q||cn(),Z=ea(U),K=Xd(T).filter(L=>L!==T),ee=mt(T);if(!K.length||!b)return z(Z),Reflect.apply(j,A,[Z,...B]);const D=x.getOptions().ignoreSpans,G=K?.reduce((L,I)=>{const H=mt(I);return!H.timestamp||D&&mh(H,D)?L:L?Math.max(L,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(Z,G||1/0)));return z(V),Reflect.apply(j,A,[V,...B])}});function C(){i&&(clearTimeout(i),i=void 0)}function O(j){C(),i=setTimeout(()=>{!s&&n.size===0&&l&&(a=yP,T.end(j))},d)}function N(j){i=setTimeout(()=>{!s&&l&&(a=gP,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 z(j){s=!0,n.clear(),f.forEach(K=>K()),Nc(S,w);const A=mt(T),{start_timestamp:P}=A;if(!P)return;A.data[mu]||T.setAttribute(mu,a);const B=A.status;(!B||B==="unknown")&&T.setStatus({code:Zv}),be.log(`[Tracing] Idle span "${A.op}" finished`);const U=Xd(T).filter(K=>K!==T);let Z=0;U.forEach(K=>{K.isRecording()&&(K.setStatus({code:hn,message:"cancelled"}),K.end(j),Re&&be.log("[Tracing] Cancelling span since span ended early",JSON.stringify(K,void 0,2)));const ee=mt(K),{timestamp:D=0,start_timestamp:G=0}=ee,q=G<=j,V=(p+d)/1e3,L=D-G<=V;if(Re){const I=JSON.stringify(K,void 0,2);q?L||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)}(!L||!q)&&(UI(T,K),Z++)}),Z>0&&T.setAttribute("sentry.idle_span_discarded_spans",Z)}return f.push(x.on("spanStart",j=>{if(s||j===T||mt(j).timestamp||j instanceof np&&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=vP,T.end())},p),T}function xP(e){const t=Gc(e);return Nc(bt(),t),Re&&be.log("[Tracing] Started span is an idle span"),t}const Hg=0,kw=1,Ow=2;function Pu(e){return new yu(t=>{t(e)})}function tb(e){return new yu((t,n)=>{n(e)})}class yu{constructor(t){this._state=Hg,this._handlers=[],this._runExecutor(t)}then(t,n){return new yu((s,i)=>{this._handlers.push([!1,a=>{if(!t)s(a);else try{s(t(a))}catch(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 yu((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===Hg)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===Hg){if(Hc(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 SP(e,t,n,s=0){try{const i=Wy(t,n,e,s);return Hc(i)?i:Pu(i)}catch(i){return tb(i)}}function Wy(e,t,n,s){const i=n[s];if(!e||!i)return e;const a=i({...e},t);return Re&&a===null&&be.log(`Event processor "${i.id||"?"}" dropped event`),Hc(a)?a.then(l=>Wy(l,t,n,s+1)):Wy(a,t,n,s+1)}let Fi,Mw,Iw,Lo;function _P(e){const t=ct._sentryDebugIds,n=ct._debugIds;if(!t&&!n)return{};const s=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Lo&&s.length===Mw&&i.length===Iw)return Lo;Mw=s.length,Iw=i.length,Lo={},Fi||(Fi={});const a=(l,f)=>{for(const d of l){const p=f[d],g=Fi?.[d];if(g&&Lo&&p)Lo[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&&Lo&&Fi){Lo[S]=p,Fi[d]=[S,p];break}}}}};return t&&a(s,t),n&&a(i,n),Lo}function wP(e,t){const{fingerprint:n,span:s,breadcrumbs:i,sdkProcessingMetadata:a}=t;EP(e,t),s&&RP(e,s),NP(e,n),TP(e,i),CP(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;Zl(e,"extra",n),Zl(e,"tags",s),Zl(e,"attributes",i),Zl(e,"user",a),Zl(e,"contexts",l),e.sdkProcessingMetadata=ku(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 Zl(e,t,n){e[t]=ku(e[t],n,1)}function nb(e,t){const n=uI().getScopeData();return e&&Pw(n,e.getScopeData()),t&&Pw(n,t.getScopeData()),n}function EP(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 TP(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function CP(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function RP(e,t){e.contexts={trace:_R(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:to(t),...e.sdkProcessingMetadata};const n=Dn(t),s=mt(n).description;s&&!e.transaction&&e.type==="transaction"&&(e.transaction=s)}function NP(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 jP(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);AP(d,e),MP(d,p),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&kP(d,e.stackParser);const g=PP(s,n.captureContext);n.mechanism&&Cc(d,n.mechanism);const y=i?i.getEventProcessors():[],b=nb(a,g),x=[...n.attachments||[],...b.attachments];x.length&&(n.attachments=x),wP(d,b);const S=[...y,...b.eventProcessors];return(n.data&&n.data.__sentry__===!0?Pu(d):SP(S,d,n)).then(C=>(C&&OP(C),typeof l=="number"&&l>0?IP(C,l,f):C))}function AP(e,t){const{environment:n,release:s,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||Qv,!e.release&&s&&(e.release=s),!e.dist&&i&&(e.dist=i);const l=e.request;l?.url&&a&&(l.url=qy(l.url,a)),a&&e.exception?.values?.forEach(f=>{f.value&&(f.value=qy(f.value,a))})}function kP(e,t){const n=_P(t);e.exception?.values?.forEach(s=>{s.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=n[i.filename])})})}function OP(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 MP(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function IP(e,t,n){if(!e)return null;const s={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:qs(i.data,t,n)}}))},...e.user&&{user:qs(e.user,t,n)},...e.contexts&&{contexts:qs(e.contexts,t,n)},...e.extra&&{extra:qs(e.extra,t,n)}};return e.contexts?.trace&&s.contexts&&(s.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(s.contexts.trace.data=qs(e.contexts.trace.data,t,n))),e.spans&&(s.spans=e.spans.map(i=>({...i,...i.data&&{data:qs(i.data,t,n)}}))),e.contexts?.flags&&s.contexts&&(s.contexts.flags=qs(e.contexts.flags,3,n)),s}function PP(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 DP(e,t){ss().setContext(e,t)}function zP(){const e=gt();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Dw(e){const t=ss(),n=bt(),{userAgent:s}=ct.navigator||{},i=eI({user:n.getUser()||t.getUser(),...s&&{userAgent:s},...e}),a=t.getSession();return a?.status==="ok"&&Rc(a,{status:"exited"}),LR(),t.setSession(i),i}function LR(){const e=ss(),n=bt().getSession()||e.getSession();n&&tI(n),UR(),e.setSession()}function UR(){const e=ss(),t=gt(),n=e.getSession();n&&t&&t.captureSession(n)}function zw(e=!1){if(e){LR();return}UR()}const LP="7";function UP(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function $P(e){return`${UP(e)}${e.projectId}/envelope/`}function BP(e,t){const n={sentry_version:LP};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function FP(e,t,n){return t||`${$P(e)}?${BP(e,n)}`}const Lw=[];function HP(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 qP(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 HP(s)}function VP(e,t){const n={};return t.forEach(s=>{s&&$R(e,s,n)}),n}function Uw(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function $R(e,t,n){if(n[t.name]){Re&&be.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Lw.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Lw.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)}Re&&be.log(`Integration installed: ${t.name}`)}function KP(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function GP(e,t){const{value:n,unit:s}=KP(e)?e:{value:e,unit:void 0},i=ZP(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=GP(i,t);a&&(n[s]=a)}return n}function ZP(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?Ou(t,()=>{const n=Xn(),s=n?_R(n):fR(t);return[n?to(n):Wv(e,t),s]}):[void 0,void 0]}const YP={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function XP(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function QP(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Kc(s)),ga(i,[XP(e)])}const WP=100;function hs(e,t,n,s=!0){n&&(!e[t]||s)&&(e[t]=n)}function JP(e,t){const n=sb(),s=FR(e);s===void 0?n.set(e,[t]):s.length>=WP?(rb(e,s),n.set(e,[t])):n.set(e,[...s,t])}function eD(e,t=bt(),n=JP){const s=t?.getClient()??gt();if(!s){Re&&be.warn("No client available to capture log.");return}const{release:i,environment:a,enableLogs:l=!1,beforeSendLog:f}=s.getOptions();if(!l){Re&&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={}}=nb(ss(),t);hs(p,"user.id",g,!1),hs(p,"user.email",y,!1),hs(p,"user.name",b,!1),hs(p,"sentry.release",i),hs(p,"sentry.environment",a);const{name:S,version:w}=s.getSdkMetadata()?.sdk??{};hs(p,"sentry.sdk.name",S),hs(p,"sentry.sdk.version",w);const T=s.getIntegrationByName("Replay"),C=T?.getReplayId(!0);hs(p,"sentry.replay_id",C),C&&T?.getRecordingMode()==="buffer"&&hs(p,"sentry._internal.replay_is_buffering",!0);const O=e.message;if(ep(O)){const{__sentry_template_string__:B,__sentry_template_values__:U=[]}=O;U?.length&&(p["sentry.message.template"]=B),U.forEach((Z,K)=>{p[`sentry.message.parameter.${K}`]=Z})}const N=jc(t);hs(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),Re&&be.warn("beforeSendLog returned null, log will not be captured.");return}const{level:z,message:j,attributes:A={},severityNumber:P}=M,Q={timestamp:cn(),level:z,body:j,trace_id:d?.trace_id,severity_number:P??YP[z],attributes:{...gh(x),...gh(A,!0)}};n(s,Q),s.emit("afterCaptureLog",M)}function rb(e,t){const n=t??FR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=QP(n,s._metadata,s.tunnel,e.getDsn());sb().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function FR(e){return sb().get(e)}function sb(){return Bc("clientToLogBufferMap",()=>new WeakMap)}function tD(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function nD(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Kc(s)),ga(i,[tD(e)])}const rD=1e3;function Bs(e,t,n,s=!0){n&&(s||!(t in e))&&(e[t]=n)}function sD(e,t){const n=ib(),s=HR(e);s===void 0?n.set(e,[t]):s.length>=rD?(ob(e,s),n.set(e,[t])):n.set(e,[...s,t])}function oD(e,t,n){const{release:s,environment:i}=t.getOptions(),a={...e.attributes};Bs(a,"user.id",n.id,!1),Bs(a,"user.email",n.email,!1),Bs(a,"user.name",n.username,!1),Bs(a,"sentry.release",s),Bs(a,"sentry.environment",i);const{name:l,version:f}=t.getSdkMetadata()?.sdk??{};Bs(a,"sentry.sdk.name",l),Bs(a,"sentry.sdk.version",f);const d=t.getIntegrationByName("Replay"),p=d?.getReplayId(!0);return Bs(a,"sentry.replay_id",p),p&&d?.getRecordingMode()==="buffer"&&Bs(a,"sentry._internal.replay_is_buffering",!0),{...e,attributes:a}}function iD(e,t,n,s){const[,i]=BR(t,n),a=jc(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 aD(e,t){const n=t?.scope??bt(),s=t?.captureSerializedMetric??sD,i=n?.getClient()??gt();if(!i){Re&&be.warn("No client available to capture metric.");return}const{_experiments:a,enableMetrics:l,beforeSendMetric:f}=i.getOptions();if(!(l??a?.enableMetrics??!0)){Re&&be.warn("metrics option not enabled, metric will not be captured.");return}const{user:p,attributes:g}=nb(ss(),n),y=oD(e,i,p);i.emit("processMetric",y);const b=f||a?.beforeSendMetric,x=b?b(y):y;if(!x){Re&&be.log("`beforeSendMetric` returned `null`, will not send metric.");return}const S=iD(x,i,n,g);Re&&be.log("[Metric]",S),s(i,S),i.emit("afterCaptureMetric",x)}function ob(e,t){const n=t??HR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=nD(n,s._metadata,s.tunnel,e.getDsn());ib().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function HR(e){return ib().get(e)}function ib(){return Bc("clientToMetricBufferMap",()=>new WeakMap)}function qR(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const ab=Symbol.for("SentryBufferFullError");function cb(e=100){const t=new Set;function n(){return t.size<e}function s(l){t.delete(l)}function i(l){if(!n())return tb(ab);const f=l();return t.add(f),f.then(()=>s(f),()=>s(f)),f}function a(l){if(!t.size)return Pu(!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 cD=60*1e3;function lD(e,t=Au()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const s=Date.parse(`${e}`);return isNaN(s)?cD:s-t}function uD(e,t){return e[t]||e.all||0}function fD(e,t,n=Au()){return uD(e,t)>n}function dD(e,{statusCode:t,headers:n},s=Au()){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+lD(l,s):t===429&&(i.all=s+60*1e3);return i}const VR=64;function hD(e,t,n=cb(e.bufferSize||VR)){let s={};const i=l=>n.drain(l);function a(l){const f=[];if(Xy(l,(y,b)=>{const x=Tw(b);fD(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(YI(d,["client_report"])){Re&&be.warn(`Dropping client report. Will not send outcomes (reason: ${y}).`);return}Xy(d,(b,x)=>{e.recordDroppedEvent(y,Tw(x))})},g=()=>t({body:XI(d)}).then(y=>y.statusCode===413?(Re&&be.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),p("send_error"),y):(Re&&y.statusCode!==void 0&&(y.statusCode<200||y.statusCode>=300)&&be.warn(`Sentry responded with status code ${y.statusCode} to sent event.`),s=dD(s,y),y),y=>{throw p("network_error"),Re&&be.error("Encountered error running transport request:",y),y});return n.add(g).then(y=>y,y=>{if(y===ab)return Re&&be.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw y})}return{send:a,flush:i}}function pD(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 mD(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?.[Gv],exclusive_time:l?.[Vc],measurements:e.measurements,is_segment:!0}}function gD(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[Gv]:e.profile_id},...e.exclusive_time&&{[Vc]:e.exclusive_time}}}},measurements:e.measurements}}const $w="Not capturing exception because it's already been captured.",Bw="Discarded session because of missing or non-string release",GR=Symbol.for("SentryInternalError"),ZR=Symbol.for("SentryDoNotSendEventError"),yD=5e3;function Jd(e){return{message:e,[GR]:!0}}function qg(e){return{message:e,[ZR]:!0}}function Fw(e){return!!e&&typeof e=="object"&&GR in e}function Hw(e){return!!e&&typeof e=="object"&&ZR in e}function qw(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)},yD)))}),e.on("flush",()=>{i(e)})}class vD{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=cb(t.transportOptions?.bufferSize??VR),t.dsn?this._dsn=AI(t.dsn):Re&&be.warn("No DSN provided, client will not send events."),this._dsn){const s=FP(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&&qw(this,"afterCaptureLog","flushLogs",_D,rb),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&qw(this,"afterCaptureMetric","flushMetrics",SD,ob)}captureException(t,n,s){const i=qr();if(gw(t))return Re&&be.log($w),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=ep(t)?t:String(t),f=Tc(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 Re&&be.log($w),i;const a={event_id:i,...n},l=t.sdkProcessingMetadata||{},f=l.capturedSpanScope,d=l.capturedSpanIsolationScope,p=Vw(t.type);return this._process(()=>this._captureEvent(t,a,f||s,d),p),a.event_id}captureSession(t){this.sendSession(t),Rc(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){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||Uw(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let s=sP(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])s=ZI(s,JI(i));this.sendEnvelope(s).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){const{release:n,environment:s=Qv}=this._options;if("aggregates"in t){const a=t.attrs||{};if(!a.release&&!n){Re&&be.warn(Bw);return}a.release=a.release||n,a.environment=a.environment||s,t.attrs=a}else{if(!t.release&&!n){Re&&be.warn(Bw);return}t.release=t.release||n,t.environment=t.environment||s}this.emit("beforeSendSession",t);const i=rP(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}`;Re&&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 Re&&be.error("Error while sending envelope:",n),{}}return Re&&be.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=VP(this,t),Uw(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)&&(Rc(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),jP(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=Wv(this,s);return f.sdkProcessingMetadata={dynamicSamplingContext:d,...f.sdkProcessingMetadata},f})}_captureEvent(t,n={},s=bt(),i=ss()){return Re&&Jy(t)&&be.log(`Captured error event \`${KR(t)[0]||"<unknown>"}\``),this._processEvent(t,n,s,i).then(a=>a.event_id,a=>{Re&&(Hw(a)?be.log(a.message):Fw(a)?be.warn(a.message):be.warn(a))})}_processEvent(t,n,s,i){const a=this.getOptions(),{sampleRate:l}=a,f=YR(t),d=Jy(t),g=`before send for type \`${t.type||"error"}\``,y=typeof l>"u"?void 0:gu(l);if(d&&typeof y=="number"&&Ko()>y)return this.recordDroppedEvent("sample_rate","error"),tb(qg(`Discarding event because it's not included in the random sample (sampling rate = ${l})`));const b=Vw(t.type);return this._prepareEvent(t,n,s,i).then(x=>{if(x===null)throw this.recordDroppedEvent("event_processor",b),qg("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return x;const w=xD(this,a,x,n);return bD(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 qg(`${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 Hw(x)||Fw(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===ab&&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(){Re&&be.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){Re&&be.log("No outcomes to send");return}if(!this._dsn){Re&&be.log("No dsn provided, will not send outcomes");return}Re&&be.log("Sending outcomes:",t);const n=pD(t,this._options.tunnel&&Kc(this._dsn));this.sendEnvelope(n)}}function Vw(e){return e==="replay_event"?"replay":e||"error"}function bD(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Hc(e))return e.then(s=>{if(!pu(s)&&s!==null)throw Jd(n);return s},s=>{throw Jd(`${t} rejected with ${s}`)});if(!pu(e)&&e!==null)throw Jd(n);return e}function xD(e,t,n,s){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:l,ignoreSpans:f}=t;let d=n;if(Jy(d)&&i)return i(d,s);if(YR(d)){if(l||f){const p=mD(d);if(f?.length&&mh(p,f))return null;if(l){const g=l(p);g?d=ku(n,gD(g)):Zy()}if(d.spans){const g=[],y=d.spans;for(const x of y){if(f?.length&&mh(x,f)){BI(y,x);continue}if(l){const S=l(x);S?g.push(S):(Zy(),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 Jy(e){return e.type===void 0}function YR(e){return e.type==="transaction"}function SD(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+XR(e.attributes)}function _D(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*Kw(n[0]):Tc(n)?t+=Kw(n):t+=100}),t}function Kw(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function wD(e){return Jh(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Gw(e){return wD(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function ED(e,t){t.debug===!0&&(Re?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 TD(s),s.init(),s}function TD(e){bt().setClient(e)}const CD="thismessage:/";function QR(e){return"isRelative"in e}function WR(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,s=n?CD: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 RD(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 ND(e){return e.split(/[?#]/,1)[0]}function Zo(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 jD(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 AD=jD;function kD(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||gt();if(!zP()||!t)return{};const n=ha(),s=qc(n);if(s.getTraceData)return s.getTraceData(e);const i=e.scope||bt(),a=e.span||Xn(),l=a?PI(a):OD(i),f=a?to(a):Wv(t,i),d=xI(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?DI(a):MD(i)),g}function OD(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return bR(t,s,n)}function MD(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return xR(t,s,n)}const ID=100;function ia(e,t){const n=gt(),s=ss();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=ID}=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 Zw;const PD="FunctionToString",Yw=new WeakMap,DD=(()=>({name:PD,setupOnce(){Zw=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Vv(this),n=Yw.has(gt())&&t!==void 0?t:this;return Zw.apply(n,e)}}catch{}},setup(e){Yw.set(e,!0)}})),zD=DD,LD=[/^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$/],UD="EventFilters",$D=(e={})=>{let t;return{name:UD,setup(n){const s=n.getOptions();t=Xw(e,s)},processEvent(n,s,i){if(!t){const a=i.getOptions();t=Xw(e,a)}return FD(n,t)?null:n}}},BD=((e={})=>({...$D(e),name:"InboundFilters"}));function Xw(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:LD],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function FD(e,t){if(e.type){if(e.type==="transaction"&&qD(e,t.ignoreTransactions))return Re&&be.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
11
- Event: ${Gi(e)}`),!0}else{if(HD(e,t.ignoreErrors))return Re&&be.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
12
- Event: ${Gi(e)}`),!0;if(ZD(e))return Re&&be.warn(`Event dropped due to not having an error message, error type or stacktrace.
13
- Event: ${Gi(e)}`),!0;if(VD(e,t.denyUrls))return Re&&be.warn(`Event dropped due to being matched by \`denyUrls\` option.
14
- Event: ${Gi(e)}.
9
+ `)}`)}function cP(e){if(!Re)return;const{description:t="< unknown name >",op:n="< unknown op >"}=mt(e),{spanId:s}=e.spanContext(),a=Dn(e)===e,l=`[Tracing] Finishing "${n}" ${a?"root ":""}span "${t}" with ID ${s}`;be.log(l)}function lP(e,t,n,s=Xn()){const i=s&&Dn(s);i&&(Re&&be.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[Iu]:t,[Mu]:n}))}function Cw(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const s=n.attributes||{},i=s[Mu],a=s[Iu];typeof i=="string"&&typeof a=="number"&&(t[n.name]={value:a,unit:i})}),t}const Rw=1e3;class np{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?Xv: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(ys,"custom"),this}end(t){this._endTime||(this._endTime=ea(t),cP(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[Kv],exclusive_time:this._attributes[Vc],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){Re&&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=gt();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===Dn(this)))return;if(this._isStandaloneSpan){this._sampled?fP(iP([this],t)):(Re&&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(mt(this)))return;this._name||(Re&&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&&!uP(g)).map(g=>mt(g)).filter(jw),l=this._attributes[ys];delete this._attributes[bw],a.forEach(g=>{delete g.data[bw]});const f={contexts:{trace:PI(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&&(Re&&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 uP(e){return e instanceof np&&e.isStandaloneSpan()}function fP(e){const t=gt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function dP(e,t,n=()=>{},s=()=>{}){let i;try{i=e()}catch(a){throw t(a),n(),a}return hP(i,t,n,s)}function hP(e,t,n,s){return Hc(e)?e.then(i=>(n(),s(i),i),i=>{throw t(i),n(),i}):(n(),s(e),e)}function pP(e,t,n){if(!rs(e))return[!1];let s,i;typeof e.tracesSampler=="function"?(i=e.tracesSampler({...t,inheritOrSampleWith:f=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):f}),s=!0):t.parentSampled!==void 0?i=t.parentSampled:typeof e.tracesSampleRate<"u"&&(i=e.tracesSampleRate,s=!0);const a=gu(i);if(a===void 0)return Re&&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 Re&&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||Re&&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=eb();if(n.startSpan)return n.startSpan(e,t);const s=MR(e),{forceTransaction:i,parentSpan:a,scope:l}=e,f=l?.clone();return Ou(f,()=>gP(a)(()=>{const p=bt(),g=IR(p,a),b=e.onlyIfParent&&!g?new ei:OR({parentSpan:g,spanArguments:s,forceTransaction:i,scope:p});return Nc(p,b),dP(()=>t(b),()=>{const{status:x}=mt(b);b.isRecording()&&(!x||x==="ok")&&b.setStatus({code:hn,message:"internal_error"})},()=>{b.end()})}))}function Kc(e){const t=eb();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=MR(e),{forceTransaction:s,parentSpan:i}=e;return(e.scope?l=>Ou(e.scope,l):i!==void 0?l=>Jv(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 Jv(e,t){const n=eb();return n.withActiveSpan?n.withActiveSpan(e,t):Ou(s=>(Nc(s,e||void 0),t(s)))}function OR({parentSpan:e,spanArguments:t,forceTransaction:n,scope:s}){if(!rs()){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=ss();let a;if(e&&!n)a=mP(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 aP(a),vI(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 eb(){const e=ha();return qc(e)}function Aw(e,t,n){const s=gt(),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]:pP(i,{name:a,parentSampled:f,attributes:d,parentSampleRate:gu(p.dsc?.sample_rate)},p.sampleRand),x=new np({...e,attributes:{[ys]:"custom",[Gv]:y!==void 0&&b?y:void 0,...d},sampled:g});return!g&&s&&(Re&&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 mP(e,t,n){const{spanId:s,traceId:i}=e.spanContext(),a=t.getScopeData().sdkProcessingMetadata[AR]?!1:ui(e),l=a?new np({...n,parentSpanId:s,traceId:i,sampled:a}):new ei({traceId:i});TR(e,l);const f=gt();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=jc(e);if(!n)return;const s=gt();return(s?s.getOptions():{}).parentSpanIsAlwaysRootSpan?Dn(n):n}function gP(e){return e!==void 0?t=>Jv(e,t):t=>t()}const Wd={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},yP="heartbeatFailed",vP="idleTimeout",bP="finalTimeout",xP="externalFinish";function PR(e,t={}){const n=new Map;let s=!1,i,a=xP,l=!t.disableAutoFinish;const f=[],{idleTimeout:d=Wd.idleTimeout,finalTimeout:p=Wd.finalTimeout,childSpanTimeout:g=Wd.childSpanTimeout,beforeSpanEnd:y,trimIdleSpanEndTimestamp:b=!0}=t,x=gt();if(!x||!rs()){const j=new ei,A={sample_rate:"0",sampled:"false",...to(j)};return Qd(j,A),j}const S=bt(),w=Xn(),T=SP(e);T.end=new Proxy(T.end,{apply(j,A,P){if(y&&y(T),A instanceof ei)return;const[Q,...B]=P,U=Q||cn(),Z=ea(U),G=Xd(T).filter(L=>L!==T),ee=mt(T);if(!G.length||!b)return z(Z),Reflect.apply(j,A,[Z,...B]);const D=x.getOptions().ignoreSpans,K=G?.reduce((L,I)=>{const H=mt(I);return!H.timestamp||D&&mh(H,D)?L:L?Math.max(L,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(Z,K||1/0)));return z(V),Reflect.apply(j,A,[V,...B])}});function C(){i&&(clearTimeout(i),i=void 0)}function O(j){C(),i=setTimeout(()=>{!s&&n.size===0&&l&&(a=vP,T.end(j))},d)}function N(j){i=setTimeout(()=>{!s&&l&&(a=yP,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 z(j){s=!0,n.clear(),f.forEach(G=>G()),Nc(S,w);const A=mt(T),{start_timestamp:P}=A;if(!P)return;A.data[mu]||T.setAttribute(mu,a);const B=A.status;(!B||B==="unknown")&&T.setStatus({code:Zv}),be.log(`[Tracing] Idle span "${A.op}" finished`);const U=Xd(T).filter(G=>G!==T);let Z=0;U.forEach(G=>{G.isRecording()&&(G.setStatus({code:hn,message:"cancelled"}),G.end(j),Re&&be.log("[Tracing] Cancelling span since span ended early",JSON.stringify(G,void 0,2)));const ee=mt(G),{timestamp:D=0,start_timestamp:K=0}=ee,q=K<=j,V=(p+d)/1e3,L=D-K<=V;if(Re){const I=JSON.stringify(G,void 0,2);q?L||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)}(!L||!q)&&($I(T,G),Z++)}),Z>0&&T.setAttribute("sentry.idle_span_discarded_spans",Z)}return f.push(x.on("spanStart",j=>{if(s||j===T||mt(j).timestamp||j instanceof np&&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=bP,T.end())},p),T}function SP(e){const t=Kc(e);return Nc(bt(),t),Re&&be.log("[Tracing] Started span is an idle span"),t}const Hg=0,kw=1,Ow=2;function Pu(e){return new yu(t=>{t(e)})}function tb(e){return new yu((t,n)=>{n(e)})}class yu{constructor(t){this._state=Hg,this._handlers=[],this._runExecutor(t)}then(t,n){return new yu((s,i)=>{this._handlers.push([!1,a=>{if(!t)s(a);else try{s(t(a))}catch(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 yu((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===Hg)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===Hg){if(Hc(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 _P(e,t,n,s=0){try{const i=Wy(t,n,e,s);return Hc(i)?i:Pu(i)}catch(i){return tb(i)}}function Wy(e,t,n,s){const i=n[s];if(!e||!i)return e;const a=i({...e},t);return Re&&a===null&&be.log(`Event processor "${i.id||"?"}" dropped event`),Hc(a)?a.then(l=>Wy(l,t,n,s+1)):Wy(a,t,n,s+1)}let Fi,Mw,Iw,Lo;function wP(e){const t=ct._sentryDebugIds,n=ct._debugIds;if(!t&&!n)return{};const s=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Lo&&s.length===Mw&&i.length===Iw)return Lo;Mw=s.length,Iw=i.length,Lo={},Fi||(Fi={});const a=(l,f)=>{for(const d of l){const p=f[d],g=Fi?.[d];if(g&&Lo&&p)Lo[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&&Lo&&Fi){Lo[S]=p,Fi[d]=[S,p];break}}}}};return t&&a(s,t),n&&a(i,n),Lo}function EP(e,t){const{fingerprint:n,span:s,breadcrumbs:i,sdkProcessingMetadata:a}=t;TP(e,t),s&&NP(e,s),jP(e,n),CP(e,i),RP(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;Zl(e,"extra",n),Zl(e,"tags",s),Zl(e,"attributes",i),Zl(e,"user",a),Zl(e,"contexts",l),e.sdkProcessingMetadata=ku(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 Zl(e,t,n){e[t]=ku(e[t],n,1)}function nb(e,t){const n=fI().getScopeData();return e&&Pw(n,e.getScopeData()),t&&Pw(n,t.getScopeData()),n}function TP(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 CP(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function RP(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function NP(e,t){e.contexts={trace:_R(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:to(t),...e.sdkProcessingMetadata};const n=Dn(t),s=mt(n).description;s&&!e.transaction&&e.type==="transaction"&&(e.transaction=s)}function jP(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 AP(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);kP(d,e),IP(d,p),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&OP(d,e.stackParser);const g=DP(s,n.captureContext);n.mechanism&&Cc(d,n.mechanism);const y=i?i.getEventProcessors():[],b=nb(a,g),x=[...n.attachments||[],...b.attachments];x.length&&(n.attachments=x),EP(d,b);const S=[...y,...b.eventProcessors];return(n.data&&n.data.__sentry__===!0?Pu(d):_P(S,d,n)).then(C=>(C&&MP(C),typeof l=="number"&&l>0?PP(C,l,f):C))}function kP(e,t){const{environment:n,release:s,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||Qv,!e.release&&s&&(e.release=s),!e.dist&&i&&(e.dist=i);const l=e.request;l?.url&&a&&(l.url=qy(l.url,a)),a&&e.exception?.values?.forEach(f=>{f.value&&(f.value=qy(f.value,a))})}function OP(e,t){const n=wP(t);e.exception?.values?.forEach(s=>{s.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=n[i.filename])})})}function MP(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 IP(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function PP(e,t,n){if(!e)return null;const s={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:qs(i.data,t,n)}}))},...e.user&&{user:qs(e.user,t,n)},...e.contexts&&{contexts:qs(e.contexts,t,n)},...e.extra&&{extra:qs(e.extra,t,n)}};return e.contexts?.trace&&s.contexts&&(s.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(s.contexts.trace.data=qs(e.contexts.trace.data,t,n))),e.spans&&(s.spans=e.spans.map(i=>({...i,...i.data&&{data:qs(i.data,t,n)}}))),e.contexts?.flags&&s.contexts&&(s.contexts.flags=qs(e.contexts.flags,3,n)),s}function DP(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 zP(e,t){ss().setContext(e,t)}function LP(){const e=gt();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Dw(e){const t=ss(),n=bt(),{userAgent:s}=ct.navigator||{},i=tI({user:n.getUser()||t.getUser(),...s&&{userAgent:s},...e}),a=t.getSession();return a?.status==="ok"&&Rc(a,{status:"exited"}),LR(),t.setSession(i),i}function LR(){const e=ss(),n=bt().getSession()||e.getSession();n&&nI(n),UR(),e.setSession()}function UR(){const e=ss(),t=gt(),n=e.getSession();n&&t&&t.captureSession(n)}function zw(e=!1){if(e){LR();return}UR()}const UP="7";function $P(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function BP(e){return`${$P(e)}${e.projectId}/envelope/`}function FP(e,t){const n={sentry_version:UP};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function HP(e,t,n){return t||`${BP(e)}?${FP(e,n)}`}const Lw=[];function qP(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 VP(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 qP(s)}function GP(e,t){const n={};return t.forEach(s=>{s&&$R(e,s,n)}),n}function Uw(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function $R(e,t,n){if(n[t.name]){Re&&be.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Lw.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Lw.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)}Re&&be.log(`Integration installed: ${t.name}`)}function KP(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function ZP(e,t){const{value:n,unit:s}=KP(e)?e:{value:e,unit:void 0},i=YP(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=ZP(i,t);a&&(n[s]=a)}return n}function YP(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?Ou(t,()=>{const n=Xn(),s=n?_R(n):fR(t);return[n?to(n):Wv(e,t),s]}):[void 0,void 0]}const XP={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function QP(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function WP(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,[QP(e)])}const JP=100;function hs(e,t,n,s=!0){n&&(!e[t]||s)&&(e[t]=n)}function eD(e,t){const n=sb(),s=FR(e);s===void 0?n.set(e,[t]):s.length>=JP?(rb(e,s),n.set(e,[t])):n.set(e,[...s,t])}function tD(e,t=bt(),n=eD){const s=t?.getClient()??gt();if(!s){Re&&be.warn("No client available to capture log.");return}const{release:i,environment:a,enableLogs:l=!1,beforeSendLog:f}=s.getOptions();if(!l){Re&&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={}}=nb(ss(),t);hs(p,"user.id",g,!1),hs(p,"user.email",y,!1),hs(p,"user.name",b,!1),hs(p,"sentry.release",i),hs(p,"sentry.environment",a);const{name:S,version:w}=s.getSdkMetadata()?.sdk??{};hs(p,"sentry.sdk.name",S),hs(p,"sentry.sdk.version",w);const T=s.getIntegrationByName("Replay"),C=T?.getReplayId(!0);hs(p,"sentry.replay_id",C),C&&T?.getRecordingMode()==="buffer"&&hs(p,"sentry._internal.replay_is_buffering",!0);const O=e.message;if(ep(O)){const{__sentry_template_string__:B,__sentry_template_values__:U=[]}=O;U?.length&&(p["sentry.message.template"]=B),U.forEach((Z,G)=>{p[`sentry.message.parameter.${G}`]=Z})}const N=jc(t);hs(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),Re&&be.warn("beforeSendLog returned null, log will not be captured.");return}const{level:z,message:j,attributes:A={},severityNumber:P}=M,Q={timestamp:cn(),level:z,body:j,trace_id:d?.trace_id,severity_number:P??XP[z],attributes:{...gh(x),...gh(A,!0)}};n(s,Q),s.emit("afterCaptureLog",M)}function rb(e,t){const n=t??FR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=WP(n,s._metadata,s.tunnel,e.getDsn());sb().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function FR(e){return sb().get(e)}function sb(){return Bc("clientToLogBufferMap",()=>new WeakMap)}function nD(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function rD(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,[nD(e)])}const sD=1e3;function Bs(e,t,n,s=!0){n&&(s||!(t in e))&&(e[t]=n)}function oD(e,t){const n=ib(),s=HR(e);s===void 0?n.set(e,[t]):s.length>=sD?(ob(e,s),n.set(e,[t])):n.set(e,[...s,t])}function iD(e,t,n){const{release:s,environment:i}=t.getOptions(),a={...e.attributes};Bs(a,"user.id",n.id,!1),Bs(a,"user.email",n.email,!1),Bs(a,"user.name",n.username,!1),Bs(a,"sentry.release",s),Bs(a,"sentry.environment",i);const{name:l,version:f}=t.getSdkMetadata()?.sdk??{};Bs(a,"sentry.sdk.name",l),Bs(a,"sentry.sdk.version",f);const d=t.getIntegrationByName("Replay"),p=d?.getReplayId(!0);return Bs(a,"sentry.replay_id",p),p&&d?.getRecordingMode()==="buffer"&&Bs(a,"sentry._internal.replay_is_buffering",!0),{...e,attributes:a}}function aD(e,t,n,s){const[,i]=BR(t,n),a=jc(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 cD(e,t){const n=t?.scope??bt(),s=t?.captureSerializedMetric??oD,i=n?.getClient()??gt();if(!i){Re&&be.warn("No client available to capture metric.");return}const{_experiments:a,enableMetrics:l,beforeSendMetric:f}=i.getOptions();if(!(l??a?.enableMetrics??!0)){Re&&be.warn("metrics option not enabled, metric will not be captured.");return}const{user:p,attributes:g}=nb(ss(),n),y=iD(e,i,p);i.emit("processMetric",y);const b=f||a?.beforeSendMetric,x=b?b(y):y;if(!x){Re&&be.log("`beforeSendMetric` returned `null`, will not send metric.");return}const S=aD(x,i,n,g);Re&&be.log("[Metric]",S),s(i,S),i.emit("afterCaptureMetric",x)}function ob(e,t){const n=t??HR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=rD(n,s._metadata,s.tunnel,e.getDsn());ib().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function HR(e){return ib().get(e)}function ib(){return Bc("clientToMetricBufferMap",()=>new WeakMap)}function qR(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const ab=Symbol.for("SentryBufferFullError");function cb(e=100){const t=new Set;function n(){return t.size<e}function s(l){t.delete(l)}function i(l){if(!n())return tb(ab);const f=l();return t.add(f),f.then(()=>s(f),()=>s(f)),f}function a(l){if(!t.size)return Pu(!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 lD=60*1e3;function uD(e,t=Au()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const s=Date.parse(`${e}`);return isNaN(s)?lD:s-t}function fD(e,t){return e[t]||e.all||0}function dD(e,t,n=Au()){return fD(e,t)>n}function hD(e,{statusCode:t,headers:n},s=Au()){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+uD(l,s):t===429&&(i.all=s+60*1e3);return i}const VR=64;function pD(e,t,n=cb(e.bufferSize||VR)){let s={};const i=l=>n.drain(l);function a(l){const f=[];if(Xy(l,(y,b)=>{const x=Tw(b);dD(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(XI(d,["client_report"])){Re&&be.warn(`Dropping client report. Will not send outcomes (reason: ${y}).`);return}Xy(d,(b,x)=>{e.recordDroppedEvent(y,Tw(x))})},g=()=>t({body:QI(d)}).then(y=>y.statusCode===413?(Re&&be.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),p("send_error"),y):(Re&&y.statusCode!==void 0&&(y.statusCode<200||y.statusCode>=300)&&be.warn(`Sentry responded with status code ${y.statusCode} to sent event.`),s=hD(s,y),y),y=>{throw p("network_error"),Re&&be.error("Encountered error running transport request:",y),y});return n.add(g).then(y=>y,y=>{if(y===ab)return Re&&be.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw y})}return{send:a,flush:i}}function mD(e,t,n){const s=[{type:"client_report"},{timestamp:ma(),discarded_events:e}];return ga(t?{dsn:t}:{},[s])}function GR(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 gD(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?.[Kv],exclusive_time:l?.[Vc],measurements:e.measurements,is_segment:!0}}function yD(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&&{[Kv]:e.profile_id},...e.exclusive_time&&{[Vc]:e.exclusive_time}}}},measurements:e.measurements}}const $w="Not capturing exception because it's already been captured.",Bw="Discarded session because of missing or non-string release",KR=Symbol.for("SentryInternalError"),ZR=Symbol.for("SentryDoNotSendEventError"),vD=5e3;function Jd(e){return{message:e,[KR]:!0}}function qg(e){return{message:e,[ZR]:!0}}function Fw(e){return!!e&&typeof e=="object"&&KR in e}function Hw(e){return!!e&&typeof e=="object"&&ZR in e}function qw(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)},vD)))}),e.on("flush",()=>{i(e)})}class bD{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=cb(t.transportOptions?.bufferSize??VR),t.dsn?this._dsn=kI(t.dsn):Re&&be.warn("No DSN provided, client will not send events."),this._dsn){const s=HP(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&&qw(this,"afterCaptureLog","flushLogs",wD,rb),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&qw(this,"afterCaptureMetric","flushMetrics",_D,ob)}captureException(t,n,s){const i=qr();if(gw(t))return Re&&be.log($w),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=ep(t)?t:String(t),f=Tc(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 Re&&be.log($w),i;const a={event_id:i,...n},l=t.sdkProcessingMetadata||{},f=l.capturedSpanScope,d=l.capturedSpanIsolationScope,p=Vw(t.type);return this._process(()=>this._captureEvent(t,a,f||s,d),p),a.event_id}captureSession(t){this.sendSession(t),Rc(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){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||Uw(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let s=oP(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])s=YI(s,eP(i));this.sendEnvelope(s).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){const{release:n,environment:s=Qv}=this._options;if("aggregates"in t){const a=t.attrs||{};if(!a.release&&!n){Re&&be.warn(Bw);return}a.release=a.release||n,a.environment=a.environment||s,t.attrs=a}else{if(!t.release&&!n){Re&&be.warn(Bw);return}t.release=t.release||n,t.environment=t.environment||s}this.emit("beforeSendSession",t);const i=sP(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}`;Re&&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 Re&&be.error("Error while sending envelope:",n),{}}return Re&&be.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=GP(this,t),Uw(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)&&(Rc(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),AP(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=Wv(this,s);return f.sdkProcessingMetadata={dynamicSamplingContext:d,...f.sdkProcessingMetadata},f})}_captureEvent(t,n={},s=bt(),i=ss()){return Re&&Jy(t)&&be.log(`Captured error event \`${GR(t)[0]||"<unknown>"}\``),this._processEvent(t,n,s,i).then(a=>a.event_id,a=>{Re&&(Hw(a)?be.log(a.message):Fw(a)?be.warn(a.message):be.warn(a))})}_processEvent(t,n,s,i){const a=this.getOptions(),{sampleRate:l}=a,f=YR(t),d=Jy(t),g=`before send for type \`${t.type||"error"}\``,y=typeof l>"u"?void 0:gu(l);if(d&&typeof y=="number"&&Go()>y)return this.recordDroppedEvent("sample_rate","error"),tb(qg(`Discarding event because it's not included in the random sample (sampling rate = ${l})`));const b=Vw(t.type);return this._prepareEvent(t,n,s,i).then(x=>{if(x===null)throw this.recordDroppedEvent("event_processor",b),qg("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return x;const w=SD(this,a,x,n);return xD(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 qg(`${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 Hw(x)||Fw(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===ab&&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(){Re&&be.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){Re&&be.log("No outcomes to send");return}if(!this._dsn){Re&&be.log("No dsn provided, will not send outcomes");return}Re&&be.log("Sending outcomes:",t);const n=mD(t,this._options.tunnel&&Gc(this._dsn));this.sendEnvelope(n)}}function Vw(e){return e==="replay_event"?"replay":e||"error"}function xD(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Hc(e))return e.then(s=>{if(!pu(s)&&s!==null)throw Jd(n);return s},s=>{throw Jd(`${t} rejected with ${s}`)});if(!pu(e)&&e!==null)throw Jd(n);return e}function SD(e,t,n,s){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:l,ignoreSpans:f}=t;let d=n;if(Jy(d)&&i)return i(d,s);if(YR(d)){if(l||f){const p=gD(d);if(f?.length&&mh(p,f))return null;if(l){const g=l(p);g?d=ku(n,yD(g)):Zy()}if(d.spans){const g=[],y=d.spans;for(const x of y){if(f?.length&&mh(x,f)){FI(y,x);continue}if(l){const S=l(x);S?g.push(S):(Zy(),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 Jy(e){return e.type===void 0}function YR(e){return e.type==="transaction"}function _D(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+XR(e.attributes)}function wD(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*Gw(n[0]):Tc(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 ED(e){return Jh(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Kw(e){return ED(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function TD(e,t){t.debug===!0&&(Re?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 CD(s),s.init(),s}function CD(e){bt().setClient(e)}const RD="thismessage:/";function QR(e){return"isRelative"in e}function WR(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,s=n?RD: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 ND(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 jD(e){return e.split(/[?#]/,1)[0]}function Zo(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 AD(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 kD=AD;function OD(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||gt();if(!LP()||!t)return{};const n=ha(),s=qc(n);if(s.getTraceData)return s.getTraceData(e);const i=e.scope||bt(),a=e.span||Xn(),l=a?DI(a):MD(i),f=a?to(a):Wv(t,i),d=SI(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?zI(a):ID(i)),g}function MD(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return bR(t,s,n)}function ID(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return xR(t,s,n)}const PD=100;function ia(e,t){const n=gt(),s=ss();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=PD}=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 Zw;const DD="FunctionToString",Yw=new WeakMap,zD=(()=>({name:DD,setupOnce(){Zw=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Vv(this),n=Yw.has(gt())&&t!==void 0?t:this;return Zw.apply(n,e)}}catch{}},setup(e){Yw.set(e,!0)}})),LD=zD,UD=[/^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$/],$D="EventFilters",BD=(e={})=>{let t;return{name:$D,setup(n){const s=n.getOptions();t=Xw(e,s)},processEvent(n,s,i){if(!t){const a=i.getOptions();t=Xw(e,a)}return HD(n,t)?null:n}}},FD=((e={})=>({...BD(e),name:"InboundFilters"}));function Xw(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:UD],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function HD(e,t){if(e.type){if(e.type==="transaction"&&VD(e,t.ignoreTransactions))return Re&&be.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
11
+ Event: ${Ki(e)}`),!0}else{if(qD(e,t.ignoreErrors))return Re&&be.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
12
+ Event: ${Ki(e)}`),!0;if(YD(e))return Re&&be.warn(`Event dropped due to not having an error message, error type or stacktrace.
13
+ Event: ${Ki(e)}`),!0;if(GD(e,t.denyUrls))return Re&&be.warn(`Event dropped due to being matched by \`denyUrls\` option.
14
+ Event: ${Ki(e)}.
15
15
  Url: ${yh(e)}`),!0;if(!KD(e,t.allowUrls))return Re&&be.warn(`Event dropped due to not being matched by \`allowUrls\` option.
16
- Event: ${Gi(e)}.
17
- Url: ${yh(e)}`),!0}return!1}function HD(e,t){return t?.length?KR(e).some(n=>Go(n,t)):!1}function qD(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Go(n,t):!1}function VD(e,t){if(!t?.length)return!1;const n=yh(e);return n?Go(n,t):!1}function KD(e,t){if(!t?.length)return!0;const n=yh(e);return n?Go(n,t):!0}function GD(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 yh(e){try{const n=[...e.exception?.values??[]].reverse().find(s=>s.mechanism?.parent_id===void 0&&s.stacktrace?.frames?.length)?.stacktrace?.frames;return n?GD(n):null}catch{return Re&&be.error(`Cannot extract url for event ${Gi(e)}`),null}}function ZD(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function YD(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=ev(e,t,s,a.originalException,n,i.exception.values,l,0))}function ev(e,t,n,s,i,a,l,f){if(a.length>=n+1)return a;let d=[...a];if(Qs(s[i],Error)){Qw(l,f,s);const p=e(t,s[i]),g=d.length;Ww(p,i,g,f),d=ev(e,t,n,s[i],i,[p,...d],p,g)}return t1(s)&&s.errors.forEach((p,g)=>{if(Qs(p,Error)){Qw(l,f,s);const y=e(t,p),b=d.length;Ww(y,`errors[${g}]`,b,f),d=ev(e,t,n,p,i,[y,...d],y,b)}}),d}function t1(e){return Array.isArray(e.errors)}function Qw(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...t1(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ww(e,t,n,s){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:s}}function XD(e){const t="console";ci(t,e),li(t,QD)}function QD(){"console"in ct&&kM.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 WD(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const JD="Dedupe",ez=(()=>{let e;return{name:JD,processEvent(t){if(t.type)return t;try{if(nz(t,e))return Re&&be.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),tz=ez;function nz(e,t){return t?!!(rz(e,t)||sz(e,t)):!1}function rz(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 sz(e,t){const n=Jw(t),s=Jw(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 Jw(e){return e.exception?.values?.[0]}const oz="ConversationId",iz=(()=>({name:oz,setup(e){e.on("spanStart",t=>{const n=bt().getScopeData(),s=ss().getScopeData(),i=n.conversationId||s.conversationId;i&&t.setAttribute(dI,i)})}})),az=iz;function cz(e,t,n,s,i){if(!e.fetchData)return;const{method:a,url:l}=e.fetchData,f=rs()&&t(l);if(e.endTimestamp&&f){const x=e.fetchData.__span;if(!x)return;const S=s[x];S&&(fz(S,e),lz(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?Gc(hz(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=uz(x,S,rs()&&g?y:void 0,p);w&&(e.args[1]=S,S.headers=w)}const b=gt();if(b){const x={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};b.emit("beforeOutgoingRequestSpan",y,x)}return y}function lz(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function uz(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||(Hv(e)?e.headers:void 0);if(d)if(dz(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 fz(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(Yv))}function dz(e){return typeof Headers<"u"&&Qs(e,Headers)}function hz(e,t,n){if(e.startsWith("data:")){const a=Zo(e);return{name:`${t} ${a}`,attributes:eE(e,void 0,t,n)}}const s=WR(e),i=s?RD(s):e;return{name:`${t} ${i}`,attributes:eE(e,s,t,n)}}function eE(e,t,n,s){const i={url:Zo(e),type:"fetch","http.method":n,[mn]:s,[eo]:"http.client"};return t&&(QR(t)||(i["http.url"]=Zo(t.href),i["server.address"]=t.host),t.search&&(i["http.query"]=t.search),t.hash&&(i["http.fragment"]=t.hash)),i}function Zc(e,t,n,s,i){eD({level:e,message:t,attributes:n,severityNumber:i},s)}function pz(e,t,{scope:n}={}){Zc("trace",e,t,n)}function mz(e,t,{scope:n}={}){Zc("debug",e,t,n)}function gz(e,t,{scope:n}={}){Zc("info",e,t,n)}function yz(e,t,{scope:n}={}){Zc("warn",e,t,n)}function vz(e,t,{scope:n}={}){Zc("error",e,t,n)}function bz(e,t,{scope:n}={}){Zc("fatal",e,t,n)}const xz=Object.freeze(Object.defineProperty({__proto__:null,debug:mz,error:vz,fatal:bz,fmt:AD,info:gz,trace:pz,warn:yz},Symbol.toStringTag,{value:"Module"}));function lb(e,t,n,s){aD({type:e,name:t,value:n,unit:s?.unit,attributes:s?.attributes},{scope:s?.scope})}function tE(e,t=1,n){lb("counter",e,t,n)}function nE(e,t,n){lb("gauge",e,t,n)}function rE(e,t,n){lb("distribution",e,t,n)}function s1(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const vu=ct;function Sz(){return"history"in vu&&!!vu.history}function _z(){if(!("fetch"in vu))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function tv(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function wz(){if(typeof EdgeRuntime=="string")return!0;if(!_z())return!1;if(tv(vu.fetch))return!0;let e=!1;const t=vu.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=tv(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){Re&&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 Ez(e){const t="fetch-body-resolved";ci(t,e),li(t,()=>i1(Cz))}function i1(e,t=!1){t&&!wz()||gr(ct,"fetch",function(n){return function(...s){const i=new Error,{method:a,url:l}=Rz(s),f={args:s,fetchData:{method:a,url:l},startTimestamp:cn()*1e3,virtualError:i,headers:Nz(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}),Jh(d)&&d.stack===void 0&&(d.stack=i.stack,Yn(d,"framesToPop",1));const g=gt()?.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 Tz(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 Cz(e){let t;try{t=e.clone()}catch{return}Tz(t,()=>{Hr("fetch-body-resolved",{endTimestamp:cn()*1e3,response:e})})}function eh(e,t){return!!e&&typeof e=="object"&&!!e[t]}function sE(e){return typeof e=="string"?e:e?eh(e,"url")?e.url:e.toString?e.toString():"":""}function Rz(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,s]=e;return{url:sE(n),method:eh(s,"method")?String(s.method).toUpperCase():Hv(n)&&eh(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:sE(t),method:eh(t,"method")?String(t.method).toUpperCase():"GET"}}function Nz(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Hv(t))return new Headers(t.headers)}catch{}}function jz(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Az(){return"npm"}function kz(){return!jz()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Oz(){return typeof window<"u"&&(!kz()||Mz())}function Mz(){return ct.process?.type==="renderer"}const st=ct;let nv=0;function a1(){return nv>0}function Iz(){nv++,setTimeout(()=>{nv--})}function kc(e,t={}){function n(i){return typeof i=="function"}if(!n(e))return e;try{const i=e.__sentry_wrapped__;if(i)return typeof i=="function"?i:e;if(Vv(e))return e}catch{return e}const s=function(...i){try{const a=i.map(l=>kc(l,t));return e.apply(this,a)}catch(a){throw Iz(),Ou(l=>{l.addEventProcessor(f=>(t.mechanism&&(Vy(f,void 0),Cc(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 ub(){const e=Nu(),{referrer:t}=st.document||{},{userAgent:n}=st.navigator||{},s={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:s}}function fb(e,t){const n=db(e,t),s={type:Uz(t),value:$z(t)};return n.length&&(s.stacktrace={frames:n}),s.type===void 0&&s.value===""&&(s.value="Unrecoverable error caught"),s}function Pz(e,t,n,s){const a=gt()?.getOptions().normalizeDepth,l=Vz(t),f={__serialized__:NR(t,a)};if(l)return{exception:{values:[fb(e,l)]},extra:f};const d={exception:{values:[{type:tp(t)?t.constructor.name:s?"UnhandledRejection":"Error",value:Hz(t,{isUnhandledRejection:s})}]},extra:f};if(n){const p=db(e,n);p.length&&(d.exception.values[0].stacktrace={frames:p})}return d}function Vg(e,t){return{exception:{values:[fb(e,t)]}}}function db(e,t){const n=t.stacktrace||t.stack||"",s=zz(t),i=Lz(t);try{return e(n,s,i)}catch{}return[]}const Dz=/Minified React error #\d+;/i;function zz(e){return e&&Dz.test(e.message)?1:0}function Lz(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 Uz(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 $z(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"?Gw(t.error):Gw(e):"No error message"}function Bz(e,t,n,s){const i=n?.syntheticException||void 0,a=hb(e,t,i,s);return Cc(a),a.level="error",n?.event_id&&(a.event_id=n.event_id),Pu(a)}function Fz(e,t,n="info",s,i){const a=s?.syntheticException||void 0,l=rv(e,t,a,i);return l.level=n,s?.event_id&&(l.event_id=s.event_id),Pu(l)}function hb(e,t,n,s,i){let a;if(sR(t)&&t.error)return Vg(e,t.error);if(dw(t)||FM(t)){const l=t;if("stack"in t)a=Vg(e,t);else{const f=l.name||(dw(l)?"DOMError":"DOMException"),d=l.message?`${f}: ${l.message}`:f;a=rv(e,d,n,s),Vy(a,d)}return"code"in l&&(a.tags={...a.tags,"DOMException.code":`${l.code}`}),a}return Jh(t)?Vg(e,t):pu(t)||tp(t)?(a=Pz(e,t,n,i),Cc(a,{synthetic:!0}),a):(a=rv(e,t,n,s),Vy(a,`${t}`),Cc(a,{synthetic:!0}),a)}function rv(e,t,n,s){const i={};if(s&&n){const a=db(e,n);a.length&&(i.exception={values:[{value:t,stacktrace:{frames:a}}]}),Cc(i,{synthetic:!0})}if(ep(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 Hz(e,{isUnhandledRejection:t}){const n=ZM(e),s=t?"promise rejection":"exception";return sR(e)?`Event \`ErrorEvent\` captured as ${s} with message \`${e.message}\``:tp(e)?`Event \`${qz(e)}\` (type=${e.type}) captured as ${s}`:`Object captured as ${s} with keys: ${n}`}function qz(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Vz(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class Kz extends vD{constructor(t){const n=Gz(t),s=st.SENTRY_SDK_SOURCE||Az();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&&rb(this),p&&ob(this))}),i&&this.on("beforeSendSession",kD)}eventFromException(t,n){return Bz(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",s){return Fz(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 Gz(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:st.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const Du=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ge=ct,Zz=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",zu=(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=Zz(t.value,n),e(t)))}},Lu=(e=!0)=>{const t=Ge.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Yc=()=>Lu()?.activationStart??0;function Yo(e,t,n){Ge.document&&Ge.addEventListener(e,t,n)}function vh(e,t,n){Ge.document&&Ge.removeEventListener(e,t,n)}let mc=-1;const l1=new Set,Yz=()=>Ge.document?.visibilityState==="hidden"&&!Ge.document?.prerendering?0:1/0,th=e=>{if(Xz(e)&&mc>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of l1)t();isFinite(mc)||(mc=e.type==="visibilitychange"?e.timeStamp:0,vh("prerenderingchange",th,!0))}},Uu=()=>{if(Ge.document&&mc<0){const e=Yc();mc=(Ge.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??Yz(),Yo("visibilitychange",th,!0),Yo("pagehide",th,!0),Yo("prerenderingchange",th,!0)}return{get firstHiddenTime(){return mc},onHidden(e){l1.add(e)}}};function Xz(e){return e.type==="pagehide"||Ge.document?.visibilityState==="hidden"}const Qz=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,$u=(e,t=-1)=>{const n=Lu();let s="navigate";return n&&(Ge.document?.prerendering||Yc()>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:Qz(),navigationType:s}},Kg=new WeakMap;function pb(e,t){try{return Kg.get(e)||Kg.set(e,new t),Kg.get(e)}catch{return new t}}class bh{constructor(){bh.prototype.__init.call(this),bh.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 Xc=(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{}},mb=e=>{let t=!1;return()=>{t||(e(),t=!0)}},rp=e=>{Ge.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Wz=[1800,3e3],Jz=(e,t={})=>{rp(()=>{const n=Uu(),s=$u("FCP");let i;const l=Xc("paint",f=>{for(const d of f)d.name==="first-contentful-paint"&&(l.disconnect(),d.startTime<n.firstHiddenTime&&(s.value=Math.max(d.startTime-Yc(),0),s.entries.push(d),i(!0)))});l&&(i=zu(e,s,Wz,t.reportAllChanges))})},e2=[.1,.25],t2=(e,t={})=>{Jz(mb(()=>{const n=$u("CLS",0);let s;const i=Uu(),a=pb(t,bh),l=d=>{for(const p of d)a._processEntry(p);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,s())},f=Xc("layout-shift",l);f&&(s=zu(e,n,e2,t.reportAllChanges),i.onHidden(()=>{l(f.takeRecords()),s(!0)}),Ge?.setTimeout?.(s))}))};let u1=0,Gg=1/0,wd=0;const n2=e=>{e.forEach(t=>{t.interactionId&&(Gg=Math.min(Gg,t.interactionId),wd=Math.max(wd,t.interactionId),u1=wd?(wd-Gg)/7+1:0)})};let sv;const f1=()=>sv?u1:performance.interactionCount||0,r2=()=>{"interactionCount"in performance||sv||(sv=Xc("event",n2,{type:"event",buffered:!0,durationThreshold:0}))},Zg=10;let d1=0;const s2=()=>f1()-d1;class xh{constructor(){xh.prototype.__init.call(this),xh.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(s2()/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<Zg||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>Zg){const i=this._longestInteractionList.splice(Zg);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=mb(e),Yo("visibilitychange",e,{once:!0,capture:!0}),Yo("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),vh("visibilitychange",e,{capture:!0}),vh("pagehide",e,{capture:!0})}))},o2=[200,500],i2=40,a2=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Uu();rp(()=>{r2();const s=$u("INP");let i;const a=pb(t,xh),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=Xc("event",l,{durationThreshold:t.durationThreshold??i2});i=zu(e,s,o2,t.reportAllChanges),f&&(f.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{l(f.takeRecords()),i(!0)}))})};class c2{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const l2=[2500,4e3],u2=(e,t={})=>{rp(()=>{const n=Uu(),s=$u("LCP");let i;const a=pb(t,c2),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-Yc(),0),s.entries=[p],i())},f=Xc("largest-contentful-paint",l);if(f){i=zu(e,s,l2,t.reportAllChanges);const d=mb(()=>{l(f.takeRecords()),f.disconnect(),i(!0)}),p=g=>{g.isTrusted&&(h1(d),vh(g.type,p,{capture:!0}))};for(const g of["keydown","click","visibilitychange"])Yo(g,p,{capture:!0})}})},f2=[800,1800],ov=e=>{Ge.document?.prerendering?rp(()=>ov(e)):Ge.document?.readyState!=="complete"?addEventListener("load",()=>ov(e),!0):setTimeout(e)},d2=(e,t={})=>{const n=$u("TTFB"),s=zu(e,n,f2,t.reportAllChanges);ov(()=>{const i=Lu();i&&(n.value=Math.max(i.responseStart-Yc(),0),n.entries=[i],s(!0))})},au={},Sh={};let p1,m1,g1,y1;function v1(e,t=!1){return sp("cls",e,m2,p1,t)}function b1(e,t=!1){return sp("lcp",e,g2,m1,t)}function h2(e){return sp("ttfb",e,y2,g1)}function p2(e){return sp("inp",e,v2,y1)}function Oc(e,t){return x1(e,t),Sh[e]||(b2(e),Sh[e]=!0),S1(e,t)}function Bu(e,t){const n=au[e];if(n?.length)for(const s of n)try{s(t)}catch(i){Du&&be.error(`Error while triggering instrumentation handler.
16
+ Event: ${Ki(e)}.
17
+ Url: ${yh(e)}`),!0}return!1}function qD(e,t){return t?.length?GR(e).some(n=>Ko(n,t)):!1}function VD(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Ko(n,t):!1}function GD(e,t){if(!t?.length)return!1;const n=yh(e);return n?Ko(n,t):!1}function KD(e,t){if(!t?.length)return!0;const n=yh(e);return n?Ko(n,t):!0}function ZD(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 yh(e){try{const n=[...e.exception?.values??[]].reverse().find(s=>s.mechanism?.parent_id===void 0&&s.stacktrace?.frames?.length)?.stacktrace?.frames;return n?ZD(n):null}catch{return Re&&be.error(`Cannot extract url for event ${Ki(e)}`),null}}function YD(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function XD(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=ev(e,t,s,a.originalException,n,i.exception.values,l,0))}function ev(e,t,n,s,i,a,l,f){if(a.length>=n+1)return a;let d=[...a];if(Qs(s[i],Error)){Qw(l,f,s);const p=e(t,s[i]),g=d.length;Ww(p,i,g,f),d=ev(e,t,n,s[i],i,[p,...d],p,g)}return t1(s)&&s.errors.forEach((p,g)=>{if(Qs(p,Error)){Qw(l,f,s);const y=e(t,p),b=d.length;Ww(y,`errors[${g}]`,b,f),d=ev(e,t,n,p,i,[y,...d],y,b)}}),d}function t1(e){return Array.isArray(e.errors)}function Qw(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...t1(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ww(e,t,n,s){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:s}}function QD(e){const t="console";ci(t,e),li(t,WD)}function WD(){"console"in ct&&OM.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 JD(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const e2="Dedupe",t2=(()=>{let e;return{name:e2,processEvent(t){if(t.type)return t;try{if(r2(t,e))return Re&&be.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),n2=t2;function r2(e,t){return t?!!(s2(e,t)||o2(e,t)):!1}function s2(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 o2(e,t){const n=Jw(t),s=Jw(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 Jw(e){return e.exception?.values?.[0]}const i2="ConversationId",a2=(()=>({name:i2,setup(e){e.on("spanStart",t=>{const n=bt().getScopeData(),s=ss().getScopeData(),i=n.conversationId||s.conversationId;i&&t.setAttribute(hI,i)})}})),c2=a2;function l2(e,t,n,s,i){if(!e.fetchData)return;const{method:a,url:l}=e.fetchData,f=rs()&&t(l);if(e.endTimestamp&&f){const x=e.fetchData.__span;if(!x)return;const S=s[x];S&&(d2(S,e),u2(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?Kc(p2(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=f2(x,S,rs()&&g?y:void 0,p);w&&(e.args[1]=S,S.headers=w)}const b=gt();if(b){const x={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};b.emit("beforeOutgoingRequestSpan",y,x)}return y}function u2(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function f2(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||(Hv(e)?e.headers:void 0);if(d)if(h2(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 d2(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(Yv))}function h2(e){return typeof Headers<"u"&&Qs(e,Headers)}function p2(e,t,n){if(e.startsWith("data:")){const a=Zo(e);return{name:`${t} ${a}`,attributes:eE(e,void 0,t,n)}}const s=WR(e),i=s?ND(s):e;return{name:`${t} ${i}`,attributes:eE(e,s,t,n)}}function eE(e,t,n,s){const i={url:Zo(e),type:"fetch","http.method":n,[gn]:s,[eo]:"http.client"};return t&&(QR(t)||(i["http.url"]=Zo(t.href),i["server.address"]=t.host),t.search&&(i["http.query"]=t.search),t.hash&&(i["http.fragment"]=t.hash)),i}function Zc(e,t,n,s,i){tD({level:e,message:t,attributes:n,severityNumber:i},s)}function m2(e,t,{scope:n}={}){Zc("trace",e,t,n)}function g2(e,t,{scope:n}={}){Zc("debug",e,t,n)}function y2(e,t,{scope:n}={}){Zc("info",e,t,n)}function v2(e,t,{scope:n}={}){Zc("warn",e,t,n)}function b2(e,t,{scope:n}={}){Zc("error",e,t,n)}function x2(e,t,{scope:n}={}){Zc("fatal",e,t,n)}const S2=Object.freeze(Object.defineProperty({__proto__:null,debug:g2,error:b2,fatal:x2,fmt:kD,info:y2,trace:m2,warn:v2},Symbol.toStringTag,{value:"Module"}));function lb(e,t,n,s){cD({type:e,name:t,value:n,unit:s?.unit,attributes:s?.attributes},{scope:s?.scope})}function tE(e,t=1,n){lb("counter",e,t,n)}function nE(e,t,n){lb("gauge",e,t,n)}function rE(e,t,n){lb("distribution",e,t,n)}function s1(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const vu=ct;function _2(){return"history"in vu&&!!vu.history}function w2(){if(!("fetch"in vu))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function tv(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function E2(){if(typeof EdgeRuntime=="string")return!0;if(!w2())return!1;if(tv(vu.fetch))return!0;let e=!1;const t=vu.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=tv(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){Re&&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 T2(e){const t="fetch-body-resolved";ci(t,e),li(t,()=>i1(R2))}function i1(e,t=!1){t&&!E2()||gr(ct,"fetch",function(n){return function(...s){const i=new Error,{method:a,url:l}=N2(s),f={args:s,fetchData:{method:a,url:l},startTimestamp:cn()*1e3,virtualError:i,headers:j2(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}),Jh(d)&&d.stack===void 0&&(d.stack=i.stack,Yn(d,"framesToPop",1));const g=gt()?.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 C2(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 R2(e){let t;try{t=e.clone()}catch{return}C2(t,()=>{Hr("fetch-body-resolved",{endTimestamp:cn()*1e3,response:e})})}function eh(e,t){return!!e&&typeof e=="object"&&!!e[t]}function sE(e){return typeof e=="string"?e:e?eh(e,"url")?e.url:e.toString?e.toString():"":""}function N2(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,s]=e;return{url:sE(n),method:eh(s,"method")?String(s.method).toUpperCase():Hv(n)&&eh(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:sE(t),method:eh(t,"method")?String(t.method).toUpperCase():"GET"}}function j2(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Hv(t))return new Headers(t.headers)}catch{}}function A2(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function k2(){return"npm"}function O2(){return!A2()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function M2(){return typeof window<"u"&&(!O2()||I2())}function I2(){return ct.process?.type==="renderer"}const st=ct;let nv=0;function a1(){return nv>0}function P2(){nv++,setTimeout(()=>{nv--})}function kc(e,t={}){function n(i){return typeof i=="function"}if(!n(e))return e;try{const i=e.__sentry_wrapped__;if(i)return typeof i=="function"?i:e;if(Vv(e))return e}catch{return e}const s=function(...i){try{const a=i.map(l=>kc(l,t));return e.apply(this,a)}catch(a){throw P2(),Ou(l=>{l.addEventProcessor(f=>(t.mechanism&&(Vy(f,void 0),Cc(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 ub(){const e=Nu(),{referrer:t}=st.document||{},{userAgent:n}=st.navigator||{},s={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:s}}function fb(e,t){const n=db(e,t),s={type:$2(t),value:B2(t)};return n.length&&(s.stacktrace={frames:n}),s.type===void 0&&s.value===""&&(s.value="Unrecoverable error caught"),s}function D2(e,t,n,s){const a=gt()?.getOptions().normalizeDepth,l=G2(t),f={__serialized__:NR(t,a)};if(l)return{exception:{values:[fb(e,l)]},extra:f};const d={exception:{values:[{type:tp(t)?t.constructor.name:s?"UnhandledRejection":"Error",value:q2(t,{isUnhandledRejection:s})}]},extra:f};if(n){const p=db(e,n);p.length&&(d.exception.values[0].stacktrace={frames:p})}return d}function Vg(e,t){return{exception:{values:[fb(e,t)]}}}function db(e,t){const n=t.stacktrace||t.stack||"",s=L2(t),i=U2(t);try{return e(n,s,i)}catch{}return[]}const z2=/Minified React error #\d+;/i;function L2(e){return e&&z2.test(e.message)?1:0}function U2(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 $2(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 B2(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 F2(e,t,n,s){const i=n?.syntheticException||void 0,a=hb(e,t,i,s);return Cc(a),a.level="error",n?.event_id&&(a.event_id=n.event_id),Pu(a)}function H2(e,t,n="info",s,i){const a=s?.syntheticException||void 0,l=rv(e,t,a,i);return l.level=n,s?.event_id&&(l.event_id=s.event_id),Pu(l)}function hb(e,t,n,s,i){let a;if(sR(t)&&t.error)return Vg(e,t.error);if(dw(t)||HM(t)){const l=t;if("stack"in t)a=Vg(e,t);else{const f=l.name||(dw(l)?"DOMError":"DOMException"),d=l.message?`${f}: ${l.message}`:f;a=rv(e,d,n,s),Vy(a,d)}return"code"in l&&(a.tags={...a.tags,"DOMException.code":`${l.code}`}),a}return Jh(t)?Vg(e,t):pu(t)||tp(t)?(a=D2(e,t,n,i),Cc(a,{synthetic:!0}),a):(a=rv(e,t,n,s),Vy(a,`${t}`),Cc(a,{synthetic:!0}),a)}function rv(e,t,n,s){const i={};if(s&&n){const a=db(e,n);a.length&&(i.exception={values:[{value:t,stacktrace:{frames:a}}]}),Cc(i,{synthetic:!0})}if(ep(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 q2(e,{isUnhandledRejection:t}){const n=YM(e),s=t?"promise rejection":"exception";return sR(e)?`Event \`ErrorEvent\` captured as ${s} with message \`${e.message}\``:tp(e)?`Event \`${V2(e)}\` (type=${e.type}) captured as ${s}`:`Object captured as ${s} with keys: ${n}`}function V2(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function G2(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class K2 extends bD{constructor(t){const n=Z2(t),s=st.SENTRY_SDK_SOURCE||k2();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&&rb(this),p&&ob(this))}),i&&this.on("beforeSendSession",OD)}eventFromException(t,n){return F2(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",s){return H2(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 Z2(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:st.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const Du=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ke=ct,Y2=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",zu=(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=Y2(t.value,n),e(t)))}},Lu=(e=!0)=>{const t=Ke.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Yc=()=>Lu()?.activationStart??0;function Yo(e,t,n){Ke.document&&Ke.addEventListener(e,t,n)}function vh(e,t,n){Ke.document&&Ke.removeEventListener(e,t,n)}let mc=-1;const l1=new Set,X2=()=>Ke.document?.visibilityState==="hidden"&&!Ke.document?.prerendering?0:1/0,th=e=>{if(Q2(e)&&mc>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of l1)t();isFinite(mc)||(mc=e.type==="visibilitychange"?e.timeStamp:0,vh("prerenderingchange",th,!0))}},Uu=()=>{if(Ke.document&&mc<0){const e=Yc();mc=(Ke.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??X2(),Yo("visibilitychange",th,!0),Yo("pagehide",th,!0),Yo("prerenderingchange",th,!0)}return{get firstHiddenTime(){return mc},onHidden(e){l1.add(e)}}};function Q2(e){return e.type==="pagehide"||Ke.document?.visibilityState==="hidden"}const W2=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,$u=(e,t=-1)=>{const n=Lu();let s="navigate";return n&&(Ke.document?.prerendering||Yc()>0?s="prerender":Ke.document?.wasDiscarded?s="restore":n.type&&(s=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:W2(),navigationType:s}},Gg=new WeakMap;function pb(e,t){try{return Gg.get(e)||Gg.set(e,new t),Gg.get(e)}catch{return new t}}class bh{constructor(){bh.prototype.__init.call(this),bh.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 Xc=(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{}},mb=e=>{let t=!1;return()=>{t||(e(),t=!0)}},rp=e=>{Ke.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},J2=[1800,3e3],ez=(e,t={})=>{rp(()=>{const n=Uu(),s=$u("FCP");let i;const l=Xc("paint",f=>{for(const d of f)d.name==="first-contentful-paint"&&(l.disconnect(),d.startTime<n.firstHiddenTime&&(s.value=Math.max(d.startTime-Yc(),0),s.entries.push(d),i(!0)))});l&&(i=zu(e,s,J2,t.reportAllChanges))})},tz=[.1,.25],nz=(e,t={})=>{ez(mb(()=>{const n=$u("CLS",0);let s;const i=Uu(),a=pb(t,bh),l=d=>{for(const p of d)a._processEntry(p);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,s())},f=Xc("layout-shift",l);f&&(s=zu(e,n,tz,t.reportAllChanges),i.onHidden(()=>{l(f.takeRecords()),s(!0)}),Ke?.setTimeout?.(s))}))};let u1=0,Kg=1/0,wd=0;const rz=e=>{e.forEach(t=>{t.interactionId&&(Kg=Math.min(Kg,t.interactionId),wd=Math.max(wd,t.interactionId),u1=wd?(wd-Kg)/7+1:0)})};let sv;const f1=()=>sv?u1:performance.interactionCount||0,sz=()=>{"interactionCount"in performance||sv||(sv=Xc("event",rz,{type:"event",buffered:!0,durationThreshold:0}))},Zg=10;let d1=0;const oz=()=>f1()-d1;class xh{constructor(){xh.prototype.__init.call(this),xh.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(oz()/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<Zg||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>Zg){const i=this._longestInteractionList.splice(Zg);for(const a of i)this._longestInteractionMap.delete(a.id)}this._onAfterProcessingINPCandidate?.(s)}}}const h1=e=>{const t=Ke.requestIdleCallback||Ke.setTimeout;Ke.document?.visibilityState==="hidden"?e():(e=mb(e),Yo("visibilitychange",e,{once:!0,capture:!0}),Yo("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),vh("visibilitychange",e,{capture:!0}),vh("pagehide",e,{capture:!0})}))},iz=[200,500],az=40,cz=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Uu();rp(()=>{sz();const s=$u("INP");let i;const a=pb(t,xh),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=Xc("event",l,{durationThreshold:t.durationThreshold??az});i=zu(e,s,iz,t.reportAllChanges),f&&(f.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{l(f.takeRecords()),i(!0)}))})};class lz{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const uz=[2500,4e3],fz=(e,t={})=>{rp(()=>{const n=Uu(),s=$u("LCP");let i;const a=pb(t,lz),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-Yc(),0),s.entries=[p],i())},f=Xc("largest-contentful-paint",l);if(f){i=zu(e,s,uz,t.reportAllChanges);const d=mb(()=>{l(f.takeRecords()),f.disconnect(),i(!0)}),p=g=>{g.isTrusted&&(h1(d),vh(g.type,p,{capture:!0}))};for(const g of["keydown","click","visibilitychange"])Yo(g,p,{capture:!0})}})},dz=[800,1800],ov=e=>{Ke.document?.prerendering?rp(()=>ov(e)):Ke.document?.readyState!=="complete"?addEventListener("load",()=>ov(e),!0):setTimeout(e)},hz=(e,t={})=>{const n=$u("TTFB"),s=zu(e,n,dz,t.reportAllChanges);ov(()=>{const i=Lu();i&&(n.value=Math.max(i.responseStart-Yc(),0),n.entries=[i],s(!0))})},au={},Sh={};let p1,m1,g1,y1;function v1(e,t=!1){return sp("cls",e,gz,p1,t)}function b1(e,t=!1){return sp("lcp",e,yz,m1,t)}function pz(e){return sp("ttfb",e,vz,g1)}function mz(e){return sp("inp",e,bz,y1)}function Oc(e,t){return x1(e,t),Sh[e]||(xz(e),Sh[e]=!0),S1(e,t)}function Bu(e,t){const n=au[e];if(n?.length)for(const s of n)try{s(t)}catch(i){Du&&be.error(`Error while triggering instrumentation handler.
18
18
  Type: ${e}
19
19
  Name: ${Xs(s)}
20
- Error:`,i)}}function m2(){return t2(e=>{Bu("cls",{metric:e}),p1=e},{reportAllChanges:!0})}function g2(){return u2(e=>{Bu("lcp",{metric:e}),m1=e},{reportAllChanges:!0})}function y2(){return d2(e=>{Bu("ttfb",{metric:e}),g1=e})}function v2(){return a2(e=>{Bu("inp",{metric:e}),y1=e})}function sp(e,t,n,s,i=!1){x1(e,t);let a;return Sh[e]||(a=n(),Sh[e]=!0),s&&t({metric:s}),S1(e,t,i?a:void 0)}function b2(e){const t={};e==="event"&&(t.durationThreshold=0),Xc(e,n=>{Bu(e,{entries:n})},t)}function x1(e,t){au[e]=au[e]||[],au[e].push(t)}function S1(e,t,n){return()=>{n&&n();const s=au[e];if(!s)return;const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}function x2(e){return"duration"in e}const S2=e=>{const t=n=>{(n.type==="pagehide"||Ge.document?.visibilityState==="hidden")&&e(n)};Yo("visibilitychange",t,{capture:!0,once:!0}),Yo("pagehide",t,{capture:!0,once:!0})};function Yg(e){return typeof e=="number"&&isFinite(e)}function ti(e,t,n,{...s}){const i=mt(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Jv(e,()=>{const a=Gc({startTime:t,...s});return a&&a.end(n),a})}function gb(e){const t=gt();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 Gc({name:n,attributes:w,startTime:a,experimental:{standalone:!0}})}function Fu(){return Ge.addEventListener&&Ge.performance}function Xt(e){return e/1e3}function _2(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}S2(()=>{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 w2(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)=>{E2(t,n,a,i),s()})}function E2(e,t,n,s){Du&&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={[mn]:"auto.http.browser.cls",[eo]:"ui.webvital.cls",[Vc]: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=gb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("cls",{[Mu]:"",[Iu]:e}),d.end(i))}function T2(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)=>{C2(t,n,a,i),s()})}function C2(e,t,n,s){Du&&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={[mn]:"auto.http.browser.lcp",[eo]:"ui.webvital.lcp",[Vc]: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=gb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("lcp",{[Mu]:"millisecond",[Iu]: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}=_2(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=n}return Sr()||Fu()?.timeOrigin?R2({...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 R2(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const N2=2147483647;let oE=0,ts={},Kn,_h;function j2({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const s=Fu();if(s&&Sr()){s.mark&&Ge.performance.mark("sentry-tracing-init");const i=t?T2(n):I2(),a=P2(),l=e?w2(n):M2();return()=>{i?.(),a(),l?.()}}return()=>{}}function A2(){Oc("longtask",({entries:e})=>{const t=Xn();if(!t)return;const{op:n,start_timestamp:s}=mt(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:{[mn]:"auto.ui.browser.metrics"}})}})}function k2(){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}=mt(n);if(l==="navigation"&&a&&i<a)continue;const f=Xt(s.duration),d={[mn]:"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 O2(){Oc("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:{[mn]:"auto.ui.browser.metrics"}},l=iR(n.target);l&&(a.attributes["ui.component_name"]=l),ti(t,s,s+i,a)}}})}function M2(){return v1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ts.cls={value:e.value,unit:""},_h=t)},!0)}function I2(){return b1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ts.lcp={value:e.value,unit:"millisecond"},Kn=t)},!0)}function P2(){return h2(({metric:e})=>{e.entries[e.entries.length-1]&&(ts.ttfb={value:e.value,unit:"millisecond"})})}function D2(e,t){const n=Fu(),s=Sr();if(!n?.getEntries||!s)return;const i=Xt(s),a=n.getEntries(),{op:l,start_timestamp:f}=mt(e);a.slice(oE).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":{$2(e,d,i);break}case"mark":case"paint":case"measure":{L2(e,d,p,g,i,t.ignorePerformanceApiSpans);const y=Uu(),b=d.startTime<y.firstHiddenTime;d.name==="first-paint"&&b&&(ts.fp={value:d.startTime,unit:"millisecond"}),d.name==="first-contentful-paint"&&b&&(ts.fcp={value:d.startTime,unit:"millisecond"});break}case"resource":{H2(e,d,d.name,p,g,i,t.ignoreResourceSpans);break}}}),oE=Math.max(a.length-1,0),q2(e),l==="pageload"&&(G2(ts),t.recordClsOnPageloadSpan||delete ts.cls,t.recordLcpOnPageloadSpan||delete ts.lcp,Object.entries(ts).forEach(([d,p])=>{cP(d,p.value,p.unit)}),e.setAttribute("performance.timeOrigin",i),e.setAttribute("performance.activationStart",Yc()),V2(e,t)),Kn=void 0,_h=void 0,ts={}}function z2(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function L2(e,t,n,s,i,a){if(z2(t)||["mark","measure"].includes(t.entryType)&&Go(t.name,a))return;const l=Lu(!1),f=Xt(l?l.requestStart:0),d=i+Math.max(n,f),p=i+n,g=p+s,y={[mn]:"auto.resource.browser.metrics"};d!==p&&(y["sentry.browser.measure_happened_before_request"]=!0,y["sentry.browser.measure_start_time"]=d),U2(y,t),d<=g&&ti(e,d,g,{name:t.name,op:t.entryType,attributes:y})}function U2(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[s,i]of Object.entries(n))if(i&&Tc(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(Tc(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function $2(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"),F2(e,t,n)}function Ed(e,t,n,s,i=n){const a=B2(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:{[mn]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function B2(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function F2(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:{[mn]:"auto.ui.browser.metrics"}}),ti(e,a,i,{op:"browser.response",name:t.name,attributes:{[mn]:"auto.ui.browser.metrics"}}))}function H2(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={[mn]:"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),K2(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 q2(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),Yg(n.rtt)&&(ts["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Yg(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Yg(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function V2(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)),_h?.sources&&t.recordClsOnPageloadSpan&&_h.sources.forEach((n,s)=>e.setAttribute(`cls.source.${s+1}`,Vr(n.node)))}function K2(e,t,n){n.forEach(([s,i])=>{const a=e[s];a!=null&&(typeof a=="number"&&a<N2||typeof a=="string")&&(t[i]=a)})}function G2(e){const t=Lu(!1);if(!t)return;const{responseStart:n,requestStart:s}=t;s<=n&&(e["ttfb.requestTime"]={value:n-s,unit:"millisecond"})}function Z2(){return Fu()&&Sr()?Oc("element",Y2):()=>{}}const Y2=({entries:e})=>{const t=Xn(),n=t?Dn(t):void 0,s=n?mt(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={[mn]:"auto.ui.browser.elementtiming",[eo]:"ui.elementtiming",[ys]:"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)})})},X2=1e3;let iE,iv,av;function Q2(e){ci("dom",e),li("dom",W2)}function W2(){if(!Ge.document)return;const e=Hr.bind(null,"dom"),t=aE(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=aE(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 J2(e){if(e.type!==iv)return!1;try{if(!e.target||e.target._sentryId!==av)return!1}catch{}return!0}function eL(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function aE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const s=tL(n);if(eL(n.type,s))return;Yn(n,"_sentryCaptured",!0),s&&!s._sentryId&&Yn(s,"_sentryId",qr());const i=n.type==="keypress"?"input":n.type;J2(n)||(e({event:n,name:i,global:t}),iv=n.type,av=s?s._sentryId:void 0),clearTimeout(iE),iE=Ge.setTimeout(()=>{av=void 0,iv=void 0},X2)}}function tL(e){try{return e.target}catch{return null}}let Td;function yb(e){const t="history";ci(t,e),li(t,nL)}function nL(){if(Ge.addEventListener("popstate",()=>{const t=Ge.location.href,n=Td;if(Td=t,n===t)return;Hr("history",{from:n,to:t})}),!Sz())return;function e(t){return function(...n){const s=n.length>2?n[2]:void 0;if(s){const i=Td,a=rL(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 rL(e){try{return new URL(e,Ge.location.origin).toString()}catch{return e}}const nh={};function sL(e){const t=nh[e];if(t)return t;let n=Ge[e];if(tv(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){Du&&be.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n&&(nh[e]=n.bind(Ge))}function oL(e){nh[e]=void 0}const uc="__sentry_xhr_v3__";function T1(e){ci("xhr",e),li("xhr",iL)}function iL(){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=aL(s[1]);if(!l||!f)return t.apply(n,s);n[uc]={method:l,url:f,request_headers:{}},l==="POST"&&f.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const d=()=>{const p=n[uc];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[uc];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[uc];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 aL(e){if(Gs(e))return e;try{return e.toString()}catch{}}function cL(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Du&&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 Xg=[],rh=new Map,cc=new Map,lL=60;function uL(){if(Fu()&&Sr()){const t=fL();return()=>{t()}}return()=>{}}const cv={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 fL(){return p2(dL)}const dL=({metric:e})=>{if(e.value==null)return;const t=Xt(e.value);if(t>lL)return;const n=e.entries.find(S=>S.duration===e.value&&cv[S.name]);if(!n)return;const{interactionId:s}=n,i=cv[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?mt(p).description:bt().getScopeData().transactionName,y=d?.elementName||Vr(n.target),b={[mn]:"auto.http.browser.inp",[eo]:`ui.interaction.${i}`,[Vc]:n.duration},x=gb({name:y,transaction:g,attributes:b,startTime:a});x&&(x.addEvent("inp",{[Mu]:"millisecond",[Iu]:e.value}),x.end(a+t))};function hL(){const e=Object.keys(cv);Oz()&&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(!x2(f))return;const d=f.interactionId;if(d==null||rh.has(d))return;const p=f.target?Vr(f.target):n(f);if(Xg.length>10){const g=Xg.shift();rh.delete(g)}Xg.push(d),rh.set(d,{span:l,elementName:p})})};Oc("event",s),Oc("first-input",s)}const pL=40;function mL(e,t=sL("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 oL("fetch"),d}finally{n-=l,s--}}return hD(e,i,cb(e.bufferSize||pL))}const Kr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,gL=30,yL=50;function lv(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 vL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,bL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xL=/\((\S*)(?::(\d+))(?::(\d+))\)/,SL=/at (.+?) ?\(data:(.+?),/,_L=e=>{const t=e.match(SL);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=vL.exec(e);if(n){const[,i,a,l]=n;return lv(i,oa,+a,+l)}const s=bL.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){const f=xL.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 lv(l,a,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},wL=[gL,_L],EL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,TL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,CL=e=>{const t=EL.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const a=TL.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),lv(s,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},RL=[yL,CL],NL=[wL,RL],jL=JC(...NL),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,AL="Breadcrumbs",kL=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:AL,setup(n){t.console&&XD(PL(n)),t.dom&&Q2(IL(n,t.dom)),t.xhr&&T1(DL(n)),t.fetch&&o1(zL(n)),t.history&&yb(LL(n)),t.sentry&&n.on("beforeSendEvent",ML(n))}}}),OL=kL;function ML(e){return function(n){gt()===e&&ia({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Gi(n)},{event:n})}}function IL(e,t){return function(s){if(gt()!==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=UL(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 PL(e){return function(n){if(gt()!==e)return;const s={category:"console",data:{arguments:n.args,logger:"console"},level:WD(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 DL(e){return function(n){if(gt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n,a=n.xhr[uc];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 zL(e){return function(n){if(gt()!==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 LL(e){return function(n){if(gt()!==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 UL(e){return!!e&&!!e.target}const $L=["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"],BL="BrowserApiErrors",FL=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:BL,setupOnce(){t.setTimeout&&gr(st,"setTimeout",cE),t.setInterval&&gr(st,"setInterval",cE),t.requestAnimationFrame&&gr(st,"requestAnimationFrame",qL),t.XMLHttpRequest&&"XMLHttpRequest"in st&&gr(XMLHttpRequest.prototype,"send",VL);const n=t.eventTarget;n&&(Array.isArray(n)?n:$L).forEach(i=>KL(i,t))}}}),HL=FL;function cE(e){return function(...t){const n=t[0];return t[0]=kc(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Xs(e)}`}}),e.apply(this,t)}}function qL(e){return function(t){return e.apply(this,[kc(t,{mechanism:{data:{handler:Xs(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function VL(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=Vv(a);return f&&(l.mechanism.data.handler=Xs(f)),kc(a,l)})}),e.apply(this,t)}}function KL(e,t){const s=st[e]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(gr(s,"addEventListener",function(i){return function(a,l,f){try{GL(l)&&(l.handleEvent=kc(l.handleEvent,{mechanism:{data:{handler:Xs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&ZL(this,a,l),i.apply(this,[a,kc(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 GL(e){return typeof e.handleEvent=="function"}function ZL(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const YL=(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}),zw(),t==="route"&&yb(({from:n,to:s})=>{n!==void 0&&n!==s&&(Dw({ignoreDuration:!0}),zw())})}}},XL="CultureContext",QL=(()=>({name:XL,preprocessEvent(e){const t=JL();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})),WL=QL;function JL(){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 e4="GlobalHandlers",t4=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:e4,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(r4(n),lE("onerror")),t.onunhandledrejection&&(s4(n),lE("onunhandledrejection"))}}}),n4=t4;function r4(e){tR(t=>{const{stackParser:n,attachStacktrace:s}=R1();if(gt()!==e||a1())return;const{msg:i,url:a,line:l,column:f,error:d}=t,p=a4(hb(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 s4(e){nR(t=>{const{stackParser:n,attachStacktrace:s}=R1();if(gt()!==e||a1())return;const i=o4(t),a=Tc(i)?i4(i):hb(n,i,void 0,s,!0);a.level="error",zR(a,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function o4(e){if(Tc(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 i4(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function a4(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=c4(t)??Nu();return d.length===0&&d.push({colno:p,filename:y,function:oa,in_app:!0,lineno:g}),e}function lE(e){Kr&&be.log(`Global Handler attached: ${e}`)}function R1(){return gt()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function c4(e){if(!(!Gs(e)||e.length===0))return e.startsWith("data:")?`<${Zo(e,!1)}>`:e}const l4=()=>({name:"HttpContext",preprocessEvent(e){if(!st.navigator&&!st.location&&!st.document)return;const t=ub(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),u4="cause",f4=5,d4="LinkedErrors",h4=((e={})=>{const t=e.limit||f4,n=e.key||u4;return{name:d4,preprocessEvent(s,i,a){const l=a.getOptions();YD(fb,l.stackParser,n,t,s,i)}}}),p4=h4;function m4(){return g4()?(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 g4(){if(typeof st.window>"u")return!1;const e=st;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=Nu(),s=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(st===st.top&&s.some(a=>n.startsWith(`${a}://`)))}function y4(e){return[BD(),zD(),az(),HL(),OL(),n4(),p4(),tz(),l4(),WL(),YL()]}function v4(e={}){const t=!e.skipBrowserExtensionCheck&&m4();let n=e.defaultIntegrations==null?y4():e.defaultIntegrations;const s={...e,enabled:t?!1:e.enabled,stackParser:LM(e.stackParser||jL),integrations:qP({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||mL};return ED(Kz,s)}function b4(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 x4(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 uE=new WeakMap,Qg=new Map,A1={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function S4(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=>_4(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=Qg.get(w.span_id);T&&(w.timestamp=T/1e3,Qg.delete(w.span_id))}}),S)),i&&Ez(S=>{if(S.response){const w=uE.get(S.response);w&&S.endTimestamp&&Qg.set(w,S.endTimestamp)}}),o1(S=>{const w=cz(S,g,y,b,{propagateTraceparent:x,onRequestSpanEnd:p});if(S.response&&S.fetchData.__span&&uE.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?Zo(T):void 0,"server.address":C}),l&&fE(w),d?.(w,{headers:S.headers})}})),s&&T1(S=>{const w=w4(S,g,y,b,x,p);w&&(l&&fE(w),d?.(w,{headers:j1(S.xhr.__sentry_xhr_v3__?.request_headers)}))})}function fE(e){const{url:t}=mt(e).data;if(!t||typeof t!="string")return;const n=Oc("resource",({entries:s})=>{s.forEach(i=>{x4(i)&&i.name.endsWith(t)&&(e.setAttributes(E1(i)),setTimeout(n))})})}function _4(e,t){const n=Nu();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?Go(s.toString(),t)||a&&Go(s.pathname,t):a}else{const s=!!e.match(/^\/(?!\/)/);return t?Go(e,t):s}}function w4(e,t,n,s,i,a){const l=e.xhr,f=l?.[uc];if(!l||l.__sentry_own_request__||!f)return;const{url:d,method:p}=f,g=rs()&&t(d);if(e.endTimestamp&&g){const C=l.__sentry_xhr_span_id__;if(!C)return;const O=s[C];O&&f.status_code!==void 0&&(hR(O,f.status_code),O.end(),a?.(O,{headers:j1(cL(l)),error:e.error}),delete s[C]);return}const y=N1(d),b=na(y||d),x=Zo(ND(d)),S=!!Xn(),w=g&&S?Gc({name:`${p} ${x}`,attributes:{url:Zo(d),type:"xhr","http.method":p,"http.url":y?Zo(y):void 0,"server.address":b?.host,[mn]:"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)&&E4(l,rs()&&S?w:void 0,i);const T=gt();return T&&T.emit("beforeOutgoingRequestSpan",w,e),w}function E4(e,t,n){const{"sentry-trace":s,baggage:i,traceparent:a}=e1({span:t,propagateTraceparent:n});s&&T4(e,s,i,a)}function T4(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||!b4(a))&&e.setRequestHeader("baggage",n)}}catch{}}function C4(){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}=mt(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 R4=3600,k1="sentry_previous_trace",N4="sentry.previous_trace";function j4(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const s=t==="session-storage";let i=s?O4():void 0;e.on("spanStart",l=>{if(Dn(l)!==l)return;const f=bt().getPropagationContext();i=A4(i,l,f),s&&k4(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(uv(i.spanContext))},sampleRand:i.sampleRand}),l.parentSampled=uv(i.spanContext),l.parentSampleRate=i.sampleRate,l.spanAttributes={...l.spanAttributes,[dR]:i.sampleRate}})}function A4(e,t,n){const s=mt(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(s.data?.[Kv])}catch{return 0}}const a={spanContext:t.spanContext(),startTimestamp:s.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;const l=e.spanContext;return l.traceId===s.trace_id?e:(Date.now()/1e3-e.startTimestamp<=R4&&(Kr&&be.log(`Adding previous_trace \`${JSON.stringify(l)}\` link to span \`${JSON.stringify({op:s.op,...t.spanContext()})}\``),t.addLink({context:l,attributes:{[fI]:"previous_trace"}}),t.setAttribute(N4,`${l.traceId}-${l.spanId}-${uv(l)?1:0}`)),a)}function k4(e){try{st.sessionStorage.setItem(k1,JSON.stringify(e))}catch(t){Kr&&be.warn("Could not store previous trace in sessionStorage",t)}}function O4(){try{const e=st.sessionStorage?.getItem(k1);return JSON.parse(e)}catch{return}}function uv(e){return e.traceFlags===1}const M4="BrowserTracing",I4={...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},P4=((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:z,instrumentNavigation:j,detectRedirects:A,linkPreviousTrace:P,consistentTraceSampling:Q,enableReportPageLoaded:B,onRequestSpanStart:U,onRequestSpanEnd:Z}={...I4,...e};let K,ee,D;function G(q,V,L=!0){const I=V.op==="pageload",H=V.name,W=g?g(V):V,Y=W.attributes||{};if(H!==W.name&&(Y[ys]="custom",W.attributes=Y),!L){const fe=ma();Gc({...W,startTime:fe}).end(fe);return}t.name=W.name,t.source=Y[ys];const ae=PR(W,{idleTimeout:y,finalTimeout:b,childSpanTimeout:x,disableAutoFinish:I,beforeSpanEnd:fe=>{K?.(),D2(fe,{recordClsOnPageloadSpan:!d,recordLcpOnPageloadSpan:!p,ignoreResourceSpans:R,ignorePerformanceApiSpans:M}),pE(q,void 0);const Se=bt(),pe=Se.getPropagationContext();Se.setPropagationContext({...pe,traceId:ae.spanContext().traceId,sampled:ui(ae),dsc:to(fe)}),I&&(D=void 0)},trimIdleSpanEndTimestamp:!B});I&&B&&(D=ae),pE(q,ae);function se(){n&&["interactive","complete"].includes(n.readyState)&&q.emit("idleSpanEnableAutoFinish",ae)}I&&!B&&n&&(n.addEventListener("readystatechange",()=>{se()}),se())}return{name:M4,setup(q){if($I(),K=j2({recordClsStandaloneSpans:d||!1,recordLcpStandaloneSpans:p||!1,client:q}),s&&uL(),i&&Z2(),l&&ct.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?k2():a&&A2(),f&&O2(),A&&n){const L=()=>{ee=cn()};addEventListener("click",L,{capture:!0}),addEventListener("keydown",L,{capture:!0,passive:!0})}function V(){const L=bu(q);L&&!mt(L).timestamp&&(Kr&&be.log(`[Tracing] Finishing current active span with op: ${mt(L).op}`),L.setAttribute(mu,"cancelled"),L.end())}q.on("startNavigationSpan",(L,I)=>{if(gt()!==q)return;if(I?.isRedirect){Kr&&be.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),G(q,{op:"navigation.redirect",...L},!1);return}ee=void 0,V(),ss().setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:rs()?void 0:Zs()});const H=bt();H.setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:rs()?void 0:Zs()}),H.setSDKProcessingMetadata({normalizedRequest:void 0}),G(q,{op:"navigation",...L,parentSpan:null,forceTransaction:!0})}),q.on("startPageLoadSpan",(L,I={})=>{if(gt()!==q)return;V();const H=I.sentryTrace||dE("sentry-trace")||hE("sentry-trace"),W=I.baggage||dE("baggage")||hE("baggage"),Y=OI(H,W),ae=bt();ae.setPropagationContext(Y),rs()||(ae.getPropagationContext().propagationSpanId=Zs()),ae.setSDKProcessingMetadata({normalizedRequest:ub()}),G(q,{op:"pageload",...L})}),q.on("endPageloadSpan",()=>{B&&D&&(D.setAttribute(mu,"reportPageLoaded"),D.end())})},afterAllSetup(q){let V=Nu();if(P!=="off"&&j4(q,{linkPreviousTrace:P,consistentTraceSampling:Q}),st.location){if(z){const L=Sr();D4(q,{name:st.location.pathname,startTime:L?L/1e3:void 0,attributes:{[ys]:"url",[mn]:"auto.pageload.browser"}})}j&&yb(({to:L,from:I})=>{if(I===void 0&&V?.indexOf(L)!==-1){V=void 0;return}V=void 0;const H=WR(L),W=bu(q),Y=W&&A&&U4(W,ee);z4(q,{name:H?.pathname||st.location.pathname,attributes:{[ys]:"url",[mn]:"auto.navigation.browser"}},{url:L,isRedirect:Y})})}S&&C4(),f&&L4(q,y,b,x,t),s&&hL(),S4(q,{traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,tracePropagationTargets:q.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:O,enableHTTPTimings:N,onRequestSpanStart:U,onRequestSpanEnd:Z})}}});function D4(e,t,n){e.emit("startPageLoadSpan",t,n),bt().setTransactionName(t.name);const s=bu(e);return s&&e.emit("afterStartPageLoadSpan",s),s}function z4(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:{...ub(),url:s}}),bu(e)}function dE(e){return st.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function hE(e){return st.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(s=>s.name===e)?.description}function L4(e,t,n,s,i){const a=st.document;let l;const f=()=>{const d="ui.action.click",p=bu(e);if(p){const g=mt(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(mu,"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:{[ys]:i.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:s})};a&&addEventListener("click",f,{capture:!0})}const O1="_sentry_idleSpan";function bu(e){return e[O1]}function pE(e,t){Yn(e,O1,t)}const mE=1.5;function U4(e,t){const n=mt(e),s=ma(),i=n.start_timestamp;return!(s-i>mE||t&&s-t<=mE)}function M1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wg={exports:{}},Ke={};var gE;function $4(){if(gE)return Ke;gE=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 z(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function P(I,H,W){var Y=W.ref;return{$$typeof:e,type:I,key:H,ref:Y!==void 0?Y:null,props:W}}function Q(I,H){return P(I.type,H,I.props)}function B(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function U(I){var H={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(W){return H[W]})}var Z=/\/+/g;function K(I,H){return typeof I=="object"&&I!==null&&I.key!=null?U(""+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(z,z):(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,Y,ae){var se=typeof I;(se==="undefined"||se==="boolean")&&(I=null);var fe=!1;if(I===null)fe=!0;else switch(se){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(I.$$typeof){case e:case t:fe=!0;break;case g:return fe=I._init,D(fe(I._payload),H,W,Y,ae)}}if(fe)return ae=ae(I),fe=Y===""?"."+K(I,0):Y,M(ae)?(W="",fe!=null&&(W=fe.replace(Z,"$&/")+"/"),D(ae,H,W,"",function(Me){return Me})):ae!=null&&(B(ae)&&(ae=Q(ae,W+(ae.key==null||I&&I.key===ae.key?"":(""+ae.key).replace(Z,"$&/")+"/")+fe)),H.push(ae)),1;fe=0;var Se=Y===""?".":Y+":";if(M(I))for(var pe=0;pe<I.length;pe++)Y=I[pe],se=Se+K(Y,pe),fe+=D(Y,H,W,se,ae);else if(pe=x(I),typeof pe=="function")for(I=pe.call(I),pe=0;!(Y=I.next()).done;)Y=Y.value,se=Se+K(Y,pe++),fe+=D(Y,H,W,se,ae);else if(se==="object"){if(typeof I.then=="function")return D(ee(I),H,W,Y,ae);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 fe}function G(I,H,W){if(I==null)return I;var Y=[],ae=0;return D(I,Y,"","",function(se){return H.call(W,se,ae++)}),Y}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)},L={map:G,forEach:function(I,H,W){G(I,function(){H.apply(this,arguments)},W)},count:function(I){var H=0;return G(I,function(){H++}),H},toArray:function(I){return G(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=L,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 Y=w({},I.props),ae=I.key;if(H!=null)for(se in H.key!==void 0&&(ae=""+H.key),H)!A.call(H,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&H.ref===void 0||(Y[se]=H[se]);var se=arguments.length-2;if(se===1)Y.children=W;else if(1<se){for(var fe=Array(se),Se=0;Se<se;Se++)fe[Se]=arguments[Se+2];Y.children=fe}return P(I.type,ae,Y)},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 Y,ae={},se=null;if(H!=null)for(Y in H.key!==void 0&&(se=""+H.key),H)A.call(H,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(ae[Y]=H[Y]);var fe=arguments.length-2;if(fe===1)ae.children=W;else if(1<fe){for(var Se=Array(fe),pe=0;pe<fe;pe++)Se[pe]=arguments[pe+2];ae.children=Se}if(I&&I.defaultProps)for(Y in fe=I.defaultProps,fe)ae[Y]===void 0&&(ae[Y]=fe[Y]);return P(I,se,ae)},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 Y=I(),ae=j.S;ae!==null&&ae(W,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(z,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 yE;function Hu(){return yE||(yE=1,Wg.exports=$4()),Wg.exports}var _=Hu();const Mc=M1(_),I1=AM({__proto__:null,default:Mc},[_]);function B4(e){const t={...e};return JR(t,"react"),DP("react",{version:_.version}),v4(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 gc 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 fv(e,t){return typeof t=="bigint"?t.toString():t}function vb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function bb(e){return e==null}function xb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function F4(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 vE=Symbol("evaluating");function wt(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==vE)return s===void 0&&(s=vE,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 bE(e){return JSON.stringify(e)}function H4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const L1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const q4=vb(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ic(e){if(wh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(wh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function U1(e){return Ic(e)?{...e}:Array.isArray(e)?[...e]:e}const V4=new Set(["string","number","symbol"]);function Pc(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 K4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const G4={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 Z4(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 Y4(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 X4(e,t){if(!Ic(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 Q4(e,t){if(!Ic(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 W4(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 J4(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 e5(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 fc(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 dc(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 Sb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function xu(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const $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,fv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},B1=ue("$ZodError",$1),F1=ue("$ZodError",$1,{Parent:Error});function t5(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 n5(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 _b=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 gc;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},wb=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},op=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 gc;return a.issues.length?{success:!1,error:new(e??B1)(a.issues.map(l=>ri(l,i,ni())))}:{success:!0,data:a.value}},r5=op(F1),ip=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}},s5=ip(F1),o5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return _b(e)(t,n,i)},i5=e=>(t,n,s)=>_b(e)(t,n,s),a5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return wb(e)(t,n,i)},c5=e=>async(t,n,s)=>wb(e)(t,n,s),l5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return op(e)(t,n,i)},u5=e=>(t,n,s)=>op(e)(t,n,s),f5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return ip(e)(t,n,i)},d5=e=>async(t,n,s)=>ip(e)(t,n,s),h5=/^[cC][^\s-]{8,}$/,p5=/^[0-9a-z]+$/,m5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,g5=/^[0-9a-vA-V]{20}$/,y5=/^[A-Za-z0-9]{27}$/,v5=/^[a-zA-Z0-9_-]{21}$/,b5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,x5=/^([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})$/,xE=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)$/,S5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function w5(){return new RegExp(_5,"u")}const E5=/^(?:(?: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])$/,T5=/^(([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}|:))$/,C5=/^((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])$/,R5=/^(([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])$/,N5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,H1=/^[A-Za-z0-9_-]*$/,j5=/^\+[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])))",A5=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 k5(e){return new RegExp(`^${V1(e)}$`)}function O5(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 M5=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},I5=/^-?\d+$/,K1=/^-?\d+(?:\.\d+)?$/,P5=/^(?:true|false)$/i,D5=/^[^A-Z]*$/,z5=/^[^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})}}),L5=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):F4(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})}}),U5=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]=G4[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=I5)}),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})}}),$5=ue("$ZodCheckMaxLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!bb(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=Sb(i);s.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),B5=ue("$ZodCheckMinLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!bb(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=Sb(i);s.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),F5=ue("$ZodCheckLengthEquals",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!bb(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=Sb(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})}}),ap=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=()=>{})}),H5=ue("$ZodCheckRegex",(e,t)=>{ap.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})}}),q5=ue("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=D5),ap.init(e,t)}),V5=ue("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=z5),ap.init(e,t)}),K5=ue("$ZodCheckIncludes",(e,t)=>{Qn.init(e,t);const n=Pc(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})}}),G5=ue("$ZodCheckStartsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`^${Pc(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})}}),Z5=ue("$ZodCheckEndsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`.*${Pc(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})}}),Y5=ue("$ZodCheckOverwrite",(e,t)=>{Qn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class X5{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 gz(){return nz(e=>{Bu("cls",{metric:e}),p1=e},{reportAllChanges:!0})}function yz(){return fz(e=>{Bu("lcp",{metric:e}),m1=e},{reportAllChanges:!0})}function vz(){return hz(e=>{Bu("ttfb",{metric:e}),g1=e})}function bz(){return cz(e=>{Bu("inp",{metric:e}),y1=e})}function sp(e,t,n,s,i=!1){x1(e,t);let a;return Sh[e]||(a=n(),Sh[e]=!0),s&&t({metric:s}),S1(e,t,i?a:void 0)}function xz(e){const t={};e==="event"&&(t.durationThreshold=0),Xc(e,n=>{Bu(e,{entries:n})},t)}function x1(e,t){au[e]=au[e]||[],au[e].push(t)}function S1(e,t,n){return()=>{n&&n();const s=au[e];if(!s)return;const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}function Sz(e){return"duration"in e}const _z=e=>{const t=n=>{(n.type==="pagehide"||Ke.document?.visibilityState==="hidden")&&e(n)};Yo("visibilitychange",t,{capture:!0,once:!0}),Yo("pagehide",t,{capture:!0,once:!0})};function Yg(e){return typeof e=="number"&&isFinite(e)}function ti(e,t,n,{...s}){const i=mt(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Jv(e,()=>{const a=Kc({startTime:t,...s});return a&&a.end(n),a})}function gb(e){const t=gt();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":Ke.navigator?.userAgent,"client.address":d?"{{auto}}":void 0,...i};return Kc({name:n,attributes:w,startTime:a,experimental:{standalone:!0}})}function Fu(){return Ke.addEventListener&&Ke.performance}function Xt(e){return e/1e3}function wz(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}_z(()=>{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 Ez(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)=>{Tz(t,n,a,i),s()})}function Tz(e,t,n,s){Du&&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",[Vc]: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=gb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("cls",{[Mu]:"",[Iu]:e}),d.end(i))}function Cz(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)=>{Rz(t,n,a,i),s()})}function Rz(e,t,n,s){Du&&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",[Vc]: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=gb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("lcp",{[Mu]:"millisecond",[Iu]: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}=wz(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=n}return Sr()||Fu()?.timeOrigin?Nz({...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 Nz(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const jz=2147483647;let oE=0,ts={},Gn,_h;function Az({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const s=Fu();if(s&&Sr()){s.mark&&Ke.performance.mark("sentry-tracing-init");const i=t?Cz(n):Pz(),a=Dz(),l=e?Ez(n):Iz();return()=>{i?.(),a(),l?.()}}return()=>{}}function kz(){Oc("longtask",({entries:e})=>{const t=Xn();if(!t)return;const{op:n,start_timestamp:s}=mt(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 Oz(){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}=mt(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 Mz(){Oc("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 Iz(){return v1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ts.cls={value:e.value,unit:""},_h=t)},!0)}function Pz(){return b1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ts.lcp={value:e.value,unit:"millisecond"},Gn=t)},!0)}function Dz(){return pz(({metric:e})=>{e.entries[e.entries.length-1]&&(ts.ttfb={value:e.value,unit:"millisecond"})})}function zz(e,t){const n=Fu(),s=Sr();if(!n?.getEntries||!s)return;const i=Xt(s),a=n.getEntries(),{op:l,start_timestamp:f}=mt(e);a.slice(oE).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":{Bz(e,d,i);break}case"mark":case"paint":case"measure":{Uz(e,d,p,g,i,t.ignorePerformanceApiSpans);const y=Uu(),b=d.startTime<y.firstHiddenTime;d.name==="first-paint"&&b&&(ts.fp={value:d.startTime,unit:"millisecond"}),d.name==="first-contentful-paint"&&b&&(ts.fcp={value:d.startTime,unit:"millisecond"});break}case"resource":{qz(e,d,d.name,p,g,i,t.ignoreResourceSpans);break}}}),oE=Math.max(a.length-1,0),Vz(e),l==="pageload"&&(Zz(ts),t.recordClsOnPageloadSpan||delete ts.cls,t.recordLcpOnPageloadSpan||delete ts.lcp,Object.entries(ts).forEach(([d,p])=>{lP(d,p.value,p.unit)}),e.setAttribute("performance.timeOrigin",i),e.setAttribute("performance.activationStart",Yc()),Gz(e,t)),Gn=void 0,_h=void 0,ts={}}function Lz(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function Uz(e,t,n,s,i,a){if(Lz(t)||["mark","measure"].includes(t.entryType)&&Ko(t.name,a))return;const l=Lu(!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),$z(y,t),d<=g&&ti(e,d,g,{name:t.name,op:t.entryType,attributes:y})}function $z(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[s,i]of Object.entries(n))if(i&&Tc(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(Tc(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Bz(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"),Hz(e,t,n)}function Ed(e,t,n,s,i=n){const a=Fz(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 Fz(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Hz(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 qz(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(Ke.location.origin),Kz(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(Ke.location.origin,""),op:f,attributes:g})}function Vz(e){const t=Ke.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Yg(n.rtt)&&(ts["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Yg(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Yg(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function Gz(e,t){Gn&&t.recordLcpOnPageloadSpan&&(Gn.element&&e.setAttribute("lcp.element",Vr(Gn.element)),Gn.id&&e.setAttribute("lcp.id",Gn.id),Gn.url&&e.setAttribute("lcp.url",Gn.url.trim().slice(0,200)),Gn.loadTime!=null&&e.setAttribute("lcp.loadTime",Gn.loadTime),Gn.renderTime!=null&&e.setAttribute("lcp.renderTime",Gn.renderTime),e.setAttribute("lcp.size",Gn.size)),_h?.sources&&t.recordClsOnPageloadSpan&&_h.sources.forEach((n,s)=>e.setAttribute(`cls.source.${s+1}`,Vr(n.node)))}function Kz(e,t,n){n.forEach(([s,i])=>{const a=e[s];a!=null&&(typeof a=="number"&&a<jz||typeof a=="string")&&(t[i]=a)})}function Zz(e){const t=Lu(!1);if(!t)return;const{responseStart:n,requestStart:s}=t;s<=n&&(e["ttfb.requestTime"]={value:n-s,unit:"millisecond"})}function Yz(){return Fu()&&Sr()?Oc("element",Xz):()=>{}}const Xz=({entries:e})=>{const t=Xn(),n=t?Dn(t):void 0,s=n?mt(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",[ys]:"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)})})},Qz=1e3;let iE,iv,av;function Wz(e){ci("dom",e),li("dom",Jz)}function Jz(){if(!Ke.document)return;const e=Hr.bind(null,"dom"),t=aE(e,!0);Ke.document.addEventListener("click",t,!1),Ke.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const i=Ke[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=aE(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 eL(e){if(e.type!==iv)return!1;try{if(!e.target||e.target._sentryId!==av)return!1}catch{}return!0}function tL(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function aE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const s=nL(n);if(tL(n.type,s))return;Yn(n,"_sentryCaptured",!0),s&&!s._sentryId&&Yn(s,"_sentryId",qr());const i=n.type==="keypress"?"input":n.type;eL(n)||(e({event:n,name:i,global:t}),iv=n.type,av=s?s._sentryId:void 0),clearTimeout(iE),iE=Ke.setTimeout(()=>{av=void 0,iv=void 0},Qz)}}function nL(e){try{return e.target}catch{return null}}let Td;function yb(e){const t="history";ci(t,e),li(t,rL)}function rL(){if(Ke.addEventListener("popstate",()=>{const t=Ke.location.href,n=Td;if(Td=t,n===t)return;Hr("history",{from:n,to:t})}),!_2())return;function e(t){return function(...n){const s=n.length>2?n[2]:void 0;if(s){const i=Td,a=sL(String(s));if(Td=a,i===a)return t.apply(this,n);Hr("history",{from:i,to:a})}return t.apply(this,n)}}gr(Ke.history,"pushState",e),gr(Ke.history,"replaceState",e)}function sL(e){try{return new URL(e,Ke.location.origin).toString()}catch{return e}}const nh={};function oL(e){const t=nh[e];if(t)return t;let n=Ke[e];if(tv(n))return nh[e]=n.bind(Ke);const s=Ke.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){Du&&be.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n&&(nh[e]=n.bind(Ke))}function iL(e){nh[e]=void 0}const uc="__sentry_xhr_v3__";function T1(e){ci("xhr",e),li("xhr",aL)}function aL(){if(!Ke.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,s){const i=new Error,a=cn()*1e3,l=Ks(s[0])?s[0].toUpperCase():void 0,f=cL(s[1]);if(!l||!f)return t.apply(n,s);n[uc]={method:l,url:f,request_headers:{}},l==="POST"&&f.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const d=()=>{const p=n[uc];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[uc];return S&&Ks(b)&&Ks(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[uc];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 cL(e){if(Ks(e))return e;try{return e.toString()}catch{}}function lL(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Du&&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 Xg=[],rh=new Map,cc=new Map,uL=60;function fL(){if(Fu()&&Sr()){const t=dL();return()=>{t()}}return()=>{}}const cv={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 dL(){return mz(hL)}const hL=({metric:e})=>{if(e.value==null)return;const t=Xt(e.value);if(t>uL)return;const n=e.entries.find(S=>S.duration===e.value&&cv[S.name]);if(!n)return;const{interactionId:s}=n,i=cv[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?mt(p).description:bt().getScopeData().transactionName,y=d?.elementName||Vr(n.target),b={[gn]:"auto.http.browser.inp",[eo]:`ui.interaction.${i}`,[Vc]:n.duration},x=gb({name:y,transaction:g,attributes:b,startTime:a});x&&(x.addEvent("inp",{[Mu]:"millisecond",[Iu]:e.value}),x.end(a+t))};function pL(){const e=Object.keys(cv);M2()&&e.forEach(i=>{Ke.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(!Sz(f))return;const d=f.interactionId;if(d==null||rh.has(d))return;const p=f.target?Vr(f.target):n(f);if(Xg.length>10){const g=Xg.shift();rh.delete(g)}Xg.push(d),rh.set(d,{span:l,elementName:p})})};Oc("event",s),Oc("first-input",s)}const mL=40;function gL(e,t=oL("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 iL("fetch"),d}finally{n-=l,s--}}return pD(e,i,cb(e.bufferSize||mL))}const Gr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,yL=30,vL=50;function lv(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 bL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,SL=/\((\S*)(?::(\d+))(?::(\d+))\)/,_L=/at (.+?) ?\(data:(.+?),/,wL=e=>{const t=e.match(_L);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=bL.exec(e);if(n){const[,i,a,l]=n;return lv(i,oa,+a,+l)}const s=xL.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){const f=SL.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 lv(l,a,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},EL=[yL,wL],TL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,CL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,RL=e=>{const t=TL.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const a=CL.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),lv(s,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},NL=[vL,RL],jL=[EL,NL],AL=JC(...jL),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,kL="Breadcrumbs",OL=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:kL,setup(n){t.console&&QD(DL(n)),t.dom&&Wz(PL(n,t.dom)),t.xhr&&T1(zL(n)),t.fetch&&o1(LL(n)),t.history&&yb(UL(n)),t.sentry&&n.on("beforeSendEvent",IL(n))}}}),ML=OL;function IL(e){return function(n){gt()===e&&ia({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Ki(n)},{event:n})}}function PL(e,t){return function(s){if(gt()!==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&&(Gr&&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=$L(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 DL(e){return function(n){if(gt()!==e)return;const s={category:"console",data:{arguments:n.args,logger:"console"},level:JD(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 zL(e){return function(n){if(gt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n,a=n.xhr[uc];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 LL(e){return function(n){if(gt()!==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 UL(e){return function(n){if(gt()!==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 $L(e){return!!e&&!!e.target}const BL=["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"],FL="BrowserApiErrors",HL=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:FL,setupOnce(){t.setTimeout&&gr(st,"setTimeout",cE),t.setInterval&&gr(st,"setInterval",cE),t.requestAnimationFrame&&gr(st,"requestAnimationFrame",VL),t.XMLHttpRequest&&"XMLHttpRequest"in st&&gr(XMLHttpRequest.prototype,"send",GL);const n=t.eventTarget;n&&(Array.isArray(n)?n:BL).forEach(i=>KL(i,t))}}}),qL=HL;function cE(e){return function(...t){const n=t[0];return t[0]=kc(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Xs(e)}`}}),e.apply(this,t)}}function VL(e){return function(t){return e.apply(this,[kc(t,{mechanism:{data:{handler:Xs(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function GL(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=Vv(a);return f&&(l.mechanism.data.handler=Xs(f)),kc(a,l)})}),e.apply(this,t)}}function KL(e,t){const s=st[e]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(gr(s,"addEventListener",function(i){return function(a,l,f){try{ZL(l)&&(l.handleEvent=kc(l.handleEvent,{mechanism:{data:{handler:Xs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&YL(this,a,l),i.apply(this,[a,kc(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 ZL(e){return typeof e.handleEvent=="function"}function YL(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const XL=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof st.document>"u"){Gr&&be.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Dw({ignoreDuration:!0}),zw(),t==="route"&&yb(({from:n,to:s})=>{n!==void 0&&n!==s&&(Dw({ignoreDuration:!0}),zw())})}}},QL="CultureContext",WL=(()=>({name:QL,preprocessEvent(e){const t=e4();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})),JL=WL;function e4(){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 t4="GlobalHandlers",n4=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:t4,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(s4(n),lE("onerror")),t.onunhandledrejection&&(o4(n),lE("onunhandledrejection"))}}}),r4=n4;function s4(e){tR(t=>{const{stackParser:n,attachStacktrace:s}=R1();if(gt()!==e||a1())return;const{msg:i,url:a,line:l,column:f,error:d}=t,p=c4(hb(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 o4(e){nR(t=>{const{stackParser:n,attachStacktrace:s}=R1();if(gt()!==e||a1())return;const i=i4(t),a=Tc(i)?a4(i):hb(n,i,void 0,s,!0);a.level="error",zR(a,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function i4(e){if(Tc(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 a4(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function c4(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=l4(t)??Nu();return d.length===0&&d.push({colno:p,filename:y,function:oa,in_app:!0,lineno:g}),e}function lE(e){Gr&&be.log(`Global Handler attached: ${e}`)}function R1(){return gt()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function l4(e){if(!(!Ks(e)||e.length===0))return e.startsWith("data:")?`<${Zo(e,!1)}>`:e}const u4=()=>({name:"HttpContext",preprocessEvent(e){if(!st.navigator&&!st.location&&!st.document)return;const t=ub(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),f4="cause",d4=5,h4="LinkedErrors",p4=((e={})=>{const t=e.limit||d4,n=e.key||f4;return{name:h4,preprocessEvent(s,i,a){const l=a.getOptions();XD(fb,l.stackParser,n,t,s,i)}}}),m4=p4;function g4(){return y4()?(Gr&&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 y4(){if(typeof st.window>"u")return!1;const e=st;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=Nu(),s=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(st===st.top&&s.some(a=>n.startsWith(`${a}://`)))}function v4(e){return[FD(),LD(),c2(),qL(),ML(),r4(),m4(),n2(),u4(),JL(),XL()]}function b4(e={}){const t=!e.skipBrowserExtensionCheck&&g4();let n=e.defaultIntegrations==null?v4():e.defaultIntegrations;const s={...e,enabled:t?!1:e.enabled,stackParser:UM(e.stackParser||AL),integrations:VP({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||gL};return TD(K2,s)}function x4(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 S4(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 uE=new WeakMap,Qg=new Map,A1={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function _4(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=>w4(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=Qg.get(w.span_id);T&&(w.timestamp=T/1e3,Qg.delete(w.span_id))}}),S)),i&&T2(S=>{if(S.response){const w=uE.get(S.response);w&&S.endTimestamp&&Qg.set(w,S.endTimestamp)}}),o1(S=>{const w=l2(S,g,y,b,{propagateTraceparent:x,onRequestSpanEnd:p});if(S.response&&S.fetchData.__span&&uE.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?Zo(T):void 0,"server.address":C}),l&&fE(w),d?.(w,{headers:S.headers})}})),s&&T1(S=>{const w=E4(S,g,y,b,x,p);w&&(l&&fE(w),d?.(w,{headers:j1(S.xhr.__sentry_xhr_v3__?.request_headers)}))})}function fE(e){const{url:t}=mt(e).data;if(!t||typeof t!="string")return;const n=Oc("resource",({entries:s})=>{s.forEach(i=>{S4(i)&&i.name.endsWith(t)&&(e.setAttributes(E1(i)),setTimeout(n))})})}function w4(e,t){const n=Nu();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 E4(e,t,n,s,i,a){const l=e.xhr,f=l?.[uc];if(!l||l.__sentry_own_request__||!f)return;const{url:d,method:p}=f,g=rs()&&t(d);if(e.endTimestamp&&g){const C=l.__sentry_xhr_span_id__;if(!C)return;const O=s[C];O&&f.status_code!==void 0&&(hR(O,f.status_code),O.end(),a?.(O,{headers:j1(lL(l)),error:e.error}),delete s[C]);return}const y=N1(d),b=na(y||d),x=Zo(jD(d)),S=!!Xn(),w=g&&S?Kc({name:`${p} ${x}`,attributes:{url:Zo(d),type:"xhr","http.method":p,"http.url":y?Zo(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)&&T4(l,rs()&&S?w:void 0,i);const T=gt();return T&&T.emit("beforeOutgoingRequestSpan",w,e),w}function T4(e,t,n){const{"sentry-trace":s,baggage:i,traceparent:a}=e1({span:t,propagateTraceparent:n});s&&C4(e,s,i,a)}function C4(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||!x4(a))&&e.setRequestHeader("baggage",n)}}catch{}}function R4(){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}=mt(t);Gr&&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()}}):Gr&&be.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const N4=3600,k1="sentry_previous_trace",j4="sentry.previous_trace";function A4(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const s=t==="session-storage";let i=s?M4():void 0;e.on("spanStart",l=>{if(Dn(l)!==l)return;const f=bt().getPropagationContext();i=k4(i,l,f),s&&O4(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(uv(i.spanContext))},sampleRand:i.sampleRand}),l.parentSampled=uv(i.spanContext),l.parentSampleRate=i.sampleRate,l.spanAttributes={...l.spanAttributes,[dR]:i.sampleRate}})}function k4(e,t,n){const s=mt(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<=N4&&(Gr&&be.log(`Adding previous_trace \`${JSON.stringify(l)}\` link to span \`${JSON.stringify({op:s.op,...t.spanContext()})}\``),t.addLink({context:l,attributes:{[dI]:"previous_trace"}}),t.setAttribute(j4,`${l.traceId}-${l.spanId}-${uv(l)?1:0}`)),a)}function O4(e){try{st.sessionStorage.setItem(k1,JSON.stringify(e))}catch(t){Gr&&be.warn("Could not store previous trace in sessionStorage",t)}}function M4(){try{const e=st.sessionStorage?.getItem(k1);return JSON.parse(e)}catch{return}}function uv(e){return e.traceFlags===1}const I4="BrowserTracing",P4={...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},D4=((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:z,instrumentNavigation:j,detectRedirects:A,linkPreviousTrace:P,consistentTraceSampling:Q,enableReportPageLoaded:B,onRequestSpanStart:U,onRequestSpanEnd:Z}={...P4,...e};let G,ee,D;function K(q,V,L=!0){const I=V.op==="pageload",H=V.name,W=g?g(V):V,Y=W.attributes||{};if(H!==W.name&&(Y[ys]="custom",W.attributes=Y),!L){const fe=ma();Kc({...W,startTime:fe}).end(fe);return}t.name=W.name,t.source=Y[ys];const ae=PR(W,{idleTimeout:y,finalTimeout:b,childSpanTimeout:x,disableAutoFinish:I,beforeSpanEnd:fe=>{G?.(),zz(fe,{recordClsOnPageloadSpan:!d,recordLcpOnPageloadSpan:!p,ignoreResourceSpans:R,ignorePerformanceApiSpans:M}),pE(q,void 0);const Se=bt(),pe=Se.getPropagationContext();Se.setPropagationContext({...pe,traceId:ae.spanContext().traceId,sampled:ui(ae),dsc:to(fe)}),I&&(D=void 0)},trimIdleSpanEndTimestamp:!B});I&&B&&(D=ae),pE(q,ae);function se(){n&&["interactive","complete"].includes(n.readyState)&&q.emit("idleSpanEnableAutoFinish",ae)}I&&!B&&n&&(n.addEventListener("readystatechange",()=>{se()}),se())}return{name:I4,setup(q){if(BI(),G=Az({recordClsStandaloneSpans:d||!1,recordLcpStandaloneSpans:p||!1,client:q}),s&&fL(),i&&Yz(),l&&ct.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?Oz():a&&kz(),f&&Mz(),A&&n){const L=()=>{ee=cn()};addEventListener("click",L,{capture:!0}),addEventListener("keydown",L,{capture:!0,passive:!0})}function V(){const L=bu(q);L&&!mt(L).timestamp&&(Gr&&be.log(`[Tracing] Finishing current active span with op: ${mt(L).op}`),L.setAttribute(mu,"cancelled"),L.end())}q.on("startNavigationSpan",(L,I)=>{if(gt()!==q)return;if(I?.isRedirect){Gr&&be.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),K(q,{op:"navigation.redirect",...L},!1);return}ee=void 0,V(),ss().setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:rs()?void 0:Zs()});const H=bt();H.setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:rs()?void 0:Zs()}),H.setSDKProcessingMetadata({normalizedRequest:void 0}),K(q,{op:"navigation",...L,parentSpan:null,forceTransaction:!0})}),q.on("startPageLoadSpan",(L,I={})=>{if(gt()!==q)return;V();const H=I.sentryTrace||dE("sentry-trace")||hE("sentry-trace"),W=I.baggage||dE("baggage")||hE("baggage"),Y=MI(H,W),ae=bt();ae.setPropagationContext(Y),rs()||(ae.getPropagationContext().propagationSpanId=Zs()),ae.setSDKProcessingMetadata({normalizedRequest:ub()}),K(q,{op:"pageload",...L})}),q.on("endPageloadSpan",()=>{B&&D&&(D.setAttribute(mu,"reportPageLoaded"),D.end())})},afterAllSetup(q){let V=Nu();if(P!=="off"&&A4(q,{linkPreviousTrace:P,consistentTraceSampling:Q}),st.location){if(z){const L=Sr();z4(q,{name:st.location.pathname,startTime:L?L/1e3:void 0,attributes:{[ys]:"url",[gn]:"auto.pageload.browser"}})}j&&yb(({to:L,from:I})=>{if(I===void 0&&V?.indexOf(L)!==-1){V=void 0;return}V=void 0;const H=WR(L),W=bu(q),Y=W&&A&&$4(W,ee);L4(q,{name:H?.pathname||st.location.pathname,attributes:{[ys]:"url",[gn]:"auto.navigation.browser"}},{url:L,isRedirect:Y})})}S&&R4(),f&&U4(q,y,b,x,t),s&&pL(),_4(q,{traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,tracePropagationTargets:q.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:O,enableHTTPTimings:N,onRequestSpanStart:U,onRequestSpanEnd:Z})}}});function z4(e,t,n){e.emit("startPageLoadSpan",t,n),bt().setTransactionName(t.name);const s=bu(e);return s&&e.emit("afterStartPageLoadSpan",s),s}function L4(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:{...ub(),url:s}}),bu(e)}function dE(e){return st.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function hE(e){return st.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(s=>s.name===e)?.description}function U4(e,t,n,s,i){const a=st.document;let l;const f=()=>{const d="ui.action.click",p=bu(e);if(p){const g=mt(p).op;if(["navigation","pageload"].includes(g)){Gr&&be.warn(`[Tracing] Did not create ${d} span because a pageload or navigation span is in progress.`);return}}if(l&&(l.setAttribute(mu,"interactionInterrupted"),l.end(),l=void 0),!i.name){Gr&&be.warn(`[Tracing] Did not create ${d} transaction because _latestRouteName is missing.`);return}l=PR({name:i.name,op:d,attributes:{[ys]:i.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:s})};a&&addEventListener("click",f,{capture:!0})}const O1="_sentry_idleSpan";function bu(e){return e[O1]}function pE(e,t){Yn(e,O1,t)}const mE=1.5;function $4(e,t){const n=mt(e),s=ma(),i=n.start_timestamp;return!(s-i>mE||t&&s-t<=mE)}function M1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wg={exports:{}},Ge={};var gE;function B4(){if(gE)return Ge;gE=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 z(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function P(I,H,W){var Y=W.ref;return{$$typeof:e,type:I,key:H,ref:Y!==void 0?Y:null,props:W}}function Q(I,H){return P(I.type,H,I.props)}function B(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function U(I){var H={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(W){return H[W]})}var Z=/\/+/g;function G(I,H){return typeof I=="object"&&I!==null&&I.key!=null?U(""+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(z,z):(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,Y,ae){var se=typeof I;(se==="undefined"||se==="boolean")&&(I=null);var fe=!1;if(I===null)fe=!0;else switch(se){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(I.$$typeof){case e:case t:fe=!0;break;case g:return fe=I._init,D(fe(I._payload),H,W,Y,ae)}}if(fe)return ae=ae(I),fe=Y===""?"."+G(I,0):Y,M(ae)?(W="",fe!=null&&(W=fe.replace(Z,"$&/")+"/"),D(ae,H,W,"",function(Me){return Me})):ae!=null&&(B(ae)&&(ae=Q(ae,W+(ae.key==null||I&&I.key===ae.key?"":(""+ae.key).replace(Z,"$&/")+"/")+fe)),H.push(ae)),1;fe=0;var Se=Y===""?".":Y+":";if(M(I))for(var pe=0;pe<I.length;pe++)Y=I[pe],se=Se+G(Y,pe),fe+=D(Y,H,W,se,ae);else if(pe=x(I),typeof pe=="function")for(I=pe.call(I),pe=0;!(Y=I.next()).done;)Y=Y.value,se=Se+G(Y,pe++),fe+=D(Y,H,W,se,ae);else if(se==="object"){if(typeof I.then=="function")return D(ee(I),H,W,Y,ae);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 fe}function K(I,H,W){if(I==null)return I;var Y=[],ae=0;return D(I,Y,"","",function(se){return H.call(W,se,ae++)}),Y}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)},L={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 Ge.Activity=y,Ge.Children=L,Ge.Component=C,Ge.Fragment=n,Ge.Profiler=i,Ge.PureComponent=N,Ge.StrictMode=s,Ge.Suspense=d,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(I){return j.H.useMemoCache(I)}},Ge.cache=function(I){return function(){return I.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(I,H,W){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var Y=w({},I.props),ae=I.key;if(H!=null)for(se in H.key!==void 0&&(ae=""+H.key),H)!A.call(H,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&H.ref===void 0||(Y[se]=H[se]);var se=arguments.length-2;if(se===1)Y.children=W;else if(1<se){for(var fe=Array(se),Se=0;Se<se;Se++)fe[Se]=arguments[Se+2];Y.children=fe}return P(I.type,ae,Y)},Ge.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},Ge.createElement=function(I,H,W){var Y,ae={},se=null;if(H!=null)for(Y in H.key!==void 0&&(se=""+H.key),H)A.call(H,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(ae[Y]=H[Y]);var fe=arguments.length-2;if(fe===1)ae.children=W;else if(1<fe){for(var Se=Array(fe),pe=0;pe<fe;pe++)Se[pe]=arguments[pe+2];ae.children=Se}if(I&&I.defaultProps)for(Y in fe=I.defaultProps,fe)ae[Y]===void 0&&(ae[Y]=fe[Y]);return P(I,se,ae)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(I){return{$$typeof:f,render:I}},Ge.isValidElement=B,Ge.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:q}},Ge.memo=function(I,H){return{$$typeof:p,type:I,compare:H===void 0?null:H}},Ge.startTransition=function(I){var H=j.T,W={};j.T=W;try{var Y=I(),ae=j.S;ae!==null&&ae(W,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(z,V)}catch(se){V(se)}finally{H!==null&&W.types!==null&&(H.types=W.types),j.T=H}},Ge.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ge.use=function(I){return j.H.use(I)},Ge.useActionState=function(I,H,W){return j.H.useActionState(I,H,W)},Ge.useCallback=function(I,H){return j.H.useCallback(I,H)},Ge.useContext=function(I){return j.H.useContext(I)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(I,H){return j.H.useDeferredValue(I,H)},Ge.useEffect=function(I,H){return j.H.useEffect(I,H)},Ge.useEffectEvent=function(I){return j.H.useEffectEvent(I)},Ge.useId=function(){return j.H.useId()},Ge.useImperativeHandle=function(I,H,W){return j.H.useImperativeHandle(I,H,W)},Ge.useInsertionEffect=function(I,H){return j.H.useInsertionEffect(I,H)},Ge.useLayoutEffect=function(I,H){return j.H.useLayoutEffect(I,H)},Ge.useMemo=function(I,H){return j.H.useMemo(I,H)},Ge.useOptimistic=function(I,H){return j.H.useOptimistic(I,H)},Ge.useReducer=function(I,H,W){return j.H.useReducer(I,H,W)},Ge.useRef=function(I){return j.H.useRef(I)},Ge.useState=function(I){return j.H.useState(I)},Ge.useSyncExternalStore=function(I,H,W){return j.H.useSyncExternalStore(I,H,W)},Ge.useTransition=function(){return j.H.useTransition()},Ge.version="19.2.4",Ge}var yE;function Hu(){return yE||(yE=1,Wg.exports=B4()),Wg.exports}var _=Hu();const Mc=M1(_),I1=kM({__proto__:null,default:Mc},[_]);function F4(e){const t={...e};return JR(t,"react"),zP("react",{version:_.version}),b4(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 gc 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 fv(e,t){return typeof t=="bigint"?t.toString():t}function vb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function bb(e){return e==null}function xb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function H4(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 vE=Symbol("evaluating");function wt(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==vE)return s===void 0&&(s=vE,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 bE(e){return JSON.stringify(e)}function q4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const L1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const V4=vb(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ic(e){if(wh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(wh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function U1(e){return Ic(e)?{...e}:Array.isArray(e)?[...e]:e}const G4=new Set(["string","number","symbol"]);function Pc(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 K4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Z4={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 Y4(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 X4(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 Q4(e,t){if(!Ic(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 W4(e,t){if(!Ic(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 J4(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 e5(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 t5(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 fc(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 dc(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 Sb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function xu(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const $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,fv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},B1=ue("$ZodError",$1),F1=ue("$ZodError",$1,{Parent:Error});function n5(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 r5(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 _b=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 gc;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},wb=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},op=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 gc;return a.issues.length?{success:!1,error:new(e??B1)(a.issues.map(l=>ri(l,i,ni())))}:{success:!0,data:a.value}},s5=op(F1),ip=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}},o5=ip(F1),i5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return _b(e)(t,n,i)},a5=e=>(t,n,s)=>_b(e)(t,n,s),c5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return wb(e)(t,n,i)},l5=e=>async(t,n,s)=>wb(e)(t,n,s),u5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return op(e)(t,n,i)},f5=e=>(t,n,s)=>op(e)(t,n,s),d5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return ip(e)(t,n,i)},h5=e=>async(t,n,s)=>ip(e)(t,n,s),p5=/^[cC][^\s-]{8,}$/,m5=/^[0-9a-z]+$/,g5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,y5=/^[0-9a-vA-V]{20}$/,v5=/^[A-Za-z0-9]{27}$/,b5=/^[a-zA-Z0-9_-]{21}$/,x5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,S5=/^([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})$/,xE=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)$/,_5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,w5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function E5(){return new RegExp(w5,"u")}const 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])$/,C5=/^(([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}|:))$/,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])\/([0-9]|[1-2][0-9]|3[0-2])$/,N5=/^(([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])$/,j5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,H1=/^[A-Za-z0-9_-]*$/,A5=/^\+[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])))",k5=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 O5(e){return new RegExp(`^${V1(e)}$`)}function M5(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 I5=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},P5=/^-?\d+$/,G1=/^-?\d+(?:\.\d+)?$/,D5=/^(?:true|false)$/i,z5=/^[^A-Z]*$/,L5=/^[^a-z]*$/,Qn=ue("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),K1={number:"number",bigint:"bigint",object:"date"},Z1=ue("$ZodCheckLessThan",(e,t)=>{Qn.init(e,t);const n=K1[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=K1[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})}}),U5=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):H4(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})}}),$5=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]=Z4[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=P5)}),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})}}),B5=ue("$ZodCheckMaxLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!bb(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=Sb(i);s.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),F5=ue("$ZodCheckMinLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!bb(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=Sb(i);s.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),H5=ue("$ZodCheckLengthEquals",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!bb(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=Sb(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})}}),ap=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=()=>{})}),q5=ue("$ZodCheckRegex",(e,t)=>{ap.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})}}),V5=ue("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=z5),ap.init(e,t)}),G5=ue("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=L5),ap.init(e,t)}),K5=ue("$ZodCheckIncludes",(e,t)=>{Qn.init(e,t);const n=Pc(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})}}),Z5=ue("$ZodCheckStartsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`^${Pc(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})}}),Y5=ue("$ZodCheckEndsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`.*${Pc(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})}}),X5=ue("$ZodCheckOverwrite",(e,t)=>{Qn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Q5{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 Q5={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=Q5;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=fc(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 gc;if(g||x instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await x,l.issues.length!==b&&(p||(p=fc(l,b)))});else{if(l.issues.length===b)continue;p||(p=fc(l,b))}}return g?g.then(()=>l):l},a=(l,f,d)=>{if(fc(l))return l.aborted=!0,l;const p=i(f,s,d);if(p instanceof Promise){if(d.async===!1)throw new gc;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 gc;return d.then(p=>i(p,s,f))}return i(d,s,f)}}wt(e,"~standard",()=>({validate:i=>{try{const a=r5(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return s5(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),Eb=ue("$ZodString",(e,t)=>{Ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??M5(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)=>{ap.init(e,t),Eb.init(e,t)}),W5=ue("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=x5),Bt.init(e,t)}),J5=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=xE(s))}else t.pattern??(t.pattern=xE());Bt.init(e,t)}),eU=ue("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=S5),Bt.init(e,t)}),tU=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})}}}),nU=ue("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=w5()),Bt.init(e,t)}),rU=ue("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=v5),Bt.init(e,t)}),sU=ue("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=h5),Bt.init(e,t)}),oU=ue("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=p5),Bt.init(e,t)}),iU=ue("$ZodULID",(e,t)=>{t.pattern??(t.pattern=m5),Bt.init(e,t)}),aU=ue("$ZodXID",(e,t)=>{t.pattern??(t.pattern=g5),Bt.init(e,t)}),cU=ue("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=y5),Bt.init(e,t)}),lU=ue("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=O5(t)),Bt.init(e,t)}),uU=ue("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=A5),Bt.init(e,t)}),fU=ue("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=k5(t)),Bt.init(e,t)}),dU=ue("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=b5),Bt.init(e,t)}),hU=ue("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=E5),Bt.init(e,t),e._zod.bag.format="ipv4"}),pU=ue("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=T5),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})}}}),mU=ue("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=C5),Bt.init(e,t)}),gU=ue("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=R5),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 yU=ue("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=N5),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 vU(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 bU=ue("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=H1),Bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{vU(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),xU=ue("$ZodE164",(e,t)=>{t.pattern??(t.pattern=j5),Bt.init(e,t)});function SU(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 _U=ue("$ZodJWT",(e,t)=>{Bt.init(e,t),e._zod.check=n=>{SU(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}}),wU=ue("$ZodNumberFormat",(e,t)=>{U5.init(e,t),Q1.init(e,t)}),EU=ue("$ZodBoolean",(e,t)=>{Ft.init(e,t),e._zod.pattern=P5,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}}),TU=ue("$ZodUnknown",(e,t)=>{Ft.init(e,t),e._zod.parse=n=>n}),CU=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 SE(e,t,n){e.issues.length&&t.issues.push(...dc(n,e.issues)),t.value[n]=e.value}const RU=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=>SE(p,n,l))):SE(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function Eh(e,t,n,s,i){if(e.issues.length){if(i&&!(n in s))return;t.issues.push(...dc(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=K4(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=>Eh(x,n,y,t,g))):Eh(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 NU=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=vb(()=>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=wh,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=>Eh(T,f,b,p,S))):Eh(w,f,b,p,S)}return a?J1(g,p,f,d,s.value,e):g.length?Promise.all(g).then(()=>f):f}}),jU=ue("$ZodObjectJIT",(e,t)=>{NU.init(e,t);const n=e._zod.parse,s=vb(()=>W1(t)),i=b=>{const x=new X5(["shape","payload","ctx"]),S=s.value,w=N=>{const R=bE(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=bE(N),j=b[N]?._zod?.optout==="optional";x.write(`const ${R} = ${w(N)};`),j?x.write(`
23
+ `))}}const W5={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=W5;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=fc(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 gc;if(g||x instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await x,l.issues.length!==b&&(p||(p=fc(l,b)))});else{if(l.issues.length===b)continue;p||(p=fc(l,b))}}return g?g.then(()=>l):l},a=(l,f,d)=>{if(fc(l))return l.aborted=!0,l;const p=i(f,s,d);if(p instanceof Promise){if(d.async===!1)throw new gc;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 gc;return d.then(p=>i(p,s,f))}return i(d,s,f)}}wt(e,"~standard",()=>({validate:i=>{try{const a=s5(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return o5(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),Eb=ue("$ZodString",(e,t)=>{Ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??I5(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)=>{ap.init(e,t),Eb.init(e,t)}),J5=ue("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=S5),Bt.init(e,t)}),eU=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=xE(s))}else t.pattern??(t.pattern=xE());Bt.init(e,t)}),tU=ue("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_5),Bt.init(e,t)}),nU=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})}}}),rU=ue("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=E5()),Bt.init(e,t)}),sU=ue("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=b5),Bt.init(e,t)}),oU=ue("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=p5),Bt.init(e,t)}),iU=ue("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=m5),Bt.init(e,t)}),aU=ue("$ZodULID",(e,t)=>{t.pattern??(t.pattern=g5),Bt.init(e,t)}),cU=ue("$ZodXID",(e,t)=>{t.pattern??(t.pattern=y5),Bt.init(e,t)}),lU=ue("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=v5),Bt.init(e,t)}),uU=ue("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=M5(t)),Bt.init(e,t)}),fU=ue("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=k5),Bt.init(e,t)}),dU=ue("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=O5(t)),Bt.init(e,t)}),hU=ue("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=x5),Bt.init(e,t)}),pU=ue("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=T5),Bt.init(e,t),e._zod.bag.format="ipv4"}),mU=ue("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=C5),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})}}}),gU=ue("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=R5),Bt.init(e,t)}),yU=ue("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=N5),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 vU=ue("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=j5),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 bU(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 xU=ue("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=H1),Bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{bU(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),SU=ue("$ZodE164",(e,t)=>{t.pattern??(t.pattern=A5),Bt.init(e,t)});function _U(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 wU=ue("$ZodJWT",(e,t)=>{Bt.init(e,t),e._zod.check=n=>{_U(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??G1,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}}),EU=ue("$ZodNumberFormat",(e,t)=>{$5.init(e,t),Q1.init(e,t)}),TU=ue("$ZodBoolean",(e,t)=>{Ft.init(e,t),e._zod.pattern=D5,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}}),CU=ue("$ZodUnknown",(e,t)=>{Ft.init(e,t),e._zod.parse=n=>n}),RU=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 SE(e,t,n){e.issues.length&&t.issues.push(...dc(n,e.issues)),t.value[n]=e.value}const NU=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=>SE(p,n,l))):SE(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function Eh(e,t,n,s,i){if(e.issues.length){if(i&&!(n in s))return;t.issues.push(...dc(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=K4(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=>Eh(x,n,y,t,g))):Eh(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 jU=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=vb(()=>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=wh,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=>Eh(T,f,b,p,S))):Eh(w,f,b,p,S)}return a?J1(g,p,f,d,s.value,e):g.length?Promise.all(g).then(()=>f):f}}),AU=ue("$ZodObjectJIT",(e,t)=>{jU.init(e,t);const n=e._zod.parse,s=vb(()=>W1(t)),i=b=>{const x=new Q5(["shape","payload","ctx"]),S=s.value,w=N=>{const R=bE(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=bE(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 m2(){return t2(e=>{Bu("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=wh,f=!D1.jitless,p=f&&q4.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 _E(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=>!fc(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 AU=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=>xb(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=>_E(d,i,e,a)):_E(f,i,e,a)}}),kU=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])=>wE(n,d,p)):wE(n,a,l)}});function dv(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(Ic(e)&&Ic(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=dv(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=dv(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 wE(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}),fc(e))return e;const l=dv(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 OU=ue("$ZodRecord",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Ic(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(...dc(p,y.issues)),n.value[p]=y.value})):(g.issues.length&&n.issues.push(...dc(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(...dc(f,y.issues)),n.value[d.value]=y.value})):(g.issues.length&&n.issues.push(...dc(f,g.issues)),n.value[d.value]=g.value)}}return a.length?Promise.all(a).then(()=>n):n}}),MU=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=>V4.has(typeof i)).map(i=>typeof i=="string"?Pc(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}}),IU=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"?Pc(s):s?Pc(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}}),PU=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 gc;return n.value=i,n}});function EE(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(`^(${xb(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=>EE(a,n.value)):EE(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,s)}}),DU=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)}),zU=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(`^(${xb(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)}),LU=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=>TE(a,t)):TE(i,t)}});function TE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const UU=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))}),$U=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=>CE(a,e)):CE(i,e)}});function CE(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 BU=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)}}),FU=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 HU=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(RE):RE(i)}});function RE(e){return e.value=Object.freeze(e.value),e}const qU=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=>NE(a,n,s,e));NE(i,n,s,e)}});function NE(e,t,n,s){if(!e){const i={code:"custom",input:n,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(i.params=s._zod.def.params),t.issues.push(xu(i))}}var jE;class VU{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 KU(){return new VU}(jE=globalThis).__zod_globalRegistry??(jE.__zod_globalRegistry=KU());const ou=globalThis.__zod_globalRegistry;function GU(e,t){return new e({type:"string",...De(t)})}function ZU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function AE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function YU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function XU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function QU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function WU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function JU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function e3(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function t3(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function n3(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function r3(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function s3(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function o3(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function i3(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function a3(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function c3(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function l3(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function u3(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function f3(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function d3(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function h3(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function p3(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function m3(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function g3(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function y3(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function v3(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function b3(e,t){return new e({type:"number",checks:[],...De(t)})}function x3(e,t){return new e({type:"number",coerce:!0,checks:[],...De(t)})}function S3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function _3(e,t){return new e({type:"boolean",...De(t)})}function w3(e){return new e({type:"unknown"})}function E3(e,t){return new e({type:"never",...De(t)})}function kE(e,t){return new Z1({check:"less_than",...De(t),value:e,inclusive:!1})}function Jg(e,t){return new Z1({check:"less_than",...De(t),value:e,inclusive:!0})}function OE(e,t){return new Y1({check:"greater_than",...De(t),value:e,inclusive:!1})}function ey(e,t){return new Y1({check:"greater_than",...De(t),value:e,inclusive:!0})}function ME(e,t){return new L5({check:"multiple_of",...De(t),value:e})}function tN(e,t){return new $5({check:"max_length",...De(t),maximum:e})}function Th(e,t){return new B5({check:"min_length",...De(t),minimum:e})}function nN(e,t){return new F5({check:"length_equals",...De(t),length:e})}function T3(e,t){return new H5({check:"string_format",format:"regex",...De(t),pattern:e})}function C3(e){return new q5({check:"string_format",format:"lowercase",...De(e)})}function R3(e){return new V5({check:"string_format",format:"uppercase",...De(e)})}function N3(e,t){return new K5({check:"string_format",format:"includes",...De(t),includes:e})}function j3(e,t){return new G5({check:"string_format",format:"starts_with",...De(t),prefix:e})}function A3(e,t){return new Z5({check:"string_format",format:"ends_with",...De(t),suffix:e})}function Qc(e){return new Y5({check:"overwrite",tx:e})}function k3(e){return Qc(t=>t.normalize(e))}function O3(){return Qc(e=>e.trim())}function M3(){return Qc(e=>e.toLowerCase())}function I3(){return Qc(e=>e.toUpperCase())}function P3(){return Qc(e=>H4(e))}function D3(e,t,n){return new e({type:"array",element:t,...De(n)})}function z3(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function L3(e){const t=U3(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(xu(s,n.value,t._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(xu(i))}},e(n.value,n)));return t}function U3(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??ou,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function 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 O=x.compile();return(N,R)=>O(b,N,R)};let a;const l=wh,f=!D1.jitless,p=f&&V4.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 _E(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=>!fc(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 kU=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=>xb(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=>_E(d,i,e,a)):_E(f,i,e,a)}}),OU=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])=>wE(n,d,p)):wE(n,a,l)}});function dv(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(Ic(e)&&Ic(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=dv(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=dv(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 wE(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}),fc(e))return e;const l=dv(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 MU=ue("$ZodRecord",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Ic(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(...dc(p,y.issues)),n.value[p]=y.value})):(g.issues.length&&n.issues.push(...dc(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"&&G1.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(...dc(f,y.issues)),n.value[d.value]=y.value})):(g.issues.length&&n.issues.push(...dc(f,g.issues)),n.value[d.value]=g.value)}}return a.length?Promise.all(a).then(()=>n):n}}),IU=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=>G4.has(typeof i)).map(i=>typeof i=="string"?Pc(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}}),PU=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"?Pc(s):s?Pc(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}}),DU=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 gc;return n.value=i,n}});function EE(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(`^(${xb(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=>EE(a,n.value)):EE(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,s)}}),zU=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)}),LU=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(`^(${xb(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)}),UU=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=>TE(a,t)):TE(i,t)}});function TE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const $U=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))}),BU=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=>CE(a,e)):CE(i,e)}});function CE(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 FU=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)}}),HU=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 qU=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(RE):RE(i)}});function RE(e){return e.value=Object.freeze(e.value),e}const VU=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=>NE(a,n,s,e));NE(i,n,s,e)}});function NE(e,t,n,s){if(!e){const i={code:"custom",input:n,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(i.params=s._zod.def.params),t.issues.push(xu(i))}}var jE;class GU{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 KU(){return new GU}(jE=globalThis).__zod_globalRegistry??(jE.__zod_globalRegistry=KU());const ou=globalThis.__zod_globalRegistry;function ZU(e,t){return new e({type:"string",...De(t)})}function YU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function AE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function XU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function QU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function WU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function JU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function e3(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function t3(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function n3(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function r3(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function s3(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function o3(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function i3(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function a3(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function c3(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function l3(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function u3(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function f3(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function d3(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function h3(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function p3(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function m3(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function g3(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function y3(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function v3(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function b3(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function x3(e,t){return new e({type:"number",checks:[],...De(t)})}function S3(e,t){return new e({type:"number",coerce:!0,checks:[],...De(t)})}function _3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function w3(e,t){return new e({type:"boolean",...De(t)})}function E3(e){return new e({type:"unknown"})}function T3(e,t){return new e({type:"never",...De(t)})}function kE(e,t){return new Z1({check:"less_than",...De(t),value:e,inclusive:!1})}function Jg(e,t){return new Z1({check:"less_than",...De(t),value:e,inclusive:!0})}function OE(e,t){return new Y1({check:"greater_than",...De(t),value:e,inclusive:!1})}function ey(e,t){return new Y1({check:"greater_than",...De(t),value:e,inclusive:!0})}function ME(e,t){return new U5({check:"multiple_of",...De(t),value:e})}function tN(e,t){return new B5({check:"max_length",...De(t),maximum:e})}function Th(e,t){return new F5({check:"min_length",...De(t),minimum:e})}function nN(e,t){return new H5({check:"length_equals",...De(t),length:e})}function C3(e,t){return new q5({check:"string_format",format:"regex",...De(t),pattern:e})}function R3(e){return new V5({check:"string_format",format:"lowercase",...De(e)})}function N3(e){return new G5({check:"string_format",format:"uppercase",...De(e)})}function j3(e,t){return new K5({check:"string_format",format:"includes",...De(t),includes:e})}function A3(e,t){return new Z5({check:"string_format",format:"starts_with",...De(t),prefix:e})}function k3(e,t){return new Y5({check:"string_format",format:"ends_with",...De(t),suffix:e})}function Qc(e){return new X5({check:"overwrite",tx:e})}function O3(e){return Qc(t=>t.normalize(e))}function M3(){return Qc(e=>e.trim())}function I3(){return Qc(e=>e.toLowerCase())}function P3(){return Qc(e=>e.toUpperCase())}function D3(){return Qc(e=>q4(e))}function z3(e,t,n){return new e({type:"array",element:t,...De(n)})}function L3(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function U3(e){const t=$3(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(xu(s,n.value,t._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(xu(i))}},e(n.value,n)));return t}function $3(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??ou,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function 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>
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:Ch(t,"input",e.processors),output:Ch(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 $3=(e,t={})=>n=>{const s=rN({...n,processors:t});return ln(e,s),sN(s,e),oN(s,e)},Ch=(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)},B3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},F3=(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=B3[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}))])}},H3=(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)},q3=(e,t,n,s)=>{n.type="boolean"},V3=(e,t,n,s)=>{n.not={}},K3=(e,t,n,s)=>{},G3=(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},Z3=(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},Y3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},X3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Q3=(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"]})},W3=(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)},J3=(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},e$=(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},t$=(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)}},n$=(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"}]},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},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,n.default=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,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},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;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},a$=(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},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,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},l$=ue("ZodISODateTime",(e,t)=>{lU.init(e,t),qt.init(e,t)});function u$(e){return m3(l$,e)}const f$=ue("ZodISODate",(e,t)=>{uU.init(e,t),qt.init(e,t)});function d$(e){return g3(f$,e)}const h$=ue("ZodISOTime",(e,t)=>{fU.init(e,t),qt.init(e,t)});function p$(e){return y3(h$,e)}const m$=ue("ZodISODuration",(e,t)=>{dU.init(e,t),qt.init(e,t)});function g$(e){return v3(m$,e)}const y$=(e,t)=>{B1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>n5(e,n)},flatten:{value:n=>t5(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,fv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,fv,2)}},isEmpty:{get(){return e.issues.length===0}}})},Zr=ue("ZodError",y$,{Parent:Error}),v$=_b(Zr),b$=wb(Zr),x$=op(Zr),S$=ip(Zr),_$=o5(Zr),w$=i5(Zr),E$=a5(Zr),T$=c5(Zr),C$=l5(Zr),R$=u5(Zr),N$=f5(Zr),j$=d5(Zr),Ht=ue("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ch(e,"input"),output:Ch(e,"output")}}),e.toJSONSchema=$3(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)=>v$(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>x$(e,n,s),e.parseAsync=async(n,s)=>b$(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>S$(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>_$(e,n,s),e.decode=(n,s)=>w$(e,n,s),e.encodeAsync=async(n,s)=>E$(e,n,s),e.decodeAsync=async(n,s)=>T$(e,n,s),e.safeEncode=(n,s)=>C$(e,n,s),e.safeDecode=(n,s)=>R$(e,n,s),e.safeEncodeAsync=async(n,s)=>N$(e,n,s),e.safeDecodeAsync=async(n,s)=>j$(e,n,s),e.refine=(n,s)=>e.check(_B(n,s)),e.superRefine=n=>e.check(wB(n)),e.overwrite=n=>e.check(Qc(n)),e.optional=()=>DE(e),e.exactOptional=()=>lB(e),e.nullable=()=>zE(e),e.nullish=()=>DE(zE(e)),e.nonoptional=n=>mB(e,n),e.array=()=>Gr(e),e.or=n=>Cb([e,n]),e.and=n=>rB(e,n),e.transform=n=>LE(e,aB(n)),e.default=n=>dB(e,n),e.prefault=n=>pB(e,n),e.catch=n=>yB(e,n),e.pipe=n=>LE(e,n),e.readonly=()=>xB(e),e.describe=n=>{const s=e.clone();return ou.add(s,{description:n}),s},Object.defineProperty(e,"description",{get(){return ou.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ou.get(e);const s=e.clone();return ou.add(s,n[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),aN=ue("_ZodString",(e,t)=>{Eb.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>F3(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(T3(...s)),e.includes=(...s)=>e.check(N3(...s)),e.startsWith=(...s)=>e.check(j3(...s)),e.endsWith=(...s)=>e.check(A3(...s)),e.min=(...s)=>e.check(Th(...s)),e.max=(...s)=>e.check(tN(...s)),e.length=(...s)=>e.check(nN(...s)),e.nonempty=(...s)=>e.check(Th(1,...s)),e.lowercase=s=>e.check(C3(s)),e.uppercase=s=>e.check(R3(s)),e.trim=()=>e.check(O3()),e.normalize=(...s)=>e.check(k3(...s)),e.toLowerCase=()=>e.check(M3()),e.toUpperCase=()=>e.check(I3()),e.slugify=()=>e.check(P3())}),A$=ue("ZodString",(e,t)=>{Eb.init(e,t),aN.init(e,t),e.email=n=>e.check(ZU(k$,n)),e.url=n=>e.check(JU(O$,n)),e.jwt=n=>e.check(p3(G$,n)),e.emoji=n=>e.check(e3(M$,n)),e.guid=n=>e.check(AE(IE,n)),e.uuid=n=>e.check(YU(jd,n)),e.uuidv4=n=>e.check(XU(jd,n)),e.uuidv6=n=>e.check(QU(jd,n)),e.uuidv7=n=>e.check(WU(jd,n)),e.nanoid=n=>e.check(t3(I$,n)),e.guid=n=>e.check(AE(IE,n)),e.cuid=n=>e.check(n3(P$,n)),e.cuid2=n=>e.check(r3(D$,n)),e.ulid=n=>e.check(s3(z$,n)),e.base64=n=>e.check(f3(q$,n)),e.base64url=n=>e.check(d3(V$,n)),e.xid=n=>e.check(o3(L$,n)),e.ksuid=n=>e.check(i3(U$,n)),e.ipv4=n=>e.check(a3($$,n)),e.ipv6=n=>e.check(c3(B$,n)),e.cidrv4=n=>e.check(l3(F$,n)),e.cidrv6=n=>e.check(u3(H$,n)),e.e164=n=>e.check(h3(K$,n)),e.datetime=n=>e.check(u$(n)),e.date=n=>e.check(d$(n)),e.time=n=>e.check(p$(n)),e.duration=n=>e.check(g$(n))});function Fe(e){return GU(A$,e)}const qt=ue("ZodStringFormat",(e,t)=>{Bt.init(e,t),aN.init(e,t)}),k$=ue("ZodEmail",(e,t)=>{eU.init(e,t),qt.init(e,t)}),IE=ue("ZodGUID",(e,t)=>{W5.init(e,t),qt.init(e,t)}),jd=ue("ZodUUID",(e,t)=>{J5.init(e,t),qt.init(e,t)}),O$=ue("ZodURL",(e,t)=>{tU.init(e,t),qt.init(e,t)}),M$=ue("ZodEmoji",(e,t)=>{nU.init(e,t),qt.init(e,t)}),I$=ue("ZodNanoID",(e,t)=>{rU.init(e,t),qt.init(e,t)}),P$=ue("ZodCUID",(e,t)=>{sU.init(e,t),qt.init(e,t)}),D$=ue("ZodCUID2",(e,t)=>{oU.init(e,t),qt.init(e,t)}),z$=ue("ZodULID",(e,t)=>{iU.init(e,t),qt.init(e,t)}),L$=ue("ZodXID",(e,t)=>{aU.init(e,t),qt.init(e,t)}),U$=ue("ZodKSUID",(e,t)=>{cU.init(e,t),qt.init(e,t)}),$$=ue("ZodIPv4",(e,t)=>{hU.init(e,t),qt.init(e,t)}),B$=ue("ZodIPv6",(e,t)=>{pU.init(e,t),qt.init(e,t)}),F$=ue("ZodCIDRv4",(e,t)=>{mU.init(e,t),qt.init(e,t)}),H$=ue("ZodCIDRv6",(e,t)=>{gU.init(e,t),qt.init(e,t)}),q$=ue("ZodBase64",(e,t)=>{yU.init(e,t),qt.init(e,t)}),V$=ue("ZodBase64URL",(e,t)=>{bU.init(e,t),qt.init(e,t)}),K$=ue("ZodE164",(e,t)=>{xU.init(e,t),qt.init(e,t)}),G$=ue("ZodJWT",(e,t)=>{_U.init(e,t),qt.init(e,t)}),Tb=ue("ZodNumber",(e,t)=>{Q1.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>H3(e,s,i),e.gt=(s,i)=>e.check(OE(s,i)),e.gte=(s,i)=>e.check(ey(s,i)),e.min=(s,i)=>e.check(ey(s,i)),e.lt=(s,i)=>e.check(kE(s,i)),e.lte=(s,i)=>e.check(Jg(s,i)),e.max=(s,i)=>e.check(Jg(s,i)),e.int=s=>e.check(PE(s)),e.safe=s=>e.check(PE(s)),e.positive=s=>e.check(OE(0,s)),e.nonnegative=s=>e.check(ey(0,s)),e.negative=s=>e.check(kE(0,s)),e.nonpositive=s=>e.check(Jg(0,s)),e.multipleOf=(s,i)=>e.check(ME(s,i)),e.step=(s,i)=>e.check(ME(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 b3(Tb,e)}const Z$=ue("ZodNumberFormat",(e,t)=>{wU.init(e,t),Tb.init(e,t)});function PE(e){return S3(Z$,e)}const Y$=ue("ZodBoolean",(e,t)=>{EU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>q3(e,n,s)});function no(e){return _3(Y$,e)}const X$=ue("ZodUnknown",(e,t)=>{TU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>K3()});function aa(){return w3(X$)}const Q$=ue("ZodNever",(e,t)=>{CU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>V3(e,n,s)});function W$(e){return E3(Q$,e)}const J$=ue("ZodArray",(e,t)=>{RU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Q3(e,n,s,i),e.element=t.element,e.min=(n,s)=>e.check(Th(n,s)),e.nonempty=n=>e.check(Th(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 D3(J$,e,t)}const eB=ue("ZodObject",(e,t)=>{jU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>W3(e,n,s,i),wt(e,"shape",()=>t.shape),e.keyof=()=>Vu(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:W$()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>X4(e,n),e.safeExtend=n=>Q4(e,n),e.merge=n=>W4(e,n),e.pick=n=>Z4(e,n),e.omit=n=>Y4(e,n),e.partial=(...n)=>J4(cN,e,n[0]),e.required=(...n)=>e5(lN,e,n[0])});function At(e,t){const n={type:"object",shape:e??{},...De(t)};return new eB(n)}const tB=ue("ZodUnion",(e,t)=>{AU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>J3(e,n,s,i),e.options=t.options});function Cb(e,t){return new tB({type:"union",options:e,...De(t)})}const nB=ue("ZodIntersection",(e,t)=>{kU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>e$(e,n,s,i)});function rB(e,t){return new nB({type:"intersection",left:e,right:t})}const sB=ue("ZodRecord",(e,t)=>{OU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>t$(e,n,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function qu(e,t,n){return new sB({type:"record",keyType:e,valueType:t,...De(n)})}const hv=ue("ZodEnum",(e,t)=>{MU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>G3(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 hv({...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 hv({...t,checks:[],...De(i),entries:a})}});function Vu(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new hv({type:"enum",entries:n,...De(t)})}const oB=ue("ZodLiteral",(e,t)=>{IU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Z3(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 oB({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const iB=ue("ZodTransform",(e,t)=>{PU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>X3(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(xu(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(xu(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function aB(e){return new iB({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 DE(e){return new cN({type:"optional",innerType:e})}const cB=ue("ZodExactOptional",(e,t)=>{DU.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 lB(e){return new cB({type:"optional",innerType:e})}const uB=ue("ZodNullable",(e,t)=>{zU.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 zE(e){return new uB({type:"nullable",innerType:e})}const fB=ue("ZodDefault",(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,e.removeDefault=e.unwrap});function dB(e,t){return new fB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():U1(t)}})}const hB=ue("ZodPrefault",(e,t)=>{UU.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 pB(e,t){return new hB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():U1(t)}})}const lN=ue("ZodNonOptional",(e,t)=>{$U.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>r$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function mB(e,t){return new lN({type:"nonoptional",innerType:e,...De(t)})}const gB=ue("ZodCatch",(e,t)=>{BU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>i$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function yB(e,t){return new gB({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const vB=ue("ZodPipe",(e,t)=>{FU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>a$(e,n,s,i),e.in=t.in,e.out=t.out});function LE(e,t){return new vB({type:"pipe",in:e,out:t})}const bB=ue("ZodReadonly",(e,t)=>{HU.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 xB(e){return new bB({type:"readonly",innerType:e})}const SB=ue("ZodCustom",(e,t)=>{qU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Y3(e,n)});function _B(e,t={}){return z3(SB,e,t)}function wB(e){return L3(e)}function UE(e){return x3(Tb,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:Vu(["PUT","POST"]).optional(),uploadHeaders:qu(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:UE().int().min(1).max(100).default(50),offset:UE().int().min(0).default(0)});const EB="json-row-frame-v1",TB="gzip",fN=Vu(["upsert","delete"]),CB=qu(Fe(),Fe()),dN=qu(Fe(),Cb([Fe(),Gr(Fe())])),RB=At({table:Fe(),row_id:Fe(),op:fN,payload:qu(Fe(),aa()).nullable(),base_version:tn().int().nullable().optional()}),NB=At({clientId:Fe().min(1),clientCommitId:Fe().min(1),operations:Gr(RB).min(1),schemaVersion:tn().int().min(1)}),jB=At({opIndex:tn().int(),status:si("applied")}),AB=At({opIndex:tn().int(),status:si("conflict"),message:Fe(),server_version:tn().int(),server_row:aa()}),kB=At({opIndex:tn().int(),status:si("error"),error:Fe(),code:Fe().optional(),retriable:no().optional()}),OB=Cb([jB,AB,kB]),MB=At({ok:si(!0),status:Vu(["applied","cached","rejected"]),commitSeq:tn().int().optional(),results:Gr(OB)}),hN=At({asOfCommitSeq:tn().int(),tables:Gr(Fe()),tableIndex:tn().int(),rowCursor:Fe().nullable()}),IB=At({id:Fe().min(1),table:Fe().min(1),scopes:dN,params:qu(Fe(),aa()).optional(),cursor:tn().int(),bootstrapState:hN.nullable().optional()}),PB=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(IB)}),DB=At({table:Fe(),row_id:Fe(),op:fN,row_json:aa().nullable(),row_version:tn().int().nullable(),scopes:CB}),zB=At({commitSeq:tn().int(),createdAt:Fe(),actorId:Fe(),changes:Gr(DB)}),LB=At({id:Fe(),byteLength:tn().int(),sha256:Fe(),encoding:si(EB),compression:si(TB)}),UB=At({table:Fe(),rows:Gr(aa()),chunks:Gr(LB).optional(),isFirstPage:no(),isLastPage:no()}),$B=At({id:Fe(),status:Vu(["active","revoked"]),scopes:dN,bootstrap:no(),bootstrapState:hN.nullable().optional(),nextCursor:tn().int(),commits:Gr(zB),snapshots:Gr(UB).optional()}),BB=At({ok:si(!0),subscriptions:Gr($B)});At({clientId:Fe().min(1),push:NB.omit({clientId:!0}).optional(),pull:PB.omit({clientId:!0}).optional()});At({ok:si(!0),push:MB.optional(),pull:BB.optional()});new TextEncoder;const FB={setAttribute(){},setAttributes(){},setStatus(){}};function HB(e){return e.level?e.level:e.error?"error":"info"}function ty(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 qB(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 VB(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 $E(e){const t={};for(const[n,s]of Object.entries(e)){const i=VB(s);i!==void 0&&(t[n]=i)}return Object.keys(t).length>0?t:null}function KB(e){return{startSpan(t,n){return e.startSpan?e.startSpan(t,s=>n(qB(s))):n(FB)}}}function GB(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 ZB(e){return{log(t){const n=HB(t),{event:s,...i}=t,a=ty(e.logger,n);if(!a)return;const l=$E(i);if(!l){a(s);return}a(s,l)},tracer:KB(e),metrics:GB(e),captureException(t,n){if(e.captureException?.(t),!n)return;const s=ty(e.logger,"error")??ty(e.logger,"info");if(!s)return;const i=$E(n);if(!i){s("sync.exception.context");return}s("sync.exception.context",i)}}}function YB(e){if(e?.attributes)return{attributes:e.attributes}}function BE(e){if(!e)return;const t=!!e.attributes,n=!!e.unit;if(!(!t&&!n))return{attributes:e.attributes,unit:e.unit}}function XB(){return ZB({logger:xz,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=YB(n);if(s){tE(e,t,s);return}tE(e,t)},gauge(e,t,n){const s=BE(n);if(s){nE(e,t,s);return}nE(e,t)},distribution(e,t,n){const s=BE(n);if(s){rE(e,t,s);return}rE(e,t)}},captureException(e){DR(e)}})}function QB(){return XB()}function WB(e){const t=JB(e);return B4(t),QB()}function JB(e){const t=e.integrations;if(typeof t=="function")return e;const n=t??[];return n.some(i=>i.name==="BrowserTracing")?e:{...e,integrations:[P4(),...n]}}var ny={exports:{}},Yl={};var FE;function e6(){if(FE)return Yl;FE=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 Yl.Fragment=t,Yl.jsx=n,Yl.jsxs=n,Yl}var HE;function t6(){return HE||(HE=1,ny.exports=e6()),ny.exports}var h=t6(),ry={exports:{}},Xl={},sy={exports:{}},oy={};var qE;function n6(){return qE||(qE=1,(function(e){function t(D,G){var q=D.length;D.push(G);e:for(;0<q;){var V=q-1>>>1,L=D[V];if(0<i(L,G))D[V]=G,D[q]=L,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 G=D[0],q=D.pop();if(q!==G){D[0]=q;e:for(var V=0,L=D.length,I=L>>>1;V<I;){var H=2*(V+1)-1,W=D[H],Y=H+1,ae=D[Y];if(0>i(W,q))Y<L&&0>i(ae,W)?(D[V]=ae,D[Y]=q,V=Y):(D[V]=W,D[H]=q,V=H);else if(Y<L&&0>i(ae,q))D[V]=ae,D[Y]=q,V=Y;else break e}}return G}function i(D,G){var q=D.sortIndex-G.sortIndex;return q!==0?q:D.id-G.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 G=n(p);G!==null;){if(G.callback===null)s(p);else if(G.startTime<=D)s(p),G.sortIndex=G.expirationTime,t(d,G);else break;G=n(p)}}function M(D){if(w=!1,R(D),!S)if(n(d)!==null)S=!0,z||(z=!0,U());else{var G=n(p);G!==null&&ee(M,G.startTime-D)}}var z=!1,j=-1,A=5,P=-1;function Q(){return T?!0:!(e.unstable_now()-P<A)}function B(){if(T=!1,z){var D=e.unstable_now();P=D;var G=!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&&Q());){var V=y.callback;if(typeof V=="function"){y.callback=null,b=y.priorityLevel;var L=V(y.expirationTime<=D);if(D=e.unstable_now(),typeof L=="function"){y.callback=L,R(D),G=!0;break t}y===n(d)&&s(d),R(D)}else s(d);y=n(d)}if(y!==null)G=!0;else{var I=n(p);I!==null&&ee(M,I.startTime-D),G=!1}}break e}finally{y=null,b=q,x=!1}G=void 0}}finally{G?U():z=!1}}}var U;if(typeof N=="function")U=function(){N(B)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,K=Z.port2;Z.port1.onmessage=B,U=function(){K.postMessage(null)}}else U=function(){C(B,0)};function ee(D,G){j=C(function(){D(e.unstable_now())},G)}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 G=3;break;default:G=b}var q=b;b=G;try{return D()}finally{b=q}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(D,G){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var q=b;b=D;try{return G()}finally{b=q}},e.unstable_scheduleCallback=function(D,G,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 L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=q+L,D={id:g++,callback:G,priorityLevel:D,startTime:q,expirationTime:L,sortIndex:-1},q>V?(D.sortIndex=q,t(p,D),n(d)===null&&D===n(p)&&(w?(O(j),j=-1):w=!0,ee(M,q-V))):(D.sortIndex=L,t(d,D),S||x||(S=!0,z||(z=!0,U()))),D},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(D){var G=b;return function(){var q=b;b=G;try{return D.apply(this,arguments)}finally{b=q}}}})(oy)),oy}var VE;function r6(){return VE||(VE=1,sy.exports=n6()),sy.exports}var iy={exports:{}},Rn={};var KE;function s6(){if(KE)return Rn;KE=1;var e=Hu();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 GE;function pN(){if(GE)return iy.exports;GE=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 ZE;function o6(){if(ZE)return Xl;ZE=1;var e=r6(),t=Hu(),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"),z=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function U(r){return r===null||typeof r!="object"?null:(r=B&&r[B]||r["@@iterator"],typeof r=="function"?r:null)}var Z=Symbol.for("react.client.reference");function K(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Z?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 z: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:K(r.type)||"Memo";case A:o=r._payload,r=r._init;try{return K(r(o))}catch{}}return null}var ee=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},V=[],L=-1;function I(r){return{current:r}}function H(r){0>L||(r.current=V[L],V[L]=null,L--)}function W(r,o){L++,V[L]=r.current,r.current=o}var Y=I(null),ae=I(null),se=I(null),fe=I(null);function Se(r,o){switch(W(se,o),W(ae,r),W(Y,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(Y),W(Y,r)}function pe(){H(Y),H(ae),H(se)}function Me(r){r.memoizedState!==null&&W(fe,r);var o=Y.current,c=O_(o,r.type);o!==c&&(W(ae,r),W(Y,c))}function _e(r){ae.current===r&&(H(Y),H(ae)),fe.current===r&&(H(fe),ql._currentValue=q)}var re,he;function ie(r){if(re===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);re=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 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:Ch(t,"input",e.processors),output:Ch(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 B3=(e,t={})=>n=>{const s=rN({...n,processors:t});return ln(e,s),sN(s,e),oN(s,e)},Ch=(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)},F3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},H3=(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=F3[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}))])}},q3=(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)},V3=(e,t,n,s)=>{n.type="boolean"},G3=(e,t,n,s)=>{n.not={}},K3=(e,t,n,s)=>{},Z3=(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},Y3=(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},X3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Q3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},W3=(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"]})},J3=(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)},e$=(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},t$=(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},n$=(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)}},r$=(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"}]},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},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,n.default=JSON.parse(JSON.stringify(i.defaultValue))},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,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},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;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},c$=(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},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,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},u$=ue("ZodISODateTime",(e,t)=>{uU.init(e,t),qt.init(e,t)});function f$(e){return g3(u$,e)}const d$=ue("ZodISODate",(e,t)=>{fU.init(e,t),qt.init(e,t)});function h$(e){return y3(d$,e)}const p$=ue("ZodISOTime",(e,t)=>{dU.init(e,t),qt.init(e,t)});function m$(e){return v3(p$,e)}const g$=ue("ZodISODuration",(e,t)=>{hU.init(e,t),qt.init(e,t)});function y$(e){return b3(g$,e)}const v$=(e,t)=>{B1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>r5(e,n)},flatten:{value:n=>n5(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,fv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,fv,2)}},isEmpty:{get(){return e.issues.length===0}}})},Zr=ue("ZodError",v$,{Parent:Error}),b$=_b(Zr),x$=wb(Zr),S$=op(Zr),_$=ip(Zr),w$=i5(Zr),E$=a5(Zr),T$=c5(Zr),C$=l5(Zr),R$=u5(Zr),N$=f5(Zr),j$=d5(Zr),A$=h5(Zr),Ht=ue("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ch(e,"input"),output:Ch(e,"output")}}),e.toJSONSchema=B3(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)=>b$(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>S$(e,n,s),e.parseAsync=async(n,s)=>x$(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>_$(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>w$(e,n,s),e.decode=(n,s)=>E$(e,n,s),e.encodeAsync=async(n,s)=>T$(e,n,s),e.decodeAsync=async(n,s)=>C$(e,n,s),e.safeEncode=(n,s)=>R$(e,n,s),e.safeDecode=(n,s)=>N$(e,n,s),e.safeEncodeAsync=async(n,s)=>j$(e,n,s),e.safeDecodeAsync=async(n,s)=>A$(e,n,s),e.refine=(n,s)=>e.check(wB(n,s)),e.superRefine=n=>e.check(EB(n)),e.overwrite=n=>e.check(Qc(n)),e.optional=()=>DE(e),e.exactOptional=()=>uB(e),e.nullable=()=>zE(e),e.nullish=()=>DE(zE(e)),e.nonoptional=n=>gB(e,n),e.array=()=>Kr(e),e.or=n=>Cb([e,n]),e.and=n=>sB(e,n),e.transform=n=>LE(e,cB(n)),e.default=n=>hB(e,n),e.prefault=n=>mB(e,n),e.catch=n=>vB(e,n),e.pipe=n=>LE(e,n),e.readonly=()=>SB(e),e.describe=n=>{const s=e.clone();return ou.add(s,{description:n}),s},Object.defineProperty(e,"description",{get(){return ou.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ou.get(e);const s=e.clone();return ou.add(s,n[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),aN=ue("_ZodString",(e,t)=>{Eb.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>H3(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(C3(...s)),e.includes=(...s)=>e.check(j3(...s)),e.startsWith=(...s)=>e.check(A3(...s)),e.endsWith=(...s)=>e.check(k3(...s)),e.min=(...s)=>e.check(Th(...s)),e.max=(...s)=>e.check(tN(...s)),e.length=(...s)=>e.check(nN(...s)),e.nonempty=(...s)=>e.check(Th(1,...s)),e.lowercase=s=>e.check(R3(s)),e.uppercase=s=>e.check(N3(s)),e.trim=()=>e.check(M3()),e.normalize=(...s)=>e.check(O3(...s)),e.toLowerCase=()=>e.check(I3()),e.toUpperCase=()=>e.check(P3()),e.slugify=()=>e.check(D3())}),k$=ue("ZodString",(e,t)=>{Eb.init(e,t),aN.init(e,t),e.email=n=>e.check(YU(O$,n)),e.url=n=>e.check(e3(M$,n)),e.jwt=n=>e.check(m3(Z$,n)),e.emoji=n=>e.check(t3(I$,n)),e.guid=n=>e.check(AE(IE,n)),e.uuid=n=>e.check(XU(jd,n)),e.uuidv4=n=>e.check(QU(jd,n)),e.uuidv6=n=>e.check(WU(jd,n)),e.uuidv7=n=>e.check(JU(jd,n)),e.nanoid=n=>e.check(n3(P$,n)),e.guid=n=>e.check(AE(IE,n)),e.cuid=n=>e.check(r3(D$,n)),e.cuid2=n=>e.check(s3(z$,n)),e.ulid=n=>e.check(o3(L$,n)),e.base64=n=>e.check(d3(V$,n)),e.base64url=n=>e.check(h3(G$,n)),e.xid=n=>e.check(i3(U$,n)),e.ksuid=n=>e.check(a3($$,n)),e.ipv4=n=>e.check(c3(B$,n)),e.ipv6=n=>e.check(l3(F$,n)),e.cidrv4=n=>e.check(u3(H$,n)),e.cidrv6=n=>e.check(f3(q$,n)),e.e164=n=>e.check(p3(K$,n)),e.datetime=n=>e.check(f$(n)),e.date=n=>e.check(h$(n)),e.time=n=>e.check(m$(n)),e.duration=n=>e.check(y$(n))});function Fe(e){return ZU(k$,e)}const qt=ue("ZodStringFormat",(e,t)=>{Bt.init(e,t),aN.init(e,t)}),O$=ue("ZodEmail",(e,t)=>{tU.init(e,t),qt.init(e,t)}),IE=ue("ZodGUID",(e,t)=>{J5.init(e,t),qt.init(e,t)}),jd=ue("ZodUUID",(e,t)=>{eU.init(e,t),qt.init(e,t)}),M$=ue("ZodURL",(e,t)=>{nU.init(e,t),qt.init(e,t)}),I$=ue("ZodEmoji",(e,t)=>{rU.init(e,t),qt.init(e,t)}),P$=ue("ZodNanoID",(e,t)=>{sU.init(e,t),qt.init(e,t)}),D$=ue("ZodCUID",(e,t)=>{oU.init(e,t),qt.init(e,t)}),z$=ue("ZodCUID2",(e,t)=>{iU.init(e,t),qt.init(e,t)}),L$=ue("ZodULID",(e,t)=>{aU.init(e,t),qt.init(e,t)}),U$=ue("ZodXID",(e,t)=>{cU.init(e,t),qt.init(e,t)}),$$=ue("ZodKSUID",(e,t)=>{lU.init(e,t),qt.init(e,t)}),B$=ue("ZodIPv4",(e,t)=>{pU.init(e,t),qt.init(e,t)}),F$=ue("ZodIPv6",(e,t)=>{mU.init(e,t),qt.init(e,t)}),H$=ue("ZodCIDRv4",(e,t)=>{gU.init(e,t),qt.init(e,t)}),q$=ue("ZodCIDRv6",(e,t)=>{yU.init(e,t),qt.init(e,t)}),V$=ue("ZodBase64",(e,t)=>{vU.init(e,t),qt.init(e,t)}),G$=ue("ZodBase64URL",(e,t)=>{xU.init(e,t),qt.init(e,t)}),K$=ue("ZodE164",(e,t)=>{SU.init(e,t),qt.init(e,t)}),Z$=ue("ZodJWT",(e,t)=>{wU.init(e,t),qt.init(e,t)}),Tb=ue("ZodNumber",(e,t)=>{Q1.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>q3(e,s,i),e.gt=(s,i)=>e.check(OE(s,i)),e.gte=(s,i)=>e.check(ey(s,i)),e.min=(s,i)=>e.check(ey(s,i)),e.lt=(s,i)=>e.check(kE(s,i)),e.lte=(s,i)=>e.check(Jg(s,i)),e.max=(s,i)=>e.check(Jg(s,i)),e.int=s=>e.check(PE(s)),e.safe=s=>e.check(PE(s)),e.positive=s=>e.check(OE(0,s)),e.nonnegative=s=>e.check(ey(0,s)),e.negative=s=>e.check(kE(0,s)),e.nonpositive=s=>e.check(Jg(0,s)),e.multipleOf=(s,i)=>e.check(ME(s,i)),e.step=(s,i)=>e.check(ME(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 x3(Tb,e)}const Y$=ue("ZodNumberFormat",(e,t)=>{EU.init(e,t),Tb.init(e,t)});function PE(e){return _3(Y$,e)}const X$=ue("ZodBoolean",(e,t)=>{TU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>V3(e,n,s)});function no(e){return w3(X$,e)}const Q$=ue("ZodUnknown",(e,t)=>{CU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>K3()});function aa(){return E3(Q$)}const W$=ue("ZodNever",(e,t)=>{RU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>G3(e,n,s)});function J$(e){return T3(W$,e)}const eB=ue("ZodArray",(e,t)=>{NU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>W3(e,n,s,i),e.element=t.element,e.min=(n,s)=>e.check(Th(n,s)),e.nonempty=n=>e.check(Th(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 Kr(e,t){return z3(eB,e,t)}const tB=ue("ZodObject",(e,t)=>{AU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>J3(e,n,s,i),wt(e,"shape",()=>t.shape),e.keyof=()=>Vu(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:J$()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Q4(e,n),e.safeExtend=n=>W4(e,n),e.merge=n=>J4(e,n),e.pick=n=>Y4(e,n),e.omit=n=>X4(e,n),e.partial=(...n)=>e5(cN,e,n[0]),e.required=(...n)=>t5(lN,e,n[0])});function At(e,t){const n={type:"object",shape:e??{},...De(t)};return new tB(n)}const nB=ue("ZodUnion",(e,t)=>{kU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>e$(e,n,s,i),e.options=t.options});function Cb(e,t){return new nB({type:"union",options:e,...De(t)})}const rB=ue("ZodIntersection",(e,t)=>{OU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>t$(e,n,s,i)});function sB(e,t){return new rB({type:"intersection",left:e,right:t})}const oB=ue("ZodRecord",(e,t)=>{MU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>n$(e,n,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function qu(e,t,n){return new oB({type:"record",keyType:e,valueType:t,...De(n)})}const hv=ue("ZodEnum",(e,t)=>{IU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>Z3(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 hv({...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 hv({...t,checks:[],...De(i),entries:a})}});function Vu(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new hv({type:"enum",entries:n,...De(t)})}const iB=ue("ZodLiteral",(e,t)=>{PU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Y3(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 iB({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const aB=ue("ZodTransform",(e,t)=>{DU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Q3(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(xu(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(xu(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function cB(e){return new aB({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 DE(e){return new cN({type:"optional",innerType:e})}const lB=ue("ZodExactOptional",(e,t)=>{zU.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 uB(e){return new lB({type:"optional",innerType:e})}const fB=ue("ZodNullable",(e,t)=>{LU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>r$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function zE(e){return new fB({type:"nullable",innerType:e})}const dB=ue("ZodDefault",(e,t)=>{UU.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.removeDefault=e.unwrap});function hB(e,t){return new dB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():U1(t)}})}const pB=ue("ZodPrefault",(e,t)=>{$U.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 mB(e,t){return new pB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():U1(t)}})}const lN=ue("ZodNonOptional",(e,t)=>{BU.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 gB(e,t){return new lN({type:"nonoptional",innerType:e,...De(t)})}const yB=ue("ZodCatch",(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,e.removeCatch=e.unwrap});function vB(e,t){return new yB({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const bB=ue("ZodPipe",(e,t)=>{HU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>c$(e,n,s,i),e.in=t.in,e.out=t.out});function LE(e,t){return new bB({type:"pipe",in:e,out:t})}const xB=ue("ZodReadonly",(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});function SB(e){return new xB({type:"readonly",innerType:e})}const _B=ue("ZodCustom",(e,t)=>{VU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>X3(e,n)});function wB(e,t={}){return L3(_B,e,t)}function EB(e){return U3(e)}function UE(e){return S3(Tb,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:Vu(["PUT","POST"]).optional(),uploadHeaders:qu(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:UE().int().min(1).max(100).default(50),offset:UE().int().min(0).default(0)});const TB="json-row-frame-v1",CB="gzip",fN=Vu(["upsert","delete"]),RB=qu(Fe(),Fe()),dN=qu(Fe(),Cb([Fe(),Kr(Fe())])),NB=At({table:Fe(),row_id:Fe(),op:fN,payload:qu(Fe(),aa()).nullable(),base_version:tn().int().nullable().optional()}),jB=At({clientId:Fe().min(1),clientCommitId:Fe().min(1),operations:Kr(NB).min(1),schemaVersion:tn().int().min(1)}),AB=At({opIndex:tn().int(),status:si("applied")}),kB=At({opIndex:tn().int(),status:si("conflict"),message:Fe(),server_version:tn().int(),server_row:aa()}),OB=At({opIndex:tn().int(),status:si("error"),error:Fe(),code:Fe().optional(),retriable:no().optional()}),MB=Cb([AB,kB,OB]),IB=At({ok:si(!0),status:Vu(["applied","cached","rejected"]),commitSeq:tn().int().optional(),results:Kr(MB)}),hN=At({asOfCommitSeq:tn().int(),tables:Kr(Fe()),tableIndex:tn().int(),rowCursor:Fe().nullable()}),PB=At({id:Fe().min(1),table:Fe().min(1),scopes:dN,params:qu(Fe(),aa()).optional(),cursor:tn().int(),bootstrapState:hN.nullable().optional()}),DB=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:Kr(PB)}),zB=At({table:Fe(),row_id:Fe(),op:fN,row_json:aa().nullable(),row_version:tn().int().nullable(),scopes:RB}),LB=At({commitSeq:tn().int(),createdAt:Fe(),actorId:Fe(),changes:Kr(zB)}),UB=At({id:Fe(),byteLength:tn().int(),sha256:Fe(),encoding:si(TB),compression:si(CB)}),$B=At({table:Fe(),rows:Kr(aa()),chunks:Kr(UB).optional(),isFirstPage:no(),isLastPage:no()}),BB=At({id:Fe(),status:Vu(["active","revoked"]),scopes:dN,bootstrap:no(),bootstrapState:hN.nullable().optional(),nextCursor:tn().int(),commits:Kr(LB),snapshots:Kr($B).optional()}),FB=At({ok:si(!0),subscriptions:Kr(BB)});At({clientId:Fe().min(1),push:jB.omit({clientId:!0}).optional(),pull:DB.omit({clientId:!0}).optional()});At({ok:si(!0),push:IB.optional(),pull:FB.optional()});new TextEncoder;const HB={setAttribute(){},setAttributes(){},setStatus(){}};function qB(e){return e.level?e.level:e.error?"error":"info"}function ty(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 VB(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 GB(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 $E(e){const t={};for(const[n,s]of Object.entries(e)){const i=GB(s);i!==void 0&&(t[n]=i)}return Object.keys(t).length>0?t:null}function KB(e){return{startSpan(t,n){return e.startSpan?e.startSpan(t,s=>n(VB(s))):n(HB)}}}function ZB(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 YB(e){return{log(t){const n=qB(t),{event:s,...i}=t,a=ty(e.logger,n);if(!a)return;const l=$E(i);if(!l){a(s);return}a(s,l)},tracer:KB(e),metrics:ZB(e),captureException(t,n){if(e.captureException?.(t),!n)return;const s=ty(e.logger,"error")??ty(e.logger,"info");if(!s)return;const i=$E(n);if(!i){s("sync.exception.context");return}s("sync.exception.context",i)}}}function XB(e){if(e?.attributes)return{attributes:e.attributes}}function BE(e){if(!e)return;const t=!!e.attributes,n=!!e.unit;if(!(!t&&!n))return{attributes:e.attributes,unit:e.unit}}function QB(){return YB({logger:S2,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=XB(n);if(s){tE(e,t,s);return}tE(e,t)},gauge(e,t,n){const s=BE(n);if(s){nE(e,t,s);return}nE(e,t)},distribution(e,t,n){const s=BE(n);if(s){rE(e,t,s);return}rE(e,t)}},captureException(e){DR(e)}})}function WB(){return QB()}function JB(e){const t=e6(e);return F4(t),WB()}function e6(e){const t=e.integrations;if(typeof t=="function")return e;const n=t??[];return n.some(i=>i.name==="BrowserTracing")?e:{...e,integrations:[D4(),...n]}}var ny={exports:{}},Yl={};var FE;function t6(){if(FE)return Yl;FE=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 Yl.Fragment=t,Yl.jsx=n,Yl.jsxs=n,Yl}var HE;function n6(){return HE||(HE=1,ny.exports=t6()),ny.exports}var h=n6(),ry={exports:{}},Xl={},sy={exports:{}},oy={};var qE;function r6(){return qE||(qE=1,(function(e){function t(D,K){var q=D.length;D.push(K);e:for(;0<q;){var V=q-1>>>1,L=D[V];if(0<i(L,K))D[V]=K,D[q]=L,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,L=D.length,I=L>>>1;V<I;){var H=2*(V+1)-1,W=D[H],Y=H+1,ae=D[Y];if(0>i(W,q))Y<L&&0>i(ae,W)?(D[V]=ae,D[Y]=q,V=Y):(D[V]=W,D[H]=q,V=H);else if(Y<L&&0>i(ae,q))D[V]=ae,D[Y]=q,V=Y;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,O=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,z||(z=!0,U());else{var K=n(p);K!==null&&ee(M,K.startTime-D)}}var z=!1,j=-1,A=5,P=-1;function Q(){return T?!0:!(e.unstable_now()-P<A)}function B(){if(T=!1,z){var D=e.unstable_now();P=D;var K=!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&&Q());){var V=y.callback;if(typeof V=="function"){y.callback=null,b=y.priorityLevel;var L=V(y.expirationTime<=D);if(D=e.unstable_now(),typeof L=="function"){y.callback=L,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?U():z=!1}}}var U;if(typeof N=="function")U=function(){N(B)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,G=Z.port2;Z.port1.onmessage=B,U=function(){G.postMessage(null)}}else U=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 L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=q+L,D={id:g++,callback:K,priorityLevel:D,startTime:q,expirationTime:L,sortIndex:-1},q>V?(D.sortIndex=q,t(p,D),n(d)===null&&D===n(p)&&(w?(O(j),j=-1):w=!0,ee(M,q-V))):(D.sortIndex=L,t(d,D),S||x||(S=!0,z||(z=!0,U()))),D},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(D){var K=b;return function(){var q=b;b=K;try{return D.apply(this,arguments)}finally{b=q}}}})(oy)),oy}var VE;function s6(){return VE||(VE=1,sy.exports=r6()),sy.exports}var iy={exports:{}},Rn={};var GE;function o6(){if(GE)return Rn;GE=1;var e=Hu();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 iy.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(),iy.exports=o6(),iy.exports}var ZE;function i6(){if(ZE)return Xl;ZE=1;var e=s6(),t=Hu(),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"),z=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function U(r){return r===null||typeof r!="object"?null:(r=B&&r[B]||r["@@iterator"],typeof r=="function"?r:null)}var Z=Symbol.for("react.client.reference");function G(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Z?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 z: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:G(r.type)||"Memo";case A:o=r._payload,r=r._init;try{return G(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=[],L=-1;function I(r){return{current:r}}function H(r){0>L||(r.current=V[L],V[L]=null,L--)}function W(r,o){L++,V[L]=r.current,r.current=o}var Y=I(null),ae=I(null),se=I(null),fe=I(null);function Se(r,o){switch(W(se,o),W(ae,r),W(Y,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(Y),W(Y,r)}function pe(){H(Y),H(ae),H(se)}function Me(r){r.memoizedState!==null&&W(fe,r);var o=Y.current,c=O_(o,r.type);o!==c&&(W(ae,r),W(Y,c))}function _e(r){ae.current===r&&(H(Y),H(ae)),fe.current===r&&(H(fe),ql._currentValue=q)}var re,he;function ie(r){if(re===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);re=o&&o[1]||"",he=-1<c.stack.indexOf(`
60
60
  at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
61
61
  `+re+r+he}var we=!1;function ye(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 de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(oe){var ne=oe}Reflect.construct(r,[],de)}else{try{de.call()}catch(oe){ne=oe}r.call(de.prototype)}}else{try{throw Error()}catch(oe){ne=oe}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(oe){if(oe&&ne&&typeof oe.stack=="string")return[oe.stack,ne.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),E=v[0],k=v[1];if(E&&k){var $=E.split(`
62
62
  `),te=k.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:"")?ie(c):""}function xe(r,o){switch(r.tag){case 26:case 27:case 5:return ie(r.type);case 16:return ie("Lazy");case 13:return r.child!==o&&o!==null?ie("Suspense Fallback"):ie("Suspense");case 19:return ie("SuspenseList");case 0:case 15:return ye(r.type,!1);case 11:return ye(r.type.render,!1);case 1:return ye(r.type,!0);case 31:return ie("Activity");default:return""}}function ve(r){try{var o="",c=null;do o+=xe(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 Ie=Object.prototype.hasOwnProperty,Ue=e.unstable_scheduleCallback,Ee=e.unstable_cancelCallback,Ve=e.unstable_shouldYield,Qe=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,ht=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:yn,ot=Math.log,Wt=Math.LN2;function yn(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 is(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 as(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 _s(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),de=1<<ce;k[ce]=0,$[ce]=-1;var ne=te[ce];if(ne!==null)for(te[ce]=null,ce=0;ce<ne.length;ce++){var oe=ne[ce];oe!==null&&(oe.lane&=-536870913)}c&=~de}u!==0&&cs(r,u,0),v!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=v&~(E&~o))}function cs(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 fo(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 ho(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 sl(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function af(){var r=G.p;return r!==0?r:(r=window.event,r===void 0?32:tw(r.type))}function cf(r,o){var c=G.p;try{return G.p=r,o()}finally{G.p=c}}var po=Math.random().toString(36).slice(2),Sn="__reactFiber$"+po,Un="__reactProps$"+po,wa="__reactContainer$"+po,jp="__reactEvents$"+po,bk="__reactListeners$"+po,xk="__reactHandles$"+po,vx="__reactResources$"+po,ol="__reactMarker$"+po;function Ap(r){delete r[Sn],delete r[Un],delete r[jp],delete r[bk],delete r[xk]}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 il(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 vn(r){r[ol]=!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 Sk=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 _k(r){return Ie.call(_x,r)?!0:Ie.call(Sx,r)?!1:Sk.test(r)?_x[r]=!0:(Sx[r]=!0,!1)}function lf(r,o,c){if(_k(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 ws(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 wk(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 kp(r){if(!r._valueTracker){var o=wx(r)?"checked":"value";r._valueTracker=wk(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 Ek=/[\n"\\]/g;function Cr(r){return r.replace(Ek,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Op(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?Mp(r,E,Tr(o)):c!=null?Mp(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)){kp(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),kp(r)}function Mp(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),kp(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 Tk=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||Tk.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 Ip(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ck=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"]]),Rk=/^[\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 Rk.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Es(){}var Pp=null;function Dp(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(Op(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));Op(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 zp=!1;function kx(r,o,c){if(zp)return r(o,c);zp=!0;try{var u=r(o);return u}finally{if(zp=!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 al(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 Ts=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lp=!1;if(Ts)try{var cl={};Object.defineProperty(cl,"passive",{get:function(){Lp=!0}}),window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{Lp=!1}var mo=null,Up=null,hf=null;function Ox(){if(hf)return hf;var r,o=Up,c=o.length,u,m="value"in mo?mo.value:mo.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),ll=y({},Ci,{view:0,detail:0}),Nk=$n(ll),$p,Bp,ul,yf=y({},ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hp,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==ul&&(ul&&r.type==="mousemove"?($p=r.screenX-ul.screenX,Bp=r.screenY-ul.screenY):Bp=$p=0,ul=r),$p)},movementY:function(r){return"movementY"in r?r.movementY:Bp}}),Ix=$n(yf),jk=y({},yf,{dataTransfer:0}),Ak=$n(jk),kk=y({},ll,{relatedTarget:0}),Fp=$n(kk),Ok=y({},Ci,{animationName:0,elapsedTime:0,pseudoElement:0}),Mk=$n(Ok),Ik=y({},Ci,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Pk=$n(Ik),Dk=y({},Ci,{data:0}),Px=$n(Dk),zk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lk={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"},Uk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $k(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=Uk[r])?!!o[r]:!1}function Hp(){return $k}var Bk=y({},ll,{key:function(r){if(r.key){var o=zk[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"?Lk[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hp,charCode:function(r){return r.type==="keypress"?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}}),Fk=$n(Bk),Hk=y({},yf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dx=$n(Hk),qk=y({},ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hp}),Vk=$n(qk),Kk=y({},Ci,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gk=$n(Kk),Zk=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}),Yk=$n(Zk),Xk=y({},Ci,{newState:0,oldState:0}),Qk=$n(Xk),Wk=[9,13,27,32],qp=Ts&&"CompositionEvent"in window,fl=null;Ts&&"documentMode"in document&&(fl=document.documentMode);var Jk=Ts&&"TextEvent"in window&&!fl,zx=Ts&&(!qp||fl&&8<fl&&11>=fl),Lx=" ",Ux=!1;function $x(r,o){switch(r){case"keyup":return Wk.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 eO(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 tO(r,o){if(Oa)return r==="compositionend"||!qp&&$x(r,o)?(r=Ox(),hf=Up=mo=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 nO={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"?!!nO[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 dl=null,hl=null;function rO(r){T_(r,0)}function vf(r){var o=il(r);if(Ex(o))return r}function qx(r,o){if(r==="change")return o}var Vx=!1;if(Ts){var Vp;if(Ts){var Kp="oninput"in document;if(!Kp){var Kx=document.createElement("div");Kx.setAttribute("oninput","return;"),Kp=typeof Kx.oninput=="function"}Vp=Kp}else Vp=!1;Vx=Vp&&(!document.documentMode||9<document.documentMode)}function Gx(){dl&&(dl.detachEvent("onpropertychange",Zx),hl=dl=null)}function Zx(r){if(r.propertyName==="value"&&vf(hl)){var o=[];Hx(o,hl,r,Dp(r)),kx(rO,o)}}function sO(r,o,c){r==="focusin"?(Gx(),dl=o,hl=c,dl.attachEvent("onpropertychange",Zx)):r==="focusout"&&Gx()}function oO(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return vf(hl)}function iO(r,o){if(r==="click")return vf(o)}function aO(r,o){if(r==="input"||r==="change")return vf(o)}function cO(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var rr=typeof Object.is=="function"?Object.is:cO;function pl(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(!Ie.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 Gp(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}var lO=Ts&&"documentMode"in document&&11>=document.documentMode,Ma=null,Zp=null,ml=null,Yp=!1;function Jx(r,o,c){var u=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Yp||Ma==null||Ma!==ff(u)||(u=Ma,"selectionStart"in u&&Gp(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ml&&pl(ml,u)||(ml=u,u=id(Zp,"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")},Xp={},e0={};Ts&&(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(Xp[r])return Xp[r];if(!Ia[r])return r;var o=Ia[r],c;for(c in o)if(o.hasOwnProperty(c)&&c in e0)return Xp[r]=o[c];return r}var t0=Ni("animationend"),n0=Ni("animationiteration"),r0=Ni("animationstart"),uO=Ni("transitionrun"),fO=Ni("transitionstart"),dO=Ni("transitioncancel"),s0=Ni("transitionend"),o0=new Map,Qp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Qp.push("scrollEnd");function Xr(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,Wp=0;function xf(){for(var r=Pa,o=Wp=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,Wp|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function Jp(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<zl)throw zl=0,cg=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 hO(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 hO(r,o,c,u)}function em(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Cs(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")em(r)&&(E=1);else if(typeof r=="string")E=vM(r,c,Y.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 z:return r=sr(19,c,o,m),r.elementType=z,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 tm(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 nm(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:ve(o)},l0.set(r,o),o)}return{value:r,source:o,stack:ve(o)}}var za=[],La=0,Ef=null,gl=0,jr=[],Ar=0,go=null,ls=1,us="";function Rs(r,o){za[La++]=gl,za[La++]=Ef,Ef=r,gl=o}function u0(r,o,c){jr[Ar++]=ls,jr[Ar++]=us,jr[Ar++]=go,go=r;var u=ls;r=us;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,ls=1<<32-xt(o)+m|c<<m|u,us=v+r}else ls=1<<v|c<<m|u,us=r}function rm(r){r.return!==null&&(Rs(r,1),u0(r,1,0))}function sm(r){for(;r===Ef;)Ef=za[--La],za[La]=null,gl=za[--La],za[La]=null;for(;r===go;)go=jr[--Ar],jr[Ar]=null,us=jr[--Ar],jr[Ar]=null,ls=jr[--Ar],jr[Ar]=null}function f0(r,o){jr[Ar++]=ls,jr[Ar++]=us,jr[Ar++]=go,ls=o.id,us=o.overflow,go=r}var _n=null,Mt=null,rt=!1,yo=null,kr=!1,om=Error(s(519));function vo(r){var o=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yl(Nr(o,r)),om}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<Ul.length;c++)et(Ul[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=Es),o=!0):o=!1,o||vo(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")||wg(r.type,r.memoizedProps)),c=!c),c&&Mt&&vo(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,Oo(r.type)?(r=Ng,Ng=null,Mt=r):Mt=o):Mt=_n?Mr(r.stateNode.nextSibling):null;return!0}function ki(){Mt=_n=null,rt=!1}function im(){var r=yo;return r!==null&&(qn===null?qn=r:qn.push.apply(qn,r),yo=null),r}function yl(r){yo===null?yo=[r]:yo.push(r)}var am=I(null),Oi=null,Ns=null;function bo(r,o,c){W(am,o._currentValue),o._currentValue=c}function js(r){r._currentValue=am.current,H(am)}function cm(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 lm(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),cm(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),cm(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===fe.current){if(E=m.alternate,E===null)throw Error(s(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r!==null?r.push(ql):r=[ql])}m=m.return}r!==null&&lm(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,Ns=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},Ns===null){if(r===null)throw Error(s(308));Ns=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else Ns=Ns.next=o;return c}var pO=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()})}},mO=e.unstable_scheduleCallback,gO=e.unstable_NormalPriority,nn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function um(){return{controller:new pO,data:new Map,refCount:0}}function vl(r){r.refCount--,r.refCount===0&&mO(gO,function(){r.controller.abort()})}var bl=null,fm=0,Ba=0,Fa=null;function yO(r,o){if(bl===null){var c=bl=[];fm=0,Ba=pg(),Fa={status:"pending",value:void 0,then:function(u){c.push(u)}}}return fm++,o.then(m0,m0),o}function m0(){if(--fm===0&&bl!==null){Fa!==null&&(Fa.status="fulfilled");var r=bl;bl=null,Ba=0,Fa=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function vO(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"&&yO(r,o),g0!==null&&g0(r,o)};var Ii=I(null);function dm(){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=dm();return r===null?null:{parent:nn._currentValue,pool:r}}var Ha=Error(s(460)),hm=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(Es,Es),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(Es,Es);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,xl=0;function Af(r){var o=xl;return xl+=1,qa===null&&(qa=[]),b0(qa,r,o)}function Sl(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(X,F){if(r){var J=X.deletions;J===null?(X.deletions=[F],X.flags|=16):J.push(F)}}function c(X,F){if(!r)return null;for(;F!==null;)o(X,F),F=F.sibling;return null}function u(X){for(var F=new Map;X!==null;)X.key!==null?F.set(X.key,X):F.set(X.index,X),X=X.sibling;return F}function m(X,F){return X=Cs(X,F),X.index=0,X.sibling=null,X}function v(X,F,J){return X.index=J,r?(J=X.alternate,J!==null?(J=J.index,J<F?(X.flags|=67108866,F):J):(X.flags|=67108866,F)):(X.flags|=1048576,F)}function E(X){return r&&X.alternate===null&&(X.flags|=67108866),X}function k(X,F,J,le){return F===null||F.tag!==6?(F=tm(J,X.mode,le),F.return=X,F):(F=m(F,J),F.return=X,F)}function $(X,F,J,le){var ze=J.type;return ze===w?ce(X,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),Sl(F,J),F.return=X,F):(F=wf(J.type,J.key,J.props,null,X.mode,le),Sl(F,J),F.return=X,F)}function te(X,F,J,le){return F===null||F.tag!==4||F.stateNode.containerInfo!==J.containerInfo||F.stateNode.implementation!==J.implementation?(F=nm(J,X.mode,le),F.return=X,F):(F=m(F,J.children||[]),F.return=X,F)}function ce(X,F,J,le,ze){return F===null||F.tag!==7?(F=Ai(J,X.mode,le,ze),F.return=X,F):(F=m(F,J),F.return=X,F)}function de(X,F,J){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=tm(""+F,X.mode,J),F.return=X,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case x:return J=wf(F.type,F.key,F.props,null,X.mode,J),Sl(J,F),J.return=X,J;case S:return F=nm(F,X.mode,J),F.return=X,F;case A:return F=Pi(F),de(X,F,J)}if(ee(F)||U(F))return F=Ai(F,X.mode,J,null),F.return=X,F;if(typeof F.then=="function")return de(X,Af(F),J);if(F.$$typeof===N)return de(X,Cf(X,F),J);kf(X,F)}return null}function ne(X,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(X,F,""+J,le);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===ze?$(X,F,J,le):null;case S:return J.key===ze?te(X,F,J,le):null;case A:return J=Pi(J),ne(X,F,J,le)}if(ee(J)||U(J))return ze!==null?null:ce(X,F,J,le,null);if(typeof J.then=="function")return ne(X,F,Af(J),le);if(J.$$typeof===N)return ne(X,F,Cf(X,J),le);kf(X,J)}return null}function oe(X,F,J,le,ze){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return X=X.get(J)||null,k(F,X,""+le,ze);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case x:return X=X.get(le.key===null?J:le.key)||null,$(F,X,le,ze);case S:return X=X.get(le.key===null?J:le.key)||null,te(F,X,le,ze);case A:return le=Pi(le),oe(X,F,J,le,ze)}if(ee(le)||U(le))return X=X.get(J)||null,ce(F,X,le,ze,null);if(typeof le.then=="function")return oe(X,F,J,Af(le),ze);if(le.$$typeof===N)return oe(X,F,J,Cf(F,le),ze);kf(F,le)}return null}function Ne(X,F,J,le){for(var ze=null,ft=null,Oe=F,Ye=F=0,nt=null;Oe!==null&&Ye<J.length;Ye++){Oe.index>Ye?(nt=Oe,Oe=null):nt=Oe.sibling;var dt=ne(X,Oe,J[Ye],le);if(dt===null){Oe===null&&(Oe=nt);break}r&&Oe&&dt.alternate===null&&o(X,Oe),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt,Oe=nt}if(Ye===J.length)return c(X,Oe),rt&&Rs(X,Ye),ze;if(Oe===null){for(;Ye<J.length;Ye++)Oe=de(X,J[Ye],le),Oe!==null&&(F=v(Oe,F,Ye),ft===null?ze=Oe:ft.sibling=Oe,ft=Oe);return rt&&Rs(X,Ye),ze}for(Oe=u(Oe);Ye<J.length;Ye++)nt=oe(Oe,X,Ye,J[Ye],le),nt!==null&&(r&&nt.alternate!==null&&Oe.delete(nt.key===null?Ye:nt.key),F=v(nt,F,Ye),ft===null?ze=nt:ft.sibling=nt,ft=nt);return r&&Oe.forEach(function(zo){return o(X,zo)}),rt&&Rs(X,Ye),ze}function $e(X,F,J,le){if(J==null)throw Error(s(151));for(var ze=null,ft=null,Oe=F,Ye=F=0,nt=null,dt=J.next();Oe!==null&&!dt.done;Ye++,dt=J.next()){Oe.index>Ye?(nt=Oe,Oe=null):nt=Oe.sibling;var zo=ne(X,Oe,dt.value,le);if(zo===null){Oe===null&&(Oe=nt);break}r&&Oe&&zo.alternate===null&&o(X,Oe),F=v(zo,F,Ye),ft===null?ze=zo:ft.sibling=zo,ft=zo,Oe=nt}if(dt.done)return c(X,Oe),rt&&Rs(X,Ye),ze;if(Oe===null){for(;!dt.done;Ye++,dt=J.next())dt=de(X,dt.value,le),dt!==null&&(F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return rt&&Rs(X,Ye),ze}for(Oe=u(Oe);!dt.done;Ye++,dt=J.next())dt=oe(Oe,X,Ye,dt.value,le),dt!==null&&(r&&dt.alternate!==null&&Oe.delete(dt.key===null?Ye:dt.key),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return r&&Oe.forEach(function(jM){return o(X,jM)}),rt&&Rs(X,Ye),ze}function Ct(X,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(X,F.sibling),le=m(F,J.props.children),le.return=X,X=le;break e}}else if(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Pi(ze)===F.type){c(X,F.sibling),le=m(F,J.props),Sl(le,J),le.return=X,X=le;break e}c(X,F);break}else o(X,F);F=F.sibling}J.type===w?(le=Ai(J.props.children,X.mode,le,J.key),le.return=X,X=le):(le=wf(J.type,J.key,J.props,null,X.mode,le),Sl(le,J),le.return=X,X=le)}return E(X);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(X,F.sibling),le=m(F,J.children||[]),le.return=X,X=le;break e}else{c(X,F);break}else o(X,F);F=F.sibling}le=nm(J,X.mode,le),le.return=X,X=le}return E(X);case A:return J=Pi(J),Ct(X,F,J,le)}if(ee(J))return Ne(X,F,J,le);if(U(J)){if(ze=U(J),typeof ze!="function")throw Error(s(150));return J=ze.call(J),$e(X,F,J,le)}if(typeof J.then=="function")return Ct(X,F,Af(J),le);if(J.$$typeof===N)return Ct(X,F,Cf(X,J),le);kf(X,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,F!==null&&F.tag===6?(c(X,F.sibling),le=m(F,J),le.return=X,X=le):(c(X,F),le=tm(J,X.mode,le),le.return=X,X=le),E(X)):c(X,F)}return function(X,F,J,le){try{xl=0;var ze=Ct(X,F,J,le);return qa=null,ze}catch(Oe){if(Oe===Ha||Oe===Nf)throw Oe;var ft=sr(29,Oe,null,X.mode);return ft.lanes=le,ft.return=X,ft}}}var zi=_0(!0),w0=_0(!1),xo=!1;function pm(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mm(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function So(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function _o(r,o,c){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(pt&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 _l(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,fo(r,c)}}function gm(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 ym=!1;function wl(){if(ym){var r=Fa;if(r!==null)throw r}}function El(r,o,c,u){ym=!1;var m=r.updateQueue;xo=!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 de=m.baseState;E=0,ce=te=$=null,k=v;do{var ne=k.lane&-536870913,oe=ne!==k.lane;if(oe?(tt&ne)===ne:(u&ne)===ne){ne!==0&&ne===Ba&&(ym=!0),ce!==null&&(ce=ce.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Ne=r,$e=k;ne=o;var Ct=c;switch($e.tag){case 1:if(Ne=$e.payload,typeof Ne=="function"){de=Ne.call(Ct,de,ne);break e}de=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=$e.payload,ne=typeof Ne=="function"?Ne.call(Ct,de,ne):Ne,ne==null)break e;de=y({},de,ne);break e;case 2:xo=!0}}ne=k.callback,ne!==null&&(r.flags|=64,oe&&(r.flags|=8192),oe=m.callbacks,oe===null?m.callbacks=[ne]:oe.push(ne))}else oe={lane:ne,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ce===null?(te=ce=oe,$=de):ce=ce.next=oe,E|=ne;if(k=k.next,k===null){if(k=m.shared.pending,k===null)break;oe=k,k=oe.next,oe.next=null,m.lastBaseUpdate=oe,m.shared.pending=null}}while(!0);ce===null&&($=de),m.baseState=$,m.firstBaseUpdate=te,m.lastBaseUpdate=ce,v===null&&(m.shared.lanes=0),Ro|=E,r.lanes=E,r.memoizedState=de}}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=Ls,W(Of,r),W(Va,o),Ls=r|o.baseLanes}function vm(){W(Of,Ls),W(Va,Va.current)}function bm(){Ls=Of.current,H(Va),H(Of)}var or=I(null),Or=null;function wo(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 xm(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)):Eo()}function Eo(){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||Cg(c)||Rg(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 As=0,Ze=null,Et=null,rn=null,If=!1,Ka=!1,Li=!1,Pf=0,Tl=0,Ga=null,bO=0;function Kt(){throw Error(s(321))}function Sm(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 _m(r,o,c,u,m,v){return As=v,Ze=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,D.H=r===null||r.memoizedState===null?uS:zm,Li=!1,v=c(u,m),Li=!1,Ka&&(v=j0(o,c,u,m)),N0(r),v}function N0(r){D.H=Nl;var o=Et!==null&&Et.next!==null;if(As=0,rn=Et=Ze=null,If=!1,Tl=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),Tl=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 xO(){var r=D.H,o=r.useState()[0];return o=typeof o.then=="function"?Cl(o):o,r=r.useState()[0],(Et!==null?Et.memoizedState:null)!==r&&(Ze.flags|=1024),o}function wm(){var r=Pf!==0;return Pf=0,r}function Em(r,o,c){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~c}function Tm(r){if(If){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}If=!1}As=0,rn=Et=Ze=null,Ka=!1,Tl=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 Cl(r){var o=Tl;return Tl+=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:zm),r}function zf(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Cl(r);if(r.$$typeof===N)return wn(r)}throw Error(s(438,String(r)))}function Cm(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]=Q;return o.index++,c}function ks(r,o){return typeof o=="function"?o(r):o}function Lf(r){var o=en();return Rm(o,Et,r)}function Rm(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 de=te.lane&-536870913;if(de!==te.lane?(tt&de)===de:(As&de)===de){var ne=te.revertLane;if(ne===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),de===Ba&&(ce=!0);else if((As&ne)===ne){te=te.next,ne===Ba&&(ce=!0);continue}else de={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(k=$=de,E=v):$=$.next=de,Ze.lanes|=ne,Ro|=ne;de=te.action,Li&&c(v,de),v=te.hasEagerState?te.eagerState:c(v,de)}else ne={lane:de,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(k=$=ne,E=v):$=$.next=ne,Ze.lanes|=de,Ro|=de;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 Nm(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,km(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||(As&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 jm(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:ks,lastRenderedState:r},o}function D0(r,o,c,u){return r.baseState=c,Rm(r,Et,typeof u=="function"?u:ks)}function SO(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){Am(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){Am(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 Am(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 Am(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}}vo(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=jm(!1),v=Dm.bind(null,Ze,!1,u.queue),u=kn(),m={state:o,dispatch:null,action:r,pending:null},u.queue=m,c=SO.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=Rm(r,o,B0)[0],r=Lf(ks)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Cl(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},_O.bind(null,m,c),null)),[u,v,r]}function _O(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&&Sm(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 km(r,o){$f(2048,8,r,o)}function wO(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 wO({ref:o,nextImpl:r}),function(){if((pt&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 Om(){}function J0(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;return o!==null&&Sm(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&&Sm(o,u[1]))return u[0];if(u=r(),Li){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u}function Mm(r,o,c){return c===void 0||(As&1073741824)!==0&&(tt&261930)===0?r.memoizedState=o:(r.memoizedState=c,r=t_(),Ze.lanes|=r,Ro|=r,c)}function tS(r,o,c,u){return rr(c,o)?c:Va.current!==null?(r=Mm(r,c,u),rr(r,o)||(sn=!0),r):(As&42)===0||(As&1073741824)!==0&&(tt&261930)===0?(sn=!0,r.memoizedState=c):(r=t_(),Ze.lanes|=r,Ro|=r,o)}function nS(r,o,c,u,m){var v=G.p;G.p=v!==0&&8>v?v:8;var E=D.T,k={};D.T=k,Dm(r,!1,o,c);try{var $=m(),te=D.S;if(te!==null&&te(k,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ce=vO($,u);Rl(r,o,ce,lr(r))}else Rl(r,o,u,lr(r))}catch(de){Rl(r,o,{then:function(){},status:"rejected",reason:de},lr())}finally{G.p=v,E!==null&&k.types!==null&&(E.types=k.types),D.T=E}}function EO(){}function Im(r,o,c,u){if(r.tag!==5)throw Error(s(476));var m=rS(r).queue;nS(r,m,o,q,c===null?EO: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:ks,lastRenderedState:q},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,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),Rl(r,o.next.queue,{},lr())}function Pm(){return wn(ql)}function oS(){return en().memoizedState}function iS(){return en().memoizedState}function TO(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var c=lr();r=So(c);var u=_o(o,r,c);u!==null&&(Vn(u,o,c),_l(u,o,c)),o={cache:um()},r.payload=o;return}o=o.return}}function CO(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=Jp(r,o,c,u),c!==null&&(Vn(c,r,u),lS(c,o,u)))}function aS(r,o,c){var u=lr();Rl(r,o,c,u)}function Rl(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=Jp(r,o,m,u),c!==null)return Vn(c,r,u),lS(c,o,u),!0}return!1}function Dm(r,o,c,u){if(u={lane:2,revertLane:pg(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Bf(r)){if(o)throw Error(s(479))}else o=Jp(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,fo(r,c)}}var Nl={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};Nl.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=CO.bind(null,Ze,r),[u.memoizedState,r]},useRef:function(r){var o=kn();return r={current:r},o.memoizedState=r},useState:function(r){r=jm(r);var o=r.queue,c=aS.bind(null,Ze,o);return o.dispatch=c,[r.memoizedState,c]},useDebugValue:Om,useDeferredValue:function(r,o){var c=kn();return Mm(c,r,o)},useTransition:function(){var r=jm(!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=us,u=ls;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=bO++,o="_"+o+"r_"+c.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Pm,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=Dm.bind(null,Ze,!0,c),c.dispatch=o,[r,o]},useMemoCache:Cm,useCacheRefresh:function(){return kn().memoizedState=TO.bind(null,Ze)},useEffectEvent:function(r){var o=kn(),c={impl:r};return o.memoizedState=c,function(){if((pt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},zm={readContext:wn,use:zf,useCallback:J0,useContext:wn,useEffect:km,useImperativeHandle:W0,useInsertionEffect:Y0,useLayoutEffect:X0,useMemo:eS,useReducer:Lf,useRef:K0,useState:function(){return Lf(ks)},useDebugValue:Om,useDeferredValue:function(r,o){var c=en();return tS(c,Et.memoizedState,r,o)},useTransition:function(){var r=Lf(ks)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Cl(r),o]},useSyncExternalStore:A0,useId:oS,useHostTransitionStatus:Pm,useFormState:H0,useActionState:H0,useOptimistic:function(r,o){var c=en();return D0(c,Et,r,o)},useMemoCache:Cm,useCacheRefresh:iS};zm.useEffectEvent=Z0;var fS={readContext:wn,use:zf,useCallback:J0,useContext:wn,useEffect:km,useImperativeHandle:W0,useInsertionEffect:Y0,useLayoutEffect:X0,useMemo:eS,useReducer:Nm,useRef:K0,useState:function(){return Nm(ks)},useDebugValue:Om,useDeferredValue:function(r,o){var c=en();return Et===null?Mm(c,r,o):tS(c,Et.memoizedState,r,o)},useTransition:function(){var r=Nm(ks)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Cl(r),o]},useSyncExternalStore:A0,useId:oS,useHostTransitionStatus:Pm,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:Cm,useCacheRefresh:iS};fS.useEffectEvent=Z0;function Lm(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 Um={enqueueSetState:function(r,o,c){r=r._reactInternals;var u=lr(),m=So(u);m.payload=o,c!=null&&(m.callback=c),o=_o(r,m,u),o!==null&&(Vn(o,r,u),_l(o,r,u))},enqueueReplaceState:function(r,o,c){r=r._reactInternals;var u=lr(),m=So(u);m.tag=1,m.payload=o,c!=null&&(m.callback=c),o=_o(r,m,u),o!==null&&(Vn(o,r,u),_l(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var c=lr(),u=So(c);u.tag=2,o!=null&&(u.callback=o),o=_o(r,u,c),o!==null&&(Vn(o,r,c),_l(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?!pl(c,u)||!pl(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&&Um.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 $m(r,o,c){return c=So(c),c.tag=3,c.payload={element:null},c.callback=function(){Ff(r,o)},c}function vS(r){return r=So(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"&&(No===null?No=new Set([this]):No.add(this));var k=u.stack;this.componentDidCatch(u.value,{componentStack:k!==null?k:""})})}function RO(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),fg(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)),fg(r,u,m)),!1}throw Error(s(435,c.tag))}return fg(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!==om&&(r=Error(s(422),{cause:u}),yl(Nr(r,c)))):(u!==om&&(o=Error(s(423),{cause:u}),yl(Nr(o,c))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,u=Nr(u,c),m=$m(r.stateNode,u,m),gm(r,m),Gt!==4&&(Gt=2)),!1;var v=Error(s(520),{cause:u});if(v=Nr(v,c),Dl===null?Dl=[v]:Dl.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=$m(c.stateNode,u,r),gm(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"&&(No===null||!No.has(v))))return c.flags|=65536,m&=-m,c.lanes|=m,m=vS(m),bS(m,r,c,u),gm(c,m),!1}c=c.return}while(c!==null);return!1}var Bm=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=_m(r,o,c,E,v,m),k=wm(),r!==null&&!sn?(Em(r,o,m),Os(r,o,m)):(rt&&k&&rm(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"&&!em(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,!Ym(r,m)){var E=v.memoizedProps;if(c=c.compare,c=c!==null?c:pl,c(E,u)&&r.ref===o.ref)return Os(r,o,m)}return o.flags|=1,r=Cs(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(pl(v,u)&&r.ref===o.ref)if(sn=!1,o.pendingProps=u=v,Ym(r,m))(r.flags&131072)!==0&&(sn=!0);else return o.lanes=r.lanes,Os(r,o,m)}return Fm(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):vm(),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),Eo(),o.memoizedState=null):(r!==null&&Rf(o,null),vm(),Eo());return En(r,o,m,c),o.child}function jl(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=dm();return v=v===null?null:{parent:nn._currentValue,pool:v},o.memoizedState={baseLanes:c,cachePool:v},r!==null&&Rf(o,null),vm(),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 NO(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,jl(null,r);if(xm(o),(r=Mt)?(r=z_(r,kr),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:go!==null?{id:ls,overflow:us}:null,retryLane:536870912,hydrationErrors:null},c=c0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw vo(o);return o.lanes=536870912,null}return Hf(o,u)}var v=r.memoizedState;if(v!==null){var E=v.dehydrated;if(xm(o),m)if(o.flags&256)o.flags&=-257,o=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=ho(u,c),E!==0&&E!==v.retryLane))throw v.retryLane=E,ji(r,E),Vn(u,r,E),Bm;ed(),o=TS(r,o,c)}else r=v.treeContext,Mt=Mr(E.nextSibling),_n=o,rt=!0,yo=null,kr=!1,r!==null&&f0(o,r),o=Hf(o,u),o.flags|=4096;return o}return r=Cs(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 Fm(r,o,c,u,m){return Mi(o),c=_m(r,o,c,u,void 0,m),u=wm(),r!==null&&!sn?(Em(r,o,m),Os(r,o,m)):(rt&&u&&rm(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=wm(),r!==null&&!sn?(Em(r,o,v),Os(r,o,v)):(rt&&u&&rm(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=Um,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},pm(o),E=c.contextType,v.context=typeof E=="object"&&E!==null?wn(E):Da,v.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Lm(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&&Um.enqueueReplaceState(v,v.state,null),El(o,u,v,m),wl(),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 de=c.getDerivedStateFromProps;ce=typeof de=="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),xo=!1;var ne=o.memoizedState;v.state=ne,El(o,u,v,m),wl(),te=o.memoizedState,k||ne!==te||xo?(typeof de=="function"&&(Lm(o,c,de,u),te=o.memoizedState),($=xo||dS(o,c,$,u,ne,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,mm(r,o),E=o.memoizedProps,ce=Ui(c,E),v.props=ce,de=o.pendingProps,ne=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!==de||ne!==$)&&hS(o,v,u,$),xo=!1,ne=o.memoizedState,v.state=ne,El(o,u,v,m),wl();var oe=o.memoizedState;E!==de||ne!==oe||xo||r!==null&&r.dependencies!==null&&Tf(r.dependencies)?(typeof k=="function"&&(Lm(o,c,k,u),oe=o.memoizedState),(ce=xo||dS(o,c,ce,u,ne,oe,$)||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,oe,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,oe,$)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=oe),v.props=u,v.state=oe,v.context=$,u=ce):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,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=Os(r,o,m),r}function NS(r,o,c,u){return ki(),o.flags|=256,En(r,o,c,u),o.child}var Hm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qm(r){return{baseLanes:r,cachePool:y0()}}function Vm(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?wo(o):Eo(),(r=Mt)?(r=z_(r,kr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:go!==null?{id:ls,overflow:us}:null,retryLane:536870912,hydrationErrors:null},c=c0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw vo(o);return Rg(r)?o.lanes=32:o.lanes=536870912,null}var k=u.children;return u=u.fallback,m?(Eo(),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=qm(c),u.childLanes=Vm(r,E,c),o.memoizedState=Hm,jl(null,u)):(wo(o),Km(o,k))}var $=r.memoizedState;if($!==null&&(k=$.dehydrated,k!==null)){if(v)o.flags&256?(wo(o),o.flags&=-257,o=Gm(r,o,c)):o.memoizedState!==null?(Eo(),o.child=r.child,o.flags|=128,o=null):(Eo(),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=qm(c),u.childLanes=Vm(r,E,c),o.memoizedState=Hm,o=jl(null,u));else if(wo(o),Rg(k)){if(E=k.nextSibling&&k.nextSibling.dataset,E)var te=E.dgst;E=te,u=Error(s(419)),u.stack="",u.digest=E,yl({value:u,source:null,stack:null}),o=Gm(r,o,c)}else if(sn||$a(r,o,c,!1),E=(c&r.childLanes)!==0,sn||E){if(E=Nt,E!==null&&(u=ho(E,c),u!==0&&u!==$.retryLane))throw $.retryLane=u,ji(r,u),Vn(E,r,u),Bm;Cg(k)||ed(),o=Gm(r,o,c)}else Cg(k)?(o.flags|=192,o.child=r.child,o=null):(r=$.treeContext,Mt=Mr(k.nextSibling),_n=o,rt=!0,yo=null,kr=!1,r!==null&&f0(o,r),o=Km(o,u.children),o.flags|=4096);return o}return m?(Eo(),k=u.fallback,m=o.mode,$=r.child,te=$.sibling,u=Cs($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,te!==null?k=Cs(te,k):(k=Ai(k,m,c,null),k.flags|=2),k.return=o,u.return=o,u.sibling=k,o.child=u,jl(null,u),u=o.child,k=r.child.memoizedState,k===null?k=qm(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=Vm(r,E,c),o.memoizedState=Hm,jl(r.child,u)):(wo(o),c=r.child,r=c.sibling,c=Cs(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 Km(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 Gm(r,o,c){return zi(o,r.child,null,c),r=Km(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),cm(r.return,o,c)}function Zm(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?gl: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),Zm(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}Zm(o,!0,c,null,v,u);break;case"together":Zm(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function Os(r,o,c){if(r!==null&&(o.dependencies=r.dependencies),Ro|=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=Cs(r,r.pendingProps),o.child=c,c.return=o;r.sibling!==null;)r=r.sibling,c=c.sibling=Cs(r,r.pendingProps),c.return=o;c.sibling=null}return o.child}function Ym(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Tf(r)))}function jO(r,o,c){switch(o.tag){case 3:Se(o,o.stateNode.containerInfo),bo(o,nn,r.memoizedState.cache),ki();break;case 27:case 5:Me(o);break;case 4:Se(o,o.stateNode.containerInfo);break;case 10:bo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,xm(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(wo(o),o.flags|=128,null):(c&o.child.childLanes)!==0?jS(r,o,c):(wo(o),r=Os(r,o,c),r!==null?r.sibling:null);wo(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:bo(o,nn,r.memoizedState.cache)}return Os(r,o,c)}function OS(r,o,c){if(r!==null)if(r.memoizedProps!==o.pendingProps)sn=!0;else{if(!Ym(r,c)&&(o.flags&128)===0)return sn=!1,jO(r,o,c);sn=(r.flags&131072)!==0}else sn=!1,rt&&(o.flags&1048576)!==0&&u0(o,gl,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")em(r)?(u=Ui(r,u),o.tag=1,o=RS(null,o,r,u,c)):(o.tag=0,o=Fm(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=K(r)||r,Error(s(306,o,""))}}return o;case 0:return Fm(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(Se(o,o.stateNode.containerInfo),r===null)throw Error(s(387));u=o.pendingProps;var v=o.memoizedState;m=v.element,mm(r,o),El(o,u,null,c);var E=o.memoizedState;if(u=E.cache,bo(o,nn,u),u!==v.cache&&lm(o,[nn],c,!0),wl(),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),yl(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,yo=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=Os(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),vn(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,Oo(o.type)?(Ng=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=oM(u,o.type,o.pendingProps,kr),u!==null?(o.stateNode=u,_n=o,Mt=Mr(u.firstChild),kr=!1,m=!0):m=!1),m||vo(o)),Me(o),m=o.type,v=o.pendingProps,E=r!==null?r.memoizedProps:null,u=v.children,wg(m,v)?u=null:E!==null&&wg(m,E)&&(o.flags|=32),o.memoizedState!==null&&(m=_m(r,o,xO,null,null,c),ql._currentValue=m),qf(r,o),En(r,o,u,c),o.child;case 6:return r===null&&rt&&((r=c=Mt)&&(c=iM(c,o.pendingProps,kr),c!==null?(o.stateNode=c,_n=o,Mt=null,r=!0):r=!1),r||vo(o)),null;case 13:return jS(r,o,c);case 4:return Se(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,bo(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 NO(r,o,c);case 22:return wS(r,o,c,o.pendingProps);case 24:return Mi(o),u=wn(nn),r===null?(m=dm(),m===null&&(m=Nt,v=um(),m.pooledCache=v,v.refCount++,v!==null&&(m.pooledCacheLanes|=c),m=v),o.memoizedState={parent:u,cache:m},pm(o),bo(o,nn,m)):((r.lanes&c)!==0&&(mm(r,o),El(o,null,null,c),wl()),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),bo(o,nn,u)):(u=v.cache,bo(o,nn,u),u!==m.cache&&lm(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 Ms(r){r.flags|=4}function Xm(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,hm}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,hm}function Kf(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?wi():536870912,r.lanes|=o,Wa|=o)}function Al(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 AO(r,o,c){var u=o.pendingProps;switch(sm(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(o),null;case 1:return It(o),null;case 3:return c=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),js(nn),pe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Ua(o)?Ms(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,im())),It(o),null;case 26:var m=o.type,v=o.memoizedState;return r===null?(Ms(o),v!==null?(It(o),MS(o,v)):(It(o),Xm(o,m,null,u,c))):v?v!==r.memoizedState?(Ms(o),It(o),MS(o,v)):(It(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&Ms(o),It(o),Xm(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&&Ms(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}r=Y.current,Ua(o)?d0(o):(r=$_(m,u,c),o.stateNode=r,Ms(o))}return It(o),null;case 5:if(_e(o),m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Ms(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}if(v=Y.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&&Ms(o)}}return It(o),Xm(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,c),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&Ms(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||vo(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=im(),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=im(),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 pe(),r===null&&vg(o.stateNode.containerInfo),It(o),null;case 10:return js(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)Al(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,Al(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&&Rs(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&Be()>Qf&&(o.flags|=128,m=!0,Al(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),Al(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,Al(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&&Rs(o,u.treeForkCount),r):(It(o),null);case 22:case 23:return ir(o),bm(),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),js(nn),It(o),null;case 25:return null;case 30:return null}throw Error(s(156,o.tag))}function kO(r,o){switch(sm(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return js(nn),pe(),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 pe(),null;case 10:return js(o.type),null;case 22:case 23:return ir(o),bm(),r!==null&&H(Ii),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return js(nn),null;case 25:return null;default:return null}}function IS(r,o){switch(sm(o),o.tag){case 3:js(nn),pe();break;case 26:case 27:case 5:_e(o);break;case 4:pe();break;case 31:o.memoizedState!==null&&ir(o);break;case 13:ir(o);break;case 19:H(Jt);break;case 10:js(o.type);break;case 22:case 23:ir(o),bm(),r!==null&&H(Ii);break;case 24:js(nn)}}function kl(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 To(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 Ol(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 fs(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 Qm(r,o,c){try{var u=r.stateNode;JO(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&&Oo(r.type)||r.tag===4}function Wm(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&&Oo(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Jm(r,o,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=Es));else if(u!==4&&(u===27&&Oo(r.type)&&(c=r.stateNode,o=null),r=r.child,r!==null))for(Jm(r,o,c),r=r.sibling;r!==null;)Jm(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&&Oo(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 Is=!1,on=!1,eg=!1,$S=typeof WeakSet=="function"?WeakSet:Set,bn=null;function OO(r,o){if(r=r.containerInfo,Sg=pd,r=Wx(r),Gp(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,de=r,ne=null;t:for(;;){for(var oe;de!==c||m!==0&&de.nodeType!==3||(k=E+m),de!==v||u!==0&&de.nodeType!==3||($=E+u),de.nodeType===3&&(E+=de.nodeValue.length),(oe=de.firstChild)!==null;)ne=de,de=oe;for(;;){if(de===r)break t;if(ne===c&&++te===m&&(k=E),ne===v&&++ce===u&&($=E),(oe=de.nextSibling)!==null)break;de=ne,ne=de.parentNode}de=oe}c=k===-1||$===-1?null:{start:k,end:$}}else c=null}c=c||{start:0,end:0}}else c=null;for(_g={focusedElem:r,selectionRange:c},pd=!1,bn=o;bn!==null;)if(o=bn,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,bn=r;else for(;bn!==null;){switch(o=bn,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 Ne=Ui(c.type,m);r=u.getSnapshotBeforeUpdate(Ne,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)Tg(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Tg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(s(163))}if(r=o.sibling,r!==null){r.return=o.return,bn=r;break}bn=o.return}}function BS(r,o,c){var u=c.flags;switch(c.tag){case 0:case 11:case 15:Ds(r,c),u&4&&kl(5,c);break;case 1:if(Ds(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&&Ol(c,c.return);break;case 3:if(Ds(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:Ds(r,c),o===null&&u&4&&zS(c),u&512&&Ol(c,c.return);break;case 12:Ds(r,c);break;case 31:Ds(r,c),u&4&&qS(r,c);break;case 13:Ds(r,c),u&4&&VS(r,c),u&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=BO.bind(null,c),aM(r,c))));break;case 22:if(u=c.memoizedState!==null||Is,!u){o=o!==null&&o.memoizedState!==null||on,m=Is;var v=on;Is=u,(on=o)&&!v?zs(r,c,(c.subtreeFlags&8772)!==0):Ds(r,c),Is=m,on=v}break;case 30:break;default:Ds(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&&Ap(o)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Ut=null,Bn=!1;function Ps(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||fs(c,o),Ps(r,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:on||fs(c,o);var u=Ut,m=Bn;Oo(c.type)&&(Ut=c.stateNode,Bn=!1),Ps(r,o,c),Bl(c.stateNode),Ut=u,Bn=m;break;case 5:on||fs(c,o);case 6:if(u=Ut,m=Bn,Ut=null,Ps(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,Ps(r,o,c),Ut=u,Bn=m;break;case 0:case 11:case 14:case 15:To(2,c,o),on||To(4,c,o),Ps(r,o,c);break;case 1:on||(fs(c,o),u=c.stateNode,typeof u.componentWillUnmount=="function"&&DS(c,o,u)),Ps(r,o,c);break;case 21:Ps(r,o,c);break;case 22:on=(u=on)||c.memoizedState!==null,Ps(r,o,c),on=u;break;default:Ps(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 MO(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=MO(r);o.forEach(function(u){if(!c.has(u)){c.add(u);var m=FO.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(Oo(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 Qr=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&&(To(3,r,r.return),kl(3,r),To(5,r,r.return));break;case 1:Fn(o,r),Hn(r),u&512&&(on||c===null||fs(c,c.return)),u&64&&Is&&(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=Qr;if(Fn(o,r),Hn(r),u&512&&(on||c===null||fs(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[ol]||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,vn(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,vn(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&&Qm(r,r.memoizedProps,c.memoizedProps)}break;case 27:Fn(o,r),Hn(r),u&512&&(on||c===null||fs(c,c.return)),c!==null&&u&4&&Qm(r,r.memoizedProps,c.memoizedProps);break;case 5:if(Fn(o,r),Hn(r),u&512&&(on||c===null||fs(c,c.return)),r.flags&32){m=r.stateNode;try{ja(m,"")}catch(Ne){_t(r,r.return,Ne)}}u&4&&r.stateNode!=null&&(m=r.memoizedProps,Qm(r,m,c!==null?c.memoizedProps:m)),u&1024&&(eg=!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(Ne){_t(r,r.return,Ne)}}break;case 3:if(ud=null,m=Qr,Qr=cd(o.containerInfo),Fn(o,r),Qr=m,Hn(r),u&4&&c!==null&&c.memoizedState.isDehydrated)try{ic(o.containerInfo)}catch(Ne){_t(r,r.return,Ne)}eg&&(eg=!1,GS(r));break;case 4:u=Qr,Qr=cd(r.stateNode.containerInfo),Fn(o,r),Hn(r),Qr=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=Is,ce=on;if(Is=te||m,on=ce||$,Fn(o,r),on=ce,Is=te,Hn(r),u&8192)e:for(o=r.stateNode,o._visibility=m?o._visibility&-2:o._visibility|1,m&&(c===null||$||Is||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 de=$.memoizedProps.style,ne=de!=null&&de.hasOwnProperty("display")?de.display:null;k.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Ne){_t($,$.return,Ne)}}}else if(o.tag===6){if(c===null){$=o;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(Ne){_t($,$.return,Ne)}}}else if(o.tag===18){if(c===null){$=o;try{var oe=$.stateNode;m?D_(oe,!0):D_($.stateNode,!1)}catch(Ne){_t($,$.return,Ne)}}}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=Wm(r);Gf(r,v,m);break;case 5:var E=c.stateNode;c.flags&32&&(ja(E,""),c.flags&=-33);var k=Wm(r);Gf(r,k,E);break;case 3:case 4:var $=c.stateNode.containerInfo,te=Wm(r);Jm(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 Ds(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:To(4,o,o.return),$i(o);break;case 1:fs(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&DS(o,o.return,c),$i(o);break;case 27:Bl(o.stateNode);case 26:case 5:fs(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 zs(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:zs(m,v,c),kl(4,v);break;case 1:if(zs(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),Ol(v,v.return);break;case 27:US(v);case 26:case 5:zs(m,v,c),c&&u===null&&E&4&&zS(v),Ol(v,v.return);break;case 12:zs(m,v,c);break;case 31:zs(m,v,c),c&&E&4&&qS(m,v);break;case 13:zs(m,v,c),c&&E&4&&VS(m,v);break;case 22:v.memoizedState===null&&zs(m,v,c),Ol(v,v.return);break;case 30:break;default:zs(m,v,c)}o=o.sibling}}function tg(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&&vl(c))}function ng(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&vl(r))}function Wr(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:Wr(r,o,c,u),m&2048&&kl(9,o);break;case 1:Wr(r,o,c,u);break;case 3:Wr(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&&vl(r)));break;case 12:if(m&2048){Wr(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 Wr(r,o,c,u);break;case 31:Wr(r,o,c,u);break;case 13:Wr(r,o,c,u);break;case 23:break;case 22:v=o.stateNode,E=o.alternate,o.memoizedState!==null?v._visibility&2?Wr(r,o,c,u):Ml(r,o):v._visibility&2?Wr(r,o,c,u):(v._visibility|=2,Ya(r,o,c,u,(o.subtreeFlags&10256)!==0||!1)),m&2048&&tg(E,o);break;case 24:Wr(r,o,c,u),m&2048&&ng(o.alternate,o);break;default:Wr(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),kl(8,E);break;case 23:break;case 22:var ce=E.stateNode;E.memoizedState!==null?ce._visibility&2?Ya(v,E,k,$,m):Ml(v,E):(ce._visibility|=2,Ya(v,E,k,$,m)),m&&te&2048&&tg(E.alternate,E);break;case 24:Ya(v,E,k,$,m),m&&te&2048&&ng(E.alternate,E);break;default:Ya(v,E,k,$,m)}o=o.sibling}}function Ml(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:Ml(c,u),m&2048&&tg(u.alternate,u);break;case 24:Ml(c,u),m&2048&&ng(u.alternate,u);break;default:Ml(c,u)}o=o.sibling}}var Il=8192;function Xa(r,o,c){if(r.subtreeFlags&Il)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&Il&&r.memoizedState!==null&&bM(c,Qr,r.memoizedState,r.memoizedProps);break;case 5:Xa(r,o,c);break;case 3:case 4:var u=Qr;Qr=cd(r.stateNode.containerInfo),Xa(r,o,c),Qr=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=Il,Il=16777216,Xa(r,o,c),Il=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 Pl(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];bn=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:Pl(r),r.flags&2048&&To(9,r,r.return);break;case 3:Pl(r);break;case 12:Pl(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)):Pl(r);break;default:Pl(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];bn=u,WS(u,r)}XS(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:To(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(;bn!==null;){var c=bn;switch(c.tag){case 0:case 11:case 15:To(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:vl(c.memoizedState.cache)}if(u=c.child,u!==null)u.return=c,bn=u;else e:for(c=r;bn!==null;){u=bn;var m=u.sibling,v=u.return;if(FS(u),u===c){bn=null;break e}if(m!==null){m.return=v,bn=m;break e}bn=v}}}var IO={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}},PO=typeof WeakMap=="function"?WeakMap:Map,pt=0,Nt=null,Je=null,tt=0,St=0,ar=null,Co=!1,Qa=!1,rg=!1,Ls=0,Gt=0,Ro=0,Bi=0,sg=0,cr=0,Wa=0,Dl=null,qn=null,og=!1,Xf=0,JS=0,Qf=1/0,Wf=null,No=null,fn=0,jo=null,Ja=null,Us=0,ig=0,ag=null,e_=null,zl=0,cg=null;function lr(){return(pt&2)!==0&&tt!==0?tt&-tt:D.T!==null?pg():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),Ao(r,tt,cr,!1)),_s(r,c),((pt&2)===0||r!==Nt)&&(r===Nt&&((pt&2)===0&&(Bi|=c),Gt===4&&Ao(r,tt,cr,!1)),ds(r))}function n_(r,o,c){if((pt&6)!==0)throw Error(s(327));var u=!c&&(o&127)===0&&(o&r.expiredLanes)===0||as(r,o),m=u?LO(r,o):ug(r,o,!0),v=u;do{if(m===0){Qa&&!u&&Ao(r,o,0,!1);break}else{if(c=r.current.alternate,v&&!DO(c)){m=ug(r,o,!1),v=!1;continue}if(m===2){if(v=o,r.errorRecoveryDisabledLanes&v)var E=0;else E=r.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var k=r;m=Dl;var $=k.current.memoizedState.isDehydrated;if($&&(ec(k,E).flags|=256),E=ug(k,E,!1),E!==2){if(rg&&!$){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),Ao(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:Ao(u,o,cr,!Co);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(Ao(u,o,cr,!Co),is(u,0,!0)!==0)break e;Us=o,u.timeoutHandle=M_(r_.bind(null,u,c,qn,Wf,og,o,cr,Bi,Wa,Co,v,"Throttled",-0,0),m);break e}r_(u,c,qn,Wf,og,o,cr,Bi,Wa,Co,v,null,-0,0)}}break}while(!0);ds(r)}function r_(r,o,c,u,m,v,E,k,$,te,ce,de,ne,oe){if(r.timeoutHandle=-1,de=o.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Es},YS(o,v,de);var Ne=(v&62914560)===v?Xf-Be():(v&4194048)===v?JS-Be():0;if(Ne=xM(de,Ne),Ne!==null){Us=v,r.cancelPendingCommit=Ne(f_.bind(null,r,o,v,c,u,m,E,k,$,ce,de,null,ne,oe)),Ao(r,v,E,!te);return}}f_(r,o,v,c,u,m,E,k,$)}function DO(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 Ao(r,o,c,u){o&=~sg,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&&cs(r,c,o)}function Jf(){return(pt&6)===0?(Ll(0),!1):!0}function lg(){if(Je!==null){if(St===0)var r=Je.return;else r=Je,Ns=Oi=null,Tm(r),qa=null,xl=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,nM(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),Us=0,lg(),Nt=r,Je=c=Cs(r.current,null),tt=o,St=0,ar=null,Co=!1,Qa=as(r,o),rg=!1,Wa=cr=sg=Bi=Ro=Gt=0,qn=Dl=null,og=!1,(o&8)!==0&&(o|=o&32);var u=r.entangledLanes;if(u!==0)for(r=r.entanglements,u&=o;0<u;){var m=31-xt(u),v=1<<m;o|=r[m],u&=~v}return Ls=o,xf(),c}function s_(r,o){Ze=null,D.H=Nl,o===Ha||o===Nf?(o=x0(),St=3):o===hm?(o=x0(),St=4):St=o===Bm?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=Nl,r===null?Nl:r}function a_(){var r=D.A;return D.A=IO,r}function ed(){Gt=4,Co||(tt&4194048)!==tt&&or.current!==null||(Qa=!0),(Ro&134217727)===0&&(Bi&134217727)===0||Nt===null||Ao(Nt,tt,cr,!1)}function ug(r,o,c){var u=pt;pt|=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:lg(),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)}}zO(),E=Gt;break}catch(ce){s_(r,ce)}while(!0);return o&&r.shellSuspendCounter++,Ns=Oi=null,pt=u,D.H=m,D.A=v,Je===null&&(Nt=null,tt=0,xf()),E}function zO(){for(;Je!==null;)c_(Je)}function LO(r,o){var c=pt;pt|=2;var u=i_(),m=a_();Nt!==r||tt!==o?(Wf=null,Qf=Be()+500,ec(r,o)):Qa=as(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),ds(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:lg(),Gt=6;break e;default:throw Error(s(462))}}UO();break}catch(ce){s_(r,ce)}while(!0);return Ns=Oi=null,D.H=u,D.A=m,pt=c,Je!==null?0:(Nt=null,tt=0,xf(),Gt)}function UO(){for(;Je!==null&&!Ve();)c_(Je)}function c_(r){var o=OS(r.alternate,r,Ls);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:Tm(o);default:IS(c,o),o=Je=a0(o,Ls),o=OS(c,o,Ls)}r.memoizedProps=r.pendingProps,o===null?td(r):Je=o}function tc(r,o,c,u){Ns=Oi=null,Tm(o),qa=null,xl=0;var m=o.return;try{if(RO(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:(Co=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,Co);return}r=o.return;var c=AO(o.alternate,o,Ls);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=kO(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((pt&6)!==0)throw Error(s(327));if(o!==null){if(o===r.current)throw Error(s(177));if(v=o.lanes|o.childLanes,v|=Wp,tr(r,c,v,E,k,$),r===Nt&&(Je=Nt=null,tt=0),Ja=o,jo=r,Us=c,ig=v,ag=m,e_=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,HO(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=G.p,G.p=2,E=pt,pt|=4;try{OO(r,o,c)}finally{pt=E,G.p=m,D.T=u}}fn=1,d_(),h_(),p_()}}function d_(){if(fn===1){fn=0;var r=jo,o=Ja,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=D.T,D.T=null;var u=G.p;G.p=2;var m=pt;pt|=4;try{KS(o,r);var v=_g,E=Wx(r.containerInfo),k=v.focusedElem,$=v.selectionRange;if(E!==k&&k&&k.ownerDocument&&Qx(k.ownerDocument.documentElement,k)){if($!==null&&Gp(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 de=k.ownerDocument||document,ne=de&&de.defaultView||window;if(ne.getSelection){var oe=ne.getSelection(),Ne=k.textContent.length,$e=Math.min($.start,Ne),Ct=$.end===void 0?$e:Math.min($.end,Ne);!oe.extend&&$e>Ct&&(E=Ct,Ct=$e,$e=E);var X=Xx(k,$e),F=Xx(k,Ct);if(X&&F&&(oe.rangeCount!==1||oe.anchorNode!==X.node||oe.anchorOffset!==X.offset||oe.focusNode!==F.node||oe.focusOffset!==F.offset)){var J=de.createRange();J.setStart(X.node,X.offset),oe.removeAllRanges(),$e>Ct?(oe.addRange(J),oe.extend(F.node,F.offset)):(J.setEnd(F.node,F.offset),oe.addRange(J))}}}}for(de=[],oe=k;oe=oe.parentNode;)oe.nodeType===1&&de.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<de.length;k++){var le=de[k];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}pd=!!Sg,_g=Sg=null}finally{pt=m,G.p=u,D.T=c}}r.current=o,fn=2}}function h_(){if(fn===2){fn=0;var r=jo,o=Ja,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=D.T,D.T=null;var u=G.p;G.p=2;var m=pt;pt|=4;try{BS(r,o.alternate,o)}finally{pt=m,G.p=u,D.T=c}}fn=3}}function p_(){if(fn===4||fn===3){fn=0,Qe();var r=jo,o=Ja,c=Us,u=e_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?fn=5:(fn=0,Ja=jo=null,m_(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(No=null),sl(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=G.p,G.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,G.p=m}}(Us&3)!==0&&nd(),ds(r),m=r.pendingLanes,(c&261930)!==0&&(m&42)!==0?r===cg?zl++:(zl=0,cg=r):zl=0,Ll(0)}}function m_(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,vl(o)))}function nd(){return d_(),h_(),p_(),g_()}function g_(){if(fn!==5)return!1;var r=jo,o=ig;ig=0;var c=sl(Us),u=D.T,m=G.p;try{G.p=32>c?32:c,D.T=null,c=ag,ag=null;var v=jo,E=Us;if(fn=0,Ja=jo=null,Us=0,(pt&6)!==0)throw Error(s(331));var k=pt;if(pt|=4,QS(v.current),ZS(v,v.current,E,c),pt=k,Ll(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Er,v)}catch{}return!0}finally{G.p=m,D.T=u,m_(r,o)}}function y_(r,o,c){o=Nr(c,o),o=$m(r.stateNode,o,2),r=_o(r,o,2),r!==null&&(_s(r,2),ds(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"&&(No===null||!No.has(u))){r=Nr(c,r),c=vS(2),u=_o(o,c,2),u!==null&&(bS(c,u,o,r),_s(u,2),ds(u));break}}o=o.return}}function fg(r,o,c){var u=r.pingCache;if(u===null){u=r.pingCache=new PO;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)||(rg=!0,m.add(c),r=$O.bind(null,r,o,c),o.then(r,r))}function $O(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?(pt&2)===0&&ec(r,0):sg|=c,Wa===tt&&(Wa=0)),ds(r)}function v_(r,o){o===0&&(o=wi()),r=ji(r,o),r!==null&&(_s(r,o),ds(r))}function BO(r){var o=r.memoizedState,c=0;o!==null&&(c=o.retryLane),v_(r,c)}function FO(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 HO(r,o){return Ue(r,o)}var rd=null,nc=null,dg=!1,sd=!1,hg=!1,ko=0;function ds(r){r!==nc&&r.next===null&&(nc===null?rd=nc=r:nc=nc.next=r),sd=!0,dg||(dg=!0,VO())}function Ll(r,o){if(!hg&&sd){hg=!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=is(u,u===Nt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||as(u,v)||(c=!0,__(u,v));u=u.next}while(c);hg=!1}}function qO(){b_()}function b_(){sd=dg=!1;var r=0;ko!==0&&tM()&&(r=ko);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||Ll(r),ko!==0&&(ko=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=is(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||as(r,c)){if(o=c&-c,o===r.callbackPriority)return o;switch(u!==null&&Ee(u),sl(c)){case 2:case 8:c=me;break;case 32:c=Te;break;case 268435456:c=ht;break;default:c=Te}return u=S_.bind(null,r),c=Ue(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=is(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 VO(){rM(function(){(pt&6)!==0?Ue(He,qO):b_()})}function pg(){if(ko===0){var r=Ba;r===0&&(r=kt,kt<<=1,(kt&261888)===0&&(kt=256)),ko=r}return ko}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 KO(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(ko!==0){var $=E?E_(m,E):new FormData(m);Im(c,{pending:!0,data:$,method:m.method,action:v},null,$)}}else typeof v=="function"&&(k.preventDefault(),$=E?E_(m,E):new FormData(m),Im(c,{pending:!0,data:$,method:m.method,action:v},v,$))},currentTarget:m}]})}}for(var mg=0;mg<Qp.length;mg++){var gg=Qp[mg],GO=gg.toLowerCase(),ZO=gg[0].toUpperCase()+gg.slice(1);Xr(GO,"on"+ZO)}Xr(t0,"onAnimationEnd"),Xr(n0,"onAnimationIteration"),Xr(r0,"onAnimationStart"),Xr("dblclick","onDoubleClick"),Xr("focusin","onFocus"),Xr("focusout","onBlur"),Xr(uO,"onTransitionRun"),Xr(fO,"onTransitionStart"),Xr(dO,"onTransitionCancel"),Xr(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 Ul="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(" "),YO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ul));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[jp];c===void 0&&(c=o[jp]=new Set);var u=r+"__bubble";c.has(u)||(C_(o,r,2,!1),c.add(u))}function yg(r,o,c){var u=0;o&&(u|=4),C_(c,r,u,o)}var od="_reactListening"+Math.random().toString(36).slice(2);function vg(r){if(!r[od]){r[od]=!0,bx.forEach(function(c){c!=="selectionchange"&&(YO.has(c)||yg(c,!1,r),yg(c,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[od]||(o[od]=!0,yg("selectionchange",!1,o))}}function C_(r,o,c,u){switch(tw(o)){case 2:var m=wM;break;case 8:m=EM;break;default:m=Mg}c=m.bind(null,o,c,r),m=void 0,!Lp||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 bg(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=Dp(c),de=[];e:{var ne=o0.get(r);if(ne!==void 0){var oe=gf,Ne=r;switch(r){case"keypress":if(pf(c)===0)break e;case"keydown":case"keyup":oe=Fk;break;case"focusin":Ne="focus",oe=Fp;break;case"focusout":Ne="blur",oe=Fp;break;case"beforeblur":case"afterblur":oe=Fp;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":oe=Ix;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=Ak;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Vk;break;case t0:case n0:case r0:oe=Mk;break;case s0:oe=Gk;break;case"scroll":case"scrollend":oe=Nk;break;case"wheel":oe=Yk;break;case"copy":case"cut":case"paste":oe=Pk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=Dx;break;case"toggle":case"beforetoggle":oe=Qk}var $e=(o&4)!==0,Ct=!$e&&(r==="scroll"||r==="scrollend"),X=$e?ne!==null?ne+"Capture":null:ne;$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||X===null||(le=al(F,X),le!=null&&$e.push($l(F,le,J))),Ct)break;F=F.return}0<$e.length&&(ne=new oe(ne,Ne,null,c,ce),de.push({event:ne,listeners:$e}))}}if((o&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",oe=r==="mouseout"||r==="pointerout",ne&&c!==Pp&&(Ne=c.relatedTarget||c.fromElement)&&(Ea(Ne)||Ne[wa]))break e;if((oe||ne)&&(ne=ce.window===ce?ce:(ne=ce.ownerDocument)?ne.defaultView||ne.parentWindow:window,oe?(Ne=c.relatedTarget||c.toElement,oe=te,Ne=Ne?Ea(Ne):null,Ne!==null&&(Ct=a(Ne),$e=Ne.tag,Ne!==Ct||$e!==5&&$e!==27&&$e!==6)&&(Ne=null)):(oe=null,Ne=te),oe!==Ne)){if($e=Ix,le="onMouseLeave",X="onMouseEnter",F="mouse",(r==="pointerout"||r==="pointerover")&&($e=Dx,le="onPointerLeave",X="onPointerEnter",F="pointer"),Ct=oe==null?ne:il(oe),J=Ne==null?ne:il(Ne),ne=new $e(le,F+"leave",oe,c,ce),ne.target=Ct,ne.relatedTarget=J,le=null,Ea(ce)===te&&($e=new $e(X,F+"enter",Ne,c,ce),$e.target=J,$e.relatedTarget=Ct,le=$e),Ct=le,oe&&Ne)t:{for($e=XO,X=oe,F=Ne,J=0,le=X;le;le=$e(le))J++;le=0;for(var ze=F;ze;ze=$e(ze))le++;for(;0<J-le;)X=$e(X),J--;for(;0<le-J;)F=$e(F),le--;for(;J--;){if(X===F||F!==null&&X===F.alternate){$e=X;break t}X=$e(X),F=$e(F)}$e=null}else $e=null;oe!==null&&R_(de,ne,oe,$e,!1),Ne!==null&&Ct!==null&&R_(de,Ct,Ne,$e,!0)}}e:{if(ne=te?il(te):window,oe=ne.nodeName&&ne.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ne.type==="file")var ft=qx;else if(Fx(ne))if(Vx)ft=aO;else{ft=oO;var Oe=sO}else oe=ne.nodeName,!oe||oe.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&Ip(te.elementType)&&(ft=qx):ft=iO;if(ft&&(ft=ft(r,te))){Hx(de,ft,c,ce);break e}Oe&&Oe(r,ne,te),r==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&Mp(ne,"number",ne.value)}switch(Oe=te?il(te):window,r){case"focusin":(Fx(Oe)||Oe.contentEditable==="true")&&(Ma=Oe,Zp=te,ml=null);break;case"focusout":ml=Zp=Ma=null;break;case"mousedown":Yp=!0;break;case"contextmenu":case"mouseup":case"dragend":Yp=!1,Jx(de,c,ce);break;case"selectionchange":if(lO)break;case"keydown":case"keyup":Jx(de,c,ce)}var Ye;if(qp)e:{switch(r){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else 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()):(mo=ce,Up="value"in mo?mo.value:mo.textContent,Oa=!0)),Oe=id(te,nt),0<Oe.length&&(nt=new Px(nt,r,null,c,ce),de.push({event:nt,listeners:Oe}),Ye?nt.data=Ye:(Ye=Bx(c),Ye!==null&&(nt.data=Ye)))),(Ye=Jk?eO(r,c):tO(r,c))&&(nt=id(te,"onBeforeInput"),0<nt.length&&(Oe=new Px("onBeforeInput","beforeinput",null,c,ce),de.push({event:Oe,listeners:nt}),Oe.data=Ye)),KO(de,r,te,c,ce)}T_(de,o)})}function $l(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=al(r,c),m!=null&&u.unshift($l(r,m,v)),m=al(r,o),m!=null&&u.push($l(r,m,v))),r.tag===3)return u;r=r.return}return[]}function XO(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=al(c,v),te!=null&&E.unshift($l(c,te,$))):m||(te=al(c,v),te!=null&&E.push($l(c,te,$)))),c=c.return}E.length!==0&&r.push({event:o,listeners:E})}var QO=/\r\n?/g,WO=/\u0000|\uFFFD/g;function N_(r){return(typeof r=="string"?r:""+r).replace(QO,`
67
- `).replace(WO,"")}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=Es);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":ws(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":ws(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":ws(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":ws(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":ws(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":ws(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":ws(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":ws(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":ws(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=Ck.get(c)||c,lf(r,c,u))}}function xg(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=Es);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<Ul.length;u++)et(Ul[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(Ip(o)){for(ce in c)c.hasOwnProperty(ce)&&(u=c[ce],u!==void 0&&xg(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 JO(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(oe in c){var de=c[oe];if(c.hasOwnProperty(oe)&&de!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":$=de;default:u.hasOwnProperty(oe)||Tt(r,o,oe,null,u,de)}}for(var ne in u){var oe=u[ne];if(de=c[ne],u.hasOwnProperty(ne)&&(oe!=null||de!=null))switch(ne){case"type":v=oe;break;case"name":m=oe;break;case"checked":te=oe;break;case"defaultChecked":ce=oe;break;case"value":E=oe;break;case"defaultValue":k=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(s(137,o));break;default:oe!==de&&Tt(r,o,ne,oe,u,de)}}Op(r,E,k,$,te,ce,v,m);return;case"select":oe=E=k=ne=null;for(v in c)if($=c[v],c.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":oe=$;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":ne=v;break;case"defaultValue":k=v;break;case"multiple":E=v;default:v!==$&&Tt(r,o,m,v,u,$)}o=k,c=E,u=oe,ne!=null?Na(r,!!c,ne,!1):!!u!=!!c&&(o!=null?Na(r,!!c,o,!0):Na(r,!!c,c?[]:"",!1));return;case"textarea":oe=ne=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":ne=m;break;case"defaultValue":oe=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,ne,oe);return;case"option":for(var Ne in c)ne=c[Ne],c.hasOwnProperty(Ne)&&ne!=null&&!u.hasOwnProperty(Ne)&&(Ne==="selected"?r.selected=!1:Tt(r,o,Ne,null,u,ne));for($ in u)ne=u[$],oe=c[$],u.hasOwnProperty($)&&ne!==oe&&(ne!=null||oe!=null)&&($==="selected"?r.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Tt(r,o,$,ne,u,oe));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var $e in c)ne=c[$e],c.hasOwnProperty($e)&&ne!=null&&!u.hasOwnProperty($e)&&Tt(r,o,$e,null,u,ne);for(te in u)if(ne=u[te],oe=c[te],u.hasOwnProperty(te)&&ne!==oe&&(ne!=null||oe!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(s(137,o));break;default:Tt(r,o,te,ne,u,oe)}return;default:if(Ip(o)){for(var Ct in c)ne=c[Ct],c.hasOwnProperty(Ct)&&ne!==void 0&&!u.hasOwnProperty(Ct)&&xg(r,o,Ct,void 0,u,ne);for(ce in u)ne=u[ce],oe=c[ce],!u.hasOwnProperty(ce)||ne===oe||ne===void 0&&oe===void 0||xg(r,o,ce,ne,u,oe);return}}for(var X in c)ne=c[X],c.hasOwnProperty(X)&&ne!=null&&!u.hasOwnProperty(X)&&Tt(r,o,X,null,u,ne);for(de in u)ne=u[de],oe=c[de],!u.hasOwnProperty(de)||ne===oe||ne==null&&oe==null||Tt(r,o,de,ne,u,oe)}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 eM(){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,de=$.initiatorType;ce&&A_(de)&&($=$.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 Sg=null,_g=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 wg(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Eg=null;function tM(){var r=window.event;return r&&r.type==="popstate"?r===Eg?!1:(Eg=r,!0):(Eg=null,!1)}var M_=typeof setTimeout=="function"?setTimeout:void 0,nM=typeof clearTimeout=="function"?clearTimeout:void 0,I_=typeof Promise=="function"?Promise:void 0,rM=typeof queueMicrotask=="function"?queueMicrotask:typeof I_<"u"?function(r){return I_.resolve(null).then(r).catch(sM)}:M_;function sM(r){setTimeout(function(){throw r})}function Oo(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")Bl(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,Bl(c);for(var v=c.firstChild;v;){var E=v.nextSibling,k=v.nodeName;v[ol]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&v.rel.toLowerCase()==="stylesheet"||c.removeChild(v),v=E}}else c==="body"&&Bl(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 Tg(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":Tg(c),Ap(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function oM(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[ol])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 iM(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 Cg(r){return r.data==="$?"||r.data==="$~"}function Rg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function aM(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 Ng=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 Bl(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Ap(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 $s=G.d;G.d={f:cM,r:lM,D:uM,C:fM,L:dM,m:hM,X:mM,S:pM,M:gM};function cM(){var r=$s.f(),o=Jf();return r||o}function lM(r){var o=Ta(r);o!==null&&o.tag===5&&o.type==="form"?sS(o):$s.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),vn(o),u.head.appendChild(o)))}}function uM(r){$s.D(r),F_("dns-prefetch",r,null)}function fM(r,o){$s.C(r,o),F_("preconnect",r,o)}function dM(r,o,c){$s.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(Fl(v))||o==="script"&&u.querySelector(Hl(v))||(o=u.createElement("link"),Tn(o,"link",r),vn(o),u.head.appendChild(o)))}}function hM(r,o){$s.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(Hl(v)))return}u=c.createElement("link"),Tn(u,"link",r),vn(u),c.head.appendChild(u)}}}function pM(r,o,c){$s.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(Fl(v)))k.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":o},c),(c=Ir.get(v))&&jg(r,c);var $=E=u.createElement("link");vn($),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 mM(r,o){$s.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(Hl(m)),v||(r=y({src:r,async:!0},o),(o=Ir.get(m))&&Ag(r,o),v=c.createElement("script"),vn(v),Tn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function gM(r,o){$s.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(Hl(m)),v||(r=y({src:r,async:!0,type:"module"},o),(o=Ir.get(m))&&Ag(r,o),v=c.createElement("script"),vn(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(Fl(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||yM(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 Fl(r){return'link[rel="stylesheet"]['+r+"]"}function q_(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function yM(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),vn(o),r.head.appendChild(o))}function oc(r){return'[src="'+Cr(r)+'"]'}function Hl(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,vn(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"),vn(u),Tn(u,"style",m),ld(u,c.precedence,r),o.instance=u;case"stylesheet":m=sc(c.href);var v=r.querySelector(Fl(m));if(v)return o.state.loading|=4,o.instance=v,vn(v),v;u=q_(c),(m=Ir.get(m))&&jg(u,m),v=(r.ownerDocument||r).createElement("link"),vn(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(Hl(v)))?(o.instance=m,vn(m),m):(u=c,(m=Ir.get(v))&&(u=y({},c),Ag(u,m)),r=r.ownerDocument||r,m=r.createElement("script"),vn(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 jg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function Ag(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var 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[ol]||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 vM(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 bM(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(Fl(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,vn(v);return}v=o.ownerDocument||o,u=q_(u),(m=Ir.get(m))&&jg(u,m),v=v.createElement("link"),vn(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 kg=0;function xM(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&&kg===0&&(kg=62500*eM());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>kg?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(SM,r),dd=null,fd.call(r))}function SM(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 ql={$$typeof:N,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function _M(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,de){return r=new _M(r,o,c,E,$,te,ce,de,k),o=1,v===!0&&(o|=24),v=sr(3,null,null,o),r.current=v,v.stateNode=r,o=um(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:c,cache:o},pm(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=So(o),u.payload={element:c},v=v===void 0?null:v,v!==null&&(u.callback=v),c=_o(r,u,o),c!==null&&(Vn(c,r,o),_l(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 Og(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),Og(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),Og(r,o)}}var pd=!0;function wM(r,o,c,u){var m=D.T;D.T=null;var v=G.p;try{G.p=2,Mg(r,o,c,u)}finally{G.p=v,D.T=m}}function EM(r,o,c,u){var m=D.T;D.T=null;var v=G.p;try{G.p=8,Mg(r,o,c,u)}finally{G.p=v,D.T=m}}function Mg(r,o,c,u){if(pd){var m=Ig(u);if(m===null)bg(r,o,u,md,c),nw(r,u);else if(CM(m,r,o,c,u))u.stopPropagation();else if(nw(r,u),o&4&&-1<TM.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&=~$}ds(v),(pt&6)===0&&(Qf=Be()+500,Ll(0))}}break;case 31:case 13:k=ji(v,2),k!==null&&Vn(k,v,2),Jf(),Og(v,2)}if(v=Ig(u),v===null&&bg(r,o,u,md,c),v===m)break;m=v}m!==null&&u.stopPropagation()}else bg(r,o,u,null,c)}}function Ig(r){return r=Dp(r),Pg(r)}var md=null;function Pg(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 ht:return 268435456;default:return 32}default:return 32}}var Dg=!1,Mo=null,Io=null,Po=null,Vl=new Map,Kl=new Map,Do=[],TM="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":Mo=null;break;case"dragenter":case"dragleave":Io=null;break;case"mouseover":case"mouseout":Po=null;break;case"pointerover":case"pointerout":Vl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kl.delete(o.pointerId)}}function Gl(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 CM(r,o,c,u,m){switch(o){case"focusin":return Mo=Gl(Mo,r,o,c,u,m),!0;case"dragenter":return Io=Gl(Io,r,o,c,u,m),!0;case"mouseover":return Po=Gl(Po,r,o,c,u,m),!0;case"pointerover":var v=m.pointerId;return Vl.set(v,Gl(Vl.get(v)||null,r,o,c,u,m)),!0;case"gotpointercapture":return v=m.pointerId,Kl.set(v,Gl(Kl.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=Ig(r.nativeEvent);if(c===null){c=r.nativeEvent;var u=new c.constructor(c.type,c);Pp=u,c.target.dispatchEvent(u),Pp=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 RM(){Dg=!1,Mo!==null&&gd(Mo)&&(Mo=null),Io!==null&&gd(Io)&&(Io=null),Po!==null&&gd(Po)&&(Po=null),Vl.forEach(sw),Kl.forEach(sw)}function yd(r,o){r.blockedOn===o&&(r.blockedOn=null,Dg||(Dg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,RM)))}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(Pg(u||c)===null)continue;break}var v=Ta(c);v!==null&&(r.splice(o,3),o-=3,Im(v,{pending:!0,data:m,method:c.method,action:u},u,m))}}))}function ic(r){function o($){return yd($,r)}Mo!==null&&yd(Mo,r),Io!==null&&yd(Io,r),Po!==null&&yd(Po,r),Vl.forEach(o),Kl.forEach(o);for(var c=0;c<Do.length;c++){var u=Do[c];u.blockedOn===r&&(u.blockedOn=null)}for(;0<Do.length&&(c=Do[0],c.blockedOn===null);)rw(c),c.blockedOn===null&&Do.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(Pg(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 zg(r){this._internalRoot=r}bd.prototype.render=zg.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=zg.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<Do.length&&o!==0&&o<Do[c].priority;c++);Do.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"));G.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 NM={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(NM),Qt=xd}catch{}}return Xl.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,vg(r),new zg(o)},Xl.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=So(u),m.callback=null,_o(c,m,u),c=u,o.current.lanes=c,_s(o,c),ds(o),r[wa]=o.current,vg(r),new bd(o)},Xl.version="19.2.4",Xl}var YE;function i6(){if(YE)return ry.exports;YE=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(),ry.exports=o6(),ry.exports}var a6=i6(),Wc=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(){}},c6={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l6=class{#e=c6;#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 l6;function u6(e){setTimeout(e,0)}var ca=typeof window>"u"||"Deno"in globalThis;function Mn(){}function f6(e,t){return typeof e=="function"?e(t):e}function pv(e){return typeof e=="number"&&e>=0&&e!==1/0}function mN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xo(e,t){return typeof e=="function"?e(t):e}function zr(e,t){return typeof e=="function"?e(t):e}function XE(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:a,queryKey:l,stale:f}=e;if(l){if(s){if(t.queryHash!==Rb(l,t.options))return!1}else if(!Su(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 QE(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(!Su(t.options.mutationKey,a))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function Rb(e,t){return(t?.queryKeyHashFn||la)(e)}function la(e){return JSON.stringify(e,(t,n)=>mv(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Su(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Su(e[n],t[n])):!1}var d6=Object.prototype.hasOwnProperty;function gN(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=WE(e)&&WE(t);if(!s&&!(mv(e)&&mv(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:d6.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 Rh(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 WE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mv(e){if(!JE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!JE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function JE(e){return Object.prototype.toString.call(e)==="[object Object]"}function h6(e){return new Promise(t=>{Zi.setTimeout(t,e)})}function gv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?gN(e,t):t}function p6(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function m6(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Nb=Symbol();function yN(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Nb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jb(e,t){return typeof e=="function"?e(...t):!!e}function g6(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 y6=class extends Wc{#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"}},Ab=new y6;function yv(){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 v6=u6;function b6(){let e=[],t=0,n=f=>{f()},s=f=>{f()},i=v6;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=b6(),x6=class extends Wc{#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}},Nh=new x6;function S6(e){return Math.min(1e3*2**e,3e4)}function vN(e){return(e??"online")==="online"?Nh.isOnline():!0}var vv=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=yv(),a=()=>i.status!=="pending",l=w=>{if(!a()){const T=new vv(w);b(T),e.onCancel?.(T)}},f=()=>{t=!0},d=()=>{t=!1},p=()=>Ab.isFocused()&&(e.networkMode==="always"||Nh.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??S6,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),h6(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(),pv(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)}},_6=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=tT(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=tT(this.options);t.data!==void 0&&(this.setState(eT(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=gv(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===Nb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xo(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 vv&&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 vv){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,...eT(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 eT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function tT(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 w6=class extends Wc{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=yv(),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),nT(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bv(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&&!Rh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&rT(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)||Xo(this.options.staleTime,this.#t)!==Xo(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 T6(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=Xo(this.options.staleTime,this.#t);if(ca||this.#s.isStale||!pv(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||!pv(this.#c)||this.#c===0)&&(this.#u=Zi.setInterval(()=>{(this.options.refetchIntervalInBackground||Ab.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&&nT(e,t),Q=A&&rT(e,n,t,s);(P||Q)&&(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=gv(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=gv(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:kb(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,Q=Z=>{P?Z.reject(j.error):A&&Z.resolve(j.data)},B=()=>{const Z=this.#a=j.promise=yv();Q(Z)},U=this.#a;switch(U.status){case"pending":e.queryHash===n.queryHash&&Q(U);break;case"fulfilled":(P||j.data!==U.value)&&B();break;case"rejected":(!P||j.error!==U.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),Rh(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 E6(e,t){return zr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function nT(e,t){return E6(e,t)||e.state.data!==void 0&&bv(e,t,t.refetchOnMount)}function bv(e,t,n){if(zr(t.enabled,e)!==!1&&Xo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&kb(e,t)}return!1}function rT(e,t,n,s){return(e!==t||zr(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&kb(e,n)}function kb(e,t){return zr(t.enabled,e)!==!1&&e.isStaleByTime(Xo(t.staleTime,e))}function T6(e,t){return!Rh(e.getCurrentResult(),t)}function sT(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=>{g6(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 z={client:t.client,queryKey:t.queryKey,pageParam:w,direction:T?"backward":"forward",meta:t.options.meta};return y(z),z})(),N=await b(O),{maxPages:R}=t.options,M=T?m6:p6;return{pages:M(S.pages,N,R),pageParams:M(S.pageParams,w,R)}};if(i&&a.length){const S=i==="backward",w=S?C6:oT,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:oT(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 oT(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 C6(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var R6=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 N6=class extends Wc{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 R6({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=>QE(t,n))}findAll(e={}){return this.getAll().filter(t=>QE(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 j6=class extends Wc{#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),Rh(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)})})}},A6=class extends Wc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,i=t.queryHash??Rb(s,t);let a=this.get(i);return a||(a=new _6({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=>XE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>XE(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()})})}},k6=class{#e;#t;#n;#s;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new A6,this.#t=e.mutationCache||new N6,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Ab.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Nh.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(Xo(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=f6(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(Xo(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=sT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mn).catch(Mn)}ensureInfiniteQueryData(e){return e.behavior=sT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Nh.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=>{Su(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=>{Su(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Rb(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===Nb&&(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},O6=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(wN.Provider,{value:e,children:t})),EN=_.createContext(!1),M6=()=>_.useContext(EN);EN.Provider;function I6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var P6=_.createContext(I6()),D6=()=>_.useContext(P6),z6=(e,t,n)=>{const s=n?.state.error&&typeof e.throwOnError=="function"?jb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},L6=e=>{_.useEffect(()=>{e.clearReset()},[e])},U6=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||jb(n,[e.error,s])),$6=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))}},B6=(e,t)=>e.isLoading&&e.isFetching&&!t,F6=(e,t)=>e?.suspense&&t.isPending,iT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function H6(e,t,n){const s=M6(),i=D6(),a=_r(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const f=a.getQueryCache().get(l.queryHash);l._optimisticResults=s?"isRestoring":"optimistic",$6(l),z6(l,i,f),L6(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]),F6(l,g))throw iT(l,p,i);if(U6({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&&B6(g,s)&&(d?iT(l,p,i):f?.promise)?.catch(Mn).finally(()=>{p.updateResult()}),l.notifyOnChangeProps?g:p.trackResult(g)}function Wn(e,t){return H6(e,w6)}function os(e,t){const n=_r(),[s]=_.useState(()=>new j6(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&&jb(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 Ob=0,Hi=0,cu=0;const Vs=[],{link:mQ,unlink:CN,propagate:gQ,checkDirty:q6,shallowPropagate:yQ}=TN({update(e){return e.depsTail!==void 0?Z6(e):Y6(e)},notify(e){let t=cu,n=t;do if(Vs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(cu=t;n<--t;){const s=Vs[n];Vs[n++]=Vs[t],Vs[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,cp(e)):W6.call(e)}});function V6(){return Ob}function K6(){++Ob}function G6(){--Ob||Q6()}function Z6(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,cp(e)}}function Y6(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function X6(e){const t=e.flags;if(t&16||t&32&&q6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,cp(e)}}else e.flags=2}function Q6(){try{for(;Hi<cu;){const e=Vs[Hi];Vs[Hi++]=void 0,X6(e)}}finally{for(;Hi<cu;){const e=Vs[Hi];Vs[Hi++]=void 0,e.flags|=10}Hi=0,cu=0}}function W6(){this.depsTail=void 0,this.flags=0,cp(this);const e=this.subs;e!==void 0&&CN(e)}function cp(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 xv=[];let sh=0;const{link:aT,unlink:J6,propagate:eF,checkDirty:NN,shallowPropagate:cT}=TN({update(e){return e._update()},notify(e){xv[Sv++]=e,e.flags&=~$t.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=$t.Mutable|$t.Dirty,jh(e))}});let kd=0,Sv=0,ms;function jh(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=J6(n,e)}function jN(){if(!(V6()>0)){for(;kd<Sv;){const e=xv[kd];xv[kd++]=void 0,e.notify()}kd=0,Sv=0}}function tF(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 ms!==void 0&&aT(i,ms,sh),i._snapshot},subscribe(a){const l=RN(a),f={current:!1},d=nF(()=>{i.get(),f.current?l.next?.(i._snapshot):f.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=ms,f=Object.is;ms=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{ms=l,n&&(i.flags&=~$t.RecursedCheck),jh(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&&cT(l)}}else a&$t.Pending&&(i.flags=a&~$t.Pending);return ms!==void 0&&aT(i,ms,sh),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(eF(l),cT(l),jN())}},i}function nF(e){const t=()=>{const s=ms;ms=n,++sh,n.depsTail=void 0,n.flags=$t.Watching|$t.RecursedCheck;try{return e()}finally{ms=s,n.flags&=~$t.RecursedCheck,jh(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,jh(this)}};return t(),n}let rF=class{constructor(t){this.atom=tF(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 sF(e){try{K6(),e()}finally{G6(),jN()}}const Qo="__TSR_index",lT="popstate",uT="beforeunload";function oF(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=Ah(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[Qo];f=fT(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[Qo];f=fT(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[Qo]!==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 fT(e,t){t||(t={});const n=Mb();return{...t,key:n,__TSR_key:n,[Qo]:e}}function iF(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=(()=>Ah(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=Mb();t.history.replaceState({[Qo]: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,Q)=>{const B=f(P);C||(g=p),p=Ah(P,Q),T={href:B,state:Q,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[Qo]-p.state[Qo],Q=P===1,B=P===-1,U=!Q&&!B||y;y=!1;const Z=U?"GO":B?"BACK":"FORWARD",K=U?{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:Z})){b=!0,t.history.go(1),j.notify(K);return}}}p=d(),j.notify(K)},z=A=>{if(S){S=!1;return}let P=!1;const Q=a();if(typeof document<"u"&&Q.length)for(const B of Q){const U=B.enableBeforeUnload??!0;if(U===!0){P=!0;break}if(typeof U=="function"&&U()===!0){P=!0;break}}if(P)return A.preventDefault(),A.returnValue=""},j=oF({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(uT,z,{capture:!0}),t.removeEventListener(lT,M)},onBlocked:()=>{g&&p!==g&&(p=g)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(uT,z,{capture:!0}),t.addEventListener(lT,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 aF(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Ah(e,t){const n=aF(e),s=n.indexOf("#"),i=n.indexOf("?"),a=Mb();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||{[Qo]:0,key:a,__TSR_key:a}}}function Mb(){return(Math.random()+1).toString(36).substring(7)}const cF=!1;function lu(e){let t;return sF(()=>{t=e()}),t}function _u(e){return e[e.length-1]}function lF(e){return typeof e=="function"}function Ho(e,t){return lF(e)?e(t):e}const uF=Object.prototype.hasOwnProperty,dT=Object.prototype.propertyIsEnumerable;function ur(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=t,i=mT(e)&&mT(s);if(!i&&!(kh(e)&&kh(s)))return s;const a=i?e:hT(e);if(!a)return s;const l=i?s:hT(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:uF.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 hT(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!dT.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(!dT.call(e,i))return!1;s.push(i)}return s}function kh(e){if(!pT(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!pT(n)||!n.hasOwnProperty("isPrototypeOf"))}function pT(e){return Object.prototype.toString.call(e)==="[object Object]"}function mT(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(kh(e)&&kh(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 Dc(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 yc(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function fF(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function gT(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 fF(t)}const dF=["http:","https:","mailto:","tel:"];function Oh(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Ql(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+=gT(e.slice(n,i.index))+i[0],n=t.lastIndex;s=s+gT(n?e.slice(n):e);let a=!1;return s.startsWith("//")&&(a=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:a}}function hF(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var pF="Invariant failed";function ro(e,t){if(!e)throw new Error(pF)}function Mh(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 zc=0,ua=1,fa=2,wu=3,Yi=4,AN=5;function mF(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Ib(e,t,n=new Uint16Array(6)){const s=e.indexOf("/",t),i=s===-1?e.length:s,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=zc,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=mF(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]=wu,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=i,n}}else if(p===36){const g=f+1,y=f+2;return y===d?(n[0]=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]=zc,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function lp(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=Ib(d,f,t);let S;const w=f,T=x[5];switch(f=T+1,a++,x[0]){case zc:{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,z=N?R?N:N.toLowerCase():void 0,j=!y&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===z);if(j)S=j;else{const A=cy(ua,n.fullPath??n.from,R,M,z);S=A,A.depth=a,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case wu:{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,z=N?R?N:N.toLowerCase():void 0,j=!y&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===z);if(j)S=j;else{const A=cy(wu,n.fullPath??n.from,R,M,z);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,z=N?R?N:N.toLowerCase():void 0,j=cy(fa,n.fullPath??n.from,R,M,z);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)lp(e,t,d,f,i,a,l)}function ay(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 Bo(e){if(e.pathless)for(const t of e.pathless)Bo(t);if(e.static)for(const t of e.static.values())Bo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Bo(t);if(e.dynamic?.length){e.dynamic.sort(ay);for(const t of e.dynamic)Bo(t)}if(e.optional?.length){e.optional.sort(ay);for(const t of e.optional)Bo(t)}if(e.wildcard?.length){e.wildcard.sort(ay);for(const t of e.wildcard)Bo(t)}}function Xi(e){return{kind:zc,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function cy(e,t,n,s,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:s,suffix:i}}function gF(e,t){const n=Xi("/"),s=new Uint16Array(6);for(const i of e)lp(!1,s,i,1,n,0);Bo(n),t.masksTree=n,t.flatCache=Mh(1e3)}function yF(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=Pb(e,t.masksTree);return t.flatCache.set(e,s),s}function vF(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);lp(t,f,{from:e},1,l,0),i.singleCache.set(a,l)}return Pb(s,l,n)}function bF(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=Pb(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=_F(a.route)),t.matchCache.set(s,a),a}function xF(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function SF(e,t=!1,n){const s=Xi(e.fullPath),i=new Uint16Array(6),a={},l={};let f=0;return lp(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=xF(p.fullPath);(!l[g]||p.fullPath.endsWith("/"))&&(l[g]=p)}f++}),Bo(s),{processedTree:{segmentTree:s,singleCache:Mh(1e3),matchCache:Mh(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function Pb(e,t,n=!1){const s=e.split("/"),i=EF(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=wF(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===wu){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 _F(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function wF(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function EF(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!_u(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(!ly(e,t,y))continue;R=y.rawParams,N=y.extract,M=y.parsedParams}s&&b.route&&b.kind!==Yi&&Wl(p,y)&&(p=y);const z=x===l;if(z&&(b.route&&!a&&Wl(g,y)&&(g=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const j=z?void 0:t[x];let A;if(z&&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 Q=!0;if(b.index.skipOnParamError&&(ly(e,t,P)||(Q=!1)),Q){if(T===l&&!C&&!O&&!S)return P;Wl(g,P)&&(g=P)}}if(b.wildcard&&Wl(d,y))for(const P of b.wildcard){const{prefix:Q,suffix:B}=P;if(Q&&(z||!(P.caseSensitive?j:A??=j.toLowerCase()).startsWith(Q)))continue;if(B){if(z)continue;const Z=t.slice(x).join("/").slice(-B.length);if((P.caseSensitive?Z:Z.toLowerCase())!==B)continue}const U={node:P,index:l,skipped:S,depth:w,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M};if(!(P.skipOnParamError&&!ly(e,t,U))){d=U;break}}if(b.optional){const P=S|1<<w,Q=w+1;for(let B=b.optional.length-1;B>=0;B--){const U=b.optional[B];f.push({node:U,index:x,skipped:P,depth:Q,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(!z)for(let B=b.optional.length-1;B>=0;B--){const U=b.optional[B],{prefix:Z,suffix:K}=U;if(Z||K){const ee=U.caseSensitive?j:A??=j.toLowerCase();if(Z&&!ee.startsWith(Z)||K&&!ee.endsWith(K))continue}f.push({node:U,index:x+1,skipped:S,depth:Q,statics:T,dynamics:C,optionals:O+1,extract:N,rawParams:R,parsedParams:M})}}if(!z&&b.dynamic&&j)for(let P=b.dynamic.length-1;P>=0;P--){const Q=b.dynamic[P],{prefix:B,suffix:U}=Q;if(B||U){const Z=Q.caseSensitive?j:A??=j.toLowerCase();if(B&&!Z.startsWith(B)||U&&!Z.endsWith(U))continue}f.push({node:Q,index:x+1,skipped:S,depth:w+1,statics:T,dynamics:C+1,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(!z&&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(!z&&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 Q=b.pathless.length-1;Q>=0;Q--){const B=b.pathless[Q];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 Wl(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 ly(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 Wl(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 Db(e.filter(t=>t!==void 0).join("/"))}function Db(e){return e.replace(/\/{2,}/g,"/")}function ON(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ks(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function MN(e){return Ks(ON(e))}function Ih(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function TF(e,t,n){return Ih(e,n)===Ih(t,n)}function CF({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&&_u(f)==="";)f.pop();const y=t.split("/");for(let b=0,x=y.length;b<x;b++){const S=y[b];S===""?b?b===x-1&&f.push(S):f=[S]:S===".."?f.pop():S==="."||f.push(S)}}f.length>1&&(_u(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let d,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const b=f[y];if(!b)continue;d=Ib(b,0,d);const x=d[0];if(x===zc){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=Db(p);const g=p||"/";return l&&s&&s.set(l,g),g}function RF(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 uy(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 fy({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=Ib(e,y,d);const b=d[5];if(f=b+1,y===b)continue;const x=d[0];if(x===zc){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=uy("_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=uy(S,t,n)??"undefined";p+="/"+w+C+T;continue}if(x===wu){const S=e.substring(d[2],d[3]),w=t[S];if(w==null)continue;a[S]=w;const T=e.substring(y,d[1]),C=e.substring(d[4],b),O=uy(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 NF(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const _v="tsr-scroll-restoration-v1_3",jF=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function AF(){const e=NF();if(!e)return null;const t=e.getItem(_v);let n=t?JSON.parse(t):{};return{state:n,set:s=>{n=Ho(s,n)||n;try{e.setItem(_v,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Od=AF(),kF=e=>e.state.__TSR_key||e.href;function OF(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 Ph=!1;function MF({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];Ph=!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)}}Ph=!1}function IF(e,t){if(!Od||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Od))return;e.isScrollRestorationSetup=!0,Ph=!1;const s=e.options.getScrollRestorationKey||kF;window.history.scrollRestoration="manual";const i=a=>{if(Ph||!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=OF(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",jF(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})||(MF({storageKey:_v,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 PF(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 DF(e,t=String){const n=new URLSearchParams;for(const s in e){const i=e[s];i!==void 0&&n.set(s,t(i))}return n.toString()}function dy(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zF(e){const t=new URLSearchParams(e),n={};for(const[s,i]of t.entries()){const a=n[s];a==null?n[s]=dy(i):Array.isArray(a)?a.push(dy(i)):n[s]=[a,dy(i)]}return n}const LF=$F(JSON.parse),UF=BF(JSON.stringify,JSON.parse);function $F(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=zF(t);for(const s in n){const i=n[s];if(typeof i=="string")try{n[s]=e(i)}catch{}}return n}}function BF(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=DF(i,s);return a?`?${a}`:""}}const Lr="__root__";function FF(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?.()},up=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),vc=(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))},qo=(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:vc(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,Jl=(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,qo(e,e.router.getMatch(i),n,s);try{l.options.onError?.(n)}catch(f){n=f,qo(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&&!up(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}},HF=(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")&&qo(e,a,a.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(i):i()},qF=(e,t,n,s)=>{const i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Dc(()=>{a?.resolve()});const{paramsError:l,searchError:f}=i;l&&Jl(e,n,l,"PARSE_PARAMS"),f&&Jl(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){lu(()=>{g(),y()});return}i._nonReactive.beforeLoadPromise=Dc();const b={...vc(e,n,!1),...i.__routeContext},{search:x,params:S,cause:w}=i,T=up(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){lu(()=>{g(),y()});return}(Br(R)||yr(R))&&(g(),Jl(e,n,R,"BEFORE_LOAD")),lu(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:R})),y()})};let N;try{if(N=s.options.beforeLoad(C),yc(N))return g(),N.catch(R=>{Jl(e,n,R,"BEFORE_LOAD")}).then(O)}catch(R){g(),Jl(e,n,R,"BEFORE_LOAD")}O(N)},VF=(e,t)=>{const{id:n,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s],a=()=>f(),l=()=>qF(e,n,t,i),f=()=>{if(PN(e,n))return;const d=HF(e,n,i);return yc(d)?d.then(l):l()};return a()},KF=(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=vc(e,n),g=up(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{(!(cF??e.router.isServer)||i.ssr===!0)&&LN(s);const a=s.options.loader?.(zN(e,t,n,s)),l=s.options.loader&&yc(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;qo(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:vc(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:vc(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,yr(a)&&await s.options.notFoundComponent?.preload?.(),qo(e,e.router.getMatch(t),a);try{s.options.onError?.(a)}catch(d){l=d,qo(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:l,context:vc(e,n),status:"error",isFetching:!1}))}}catch(i){const a=e.router.getMatch(t);a&&(a._nonReactive.loaderPromise=void 0),qo(e,a,i)}},GF=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=up(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&&qo(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=Dc(),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=VF(t,f);yc(d)&&await d}const n=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<n;f++)t.matchPromises.push(GF(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=KF(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);yc(l)&&await l}catch(n){if(yr(n)&&!t.preload){const s=ih(t);throw yc(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 ZF(e){return{input:({url:t})=>{for(const n of e)t=wv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=BN(e[n],t);return t}}}function YF(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 wv(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 XF(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class QF{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=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");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=RF(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=iF()),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=Mh(1e3),b=this.buildRouteTree(),this.setRoutes(b)}!this.__store&&this.latestLocation&&(this.__store=new rF(JF(this.latestLocation)),IF(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(YF({basepath:d})),p&&b.push(p),this.rewrite=b.length===0?void 0:b.length===1?b[0]:ZF(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=SF(this.routeTree,this.options.caseSensitive,(s,i)=>{s.init({originalIndex:i})});return this.options.routeMasks&&gF(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:Ql(d).path,external:!1,searchStr:N,search:ur(s?.search,O),hash:Ql(g.slice(1)).path,state:ur(s?.state,b)}}const x=new URL(y,this.origin),S=wv(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:Ql(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:T,search:ur(s?.search,w),hash:Ql(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)=>CF({base:n,to:Db(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=>eH({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,Ho(a.params,y)),S=fy({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,w=this.getMatchedRoutes(S);let T=w.matchedRoutes;(w.foundRoute?w.foundRoute.path!=="/"&&w.routeParams["**"]:Ks(S))&&this.options.notFoundRoute&&(T=[...T,this.options.notFoundRoute]);let O=!1;if(Object.keys(x).length>0)for(const Z of T){const K=Z.options.params?.stringify??Z.options.stringifyParams;K&&(O=!0,Object.assign(x,K(x)))}const N=n.leaveParams?b:Ql(O?fy({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:S).path;let R=g;if(n._includeValidateSearch&&this.options.search?.strict){const Z={};T.forEach(K=>{if(K.options.validateSearch)try{Object.assign(Z,ah(K.options.validateSearch,{...Z,...R}))}catch{}}),R=Z}R=tH({search:R,dest:a,destRoutes:T,_includeValidateSearch:n._includeValidateSearch}),R=ur(g,R);const M=this.options.stringifySearch(R),z=a.hash===!0?l.hash:a.hash?Ho(a.hash,l.hash):void 0,j=z?`#${z}`:"";let A=a.state===!0?l.state:a.state?Ho(a.state,l.state):{};A=ur(l.state,A);const P=`${N}${M}${j}`;let Q,B,U=!1;if(this.rewrite){const Z=new URL(P,this.origin),K=BN(this.rewrite,Z);Q=Z.href.replace(Z.origin,""),K.origin!==this.origin?(B=K.href,U=!0):B=K.pathname+K.search+K.hash}else Q=hF(P),B=Q;return{publicHref:B,href:Q,pathname:N,search:R,searchStr:M,state:A,hash:z??"",external:U,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=yF(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,Ho(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=Ks(this.latestLocation.href)===Ks(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=Dc(()=>{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=Ah(f,{__TSR_index:n?y:y+1}),x=new URL(b.pathname,this.origin),S=wv(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(Oh(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=[];lu(()=>{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:XF(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&&Oh(n.options.href,this.protocolAllowlist))throw new Error(`Redirect blocked: unsafe protocol in href "${n.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);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)]);lu(()=>{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=vF(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??UF,parseSearch:t.parseSearch??LF,protocolAllowlist:t.protocolAllowlist??dF}),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["**"]:Ks(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const p=d?rH(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 K=S?.search??t.search,ee=S?._strictSearch??void 0;try{const D=ah(x.options.validateSearch,{...K})??void 0;w={...K,...D},T={...ee,...D},C=void 0}catch(D){let G=D;if(D instanceof Dh||(G=new Dh(D.message,{cause:D})),n?.throwOnError)throw G;w=K,T={},C=G}}const O=x.options.loaderDeps?.({search:w})??"",N=O?JSON.stringify(O):"",{interpolatedPath:R,usedParams:M}=fy({path:x.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),z=x.id+R+N,j=this.getMatch(z),A=y.get(x.id),P=j?._strictParams??M;let Q;if(!j)try{xT(x,M,l,P)}catch(K){if(yr(K)||Br(K)?Q=K:Q=new WF(K.message,{cause:K}),n?.throwOnError)throw Q}Object.assign(a,P);const B=A?"stay":"enter";let U;if(j)U={...j,cause:B,params:A?.params??a,_strictParams:P,search:ur(A?A.search:j.search,w),_strictSearch:T};else{const K=x.options.loader||x.options.beforeLoad||x.lazyFn||UN(x)?"pending":"success";U={id:z,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:K,isFetching:!1,error:void 0,paramsError:Q,__routeContext:void 0,_nonReactive:{loadPromise:Dc()},__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||(U.globalNotFound=p===x.id),U.searchError=C;const Z=this.getParentContext(S);U.context={...Z,...U.__routeContext,...U.__beforeLoadContext},g[b]=U}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=_u(n),l={...t.search};for(const g of n)try{Object.assign(l,ah(g.options.validateSearch,l))}catch{}const f=_u(this.state.matches),d=f&&f.routeId===a.id&&t.pathname===this.state.location.pathname;let p;if(d)p=f.params;else{const g={...s};for(const y of n)try{xT(y,s,i??{},g)}catch{}p=g}return{matchedRoutes:n,fullPath:a.fullPath,search:l,params:p}}}class Dh extends Error{}class WF extends Error{}function JF(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 Dh("Async validation not supported");if(n.issues)throw new Dh(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 eH({pathname:e,routesById:t,processedTree:n}){const s={},i=Ks(e);let a,l;const f=bF(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 tH({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){return nH(n)(e,t,s??!1)}function nH(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:Ho(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 rH(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 sH="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=Ks(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=>FF({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 oH extends FN{constructor(t){super(t)}}const Md=typeof window<"u"?_.useLayoutEffect:_.useEffect;function hy(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function iH(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 aH(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function zb(e){const t=e.errorComponent??Lb;return h.jsx(cH,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?_.createElement(t,{error:n,reset:s}):e.children})}class cH extends _.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Lb({error:e}){const[t,n]=_.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:t?"Hide Error":"Show Error"})]}),h.jsx("div",{style:{height:".25rem"}}),t?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?h.jsx("code",{children:e.message}):null})}):null]})}function lH({children:e,fallback:t=null}){return HN()?h.jsx(Mc.Fragment,{children:e}):h.jsx(Mc.Fragment,{children:t})}function HN(){return Mc.useSyncExternalStore(uH,()=>!0,()=>!1)}function uH(){return()=>{}}var py={exports:{}},my={},gy={exports:{}},yy={};var ST;function fH(){if(ST)return yy;ST=1;var e=Hu();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 yy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,yy}var _T;function qN(){return _T||(_T=1,gy.exports=fH()),gy.exports}var wT;function dH(){if(wT)return my;wT=1;var e=Hu(),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 my.useSyncExternalStoreWithSelector=function(p,g,y,b,x){var S=a(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=f(function(){function C(z){if(!O){if(O=!0,N=z,z=b(z),x!==void 0&&w.hasValue){var j=w.value;if(x(j,z))return R=j}return R=z}if(j=R,s(N,z))return j;var A=b(z);return x!==void 0&&x(j,A)?(N=z,j):(N=z,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},my}var ET;function hH(){return ET||(ET=1,py.exports=dH()),py.exports}var VN=hH();function pH(e,t){return e===t}function mH(e,t,n=pH){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 vy=_.createContext(null);function KN(){return typeof document>"u"?vy:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=vy,vy)}function Yr(e){const t=_.useContext(KN());return e?.warn,t}function vr(e){const t=Yr({warn:e?.router===void 0}),n=e?.router||t,s=_.useRef(void 0);return mH(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 fp=_.createContext(void 0),gH=_.createContext(void 0);function xs(e){const t=_.useContext(e.from?gH:fp);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 Ub(e){return xs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function $b(e){const{select:t,...n}=e;return xs({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Bb(e){return xs({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Fb(e){return xs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function dp(e){const t=Yr();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var hi=pN();function yH(e,t){const n=Yr(),s=aH(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,onFocus:M,onMouseEnter:z,onMouseLeave:j,onTouchStart:A,ignoreBlocker:P,params:Q,search:B,hash:U,state:Z,mask:K,reloadDocument:ee,unsafeRelative:D,from:G,_fromLocation:q,...V}=e,L=HN(),I=vr({select:He=>{const me=He.matches[He.matches.length-1];return{search:me?.search,hash:He.location.hash,path:me?.pathname}},structuralSharing:!0}),H=e.from,W=_.useMemo(()=>({...e,from:H}),[n,I,H,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Y=_.useMemo(()=>n.buildLocation({...W}),[n,W]),ae=Y.maskedLocation?Y.maskedLocation.publicHref:Y.publicHref,se=Y.maskedLocation?Y.maskedLocation.external:Y.external,fe=_.useMemo(()=>wH(ae,se,n.history,C),[C,se,ae,n.history]),Se=_.useMemo(()=>{if(fe?.external)return Oh(fe.href,n.protocolAllowlist)?void 0:fe.href;if(!EH(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),Oh(f,n.protocolAllowlist)?void 0:f}catch{}},[f,fe,n.protocolAllowlist]),pe=vr({select:He=>{if(Se)return!1;if(l?.exact){if(!TF(He.location.pathname,Y.pathname,n.basepath))return!1}else{const me=Ih(He.location.pathname,n.basepath),Te=Ih(Y.pathname,n.basepath);if(!(me.startsWith(Te)&&(me.length===Te.length||me[Te.length]==="/")))return!1}return(l?.includeSearch??!0)&&!ra(He.location.search,Y.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?L&&He.location.hash===Y.hash:!0}}),Me=pe?Ho(i,{})??vH:by,_e=pe?by:Ho(a,{})??by,re=[N,Me.className,_e.className].filter(Boolean).join(" "),he=(O||Me.style||_e.style)&&{...O,...Me.style,..._e.style},[ie,we]=_.useState(!1),ye=_.useRef(!1),xe=e.reloadDocument||Se?!1:d??n.options.defaultPreload,ve=p??n.options.defaultPreloadDelay??0,Ie=_.useCallback(()=>{n.preloadRoute({...W,_builtLocation:Y}).catch(He=>{console.warn(He),console.warn(sH)})},[n,W,Y]),Ue=_.useCallback(He=>{He?.isIntersecting&&Ie()},[Ie]);iH(s,Ue,_H,{disabled:!!C||xe!=="viewport"}),_.useEffect(()=>{ye.current||!C&&xe==="render"&&(Ie(),ye.current=!0)},[C,Ie,xe]);const Ee=He=>{const me=He.currentTarget.getAttribute("target"),Te=T!==void 0?T:me;if(!C&&!TH(He)&&!He.defaultPrevented&&(!Te||Te==="_self")&&He.button===0){He.preventDefault(),hi.flushSync(()=>{we(!0)});const qe=n.subscribe("onResolved",()=>{qe(),we(!1)});n.navigate({...W,replace:y,resetScroll:x,hashScrollIntoView:g,startTransition:b,viewTransition:S,ignoreBlocker:P})}};if(Se)return{...V,ref:s,href:Se,...w&&{children:w},...T&&{target:T},...C&&{disabled:C},...O&&{style:O},...N&&{className:N},...R&&{onClick:R},...M&&{onFocus:M},...z&&{onMouseEnter:z},...j&&{onMouseLeave:j},...A&&{onTouchStart:A}};const Ve=He=>{C||xe&&Ie()},Qe=Ve,Be=He=>{if(!(C||!xe))if(!ve)Ie();else{const me=He.target;if(eu.has(me))return;const Te=setTimeout(()=>{eu.delete(me),Ie()},ve);eu.set(me,Te)}},We=He=>{if(C||!xe||!ve)return;const me=He.target,Te=eu.get(me);Te&&(clearTimeout(Te),eu.delete(me))};return{...V,...Me,..._e,href:fe?.href,ref:s,onClick:tu([R,Ee]),onFocus:tu([M,Ve]),onMouseEnter:tu([z,Be]),onMouseLeave:tu([j,We]),onTouchStart:tu([A,Qe]),disabled:!!C,target:T,...he&&{style:he},...re&&{className:re},...C&&bH,...pe&&xH,...L&&ie&&SH}}const by={},vH={className:"active"},bH={role:"link","aria-disabled":!0},xH={"data-status":"active","aria-current":"page"},SH={"data-transitioning":"transitioning"},eu=new WeakMap,_H={rootMargin:"100px"},tu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function wH(e,t,n,s){if(!s)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function EH(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const bc=_.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:i,...a}=yH(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 TH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let CH=class extends FN{constructor(t){super(t),this.useMatch=n=>xs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>xs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>$b({...n,from:this.id}),this.useLoaderData=n=>Ub({...n,from:this.id}),this.useNavigate=()=>dp({from:this.fullPath}),this.Link=Mc.forwardRef((n,s)=>h.jsx(bc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function co(e){return new CH(e)}class RH extends oH{constructor(t){super(t),this.useMatch=n=>xs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>xs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>$b({...n,from:this.id}),this.useLoaderData=n=>Ub({...n,from:this.id}),this.useNavigate=()=>dp({from:this.fullPath}),this.Link=Mc.forwardRef((n,s)=>h.jsx(bc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function NH(e){return new RH(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=>{this.silent;const i=co(s);return i.isRoot=!1,i},this.silent=n?.silent}}class RT{constructor(t){this.useMatch=n=>xs({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>xs({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>$b({...n,from:this.options.id}),this.useLoaderData=n=>Ub({...n,from:this.options.id}),this.useNavigate=()=>{const n=Yr();return dp({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 jH(){const e=Yr(),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=hy(a),f=a||n||i,d=hy(f),p=a||i,g=hy(p);return e.startTransition=y=>{s(!0),_.startTransition(()=>{y(),s(!1)})},_.useEffect(()=>{const y=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ks(e.latestLocation.publicHref)!==Ks(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&&PF(e)}},[f,d,e]),null}function AH(e){const t=vr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return h.jsx(zb,{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 kH(){return h.jsx("p",{children:"Not Found"})}function lc(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(kH,{})}function OH(){return Yr().isScrollRestoring,null}const ZN=_.memo(function({matchId:t}){const n=Yr(),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:lc,b=f?zb:lc,x=p?AH:lc,S=i.isRoot?i.options.shellComponent??lc:lc;return h.jsxs(S,{children:[h.jsx(fp.Provider,{value:t,children:h.jsx(y,{fallback:l,children:h.jsx(b,{getResetKey:()=>s.resetKey,errorComponent:f||Lb,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(lH,{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(MH,{}),h.jsx(OH,{})]}):null]})});function MH(){const e=Yr(),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=Yr(),{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=Dc();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=Yr(),n=_.useContext(fp),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 IH(){const e=Yr(),n=e.routesById[Lr].options.pendingComponent??e.options.defaultPendingComponent,s=n?h.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?lc:_.Suspense,a=h.jsxs(i,{fallback:s,children:[h.jsx(jH,{}),h.jsx(PH,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:a}):a}function PH(){const e=Yr(),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(fp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:h.jsx(zb,{getResetKey:()=>n,errorComponent:Lb,onCatch:i=>{i.message||i.toString()},children:s})})}const XN=e=>new DH(e);class DH extends QF{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=KN(),i=h.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:i}):i}function LH({router:e,...t}){return h.jsx(zH,{router:e,...t,children:h.jsx(IH,{})})}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:z,body:j,middleware:A=[],...P}=x||{};let Q=t;S&&(Q=OT(S)??t);let B=typeof i=="function"?i:AT(i);R&&(B=typeof R=="function"?R:AT({...typeof i=="object"?i:{},...R}));const U=z||l||HH,Z=j===void 0?void 0:M(j,kT(f,C,O.header)),K=kT(Z===void 0||Z instanceof FormData?{}:{"Content-Type":"application/json"},f,C,O.header),ee=[...g,...A],D={redirect:"follow",...p,...P,body:Z,headers:K};let G,q,V=new T(VH(b,{baseUrl:Q,params:O,querySerializer:B,pathSerializer:U}),D),L;for(const W in P)W in V||(V[W]=P[W]);if(ee.length){G=BH(),q=Object.freeze({baseUrl:Q,fetch:w,parseAs:N,querySerializer:B,bodySerializer:M,pathSerializer:U});for(const W of ee)if(W&&typeof W=="object"&&typeof W.onRequest=="function"){const Y=await W.onRequest({request:V,schemaPath:b,params:O,options:q,id:G});if(Y)if(Y instanceof T)V=Y;else if(Y instanceof Response){L=Y;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!L){try{L=await w(V,d)}catch(W){let Y=W;if(ee.length)for(let ae=ee.length-1;ae>=0;ae--){const se=ee[ae];if(se&&typeof se=="object"&&typeof se.onError=="function"){const fe=await se.onError({request:V,error:Y,schemaPath:b,params:O,options:q,id:G});if(fe){if(fe instanceof Response){Y=void 0,L=fe;break}if(fe instanceof Error){Y=fe;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(Y)throw Y}if(ee.length)for(let W=ee.length-1;W>=0;W--){const Y=ee[W];if(Y&&typeof Y=="object"&&typeof Y.onResponse=="function"){const ae=await Y.onResponse({request:V,response:L,schemaPath:b,params:O,options:q,id:G});if(ae){if(!(ae instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");L=ae}}}}const I=L.headers.get("Content-Length");if(L.status===204||V.method==="HEAD"||I==="0"&&!L.headers.get("Transfer-Encoding")?.includes("chunked"))return L.ok?{data:void 0,response:L}:{error:void 0,response:L};if(L.ok)return{data:await(async()=>{if(N==="stream")return L.body;if(N==="json"&&!I){const Y=await L.text();return Y?JSON.parse(Y):void 0}return await L[N]()})(),response:L};let H=await L.text();try{H=JSON.parse(H)}catch{}return{error:H,response:L}}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 hp(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 QN(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(hp(f,t[l],n))}const a=s.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function WN(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(hp(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(WN(i,a,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof a=="object"){s.push(QN(i,a,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}s.push(hp(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,WN(i,f,{style:l,explode:a}));continue}if(typeof f=="object"){n=n.replace(s,QN(i,f,{style:l,explode:a}));continue}if(l==="matrix"){n=n.replace(s,`;${hp(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 Ku(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 JN=_.createContext(null);function QH({children:e,defaultConfig:t=null}){const[n,s]=pi("sync-console-connection",null),[i,a]=_.useState({isConnected:!1,isConnecting:!1,error:null,client:null});_.useEffect(()=>{if(!(n?.serverUrl?.trim()&&n.token?.trim())&&t?.serverUrl?.trim()&&t.token?.trim()){s({serverUrl:t.serverUrl.trim(),token:t.token.trim()});return}},[s,n,t]);const l=_.useCallback(async(y,b)=>{const x=y??n;if(!x)return a(w=>({...w,error:"No connection configured"})),!1;const S={serverUrl:x.serverUrl?.trim()??"",token:x.token?.trim()??""};if(!S.serverUrl)return a(w=>({...w,error:"Server URL is required"})),!1;if(!S.token)return a(w=>({...w,error:"Token is required"})),!1;y&&(b?.persistOverride??!0)&&s(S),a(w=>({...w,isConnecting:!0,error:null}));try{const w=YH(S);return await XH(w),a({isConnected:!0,isConnecting:!1,client:w,error:null}),!0}catch(w){return a({isConnected:!1,isConnecting:!1,client:null,error:w instanceof Error?w.message:"Connection failed"}),!1}},[n,s]),f=_.useCallback(y=>{y?.clearSavedConfig&&s(null),a({isConnected:!1,isConnecting:!1,client:null,error:null})},[s]),d=_.useCallback(()=>{a(y=>({...y,error:null}))},[]),p=_.useCallback(y=>{s(y),a({isConnected:!1,isConnecting:!1,client:null,error:null})},[s]),g=_.useMemo(()=>({config:n,setConfig:p,isConnected:i.isConnected,isConnecting:i.isConnecting,error:i.error,client:i.client,connect:l,disconnect:f,clearError:d}),[n,p,i,l,f,d]);return h.jsx(JN.Provider,{value:g,children:e})}function Dt(){const e=_.useContext(JN);if(!e)throw new Error("useConnection must be used within a ConnectionProvider");return e}function Vt(){const{client:e}=Dt();return e}function ej(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=ej(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Hb(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ej(e))&&(s&&(s+=" "),s+=t);return s}var WH=e=>typeof e=="number"&&e!=+e,zh=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,MT=e=>(typeof e=="number"||e instanceof Number)&&!WH(e);function JH(){}var Lh=Symbol("NOT_FOUND");function eq(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function tq(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function nq(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 rq(e){const t=Array.isArray(e[0])?e[0]:e;return nq(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function sq(e,t){const n=[],{length:s}=e;for(let i=0;i<s;i++)n.push(e[i].apply(null,t));return n}function oq(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Lh},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function iq(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 Lh}function i(f,d){s(f)===Lh&&(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 aq=(e,t)=>e===t;function cq(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 lq(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=aq,maxSize:i=1,resultEqualityCheck:a}=n,l=cq(s);let f=0;const d=i<=1?oq(l):iq(i,l);function p(){let g=d.get(arguments);if(g===Lh){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 uq=class{constructor(e){this.value=e}deref(){return this.value}},fq=typeof WeakRef<"u"?WeakRef:uq,dq=0,PT=1;function Id(){return{s:dq,v:void 0,o:null,p:null}}function tj(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 fq(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 nj(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()),eq(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const g={...n,...d},{memoize:y,memoizeOptions:b=[],argsMemoize:x=tj,argsMemoizeOptions:S=[]}=g,w=IT(b),T=IT(S),C=rq(i),O=y(function(){return a++,p.apply(null,arguments)},...w),N=x(function(){l++;const M=sq(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 hq=nj(tj),pq=Object.assign((e,t=hq)=>{tq(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:()=>pq});function Uh(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}var xy={},Sy={},_y={},DT;function mq(){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})(_y)),_y}var zT;function gq(){return zT||(zT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mq();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})(Sy)),Sy}var LT;function yq(){return LT||(LT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gq();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})(xy)),xy}var wy,UT;function vq(){return UT||(UT=1,wy=yq().throttle),wy}var bq=vq();const xq=M1(bq);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++]))}},vs={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},rj=(e,t,n)=>{var{width:s=vs.width,height:i=vs.height,aspect:a,maxHeight:l}=n,f=zh(s)?e:Number(s),d=zh(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}},Sq={width:0,height:0,overflow:"visible"},_q={width:0,overflowX:"visible"},wq={height:0,overflowY:"visible"},Eq={},Tq=e=>{var{width:t,height:n}=e,s=zh(t),i=zh(n);return s&&i?Sq:s?_q:i?wq:Eq};function Cq(e){var{width:t,height:n,aspect:s}=e,i=t,a=n;return i===void 0&&a===void 0?(i=vs.width,a=vs.height):i===void 0?i=s&&s>0?void 0:vs.width:a===void 0&&(a=s&&s>0?void 0:vs.height),{width:i,height:a}}function Ev(){return Ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ev.apply(null,arguments)}function 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){Rq(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 Rq(e,t,n){return(t=Nq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nq(e){var t=jq(e,"string");return typeof t=="symbol"?t:t+""}function jq(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 sj=_.createContext(vs.initialDimension);function Aq(e){return Uh(e.width)&&Uh(e.height)}function oj(e){var{children:t,width:n,height:s}=e,i=_.useMemo(()=>({width:n,height:s}),[n,s]);return Aq(i)?_.createElement(sj.Provider,{value:i},t):null}var kq=()=>_.useContext(sj),Oq=_.forwardRef((e,t)=>{var{aspect:n,initialDimension:s=vs.initialDimension,width:i,height:a,minWidth:l=vs.minWidth,minHeight:f,maxHeight:d,children:p,debounce:g=vs.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(Q=>{var B=Math.round(A),U=Math.round(P);return Q.containerWidth===B&&Q.containerHeight===U?Q:{containerWidth:B,containerHeight:U}})},[]);_.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return JH;var A=U=>{var Z,K=U[0];if(K!=null){var{width:ee,height:D}=K.contentRect;N(ee,D),(Z=T.current)===null||Z===void 0||Z.call(T,ee,D)}};g>0&&(A=xq(A,g,{trailing:!0,leading:!1}));var P=new ResizeObserver(A),{width:Q,height:B}=w.current.getBoundingClientRect();return N(Q,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:z,calculatedHeight:j}=rj(R,M,{width:i,height:a,aspect:n,maxHeight:d});return $T(z!=null&&z>0||j!=null&&j>0,`The width(%s) and height(%s) of chart should be greater than 0,
66
+ `+u.stack}}var Ie=Object.prototype.hasOwnProperty,Ue=e.unstable_scheduleCallback,Ee=e.unstable_cancelCallback,Ve=e.unstable_shouldYield,Qe=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,ht=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 is(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 as(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 _s(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),de=1<<ce;k[ce]=0,$[ce]=-1;var ne=te[ce];if(ne!==null)for(te[ce]=null,ce=0;ce<ne.length;ce++){var oe=ne[ce];oe!==null&&(oe.lane&=-536870913)}c&=~de}u!==0&&cs(r,u,0),v!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=v&~(E&~o))}function cs(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 fo(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 ho(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 sl(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function af(){var r=K.p;return r!==0?r:(r=window.event,r===void 0?32:tw(r.type))}function cf(r,o){var c=K.p;try{return K.p=r,o()}finally{K.p=c}}var po=Math.random().toString(36).slice(2),Sn="__reactFiber$"+po,Un="__reactProps$"+po,wa="__reactContainer$"+po,jp="__reactEvents$"+po,xk="__reactListeners$"+po,Sk="__reactHandles$"+po,vx="__reactResources$"+po,ol="__reactMarker$"+po;function Ap(r){delete r[Sn],delete r[Un],delete r[jp],delete r[xk],delete r[Sk]}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 il(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[ol]=!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 _k=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 wk(r){return Ie.call(_x,r)?!0:Ie.call(Sx,r)?!1:_k.test(r)?_x[r]=!0:(Sx[r]=!0,!1)}function lf(r,o,c){if(wk(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 ws(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 Ek(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 kp(r){if(!r._valueTracker){var o=wx(r)?"checked":"value";r._valueTracker=Ek(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 Tk=/[\n"\\]/g;function Cr(r){return r.replace(Tk,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Op(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?Mp(r,E,Tr(o)):c!=null?Mp(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)){kp(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),kp(r)}function Mp(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),kp(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 Ck=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||Ck.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 Ip(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Rk=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"]]),Nk=/^[\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 Nk.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Es(){}var Pp=null;function Dp(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(Op(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));Op(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 zp=!1;function kx(r,o,c){if(zp)return r(o,c);zp=!0;try{var u=r(o);return u}finally{if(zp=!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 al(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 Ts=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lp=!1;if(Ts)try{var cl={};Object.defineProperty(cl,"passive",{get:function(){Lp=!0}}),window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{Lp=!1}var mo=null,Up=null,hf=null;function Ox(){if(hf)return hf;var r,o=Up,c=o.length,u,m="value"in mo?mo.value:mo.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),ll=y({},Ci,{view:0,detail:0}),jk=$n(ll),$p,Bp,ul,yf=y({},ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hp,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==ul&&(ul&&r.type==="mousemove"?($p=r.screenX-ul.screenX,Bp=r.screenY-ul.screenY):Bp=$p=0,ul=r),$p)},movementY:function(r){return"movementY"in r?r.movementY:Bp}}),Ix=$n(yf),Ak=y({},yf,{dataTransfer:0}),kk=$n(Ak),Ok=y({},ll,{relatedTarget:0}),Fp=$n(Ok),Mk=y({},Ci,{animationName:0,elapsedTime:0,pseudoElement:0}),Ik=$n(Mk),Pk=y({},Ci,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Dk=$n(Pk),zk=y({},Ci,{data:0}),Px=$n(zk),Lk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Uk={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"},$k={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Bk(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=$k[r])?!!o[r]:!1}function Hp(){return Bk}var Fk=y({},ll,{key:function(r){if(r.key){var o=Lk[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"?Uk[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hp,charCode:function(r){return r.type==="keypress"?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}}),Hk=$n(Fk),qk=y({},yf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dx=$n(qk),Vk=y({},ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hp}),Gk=$n(Vk),Kk=y({},Ci,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zk=$n(Kk),Yk=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}),Xk=$n(Yk),Qk=y({},Ci,{newState:0,oldState:0}),Wk=$n(Qk),Jk=[9,13,27,32],qp=Ts&&"CompositionEvent"in window,fl=null;Ts&&"documentMode"in document&&(fl=document.documentMode);var eO=Ts&&"TextEvent"in window&&!fl,zx=Ts&&(!qp||fl&&8<fl&&11>=fl),Lx=" ",Ux=!1;function $x(r,o){switch(r){case"keyup":return Jk.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 tO(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 nO(r,o){if(Oa)return r==="compositionend"||!qp&&$x(r,o)?(r=Ox(),hf=Up=mo=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 rO={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"?!!rO[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 dl=null,hl=null;function sO(r){T_(r,0)}function vf(r){var o=il(r);if(Ex(o))return r}function qx(r,o){if(r==="change")return o}var Vx=!1;if(Ts){var Vp;if(Ts){var Gp="oninput"in document;if(!Gp){var Gx=document.createElement("div");Gx.setAttribute("oninput","return;"),Gp=typeof Gx.oninput=="function"}Vp=Gp}else Vp=!1;Vx=Vp&&(!document.documentMode||9<document.documentMode)}function Kx(){dl&&(dl.detachEvent("onpropertychange",Zx),hl=dl=null)}function Zx(r){if(r.propertyName==="value"&&vf(hl)){var o=[];Hx(o,hl,r,Dp(r)),kx(sO,o)}}function oO(r,o,c){r==="focusin"?(Kx(),dl=o,hl=c,dl.attachEvent("onpropertychange",Zx)):r==="focusout"&&Kx()}function iO(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return vf(hl)}function aO(r,o){if(r==="click")return vf(o)}function cO(r,o){if(r==="input"||r==="change")return vf(o)}function lO(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var rr=typeof Object.is=="function"?Object.is:lO;function pl(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(!Ie.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 Kp(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 uO=Ts&&"documentMode"in document&&11>=document.documentMode,Ma=null,Zp=null,ml=null,Yp=!1;function Jx(r,o,c){var u=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Yp||Ma==null||Ma!==ff(u)||(u=Ma,"selectionStart"in u&&Kp(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}),ml&&pl(ml,u)||(ml=u,u=id(Zp,"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")},Xp={},e0={};Ts&&(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(Xp[r])return Xp[r];if(!Ia[r])return r;var o=Ia[r],c;for(c in o)if(o.hasOwnProperty(c)&&c in e0)return Xp[r]=o[c];return r}var t0=Ni("animationend"),n0=Ni("animationiteration"),r0=Ni("animationstart"),fO=Ni("transitionrun"),dO=Ni("transitionstart"),hO=Ni("transitioncancel"),s0=Ni("transitionend"),o0=new Map,Qp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Qp.push("scrollEnd");function Xr(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,Wp=0;function xf(){for(var r=Pa,o=Wp=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,Wp|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function Jp(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<zl)throw zl=0,cg=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 pO(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 pO(r,o,c,u)}function em(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Cs(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")em(r)&&(E=1);else if(typeof r=="string")E=bM(r,c,Y.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 z:return r=sr(19,c,o,m),r.elementType=z,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 tm(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 nm(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:ve(o)},l0.set(r,o),o)}return{value:r,source:o,stack:ve(o)}}var za=[],La=0,Ef=null,gl=0,jr=[],Ar=0,go=null,ls=1,us="";function Rs(r,o){za[La++]=gl,za[La++]=Ef,Ef=r,gl=o}function u0(r,o,c){jr[Ar++]=ls,jr[Ar++]=us,jr[Ar++]=go,go=r;var u=ls;r=us;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,ls=1<<32-xt(o)+m|c<<m|u,us=v+r}else ls=1<<v|c<<m|u,us=r}function rm(r){r.return!==null&&(Rs(r,1),u0(r,1,0))}function sm(r){for(;r===Ef;)Ef=za[--La],za[La]=null,gl=za[--La],za[La]=null;for(;r===go;)go=jr[--Ar],jr[Ar]=null,us=jr[--Ar],jr[Ar]=null,ls=jr[--Ar],jr[Ar]=null}function f0(r,o){jr[Ar++]=ls,jr[Ar++]=us,jr[Ar++]=go,ls=o.id,us=o.overflow,go=r}var _n=null,Mt=null,rt=!1,yo=null,kr=!1,om=Error(s(519));function vo(r){var o=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yl(Nr(o,r)),om}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<Ul.length;c++)et(Ul[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=Es),o=!0):o=!1,o||vo(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")||wg(r.type,r.memoizedProps)),c=!c),c&&Mt&&vo(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,Oo(r.type)?(r=Ng,Ng=null,Mt=r):Mt=o):Mt=_n?Mr(r.stateNode.nextSibling):null;return!0}function ki(){Mt=_n=null,rt=!1}function im(){var r=yo;return r!==null&&(qn===null?qn=r:qn.push.apply(qn,r),yo=null),r}function yl(r){yo===null?yo=[r]:yo.push(r)}var am=I(null),Oi=null,Ns=null;function bo(r,o,c){W(am,o._currentValue),o._currentValue=c}function js(r){r._currentValue=am.current,H(am)}function cm(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 lm(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),cm(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),cm(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===fe.current){if(E=m.alternate,E===null)throw Error(s(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r!==null?r.push(ql):r=[ql])}m=m.return}r!==null&&lm(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,Ns=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},Ns===null){if(r===null)throw Error(s(308));Ns=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else Ns=Ns.next=o;return c}var mO=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()})}},gO=e.unstable_scheduleCallback,yO=e.unstable_NormalPriority,nn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function um(){return{controller:new mO,data:new Map,refCount:0}}function vl(r){r.refCount--,r.refCount===0&&gO(yO,function(){r.controller.abort()})}var bl=null,fm=0,Ba=0,Fa=null;function vO(r,o){if(bl===null){var c=bl=[];fm=0,Ba=pg(),Fa={status:"pending",value:void 0,then:function(u){c.push(u)}}}return fm++,o.then(m0,m0),o}function m0(){if(--fm===0&&bl!==null){Fa!==null&&(Fa.status="fulfilled");var r=bl;bl=null,Ba=0,Fa=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function bO(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"&&vO(r,o),g0!==null&&g0(r,o)};var Ii=I(null);function dm(){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=dm();return r===null?null:{parent:nn._currentValue,pool:r}}var Ha=Error(s(460)),hm=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(Es,Es),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(Es,Es);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,xl=0;function Af(r){var o=xl;return xl+=1,qa===null&&(qa=[]),b0(qa,r,o)}function Sl(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(X,F){if(r){var J=X.deletions;J===null?(X.deletions=[F],X.flags|=16):J.push(F)}}function c(X,F){if(!r)return null;for(;F!==null;)o(X,F),F=F.sibling;return null}function u(X){for(var F=new Map;X!==null;)X.key!==null?F.set(X.key,X):F.set(X.index,X),X=X.sibling;return F}function m(X,F){return X=Cs(X,F),X.index=0,X.sibling=null,X}function v(X,F,J){return X.index=J,r?(J=X.alternate,J!==null?(J=J.index,J<F?(X.flags|=67108866,F):J):(X.flags|=67108866,F)):(X.flags|=1048576,F)}function E(X){return r&&X.alternate===null&&(X.flags|=67108866),X}function k(X,F,J,le){return F===null||F.tag!==6?(F=tm(J,X.mode,le),F.return=X,F):(F=m(F,J),F.return=X,F)}function $(X,F,J,le){var ze=J.type;return ze===w?ce(X,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),Sl(F,J),F.return=X,F):(F=wf(J.type,J.key,J.props,null,X.mode,le),Sl(F,J),F.return=X,F)}function te(X,F,J,le){return F===null||F.tag!==4||F.stateNode.containerInfo!==J.containerInfo||F.stateNode.implementation!==J.implementation?(F=nm(J,X.mode,le),F.return=X,F):(F=m(F,J.children||[]),F.return=X,F)}function ce(X,F,J,le,ze){return F===null||F.tag!==7?(F=Ai(J,X.mode,le,ze),F.return=X,F):(F=m(F,J),F.return=X,F)}function de(X,F,J){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=tm(""+F,X.mode,J),F.return=X,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case x:return J=wf(F.type,F.key,F.props,null,X.mode,J),Sl(J,F),J.return=X,J;case S:return F=nm(F,X.mode,J),F.return=X,F;case A:return F=Pi(F),de(X,F,J)}if(ee(F)||U(F))return F=Ai(F,X.mode,J,null),F.return=X,F;if(typeof F.then=="function")return de(X,Af(F),J);if(F.$$typeof===N)return de(X,Cf(X,F),J);kf(X,F)}return null}function ne(X,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(X,F,""+J,le);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===ze?$(X,F,J,le):null;case S:return J.key===ze?te(X,F,J,le):null;case A:return J=Pi(J),ne(X,F,J,le)}if(ee(J)||U(J))return ze!==null?null:ce(X,F,J,le,null);if(typeof J.then=="function")return ne(X,F,Af(J),le);if(J.$$typeof===N)return ne(X,F,Cf(X,J),le);kf(X,J)}return null}function oe(X,F,J,le,ze){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return X=X.get(J)||null,k(F,X,""+le,ze);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case x:return X=X.get(le.key===null?J:le.key)||null,$(F,X,le,ze);case S:return X=X.get(le.key===null?J:le.key)||null,te(F,X,le,ze);case A:return le=Pi(le),oe(X,F,J,le,ze)}if(ee(le)||U(le))return X=X.get(J)||null,ce(F,X,le,ze,null);if(typeof le.then=="function")return oe(X,F,J,Af(le),ze);if(le.$$typeof===N)return oe(X,F,J,Cf(F,le),ze);kf(F,le)}return null}function Ne(X,F,J,le){for(var ze=null,ft=null,Oe=F,Ye=F=0,nt=null;Oe!==null&&Ye<J.length;Ye++){Oe.index>Ye?(nt=Oe,Oe=null):nt=Oe.sibling;var dt=ne(X,Oe,J[Ye],le);if(dt===null){Oe===null&&(Oe=nt);break}r&&Oe&&dt.alternate===null&&o(X,Oe),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt,Oe=nt}if(Ye===J.length)return c(X,Oe),rt&&Rs(X,Ye),ze;if(Oe===null){for(;Ye<J.length;Ye++)Oe=de(X,J[Ye],le),Oe!==null&&(F=v(Oe,F,Ye),ft===null?ze=Oe:ft.sibling=Oe,ft=Oe);return rt&&Rs(X,Ye),ze}for(Oe=u(Oe);Ye<J.length;Ye++)nt=oe(Oe,X,Ye,J[Ye],le),nt!==null&&(r&&nt.alternate!==null&&Oe.delete(nt.key===null?Ye:nt.key),F=v(nt,F,Ye),ft===null?ze=nt:ft.sibling=nt,ft=nt);return r&&Oe.forEach(function(zo){return o(X,zo)}),rt&&Rs(X,Ye),ze}function $e(X,F,J,le){if(J==null)throw Error(s(151));for(var ze=null,ft=null,Oe=F,Ye=F=0,nt=null,dt=J.next();Oe!==null&&!dt.done;Ye++,dt=J.next()){Oe.index>Ye?(nt=Oe,Oe=null):nt=Oe.sibling;var zo=ne(X,Oe,dt.value,le);if(zo===null){Oe===null&&(Oe=nt);break}r&&Oe&&zo.alternate===null&&o(X,Oe),F=v(zo,F,Ye),ft===null?ze=zo:ft.sibling=zo,ft=zo,Oe=nt}if(dt.done)return c(X,Oe),rt&&Rs(X,Ye),ze;if(Oe===null){for(;!dt.done;Ye++,dt=J.next())dt=de(X,dt.value,le),dt!==null&&(F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return rt&&Rs(X,Ye),ze}for(Oe=u(Oe);!dt.done;Ye++,dt=J.next())dt=oe(Oe,X,Ye,dt.value,le),dt!==null&&(r&&dt.alternate!==null&&Oe.delete(dt.key===null?Ye:dt.key),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return r&&Oe.forEach(function(AM){return o(X,AM)}),rt&&Rs(X,Ye),ze}function Ct(X,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(X,F.sibling),le=m(F,J.props.children),le.return=X,X=le;break e}}else if(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Pi(ze)===F.type){c(X,F.sibling),le=m(F,J.props),Sl(le,J),le.return=X,X=le;break e}c(X,F);break}else o(X,F);F=F.sibling}J.type===w?(le=Ai(J.props.children,X.mode,le,J.key),le.return=X,X=le):(le=wf(J.type,J.key,J.props,null,X.mode,le),Sl(le,J),le.return=X,X=le)}return E(X);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(X,F.sibling),le=m(F,J.children||[]),le.return=X,X=le;break e}else{c(X,F);break}else o(X,F);F=F.sibling}le=nm(J,X.mode,le),le.return=X,X=le}return E(X);case A:return J=Pi(J),Ct(X,F,J,le)}if(ee(J))return Ne(X,F,J,le);if(U(J)){if(ze=U(J),typeof ze!="function")throw Error(s(150));return J=ze.call(J),$e(X,F,J,le)}if(typeof J.then=="function")return Ct(X,F,Af(J),le);if(J.$$typeof===N)return Ct(X,F,Cf(X,J),le);kf(X,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,F!==null&&F.tag===6?(c(X,F.sibling),le=m(F,J),le.return=X,X=le):(c(X,F),le=tm(J,X.mode,le),le.return=X,X=le),E(X)):c(X,F)}return function(X,F,J,le){try{xl=0;var ze=Ct(X,F,J,le);return qa=null,ze}catch(Oe){if(Oe===Ha||Oe===Nf)throw Oe;var ft=sr(29,Oe,null,X.mode);return ft.lanes=le,ft.return=X,ft}}}var zi=_0(!0),w0=_0(!1),xo=!1;function pm(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mm(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function So(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function _o(r,o,c){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(pt&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 _l(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,fo(r,c)}}function gm(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 ym=!1;function wl(){if(ym){var r=Fa;if(r!==null)throw r}}function El(r,o,c,u){ym=!1;var m=r.updateQueue;xo=!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 de=m.baseState;E=0,ce=te=$=null,k=v;do{var ne=k.lane&-536870913,oe=ne!==k.lane;if(oe?(tt&ne)===ne:(u&ne)===ne){ne!==0&&ne===Ba&&(ym=!0),ce!==null&&(ce=ce.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Ne=r,$e=k;ne=o;var Ct=c;switch($e.tag){case 1:if(Ne=$e.payload,typeof Ne=="function"){de=Ne.call(Ct,de,ne);break e}de=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=$e.payload,ne=typeof Ne=="function"?Ne.call(Ct,de,ne):Ne,ne==null)break e;de=y({},de,ne);break e;case 2:xo=!0}}ne=k.callback,ne!==null&&(r.flags|=64,oe&&(r.flags|=8192),oe=m.callbacks,oe===null?m.callbacks=[ne]:oe.push(ne))}else oe={lane:ne,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ce===null?(te=ce=oe,$=de):ce=ce.next=oe,E|=ne;if(k=k.next,k===null){if(k=m.shared.pending,k===null)break;oe=k,k=oe.next,oe.next=null,m.lastBaseUpdate=oe,m.shared.pending=null}}while(!0);ce===null&&($=de),m.baseState=$,m.firstBaseUpdate=te,m.lastBaseUpdate=ce,v===null&&(m.shared.lanes=0),Ro|=E,r.lanes=E,r.memoizedState=de}}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=Ls,W(Of,r),W(Va,o),Ls=r|o.baseLanes}function vm(){W(Of,Ls),W(Va,Va.current)}function bm(){Ls=Of.current,H(Va),H(Of)}var or=I(null),Or=null;function wo(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 xm(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)):Eo()}function Eo(){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||Cg(c)||Rg(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 As=0,Ze=null,Et=null,rn=null,If=!1,Ga=!1,Li=!1,Pf=0,Tl=0,Ka=null,xO=0;function Gt(){throw Error(s(321))}function Sm(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 _m(r,o,c,u,m,v){return As=v,Ze=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,D.H=r===null||r.memoizedState===null?uS:zm,Li=!1,v=c(u,m),Li=!1,Ga&&(v=j0(o,c,u,m)),N0(r),v}function N0(r){D.H=Nl;var o=Et!==null&&Et.next!==null;if(As=0,rn=Et=Ze=null,If=!1,Tl=0,Ka=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(Ga&&(Ka=null),Tl=0,Ga=!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(Ga);return v}function SO(){var r=D.H,o=r.useState()[0];return o=typeof o.then=="function"?Cl(o):o,r=r.useState()[0],(Et!==null?Et.memoizedState:null)!==r&&(Ze.flags|=1024),o}function wm(){var r=Pf!==0;return Pf=0,r}function Em(r,o,c){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~c}function Tm(r){if(If){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}If=!1}As=0,rn=Et=Ze=null,Ga=!1,Tl=Pf=0,Ka=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 Cl(r){var o=Tl;return Tl+=1,Ka===null&&(Ka=[]),r=b0(Ka,r,o),o=Ze,(rn===null?o.memoizedState:rn.next)===null&&(o=o.alternate,D.H=o===null||o.memoizedState===null?uS:zm),r}function zf(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Cl(r);if(r.$$typeof===N)return wn(r)}throw Error(s(438,String(r)))}function Cm(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]=Q;return o.index++,c}function ks(r,o){return typeof o=="function"?o(r):o}function Lf(r){var o=en();return Rm(o,Et,r)}function Rm(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 de=te.lane&-536870913;if(de!==te.lane?(tt&de)===de:(As&de)===de){var ne=te.revertLane;if(ne===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),de===Ba&&(ce=!0);else if((As&ne)===ne){te=te.next,ne===Ba&&(ce=!0);continue}else de={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(k=$=de,E=v):$=$.next=de,Ze.lanes|=ne,Ro|=ne;de=te.action,Li&&c(v,de),v=te.hasEagerState?te.eagerState:c(v,de)}else ne={lane:de,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(k=$=ne,E=v):$=$.next=ne,Ze.lanes|=de,Ro|=de;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 Nm(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,km(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||(As&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 jm(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:ks,lastRenderedState:r},o}function D0(r,o,c,u){return r.baseState=c,Rm(r,Et,typeof u=="function"?u:ks)}function _O(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){Am(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){Am(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 Am(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 Am(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}}vo(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=jm(!1),v=Dm.bind(null,Ze,!1,u.queue),u=kn(),m={state:o,dispatch:null,action:r,pending:null},u.queue=m,c=_O.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=Rm(r,o,B0)[0],r=Lf(ks)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Cl(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},wO.bind(null,m,c),null)),[u,v,r]}function wO(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 G0(){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&&Sm(u,Et.memoizedState.deps)?m.memoizedState=Za(o,v,c,u):(Ze.flags|=r,m.memoizedState=Za(1|o,v,c,u))}function K0(r,o){Uf(8390656,8,r,o)}function km(r,o){$f(2048,8,r,o)}function EO(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 EO({ref:o,nextImpl:r}),function(){if((pt&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 Om(){}function J0(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;return o!==null&&Sm(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&&Sm(o,u[1]))return u[0];if(u=r(),Li){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u}function Mm(r,o,c){return c===void 0||(As&1073741824)!==0&&(tt&261930)===0?r.memoizedState=o:(r.memoizedState=c,r=t_(),Ze.lanes|=r,Ro|=r,c)}function tS(r,o,c,u){return rr(c,o)?c:Va.current!==null?(r=Mm(r,c,u),rr(r,o)||(sn=!0),r):(As&42)===0||(As&1073741824)!==0&&(tt&261930)===0?(sn=!0,r.memoizedState=c):(r=t_(),Ze.lanes|=r,Ro|=r,o)}function nS(r,o,c,u,m){var v=K.p;K.p=v!==0&&8>v?v:8;var E=D.T,k={};D.T=k,Dm(r,!1,o,c);try{var $=m(),te=D.S;if(te!==null&&te(k,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ce=bO($,u);Rl(r,o,ce,lr(r))}else Rl(r,o,u,lr(r))}catch(de){Rl(r,o,{then:function(){},status:"rejected",reason:de},lr())}finally{K.p=v,E!==null&&k.types!==null&&(E.types=k.types),D.T=E}}function TO(){}function Im(r,o,c,u){if(r.tag!==5)throw Error(s(476));var m=rS(r).queue;nS(r,m,o,q,c===null?TO: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:ks,lastRenderedState:q},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,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),Rl(r,o.next.queue,{},lr())}function Pm(){return wn(ql)}function oS(){return en().memoizedState}function iS(){return en().memoizedState}function CO(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var c=lr();r=So(c);var u=_o(o,r,c);u!==null&&(Vn(u,o,c),_l(u,o,c)),o={cache:um()},r.payload=o;return}o=o.return}}function RO(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=Jp(r,o,c,u),c!==null&&(Vn(c,r,u),lS(c,o,u)))}function aS(r,o,c){var u=lr();Rl(r,o,c,u)}function Rl(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=Jp(r,o,m,u),c!==null)return Vn(c,r,u),lS(c,o,u),!0}return!1}function Dm(r,o,c,u){if(u={lane:2,revertLane:pg(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Bf(r)){if(o)throw Error(s(479))}else o=Jp(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){Ga=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,fo(r,c)}}var Nl={readContext:wn,use:zf,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};Nl.useEffectEvent=Gt;var uS={readContext:wn,use:zf,useCallback:function(r,o){return kn().memoizedState=[r,o===void 0?null:o],r},useContext:wn,useEffect:K0,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=RO.bind(null,Ze,r),[u.memoizedState,r]},useRef:function(r){var o=kn();return r={current:r},o.memoizedState=r},useState:function(r){r=jm(r);var o=r.queue,c=aS.bind(null,Ze,o);return o.dispatch=c,[r.memoizedState,c]},useDebugValue:Om,useDeferredValue:function(r,o){var c=kn();return Mm(c,r,o)},useTransition:function(){var r=jm(!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,K0(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=us,u=ls;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=xO++,o="_"+o+"r_"+c.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Pm,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=Dm.bind(null,Ze,!0,c),c.dispatch=o,[r,o]},useMemoCache:Cm,useCacheRefresh:function(){return kn().memoizedState=CO.bind(null,Ze)},useEffectEvent:function(r){var o=kn(),c={impl:r};return o.memoizedState=c,function(){if((pt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},zm={readContext:wn,use:zf,useCallback:J0,useContext:wn,useEffect:km,useImperativeHandle:W0,useInsertionEffect:Y0,useLayoutEffect:X0,useMemo:eS,useReducer:Lf,useRef:G0,useState:function(){return Lf(ks)},useDebugValue:Om,useDeferredValue:function(r,o){var c=en();return tS(c,Et.memoizedState,r,o)},useTransition:function(){var r=Lf(ks)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Cl(r),o]},useSyncExternalStore:A0,useId:oS,useHostTransitionStatus:Pm,useFormState:H0,useActionState:H0,useOptimistic:function(r,o){var c=en();return D0(c,Et,r,o)},useMemoCache:Cm,useCacheRefresh:iS};zm.useEffectEvent=Z0;var fS={readContext:wn,use:zf,useCallback:J0,useContext:wn,useEffect:km,useImperativeHandle:W0,useInsertionEffect:Y0,useLayoutEffect:X0,useMemo:eS,useReducer:Nm,useRef:G0,useState:function(){return Nm(ks)},useDebugValue:Om,useDeferredValue:function(r,o){var c=en();return Et===null?Mm(c,r,o):tS(c,Et.memoizedState,r,o)},useTransition:function(){var r=Nm(ks)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Cl(r),o]},useSyncExternalStore:A0,useId:oS,useHostTransitionStatus:Pm,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:Cm,useCacheRefresh:iS};fS.useEffectEvent=Z0;function Lm(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 Um={enqueueSetState:function(r,o,c){r=r._reactInternals;var u=lr(),m=So(u);m.payload=o,c!=null&&(m.callback=c),o=_o(r,m,u),o!==null&&(Vn(o,r,u),_l(o,r,u))},enqueueReplaceState:function(r,o,c){r=r._reactInternals;var u=lr(),m=So(u);m.tag=1,m.payload=o,c!=null&&(m.callback=c),o=_o(r,m,u),o!==null&&(Vn(o,r,u),_l(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var c=lr(),u=So(c);u.tag=2,o!=null&&(u.callback=o),o=_o(r,u,c),o!==null&&(Vn(o,r,c),_l(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?!pl(c,u)||!pl(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&&Um.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 $m(r,o,c){return c=So(c),c.tag=3,c.payload={element:null},c.callback=function(){Ff(r,o)},c}function vS(r){return r=So(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"&&(No===null?No=new Set([this]):No.add(this));var k=u.stack;this.componentDidCatch(u.value,{componentStack:k!==null?k:""})})}function NO(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&&Kt===0&&(Kt=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),fg(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)),fg(r,u,m)),!1}throw Error(s(435,c.tag))}return fg(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!==om&&(r=Error(s(422),{cause:u}),yl(Nr(r,c)))):(u!==om&&(o=Error(s(423),{cause:u}),yl(Nr(o,c))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,u=Nr(u,c),m=$m(r.stateNode,u,m),gm(r,m),Kt!==4&&(Kt=2)),!1;var v=Error(s(520),{cause:u});if(v=Nr(v,c),Dl===null?Dl=[v]:Dl.push(v),Kt!==4&&(Kt=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=$m(c.stateNode,u,r),gm(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"&&(No===null||!No.has(v))))return c.flags|=65536,m&=-m,c.lanes|=m,m=vS(m),bS(m,r,c,u),gm(c,m),!1}c=c.return}while(c!==null);return!1}var Bm=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=_m(r,o,c,E,v,m),k=wm(),r!==null&&!sn?(Em(r,o,m),Os(r,o,m)):(rt&&k&&rm(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"&&!em(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,!Ym(r,m)){var E=v.memoizedProps;if(c=c.compare,c=c!==null?c:pl,c(E,u)&&r.ref===o.ref)return Os(r,o,m)}return o.flags|=1,r=Cs(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(pl(v,u)&&r.ref===o.ref)if(sn=!1,o.pendingProps=u=v,Ym(r,m))(r.flags&131072)!==0&&(sn=!0);else return o.lanes=r.lanes,Os(r,o,m)}return Fm(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):vm(),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),Eo(),o.memoizedState=null):(r!==null&&Rf(o,null),vm(),Eo());return En(r,o,m,c),o.child}function jl(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=dm();return v=v===null?null:{parent:nn._currentValue,pool:v},o.memoizedState={baseLanes:c,cachePool:v},r!==null&&Rf(o,null),vm(),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 jO(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,jl(null,r);if(xm(o),(r=Mt)?(r=z_(r,kr),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:go!==null?{id:ls,overflow:us}:null,retryLane:536870912,hydrationErrors:null},c=c0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw vo(o);return o.lanes=536870912,null}return Hf(o,u)}var v=r.memoizedState;if(v!==null){var E=v.dehydrated;if(xm(o),m)if(o.flags&256)o.flags&=-257,o=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=ho(u,c),E!==0&&E!==v.retryLane))throw v.retryLane=E,ji(r,E),Vn(u,r,E),Bm;ed(),o=TS(r,o,c)}else r=v.treeContext,Mt=Mr(E.nextSibling),_n=o,rt=!0,yo=null,kr=!1,r!==null&&f0(o,r),o=Hf(o,u),o.flags|=4096;return o}return r=Cs(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 Fm(r,o,c,u,m){return Mi(o),c=_m(r,o,c,u,void 0,m),u=wm(),r!==null&&!sn?(Em(r,o,m),Os(r,o,m)):(rt&&u&&rm(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=wm(),r!==null&&!sn?(Em(r,o,v),Os(r,o,v)):(rt&&u&&rm(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=Um,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},pm(o),E=c.contextType,v.context=typeof E=="object"&&E!==null?wn(E):Da,v.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Lm(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&&Um.enqueueReplaceState(v,v.state,null),El(o,u,v,m),wl(),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 de=c.getDerivedStateFromProps;ce=typeof de=="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),xo=!1;var ne=o.memoizedState;v.state=ne,El(o,u,v,m),wl(),te=o.memoizedState,k||ne!==te||xo?(typeof de=="function"&&(Lm(o,c,de,u),te=o.memoizedState),($=xo||dS(o,c,$,u,ne,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,mm(r,o),E=o.memoizedProps,ce=Ui(c,E),v.props=ce,de=o.pendingProps,ne=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!==de||ne!==$)&&hS(o,v,u,$),xo=!1,ne=o.memoizedState,v.state=ne,El(o,u,v,m),wl();var oe=o.memoizedState;E!==de||ne!==oe||xo||r!==null&&r.dependencies!==null&&Tf(r.dependencies)?(typeof k=="function"&&(Lm(o,c,k,u),oe=o.memoizedState),(ce=xo||dS(o,c,ce,u,ne,oe,$)||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,oe,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,oe,$)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=oe),v.props=u,v.state=oe,v.context=$,u=ce):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,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=Os(r,o,m),r}function NS(r,o,c,u){return ki(),o.flags|=256,En(r,o,c,u),o.child}var Hm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qm(r){return{baseLanes:r,cachePool:y0()}}function Vm(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?wo(o):Eo(),(r=Mt)?(r=z_(r,kr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:go!==null?{id:ls,overflow:us}:null,retryLane:536870912,hydrationErrors:null},c=c0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw vo(o);return Rg(r)?o.lanes=32:o.lanes=536870912,null}var k=u.children;return u=u.fallback,m?(Eo(),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=qm(c),u.childLanes=Vm(r,E,c),o.memoizedState=Hm,jl(null,u)):(wo(o),Gm(o,k))}var $=r.memoizedState;if($!==null&&(k=$.dehydrated,k!==null)){if(v)o.flags&256?(wo(o),o.flags&=-257,o=Km(r,o,c)):o.memoizedState!==null?(Eo(),o.child=r.child,o.flags|=128,o=null):(Eo(),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=qm(c),u.childLanes=Vm(r,E,c),o.memoizedState=Hm,o=jl(null,u));else if(wo(o),Rg(k)){if(E=k.nextSibling&&k.nextSibling.dataset,E)var te=E.dgst;E=te,u=Error(s(419)),u.stack="",u.digest=E,yl({value:u,source:null,stack:null}),o=Km(r,o,c)}else if(sn||$a(r,o,c,!1),E=(c&r.childLanes)!==0,sn||E){if(E=Nt,E!==null&&(u=ho(E,c),u!==0&&u!==$.retryLane))throw $.retryLane=u,ji(r,u),Vn(E,r,u),Bm;Cg(k)||ed(),o=Km(r,o,c)}else Cg(k)?(o.flags|=192,o.child=r.child,o=null):(r=$.treeContext,Mt=Mr(k.nextSibling),_n=o,rt=!0,yo=null,kr=!1,r!==null&&f0(o,r),o=Gm(o,u.children),o.flags|=4096);return o}return m?(Eo(),k=u.fallback,m=o.mode,$=r.child,te=$.sibling,u=Cs($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,te!==null?k=Cs(te,k):(k=Ai(k,m,c,null),k.flags|=2),k.return=o,u.return=o,u.sibling=k,o.child=u,jl(null,u),u=o.child,k=r.child.memoizedState,k===null?k=qm(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=Vm(r,E,c),o.memoizedState=Hm,jl(r.child,u)):(wo(o),c=r.child,r=c.sibling,c=Cs(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 Gm(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 Km(r,o,c){return zi(o,r.child,null,c),r=Gm(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),cm(r.return,o,c)}function Zm(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?gl: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),Zm(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}Zm(o,!0,c,null,v,u);break;case"together":Zm(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function Os(r,o,c){if(r!==null&&(o.dependencies=r.dependencies),Ro|=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=Cs(r,r.pendingProps),o.child=c,c.return=o;r.sibling!==null;)r=r.sibling,c=c.sibling=Cs(r,r.pendingProps),c.return=o;c.sibling=null}return o.child}function Ym(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Tf(r)))}function AO(r,o,c){switch(o.tag){case 3:Se(o,o.stateNode.containerInfo),bo(o,nn,r.memoizedState.cache),ki();break;case 27:case 5:Me(o);break;case 4:Se(o,o.stateNode.containerInfo);break;case 10:bo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,xm(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(wo(o),o.flags|=128,null):(c&o.child.childLanes)!==0?jS(r,o,c):(wo(o),r=Os(r,o,c),r!==null?r.sibling:null);wo(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:bo(o,nn,r.memoizedState.cache)}return Os(r,o,c)}function OS(r,o,c){if(r!==null)if(r.memoizedProps!==o.pendingProps)sn=!0;else{if(!Ym(r,c)&&(o.flags&128)===0)return sn=!1,AO(r,o,c);sn=(r.flags&131072)!==0}else sn=!1,rt&&(o.flags&1048576)!==0&&u0(o,gl,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")em(r)?(u=Ui(r,u),o.tag=1,o=RS(null,o,r,u,c)):(o.tag=0,o=Fm(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=G(r)||r,Error(s(306,o,""))}}return o;case 0:return Fm(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(Se(o,o.stateNode.containerInfo),r===null)throw Error(s(387));u=o.pendingProps;var v=o.memoizedState;m=v.element,mm(r,o),El(o,u,null,c);var E=o.memoizedState;if(u=E.cache,bo(o,nn,u),u!==v.cache&&lm(o,[nn],c,!0),wl(),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),yl(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,yo=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=Os(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,Oo(o.type)?(Ng=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=iM(u,o.type,o.pendingProps,kr),u!==null?(o.stateNode=u,_n=o,Mt=Mr(u.firstChild),kr=!1,m=!0):m=!1),m||vo(o)),Me(o),m=o.type,v=o.pendingProps,E=r!==null?r.memoizedProps:null,u=v.children,wg(m,v)?u=null:E!==null&&wg(m,E)&&(o.flags|=32),o.memoizedState!==null&&(m=_m(r,o,SO,null,null,c),ql._currentValue=m),qf(r,o),En(r,o,u,c),o.child;case 6:return r===null&&rt&&((r=c=Mt)&&(c=aM(c,o.pendingProps,kr),c!==null?(o.stateNode=c,_n=o,Mt=null,r=!0):r=!1),r||vo(o)),null;case 13:return jS(r,o,c);case 4:return Se(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,bo(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 jO(r,o,c);case 22:return wS(r,o,c,o.pendingProps);case 24:return Mi(o),u=wn(nn),r===null?(m=dm(),m===null&&(m=Nt,v=um(),m.pooledCache=v,v.refCount++,v!==null&&(m.pooledCacheLanes|=c),m=v),o.memoizedState={parent:u,cache:m},pm(o),bo(o,nn,m)):((r.lanes&c)!==0&&(mm(r,o),El(o,null,null,c),wl()),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),bo(o,nn,u)):(u=v.cache,bo(o,nn,u),u!==m.cache&&lm(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 Ms(r){r.flags|=4}function Xm(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,hm}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,hm}function Gf(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?wi():536870912,r.lanes|=o,Wa|=o)}function Al(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 kO(r,o,c){var u=o.pendingProps;switch(sm(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(o),null;case 1:return It(o),null;case 3:return c=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),js(nn),pe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Ua(o)?Ms(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,im())),It(o),null;case 26:var m=o.type,v=o.memoizedState;return r===null?(Ms(o),v!==null?(It(o),MS(o,v)):(It(o),Xm(o,m,null,u,c))):v?v!==r.memoizedState?(Ms(o),It(o),MS(o,v)):(It(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&Ms(o),It(o),Xm(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&&Ms(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}r=Y.current,Ua(o)?d0(o):(r=$_(m,u,c),o.stateNode=r,Ms(o))}return It(o),null;case 5:if(_e(o),m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Ms(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}if(v=Y.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&&Ms(o)}}return It(o),Xm(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,c),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&Ms(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||vo(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=im(),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=im(),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 pe(),r===null&&vg(o.stateNode.containerInfo),It(o),null;case 10:return js(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)Al(u,!1);else{if(Kt!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=Mf(r),v!==null){for(o.flags|=128,Al(u,!1),r=v.updateQueue,o.updateQueue=r,Gf(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&&Rs(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&Be()>Qf&&(o.flags|=128,m=!0,Al(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,Gf(o,r),Al(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,Al(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&&Rs(o,u.treeForkCount),r):(It(o),null);case 22:case 23:return ir(o),bm(),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(Ii),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),js(nn),It(o),null;case 25:return null;case 30:return null}throw Error(s(156,o.tag))}function OO(r,o){switch(sm(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return js(nn),pe(),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 pe(),null;case 10:return js(o.type),null;case 22:case 23:return ir(o),bm(),r!==null&&H(Ii),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return js(nn),null;case 25:return null;default:return null}}function IS(r,o){switch(sm(o),o.tag){case 3:js(nn),pe();break;case 26:case 27:case 5:_e(o);break;case 4:pe();break;case 31:o.memoizedState!==null&&ir(o);break;case 13:ir(o);break;case 19:H(Jt);break;case 10:js(o.type);break;case 22:case 23:ir(o),bm(),r!==null&&H(Ii);break;case 24:js(nn)}}function kl(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 To(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 Ol(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 fs(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 Qm(r,o,c){try{var u=r.stateNode;eM(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&&Oo(r.type)||r.tag===4}function Wm(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&&Oo(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Jm(r,o,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=Es));else if(u!==4&&(u===27&&Oo(r.type)&&(c=r.stateNode,o=null),r=r.child,r!==null))for(Jm(r,o,c),r=r.sibling;r!==null;)Jm(r,o,c),r=r.sibling}function Kf(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&&Oo(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(Kf(r,o,c),r=r.sibling;r!==null;)Kf(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 Is=!1,on=!1,eg=!1,$S=typeof WeakSet=="function"?WeakSet:Set,xn=null;function MO(r,o){if(r=r.containerInfo,Sg=pd,r=Wx(r),Kp(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,de=r,ne=null;t:for(;;){for(var oe;de!==c||m!==0&&de.nodeType!==3||(k=E+m),de!==v||u!==0&&de.nodeType!==3||($=E+u),de.nodeType===3&&(E+=de.nodeValue.length),(oe=de.firstChild)!==null;)ne=de,de=oe;for(;;){if(de===r)break t;if(ne===c&&++te===m&&(k=E),ne===v&&++ce===u&&($=E),(oe=de.nextSibling)!==null)break;de=ne,ne=de.parentNode}de=oe}c=k===-1||$===-1?null:{start:k,end:$}}else c=null}c=c||{start:0,end:0}}else c=null;for(_g={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 Ne=Ui(c.type,m);r=u.getSnapshotBeforeUpdate(Ne,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)Tg(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Tg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(s(163))}if(r=o.sibling,r!==null){r.return=o.return,xn=r;break}xn=o.return}}function BS(r,o,c){var u=c.flags;switch(c.tag){case 0:case 11:case 15:Ds(r,c),u&4&&kl(5,c);break;case 1:if(Ds(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&&Ol(c,c.return);break;case 3:if(Ds(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:Ds(r,c),o===null&&u&4&&zS(c),u&512&&Ol(c,c.return);break;case 12:Ds(r,c);break;case 31:Ds(r,c),u&4&&qS(r,c);break;case 13:Ds(r,c),u&4&&VS(r,c),u&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=FO.bind(null,c),cM(r,c))));break;case 22:if(u=c.memoizedState!==null||Is,!u){o=o!==null&&o.memoizedState!==null||on,m=Is;var v=on;Is=u,(on=o)&&!v?zs(r,c,(c.subtreeFlags&8772)!==0):Ds(r,c),Is=m,on=v}break;case 30:break;default:Ds(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&&Ap(o)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Ut=null,Bn=!1;function Ps(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||fs(c,o),Ps(r,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:on||fs(c,o);var u=Ut,m=Bn;Oo(c.type)&&(Ut=c.stateNode,Bn=!1),Ps(r,o,c),Bl(c.stateNode),Ut=u,Bn=m;break;case 5:on||fs(c,o);case 6:if(u=Ut,m=Bn,Ut=null,Ps(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,Ps(r,o,c),Ut=u,Bn=m;break;case 0:case 11:case 14:case 15:To(2,c,o),on||To(4,c,o),Ps(r,o,c);break;case 1:on||(fs(c,o),u=c.stateNode,typeof u.componentWillUnmount=="function"&&DS(c,o,u)),Ps(r,o,c);break;case 21:Ps(r,o,c);break;case 22:on=(u=on)||c.memoizedState!==null,Ps(r,o,c),on=u;break;default:Ps(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 IO(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=IO(r);o.forEach(function(u){if(!c.has(u)){c.add(u);var m=HO.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(Oo(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;)GS(o,r),o=o.sibling}var Qr=null;function GS(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&&(To(3,r,r.return),kl(3,r),To(5,r,r.return));break;case 1:Fn(o,r),Hn(r),u&512&&(on||c===null||fs(c,c.return)),u&64&&Is&&(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=Qr;if(Fn(o,r),Hn(r),u&512&&(on||c===null||fs(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[ol]||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=G_("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=G_("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 K_(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?K_(m,r.type,r.stateNode):V_(m,u,r.memoizedProps)):u===null&&r.stateNode!==null&&Qm(r,r.memoizedProps,c.memoizedProps)}break;case 27:Fn(o,r),Hn(r),u&512&&(on||c===null||fs(c,c.return)),c!==null&&u&4&&Qm(r,r.memoizedProps,c.memoizedProps);break;case 5:if(Fn(o,r),Hn(r),u&512&&(on||c===null||fs(c,c.return)),r.flags&32){m=r.stateNode;try{ja(m,"")}catch(Ne){_t(r,r.return,Ne)}}u&4&&r.stateNode!=null&&(m=r.memoizedProps,Qm(r,m,c!==null?c.memoizedProps:m)),u&1024&&(eg=!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(Ne){_t(r,r.return,Ne)}}break;case 3:if(ud=null,m=Qr,Qr=cd(o.containerInfo),Fn(o,r),Qr=m,Hn(r),u&4&&c!==null&&c.memoizedState.isDehydrated)try{ic(o.containerInfo)}catch(Ne){_t(r,r.return,Ne)}eg&&(eg=!1,KS(r));break;case 4:u=Qr,Qr=cd(r.stateNode.containerInfo),Fn(o,r),Hn(r),Qr=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=Is,ce=on;if(Is=te||m,on=ce||$,Fn(o,r),on=ce,Is=te,Hn(r),u&8192)e:for(o=r.stateNode,o._visibility=m?o._visibility&-2:o._visibility|1,m&&(c===null||$||Is||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 de=$.memoizedProps.style,ne=de!=null&&de.hasOwnProperty("display")?de.display:null;k.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Ne){_t($,$.return,Ne)}}}else if(o.tag===6){if(c===null){$=o;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(Ne){_t($,$.return,Ne)}}}else if(o.tag===18){if(c===null){$=o;try{var oe=$.stateNode;m?D_(oe,!0):D_($.stateNode,!1)}catch(Ne){_t($,$.return,Ne)}}}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=Wm(r);Kf(r,v,m);break;case 5:var E=c.stateNode;c.flags&32&&(ja(E,""),c.flags&=-33);var k=Wm(r);Kf(r,k,E);break;case 3:case 4:var $=c.stateNode.containerInfo,te=Wm(r);Jm(r,te,$);break;default:throw Error(s(161))}}catch(ce){_t(r,r.return,ce)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function KS(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;KS(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function Ds(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:To(4,o,o.return),$i(o);break;case 1:fs(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&DS(o,o.return,c),$i(o);break;case 27:Bl(o.stateNode);case 26:case 5:fs(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 zs(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:zs(m,v,c),kl(4,v);break;case 1:if(zs(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),Ol(v,v.return);break;case 27:US(v);case 26:case 5:zs(m,v,c),c&&u===null&&E&4&&zS(v),Ol(v,v.return);break;case 12:zs(m,v,c);break;case 31:zs(m,v,c),c&&E&4&&qS(m,v);break;case 13:zs(m,v,c),c&&E&4&&VS(m,v);break;case 22:v.memoizedState===null&&zs(m,v,c),Ol(v,v.return);break;case 30:break;default:zs(m,v,c)}o=o.sibling}}function tg(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&&vl(c))}function ng(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&vl(r))}function Wr(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:Wr(r,o,c,u),m&2048&&kl(9,o);break;case 1:Wr(r,o,c,u);break;case 3:Wr(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&&vl(r)));break;case 12:if(m&2048){Wr(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 Wr(r,o,c,u);break;case 31:Wr(r,o,c,u);break;case 13:Wr(r,o,c,u);break;case 23:break;case 22:v=o.stateNode,E=o.alternate,o.memoizedState!==null?v._visibility&2?Wr(r,o,c,u):Ml(r,o):v._visibility&2?Wr(r,o,c,u):(v._visibility|=2,Ya(r,o,c,u,(o.subtreeFlags&10256)!==0||!1)),m&2048&&tg(E,o);break;case 24:Wr(r,o,c,u),m&2048&&ng(o.alternate,o);break;default:Wr(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),kl(8,E);break;case 23:break;case 22:var ce=E.stateNode;E.memoizedState!==null?ce._visibility&2?Ya(v,E,k,$,m):Ml(v,E):(ce._visibility|=2,Ya(v,E,k,$,m)),m&&te&2048&&tg(E.alternate,E);break;case 24:Ya(v,E,k,$,m),m&&te&2048&&ng(E.alternate,E);break;default:Ya(v,E,k,$,m)}o=o.sibling}}function Ml(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:Ml(c,u),m&2048&&tg(u.alternate,u);break;case 24:Ml(c,u),m&2048&&ng(u.alternate,u);break;default:Ml(c,u)}o=o.sibling}}var Il=8192;function Xa(r,o,c){if(r.subtreeFlags&Il)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&Il&&r.memoizedState!==null&&xM(c,Qr,r.memoizedState,r.memoizedProps);break;case 5:Xa(r,o,c);break;case 3:case 4:var u=Qr;Qr=cd(r.stateNode.containerInfo),Xa(r,o,c),Qr=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=Il,Il=16777216,Xa(r,o,c),Il=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 Pl(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:Pl(r),r.flags&2048&&To(9,r,r.return);break;case 3:Pl(r);break;case 12:Pl(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)):Pl(r);break;default:Pl(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:To(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:To(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:vl(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 PO={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}},DO=typeof WeakMap=="function"?WeakMap:Map,pt=0,Nt=null,Je=null,tt=0,St=0,ar=null,Co=!1,Qa=!1,rg=!1,Ls=0,Kt=0,Ro=0,Bi=0,sg=0,cr=0,Wa=0,Dl=null,qn=null,og=!1,Xf=0,JS=0,Qf=1/0,Wf=null,No=null,fn=0,jo=null,Ja=null,Us=0,ig=0,ag=null,e_=null,zl=0,cg=null;function lr(){return(pt&2)!==0&&tt!==0?tt&-tt:D.T!==null?pg():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),Ao(r,tt,cr,!1)),_s(r,c),((pt&2)===0||r!==Nt)&&(r===Nt&&((pt&2)===0&&(Bi|=c),Kt===4&&Ao(r,tt,cr,!1)),ds(r))}function n_(r,o,c){if((pt&6)!==0)throw Error(s(327));var u=!c&&(o&127)===0&&(o&r.expiredLanes)===0||as(r,o),m=u?UO(r,o):ug(r,o,!0),v=u;do{if(m===0){Qa&&!u&&Ao(r,o,0,!1);break}else{if(c=r.current.alternate,v&&!zO(c)){m=ug(r,o,!1),v=!1;continue}if(m===2){if(v=o,r.errorRecoveryDisabledLanes&v)var E=0;else E=r.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var k=r;m=Dl;var $=k.current.memoizedState.isDehydrated;if($&&(ec(k,E).flags|=256),E=ug(k,E,!1),E!==2){if(rg&&!$){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),Ao(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:Ao(u,o,cr,!Co);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(Ao(u,o,cr,!Co),is(u,0,!0)!==0)break e;Us=o,u.timeoutHandle=M_(r_.bind(null,u,c,qn,Wf,og,o,cr,Bi,Wa,Co,v,"Throttled",-0,0),m);break e}r_(u,c,qn,Wf,og,o,cr,Bi,Wa,Co,v,null,-0,0)}}break}while(!0);ds(r)}function r_(r,o,c,u,m,v,E,k,$,te,ce,de,ne,oe){if(r.timeoutHandle=-1,de=o.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Es},YS(o,v,de);var Ne=(v&62914560)===v?Xf-Be():(v&4194048)===v?JS-Be():0;if(Ne=SM(de,Ne),Ne!==null){Us=v,r.cancelPendingCommit=Ne(f_.bind(null,r,o,v,c,u,m,E,k,$,ce,de,null,ne,oe)),Ao(r,v,E,!te);return}}f_(r,o,v,c,u,m,E,k,$)}function zO(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 Ao(r,o,c,u){o&=~sg,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&&cs(r,c,o)}function Jf(){return(pt&6)===0?(Ll(0),!1):!0}function lg(){if(Je!==null){if(St===0)var r=Je.return;else r=Je,Ns=Oi=null,Tm(r),qa=null,xl=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,rM(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),Us=0,lg(),Nt=r,Je=c=Cs(r.current,null),tt=o,St=0,ar=null,Co=!1,Qa=as(r,o),rg=!1,Wa=cr=sg=Bi=Ro=Kt=0,qn=Dl=null,og=!1,(o&8)!==0&&(o|=o&32);var u=r.entangledLanes;if(u!==0)for(r=r.entanglements,u&=o;0<u;){var m=31-xt(u),v=1<<m;o|=r[m],u&=~v}return Ls=o,xf(),c}function s_(r,o){Ze=null,D.H=Nl,o===Ha||o===Nf?(o=x0(),St=3):o===hm?(o=x0(),St=4):St=o===Bm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,ar=o,Je===null&&(Kt=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=Nl,r===null?Nl:r}function a_(){var r=D.A;return D.A=PO,r}function ed(){Kt=4,Co||(tt&4194048)!==tt&&or.current!==null||(Qa=!0),(Ro&134217727)===0&&(Bi&134217727)===0||Nt===null||Ao(Nt,tt,cr,!1)}function ug(r,o,c){var u=pt;pt|=2;var m=i_(),v=a_();(Nt!==r||tt!==o)&&(Wf=null,ec(r,o)),o=!1;var E=Kt;e:do try{if(St!==0&&Je!==null){var k=Je,$=ar;switch(St){case 8:lg(),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)}}LO(),E=Kt;break}catch(ce){s_(r,ce)}while(!0);return o&&r.shellSuspendCounter++,Ns=Oi=null,pt=u,D.H=m,D.A=v,Je===null&&(Nt=null,tt=0,xf()),E}function LO(){for(;Je!==null;)c_(Je)}function UO(r,o){var c=pt;pt|=2;var u=i_(),m=a_();Nt!==r||tt!==o?(Wf=null,Qf=Be()+500,ec(r,o)):Qa=as(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),ds(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:lg(),Kt=6;break e;default:throw Error(s(462))}}$O();break}catch(ce){s_(r,ce)}while(!0);return Ns=Oi=null,D.H=u,D.A=m,pt=c,Je!==null?0:(Nt=null,tt=0,xf(),Kt)}function $O(){for(;Je!==null&&!Ve();)c_(Je)}function c_(r){var o=OS(r.alternate,r,Ls);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:Tm(o);default:IS(c,o),o=Je=a0(o,Ls),o=OS(c,o,Ls)}r.memoizedProps=r.pendingProps,o===null?td(r):Je=o}function tc(r,o,c,u){Ns=Oi=null,Tm(o),qa=null,xl=0;var m=o.return;try{if(NO(r,m,o,c,tt)){Kt=1,Ff(r,Nr(c,r.current)),Je=null;return}}catch(v){if(m!==null)throw Je=m,v;Kt=1,Ff(r,Nr(c,r.current)),Je=null;return}o.flags&32768?(rt||u===1?r=!0:Qa||(tt&536870912)!==0?r=!1:(Co=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,Co);return}r=o.return;var c=kO(o.alternate,o,Ls);if(c!==null){Je=c;return}if(o=o.sibling,o!==null){Je=o;return}Je=o=r}while(o!==null);Kt===0&&(Kt=5)}function u_(r,o){do{var c=OO(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);Kt=6,Je=null}function f_(r,o,c,u,m,v,E,k,$){r.cancelPendingCommit=null;do nd();while(fn!==0);if((pt&6)!==0)throw Error(s(327));if(o!==null){if(o===r.current)throw Error(s(177));if(v=o.lanes|o.childLanes,v|=Wp,tr(r,c,v,E,k,$),r===Nt&&(Je=Nt=null,tt=0),Ja=o,jo=r,Us=c,ig=v,ag=m,e_=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,qO(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=K.p,K.p=2,E=pt,pt|=4;try{MO(r,o,c)}finally{pt=E,K.p=m,D.T=u}}fn=1,d_(),h_(),p_()}}function d_(){if(fn===1){fn=0;var r=jo,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=pt;pt|=4;try{GS(o,r);var v=_g,E=Wx(r.containerInfo),k=v.focusedElem,$=v.selectionRange;if(E!==k&&k&&k.ownerDocument&&Qx(k.ownerDocument.documentElement,k)){if($!==null&&Kp(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 de=k.ownerDocument||document,ne=de&&de.defaultView||window;if(ne.getSelection){var oe=ne.getSelection(),Ne=k.textContent.length,$e=Math.min($.start,Ne),Ct=$.end===void 0?$e:Math.min($.end,Ne);!oe.extend&&$e>Ct&&(E=Ct,Ct=$e,$e=E);var X=Xx(k,$e),F=Xx(k,Ct);if(X&&F&&(oe.rangeCount!==1||oe.anchorNode!==X.node||oe.anchorOffset!==X.offset||oe.focusNode!==F.node||oe.focusOffset!==F.offset)){var J=de.createRange();J.setStart(X.node,X.offset),oe.removeAllRanges(),$e>Ct?(oe.addRange(J),oe.extend(F.node,F.offset)):(J.setEnd(F.node,F.offset),oe.addRange(J))}}}}for(de=[],oe=k;oe=oe.parentNode;)oe.nodeType===1&&de.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<de.length;k++){var le=de[k];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}pd=!!Sg,_g=Sg=null}finally{pt=m,K.p=u,D.T=c}}r.current=o,fn=2}}function h_(){if(fn===2){fn=0;var r=jo,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=pt;pt|=4;try{BS(r,o.alternate,o)}finally{pt=m,K.p=u,D.T=c}}fn=3}}function p_(){if(fn===4||fn===3){fn=0,Qe();var r=jo,o=Ja,c=Us,u=e_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?fn=5:(fn=0,Ja=jo=null,m_(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(No=null),sl(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 k=u[E];v(k.value,{componentStack:k.stack})}}finally{D.T=o,K.p=m}}(Us&3)!==0&&nd(),ds(r),m=r.pendingLanes,(c&261930)!==0&&(m&42)!==0?r===cg?zl++:(zl=0,cg=r):zl=0,Ll(0)}}function m_(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,vl(o)))}function nd(){return d_(),h_(),p_(),g_()}function g_(){if(fn!==5)return!1;var r=jo,o=ig;ig=0;var c=sl(Us),u=D.T,m=K.p;try{K.p=32>c?32:c,D.T=null,c=ag,ag=null;var v=jo,E=Us;if(fn=0,Ja=jo=null,Us=0,(pt&6)!==0)throw Error(s(331));var k=pt;if(pt|=4,QS(v.current),ZS(v,v.current,E,c),pt=k,Ll(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Er,v)}catch{}return!0}finally{K.p=m,D.T=u,m_(r,o)}}function y_(r,o,c){o=Nr(c,o),o=$m(r.stateNode,o,2),r=_o(r,o,2),r!==null&&(_s(r,2),ds(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"&&(No===null||!No.has(u))){r=Nr(c,r),c=vS(2),u=_o(o,c,2),u!==null&&(bS(c,u,o,r),_s(u,2),ds(u));break}}o=o.return}}function fg(r,o,c){var u=r.pingCache;if(u===null){u=r.pingCache=new DO;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)||(rg=!0,m.add(c),r=BO.bind(null,r,o,c),o.then(r,r))}function BO(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&&(Kt===4||Kt===3&&(tt&62914560)===tt&&300>Be()-Xf?(pt&2)===0&&ec(r,0):sg|=c,Wa===tt&&(Wa=0)),ds(r)}function v_(r,o){o===0&&(o=wi()),r=ji(r,o),r!==null&&(_s(r,o),ds(r))}function FO(r){var o=r.memoizedState,c=0;o!==null&&(c=o.retryLane),v_(r,c)}function HO(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 qO(r,o){return Ue(r,o)}var rd=null,nc=null,dg=!1,sd=!1,hg=!1,ko=0;function ds(r){r!==nc&&r.next===null&&(nc===null?rd=nc=r:nc=nc.next=r),sd=!0,dg||(dg=!0,GO())}function Ll(r,o){if(!hg&&sd){hg=!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=is(u,u===Nt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||as(u,v)||(c=!0,__(u,v));u=u.next}while(c);hg=!1}}function VO(){b_()}function b_(){sd=dg=!1;var r=0;ko!==0&&nM()&&(r=ko);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||Ll(r),ko!==0&&(ko=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=is(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||as(r,c)){if(o=c&-c,o===r.callbackPriority)return o;switch(u!==null&&Ee(u),sl(c)){case 2:case 8:c=me;break;case 32:c=Te;break;case 268435456:c=ht;break;default:c=Te}return u=S_.bind(null,r),c=Ue(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=is(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 GO(){sM(function(){(pt&6)!==0?Ue(He,VO):b_()})}function pg(){if(ko===0){var r=Ba;r===0&&(r=kt,kt<<=1,(kt&261888)===0&&(kt=256)),ko=r}return ko}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 KO(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(ko!==0){var $=E?E_(m,E):new FormData(m);Im(c,{pending:!0,data:$,method:m.method,action:v},null,$)}}else typeof v=="function"&&(k.preventDefault(),$=E?E_(m,E):new FormData(m),Im(c,{pending:!0,data:$,method:m.method,action:v},v,$))},currentTarget:m}]})}}for(var mg=0;mg<Qp.length;mg++){var gg=Qp[mg],ZO=gg.toLowerCase(),YO=gg[0].toUpperCase()+gg.slice(1);Xr(ZO,"on"+YO)}Xr(t0,"onAnimationEnd"),Xr(n0,"onAnimationIteration"),Xr(r0,"onAnimationStart"),Xr("dblclick","onDoubleClick"),Xr("focusin","onFocus"),Xr("focusout","onBlur"),Xr(fO,"onTransitionRun"),Xr(dO,"onTransitionStart"),Xr(hO,"onTransitionCancel"),Xr(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 Ul="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(" "),XO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ul));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[jp];c===void 0&&(c=o[jp]=new Set);var u=r+"__bubble";c.has(u)||(C_(o,r,2,!1),c.add(u))}function yg(r,o,c){var u=0;o&&(u|=4),C_(c,r,u,o)}var od="_reactListening"+Math.random().toString(36).slice(2);function vg(r){if(!r[od]){r[od]=!0,bx.forEach(function(c){c!=="selectionchange"&&(XO.has(c)||yg(c,!1,r),yg(c,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[od]||(o[od]=!0,yg("selectionchange",!1,o))}}function C_(r,o,c,u){switch(tw(o)){case 2:var m=EM;break;case 8:m=TM;break;default:m=Mg}c=m.bind(null,o,c,r),m=void 0,!Lp||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 bg(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=Dp(c),de=[];e:{var ne=o0.get(r);if(ne!==void 0){var oe=gf,Ne=r;switch(r){case"keypress":if(pf(c)===0)break e;case"keydown":case"keyup":oe=Hk;break;case"focusin":Ne="focus",oe=Fp;break;case"focusout":Ne="blur",oe=Fp;break;case"beforeblur":case"afterblur":oe=Fp;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":oe=Ix;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=kk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Gk;break;case t0:case n0:case r0:oe=Ik;break;case s0:oe=Zk;break;case"scroll":case"scrollend":oe=jk;break;case"wheel":oe=Xk;break;case"copy":case"cut":case"paste":oe=Dk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=Dx;break;case"toggle":case"beforetoggle":oe=Wk}var $e=(o&4)!==0,Ct=!$e&&(r==="scroll"||r==="scrollend"),X=$e?ne!==null?ne+"Capture":null:ne;$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||X===null||(le=al(F,X),le!=null&&$e.push($l(F,le,J))),Ct)break;F=F.return}0<$e.length&&(ne=new oe(ne,Ne,null,c,ce),de.push({event:ne,listeners:$e}))}}if((o&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",oe=r==="mouseout"||r==="pointerout",ne&&c!==Pp&&(Ne=c.relatedTarget||c.fromElement)&&(Ea(Ne)||Ne[wa]))break e;if((oe||ne)&&(ne=ce.window===ce?ce:(ne=ce.ownerDocument)?ne.defaultView||ne.parentWindow:window,oe?(Ne=c.relatedTarget||c.toElement,oe=te,Ne=Ne?Ea(Ne):null,Ne!==null&&(Ct=a(Ne),$e=Ne.tag,Ne!==Ct||$e!==5&&$e!==27&&$e!==6)&&(Ne=null)):(oe=null,Ne=te),oe!==Ne)){if($e=Ix,le="onMouseLeave",X="onMouseEnter",F="mouse",(r==="pointerout"||r==="pointerover")&&($e=Dx,le="onPointerLeave",X="onPointerEnter",F="pointer"),Ct=oe==null?ne:il(oe),J=Ne==null?ne:il(Ne),ne=new $e(le,F+"leave",oe,c,ce),ne.target=Ct,ne.relatedTarget=J,le=null,Ea(ce)===te&&($e=new $e(X,F+"enter",Ne,c,ce),$e.target=J,$e.relatedTarget=Ct,le=$e),Ct=le,oe&&Ne)t:{for($e=QO,X=oe,F=Ne,J=0,le=X;le;le=$e(le))J++;le=0;for(var ze=F;ze;ze=$e(ze))le++;for(;0<J-le;)X=$e(X),J--;for(;0<le-J;)F=$e(F),le--;for(;J--;){if(X===F||F!==null&&X===F.alternate){$e=X;break t}X=$e(X),F=$e(F)}$e=null}else $e=null;oe!==null&&R_(de,ne,oe,$e,!1),Ne!==null&&Ct!==null&&R_(de,Ct,Ne,$e,!0)}}e:{if(ne=te?il(te):window,oe=ne.nodeName&&ne.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ne.type==="file")var ft=qx;else if(Fx(ne))if(Vx)ft=cO;else{ft=iO;var Oe=oO}else oe=ne.nodeName,!oe||oe.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&Ip(te.elementType)&&(ft=qx):ft=aO;if(ft&&(ft=ft(r,te))){Hx(de,ft,c,ce);break e}Oe&&Oe(r,ne,te),r==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&Mp(ne,"number",ne.value)}switch(Oe=te?il(te):window,r){case"focusin":(Fx(Oe)||Oe.contentEditable==="true")&&(Ma=Oe,Zp=te,ml=null);break;case"focusout":ml=Zp=Ma=null;break;case"mousedown":Yp=!0;break;case"contextmenu":case"mouseup":case"dragend":Yp=!1,Jx(de,c,ce);break;case"selectionchange":if(uO)break;case"keydown":case"keyup":Jx(de,c,ce)}var Ye;if(qp)e:{switch(r){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else 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()):(mo=ce,Up="value"in mo?mo.value:mo.textContent,Oa=!0)),Oe=id(te,nt),0<Oe.length&&(nt=new Px(nt,r,null,c,ce),de.push({event:nt,listeners:Oe}),Ye?nt.data=Ye:(Ye=Bx(c),Ye!==null&&(nt.data=Ye)))),(Ye=eO?tO(r,c):nO(r,c))&&(nt=id(te,"onBeforeInput"),0<nt.length&&(Oe=new Px("onBeforeInput","beforeinput",null,c,ce),de.push({event:Oe,listeners:nt}),Oe.data=Ye)),KO(de,r,te,c,ce)}T_(de,o)})}function $l(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=al(r,c),m!=null&&u.unshift($l(r,m,v)),m=al(r,o),m!=null&&u.push($l(r,m,v))),r.tag===3)return u;r=r.return}return[]}function QO(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=al(c,v),te!=null&&E.unshift($l(c,te,$))):m||(te=al(c,v),te!=null&&E.push($l(c,te,$)))),c=c.return}E.length!==0&&r.push({event:o,listeners:E})}var WO=/\r\n?/g,JO=/\u0000|\uFFFD/g;function N_(r){return(typeof r=="string"?r:""+r).replace(WO,`
67
+ `).replace(JO,"")}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=Es);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":ws(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":ws(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":ws(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":ws(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":ws(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":ws(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":ws(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":ws(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":ws(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=Rk.get(c)||c,lf(r,c,u))}}function xg(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=Es);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<Ul.length;u++)et(Ul[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(Ip(o)){for(ce in c)c.hasOwnProperty(ce)&&(u=c[ce],u!==void 0&&xg(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 eM(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(oe in c){var de=c[oe];if(c.hasOwnProperty(oe)&&de!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":$=de;default:u.hasOwnProperty(oe)||Tt(r,o,oe,null,u,de)}}for(var ne in u){var oe=u[ne];if(de=c[ne],u.hasOwnProperty(ne)&&(oe!=null||de!=null))switch(ne){case"type":v=oe;break;case"name":m=oe;break;case"checked":te=oe;break;case"defaultChecked":ce=oe;break;case"value":E=oe;break;case"defaultValue":k=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(s(137,o));break;default:oe!==de&&Tt(r,o,ne,oe,u,de)}}Op(r,E,k,$,te,ce,v,m);return;case"select":oe=E=k=ne=null;for(v in c)if($=c[v],c.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":oe=$;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":ne=v;break;case"defaultValue":k=v;break;case"multiple":E=v;default:v!==$&&Tt(r,o,m,v,u,$)}o=k,c=E,u=oe,ne!=null?Na(r,!!c,ne,!1):!!u!=!!c&&(o!=null?Na(r,!!c,o,!0):Na(r,!!c,c?[]:"",!1));return;case"textarea":oe=ne=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":ne=m;break;case"defaultValue":oe=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,ne,oe);return;case"option":for(var Ne in c)ne=c[Ne],c.hasOwnProperty(Ne)&&ne!=null&&!u.hasOwnProperty(Ne)&&(Ne==="selected"?r.selected=!1:Tt(r,o,Ne,null,u,ne));for($ in u)ne=u[$],oe=c[$],u.hasOwnProperty($)&&ne!==oe&&(ne!=null||oe!=null)&&($==="selected"?r.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Tt(r,o,$,ne,u,oe));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var $e in c)ne=c[$e],c.hasOwnProperty($e)&&ne!=null&&!u.hasOwnProperty($e)&&Tt(r,o,$e,null,u,ne);for(te in u)if(ne=u[te],oe=c[te],u.hasOwnProperty(te)&&ne!==oe&&(ne!=null||oe!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(s(137,o));break;default:Tt(r,o,te,ne,u,oe)}return;default:if(Ip(o)){for(var Ct in c)ne=c[Ct],c.hasOwnProperty(Ct)&&ne!==void 0&&!u.hasOwnProperty(Ct)&&xg(r,o,Ct,void 0,u,ne);for(ce in u)ne=u[ce],oe=c[ce],!u.hasOwnProperty(ce)||ne===oe||ne===void 0&&oe===void 0||xg(r,o,ce,ne,u,oe);return}}for(var X in c)ne=c[X],c.hasOwnProperty(X)&&ne!=null&&!u.hasOwnProperty(X)&&Tt(r,o,X,null,u,ne);for(de in u)ne=u[de],oe=c[de],!u.hasOwnProperty(de)||ne===oe||ne==null&&oe==null||Tt(r,o,de,ne,u,oe)}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 tM(){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,de=$.initiatorType;ce&&A_(de)&&($=$.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 Sg=null,_g=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 wg(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Eg=null;function nM(){var r=window.event;return r&&r.type==="popstate"?r===Eg?!1:(Eg=r,!0):(Eg=null,!1)}var M_=typeof setTimeout=="function"?setTimeout:void 0,rM=typeof clearTimeout=="function"?clearTimeout:void 0,I_=typeof Promise=="function"?Promise:void 0,sM=typeof queueMicrotask=="function"?queueMicrotask:typeof I_<"u"?function(r){return I_.resolve(null).then(r).catch(oM)}:M_;function oM(r){setTimeout(function(){throw r})}function Oo(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")Bl(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,Bl(c);for(var v=c.firstChild;v;){var E=v.nextSibling,k=v.nodeName;v[ol]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&v.rel.toLowerCase()==="stylesheet"||c.removeChild(v),v=E}}else c==="body"&&Bl(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 Tg(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":Tg(c),Ap(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function iM(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[ol])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 aM(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 Cg(r){return r.data==="$?"||r.data==="$~"}function Rg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function cM(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 Ng=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 Bl(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Ap(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 $s=K.d;K.d={f:lM,r:uM,D:fM,C:dM,L:hM,m:pM,X:gM,S:mM,M:yM};function lM(){var r=$s.f(),o=Jf();return r||o}function uM(r){var o=Ta(r);o!==null&&o.tag===5&&o.type==="form"?sS(o):$s.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 fM(r){$s.D(r),F_("dns-prefetch",r,null)}function dM(r,o){$s.C(r,o),F_("preconnect",r,o)}function hM(r,o,c){$s.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(Fl(v))||o==="script"&&u.querySelector(Hl(v))||(o=u.createElement("link"),Tn(o,"link",r),bn(o),u.head.appendChild(o)))}}function pM(r,o){$s.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(Hl(v)))return}u=c.createElement("link"),Tn(u,"link",r),bn(u),c.head.appendChild(u)}}}function mM(r,o,c){$s.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(Fl(v)))k.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":o},c),(c=Ir.get(v))&&jg(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 gM(r,o){$s.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(Hl(m)),v||(r=y({src:r,async:!0},o),(o=Ir.get(m))&&Ag(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 yM(r,o){$s.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(Hl(m)),v||(r=y({src:r,async:!0,type:"module"},o),(o=Ir.get(m))&&Ag(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(Fl(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||vM(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 Fl(r){return'link[rel="stylesheet"]['+r+"]"}function q_(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function vM(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 Hl(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(Fl(m));if(v)return o.state.loading|=4,o.instance=v,bn(v),v;u=q_(c),(m=Ir.get(m))&&jg(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(Hl(v)))?(o.instance=m,bn(m),m):(u=c,(m=Ir.get(v))&&(u=y({},c),Ag(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 jg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function Ag(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var ud=null;function G_(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[ol]||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 K_(r,o,c){r=r.ownerDocument||r,r.head.insertBefore(c,o==="title"?r.querySelector("head > title"):null)}function bM(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 xM(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(Fl(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))&&jg(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 kg=0;function SM(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&&kg===0&&(kg=62500*tM());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>kg?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(_M,r),dd=null,fd.call(r))}function _M(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 ql={$$typeof:N,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function wM(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,de){return r=new wM(r,o,c,E,$,te,ce,de,k),o=1,v===!0&&(o|=24),v=sr(3,null,null,o),r.current=v,v.stateNode=r,o=um(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:c,cache:o},pm(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=So(o),u.payload={element:c},v=v===void 0?null:v,v!==null&&(u.callback=v),c=_o(r,u,o),c!==null&&(Vn(c,r,o),_l(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 Og(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),Og(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),Og(r,o)}}var pd=!0;function EM(r,o,c,u){var m=D.T;D.T=null;var v=K.p;try{K.p=2,Mg(r,o,c,u)}finally{K.p=v,D.T=m}}function TM(r,o,c,u){var m=D.T;D.T=null;var v=K.p;try{K.p=8,Mg(r,o,c,u)}finally{K.p=v,D.T=m}}function Mg(r,o,c,u){if(pd){var m=Ig(u);if(m===null)bg(r,o,u,md,c),nw(r,u);else if(RM(m,r,o,c,u))u.stopPropagation();else if(nw(r,u),o&4&&-1<CM.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&=~$}ds(v),(pt&6)===0&&(Qf=Be()+500,Ll(0))}}break;case 31:case 13:k=ji(v,2),k!==null&&Vn(k,v,2),Jf(),Og(v,2)}if(v=Ig(u),v===null&&bg(r,o,u,md,c),v===m)break;m=v}m!==null&&u.stopPropagation()}else bg(r,o,u,null,c)}}function Ig(r){return r=Dp(r),Pg(r)}var md=null;function Pg(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 ht:return 268435456;default:return 32}default:return 32}}var Dg=!1,Mo=null,Io=null,Po=null,Vl=new Map,Gl=new Map,Do=[],CM="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":Mo=null;break;case"dragenter":case"dragleave":Io=null;break;case"mouseover":case"mouseout":Po=null;break;case"pointerover":case"pointerout":Vl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gl.delete(o.pointerId)}}function Kl(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 RM(r,o,c,u,m){switch(o){case"focusin":return Mo=Kl(Mo,r,o,c,u,m),!0;case"dragenter":return Io=Kl(Io,r,o,c,u,m),!0;case"mouseover":return Po=Kl(Po,r,o,c,u,m),!0;case"pointerover":var v=m.pointerId;return Vl.set(v,Kl(Vl.get(v)||null,r,o,c,u,m)),!0;case"gotpointercapture":return v=m.pointerId,Gl.set(v,Kl(Gl.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=Ig(r.nativeEvent);if(c===null){c=r.nativeEvent;var u=new c.constructor(c.type,c);Pp=u,c.target.dispatchEvent(u),Pp=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 NM(){Dg=!1,Mo!==null&&gd(Mo)&&(Mo=null),Io!==null&&gd(Io)&&(Io=null),Po!==null&&gd(Po)&&(Po=null),Vl.forEach(sw),Gl.forEach(sw)}function yd(r,o){r.blockedOn===o&&(r.blockedOn=null,Dg||(Dg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,NM)))}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(Pg(u||c)===null)continue;break}var v=Ta(c);v!==null&&(r.splice(o,3),o-=3,Im(v,{pending:!0,data:m,method:c.method,action:u},u,m))}}))}function ic(r){function o($){return yd($,r)}Mo!==null&&yd(Mo,r),Io!==null&&yd(Io,r),Po!==null&&yd(Po,r),Vl.forEach(o),Gl.forEach(o);for(var c=0;c<Do.length;c++){var u=Do[c];u.blockedOn===r&&(u.blockedOn=null)}for(;0<Do.length&&(c=Do[0],c.blockedOn===null);)rw(c),c.blockedOn===null&&Do.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(Pg(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 zg(r){this._internalRoot=r}bd.prototype.render=zg.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=zg.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<Do.length&&o!==0&&o<Do[c].priority;c++);Do.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"));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 jM={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(jM),Qt=xd}catch{}}return Xl.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,vg(r),new zg(o)},Xl.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=So(u),m.callback=null,_o(c,m,u),c=u,o.current.lanes=c,_s(o,c),ds(o),r[wa]=o.current,vg(r),new bd(o)},Xl.version="19.2.4",Xl}var YE;function a6(){if(YE)return ry.exports;YE=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(),ry.exports=i6(),ry.exports}var c6=a6(),Wc=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(){}},l6={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},u6=class{#e=l6;#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 u6;function f6(e){setTimeout(e,0)}var ca=typeof window>"u"||"Deno"in globalThis;function Mn(){}function d6(e,t){return typeof e=="function"?e(t):e}function pv(e){return typeof e=="number"&&e>=0&&e!==1/0}function mN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xo(e,t){return typeof e=="function"?e(t):e}function zr(e,t){return typeof e=="function"?e(t):e}function XE(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:a,queryKey:l,stale:f}=e;if(l){if(s){if(t.queryHash!==Rb(l,t.options))return!1}else if(!Su(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 QE(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(!Su(t.options.mutationKey,a))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function Rb(e,t){return(t?.queryKeyHashFn||la)(e)}function la(e){return JSON.stringify(e,(t,n)=>mv(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Su(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Su(e[n],t[n])):!1}var h6=Object.prototype.hasOwnProperty;function gN(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=WE(e)&&WE(t);if(!s&&!(mv(e)&&mv(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:h6.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 Rh(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 WE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mv(e){if(!JE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!JE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function JE(e){return Object.prototype.toString.call(e)==="[object Object]"}function p6(e){return new Promise(t=>{Zi.setTimeout(t,e)})}function gv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?gN(e,t):t}function m6(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function g6(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Nb=Symbol();function yN(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Nb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jb(e,t){return typeof e=="function"?e(...t):!!e}function y6(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 v6=class extends Wc{#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"}},Ab=new v6;function yv(){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 b6=f6;function x6(){let e=[],t=0,n=f=>{f()},s=f=>{f()},i=b6;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=x6(),S6=class extends Wc{#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}},Nh=new S6;function _6(e){return Math.min(1e3*2**e,3e4)}function vN(e){return(e??"online")==="online"?Nh.isOnline():!0}var vv=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=yv(),a=()=>i.status!=="pending",l=w=>{if(!a()){const T=new vv(w);b(T),e.onCancel?.(T)}},f=()=>{t=!0},d=()=>{t=!1},p=()=>Ab.isFocused()&&(e.networkMode==="always"||Nh.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??_6,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),p6(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(),pv(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)}},w6=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=tT(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=tT(this.options);t.data!==void 0&&(this.setState(eT(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=gv(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===Nb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xo(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 vv&&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 vv){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,...eT(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 eT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function tT(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 E6=class extends Wc{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=yv(),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),nT(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bv(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&&!Rh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&rT(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)||Xo(this.options.staleTime,this.#t)!==Xo(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 C6(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=Xo(this.options.staleTime,this.#t);if(ca||this.#s.isStale||!pv(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||!pv(this.#c)||this.#c===0)&&(this.#u=Zi.setInterval(()=>{(this.options.refetchIntervalInBackground||Ab.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&&nT(e,t),Q=A&&rT(e,n,t,s);(P||Q)&&(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=gv(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=gv(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:kb(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,Q=Z=>{P?Z.reject(j.error):A&&Z.resolve(j.data)},B=()=>{const Z=this.#a=j.promise=yv();Q(Z)},U=this.#a;switch(U.status){case"pending":e.queryHash===n.queryHash&&Q(U);break;case"fulfilled":(P||j.data!==U.value)&&B();break;case"rejected":(!P||j.error!==U.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),Rh(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 T6(e,t){return zr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function nT(e,t){return T6(e,t)||e.state.data!==void 0&&bv(e,t,t.refetchOnMount)}function bv(e,t,n){if(zr(t.enabled,e)!==!1&&Xo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&kb(e,t)}return!1}function rT(e,t,n,s){return(e!==t||zr(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&kb(e,n)}function kb(e,t){return zr(t.enabled,e)!==!1&&e.isStaleByTime(Xo(t.staleTime,e))}function C6(e,t){return!Rh(e.getCurrentResult(),t)}function sT(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=>{y6(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 z={client:t.client,queryKey:t.queryKey,pageParam:w,direction:T?"backward":"forward",meta:t.options.meta};return y(z),z})(),N=await b(O),{maxPages:R}=t.options,M=T?g6:m6;return{pages:M(S.pages,N,R),pageParams:M(S.pageParams,w,R)}};if(i&&a.length){const S=i==="backward",w=S?R6:oT,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:oT(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 oT(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 R6(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var N6=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 j6=class extends Wc{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 N6({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=>QE(t,n))}findAll(e={}){return this.getAll().filter(t=>QE(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 A6=class extends Wc{#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),Rh(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)})})}},k6=class extends Wc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,i=t.queryHash??Rb(s,t);let a=this.get(i);return a||(a=new w6({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=>XE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>XE(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()})})}},O6=class{#e;#t;#n;#s;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new k6,this.#t=e.mutationCache||new j6,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Ab.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Nh.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(Xo(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=d6(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(Xo(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=sT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mn).catch(Mn)}ensureInfiniteQueryData(e){return e.behavior=sT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Nh.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=>{Su(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=>{Su(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Rb(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===Nb&&(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},M6=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(wN.Provider,{value:e,children:t})),EN=_.createContext(!1),I6=()=>_.useContext(EN);EN.Provider;function P6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var D6=_.createContext(P6()),z6=()=>_.useContext(D6),L6=(e,t,n)=>{const s=n?.state.error&&typeof e.throwOnError=="function"?jb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},U6=e=>{_.useEffect(()=>{e.clearReset()},[e])},$6=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||jb(n,[e.error,s])),B6=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))}},F6=(e,t)=>e.isLoading&&e.isFetching&&!t,H6=(e,t)=>e?.suspense&&t.isPending,iT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function q6(e,t,n){const s=I6(),i=z6(),a=_r(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const f=a.getQueryCache().get(l.queryHash);l._optimisticResults=s?"isRestoring":"optimistic",B6(l),L6(l,i,f),U6(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]),H6(l,g))throw iT(l,p,i);if($6({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&&F6(g,s)&&(d?iT(l,p,i):f?.promise)?.catch(Mn).finally(()=>{p.updateResult()}),l.notifyOnChangeProps?g:p.trackResult(g)}function Wn(e,t){return q6(e,E6)}function os(e,t){const n=_r(),[s]=_.useState(()=>new A6(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&&jb(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 Ob=0,Hi=0,cu=0;const Vs=[],{link:yQ,unlink:CN,propagate:vQ,checkDirty:V6,shallowPropagate:bQ}=TN({update(e){return e.depsTail!==void 0?Y6(e):X6(e)},notify(e){let t=cu,n=t;do if(Vs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(cu=t;n<--t;){const s=Vs[n];Vs[n++]=Vs[t],Vs[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,cp(e)):J6.call(e)}});function G6(){return Ob}function K6(){++Ob}function Z6(){--Ob||W6()}function Y6(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,cp(e)}}function X6(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Q6(e){const t=e.flags;if(t&16||t&32&&V6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,cp(e)}}else e.flags=2}function W6(){try{for(;Hi<cu;){const e=Vs[Hi];Vs[Hi++]=void 0,Q6(e)}}finally{for(;Hi<cu;){const e=Vs[Hi];Vs[Hi++]=void 0,e.flags|=10}Hi=0,cu=0}}function J6(){this.depsTail=void 0,this.flags=0,cp(this);const e=this.subs;e!==void 0&&CN(e)}function cp(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 xv=[];let sh=0;const{link:aT,unlink:eF,propagate:tF,checkDirty:NN,shallowPropagate:cT}=TN({update(e){return e._update()},notify(e){xv[Sv++]=e,e.flags&=~$t.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=$t.Mutable|$t.Dirty,jh(e))}});let kd=0,Sv=0,ms;function jh(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=eF(n,e)}function jN(){if(!(G6()>0)){for(;kd<Sv;){const e=xv[kd];xv[kd++]=void 0,e.notify()}kd=0,Sv=0}}function nF(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 ms!==void 0&&aT(i,ms,sh),i._snapshot},subscribe(a){const l=RN(a),f={current:!1},d=rF(()=>{i.get(),f.current?l.next?.(i._snapshot):f.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=ms,f=Object.is;ms=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{ms=l,n&&(i.flags&=~$t.RecursedCheck),jh(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&&cT(l)}}else a&$t.Pending&&(i.flags=a&~$t.Pending);return ms!==void 0&&aT(i,ms,sh),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(tF(l),cT(l),jN())}},i}function rF(e){const t=()=>{const s=ms;ms=n,++sh,n.depsTail=void 0,n.flags=$t.Watching|$t.RecursedCheck;try{return e()}finally{ms=s,n.flags&=~$t.RecursedCheck,jh(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,jh(this)}};return t(),n}let sF=class{constructor(t){this.atom=nF(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 oF(e){try{K6(),e()}finally{Z6(),jN()}}const Qo="__TSR_index",lT="popstate",uT="beforeunload";function iF(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=Ah(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[Qo];f=fT(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[Qo];f=fT(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[Qo]!==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 fT(e,t){t||(t={});const n=Mb();return{...t,key:n,__TSR_key:n,[Qo]:e}}function aF(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=(()=>Ah(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=Mb();t.history.replaceState({[Qo]: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,Q)=>{const B=f(P);C||(g=p),p=Ah(P,Q),T={href:B,state:Q,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[Qo]-p.state[Qo],Q=P===1,B=P===-1,U=!Q&&!B||y;y=!1;const Z=U?"GO":B?"BACK":"FORWARD",G=U?{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:Z})){b=!0,t.history.go(1),j.notify(G);return}}}p=d(),j.notify(G)},z=A=>{if(S){S=!1;return}let P=!1;const Q=a();if(typeof document<"u"&&Q.length)for(const B of Q){const U=B.enableBeforeUnload??!0;if(U===!0){P=!0;break}if(typeof U=="function"&&U()===!0){P=!0;break}}if(P)return A.preventDefault(),A.returnValue=""},j=iF({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(uT,z,{capture:!0}),t.removeEventListener(lT,M)},onBlocked:()=>{g&&p!==g&&(p=g)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(uT,z,{capture:!0}),t.addEventListener(lT,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 cF(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Ah(e,t){const n=cF(e),s=n.indexOf("#"),i=n.indexOf("?"),a=Mb();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||{[Qo]:0,key:a,__TSR_key:a}}}function Mb(){return(Math.random()+1).toString(36).substring(7)}const lF=!1;function lu(e){let t;return oF(()=>{t=e()}),t}function _u(e){return e[e.length-1]}function uF(e){return typeof e=="function"}function Ho(e,t){return uF(e)?e(t):e}const fF=Object.prototype.hasOwnProperty,dT=Object.prototype.propertyIsEnumerable;function ur(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=t,i=mT(e)&&mT(s);if(!i&&!(kh(e)&&kh(s)))return s;const a=i?e:hT(e);if(!a)return s;const l=i?s:hT(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:fF.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 hT(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!dT.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(!dT.call(e,i))return!1;s.push(i)}return s}function kh(e){if(!pT(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!pT(n)||!n.hasOwnProperty("isPrototypeOf"))}function pT(e){return Object.prototype.toString.call(e)==="[object Object]"}function mT(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(kh(e)&&kh(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 Dc(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 yc(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function dF(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function gT(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 dF(t)}const hF=["http:","https:","mailto:","tel:"];function Oh(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Ql(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+=gT(e.slice(n,i.index))+i[0],n=t.lastIndex;s=s+gT(n?e.slice(n):e);let a=!1;return s.startsWith("//")&&(a=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:a}}function pF(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var mF="Invariant failed";function ro(e,t){if(!e)throw new Error(mF)}function Mh(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 zc=0,ua=1,fa=2,wu=3,Yi=4,AN=5;function gF(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Ib(e,t,n=new Uint16Array(6)){const s=e.indexOf("/",t),i=s===-1?e.length:s,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=zc,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=gF(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]=wu,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=i,n}}else if(p===36){const g=f+1,y=f+2;return y===d?(n[0]=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]=zc,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function lp(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=Ib(d,f,t);let S;const w=f,T=x[5];switch(f=T+1,a++,x[0]){case zc:{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,z=N?R?N:N.toLowerCase():void 0,j=!y&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===z);if(j)S=j;else{const A=cy(ua,n.fullPath??n.from,R,M,z);S=A,A.depth=a,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case wu:{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,z=N?R?N:N.toLowerCase():void 0,j=!y&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===z);if(j)S=j;else{const A=cy(wu,n.fullPath??n.from,R,M,z);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,z=N?R?N:N.toLowerCase():void 0,j=cy(fa,n.fullPath??n.from,R,M,z);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)lp(e,t,d,f,i,a,l)}function ay(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 Bo(e){if(e.pathless)for(const t of e.pathless)Bo(t);if(e.static)for(const t of e.static.values())Bo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Bo(t);if(e.dynamic?.length){e.dynamic.sort(ay);for(const t of e.dynamic)Bo(t)}if(e.optional?.length){e.optional.sort(ay);for(const t of e.optional)Bo(t)}if(e.wildcard?.length){e.wildcard.sort(ay);for(const t of e.wildcard)Bo(t)}}function Xi(e){return{kind:zc,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function cy(e,t,n,s,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:s,suffix:i}}function yF(e,t){const n=Xi("/"),s=new Uint16Array(6);for(const i of e)lp(!1,s,i,1,n,0);Bo(n),t.masksTree=n,t.flatCache=Mh(1e3)}function vF(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=Pb(e,t.masksTree);return t.flatCache.set(e,s),s}function bF(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);lp(t,f,{from:e},1,l,0),i.singleCache.set(a,l)}return Pb(s,l,n)}function xF(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=Pb(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=wF(a.route)),t.matchCache.set(s,a),a}function SF(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function _F(e,t=!1,n){const s=Xi(e.fullPath),i=new Uint16Array(6),a={},l={};let f=0;return lp(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=SF(p.fullPath);(!l[g]||p.fullPath.endsWith("/"))&&(l[g]=p)}f++}),Bo(s),{processedTree:{segmentTree:s,singleCache:Mh(1e3),matchCache:Mh(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function Pb(e,t,n=!1){const s=e.split("/"),i=TF(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=EF(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===wu){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 wF(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function EF(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function TF(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!_u(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(!ly(e,t,y))continue;R=y.rawParams,N=y.extract,M=y.parsedParams}s&&b.route&&b.kind!==Yi&&Wl(p,y)&&(p=y);const z=x===l;if(z&&(b.route&&!a&&Wl(g,y)&&(g=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const j=z?void 0:t[x];let A;if(z&&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 Q=!0;if(b.index.skipOnParamError&&(ly(e,t,P)||(Q=!1)),Q){if(T===l&&!C&&!O&&!S)return P;Wl(g,P)&&(g=P)}}if(b.wildcard&&Wl(d,y))for(const P of b.wildcard){const{prefix:Q,suffix:B}=P;if(Q&&(z||!(P.caseSensitive?j:A??=j.toLowerCase()).startsWith(Q)))continue;if(B){if(z)continue;const Z=t.slice(x).join("/").slice(-B.length);if((P.caseSensitive?Z:Z.toLowerCase())!==B)continue}const U={node:P,index:l,skipped:S,depth:w,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M};if(!(P.skipOnParamError&&!ly(e,t,U))){d=U;break}}if(b.optional){const P=S|1<<w,Q=w+1;for(let B=b.optional.length-1;B>=0;B--){const U=b.optional[B];f.push({node:U,index:x,skipped:P,depth:Q,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(!z)for(let B=b.optional.length-1;B>=0;B--){const U=b.optional[B],{prefix:Z,suffix:G}=U;if(Z||G){const ee=U.caseSensitive?j:A??=j.toLowerCase();if(Z&&!ee.startsWith(Z)||G&&!ee.endsWith(G))continue}f.push({node:U,index:x+1,skipped:S,depth:Q,statics:T,dynamics:C,optionals:O+1,extract:N,rawParams:R,parsedParams:M})}}if(!z&&b.dynamic&&j)for(let P=b.dynamic.length-1;P>=0;P--){const Q=b.dynamic[P],{prefix:B,suffix:U}=Q;if(B||U){const Z=Q.caseSensitive?j:A??=j.toLowerCase();if(B&&!Z.startsWith(B)||U&&!Z.endsWith(U))continue}f.push({node:Q,index:x+1,skipped:S,depth:w+1,statics:T,dynamics:C+1,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(!z&&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(!z&&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 Q=b.pathless.length-1;Q>=0;Q--){const B=b.pathless[Q];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 Wl(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 ly(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 Wl(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 Db(e.filter(t=>t!==void 0).join("/"))}function Db(e){return e.replace(/\/{2,}/g,"/")}function ON(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Gs(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function MN(e){return Gs(ON(e))}function Ih(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function CF(e,t,n){return Ih(e,n)===Ih(t,n)}function RF({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&&_u(f)==="";)f.pop();const y=t.split("/");for(let b=0,x=y.length;b<x;b++){const S=y[b];S===""?b?b===x-1&&f.push(S):f=[S]:S===".."?f.pop():S==="."||f.push(S)}}f.length>1&&(_u(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let d,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const b=f[y];if(!b)continue;d=Ib(b,0,d);const x=d[0];if(x===zc){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=Db(p);const g=p||"/";return l&&s&&s.set(l,g),g}function NF(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 uy(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 fy({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=Ib(e,y,d);const b=d[5];if(f=b+1,y===b)continue;const x=d[0];if(x===zc){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=uy("_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=uy(S,t,n)??"undefined";p+="/"+w+C+T;continue}if(x===wu){const S=e.substring(d[2],d[3]),w=t[S];if(w==null)continue;a[S]=w;const T=e.substring(y,d[1]),C=e.substring(d[4],b),O=uy(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 jF(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const _v="tsr-scroll-restoration-v1_3",AF=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function kF(){const e=jF();if(!e)return null;const t=e.getItem(_v);let n=t?JSON.parse(t):{};return{state:n,set:s=>{n=Ho(s,n)||n;try{e.setItem(_v,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Od=kF(),OF=e=>e.state.__TSR_key||e.href;function MF(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 Ph=!1;function IF({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];Ph=!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)}}Ph=!1}function PF(e,t){if(!Od||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Od))return;e.isScrollRestorationSetup=!0,Ph=!1;const s=e.options.getScrollRestorationKey||OF;window.history.scrollRestoration="manual";const i=a=>{if(Ph||!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=MF(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",AF(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})||(IF({storageKey:_v,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 DF(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 zF(e,t=String){const n=new URLSearchParams;for(const s in e){const i=e[s];i!==void 0&&n.set(s,t(i))}return n.toString()}function dy(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function LF(e){const t=new URLSearchParams(e),n={};for(const[s,i]of t.entries()){const a=n[s];a==null?n[s]=dy(i):Array.isArray(a)?a.push(dy(i)):n[s]=[a,dy(i)]}return n}const UF=BF(JSON.parse),$F=FF(JSON.stringify,JSON.parse);function BF(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=LF(t);for(const s in n){const i=n[s];if(typeof i=="string")try{n[s]=e(i)}catch{}}return n}}function FF(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=zF(i,s);return a?`?${a}`:""}}const Lr="__root__";function HF(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?.()},up=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),vc=(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))},qo=(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:vc(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,Jl=(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,qo(e,e.router.getMatch(i),n,s);try{l.options.onError?.(n)}catch(f){n=f,qo(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&&!up(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}},qF=(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")&&qo(e,a,a.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(i):i()},VF=(e,t,n,s)=>{const i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Dc(()=>{a?.resolve()});const{paramsError:l,searchError:f}=i;l&&Jl(e,n,l,"PARSE_PARAMS"),f&&Jl(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){lu(()=>{g(),y()});return}i._nonReactive.beforeLoadPromise=Dc();const b={...vc(e,n,!1),...i.__routeContext},{search:x,params:S,cause:w}=i,T=up(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){lu(()=>{g(),y()});return}(Br(R)||yr(R))&&(g(),Jl(e,n,R,"BEFORE_LOAD")),lu(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:R})),y()})};let N;try{if(N=s.options.beforeLoad(C),yc(N))return g(),N.catch(R=>{Jl(e,n,R,"BEFORE_LOAD")}).then(O)}catch(R){g(),Jl(e,n,R,"BEFORE_LOAD")}O(N)},GF=(e,t)=>{const{id:n,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s],a=()=>f(),l=()=>VF(e,n,t,i),f=()=>{if(PN(e,n))return;const d=qF(e,n,i);return yc(d)?d.then(l):l()};return a()},KF=(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=vc(e,n),g=up(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{(!(lF??e.router.isServer)||i.ssr===!0)&&LN(s);const a=s.options.loader?.(zN(e,t,n,s)),l=s.options.loader&&yc(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;qo(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:vc(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:vc(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,yr(a)&&await s.options.notFoundComponent?.preload?.(),qo(e,e.router.getMatch(t),a);try{s.options.onError?.(a)}catch(d){l=d,qo(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:l,context:vc(e,n),status:"error",isFetching:!1}))}}catch(i){const a=e.router.getMatch(t);a&&(a._nonReactive.loaderPromise=void 0),qo(e,a,i)}},ZF=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=up(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&&qo(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=Dc(),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=GF(t,f);yc(d)&&await d}const n=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<n;f++)t.matchPromises.push(ZF(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=KF(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);yc(l)&&await l}catch(n){if(yr(n)&&!t.preload){const s=ih(t);throw yc(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 YF(e){return{input:({url:t})=>{for(const n of e)t=wv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=BN(e[n],t);return t}}}function XF(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 wv(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 QF(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class WF{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=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");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=NF(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=aF()),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=Mh(1e3),b=this.buildRouteTree(),this.setRoutes(b)}!this.__store&&this.latestLocation&&(this.__store=new sF(eH(this.latestLocation)),PF(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(XF({basepath:d})),p&&b.push(p),this.rewrite=b.length===0?void 0:b.length===1?b[0]:YF(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=_F(this.routeTree,this.options.caseSensitive,(s,i)=>{s.init({originalIndex:i})});return this.options.routeMasks&&yF(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:Ql(d).path,external:!1,searchStr:N,search:ur(s?.search,O),hash:Ql(g.slice(1)).path,state:ur(s?.state,b)}}const x=new URL(y,this.origin),S=wv(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:Ql(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:T,search:ur(s?.search,w),hash:Ql(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)=>RF({base:n,to:Db(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=>tH({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,Ho(a.params,y)),S=fy({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,w=this.getMatchedRoutes(S);let T=w.matchedRoutes;(w.foundRoute?w.foundRoute.path!=="/"&&w.routeParams["**"]:Gs(S))&&this.options.notFoundRoute&&(T=[...T,this.options.notFoundRoute]);let O=!1;if(Object.keys(x).length>0)for(const Z of T){const G=Z.options.params?.stringify??Z.options.stringifyParams;G&&(O=!0,Object.assign(x,G(x)))}const N=n.leaveParams?b:Ql(O?fy({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:S).path;let R=g;if(n._includeValidateSearch&&this.options.search?.strict){const Z={};T.forEach(G=>{if(G.options.validateSearch)try{Object.assign(Z,ah(G.options.validateSearch,{...Z,...R}))}catch{}}),R=Z}R=nH({search:R,dest:a,destRoutes:T,_includeValidateSearch:n._includeValidateSearch}),R=ur(g,R);const M=this.options.stringifySearch(R),z=a.hash===!0?l.hash:a.hash?Ho(a.hash,l.hash):void 0,j=z?`#${z}`:"";let A=a.state===!0?l.state:a.state?Ho(a.state,l.state):{};A=ur(l.state,A);const P=`${N}${M}${j}`;let Q,B,U=!1;if(this.rewrite){const Z=new URL(P,this.origin),G=BN(this.rewrite,Z);Q=Z.href.replace(Z.origin,""),G.origin!==this.origin?(B=G.href,U=!0):B=G.pathname+G.search+G.hash}else Q=pF(P),B=Q;return{publicHref:B,href:Q,pathname:N,search:R,searchStr:M,state:A,hash:z??"",external:U,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=vF(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,Ho(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=Gs(this.latestLocation.href)===Gs(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=Dc(()=>{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=Ah(f,{__TSR_index:n?y:y+1}),x=new URL(b.pathname,this.origin),S=wv(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(Oh(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=[];lu(()=>{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:QF(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&&Oh(n.options.href,this.protocolAllowlist))throw new Error(`Redirect blocked: unsafe protocol in href "${n.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);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)]);lu(()=>{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=bF(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??$F,parseSearch:t.parseSearch??UF,protocolAllowlist:t.protocolAllowlist??hF}),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["**"]:Gs(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const p=d?sH(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 G=S?.search??t.search,ee=S?._strictSearch??void 0;try{const D=ah(x.options.validateSearch,{...G})??void 0;w={...G,...D},T={...ee,...D},C=void 0}catch(D){let K=D;if(D instanceof Dh||(K=new Dh(D.message,{cause:D})),n?.throwOnError)throw K;w=G,T={},C=K}}const O=x.options.loaderDeps?.({search:w})??"",N=O?JSON.stringify(O):"",{interpolatedPath:R,usedParams:M}=fy({path:x.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),z=x.id+R+N,j=this.getMatch(z),A=y.get(x.id),P=j?._strictParams??M;let Q;if(!j)try{xT(x,M,l,P)}catch(G){if(yr(G)||Br(G)?Q=G:Q=new JF(G.message,{cause:G}),n?.throwOnError)throw Q}Object.assign(a,P);const B=A?"stay":"enter";let U;if(j)U={...j,cause:B,params:A?.params??a,_strictParams:P,search:ur(A?A.search:j.search,w),_strictSearch:T};else{const G=x.options.loader||x.options.beforeLoad||x.lazyFn||UN(x)?"pending":"success";U={id:z,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:G,isFetching:!1,error:void 0,paramsError:Q,__routeContext:void 0,_nonReactive:{loadPromise:Dc()},__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||(U.globalNotFound=p===x.id),U.searchError=C;const Z=this.getParentContext(S);U.context={...Z,...U.__routeContext,...U.__beforeLoadContext},g[b]=U}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=_u(n),l={...t.search};for(const g of n)try{Object.assign(l,ah(g.options.validateSearch,l))}catch{}const f=_u(this.state.matches),d=f&&f.routeId===a.id&&t.pathname===this.state.location.pathname;let p;if(d)p=f.params;else{const g={...s};for(const y of n)try{xT(y,s,i??{},g)}catch{}p=g}return{matchedRoutes:n,fullPath:a.fullPath,search:l,params:p}}}class Dh extends Error{}class JF extends Error{}function eH(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 Dh("Async validation not supported");if(n.issues)throw new Dh(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 tH({pathname:e,routesById:t,processedTree:n}){const s={},i=Gs(e);let a,l;const f=xF(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 nH({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){return rH(n)(e,t,s??!1)}function rH(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:Ho(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 sH(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 oH="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=Gs(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=>HF({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 iH extends FN{constructor(t){super(t)}}const Md=typeof window<"u"?_.useLayoutEffect:_.useEffect;function hy(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function aH(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 cH(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function zb(e){const t=e.errorComponent??Lb;return h.jsx(lH,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?_.createElement(t,{error:n,reset:s}):e.children})}class lH extends _.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Lb({error:e}){const[t,n]=_.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:t?"Hide Error":"Show Error"})]}),h.jsx("div",{style:{height:".25rem"}}),t?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?h.jsx("code",{children:e.message}):null})}):null]})}function uH({children:e,fallback:t=null}){return HN()?h.jsx(Mc.Fragment,{children:e}):h.jsx(Mc.Fragment,{children:t})}function HN(){return Mc.useSyncExternalStore(fH,()=>!0,()=>!1)}function fH(){return()=>{}}var py={exports:{}},my={},gy={exports:{}},yy={};var ST;function dH(){if(ST)return yy;ST=1;var e=Hu();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 yy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,yy}var _T;function qN(){return _T||(_T=1,gy.exports=dH()),gy.exports}var wT;function hH(){if(wT)return my;wT=1;var e=Hu(),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 my.useSyncExternalStoreWithSelector=function(p,g,y,b,x){var S=a(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=f(function(){function C(z){if(!O){if(O=!0,N=z,z=b(z),x!==void 0&&w.hasValue){var j=w.value;if(x(j,z))return R=j}return R=z}if(j=R,s(N,z))return j;var A=b(z);return x!==void 0&&x(j,A)?(N=z,j):(N=z,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},my}var ET;function pH(){return ET||(ET=1,py.exports=hH()),py.exports}var VN=pH();function mH(e,t){return e===t}function gH(e,t,n=mH){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 vy=_.createContext(null);function GN(){return typeof document>"u"?vy:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=vy,vy)}function Yr(e){const t=_.useContext(GN());return e?.warn,t}function vr(e){const t=Yr({warn:e?.router===void 0}),n=e?.router||t,s=_.useRef(void 0);return gH(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 fp=_.createContext(void 0),yH=_.createContext(void 0);function xs(e){const t=_.useContext(e.from?yH:fp);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 Ub(e){return xs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function $b(e){const{select:t,...n}=e;return xs({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Bb(e){return xs({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Fb(e){return xs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function dp(e){const t=Yr();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var hi=pN();function vH(e,t){const n=Yr(),s=cH(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,onFocus:M,onMouseEnter:z,onMouseLeave:j,onTouchStart:A,ignoreBlocker:P,params:Q,search:B,hash:U,state:Z,mask:G,reloadDocument:ee,unsafeRelative:D,from:K,_fromLocation:q,...V}=e,L=HN(),I=vr({select:He=>{const me=He.matches[He.matches.length-1];return{search:me?.search,hash:He.location.hash,path:me?.pathname}},structuralSharing:!0}),H=e.from,W=_.useMemo(()=>({...e,from:H}),[n,I,H,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Y=_.useMemo(()=>n.buildLocation({...W}),[n,W]),ae=Y.maskedLocation?Y.maskedLocation.publicHref:Y.publicHref,se=Y.maskedLocation?Y.maskedLocation.external:Y.external,fe=_.useMemo(()=>EH(ae,se,n.history,C),[C,se,ae,n.history]),Se=_.useMemo(()=>{if(fe?.external)return Oh(fe.href,n.protocolAllowlist)?void 0:fe.href;if(!TH(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),Oh(f,n.protocolAllowlist)?void 0:f}catch{}},[f,fe,n.protocolAllowlist]),pe=vr({select:He=>{if(Se)return!1;if(l?.exact){if(!CF(He.location.pathname,Y.pathname,n.basepath))return!1}else{const me=Ih(He.location.pathname,n.basepath),Te=Ih(Y.pathname,n.basepath);if(!(me.startsWith(Te)&&(me.length===Te.length||me[Te.length]==="/")))return!1}return(l?.includeSearch??!0)&&!ra(He.location.search,Y.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?L&&He.location.hash===Y.hash:!0}}),Me=pe?Ho(i,{})??bH:by,_e=pe?by:Ho(a,{})??by,re=[N,Me.className,_e.className].filter(Boolean).join(" "),he=(O||Me.style||_e.style)&&{...O,...Me.style,..._e.style},[ie,we]=_.useState(!1),ye=_.useRef(!1),xe=e.reloadDocument||Se?!1:d??n.options.defaultPreload,ve=p??n.options.defaultPreloadDelay??0,Ie=_.useCallback(()=>{n.preloadRoute({...W,_builtLocation:Y}).catch(He=>{console.warn(He),console.warn(oH)})},[n,W,Y]),Ue=_.useCallback(He=>{He?.isIntersecting&&Ie()},[Ie]);aH(s,Ue,wH,{disabled:!!C||xe!=="viewport"}),_.useEffect(()=>{ye.current||!C&&xe==="render"&&(Ie(),ye.current=!0)},[C,Ie,xe]);const Ee=He=>{const me=He.currentTarget.getAttribute("target"),Te=T!==void 0?T:me;if(!C&&!CH(He)&&!He.defaultPrevented&&(!Te||Te==="_self")&&He.button===0){He.preventDefault(),hi.flushSync(()=>{we(!0)});const qe=n.subscribe("onResolved",()=>{qe(),we(!1)});n.navigate({...W,replace:y,resetScroll:x,hashScrollIntoView:g,startTransition:b,viewTransition:S,ignoreBlocker:P})}};if(Se)return{...V,ref:s,href:Se,...w&&{children:w},...T&&{target:T},...C&&{disabled:C},...O&&{style:O},...N&&{className:N},...R&&{onClick:R},...M&&{onFocus:M},...z&&{onMouseEnter:z},...j&&{onMouseLeave:j},...A&&{onTouchStart:A}};const Ve=He=>{C||xe&&Ie()},Qe=Ve,Be=He=>{if(!(C||!xe))if(!ve)Ie();else{const me=He.target;if(eu.has(me))return;const Te=setTimeout(()=>{eu.delete(me),Ie()},ve);eu.set(me,Te)}},We=He=>{if(C||!xe||!ve)return;const me=He.target,Te=eu.get(me);Te&&(clearTimeout(Te),eu.delete(me))};return{...V,...Me,..._e,href:fe?.href,ref:s,onClick:tu([R,Ee]),onFocus:tu([M,Ve]),onMouseEnter:tu([z,Be]),onMouseLeave:tu([j,We]),onTouchStart:tu([A,Qe]),disabled:!!C,target:T,...he&&{style:he},...re&&{className:re},...C&&xH,...pe&&SH,...L&&ie&&_H}}const by={},bH={className:"active"},xH={role:"link","aria-disabled":!0},SH={"data-status":"active","aria-current":"page"},_H={"data-transitioning":"transitioning"},eu=new WeakMap,wH={rootMargin:"100px"},tu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function EH(e,t,n,s){if(!s)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function TH(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const bc=_.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:i,...a}=vH(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 CH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let RH=class extends FN{constructor(t){super(t),this.useMatch=n=>xs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>xs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>$b({...n,from:this.id}),this.useLoaderData=n=>Ub({...n,from:this.id}),this.useNavigate=()=>dp({from:this.fullPath}),this.Link=Mc.forwardRef((n,s)=>h.jsx(bc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function co(e){return new RH(e)}class NH extends iH{constructor(t){super(t),this.useMatch=n=>xs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>xs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>$b({...n,from:this.id}),this.useLoaderData=n=>Ub({...n,from:this.id}),this.useNavigate=()=>dp({from:this.fullPath}),this.Link=Mc.forwardRef((n,s)=>h.jsx(bc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function jH(e){return new NH(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=>{this.silent;const i=co(s);return i.isRoot=!1,i},this.silent=n?.silent}}class RT{constructor(t){this.useMatch=n=>xs({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>xs({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>$b({...n,from:this.options.id}),this.useLoaderData=n=>Ub({...n,from:this.options.id}),this.useNavigate=()=>{const n=Yr();return dp({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 AH(){const e=Yr(),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=hy(a),f=a||n||i,d=hy(f),p=a||i,g=hy(p);return e.startTransition=y=>{s(!0),_.startTransition(()=>{y(),s(!1)})},_.useEffect(()=>{const y=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Gs(e.latestLocation.publicHref)!==Gs(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&&DF(e)}},[f,d,e]),null}function kH(e){const t=vr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return h.jsx(zb,{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 OH(){return h.jsx("p",{children:"Not Found"})}function lc(e){return h.jsx(h.Fragment,{children:e.children})}function KN(e,t,n){return t.options.notFoundComponent?h.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...n}):h.jsx(OH,{})}function MH(){return Yr().isScrollRestoring,null}const ZN=_.memo(function({matchId:t}){const n=Yr(),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:lc,b=f?zb:lc,x=p?kH:lc,S=i.isRoot?i.options.shellComponent??lc:lc;return h.jsxs(S,{children:[h.jsx(fp.Provider,{value:t,children:h.jsx(y,{fallback:l,children:h.jsx(b,{getResetKey:()=>s.resetKey,errorComponent:f||Lb,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(uH,{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(IH,{}),h.jsx(MH,{})]}):null]})});function IH(){const e=Yr(),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=Yr(),{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=Dc();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)),KN(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=Yr(),n=_.useContext(fp),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 KN(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 PH(){const e=Yr(),n=e.routesById[Lr].options.pendingComponent??e.options.defaultPendingComponent,s=n?h.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?lc:_.Suspense,a=h.jsxs(i,{fallback:s,children:[h.jsx(AH,{}),h.jsx(DH,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:a}):a}function DH(){const e=Yr(),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(fp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:h.jsx(zb,{getResetKey:()=>n,errorComponent:Lb,onCatch:i=>{i.message||i.toString()},children:s})})}const XN=e=>new zH(e);class zH extends WF{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=TT,globalThis.createLazyFileRoute=NT):typeof window<"u"&&(window.createFileRoute=TT,window.createLazyFileRoute=NT);function LH({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=GN(),i=h.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:i}):i}function UH({router:e,...t}){return h.jsx(LH,{router:e,...t,children:h.jsx(PH,{})})}const $H=/\{[^{}]+\}/g,BH=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function FH(){return Math.random().toString(36).slice(2,11)}function HH(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=BH()?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??VH,pathSerializer:z,body:j,middleware:A=[],...P}=x||{};let Q=t;S&&(Q=OT(S)??t);let B=typeof i=="function"?i:AT(i);R&&(B=typeof R=="function"?R:AT({...typeof i=="object"?i:{},...R}));const U=z||l||qH,Z=j===void 0?void 0:M(j,kT(f,C,O.header)),G=kT(Z===void 0||Z instanceof FormData?{}:{"Content-Type":"application/json"},f,C,O.header),ee=[...g,...A],D={redirect:"follow",...p,...P,body:Z,headers:G};let K,q,V=new T(GH(b,{baseUrl:Q,params:O,querySerializer:B,pathSerializer:U}),D),L;for(const W in P)W in V||(V[W]=P[W]);if(ee.length){K=FH(),q=Object.freeze({baseUrl:Q,fetch:w,parseAs:N,querySerializer:B,bodySerializer:M,pathSerializer:U});for(const W of ee)if(W&&typeof W=="object"&&typeof W.onRequest=="function"){const Y=await W.onRequest({request:V,schemaPath:b,params:O,options:q,id:K});if(Y)if(Y instanceof T)V=Y;else if(Y instanceof Response){L=Y;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!L){try{L=await w(V,d)}catch(W){let Y=W;if(ee.length)for(let ae=ee.length-1;ae>=0;ae--){const se=ee[ae];if(se&&typeof se=="object"&&typeof se.onError=="function"){const fe=await se.onError({request:V,error:Y,schemaPath:b,params:O,options:q,id:K});if(fe){if(fe instanceof Response){Y=void 0,L=fe;break}if(fe instanceof Error){Y=fe;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(Y)throw Y}if(ee.length)for(let W=ee.length-1;W>=0;W--){const Y=ee[W];if(Y&&typeof Y=="object"&&typeof Y.onResponse=="function"){const ae=await Y.onResponse({request:V,response:L,schemaPath:b,params:O,options:q,id:K});if(ae){if(!(ae instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");L=ae}}}}const I=L.headers.get("Content-Length");if(L.status===204||V.method==="HEAD"||I==="0"&&!L.headers.get("Transfer-Encoding")?.includes("chunked"))return L.ok?{data:void 0,response:L}:{error:void 0,response:L};if(L.ok)return{data:await(async()=>{if(N==="stream")return L.body;if(N==="json"&&!I){const Y=await L.text();return Y?JSON.parse(Y):void 0}return await L[N]()})(),response:L};let H=await L.text();try{H=JSON.parse(H)}catch{}return{error:H,response:L}}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 hp(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 QN(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(hp(f,t[l],n))}const a=s.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function WN(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(hp(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(WN(i,a,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof a=="object"){s.push(QN(i,a,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}s.push(hp(i,a,e))}}return s.join("&")}}function qH(e,t){let n=e;for(const s of e.match($H)??[]){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,WN(i,f,{style:l,explode:a}));continue}if(typeof f=="object"){n=n.replace(s,QN(i,f,{style:l,explode:a}));continue}if(l==="matrix"){n=n.replace(s,`;${hp(i,f)}`);continue}n=n.replace(s,l==="label"?`.${encodeURIComponent(f)}`:encodeURIComponent(f))}return n}function VH(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 GH(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 ZH(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 Gu(e){const{data:t,error:n}=await e;if(n||!t)throw new KH(ZH(n),n);return t}function YH(e){const t=HH({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 XH(e){return YH({baseUrl:e.serverUrl,getHeaders:()=>({Authorization:`Bearer ${e.token}`})})}async function QH(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 JN=_.createContext(null);function WH({children:e,defaultConfig:t=null}){const[n,s]=pi("sync-console-connection",null),[i,a]=_.useState({isConnected:!1,isConnecting:!1,error:null,client:null});_.useEffect(()=>{if(!(n?.serverUrl?.trim()&&n.token?.trim())&&t?.serverUrl?.trim()&&t.token?.trim()){s({serverUrl:t.serverUrl.trim(),token:t.token.trim()});return}},[s,n,t]);const l=_.useCallback(async(y,b)=>{const x=y??n;if(!x)return a(w=>({...w,error:"No connection configured"})),!1;const S={serverUrl:x.serverUrl?.trim()??"",token:x.token?.trim()??""};if(!S.serverUrl)return a(w=>({...w,error:"Server URL is required"})),!1;if(!S.token)return a(w=>({...w,error:"Token is required"})),!1;y&&(b?.persistOverride??!0)&&s(S),a(w=>({...w,isConnecting:!0,error:null}));try{const w=XH(S);return await QH(w),a({isConnected:!0,isConnecting:!1,client:w,error:null}),!0}catch(w){return a({isConnected:!1,isConnecting:!1,client:null,error:w instanceof Error?w.message:"Connection failed"}),!1}},[n,s]),f=_.useCallback(y=>{y?.clearSavedConfig&&s(null),a({isConnected:!1,isConnecting:!1,client:null,error:null})},[s]),d=_.useCallback(()=>{a(y=>({...y,error:null}))},[]),p=_.useCallback(y=>{s(y),a({isConnected:!1,isConnecting:!1,client:null,error:null})},[s]),g=_.useMemo(()=>({config:n,setConfig:p,isConnected:i.isConnected,isConnecting:i.isConnecting,error:i.error,client:i.client,connect:l,disconnect:f,clearError:d}),[n,p,i,l,f,d]);return h.jsx(JN.Provider,{value:g,children:e})}function Dt(){const e=_.useContext(JN);if(!e)throw new Error("useConnection must be used within a ConnectionProvider");return e}function Vt(){const{client:e}=Dt();return e}function ej(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=ej(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Hb(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ej(e))&&(s&&(s+=" "),s+=t);return s}var JH=e=>typeof e=="number"&&e!=+e,zh=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,MT=e=>(typeof e=="number"||e instanceof Number)&&!JH(e);function eq(){}var Lh=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:Lh},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 Lh}function i(f,d){s(f)===Lh&&(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===Lh){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 tj(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 nj(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=tj,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=nj(tj),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 Uh(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}var xy={},Sy={},_y={},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})(_y)),_y}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})(Sy)),Sy}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})(xy)),xy}var wy,UT;function bq(){return UT||(UT=1,wy=vq().throttle),wy}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++]))}},vs={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},rj=(e,t,n)=>{var{width:s=vs.width,height:i=vs.height,aspect:a,maxHeight:l}=n,f=zh(s)?e:Number(s),d=zh(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=zh(t),i=zh(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=vs.width,a=vs.height):i===void 0?i=s&&s>0?void 0:vs.width:a===void 0&&(a=s&&s>0?void 0:vs.height),{width:i,height:a}}function Ev(){return Ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ev.apply(null,arguments)}function 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 sj=_.createContext(vs.initialDimension);function kq(e){return Uh(e.width)&&Uh(e.height)}function oj(e){var{children:t,width:n,height:s}=e,i=_.useMemo(()=>({width:n,height:s}),[n,s]);return kq(i)?_.createElement(sj.Provider,{value:i},t):null}var Oq=()=>_.useContext(sj),Mq=_.forwardRef((e,t)=>{var{aspect:n,initialDimension:s=vs.initialDimension,width:i,height:a,minWidth:l=vs.minWidth,minHeight:f,maxHeight:d,children:p,debounce:g=vs.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(Q=>{var B=Math.round(A),U=Math.round(P);return Q.containerWidth===B&&Q.containerHeight===U?Q:{containerWidth:B,containerHeight:U}})},[]);_.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return eq;var A=U=>{var Z,G=U[0];if(G!=null){var{width:ee,height:D}=G.contentRect;N(ee,D),(Z=T.current)===null||Z===void 0||Z.call(T,ee,D)}};g>0&&(A=Sq(A,g,{trailing:!0,leading:!1}));var P=new ResizeObserver(A),{width:Q,height:B}=w.current.getBoundingClientRect();return N(Q,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:z,calculatedHeight:j}=rj(R,M,{width:i,height:a,aspect:n,maxHeight:d});return $T(z!=null&&z>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.`,z,j,i,a,l,f,n),_.createElement("div",{id:y?"".concat(y):void 0,className:Hb("recharts-responsive-container",b),style:FT(FT({},S),{},{width:i,height:a,minWidth:l,minHeight:f,maxHeight:d}),ref:w},_.createElement("div",{style:Tq({width:i,height:a})},_.createElement(oj,{width:z,height:j},p)))}),Mq=_.forwardRef((e,t)=>{var n=kq();if(Uh(n.width)&&Uh(n.height))return e.children;var{width:s,height:i}=Cq({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=rj(void 0,void 0,{width:s,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return MT(a)&&MT(l)?_.createElement(oj,{width:a,height:l},e.children):_.createElement(Oq,Ev({},e,{width:s,height:i,ref:t}))});const Iq=(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},Pq=(e,t)=>({classGroupId:e,validator:t}),ij=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),$h="-",HT=[],Dq="arbitrary..",zq=e=>{const t=Uq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Lq(l);const f=l.split($h),d=f[0]===""&&f.length>1?1:0;return aj(f,d,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const d=s[l],p=n[l];return d?p?Iq(p,d):d:p||HT}return n[l]||HT}}},aj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const p=aj(e,t+1,a);if(p)return p}const l=n.validators;if(l===null)return;const f=t===0?e.join($h):e.slice(t).join($h),d=l.length;for(let p=0;p<d;p++){const g=l[p];if(g.validator(f))return g.classGroupId}},Lq=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?Dq+s:void 0})(),Uq=e=>{const{theme:t,classGroups:n}=e;return $q(n,t)},$q=(e,t)=>{const n=ij();for(const s in e){const i=e[s];qb(i,n,s,t)}return n},qb=(e,t,n,s)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];Bq(l,t,n,s)}},Bq=(e,t,n,s)=>{if(typeof e=="string"){Fq(e,t,n);return}if(typeof e=="function"){Hq(e,t,n,s);return}qq(e,t,n,s)},Fq=(e,t,n)=>{const s=e===""?t:cj(t,e);s.classGroupId=n},Hq=(e,t,n,s)=>{if(Vq(e)){qb(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(Pq(n,e))},qq=(e,t,n,s)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[f,d]=i[l];qb(d,cj(t,f),n,s)}},cj=(e,t)=>{let n=e;const s=t.split($h),i=s.length;for(let a=0;a<i;a++){const l=s[a];let f=n.nextPart.get(l);f||(f=ij(),n.nextPart.set(l,f)),n=f}return n},Vq=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Kq=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)}}},Tv="!",qT=":",Gq=[],VT=(e,t,n,s,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),Zq=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(Tv)?(b=y.slice(0,-1),x=!0):y.startsWith(Tv)&&(b=y.slice(1),x=!0);const S=p&&p>d?p-d:void 0;return VT(a,x,b,S)};if(t){const i=t+qT,a=s;s=l=>l.startsWith(i)?a(l.slice(i.length)):VT(Gq,!1,l,void 0,!0)}if(n){const i=s;s=a=>n({className:a,parseClassName:i})}return s},Yq=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}},Xq=e=>({cache:Kq(e.cacheSize),parseClassName:Zq(e),sortModifiers:Yq(e),...zq(e)}),Qq=/\s+/,Wq=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],f=e.trim().split(Qq);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+Tv:O,R=N+C;if(l.indexOf(R)>-1)continue;l.push(R);const M=i(C,T);for(let z=0;z<M.length;++z){const j=M[z];l.push(N+j)}d=g+(d.length>0?" "+d:d)}return d},Jq=(...e)=>{let t=0,n,s,i="";for(;t<e.length;)(n=e[t++])&&(s=lj(n))&&(i&&(i+=" "),i+=s);return i},lj=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=lj(e[s]))&&(n&&(n+=" "),n+=t);return n},e9=(e,...t)=>{let n,s,i,a;const l=d=>{const p=t.reduce((g,y)=>y(g),e());return n=Xq(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=Wq(d,n);return i(d,g),g};return a=l,(...d)=>a(Jq(...d))},t9=[],dn=e=>{const t=n=>n[e]||t9;return t.isThemeGetter=!0,t},uj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,n9=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,r9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,s9=/\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$/,o9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,i9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Uo=e=>n9.test(e),Xe=e=>!!e&&!Number.isNaN(Number(e)),$o=e=>!!e&&Number.isInteger(Number(e)),Ey=e=>e.endsWith("%")&&Xe(e.slice(0,-1)),Fs=e=>r9.test(e),dj=()=>!0,c9=e=>s9.test(e)&&!o9.test(e),Vb=()=>!1,l9=e=>i9.test(e),u9=e=>a9.test(e),f9=e=>!je(e)&&!Ae(e),d9=e=>mi(e,mj,Vb),je=e=>uj.test(e),qi=e=>mi(e,gj,c9),KT=e=>mi(e,x9,Xe),h9=e=>mi(e,vj,dj),p9=e=>mi(e,yj,Vb),GT=e=>mi(e,hj,Vb),m9=e=>mi(e,pj,u9),Pd=e=>mi(e,bj,l9),Ae=e=>fj.test(e),nu=e=>va(e,gj),g9=e=>va(e,yj),ZT=e=>va(e,hj),y9=e=>va(e,mj),v9=e=>va(e,pj),Dd=e=>va(e,bj,!0),b9=e=>va(e,vj,!0),mi=(e,t,n)=>{const s=uj.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},va=(e,t,n=!1)=>{const s=fj.exec(e);return s?s[1]?t(s[1]):n:!1},hj=e=>e==="position"||e==="percentage",pj=e=>e==="image"||e==="url",mj=e=>e==="length"||e==="size"||e==="bg-size",gj=e=>e==="length",x9=e=>e==="number",yj=e=>e==="family-name",vj=e=>e==="number"||e==="weight",bj=e=>e==="shadow",S9=()=>{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(),Ae,je],z=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],A=()=>[Ae,je,d],P=()=>[Uo,"full","auto",...A()],Q=()=>[$o,"none","subgrid",Ae,je],B=()=>["auto",{span:["full",$o,Ae,je]},$o,Ae,je],U=()=>[$o,"auto",Ae,je],Z=()=>["auto","min","max","fr",Ae,je],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...A()],G=()=>[Uo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],q=()=>[Uo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],V=()=>[Uo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],L=()=>[e,Ae,je],I=()=>[...R(),ZT,GT,{position:[Ae,je]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",y9,d9,{size:[Ae,je]}],Y=()=>[Ey,nu,qi],ae=()=>["","none","full",p,Ae,je],se=()=>["",Xe,nu,qi],fe=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[Xe,Ey,ZT,GT],Me=()=>["","none",S,Ae,je],_e=()=>["none",Xe,Ae,je],re=()=>["none",Xe,Ae,je],he=()=>[Xe,Ae,je],ie=()=>[Uo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fs],breakpoint:[Fs],color:[dj],container:[Fs],"drop-shadow":[Fs],ease:["in","out","in-out"],font:[f9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fs],shadow:[Fs],spacing:["px",Xe],text:[Fs],"text-shadow":[Fs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Uo,je,Ae,T]}],container:["container"],columns:[{columns:[Xe,je,Ae,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:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset: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:[$o,"auto",Ae,je]}],basis:[{basis:[Uo,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,Uo,"auto","initial","none",je]}],grow:[{grow:["",Xe,Ae,je]}],shrink:[{shrink:["",Xe,Ae,je]}],order:[{order:[$o,"first","last","none",Ae,je]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"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:G()}],"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",...G()]}],"min-w":[{"min-w":[f,"screen","none",...G()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,nu,qi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,b9,h9]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ey,je]}],"font-family":[{font:[g9,p9,t]}],"font-features":[{"font-features":[je]}],"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,Ae,je]}],"line-clamp":[{"line-clamp":[Xe,"none",Ae,KT]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",Ae,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",Ae,qi]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Xe,"auto",Ae,je]}],"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",Ae,je]}],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",Ae,je]}],"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"]},$o,Ae,je],radial:["",Ae,je],conic:[$o,Ae,je]},v9,m9]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"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:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,Ae,je]}],"outline-w":[{outline:["",Xe,nu,qi]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",g,Dd,Pd]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",y,Dd,Pd]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Xe,qi]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",b,Dd,Pd]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Xe,Ae,je]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[Ae,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"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",Ae,je]}],filter:[{filter:["","none",Ae,je]}],blur:[{blur:Me()}],brightness:[{brightness:[Xe,Ae,je]}],contrast:[{contrast:[Xe,Ae,je]}],"drop-shadow":[{"drop-shadow":["","none",x,Dd,Pd]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Xe,Ae,je]}],"hue-rotate":[{"hue-rotate":[Xe,Ae,je]}],invert:[{invert:["",Xe,Ae,je]}],saturate:[{saturate:[Xe,Ae,je]}],sepia:[{sepia:["",Xe,Ae,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,je]}],"backdrop-blur":[{"backdrop-blur":Me()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,Ae,je]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,Ae,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,Ae,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,Ae,je]}],"backdrop-invert":[{"backdrop-invert":["",Xe,Ae,je]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,Ae,je]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,Ae,je]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,Ae,je]}],"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",Ae,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",Ae,je]}],ease:[{ease:["linear","initial",C,Ae,je]}],delay:[{delay:[Xe,Ae,je]}],animate:[{animate:["none",O,Ae,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ae,je]}],"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:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[Ae,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",Ae,je]}],"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",Ae,je]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Xe,nu,qi,KT]}],stroke:[{stroke:["none",...L()]}],"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"]}},_9=e9(S9);function ge(...e){return _9(Hb(e))}const w9={light:"",dark:".dark"},xj=_.createContext(null);function E9(){const e=_.useContext(xj);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const T9=_.forwardRef(({id:e,className:t,children:n,config:s,...i},a)=>{const l=_.useId(),f=`chart-${e||l.replace(/:/g,"")}`;return h.jsx(xj.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(C9,{config:s,id:f}),h.jsx(Mq,{initialDimension:{width:1,height:1},children:n})]})})});T9.displayName="ChartContainer";function C9({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(w9).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.`,z,j,i,a,l,f,n),_.createElement("div",{id:y?"".concat(y):void 0,className:Hb("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(oj,{width:z,height:j},p)))}),Iq=_.forwardRef((e,t)=>{var n=Oq();if(Uh(n.width)&&Uh(n.height))return e.children;var{width:s,height:i}=Rq({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=rj(void 0,void 0,{width:s,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return MT(a)&&MT(l)?_.createElement(oj,{width:a,height:l},e.children):_.createElement(Mq,Ev({},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}),ij=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),$h="-",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($h),d=f[0]===""&&f.length>1?1:0;return aj(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}}},aj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const p=aj(e,t+1,a);if(p)return p}const l=n.validators;if(l===null)return;const f=t===0?e.join($h):e.slice(t).join($h),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=ij();for(const s in e){const i=e[s];qb(i,n,s,t)}return n},qb=(e,t,n,s)=>{const i=e.length;for(let a=0;a<i;a++){const 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:cj(t,e);s.classGroupId=n},qq=(e,t,n,s)=>{if(Gq(e)){qb(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];qb(d,cj(t,f),n,s)}},cj=(e,t)=>{let n=e;const s=t.split($h),i=s.length;for(let a=0;a<i;a++){const l=s[a];let f=n.nextPart.get(l);f||(f=ij(),n.nextPart.set(l,f)),n=f}return n},Gq=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Kq=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)}}},Tv="!",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(Tv)?(b=y.slice(0,-1),x=!0):y.startsWith(Tv)&&(b=y.slice(1),x=!0);const S=p&&p>d?p-d:void 0;return 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:Kq(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+Tv:O,R=N+C;if(l.indexOf(R)>-1)continue;l.push(R);const M=i(C,T);for(let z=0;z<M.length;++z){const j=M[z];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=lj(n))&&(i&&(i+=" "),i+=s);return i},lj=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=lj(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},uj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fj=/^\((?:(\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)\(.+\)$/,Uo=e=>r9.test(e),Xe=e=>!!e&&!Number.isNaN(Number(e)),$o=e=>!!e&&Number.isInteger(Number(e)),Ey=e=>e.endsWith("%")&&Xe(e.slice(0,-1)),Fs=e=>s9.test(e),dj=()=>!0,l9=e=>o9.test(e)&&!i9.test(e),Vb=()=>!1,u9=e=>a9.test(e),f9=e=>c9.test(e),d9=e=>!je(e)&&!Ae(e),h9=e=>mi(e,mj,Vb),je=e=>uj.test(e),qi=e=>mi(e,gj,l9),GT=e=>mi(e,S9,Xe),p9=e=>mi(e,vj,dj),m9=e=>mi(e,yj,Vb),KT=e=>mi(e,hj,Vb),g9=e=>mi(e,pj,f9),Pd=e=>mi(e,bj,u9),Ae=e=>fj.test(e),nu=e=>va(e,gj),y9=e=>va(e,yj),ZT=e=>va(e,hj),v9=e=>va(e,mj),b9=e=>va(e,pj),Dd=e=>va(e,bj,!0),x9=e=>va(e,vj,!0),mi=(e,t,n)=>{const s=uj.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},va=(e,t,n=!1)=>{const s=fj.exec(e);return s?s[1]?t(s[1]):n:!1},hj=e=>e==="position"||e==="percentage",pj=e=>e==="image"||e==="url",mj=e=>e==="length"||e==="size"||e==="bg-size",gj=e=>e==="length",S9=e=>e==="number",yj=e=>e==="family-name",vj=e=>e==="number"||e==="weight",bj=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(),Ae,je],z=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],A=()=>[Ae,je,d],P=()=>[Uo,"full","auto",...A()],Q=()=>[$o,"none","subgrid",Ae,je],B=()=>["auto",{span:["full",$o,Ae,je]},$o,Ae,je],U=()=>[$o,"auto",Ae,je],Z=()=>["auto","min","max","fr",Ae,je],G=()=>["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=()=>[Uo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],q=()=>[Uo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],V=()=>[Uo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],L=()=>[e,Ae,je],I=()=>[...R(),ZT,KT,{position:[Ae,je]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",v9,h9,{size:[Ae,je]}],Y=()=>[Ey,nu,qi],ae=()=>["","none","full",p,Ae,je],se=()=>["",Xe,nu,qi],fe=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[Xe,Ey,ZT,KT],Me=()=>["","none",S,Ae,je],_e=()=>["none",Xe,Ae,je],re=()=>["none",Xe,Ae,je],he=()=>[Xe,Ae,je],ie=()=>[Uo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fs],breakpoint:[Fs],color:[dj],container:[Fs],"drop-shadow":[Fs],ease:["in","out","in-out"],font:[d9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fs],shadow:[Fs],spacing:["px",Xe],text:[Fs],"text-shadow":[Fs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Uo,je,Ae,T]}],container:["container"],columns:[{columns:[Xe,je,Ae,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:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset: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:[$o,"auto",Ae,je]}],basis:[{basis:[Uo,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,Uo,"auto","initial","none",je]}],grow:[{grow:["",Xe,Ae,je]}],shrink:[{shrink:["",Xe,Ae,je]}],order:[{order:[$o,"first","last","none",Ae,je]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"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,nu,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",Ey,je]}],"font-family":[{font:[y9,m9,t]}],"font-features":[{"font-features":[je]}],"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,Ae,je]}],"line-clamp":[{"line-clamp":[Xe,"none",Ae,GT]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",Ae,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",Ae,qi]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Xe,"auto",Ae,je]}],"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",Ae,je]}],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",Ae,je]}],"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"]},$o,Ae,je],radial:["",Ae,je],conic:[$o,Ae,je]},b9,g9]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"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:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,Ae,je]}],"outline-w":[{outline:["",Xe,nu,qi]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",g,Dd,Pd]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",y,Dd,Pd]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Xe,qi]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",b,Dd,Pd]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Xe,Ae,je]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[Ae,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"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",Ae,je]}],filter:[{filter:["","none",Ae,je]}],blur:[{blur:Me()}],brightness:[{brightness:[Xe,Ae,je]}],contrast:[{contrast:[Xe,Ae,je]}],"drop-shadow":[{"drop-shadow":["","none",x,Dd,Pd]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Xe,Ae,je]}],"hue-rotate":[{"hue-rotate":[Xe,Ae,je]}],invert:[{invert:["",Xe,Ae,je]}],saturate:[{saturate:[Xe,Ae,je]}],sepia:[{sepia:["",Xe,Ae,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,je]}],"backdrop-blur":[{"backdrop-blur":Me()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,Ae,je]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,Ae,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,Ae,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,Ae,je]}],"backdrop-invert":[{"backdrop-invert":["",Xe,Ae,je]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,Ae,je]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,Ae,je]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,Ae,je]}],"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",Ae,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",Ae,je]}],ease:[{ease:["linear","initial",C,Ae,je]}],delay:[{delay:[Xe,Ae,je]}],animate:[{animate:["none",O,Ae,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ae,je]}],"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:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[Ae,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",Ae,je]}],"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",Ae,je]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Xe,nu,qi,GT]}],stroke:[{stroke:["none",...L()]}],"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(Hb(e))}const E9={light:"",dark:".dark"},xj=_.createContext(null);function T9(){const e=_.useContext(xj);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(xj.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(`
71
71
  `);return`${i} [data-chart='${t}'] {
72
72
  ${a}
73
73
  }`}).join(`
74
- `)}})}const R9=_.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}=E9(),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)})})]})});R9.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 N9=["1h","6h","24h","7d"],Sj=_.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:N9.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})]})]}));Sj.displayName="ActivityBars";const XT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,QT=Hb,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)},j9=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(j9({variant:t,className:e})),...n}));Gn.displayName="Input";function pp({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 Ty=I1[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],A9=Ty&&Ty!==_.useLayoutEffect?Ty:e=>e();function ke(e){const t=zn(k9).current;return t.next=e,A9(t.effect),t.trampoline}function k9(){const e={next:void 0,callback:O9,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function O9(){}function so(e,t,n,s){const i=zn(_j).current;return I9(i,e,t,n,s)&&wj(i,[e,t,n,s]),i.callback}function M9(e){const t=zn(_j).current;return P9(t,e)&&wj(t,e),t.callback}function _j(){return{callback:null,cleanup:null,refs:[]}}function I9(e,t,n,s,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==i}function P9(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function wj(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 D9=()=>{},Le=typeof document<"u"?_.useLayoutEffect:D9,Ej={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},mp={...Ej,position:"fixed",top:0,left:0},Tj={...Ej,position:"absolute"};function jn(){}const Eu=Object.freeze([]),an=Object.freeze({});function gn(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 z9=parseInt(_.version,10);function Kb(e){return z9>=e}function JT(e){if(!_.isValidElement(e))return null;const t=e,n=t.props;return(Kb(19)?n?.ref:t.ref)??null}function Cv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function L9(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 U9(e,t){return typeof e=="function"?e(t):e}function $9(e,t){return typeof e=="function"?e(t):e}const uu={};function oi(e,t,n,s,i){let a={...Rv(e,uu)};return t&&(a=iu(a,t)),n&&(a=iu(a,n)),s&&(a=iu(a,s)),i&&(a=iu(a,i)),a}function B9(e){if(e.length===0)return uu;if(e.length===1)return Rv(e[0],uu);let t={...Rv(e[0],uu)};for(let n=1;n<e.length;n+=1)t=iu(t,e[n]);return t}function iu(e,t){return Cj(t)?t(e):F9(e,t)}function F9(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=Cv(e.style,s);break}case"className":{e[n]=Rj(e.className,s);break}default:H9(n,s)?e[n]=q9(e[n],s):e[n]=s}}return e}function H9(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 Cj(e){return typeof e=="function"}function Rv(e,t){return Cj(e)?e(t):e??uu}function q9(e,t){return t?e?n=>{if(V9(n)){const i=n;Nv(i);const a=t(i);return i.baseUIHandlerPrevented||e?.(i),a}const s=t(n);return e?.(n),s}:t:e}function Nv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Rj(e,t){return t?e?t+" "+e:t:e}function V9(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const K9={style:{transition:"none"}},G9="data-base-ui-click-trigger",Z9={fallbackAxisSide:"none"},Y9={fallbackAxisSide:"end"},X9={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function zt(e,t,n={}){const s=t.render,i=Q9(t,n);if(n.enabled===!1)return null;const a=n.state??an;return J9(e,s,i,a)}function Q9(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?U9(n,a):void 0,y=p?$9(s,a):void 0,b=p?L9(a,d):an,x=p?Cv(b,Array.isArray(f)?B9(f):f)??an:an;return typeof document<"u"&&(p?Array.isArray(l)?x.ref=M9([x.ref,JT(i),...l]):x.ref=so(x.ref,JT(i),l):so(null,null)),p?(g!==void 0&&(x.className=Rj(x.className,g)),y!==void 0&&(x.style=Cv(x.style,y)),x):an}const W9=Symbol.for("react.lazy");function J9(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===W9&&(a=_.Children.toArray(t)[0]),_.cloneElement(a,i)}if(e&&typeof e=="string")return e8(e,n);throw new Error(gn(8))}function e8(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 t8={...I1};let eC=0;function n8(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=t8.useId;function Gu(e,t){if(tC!==void 0){const n=tC();return e??(t?`${t}-${n}`:n)}return n8(e,t)}function br(e){return Gu(e,"base-ui")}function gp(){return typeof window<"u"}function yi(e){return Gb(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ss(e){var t;return(t=(Gb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Gb(e){return gp()?e instanceof Node||e instanceof un(e).Node:!1}function jt(e){return gp()?e instanceof Element||e instanceof un(e).Element:!1}function Zt(e){return gp()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function jv(e){return!gp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}const r8=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)&&!r8.has(i)}const s8=new Set(["table","td","th"]);function o8(e){return s8.has(yi(e))}const i8=[":popover-open",":modal"];function yp(e){return i8.some(t=>{try{return e.matches(t)}catch{return!1}})}const a8=["transform","translate","scale","rotate","perspective"],c8=["transform","translate","scale","rotate","perspective","filter"],l8=["paint","layout","strict","content"];function Zb(e){const t=vp(),n=jt(e)?xr(e):e;return a8.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)||c8.some(s=>(n.willChange||"").includes(s))||l8.some(s=>(n.contain||"").includes(s))}function u8(e){let t=oo(e);for(;Zt(t)&&!Ys(t);){if(Zb(t))return t;if(yp(t))return null;t=oo(t)}return null}function vp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const f8=new Set(["html","body","#document"]);function Ys(e){return f8.has(yi(e))}function xr(e){return un(e).getComputedStyle(e)}function bp(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||jv(e)&&e.host||Ss(e);return jv(t)?t.host:t}function Nj(e){const t=oo(e);return Ys(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zt(t)&&vi(t)?t:Nj(t)}function Wo(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Nj(e),a=i===((s=e.ownerDocument)==null?void 0:s.body),l=un(i);if(a){const f=Av(l);return t.concat(l,l.visualViewport||[],vi(i)?i:[],f&&n?Wo(f):[])}return t.concat(i,Wo(i,[],n))}function Av(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const jj=_.createContext(void 0);function Aj(e=!1){const t=_.useContext(jj);if(t===void 0&&!e)throw new Error(gn(16));return t}function d8(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 Jc(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=e,a=_.useRef(null),l=Aj(!0)!==void 0,f=ke(()=>{const b=a.current;return!!(b?.tagName==="A"&&b?.href)}),{props:d}=d8({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:s,isNativeButton:i}),p=_.useCallback(()=>{const b=a.current;h8(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||(Nv(R),T?.(R)),R.baseUIHandlerPrevented)return;const M=R.target===R.currentTarget&&!i&&!f()&&!t,z=R.key==="Enter",j=R.key===" ";M&&((j||z)&&R.preventDefault(),z&&x?.(R))},onKeyUp(R){t||(Nv(R),w?.(R)),!R.baseUIHandlerPrevented&&R.target===R.currentTarget&&!i&&!t&&R.key===" "&&x?.(R)},onPointerDown(R){if(t){R.preventDefault();return}C?.(R)}},i?void 0:{role:"button"},d,O)},[t,d,i,f]),y=ke(b=>{a.current=b,p()});return{getButtonProps:g,buttonRef:y}}function h8(e){return Zt(e)&&e.tagName==="BUTTON"}const kj=_.createContext(void 0);function p8(){const e=_.useContext(kj);if(e===void 0)throw new Error(gn(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 xp={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 Oj={...bi,checked(e){return e?{[rC.checked]:""}:{[rC.unchecked]:""}}};function kv(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const m8=_.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:jn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function el(){return _.useContext(m8)}const Mj=_.createContext({invalid:void 0,name:void 0,validityData:{state:xp,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(Mj);if(t.setValidityData===jn&&!e)throw new Error(gn(28));return t}function Ij(e){const{enabled:t=!0,value:n,id:s,name:i,controlRef:a,commit:l}=e,{formRef:f}=el(),{invalid:d,markedDirtyRef:p,validityData:g,setValidityData:y}=xi(),b=ke(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:kv(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 Pj=_.createContext({controlId:void 0,registerControlId:jn,labelId:void 0,setLabelId:jn,messageIds:[],setMessageIds:jn,getDescriptionProps:e=>e});function lo(){return _.useContext(Pj)}function Dj(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:i,registerControlId:a}=lo(),l=br(t),f=n?i:void 0,d=zn(()=>Symbol("labelable-control")),p=_.useRef(!1),g=_.useRef(t!=null),y=ke(()=>{!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",Ov="trigger-hover",zj="outside-press",Cy="item-press",Lj="focus-out",g8="escape-key",y8="cancel-open",v8="imperative-action",b8="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 Uj(e,t){const n=_.useRef(e),s=ke(t);Le(()=>{n.current!==e&&s(n.current)},[e,s]),Le(()=>{n.current=e},[e])}const x8=_.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}=el(),{state:N,setTouched:R,setDirty:M,validityData:z,setFilled:j,setFocused:A,shouldValidateOnChange:P,validationMode:Q,disabled:B,name:U,validation:Z}=xi(),{labelId:K}=lo(),ee=B||x,D=U??d,G=ke(g),q=_.useRef(null),V=so(q,f,Z.inputRef),L=_.useRef(null),I=br(),H=Dj({id:l,implicit:!1,controlRef:L}),W=p?void 0:H,[Y,ae]=pp({controlled:s,default:!!a,name:"Switch",state:"checked"});Ij({id:I,commit:Z.commit,value:Y,controlRef:L,name:D,getValue:()=>Y}),Le(()=>{q.current&&j(q.current.checked)},[q,j]),Uj(Y,()=>{O(D),M(Y!==z.initialValue),j(Y),P()?Z.commit(Y):Z.commit(Y,!0)});const{getButtonProps:se,buttonRef:fe}=Jc({disabled:ee,native:p}),Se={id:p?H:I,role:"switch","aria-checked":Y,"aria-readonly":y||void 0,"aria-required":b||void 0,"aria-labelledby":K,onFocus(){ee||A(!0)},onBlur(){const re=q.current;!re||ee||(R(!0),A(!1),Q==="onBlur"&&Z.commit(re.checked))},onClick(re){y||ee||(re.preventDefault(),q.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:re.shiftKey,ctrlKey:re.ctrlKey,altKey:re.altKey,metaKey:re.metaKey})))}},pe=_.useMemo(()=>oi({checked:Y,disabled:ee,id:W,name:D,required:b,style:D?Tj:mp,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(re){if(re.nativeEvent.defaultPrevented)return;const he=re.target.checked,ie=Yt(ii,re.nativeEvent);G?.(he,ie),!ie.isCanceled&&ae(he)},onFocus(){L.current?.focus()}},Z.getInputValidationProps,T!==void 0?{value:T}:an),[Y,ee,V,W,D,G,b,ae,Z,T]),Me=_.useMemo(()=>({...N,checked:Y,disabled:ee,readOnly:y,required:b}),[N,Y,ee,y,b]),_e=zt("span",t,{state:Me,ref:[n,L,fe],props:[Se,Z.getValidationProps,C,se],stateAttributesMapping:Oj});return h.jsxs(kj.Provider,{value:Me,children:[_e,!Y&&D&&w!==void 0&&h.jsx("input",{type:"hidden",name:D,value:w}),h.jsx("input",{...pe})]})}),S8=_.forwardRef(function(t,n){const{render:s,className:i,...a}=t,{state:l}=xi(),f=p8(),d={...l,...f};return zt("span",t,{state:d,ref:n,stateAttributesMapping:Oj,props:a})}),Sp=_.forwardRef(({className:e,...t},n)=>h.jsx(x8,{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(S8,{className:"block w-[14px] h-[14px] bg-white rounded-full transition-transform data-[checked]:translate-x-4 absolute top-0.5 left-0.5"})}));Sp.displayName="Switch";const $j=_.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(Sp,{checked:t,onCheckedChange:d=>n?.(d)})]}),h.jsxs("div",{className:"p-4 space-y-3",children:[h.jsx(Ry,{label:"P90 latency threshold",value:s.p90Latency,onChange:d=>f("p90Latency",d)}),h.jsx(Ry,{label:"Error rate threshold",value:s.errorRate,onChange:d=>f("errorRate",d)}),h.jsx(Ry,{label:"Client lag threshold",value:s.clientLag,onChange:d=>f("clientLag",d)})]})]})});$j.displayName="AlertsConfig";function Ry({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 _8=gi("inline-flex items-center gap-1 px-2 py-0.5 rounded-sm font-mono text-[9px] 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"}}),xn=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("span",{ref:s,className:ge(_8({variant:t,className:e})),...n}));xn.displayName="Badge";const w8=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"}}),Ce=_.forwardRef(({className:e,variant:t,size:n,...s},i)=>h.jsx("button",{ref:i,className:ge(w8({variant:t,size:n,className:e})),...s}));Ce.displayName="Button";const E8={relay:"relay",admin:"flow",proxy:"ghost"},T8=_.forwardRef(({className:e,keys:t,onCreateKey:n,onRotateKey:s,onRevokeKey:i,...a},l)=>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:"API Keys"}),n&&h.jsx(Ce,{variant:"primary",size:"sm",onClick:n,children:"+ Create Key"})]}),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:"w-[140px]",children:"Name"}),h.jsx("span",{className:"w-[70px]",children:"Type"}),h.jsx("span",{className:"flex-1",children:"Prefix"}),h.jsx("span",{className:"w-[90px]",children:"Created"}),h.jsx("span",{className:"w-[80px] text-right",children:"Actions"})]}),t.map((f,d)=>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",d<t.length-1&&"border-b border-[#141414]"),children:[h.jsx("span",{className:"w-[140px] text-white truncate",children:f.name}),h.jsx("span",{className:"w-[70px]",children:h.jsx(xn,{variant:E8[f.type]??"ghost",children:f.type})}),h.jsx("span",{className:"flex-1 text-neutral-500 truncate",children:f.prefix}),h.jsx("span",{className:"w-[90px] text-neutral-600 truncate",children:f.created}),h.jsxs("span",{className:"w-[80px] flex gap-2 justify-end",children:[s&&h.jsx(Ce,{variant:"default",size:"sm",className:"text-[9px] px-1.5 py-0.5",onClick:()=>s(f.name),children:"Rotate"}),i&&h.jsx(Ce,{variant:"destructive",size:"sm",className:"text-[9px] px-1.5 py-0.5",onClick:()=>i(f.name),children:"Revoke"})]})]},`${f.name}:${f.prefix}:${d}`))]}));T8.displayName="ApiKeysTable";const Bj=_.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})]})]}));Bj.displayName="BottomBar";const Fj=_.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))]}));Fj.displayName="CommitTable";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(xn,{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(Ce,{variant:"primary",size:"md",onClick:d,disabled:n,children:n?"Connecting...":"Save + Connect"}),h.jsx(Ce,{variant:"default",size:"md",onClick:g,disabled:n||s,children:s?"Testing...":"Test Connection"}),h.jsx(Ce,{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(xn,{variant:"healthy",className:e,children:"Connected"});case"disconnected":return h.jsx(xn,{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(xn,{variant:"ghost",className:e,children:"Not configured"})}}const Yb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...t}));Yb.displayName="Card";const 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 Xb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("p-4",e),...t}));Xb.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 Qb({action:e,className:t,icon:n,message:s}){return h.jsxs("div",{className:ge("flex flex-col items-center justify-center gap-3 py-12",t),children:[n?h.jsx("div",{className:"text-neutral-500",children:n}):null,h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:s}),e?h.jsx("div",{children:e}):null]})}const 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(xn,{variant:M8[t.status],children:t.status}),h.jsx(xn,{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(Ny,{label:"Actor",value:t.actor}),h.jsx(Ny,{label:"Dialect",value:t.dialect}),h.jsx(Ny,{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(xn,{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 Ny({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 Zu=_.forwardRef(({className:e,...t},n)=>h.jsx("table",{ref:n,className:ge("w-full",e),...t}));Zu.displayName="Table";const Yu=_.forwardRef(({className:e,...t},n)=>h.jsx("thead",{ref:n,className:ge(e),...t}));Yu.displayName="TableHeader";const Xu=_.forwardRef(({className:e,...t},n)=>h.jsx("tbody",{ref:n,className:ge(e),...t}));Xu.displayName="TableBody";const io=_.forwardRef(({className:e,...t},n)=>h.jsx("tr",{ref:n,className: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 cursor-default",e),...t}));io.displayName="TableRow";const yt=_.forwardRef(({className:e,...t},n)=>h.jsx("th",{ref:n,className:ge("font-mono text-[9px] text-neutral-600 uppercase tracking-wider leading-6 bg-white/[0.01] text-left",e),...t}));yt.displayName="TableHead";const vt=_.forwardRef(({className:e,...t},n)=>h.jsx("td",{ref:n,className:ge("whitespace-nowrap overflow-hidden text-ellipsis",e),...t}));vt.displayName="TableCell";function D8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const z8={online:"healthy",syncing:"syncing",offline:"offline"},Vj=_.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(Zu,{children:[h.jsx(Yu,{children:h.jsxs(io,{children:[h.jsx(yt,{children:"Client"}),h.jsx(yt,{children:"Status"}),h.jsx(yt,{children:"Type"}),h.jsx(yt,{children:"Cursor"}),h.jsx(yt,{children:"Lag"}),h.jsx(yt,{children:"Dialect"}),h.jsx(yt,{children:"Mode"}),s&&h.jsx(yt,{children:"Actions"})]})}),h.jsx(Xu,{children:t.map(l=>{const f=Math.max(0,n-l.cursor),d=n>0?Math.min(100,l.cursor/n*100):100,p=D8(f);return h.jsxs(io,{children:[h.jsx(vt,{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(vt,{children:h.jsx(xn,{variant:z8[l.status],children:l.status})}),h.jsx(vt,{children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.type})}),h.jsx(vt,{children:h.jsxs("span",{className:"font-mono text-[11px] text-white font-medium",children:["#",l.cursor.toLocaleString()]})}),h.jsx(vt,{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(vt,{children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.dialect})}),h.jsx(vt,{children:h.jsx(xn,{variant:l.mode==="realtime"?"flow":"ghost",children:l.mode})}),s&&h.jsx(vt,{children:h.jsx("button",{type:"button",onClick:()=>s(l.id),className:"inline-flex items-center gap-1 rounded-md font-mono text-[9px] px-2 py-1 border border-transparent text-neutral-600 hover:border-offline/50 hover:text-offline hover:bg-offline/[0.06] cursor-pointer transition-all opacity-0 group-hover:opacity-100",children:"evict"})})]},l.id)})})]})}));Vj.displayName="FleetTable";const Kj=_.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(xn,{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}`))]})});Kj.displayName="HandlersTable";const L8={flow:"bg-flow",healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",relay:"bg-relay",muted:"bg-neutral-500"},Gj=_.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(U8,{item:i,showDivider:a>0},i.label))}));Gj.displayName="KpiStrip";function U8({item:e,showDivider:t}){const n=L8[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 Zj=_.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})]})]})]})});Zj.displayName="LatencyPercentilesBar";const $8={PUSH:"syncing",PULL:"healthy",ACK:"flow"},Yj=_.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(xn,{variant:$8[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}`))})]})});Yj.displayName="LiveActivityFeed";const B8={syncing:"bg-syncing",flow:"bg-flow",healthy:"bg-healthy",offline:"bg-offline"},_p=_.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",B8[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(Ce,{variant:l,size:"md",onClick:d,children:[f,a]})]})]}));_p.displayName="MaintenanceCard";function F8({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Yb,{className:ge("border-border",n),children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Xb,{className:s,children:t})]})}const Xj=_.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(Ce,{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(H8,{row:a,showDivider:l>0},a.label))})]}));Xj.displayName="PreferencesPanel";function H8({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(Sp,{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(Yb,{className:n,children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Xb,{className:s,children:t})]})}const q8={commit:"text-flow",push:"text-syncing",pull:"text-healthy"},V8={applied:"text-healthy",error:"text-offline",cached:"text-syncing"},Qj=_.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(K8,{entry:d,isSelected:a===d.id,onClick:i},`${d.id}-${p}`))}),s]}));Qj.displayName="StreamLog";function K8({entry:e,isSelected:t,onClick:n}){const s=q8[e.type]??"text-neutral-500",i=V8[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 G8(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const Wj=_.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=G8(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"})]})]})]})]})});Wj.displayName="SyncHorizon";function Z8(e){const t=_.useRef(!0);t.current&&(t.current=!1,e())}const Y8=_.createContext(void 0);function Jb(e){const t=_.useContext(Y8);if(t===void 0)throw new Error(gn(72));return t}const X8=[];function ex(e){_.useEffect(e,X8)}const ru=0;class ai{static create(){return new ai}currentId=ru;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ru,n()},t)}isStarted(){return this.currentId!==ru}clear=()=>{this.currentId!==ru&&(clearTimeout(this.currentId),this.currentId=ru)};disposeEffect=()=>this.clear}function ns(){const e=zn(ai.create).current;return ex(e.disposeEffect),e}function Jo(e){const t=zn(Q8,e).current;return t.next=e,Le(t.effect),t}function Q8(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Rt(e){return e?.ownerDocument||document}const tl=typeof navigator<"u",jy=eV(),Jj=nV(),eA=tV(),tx=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),tA=jy.platform==="MacIntel"&&jy.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(jy.platform),W8=tl&&/apple/i.test(navigator.vendor),Mv=tl&&/android/i.test(Jj)||/android/i.test(eA);tl&&Jj.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const J8=eA.includes("jsdom/");function eV(){if(!tl)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 tV(){if(!tl)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function nV(){if(!tl)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Iv="data-base-ui-focusable",nA="active",rA="selected",sA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ay="ArrowLeft",ky="ArrowRight",rV="ArrowUp",sV="ArrowDown";function Fo(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&&jv(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function oV(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 Jr(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 iV(e){return e.matches("html,body")}function oA(e){return Zt(e)&&e.matches(sA)}function oC(e){return e?e.getAttribute("role")==="combobox"&&oA(e):!1}function Bh(e){return e?e.hasAttribute(Iv)?e:e.querySelector(`[${Iv}]`)||e:null}function xc(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...xc(e,i.id,n)])}function iC(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 aV(e){return"nativeEvent"in e}function cV(e){return e.pointerType===""&&e.isTrusted?!0:Mv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function lV(e){return J8?!1:!Mv&&e.width===0&&e.height===0||Mv&&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 uV(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function fV(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const dV=["top","right","bottom","left"],Lc=Math.min,dr=Math.max,Fh=Math.round,hc=Math.floor,bs=e=>({x:e,y:e}),hV={left:"right",right:"left",bottom:"top",top:"bottom"},pV={start:"end",end:"start"};function Pv(e,t,n){return dr(e,Lc(t,n))}function ao(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 mV=new Set(["top","bottom"]);function Fr(e){return mV.has(Zn(e))?"y":"x"}function sx(e){return nx(Fr(e))}function gV(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=Hh(l)),[l,Hh(l)]}function yV(e){const t=Hh(e);return[Dv(e),t,Dv(t)]}function Dv(e){return e.replace(/start|end/g,t=>pV[t])}const aC=["left","right"],cC=["right","left"],vV=["top","bottom"],bV=["bottom","top"];function xV(e,t,n){switch(e){case"top":case"bottom":return n?t?cC:aC:t?aC:cC;case"left":case"right":return t?vV:bV;default:return[]}}function SV(e,t,n,s){const i=Si(e);let a=xV(Zn(e),n==="start",s);return i&&(a=a.map(l=>l+"-"+i),t&&(a=a.concat(a.map(Dv)))),a}function Hh(e){return e.replace(/left|right|bottom|top/g,t=>hV[t])}function _V(e){return{top:0,right:0,bottom:0,left:0,...e}}function iA(e){return typeof e!="number"?_V(e):{top:e,right:e,bottom:e,left:e}}function qh(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 wV(e,t){return fr(e,{disabledIndices:t})}function EV(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&&fu(e,a,s));return a}function TV(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 z=b[R];if(z.length===0){R=C==="up"?R-1:R+1;continue}const j=Math.min(N,z.length-1);for(let A=j;A>=0;A-=1){const P=z[A];if(!fu(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===rV){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===sV){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=hc(p/a);t.key===(i?Ay:ky)&&(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?ky:Ay)&&(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=hc(d/a)===C;ch(e,y)&&(s&&O?y=t.key===(i?ky:Ay)?d:fr(e,{startingIndex:p-p%a-1,disabledIndices:l}):y=p)}return y}function CV(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 RV(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 NV(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function fu(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const s=e.current[t];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}var jV=["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] *)"],Vh=jV.join(","),aA=typeof Element>"u",Uc=aA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Kh=!aA&&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},Gh=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]"):Gh(t.parentNode));return l},AV=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},cA=function(t,n,s){if(Gh(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Vh));return n&&Uc.call(t,Vh)&&i.unshift(t),i=i.filter(s),i},Zh=function(t,n,s){for(var i=[],a=Array.from(t);a.length;){var l=a.shift();if(!Gh(l,!1))if(l.tagName==="SLOT"){var f=l.assignedElements(),d=f.length?f:l.children,p=Zh(d,!0,s);s.flatten?i.push.apply(i,p):i.push({scopeParent:l,candidates:p})}else{var g=Uc.call(l,Vh);g&&s.filter(l)&&(n||!t.includes(l))&&i.push(l);var y=l.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(l),b=!Gh(y,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(l));if(y&&b){var x=Zh(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},lA=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},uA=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||AV(t))&&!lA(t)?0:t.tabIndex},kV=function(t,n){var s=uA(t);return s<0&&n&&!lA(t)?0:s},OV=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},fA=function(t){return t.tagName==="INPUT"},MV=function(t){return fA(t)&&t.type==="hidden"},IV=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},PV=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},DV=function(t){if(!t.name)return!0;var n=t.form||Kh(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=PV(i,t.form);return!a||a===t},zV=function(t){return fA(t)&&t.type==="radio"},LV=function(t){return zV(t)&&!DV(t)},UV=function(t){var n,s=t&&Kh(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=Kh(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},lC=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},$V=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=Uc.call(t,"details>summary:first-of-type"),f=l?t.parentElement:t;if(Uc.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=Kh(t);if(p&&!p.shadowRoot&&i(p)===!0)return lC(t);t.assignedSlot?t=t.assignedSlot:!p&&g!==t.ownerDocument?t=g.host:t=p}t=d}if(UV(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return lC(t);return!1},BV=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 Uc.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},zv=function(t,n){return!(n.disabled||MV(n)||$V(n,t)||IV(n)||BV(n))},Lv=function(t,n){return!(LV(n)||uA(n)<0||!zv(t,n))},FV=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},dA=function(t){var n=[],s=[];return t.forEach(function(i,a){var l=!!i.scopeParent,f=l?i.scopeParent:i,d=kV(f,l),p=l?dA(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(OV).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},wp=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Zh([t],n.includeContainer,{filter:Lv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:FV}):s=cA(t,n.includeContainer,Lv.bind(null,n)),dA(s)},HV=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Zh([t],n.includeContainer,{filter:zv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=cA(t,n.includeContainer,zv.bind(null,n)),s},hA=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Uc.call(t,Vh)===!1?!1:Lv(n,t)};const Qu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pA(e,t){const n=wp(e,Qu()),s=n.length;if(s===0)return;const i=Fo(Rt(e)),a=n.indexOf(i),l=a===-1?t===1?0:s-1:a+t;return n[l]}function mA(e){return pA(Rt(e).body,1)||e}function gA(e){return pA(Rt(e).body,-1)||e}function du(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Ot(n,s)}function qV(e){wp(e,Qu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function uC(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 VV(){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 KV=_.createContext(null),GV=_.createContext(null),Ep=()=>_.useContext(KV)?.id||null,Tp=e=>{const t=_.useContext(GV);return e??t};function Tu(e){return`data-base-ui-${e}`}const Ld=null;class ZV{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 ZV;class gs{static create(){return new gs}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(gs.create).current;return ex(e.disposeEffect),e}const Yh=_.forwardRef(function(t,n){const[s,i]=_.useState();Le(()=>{W8&&i("button")},[]);const a={tabIndex:0,role:s};return h.jsx("span",{...t,ref:n,style:mp,"aria-hidden":s?void 0:!0,...a,"data-base-ui-focus-guard":""})});let fC=0;function Oy(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:i=!1}=t;s&&cancelAnimationFrame(fC);const a=()=>e?.focus({preventScroll:n});i?a():fC=requestAnimationFrame(a)}const Sc={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function dC(e){return e==="inert"?Sc.inert:e==="aria-hidden"?Sc["aria-hidden"]:Sc.none}let $d=new WeakSet,Bd={},My=0;const yA=e=>e&&(e.host||yA(e.parentNode)),YV=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=yA(n);return e.contains(s)?s:null}).filter(n=>n!=null);function XV(e,t,n,s){const i="data-base-ui-inert",a=s?"inert":n?"aria-hidden":null,l=YV(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=dC(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 My+=1,()=>{p.forEach(x=>{const S=dC(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)}),My-=1,My||(Sc.inert=new WeakMap,Sc["aria-hidden"]=new WeakMap,Sc.none=new WeakMap,$d=new WeakSet,Bd={})}}function QV(e,t=!1,n=!1){const s=Rt(e[0]).body;return XV(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const vA=_.createContext(null),bA=()=>_.useContext(vA),WV=Tu("portal");function xA(e={}){const{ref:t,container:n,componentProps:s=an,elementProps:i}=e,a=Gu(),f=bA()?.portalNode,[d,p]=_.useState(null),[g,y]=_.useState(null),b=ke(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&&(Gb(n)?n:n.current))??f??document.body;if(T==null){x.current&&(x.current=null,y(null),p(null));return}x.current!==T&&(x.current=T,y(null),p(T))},[n,f,a]);const S=zt("div",s,{ref:[t,b],props:[{id:a,[WV]:""},i]});return{portalNode:g,portalSubtree:d&&S?hi.createPortal(S,d):null}}const SA=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,renderGuards:f,...d}=t,{portalNode:p,portalSubtree:g}=xA({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(z){p&&z.relatedTarget&&du(z)&&(z.type==="focusin"?uC:qV)(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||uC(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(vA.Provider,{value:R,children:[N&&p&&h.jsx(Yh,{"data-type":"outside",ref:y,onFocus:M=>{if(du(M,p))x.current?.focus();else{const z=w?w.domReference:null;gA(z)?.focus()}}}),N&&p&&h.jsx("span",{"aria-owns":p.id,style:X9}),p&&hi.createPortal(s,p),N&&p&&h.jsx(Yh,{"data-type":"outside",ref:b,onFocus:M=>{if(du(M,p))S.current?.focus();else{const z=w?w.domReference:null;mA(z)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Yt(Lj,M.nativeEvent))}}})]})]})});function Hs(e){return e==null?e:"current"in e?e.current:e}function JV(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 hC=20;let Vo=[];function ix(){Vo=Vo.filter(e=>e.deref()?.isConnected)}function eK(e){ix(),e&&yi(e)!=="body"&&(Vo.push(new WeakRef(e)),Vo.length>hC&&(Vo=Vo.slice(-hC)))}function Iy(){return ix(),Vo[Vo.length-1]?.deref()}function tK(e){if(!e)return null;const t=Qu();return hA(e,t)?e:wp(e,t)[0]||e}function nK(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():xr(e).display!=="none"}function pC(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Qu(),i=HV(e,n).filter(l=>{const f=l.getAttribute("data-tabindex")||"";return hA(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 _A(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=ke(()=>N.current.floatingContext?.nodeId),M=i===!1,z=oC(T)&&M,j=_.useRef(["content"]),A=Jo(i),P=Jo(a),Q=Jo(p),B=Tp(x),U=bA(),Z=_.useRef(null),K=_.useRef(null),ee=_.useRef(!1),D=_.useRef(!1),G=_.useRef(!1),q=_.useRef(-1),V=_.useRef(""),L=_.useRef(""),I=_.useRef(null),H=_.useRef(null),W=so(I,b,U?.beforeInsideRef),Y=so(H,U?.afterInsideRef),ae=ns(),se=ns(),fe=ox(),Se=U!=null,pe=Bh(C),Me=ke((he=pe)=>he?wp(he,Qu()):[]),_e=ke(he=>{const ie=Me(he);return j.current.map(()=>ie).filter(Boolean).flat()});_.useEffect(()=>{if(s||!f)return;function he(we){we.key==="Tab"&&Ot(pe,Fo(Rt(pe)))&&Me().length===0&&!z&&Ki(we)}const ie=Rt(pe);return ie.addEventListener("keydown",he),()=>{ie.removeEventListener("keydown",he)}},[s,T,pe,f,j,z,Me,_e]),_.useEffect(()=>{if(s||!w)return;const he=Rt(pe);function ie(){G.current=!1}function we(xe){const ve=Ur(xe),Ie=Ot(C,ve)||Ot(T,ve)||Ot(U?.portalNode,ve);G.current=!Ie,L.current=xe.pointerType||"keyboard",ve?.closest(`[${G9}]`)&&(D.current=!0)}function ye(){L.current="keyboard"}return he.addEventListener("pointerdown",we,!0),he.addEventListener("pointerup",ie,!0),he.addEventListener("pointercancel",ie,!0),he.addEventListener("keydown",ye,!0),()=>{he.removeEventListener("pointerdown",we,!0),he.removeEventListener("pointerup",ie,!0),he.removeEventListener("pointercancel",ie,!0),he.removeEventListener("keydown",ye,!0)}},[s,C,T,pe,w,U]),_.useEffect(()=>{if(s||!d)return;const he=Rt(pe);function ie(){D.current=!0,se.start(0,()=>{D.current=!1})}function we(Ue){const Ee=Ur(Ue),Qe=Me().indexOf(Ee);Qe!==-1&&(q.current=Qe)}function ye(Ue){const Ee=Ue.relatedTarget,Ve=Ue.currentTarget,Qe=Ur(Ue);queueMicrotask(()=>{const Be=R(),We=S.context.triggerElements,He=Ee?.hasAttribute(Tu("focus-guard"))&&[I.current,H.current,U?.beforeInsideRef.current,U?.afterInsideRef.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,Hs(y),Hs(g)].includes(Ee),me=!(Ot(T,Ee)||Ot(C,Ee)||Ot(Ee,C)||Ot(U?.portalNode,Ee)||Ee!=null&&We.hasElement(Ee)||We.hasMatchingElement(Te=>Ot(Te,Ee))||He||B&&(xc(B.nodesRef.current,Be).find(Te=>Ot(Te.context?.elements.floating,Ee)||Ot(Te.context?.elements.domReference,Ee))||iC(B.nodesRef.current,Be).find(Te=>[Te.context?.elements.floating,Bh(Te.context?.elements.floating)].includes(Ee)||Te.context?.elements.domReference===Ee)));if(Ve===T&&pe&&pC(pe,j),l&&Ve!==T&&!nK(Qe)&&Fo(he)===he.body){if(Zt(pe)&&(pe.focus(),l==="popup")){fe.request(()=>{pe.focus()});return}const Te=q.current,qe=Me(),ht=qe[Te]||qe[qe.length-1]||pe;Zt(ht)&&ht.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(z||!f)&&Ee&&me&&!D.current&&(z||Ee!==Iy())&&(ee.current=!0,S.setOpen(!1,Yt(Lj,Ue)))})}function xe(){G.current||(N.current.insideReactTree=!0,ae.start(0,()=>{N.current.insideReactTree=!1}))}const ve=Zt(T)?T:null,Ie=[];if(!(!C&&!ve))return ve&&(ve.addEventListener("focusout",ye),ve.addEventListener("pointerdown",ie),Ie.push(()=>{ve.removeEventListener("focusout",ye),ve.removeEventListener("pointerdown",ie)})),C&&(C.addEventListener("focusin",we),C.addEventListener("focusout",ye),U&&(C.addEventListener("focusout",xe,!0),Ie.push(()=>{C.removeEventListener("focusout",xe,!0)})),Ie.push(()=>{C.removeEventListener("focusin",we),C.removeEventListener("focusout",ye)})),()=>{Ie.forEach(Ue=>{Ue()})}},[s,T,C,pe,f,B,U,S,d,l,Me,z,R,j,N,ae,se,fe,g,y]),_.useEffect(()=>{if(s||!C||!w)return;const he=Array.from(U?.portalNode?.querySelectorAll(`[${Tu("portal")}]`)||[]),we=(B?iC(B.nodesRef.current,R()):[]).find(xe=>oC(xe.context?.elements.domReference||null))?.context?.elements.domReference,ye=[C,we,...he,Z.current,K.current,I.current,H.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,Hs(y),Hs(g),z?T:null].filter(xe=>xe!=null);return QV(ye,f||z)},[w,s,T,C,f,j,U,z,B,R,g,y]),Le(()=>{if(!w||s||!Zt(pe))return;const he=Rt(pe),ie=Fo(he);queueMicrotask(()=>{const we=_e(pe),ye=A.current,xe=typeof ye=="function"?ye(Q.current||""):ye;if(xe===void 0||xe===!1)return;let ve;xe===!0||xe===null?ve=we[0]||pe:ve=Hs(xe),ve=ve||we[0]||pe,!Ot(pe,ie)&&Oy(ve,{preventScroll:ve===pe})})},[s,w,pe,M,_e,A,Q]),Le(()=>{if(s||!pe)return;const he=Rt(pe),ie=Fo(he);eK(ie);function we(ve){if(ve.open||(V.current=JV(ve.nativeEvent,L.current)),ve.reason===Ov&&ve.nativeEvent.type==="mouseleave"&&(ee.current=!0),ve.reason===zj)if(ve.nested)ee.current=!1;else if(cV(ve.nativeEvent)||lV(ve.nativeEvent))ee.current=!1;else{let Ie=!1;document.createElement("div").focus({get preventScroll(){return Ie=!0,!1}}),Ie?ee.current=!1:ee.current=!0}}O.on("openchange",we);const ye=he.createElement("span");ye.setAttribute("tabindex","-1"),ye.setAttribute("aria-hidden","true"),Object.assign(ye.style,mp),Se&&T&&T.insertAdjacentElement("afterend",ye);function xe(){const ve=P.current;let Ie=typeof ve=="function"?ve(V.current):ve;if(Ie===void 0||Ie===!1)return null;if(Ie===null&&(Ie=!0),typeof Ie=="boolean"){const Ee=T||Iy();return Ee&&Ee.isConnected?Ee:ye}const Ue=T||Iy()||ye;return Hs(Ie)||Ue}return()=>{O.off("openchange",we);const ve=Fo(he),Ie=Ot(C,ve)||B&&xc(B.nodesRef.current,R(),!1).some(Ee=>Ot(Ee.context?.elements.floating,ve)),Ue=xe();queueMicrotask(()=>{const Ee=tK(Ue),Ve=typeof P.current!="boolean";P.current&&!ee.current&&Zt(Ee)&&(!(!Ve&&Ee!==ve&&ve!==he.body)||Ie)&&Ee.focus({preventScroll:!0}),ye.remove(),ee.current=!1})}},[s,C,pe,P,N,O,B,Se,T,R]),Le(()=>{if(!tx||w||!C)return;const he=Fo(Rt(C));!Zt(he)||!oA(he)||Ot(C,he)&&he.blur()},[w,C]),Le(()=>{if(!(s||!U))return U.setFocusManagerState({modal:f,closeOnFocusOut:d,open:w,onOpenChange:S.setOpen,domReference:T}),()=>{U.setFocusManagerState(null)}},[s,U,f,w,S,d,T]),Le(()=>{if(!(s||!pe))return pC(pe,j),()=>{queueMicrotask(ix)}},[s,pe,j]);const re=!s&&(f?!z:!0)&&(Se||f);return h.jsxs(_.Fragment,{children:[re&&h.jsx(Yh,{"data-type":"inside",ref:W,onFocus:he=>{if(f){const ie=_e();Oy(ie[ie.length-1])}else U?.portalNode&&(ee.current=!1,du(he,U.portalNode)?mA(T)?.focus():Hs(y??U.beforeOutsideRef)?.focus())}}),n,re&&h.jsx(Yh,{"data-type":"inside",ref:Y,onFocus:he=>{f?Oy(_e()[0]):U?.portalNode&&(d&&(ee.current=!0),du(he,U.portalNode)?gA(T)?.focus():Hs(g??U.afterOutsideRef)?.focus())}})]})}function mC(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 rK(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}=ao(t,e),S=iA(x),T=f[b?y==="floating"?"reference":"floating":y],C=qh(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=qh(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 sK=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}=mC(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:z}=await O({x:g,y,initialPlacement:s,placement:b,strategy:i,middlewareData:x,rects:p,platform:{...l,detectOverflow:(w=l.detectOverflow)!=null?w:rK},elements:{reference:e,floating:t}});g=N??g,y=R??y,x={...x,[C]:{...x[C],...M}},z&&S<=50&&(S++,typeof z=="object"&&(z.placement&&(b=z.placement),z.rects&&(p=z.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):z.rects),{x:g,y}=mC(p,b,d)),T=-1)}return{x:g,y,placement:b,strategy:i,middlewareData:x}},oK=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}=ao(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?[Hh(f)]:yV(f)),z=S!=="none";!b&&z&&M.push(...SV(f,w,S,R));const j=[f,...M],A=await d.detectOverflow(t,T),P=[];let Q=((s=a.flip)==null?void 0:s.overflows)||[];if(g&&P.push(A[C]),y){const K=gV(i,l,R);P.push(A[K[0]],A[K[1]])}if(Q=[...Q,{placement:i,overflows:P}],!P.every(K=>K<=0)){var B,U;const K=(((B=a.flip)==null?void 0:B.index)||0)+1,ee=j[K];if(ee&&(!(y==="alignment"?O!==Fr(ee):!1)||Q.every(q=>Fr(q.placement)===O?q.overflows[0]>0:!0)))return{data:{index:K,overflows:Q},reset:{placement:ee}};let D=(U=Q.filter(G=>G.overflows[0]<=0).sort((G,q)=>G.overflows[1]-q.overflows[1])[0])==null?void 0:U.placement;if(!D)switch(x){case"bestFit":{var Z;const G=(Z=Q.filter(q=>{if(z){const V=Fr(q.placement);return V===O||V==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(V=>V>0).reduce((V,L)=>V+L,0)]).sort((q,V)=>q[1]-V[1])[0])==null?void 0:Z[0];G&&(D=G);break}case"initialPlacement":D=f;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function gC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yC(e){return dV.some(t=>e[t]>=0)}const iK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...a}=ao(e,t);switch(i){case"referenceHidden":{const l=await s.detectOverflow(t,{...a,elementContext:"reference"}),f=gC(l,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:yC(f)}}}case"escaped":{const l=await s.detectOverflow(t,{...a,altBoundary:!0}),f=gC(l,n.floating);return{data:{escapedOffsets:f,escaped:yC(f)}}}default:return{}}}}},wA=new Set(["left","top"]);async function aK(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=wA.has(l)?-1:1,g=a&&d?-1:1,y=ao(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 cK=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 aK(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}}}}},lK=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}=ao(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=Pv(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=Pv(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}}}}}},uK=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}=ao(e,t),g={x:n,y:s},y=Fr(i),b=nx(y);let x=g[b],S=g[y];const w=ao(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=wA.has(Zn(i)),M=a.reference[y]-a.floating[N]+(R&&((C=l.offset)==null?void 0:C[y])||0)+(R?0:T.crossAxis),z=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>z&&(S=z)}return{[b]:x,[y]:S}}}},fK=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}=ao(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=Lc(w-g[T],O),M=Lc(S-g[C],N),z=!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),z&&!b){const Q=dr(g.left,0),B=dr(g.right,0),U=dr(g.top,0),Z=dr(g.bottom,0);x?A=S-2*(Q!==0||B!==0?Q+B:dr(g.left,g.right)):j=w-2*(U!==0||Z!==0?U+Z: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 EA(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=Fh(n)!==a||Fh(s)!==l;return f&&(n=a,s=l),{width:n,height:s,$:f}}function ax(e){return jt(e)?e:e.contextElement}function _c(e){const t=ax(e);if(!Zt(t))return bs(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:a}=EA(t);let l=(a?Fh(n.width):n.width)/s,f=(a?Fh(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const dK=bs(0);function TA(e){const t=un(e);return!vp()||!t.visualViewport?dK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hK(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=bs(1);t&&(s?jt(s)&&(l=_c(s)):l=_c(e));const f=hK(a,n,s)?TA(a):bs(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=Av(S);for(;w&&s&&x!==S;){const T=_c(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=Av(S)}}return qh({width:g,height:y,x:d,y:p})}function Cp(e,t){const n=bp(e).scrollLeft;return t?t.left+n:da(Ss(e)).left+n}function CA(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-Cp(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function pK(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const a=i==="fixed",l=Ss(s),f=t?yp(t.floating):!1;if(s===l||f&&a)return n;let d={scrollLeft:0,scrollTop:0},p=bs(1);const g=bs(0),y=Zt(s);if((y||!y&&!a)&&((yi(s)!=="body"||vi(l))&&(d=bp(s)),Zt(s))){const x=da(s);p=_c(s),g.x=x.x+s.clientLeft,g.y=x.y+s.clientTop}const b=l&&!y&&!a?CA(l,d):bs(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 mK(e){return Array.from(e.getClientRects())}function gK(e){const t=Ss(e),n=bp(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+Cp(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 vC=25;function yK(e,t){const n=un(e),s=Ss(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=vp();(!g||g&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const p=Cp(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<=vC&&(a-=S)}else p<=vC&&(a+=p);return{width:a,height:l,x:f,y:d}}const vK=new Set(["absolute","fixed"]);function bK(e,t){const n=da(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zt(e)?_c(e):bs(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 bC(e,t,n){let s;if(t==="viewport")s=yK(e,n);else if(t==="document")s=gK(Ss(e));else if(jt(t))s=bK(t,n);else{const i=TA(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return qh(s)}function RA(e,t){const n=oo(e);return n===t||!jt(n)||Ys(n)?!1:xr(n).position==="fixed"||RA(n,t)}function xK(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=Zb(l);!d&&f.position==="fixed"&&(i=null),(a?!d&&!i:!d&&f.position==="static"&&!!i&&vK.has(i.position)||vi(l)&&!d&&RA(e,l))?s=s.filter(g=>g!==l):i=f,l=oo(l)}return t.set(e,s),s}function SK(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const l=[...n==="clippingAncestors"?yp(t)?[]:xK(t,this._c):[].concat(n),s],f=l[0],d=l.reduce((p,g)=>{const y=bC(t,g,i);return p.top=dr(y.top,p.top),p.right=Lc(y.right,p.right),p.bottom=Lc(y.bottom,p.bottom),p.left=dr(y.left,p.left),p},bC(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function _K(e){const{width:t,height:n}=EA(e);return{width:t,height:n}}function wK(e,t,n){const s=Zt(t),i=Ss(t),a=n==="fixed",l=da(e,!0,a,t);let f={scrollLeft:0,scrollTop:0};const d=bs(0);function p(){d.x=Cp(i)}if(s||!s&&!a)if((yi(t)!=="body"||vi(i))&&(f=bp(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?CA(i,f):bs(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 Py(e){return xr(e).position==="static"}function xC(e,t){if(!Zt(e)||xr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ss(e)===n&&(n=n.ownerDocument.body),n}function NA(e,t){const n=un(e);if(yp(e))return n;if(!Zt(e)){let i=oo(e);for(;i&&!Ys(i);){if(jt(i)&&!Py(i))return i;i=oo(i)}return n}let s=xC(e,t);for(;s&&o8(s)&&Py(s);)s=xC(s,t);return s&&Ys(s)&&Py(s)&&!Zb(s)?n:s||u8(e)||n}const EK=async function(e){const t=this.getOffsetParent||NA,n=this.getDimensions,s=await n(e.floating);return{reference:wK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function TK(e){return xr(e).direction==="rtl"}const CK={convertOffsetParentRelativeRectToViewportRelativeRect:pK,getDocumentElement:Ss,getClippingRect:SK,getOffsetParent:NA,getElementRects:EK,getClientRects:mK,getDimensions:_K,getScale:_c,isElement:jt,isRTL:TK};function jA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function RK(e,t){let n=null,s;const i=Ss(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=hc(y),w=hc(i.clientWidth-(g+b)),T=hc(i.clientHeight-(y+x)),C=hc(g),N={rootMargin:-S+"px "+-w+"px "+-T+"px "+-C+"px",threshold:dr(0,Lc(1,d))||1};let R=!0;function M(z){const j=z[0].intersectionRatio;if(j!==d){if(!R)return l();j?l(!1,j):s=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!jA(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 SC(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?RK(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&&!jA(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 NK=cK,jK=lK,AK=oK,kK=fK,OK=iK,MK=uK,IK=(e,t,n)=>{const s=new Map,i={platform:CK,...n},a={...i.platform,_c:s};return sK(e,t,{...i,platform:a})};var PK=typeof document<"u",DK=function(){},lh=PK?_.useLayoutEffect:DK;function Xh(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(!Xh(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)&&!Xh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function AA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _C(e,t){const n=AA(e);return Math.round(t*n)/n}function Dy(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);Xh(b,s)||x(s);const[S,w]=_.useState(null),[T,C]=_.useState(null),O=_.useCallback(q=>{q!==z.current&&(z.current=q,w(q))},[]),N=_.useCallback(q=>{q!==j.current&&(j.current=q,C(q))},[]),R=a||S,M=l||T,z=_.useRef(null),j=_.useRef(null),A=_.useRef(g),P=d!=null,Q=Dy(d),B=Dy(i),U=Dy(p),Z=_.useCallback(()=>{if(!z.current||!j.current)return;const q={placement:t,strategy:n,middleware:b};B.current&&(q.platform=B.current),IK(z.current,j.current,q).then(V=>{const L={...V,isPositioned:U.current!==!1};K.current&&!Xh(A.current,L)&&(A.current=L,hi.flushSync(()=>{y(L)}))})},[b,t,n,B,U]);lh(()=>{p===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,y(q=>({...q,isPositioned:!1})))},[p]);const K=_.useRef(!1);lh(()=>(K.current=!0,()=>{K.current=!1}),[]),lh(()=>{if(R&&(z.current=R),M&&(j.current=M),R&&M){if(Q.current)return Q.current(R,M,Z);Z()}},[R,M,Z,Q,P]);const ee=_.useMemo(()=>({reference:z,floating:j,setReference:O,setFloating:N}),[O,N]),D=_.useMemo(()=>({reference:R,floating:M}),[R,M]),G=_.useMemo(()=>{const q={position:n,left:0,top:0};if(!D.floating)return q;const V=_C(D.floating,g.x),L=_C(D.floating,g.y);return f?{...q,transform:"translate("+V+"px, "+L+"px)",...AA(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:L}},[n,f,D.floating,g.x,g.y]);return _.useMemo(()=>({...g,update:Z,refs:ee,elements:D,floatingStyles:G}),[g,Z,ee,D,G])}const LK=(e,t)=>({...NK(e),options:[e,t]}),UK=(e,t)=>({...jK(e),options:[e,t]}),$K=(e,t)=>({...MK(e),options:[e,t]}),BK=(e,t)=>({...AK(e),options:[e,t]}),FK=(e,t)=>({...kK(e),options:[e,t]}),HK=(e,t)=>({...OK(e),options:[e,t]}),qK={intentional:"onClick",sloppy:"onPointerDown"};function VK(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function KK(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=Tp(C),N=ke(typeof y=="function"?y:()=>!1),R=typeof y=="function"?N:y,M=_.useRef(!1),{escapeKey:z,outsidePress:j}=VK(T),A=_.useRef(null),P=ns(),Q=ns(),B=ke(()=>{Q.clear(),d.current.insideReactTree=!1}),U=_.useRef(!1),Z=_.useRef(""),K=ke(re=>{Z.current=re.pointerType}),ee=ke(()=>{const re=Z.current,he=re==="pen"||!re?"mouse":re,ie=typeof b=="function"?b():b;return typeof ie=="string"?ie:ie[he]}),D=ke(re=>{if(!s||!p||!g||re.key!=="Escape"||U.current)return;const he=d.current.floatingContext?.nodeId,ie=O?xc(O.nodesRef.current,he):[];if(!z&&ie.length>0){let xe=!0;if(ie.forEach(ve=>{ve.context?.open&&!ve.context.dataRef.current.__escapeKeyBubbles&&(xe=!1)}),!xe)return}const we=aV(re)?re.nativeEvent:re,ye=Yt(g8,we);n.setOpen(!1,ye),!z&&!ye.isPropagationAllowed&&re.stopPropagation()}),G=ke(re=>{const he=ee();return he==="intentional"&&re.type!=="click"||he==="sloppy"&&re.type==="click"}),q=ke(()=>{d.current.insideReactTree=!0,Q.start(0,B)}),V=ke((re,he=!1)=>{if(G(re)){B();return}if(d.current.insideReactTree){B();return}if(ee()==="intentional"&&he||typeof R=="function"&&!R(re))return;const ie=Ur(re),we=`[${Tu("inert")}]`,ye=Rt(n.select("floatingElement")).querySelectorAll(we),xe=n.context.triggerElements;if(ie&&(xe.hasElement(ie)||xe.hasMatchingElement(Ve=>Ot(Ve,ie))))return;let ve=jt(ie)?ie:null;for(;ve&&!Ys(ve);){const Ve=oo(ve);if(Ys(Ve)||!jt(Ve))break;ve=Ve}if(ye.length&&jt(ie)&&!iV(ie)&&!Ot(ie,n.select("floatingElement"))&&Array.from(ye).every(Ve=>!Ot(ve,Ve)))return;if(Zt(ie)&&!("touches"in re)){const Ve=Ys(ie),Qe=xr(ie),Be=/auto|scroll/,We=Ve||Be.test(Qe.overflowX),He=Ve||Be.test(Qe.overflowY),me=We&&ie.clientWidth>0&&ie.scrollWidth>ie.clientWidth,Te=He&&ie.clientHeight>0&&ie.scrollHeight>ie.clientHeight,qe=Qe.direction==="rtl",ht=Te&&(qe?re.offsetX<=ie.offsetWidth-ie.clientWidth:re.offsetX>ie.clientWidth),lt=me&&re.offsetY>ie.clientHeight;if(ht||lt)return}const Ie=d.current.floatingContext?.nodeId,Ue=O&&xc(O.nodesRef.current,Ie).some(Ve=>Jr(re,Ve.context?.elements.floating));if(Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement"))||Ue)return;const Ee=O?xc(O.nodesRef.current,Ie):[];if(Ee.length>0){let Ve=!0;if(Ee.forEach(Qe=>{Qe.context?.open&&!Qe.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}n.setOpen(!1,Yt(zj,re)),B()}),L=ke(re=>{ee()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!p||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement"))||V(re)}),I=ke(re=>{if(ee()!=="sloppy"||!n.select("open")||!p||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement")))return;const he=re.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=ke(re=>{const he=Ur(re);function ie(){I(re),he?.removeEventListener(re.type,ie)}he?.addEventListener(re.type,ie)}),W=ke(re=>{const he=M.current;if(M.current=!1,P.clear(),re.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const ie=Ur(re);function we(){re.type==="pointerdown"?L(re):V(re,he),ie?.removeEventListener(re.type,we)}ie?.addEventListener(re.type,we)}),Y=ke(re=>{if(ee()!=="sloppy"||!A.current||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement")))return;const he=re.touches[0];if(!he)return;const ie=Math.abs(he.clientX-A.current.startX),we=Math.abs(he.clientY-A.current.startY),ye=Math.sqrt(ie*ie+we*we);ye>5&&(A.current.dismissOnTouchEnd=!0),ye>10&&(V(re),P.clear(),A.current=null)}),ae=ke(re=>{const he=Ur(re);function ie(){Y(re),he?.removeEventListener(re.type,ie)}he?.addEventListener(re.type,ie)}),se=ke(re=>{ee()!=="sloppy"||!A.current||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&V(re),P.clear(),A.current=null)}),fe=ke(re=>{const he=Ur(re);function ie(){se(re),he?.removeEventListener(re.type,ie)}he?.addEventListener(re.type,ie)});_.useEffect(()=>{if(!s||!p)return;d.current.__escapeKeyBubbles=z,d.current.__outsidePressBubbles=j;const re=new ai;function he(ve){n.setOpen(!1,Yt(ii,ve))}function ie(){re.clear(),U.current=!0}function we(){re.start(vp()?5:0,()=>{U.current=!1})}const ye=Rt(i);ye.addEventListener("pointerdown",K,!0),g&&(ye.addEventListener("keydown",D),ye.addEventListener("compositionstart",ie),ye.addEventListener("compositionend",we)),R&&(ye.addEventListener("click",W,!0),ye.addEventListener("pointerdown",W,!0),ye.addEventListener("touchstart",H,!0),ye.addEventListener("touchmove",ae,!0),ye.addEventListener("touchend",fe,!0),ye.addEventListener("mousedown",W,!0));let xe=[];return w&&(jt(l)&&(xe=Wo(l)),jt(i)&&(xe=xe.concat(Wo(i))),!jt(a)&&a&&a.contextElement&&(xe=xe.concat(Wo(a.contextElement)))),xe=xe.filter(ve=>ve!==ye.defaultView?.visualViewport),xe.forEach(ve=>{ve.addEventListener("scroll",he,{passive:!0})}),()=>{ye.removeEventListener("pointerdown",K,!0),g&&(ye.removeEventListener("keydown",D),ye.removeEventListener("compositionstart",ie),ye.removeEventListener("compositionend",we)),R&&(ye.removeEventListener("click",W,!0),ye.removeEventListener("pointerdown",W,!0),ye.removeEventListener("touchstart",H,!0),ye.removeEventListener("touchmove",ae,!0),ye.removeEventListener("touchend",fe,!0),ye.removeEventListener("mousedown",W,!0)),xe.forEach(ve=>{ve.removeEventListener("scroll",he)}),re.clear(),M.current=!1}},[d,i,a,l,g,R,s,f,w,p,z,j,D,V,W,L,H,ae,fe,K,n]),_.useEffect(B,[R,B]);const Se=_.useMemo(()=>({onKeyDown:D,...x&&{[qK[S]]:re=>{n.setOpen(!1,Yt(sC,re.nativeEvent))},...S!=="intentional"&&{onClick(re){n.setOpen(!1,Yt(sC,re.nativeEvent))}}}}),[D,n,x,S]),pe=ke(re=>{const he=Ur(re.nativeEvent);!Ot(n.select("floatingElement"),he)||re.button!==0||(M.current=!0)}),Me=ke(re=>{!s||!p||re.button!==0||(M.current=!0)}),_e=_.useMemo(()=>({onKeyDown:D,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:q,onMouseDownCapture(re){q(),Me(re)},onPointerDownCapture(re){q(),Me(re)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[D,pe,q,Me]);return _.useMemo(()=>p?{reference:Se,floating:_e,trigger:Se}:{},[p,Se,_e])}nj({memoize:lq,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Pe=(e,t,n,s,i,a,...l)=>{if(l.length>0)throw new Error(gn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var GK=qN();const ZK=Kb(19),YK=ZK?QK:WK;function at(e,t,n,s,i){return YK(e,t,n,s,i)}function XK(e,t,n,s,i){const a=_.useCallback(()=>t(e.getSnapshot(),n,s,i),[e,t,n,s,i]);return GK.useSyncExternalStore(e.subscribe,a,a)}function QK(e,t,n,s,i){return XK(e,t,n,s,i)}function WK(e,t,n,s,i){return VN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,s,i))}class JK{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 kA extends JK{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=ke(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 e7={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 kA{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:VV(),nested:n,noEmit:s,triggerElements:a},e7)}setOpen=(t,n)=>{if((!t||!this.state.open||fV(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 Rp(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=gs.request(()=>{i("ending")});return()=>{gs.cancel(f)}}},[e,a,s,n]),Le(()=>{if(!e||t)return;const f=gs.request(()=>{i(void 0)});return()=>{gs.cancel(f)}},[t,e]),Le(()=>{if(!e||!t)return;e&&a&&s!=="idle"&&i("starting");const f=gs.request(()=>{i("idle")});return()=>{gs.cancel(f)}},[t,e,a,i,s]),_.useMemo(()=>({mounted:a,setMounted:l,transitionStatus:s}),[a,s])}let Cu=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const t7={[Cu.startingStyle]:""},n7={[Cu.endingStyle]:""},ba={transitionStatus(e){return e==="starting"?t7:e==="ending"?n7:null}};function r7(e,t=!1,n=!0){const s=ox();return ke((i,a=null)=>{s.cancel();function l(){hi.flushSync(i)}const f=Hs(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=Cu.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=ke(i),l=r7(s,n,!1);_.useEffect(()=>{if(!t)return;const f=new AbortController;return l(a,f.signal),()=>{f.abort()}},[t,n,a,l])}function s7(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 o7(e,t,n){const{mounted:s,setMounted:i,transitionStatus:a}=Rp(e);t.useSyncedValues({mounted:s,transitionStatus:a});const l=ke(()=>{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 i7(){return new cx({open:!1,floatingElement:null,referenceElement:null,triggerElements:new lx,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function a7(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:i7(),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),c7={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 l7(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,i=Gu(),a=Ep()!=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 u7(e={}){const{nodeId:t,externalTree:n}=e,s=l7(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=Tp(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"),z=_.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=z;const j=p?.nodesRef.current.find(A=>A.id===t);j&&(j.context=z)}),_.useMemo(()=>({...g,context:z,refs:O,elements:N,rootStore:i}),[g,O,N,z,i])}function f7(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:i}=e,a=Gu(),l=Ep()!=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 wC=Tu("safe-polygon"),d7=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${sA}`;function h7(e){return e?!!e.closest(d7):!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 p7(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 m7=new Set(["click","mousedown"]);function g7(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=p7(n),g=Tp(),y=Ep(),b=ke(()=>p.interactedInside?!0:l.current.openEvent?m7.has(l.current.openEvent.type):!1),x=ke(()=>{const N=l.current.openEvent?.type;return N?.includes("mouse")&&N!=="mousedown"}),S=ke(N=>oV(N,n.context.triggerElements)),w=_.useCallback((N,R=!0)=>{const M=y7(d,p.pointerType);M&&!p.handler?p.openChangeTimeout.start(M,()=>n.setOpen(!1,Yt(Ov,N))):R&&(p.openChangeTimeout.clear(),n.setOpen(!1,Yt(Ov,N)))},[d,n,p]),T=ke(()=>{p.unbindMouseMove(),p.handler=void 0}),C=ke(()=>{if(p.performedPointerEventsMutation){const N=Rt(i).body;N.style.pointerEvents="",N.removeAttribute(wC),p.performedPointerEventsMutation=!1}}),O=ke(N=>{const R=Ur(N);if(!h7(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(wC,"");const R=a,M=i,z=g?.nodesRef.current.find(j=>j.id===y)?.context?.elements.floating;return z&&(z.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 z=i;return z&&(z.addEventListener("mouseleave",N),z.addEventListener("mouseenter",R),z.addEventListener("mouseleave",M),z.addEventListener("pointerdown",O,!0)),()=>{z&&(z.removeEventListener("mouseleave",N),z.removeEventListener("mouseenter",R),z.removeEventListener("mouseleave",M),z.removeEventListener("pointerdown",O,!0))}},[f,i,n,l,b,S,w,C,T,O,p])}function y7(e,t){return t&&!uV(t)?0:typeof e=="function"?e():e}function v7(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[Iv]="");for(const l in e)i&&e&&(l===nA||l===rA)||(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&&EC(a,f,i,s)}return EC(a,e,i,s),a}function EC(e,t,n,s){for(const i in t){const a=t[i];n&&(i===nA||i===rA)||(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 b7=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function x7(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=Gu(),p=a?.id||d,g=_.useMemo(()=>Bh(l)?.id||i,[l,i]),y=b7.get(f)??f,x=Ep()!=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=Cu.startingStyle]="startingStyle",e[e.endingStyle=Cu.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),TC=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const S7={[TC.popupOpen]:"",[TC.pressed]:""},_7={[Qi.open]:""},w7={[Qi.closed]:""},E7={[Qi.anchorHidden]:""},T7={open(e){return e?S7:null}},nl={open(e){return e?_7:w7},anchorHidden(e){return e?E7:null}},OA=_.createContext(void 0);function C7(){const e=_.useContext(OA);if(e===void 0)throw new Error(gn(70));return e}const R7=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,...f}=t,{portalNode:d,portalSubtree:p}=xA({container:i,ref:n,componentProps:t,elementProps:f});return!p&&!d?null:h.jsxs(_.Fragment,{children:[p,d&&hi.createPortal(s,d)]})}),N7=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t;return Jb().useState("mounted")||s?h.jsx(OA.Provider,{value:s,children:h.jsx(R7,{ref:n,...i})}):null}),MA=_.createContext(void 0);function j7(){const e=_.useContext(MA);if(e===void 0)throw new Error(gn(71));return e}const A7=_.createContext(void 0);function IA(){return _.useContext(A7)?.direction??"ltr"}const k7=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"}=ao(e,t)||{};if(p==null)return{};const b=iA(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],z=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-z/2,Q=A/2-T[w]/2-1,B=Math.min(b[O],Q),U=Math.min(b[N],Q),Z=B,K=A-T[w]-U,ee=A/2-T[w]/2+P,D=Pv(Z,ee,K),G=!d.arrow&&Si(i)!=null&&ee!==D&&a.reference[w]/2-(ee<Z?B:U)-T[w]/2<0,q=G?ee<Z?ee-Z:ee-K:0;return{[S]:x[S]+q,data:{[S]:D,centerOffset:ee-D-q,...G&&{alignmentOffset:q}},reset:G}}}),O7=(e,t)=>({...k7(e),options:[e,t]}),M7={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 HK().fn(e)).data?.referenceHidden||a}}}},uh={sideX:"left",sideY:"top"},I7={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 PA(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 CC(e,t,n){const{rects:s,placement:i}=e;return{side:PA(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 DA(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,z]=_.useState(null);!S&&M!==null&&z(null);const j=w.side||"flip",A=w.align||"flip",P=w.fallbackAxisSide||"end",Q=typeof t=="function"?t:void 0,B=ke(Q),U=Q?B:t,Z=Jo(t),ee=IA()==="rtl",D=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ee?"left":"right","inline-start":ee?"right":"left"}[s],G=a==="center"?D:`${D}-${a}`;let q=d;const V=1,L=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+L,right:q+W,bottom:q+I,left:q+H}:q&&(q={top:(q.top||0)+L,right:(q.right||0)+W,bottom:(q.bottom||0)+I,left:(q.left||0)+H});const Y={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:q},ae=_.useRef(null),se=Jo(i),fe=Jo(l),Me=[LK(ot=>{const Wt=CC(ot,s,ee),yn=typeof se.current=="function"?se.current(Wt):se.current,kt=typeof fe.current=="function"?fe.current(Wt):fe.current;return{mainAxis:yn,crossAxis:kt,alignmentAxis:kt}},[typeof i!="function"?i:0,typeof l!="function"?l:0,ee,s])],_e=A==="none"&&j!=="shift",re=!_e&&(p||T||j==="shift"),he=j==="none"?null:BK({...Y,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}),ie=_e?null:UK(ot=>{const Wt=Rt(ot.elements.floating).documentElement;return{...Y,rootBoundary:T?{x:0,y:0,width:Wt.clientWidth,height:Wt.clientHeight}:void 0,mainAxis:A!=="none",crossAxis:re,limiter:p||T?void 0:$K(yn=>{if(!ae.current)return{};const{width:kt,height:Cn}=ae.current.getBoundingClientRect(),er=Fr(Zn(yn.placement)),An=er==="y"?kt:Cn,is=er==="y"?q.left+q.right:q.top+q.bottom;return{offset:An/2+is/2}})}},[Y,p,T,q,A]);j==="shift"||A==="shift"||a==="center"?Me.push(ie,he):Me.push(he,ie),Me.push(FK({...Y,apply({elements:{floating:ot},rects:{reference:Wt},availableWidth:yn,availableHeight:kt}){const Cn=ot.style;Cn.setProperty("--available-width",`${yn}px`),Cn.setProperty("--available-height",`${kt}px`),Cn.setProperty("--anchor-width",`${Wt.width}px`),Cn.setProperty("--anchor-height",`${Wt.height}px`)}}),O7(()=>({element:ae.current||document.createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(ot){const{elements:Wt,middlewareData:yn,placement:kt,rects:Cn,y:er}=ot,An=Zn(kt),is=Fr(An),as=ae.current,_a=yn.arrow?.x||0,wi=yn.arrow?.y||0,Ei=as?.clientWidth||0,_s=as?.clientHeight||0,tr=_a+Ei/2,cs=wi+_s/2,fo=Math.abs(yn.shift?.y||0),ho=Cn.reference.height/2,nr=typeof i=="function"?i(CC(ot,s,ee)):i,sl=fo>nr,af={top:`${tr}px calc(100% + ${nr}px)`,bottom:`${tr}px ${-nr}px`,left:`calc(100% + ${nr}px) ${cs}px`,right:`${-nr}px ${cs}px`}[An],cf=`${tr}px ${Cn.reference.y+ho-er}px`;return Wt.floating.style.setProperty("--transform-origin",re&&is==="y"&&sl?cf:af),{}}},M7,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:ye,elements:xe,x:ve,y:Ie,middlewareData:Ue,update:Ee,placement:Ve,context:Qe,isPositioned:Be,floatingStyles:We}=u7({rootContext:x,placement:G,middleware:Me,strategy:n,whileElementsMounted:b?void 0:(...ot)=>SC(...ot,we),nodeId:C,externalTree:R}),{sideX:He,sideY:me}=Ue.adaptiveOrigin||uh,Te=Be?n:"fixed",qe=_.useMemo(()=>{const ot=O?{position:Te,[He]:ve,[me]:Ie}:{position:Te,...We};return Be||(ot.opacity=0),ot},[O,Te,He,ve,me,Ie,We,Be]),ht=_.useRef(null);Le(()=>{if(!S)return;const ot=Z.current,Wt=typeof ot=="function"?ot():ot,kt=(RC(Wt)?Wt.current:Wt)||null||null;kt!==ht.current&&(ye.setPositionReference(kt),ht.current=kt)},[S,ye,U,Z]),_.useEffect(()=>{if(!S)return;const ot=Z.current;typeof ot!="function"&&RC(ot)&&ot.current!==ht.current&&(ye.setPositionReference(ot.current),ht.current=ot.current)},[S,ye,U,Z]),_.useEffect(()=>{if(b&&S&&xe.domReference&&xe.floating)return SC(xe.domReference,xe.floating,Ee,we)},[b,S,xe,Ee,we]);const lt=Zn(Ve),wr=PA(s,lt,ee),Er=Si(Ve)||"center",Qt=!!Ue.hide?.referenceHidden;Le(()=>{N&&S&&Be&&z(lt)},[N,S,Be,lt]);const ut=_.useMemo(()=>({position:"absolute",top:Ue.arrow?.y,left:Ue.arrow?.x}),[Ue.arrow]),xt=Ue.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:qe,arrowStyles:ut,arrowRef:ae,arrowUncentered:xt,side:wr,align:Er,physicalSide:lt,anchorHidden:Qt,refs:ye,context:Qe,isPositioned:Be,update:Ee}),[qe,ut,ae,xt,wr,Er,lt,Qt,ye,Qe,Be,Ee])}function RC(e){return e!=null&&"current"in e}function Np(e){return e==="starting"?K9:an}const P7=_.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=Y9,...C}=t,O=Jb(),N=C7(),R=O.useState("open"),M=O.useState("mounted"),z=O.useState("trackCursorAxis"),j=O.useState("disableHoverablePopup"),A=O.useState("floatingRootContext"),P=O.useState("instantType"),Q=O.useState("transitionStatus"),B=O.useState("hasViewport"),U=DA({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?I7:void 0}),Z=_.useMemo(()=>{const G={};return(!R||z==="both"||j)&&(G.pointerEvents="none"),{role:"presentation",hidden:!M,style:{...U.positionerStyles,...G}}},[R,z,j,M,U.positionerStyles]),K=_.useMemo(()=>({open:R,side:U.side,align:U.align,anchorHidden:U.anchorHidden,instant:z!=="none"?"tracking-cursor":P}),[R,U.side,U.align,U.anchorHidden,z,P]),ee=_.useMemo(()=>({...K,arrowRef:U.arrowRef,arrowStyles:U.arrowStyles,arrowUncentered:U.arrowUncentered}),[K,U.arrowRef,U.arrowStyles,U.arrowUncentered]),D=zt("div",t,{state:K,props:[Z,Np(Q),C],ref:[n,O.useStateSetter("positionerElement")],stateAttributesMapping:nl});return h.jsx(MA.Provider,{value:ee,children:D})}),D7={...nl,...ba},z7=_.forwardRef(function(t,n){const{className:s,render:i,...a}=t,l=Jb(),{side:f,align:d}=j7(),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 g7(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,Np(y),a],stateAttributesMapping:D7})});function fx(e){return Kb(19)?e:e?"true":void 0}const L7=_.forwardRef(({className:e,sideOffset:t=4,children:n,...s},i)=>h.jsx(N7,{children:h.jsx(P7,{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})})}));L7.displayName="TooltipContent";function NC(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const zA=_.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),Q=P?S:b,B=P?w:x,U=P?240:260,Z=P?130:150,K=C*A-Math.PI/2;T[j.id]={x:Q+U*Math.cos(K),y:B+Z*Math.sin(K)}});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,z=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:[z," 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),Q=P?S:b,B=P?w:x,U=NC(j.status),Z=j.status==="syncing"?2.5:1.5;if(j.status==="offline")return h.jsx("line",{x1:Q,y1:B,x2:A.x,y2:A.y,stroke:U,strokeWidth:1,strokeDasharray:"3 6",opacity:.2},`line-${j.id}`);const K=j.status==="syncing"?"1.2s":"2.8s",ee=`${Number.parseFloat(K)/2}s`;return h.jsxs("g",{children:[h.jsx("line",{x1:Q,y1:B,x2:A.x,y2:A.y,stroke:U,strokeWidth:Z,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:U,opacity:.7,children:[h.jsx("animateMotion",{dur:K,repeatCount:"indefinite",path:`M${Q},${B} L${A.x},${A.y}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.7;0.7;0",dur:K,repeatCount:"indefinite"})]}),h.jsxs("circle",{r:2,fill:U,opacity:.5,children:[h.jsx("animateMotion",{dur:K,begin:ee,repeatCount:"indefinite",path:`M${A.x},${A.y} L${Q},${B}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.5;0.5;0",dur:K,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=NC(j.status),Q=j.status==="offline"?.25:1,B=j.actor.replace("user-","").replace("svc-",""),U=s.includes(j.id);return h.jsxs("g",{opacity:Q,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,U?" · relay":""]})]},`node-${j.id}`)})]})]})});zA.displayName="TopologyHero";let jC=(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 LA(e){return _.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[jC.checked]:""}:{[jC.unchecked]:""}},...bi}),[e.indeterminate])}const U7=_.createContext({disabled:!1});function $7(){return _.useContext(U7)}const B7=_.createContext(void 0);function F7(e=!0){const t=_.useContext(B7);if(t===void 0&&!e)throw new Error(gn(3));return t}const UA=_.createContext(void 0);function H7(){const e=_.useContext(UA);if(e===void 0)throw new Error(gn(14));return e}const q7="data-parent",V7=_.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}=el(),{disabled:M,name:z,setDirty:j,setFilled:A,setFocused:P,setTouched:Q,state:B,validationMode:U,validityData:Z,shouldValidateOnChange:K,validation:ee}=xi(),D=$7(),{labelId:G,controlId:q,registerControlId:V,getDescriptionProps:L}=lo(),I=F7(),H=I?.parent,W=H&&I.allValues,Y=M||D.disabled||I?.disabled||l,ae=z??g,se=C??ae,fe=br(),Se=br();let pe=q;W?pe=b?Se:`${H.id}-${se}`:f&&(pe=f);let Me={};W&&(b?Me=I.parent.getParentProps():se&&(Me=I.parent.getChildProps(se)));const _e=ke(y),{checked:re=s,indeterminate:he=d,onCheckedChange:ie,...we}=Me,ye=I?.value,xe=I?.setValue,ve=I?.defaultValue,Ie=_.useRef(null),Ue=zn(()=>Symbol("checkbox-control")),Ee=_.useRef(!1),{getButtonProps:Ve,buttonRef:Qe}=Jc({disabled:Y,native:O}),Be=I?.validation??ee,[We,He]=pp({controlled:se&&ye&&!b?ye.includes(se):re,default:se&&ve&&!b?ve.includes(se):a,name:"Checkbox",state:"checked"});Le(()=>{V!==jn&&(Ee.current=!0,V(Ue.current,pe))},[pe,I,V,b,Ue]),_.useEffect(()=>{const ut=Ue.current;return()=>{!Ee.current||V===jn||(Ee.current=!1,V(ut,void 0))}},[V,Ue]),Ij({enabled:!I,id:fe,commit:Be.commit,value:We,controlRef:Ie,name:ae,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]),Uj(We,()=>{I&&!b||(R(ae),A(We),j(We!==Z.initialValue),K()?Be.commit(We):Be.commit(We,!0))});const qe=oi({checked:We,disabled:Y,name:b?void 0:ae,id:O?void 0:pe??void 0,required:w,ref:Te,style:ae?Tj:mp,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(ie?.(xt,ot),_e(xt,ot),!ot.isCanceled&&(He(xt),se&&ye&&xe&&!b)){const Wt=xt?[...ye,se]:ye.filter(yn=>yn!==se);xe(Wt,ot)}},onFocus(){Ie.current?.focus()}},C!==void 0?{value:(I?We&&C:C)||""}:an,L,I?Be.getValidationProps:Be.getInputValidationProps),ht=W?!!re:We,lt=W&&he||d;_.useEffect(()=>{if(!H||!se)return;const ut=H.disabledStatesRef.current;return ut.set(se,Y),()=>{ut.delete(se)}},[H,Y,se]);const wr=_.useMemo(()=>({...B,checked:ht,disabled:Y,readOnly:x,required:w,indeterminate:lt}),[B,ht,Y,x,w,lt]),Er=LA(wr),Qt=zt("span",t,{state:wr,ref:[Qe,Ie,n,I?.registerControlRef],props:[{id:O?pe??void 0:fe,role:"checkbox","aria-checked":he?"mixed":We,"aria-readonly":x||void 0,"aria-required":w||void 0,"aria-labelledby":G,[q7]:b?"":void 0,onFocus(){P(!0)},onBlur(){const ut=me.current;ut&&(Q(!0),P(!1),U==="onBlur"&&Be.commit(I?ye:ut.checked))},onClick(ut){x||Y||(ut.preventDefault(),me.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ut.shiftKey,ctrlKey:ut.ctrlKey,altKey:ut.altKey,metaKey:ut.metaKey})))}},L,Be.getValidationProps,N,we,Ve],stateAttributesMapping:Er});return h.jsxs(UA.Provider,{value:wr,children:[Qt,!We&&!I&&ae&&!b&&T!==void 0&&h.jsx("input",{type:"hidden",name:ae,value:T}),h.jsx("input",{...qe})]})}),K7=_.forwardRef(function(t,n){const{render:s,className:i,keepMounted:a=!1,...l}=t,f=H7(),d=f.checked||f.indeterminate,{mounted:p,transitionStatus:g,setMounted:y}=Rp(d),b=_.useRef(null),x={...f,transitionStatus:g};xa({open:d,ref:b,onComplete(){d||y(!1)}});const S=LA(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}),Uv=_.forwardRef(({className:e,label:t,...n},s)=>{const i=h.jsx(V7,{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(K7,{className:"flex items-center justify-center text-white",children:h.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M1.5 4L3.25 5.75L6.5 2.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})});return t?h.jsxs("span",{className:"inline-flex items-center gap-2 cursor-pointer font-mono text-[11px] text-neutral-400",children:[i,h.jsx("span",{children:t})]}):i});Uv.displayName="Checkbox";const G7=_.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function Z7(e=!1){const t=_.useContext(G7);if(!t&&!e)throw new Error(gn(86));return t}const Y7=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}=lo(),y=ke((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(Pj.Provider,{value:x,children:t.children})},fh=Object.keys(xp);function X7(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 Q7(e){const{formRef:t,clearErrors:n}=el(),{setValidityData:s,validate:i,validityData:a,validationDebounceTime:l,invalid:f,markedDirtyRef:d,state:p,name:g,shouldValidateOnChange:y}=e,{controlId:b,getDescriptionProps:x}=lo(),S=ns(),w=_.useRef(null),T=ke(async(N,R=!1)=>{const M=w.current;if(!M)return;if(R){if(p.valid!==!1)return;const Z=M.validity;if(!Z.valueMissing){const ee={value:N,state:{...xp,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,...kv(ee,!1)})}s(ee);return}const K=fh.reduce((ee,D)=>(ee[D]=Z[D],ee),{});if(!K.valid&&!X7(K))return}function z(Z){const K=fh.reduce((D,G)=>(D[G]=Z.validity[G],D),{});let ee=!1;for(const D of fh)if(D!=="valid"){if(D==="valueMissing"&&K[D])ee=!0;else if(K[D])return K}return ee&&!d.current&&(K.valid=!0,K.valueMissing=!1),K}S.clear();let j=null,A=[];const P=z(M);let Q;const B=y();if(M.validationMessage&&!B)Q=M.validationMessage,A=[M.validationMessage];else{const Z=Array.from(t.current.fields.values()).reduce((ee,D)=>(D.name&&(ee[D.name]=D.getValue()),ee),{}),K=i(N,Z);typeof K=="object"&&K!==null&&"then"in K?j=await K:j=K,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?(Q=M.validationMessage,A=[M.validationMessage]):M.validity.valid&&!P.valid&&(P.valid=!0))}const U={value:N,state:P,error:Q??(Array.isArray(j)?j[0]:j??""),errors:A,initialValue:a.initialValue};if(b){const Z=t.current.fields.get(b);Z&&t.current.fields.set(b,{...Z,...kv(U,f)})}s(U)}),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 W7=_.forwardRef(function(t,n){const{errors:s,validationMode:i,submitAttemptedRef:a}=el(),{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}=Z7(),N=ke(d||(()=>null)),R=O||b,[M,z]=_.useState(!1),[j,A]=_.useState(!1),[P,Q]=_.useState(!1),[B,U]=_.useState(!1),Z=S??j,K=w??M,ee=_.useRef(!1),D=ke(Se=>{S===void 0&&(Se&&(ee.current=!0),A(Se))}),G=ke(Se=>{w===void 0&&z(Se)}),q=ke(()=>g==="onChange"||g==="onSubmit"&&a.current),V=!!(x||y&&{}.hasOwnProperty.call(s,y)&&s[y]!==void 0),[L,I]=_.useState({state:xp,error:"",errors:[],value:null,initialValue:null}),H=!V&&L.state.valid,W=_.useMemo(()=>({disabled:R,touched:K,dirty:Z,valid:H,filled:P,focused:B}),[R,K,Z,H,P,B]),Y=Q7({setValidityData:I,validate:N,validityData:L,validationDebounceTime:p,invalid:V,markedDirtyRef:ee,state:W,name:y,shouldValidateOnChange:q}),ae=_.useCallback(()=>{ee.current=!0,Y.commit(L.value)},[Y,L]);_.useImperativeHandle(T,()=>({validate:ae}),[ae]);const se=_.useMemo(()=>({invalid:V,name:y,validityData:L,setValidityData:I,disabled:R,touched:K,setTouched:G,dirty:Z,setDirty:D,filled:P,setFilled:Q,focused:B,setFocused:U,validate:N,validationMode:g,validationDebounceTime:p,shouldValidateOnChange:q,state:W,markedDirtyRef:ee,validation:Y}),[V,y,L,R,K,G,Z,D,P,Q,B,U,N,g,p,q,W,Y]),fe=zt("div",t,{ref:n,state:W,props:C,stateAttributesMapping:bi});return h.jsx(Mj.Provider,{value:se,children:fe})}),J7=_.forwardRef(function(t,n){return h.jsx(Y7,{children:h.jsx(W7,{...t,ref:n})})}),eG=_.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}=lo(),b=br(a),x=_.useRef(null),S=ke(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})}),tG={...bi,...ba},nG=_.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}=lo(),{errors:x}=el(),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}=Rp(w);Le(()=>{if(!(!w||!d))return b(U=>U.concat(d)),()=>{b(U=>U.filter(Z=>Z!==d))}},[w,d,b]);const N=_.useRef(null),[R,M]=_.useState(null),[z,j]=_.useState(null),A=S||(p.errors.length>1?h.jsx("ul",{children:p.errors.map(U=>h.jsx("li",{children:U},U))}):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!==z&&(j(P),M(A)),xa({open:w,ref:N,onComplete(){w||O(!1)}});const Q={...g,transitionStatus:C},B=zt("div",t,{ref:[n,N],state:Q,props:[{id:d,children:w?A:R},f],stateAttributesMapping:tG,enabled:T});return T?B:null}),rG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,...l}=t,f=br(i),d=xi(!1),{setMessageIds:p}=lo();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})}),ps=J7,es=_.forwardRef(({className:e,...t},n)=>h.jsx(eG,{ref:n,className:ge("font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",e),...t}));es.displayName="FieldLabel";const pc=_.forwardRef(({className:e,...t},n)=>h.jsx(rG,{ref:n,className:ge("font-mono text-[9px] text-neutral-600 mt-0.5",e),...t}));pc.displayName="FieldDescription";const sG=_.forwardRef(({className:e,...t},n)=>h.jsx(nG,{ref:n,className:ge("font-mono text-[10px] text-offline mt-1",e),...t}));sG.displayName="FieldError";const oG=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge(e),...t}));oG.displayName="FieldContent";const iG=_.createContext(null),aG=_.createContext(null);function Wu(){const e=_.useContext(iG);if(e===null)throw new Error(gn(60));return e}function $A(){const e=_.useContext(aG);if(e===null)throw new Error(gn(61));return e}function $c(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function cG(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:$c(t,s,n))}function zy(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:$c(s,t,n))}function lG(e,t,n){return e.filter(s=>!$c(t,s,n))}function AC(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function uG(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function fG(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(uG(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 dG(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?AC(e.value):AC(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:dG(t,s)!==""}),hasNullItemLabel:Pe((e,t)=>t?fG(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=>$c(n,a,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:$c(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 hG(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 pG(e){const[t,n]=_.useState(null),s=ke((f,d)=>{e||n(d||(tA?"touch":""))}),i=_.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:l}=hG(s);return _.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:l}}),[t,i,a,l])}function mG(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,gG=400,kC=200,yG={...T7,...bi,value:()=>null},vG=_.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}=lo(),{store:w,setOpen:T,selectionRef:C,validation:O,readOnly:N,required:R,alignItemWithTriggerActiveRef:M,disabled:z,keyboardActiveRef:j}=Wu(),A=x||z||l,P=at(w,it.open),Q=at(w,it.value),B=at(w,it.triggerProps),U=at(w,it.positionerElement),Z=at(w,it.listElement),K=at(w,it.id),ee=at(w,it.hasSelectedValue),D=!ee&&P,G=at(w,it.hasNullItemLabel,D),q=a??K;Dj({id:q});const V=Jo(U),L=_.useRef(null),{getButtonProps:I,buttonRef:H}=Jc({disabled:A,native:f}),W=ke(re=>{w.set("triggerElement",re)}),Y=so(n,L,H,W),ae=ns(),se=ns(),fe=ns(),Se=ns();_.useEffect(()=>{if(P)return!(ee||G)?fe.start(gG,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}):Se.start(kC,()=>{C.current.allowUnselectedMouseUp=!0,fe.start(kC,()=>{C.current.allowSelectedMouseUp=!0})}),()=>{fe.clear(),Se.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},se.clear()},[P,ee,G,C,se,fe,Se]);const pe=_.useMemo(()=>Z?.id??Bh(U)?.id,[Z,U]),Me=oi(B,{id:q,role:"combobox","aria-expanded":P?"true":"false","aria-haspopup":"listbox","aria-controls":P?pe:void 0,"aria-labelledby":S,"aria-readonly":N||void 0,"aria-required":R||void 0,tabIndex:A?-1:0,ref:Y,onFocus(re){g(!0),P&&M.current&&T(!1,Yt(ii,re.nativeEvent)),ae.start(0,()=>{w.set("forceMount",!0)})},onBlur(re){Ot(U,re.relatedTarget)||(p(!0),g(!1),y==="onBlur"&&O.commit(Q))},onPointerMove(){j.current=!1},onKeyDown(){j.current=!0},onMouseDown(re){if(P)return;const he=Rt(re.currentTarget);function ie(we){if(!L.current)return;const ye=we.target;if(Ot(L.current,ye)||Ot(V.current,ye)||ye===L.current)return;const xe=mG(L.current);we.clientX>=xe.left-qd&&we.clientX<=xe.right+qd&&we.clientY>=xe.top-qd&&we.clientY<=xe.bottom+qd||T(!1,Yt(y8,we))}se.start(0,()=>{he.addEventListener("mouseup",ie,{once:!0})})}},O.getValidationProps,d,I);Me.role="combobox";const _e={...b,open:P,disabled:A,value:Q,readOnly:N,placeholder:!ee};return zt("button",t,{ref:[n,L],state:_e,stateAttributesMapping:yG,props:Me})}),bG=_.createContext(void 0),xG=_.forwardRef(function(t,n){const{store:s}=Wu(),i=at(s,it.mounted),a=at(s,it.forceMount);return i||a?h.jsx(bG.Provider,{value:!0,children:h.jsx(SA,{ref:n,...t})}):null});let OC={},MC={},IC="";function SG(e){if(typeof document>"u")return!1;const t=Rt(e);return un(t).innerWidth-t.documentElement.clientWidth>0}function _G(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 wG(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 EG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=un(n);let a=0,l=0,f=!1;const d=gs.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,OC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},IC=n.style.scrollBehavior,MC={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),z=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=_G(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||z?`calc(100dvh - ${j+z}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,OC),Object.assign(s.style,MC),f||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=IC)}function y(){g(),d.request(p)}return p(),i.addEventListener("resize",y),()=>{d.cancel(),g(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",y)}}class TG{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=tA||!SG(t);this.restore=a?wG(t):EG(t)}}const CG=new TG;function BA(e=!0,t=null){Le(()=>{if(e)return CG.acquire(t)},[e,t])}const FA=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function RG(){return _.useContext(FA)}function HA(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:i}=e,a=ke(i),l=_.useRef(0),f=zn(jG).current,d=zn(NG).current,[p,g]=_.useState(0),y=_.useRef(p),b=ke((C,O)=>{d.set(C,O??null),y.current+=1,g(y.current)}),x=ke(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(AG).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=ke(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(FA.Provider,{value:T,children:t})}function NG(){return new Map}function jG(){return new Set}function AG(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 qA=_.createContext(void 0);function kG(){const e=_.useContext(qA);if(!e)throw new Error(gn(59));return e}const VA=_.forwardRef(function(t,n){const{cutout:s,...i}=t;let a;if(s){const l=s?.getBoundingClientRect();a=`polygon(
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"],Sj=_.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})]})]}));Sj.displayName="ActivityBars";const XT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,QT=Hb,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"}}),Kn=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("input",{ref:s,className:ge(A9({variant:t,className:e})),...n}));Kn.displayName="Input";function pp({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 Ty=I1[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],k9=Ty&&Ty!==_.useLayoutEffect?Ty:e=>e();function ke(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(_j).current;return P9(i,e,t,n,s)&&wj(i,[e,t,n,s]),i.callback}function I9(e){const t=zn(_j).current;return D9(t,e)&&wj(t,e),t.callback}function _j(){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 wj(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,Ej={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},mp={...Ej,position:"fixed",top:0,left:0},Tj={...Ej,position:"absolute"};function jn(){}const Eu=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 Gb(e){return L9>=e}function JT(e){if(!_.isValidElement(e))return null;const t=e,n=t.props;return(Gb(19)?n?.ref:t.ref)??null}function Cv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function 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 uu={};function oi(e,t,n,s,i){let a={...Rv(e,uu)};return t&&(a=iu(a,t)),n&&(a=iu(a,n)),s&&(a=iu(a,s)),i&&(a=iu(a,i)),a}function F9(e){if(e.length===0)return uu;if(e.length===1)return Rv(e[0],uu);let t={...Rv(e[0],uu)};for(let n=1;n<e.length;n+=1)t=iu(t,e[n]);return t}function iu(e,t){return Cj(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]=Cv(e.style,s);break}case"className":{e[n]=Rj(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 Cj(e){return typeof e=="function"}function Rv(e,t){return Cj(e)?e(t):e??uu}function V9(e,t){return t?e?n=>{if(G9(n)){const i=n;Nv(i);const a=t(i);return i.baseUIHandlerPrevented||e?.(i),a}const s=t(n);return e?.(n),s}:t:e}function Nv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Rj(e,t){return t?e?t+" "+e:t:e}function G9(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const K9={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?Cv(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=Rj(x.className,g)),y!==void 0&&(x.style=Cv(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 Ku(e,t){if(tC!==void 0){const n=tC();return e??(t?`${t}-${n}`:n)}return r8(e,t)}function br(e){return Ku(e,"base-ui")}function gp(){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 Ss(e){var t;return(t=(Kb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kb(e){return gp()?e instanceof Node||e instanceof un(e).Node:!1}function jt(e){return gp()?e instanceof Element||e instanceof un(e).Element:!1}function Zt(e){return gp()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function jv(e){return!gp()||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 yp(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 Zb(e){const t=vp(),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(Zb(t))return t;if(yp(t))return null;t=oo(t)}return null}function vp(){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 bp(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||jv(e)&&e.host||Ss(e);return jv(t)?t.host:t}function Nj(e){const t=oo(e);return Ys(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zt(t)&&vi(t)?t:Nj(t)}function Wo(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Nj(e),a=i===((s=e.ownerDocument)==null?void 0:s.body),l=un(i);if(a){const f=Av(l);return t.concat(l,l.visualViewport||[],vi(i)?i:[],f&&n?Wo(f):[])}return t.concat(i,Wo(i,[],n))}function Av(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const jj=_.createContext(void 0);function Aj(e=!1){const t=_.useContext(jj);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 Jc(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=e,a=_.useRef(null),l=Aj(!0)!==void 0,f=ke(()=>{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||(Nv(R),T?.(R)),R.baseUIHandlerPrevented)return;const M=R.target===R.currentTarget&&!i&&!f()&&!t,z=R.key==="Enter",j=R.key===" ";M&&((j||z)&&R.preventDefault(),z&&x?.(R))},onKeyUp(R){t||(Nv(R),w?.(R)),!R.baseUIHandlerPrevented&&R.target===R.currentTarget&&!i&&!t&&R.key===" "&&x?.(R)},onPointerDown(R){if(t){R.preventDefault();return}C?.(R)}},i?void 0:{role:"button"},d,O)},[t,d,i,f]),y=ke(b=>{a.current=b,p()});return{getButtonProps:g,buttonRef:y}}function p8(e){return Zt(e)&&e.tagName==="BUTTON"}const kj=_.createContext(void 0);function m8(){const e=_.useContext(kj);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 xp={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 Oj={...bi,checked(e){return e?{[rC.checked]:""}:{[rC.unchecked]:""}}};function kv(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 el(){return _.useContext(g8)}const Mj=_.createContext({invalid:void 0,name:void 0,validityData:{state:xp,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(Mj);if(t.setValidityData===jn&&!e)throw new Error(yn(28));return t}function Ij(e){const{enabled:t=!0,value:n,id:s,name:i,controlRef:a,commit:l}=e,{formRef:f}=el(),{invalid:d,markedDirtyRef:p,validityData:g,setValidityData:y}=xi(),b=ke(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:kv(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 Pj=_.createContext({controlId:void 0,registerControlId:jn,labelId:void 0,setLabelId:jn,messageIds:[],setMessageIds:jn,getDescriptionProps:e=>e});function lo(){return _.useContext(Pj)}function Dj(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:i,registerControlId:a}=lo(),l=br(t),f=n?i:void 0,d=zn(()=>Symbol("labelable-control")),p=_.useRef(!1),g=_.useRef(t!=null),y=ke(()=>{!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",Ov="trigger-hover",zj="outside-press",Cy="item-press",Lj="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 Uj(e,t){const n=_.useRef(e),s=ke(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}=el(),{state:N,setTouched:R,setDirty:M,validityData:z,setFilled:j,setFocused:A,shouldValidateOnChange:P,validationMode:Q,disabled:B,name:U,validation:Z}=xi(),{labelId:G}=lo(),ee=B||x,D=U??d,K=ke(g),q=_.useRef(null),V=so(q,f,Z.inputRef),L=_.useRef(null),I=br(),H=Dj({id:l,implicit:!1,controlRef:L}),W=p?void 0:H,[Y,ae]=pp({controlled:s,default:!!a,name:"Switch",state:"checked"});Ij({id:I,commit:Z.commit,value:Y,controlRef:L,name:D,getValue:()=>Y}),Le(()=>{q.current&&j(q.current.checked)},[q,j]),Uj(Y,()=>{O(D),M(Y!==z.initialValue),j(Y),P()?Z.commit(Y):Z.commit(Y,!0)});const{getButtonProps:se,buttonRef:fe}=Jc({disabled:ee,native:p}),Se={id:p?H:I,role:"switch","aria-checked":Y,"aria-readonly":y||void 0,"aria-required":b||void 0,"aria-labelledby":G,onFocus(){ee||A(!0)},onBlur(){const re=q.current;!re||ee||(R(!0),A(!1),Q==="onBlur"&&Z.commit(re.checked))},onClick(re){y||ee||(re.preventDefault(),q.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:re.shiftKey,ctrlKey:re.ctrlKey,altKey:re.altKey,metaKey:re.metaKey})))}},pe=_.useMemo(()=>oi({checked:Y,disabled:ee,id:W,name:D,required:b,style:D?Tj:mp,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(re){if(re.nativeEvent.defaultPrevented)return;const he=re.target.checked,ie=Yt(ii,re.nativeEvent);K?.(he,ie),!ie.isCanceled&&ae(he)},onFocus(){L.current?.focus()}},Z.getInputValidationProps,T!==void 0?{value:T}:an),[Y,ee,V,W,D,K,b,ae,Z,T]),Me=_.useMemo(()=>({...N,checked:Y,disabled:ee,readOnly:y,required:b}),[N,Y,ee,y,b]),_e=zt("span",t,{state:Me,ref:[n,L,fe],props:[Se,Z.getValidationProps,C,se],stateAttributesMapping:Oj});return h.jsxs(kj.Provider,{value:Me,children:[_e,!Y&&D&&w!==void 0&&h.jsx("input",{type:"hidden",name:D,value:w}),h.jsx("input",{...pe})]})}),_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:Oj,props:a})}),Sp=_.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"})}));Sp.displayName="Switch";const $j=_.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(Sp,{checked:t,onCheckedChange:d=>n?.(d)})]}),h.jsxs("div",{className:"p-4 space-y-3",children:[h.jsx(Ry,{label:"P90 latency threshold",value:s.p90Latency,onChange:d=>f("p90Latency",d)}),h.jsx(Ry,{label:"Error rate threshold",value:s.errorRate,onChange:d=>f("errorRate",d)}),h.jsx(Ry,{label:"Client lag threshold",value:s.clientLag,onChange:d=>f("clientLag",d)})]})]})});$j.displayName="AlertsConfig";function Ry({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(Kn,{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] 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,...n},s)=>h.jsx("span",{ref:s,className:ge(w8({variant:t,className:e})),...n}));mn.displayName="Badge";const E8=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"}}),Ce=_.forwardRef(({className:e,variant:t,size:n,...s},i)=>h.jsx("button",{ref:i,className:ge(E8({variant:t,size:n,className:e})),...s}));Ce.displayName="Button";const T8={relay:"relay",admin:"flow",proxy:"ghost"},C8=_.forwardRef(({className:e,keys:t,onCreateKey:n,onRotateKey:s,onRevokeKey:i,...a},l)=>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:"API Keys"}),n&&h.jsx(Ce,{variant:"primary",size:"sm",onClick:n,children:"+ Create Key"})]}),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:"w-[140px]",children:"Name"}),h.jsx("span",{className:"w-[70px]",children:"Type"}),h.jsx("span",{className:"flex-1",children:"Prefix"}),h.jsx("span",{className:"w-[90px]",children:"Created"}),h.jsx("span",{className:"w-[80px] text-right",children:"Actions"})]}),t.map((f,d)=>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",d<t.length-1&&"border-b border-[#141414]"),children:[h.jsx("span",{className:"w-[140px] text-white truncate",children:f.name}),h.jsx("span",{className:"w-[70px]",children:h.jsx(mn,{variant:T8[f.type]??"ghost",children:f.type})}),h.jsx("span",{className:"flex-1 text-neutral-500 truncate",children:f.prefix}),h.jsx("span",{className:"w-[90px] text-neutral-600 truncate",children:f.created}),h.jsxs("span",{className:"w-[80px] flex gap-2 justify-end",children:[s&&h.jsx(Ce,{variant:"default",size:"sm",className:"text-[9px] px-1.5 py-0.5",onClick:()=>s(f.name),children:"Rotate"}),i&&h.jsx(Ce,{variant:"destructive",size:"sm",className:"text-[9px] px-1.5 py-0.5",onClick:()=>i(f.name),children:"Revoke"})]})]},`${f.name}:${f.prefix}:${d}`))]}));C8.displayName="ApiKeysTable";const Bj=_.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})]})]}));Bj.displayName="BottomBar";const Fj=_.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))]}));Fj.displayName="CommitTable";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(Kn,{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(Kn,{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(Ce,{variant:"primary",size:"md",onClick:d,disabled:n,children:n?"Connecting...":"Save + Connect"}),h.jsx(Ce,{variant:"default",size:"md",onClick:g,disabled:n||s,children:s?"Testing...":"Test Connection"}),h.jsx(Ce,{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 R8=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(R8({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 N8({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 Yb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...t}));Yb.displayName="Card";const j8=_.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}));j8.displayName="CardHeader";const A8=_.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));A8.displayName="CardTitle";const Xb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("p-4",e),...t}));Xb.displayName="CardContent";const k8=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-4 py-2.5 border-t border-border",e),...t}));k8.displayName="CardFooter";function Qb({action:e,className:t,icon:n,message:s}){return h.jsxs("div",{className:ge("flex flex-col items-center justify-center gap-3 py-12",t),children:[n?h.jsx("div",{className:"text-neutral-500",children:n}):null,h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:s}),e?h.jsx("div",{children:e}):null]})}const 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(O8,{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 O8({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 M8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const I8={online:"healthy",syncing:"syncing",offline:"offline"},P8={realtime:"flow",polling:"ghost"},D8=_.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=M8(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:I8[t.status],children:t.status}),h.jsx(mn,{variant:P8[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(Ny,{label:"Actor",value:t.actor}),h.jsx(Ny,{label:"Dialect",value:t.dialect}),h.jsx(Ny,{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"]})]})]})});D8.displayName="FleetCard";function Ny({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 Zu=_.forwardRef(({className:e,...t},n)=>h.jsx("table",{ref:n,className:ge("w-full",e),...t}));Zu.displayName="Table";const Yu=_.forwardRef(({className:e,...t},n)=>h.jsx("thead",{ref:n,className:ge(e),...t}));Yu.displayName="TableHeader";const Xu=_.forwardRef(({className:e,...t},n)=>h.jsx("tbody",{ref:n,className:ge(e),...t}));Xu.displayName="TableBody";const io=_.forwardRef(({className:e,...t},n)=>h.jsx("tr",{ref:n,className: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 cursor-default",e),...t}));io.displayName="TableRow";const yt=_.forwardRef(({className:e,...t},n)=>h.jsx("th",{ref:n,className:ge("font-mono text-[9px] text-neutral-600 uppercase tracking-wider leading-6 bg-white/[0.01] text-left",e),...t}));yt.displayName="TableHead";const vt=_.forwardRef(({className:e,...t},n)=>h.jsx("td",{ref:n,className:ge("whitespace-nowrap overflow-hidden text-ellipsis",e),...t}));vt.displayName="TableCell";function z8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const L8={online:"healthy",syncing:"syncing",offline:"offline"},Vj=_.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(Zu,{children:[h.jsx(Yu,{children:h.jsxs(io,{children:[h.jsx(yt,{children:"Client"}),h.jsx(yt,{children:"Status"}),h.jsx(yt,{children:"Type"}),h.jsx(yt,{children:"Cursor"}),h.jsx(yt,{children:"Lag"}),h.jsx(yt,{children:"Dialect"}),h.jsx(yt,{children:"Mode"}),s&&h.jsx(yt,{children:"Actions"})]})}),h.jsx(Xu,{children:t.map(l=>{const f=Math.max(0,n-l.cursor),d=n>0?Math.min(100,l.cursor/n*100):100,p=z8(f);return h.jsxs(io,{children:[h.jsx(vt,{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(vt,{children:h.jsx(mn,{variant:L8[l.status],children:l.status})}),h.jsx(vt,{children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.type})}),h.jsx(vt,{children:h.jsxs("span",{className:"font-mono text-[11px] text-white font-medium",children:["#",l.cursor.toLocaleString()]})}),h.jsx(vt,{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(vt,{children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.dialect})}),h.jsx(vt,{children:h.jsx(mn,{variant:l.mode==="realtime"?"flow":"ghost",children:l.mode})}),s&&h.jsx(vt,{children:h.jsx("button",{type:"button",onClick:()=>s(l.id),className:"inline-flex items-center gap-1 rounded-md font-mono text-[9px] px-2 py-1 border border-transparent text-neutral-600 hover:border-offline/50 hover:text-offline hover:bg-offline/[0.06] cursor-pointer transition-all opacity-0 group-hover:opacity-100",children:"evict"})})]},l.id)})})]})}));Vj.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 U8={flow:"bg-flow",healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",relay:"bg-relay",muted:"bg-neutral-500"},Kj=_.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($8,{item:i,showDivider:a>0},i.label))}));Kj.displayName="KpiStrip";function $8({item:e,showDivider:t}){const n=U8[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 Zj=_.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})]})]})]})});Zj.displayName="LatencyPercentilesBar";const B8={PUSH:"syncing",PULL:"healthy",ACK:"flow"},Yj=_.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:B8[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}`))})]})});Yj.displayName="LiveActivityFeed";const F8={syncing:"bg-syncing",flow:"bg-flow",healthy:"bg-healthy",offline:"bg-offline"},_p=_.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",F8[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(Ce,{variant:l,size:"md",onClick:d,children:[f,a]})]})]}));_p.displayName="MaintenanceCard";function H8({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Yb,{className:ge("border-border",n),children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Xb,{className:s,children:t})]})}const Xj=_.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(Ce,{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(q8,{row:a,showDivider:l>0},a.label))})]}));Xj.displayName="PreferencesPanel";function q8({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(Sp,{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(Yb,{className:n,children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Xb,{className:s,children:t})]})}const V8={commit:"text-flow",push:"text-syncing",pull:"text-healthy"},G8={applied:"text-healthy",error:"text-offline",cached:"text-syncing"},Qj=_.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(K8,{entry:d,isSelected:a===d.id,onClick:i},`${d.id}-${p}`))}),s]}));Qj.displayName="StreamLog";function K8({entry:e,isSelected:t,onClick:n}){const s=V8[e.type]??"text-neutral-500",i=G8[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 Z8(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const Wj=_.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=Z8(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"})]})]})]})]})});Wj.displayName="SyncHorizon";function Y8(e){const t=_.useRef(!0);t.current&&(t.current=!1,e())}const X8=_.createContext(void 0);function Jb(e){const t=_.useContext(X8);if(t===void 0)throw new Error(yn(72));return t}const Q8=[];function ex(e){_.useEffect(e,Q8)}const ru=0;class ai{static create(){return new ai}currentId=ru;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ru,n()},t)}isStarted(){return this.currentId!==ru}clear=()=>{this.currentId!==ru&&(clearTimeout(this.currentId),this.currentId=ru)};disposeEffect=()=>this.clear}function ns(){const e=zn(ai.create).current;return ex(e.disposeEffect),e}function Jo(e){const t=zn(W8,e).current;return t.next=e,Le(t.effect),t}function W8(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Rt(e){return e?.ownerDocument||document}const tl=typeof navigator<"u",jy=tV(),Jj=rV(),eA=nV(),tx=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),tA=jy.platform==="MacIntel"&&jy.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(jy.platform),J8=tl&&/apple/i.test(navigator.vendor),Mv=tl&&/android/i.test(Jj)||/android/i.test(eA);tl&&Jj.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const eV=eA.includes("jsdom/");function tV(){if(!tl)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 nV(){if(!tl)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function rV(){if(!tl)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Iv="data-base-ui-focusable",nA="active",rA="selected",sA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ay="ArrowLeft",ky="ArrowRight",sV="ArrowUp",oV="ArrowDown";function Fo(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&&jv(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function iV(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 Jr(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 aV(e){return e.matches("html,body")}function oA(e){return Zt(e)&&e.matches(sA)}function oC(e){return e?e.getAttribute("role")==="combobox"&&oA(e):!1}function Bh(e){return e?e.hasAttribute(Iv)?e:e.querySelector(`[${Iv}]`)||e:null}function xc(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...xc(e,i.id,n)])}function iC(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 Gi(e){e.preventDefault(),e.stopPropagation()}function cV(e){return"nativeEvent"in e}function lV(e){return e.pointerType===""&&e.isTrusted?!0:Mv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function uV(e){return eV?!1:!Mv&&e.width===0&&e.height===0||Mv&&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 fV(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function dV(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const hV=["top","right","bottom","left"],Lc=Math.min,dr=Math.max,Fh=Math.round,hc=Math.floor,bs=e=>({x:e,y:e}),pV={left:"right",right:"left",bottom:"top",top:"bottom"},mV={start:"end",end:"start"};function Pv(e,t,n){return dr(e,Lc(t,n))}function ao(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 gV=new Set(["top","bottom"]);function Fr(e){return gV.has(Zn(e))?"y":"x"}function sx(e){return nx(Fr(e))}function yV(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=Hh(l)),[l,Hh(l)]}function vV(e){const t=Hh(e);return[Dv(e),t,Dv(t)]}function Dv(e){return e.replace(/start|end/g,t=>mV[t])}const aC=["left","right"],cC=["right","left"],bV=["top","bottom"],xV=["bottom","top"];function SV(e,t,n){switch(e){case"top":case"bottom":return n?t?cC:aC:t?aC:cC;case"left":case"right":return t?bV:xV;default:return[]}}function _V(e,t,n,s){const i=Si(e);let a=SV(Zn(e),n==="start",s);return i&&(a=a.map(l=>l+"-"+i),t&&(a=a.concat(a.map(Dv)))),a}function Hh(e){return e.replace(/left|right|bottom|top/g,t=>pV[t])}function wV(e){return{top:0,right:0,bottom:0,left:0,...e}}function iA(e){return typeof e!="number"?wV(e):{top:e,right:e,bottom:e,left:e}}function qh(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 EV(e,t){return fr(e,{disabledIndices:t})}function TV(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&&fu(e,a,s));return a}function CV(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 z=b[R];if(z.length===0){R=C==="up"?R-1:R+1;continue}const j=Math.min(N,z.length-1);for(let A=j;A>=0;A-=1){const P=z[A];if(!fu(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===sV){const C=T("up");if(C!==void 0)g&&Gi(t),y=C;else{if(g&&Gi(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===oV){const C=T("down");C!==void 0?(g&&Gi(t),y=C):(g&&Gi(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=hc(p/a);t.key===(i?Ay:ky)&&(g&&Gi(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?ky:Ay)&&(g&&Gi(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=hc(d/a)===C;ch(e,y)&&(s&&O?y=t.key===(i?ky:Ay)?d:fr(e,{startingIndex:p-p%a-1,disabledIndices:l}):y=p)}return y}function RV(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 NV(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 jV(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function fu(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const s=e.current[t];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}var AV=["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] *)"],Vh=AV.join(","),aA=typeof Element>"u",Uc=aA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gh=!aA&&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},Kh=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]"):Kh(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"},cA=function(t,n,s){if(Kh(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Vh));return n&&Uc.call(t,Vh)&&i.unshift(t),i=i.filter(s),i},Zh=function(t,n,s){for(var i=[],a=Array.from(t);a.length;){var l=a.shift();if(!Kh(l,!1))if(l.tagName==="SLOT"){var f=l.assignedElements(),d=f.length?f:l.children,p=Zh(d,!0,s);s.flatten?i.push.apply(i,p):i.push({scopeParent:l,candidates:p})}else{var g=Uc.call(l,Vh);g&&s.filter(l)&&(n||!t.includes(l))&&i.push(l);var y=l.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(l),b=!Kh(y,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(l));if(y&&b){var x=Zh(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},lA=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},uA=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||kV(t))&&!lA(t)?0:t.tabIndex},OV=function(t,n){var s=uA(t);return s<0&&n&&!lA(t)?0:s},MV=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},fA=function(t){return t.tagName==="INPUT"},IV=function(t){return fA(t)&&t.type==="hidden"},PV=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},DV=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},zV=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=DV(i,t.form);return!a||a===t},LV=function(t){return fA(t)&&t.type==="radio"},UV=function(t){return LV(t)&&!zV(t)},$V=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},lC=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},BV=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=Uc.call(t,"details>summary:first-of-type"),f=l?t.parentElement:t;if(Uc.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 lC(t);t.assignedSlot?t=t.assignedSlot:!p&&g!==t.ownerDocument?t=g.host:t=p}t=d}if($V(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return lC(t);return!1},FV=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 Uc.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},zv=function(t,n){return!(n.disabled||IV(n)||BV(n,t)||PV(n)||FV(n))},Lv=function(t,n){return!(UV(n)||uA(n)<0||!zv(t,n))},HV=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},dA=function(t){var n=[],s=[];return t.forEach(function(i,a){var l=!!i.scopeParent,f=l?i.scopeParent:i,d=OV(f,l),p=l?dA(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(MV).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},wp=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Zh([t],n.includeContainer,{filter:Lv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:HV}):s=cA(t,n.includeContainer,Lv.bind(null,n)),dA(s)},qV=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Zh([t],n.includeContainer,{filter:zv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=cA(t,n.includeContainer,zv.bind(null,n)),s},hA=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Uc.call(t,Vh)===!1?!1:Lv(n,t)};const Qu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pA(e,t){const n=wp(e,Qu()),s=n.length;if(s===0)return;const i=Fo(Rt(e)),a=n.indexOf(i),l=a===-1?t===1?0:s-1:a+t;return n[l]}function mA(e){return pA(Rt(e).body,1)||e}function gA(e){return pA(Rt(e).body,-1)||e}function du(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Ot(n,s)}function VV(e){wp(e,Qu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function uC(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 GV(){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 KV=_.createContext(null),ZV=_.createContext(null),Ep=()=>_.useContext(KV)?.id||null,Tp=e=>{const t=_.useContext(ZV);return e??t};function Tu(e){return`data-base-ui-${e}`}const Ld=null;class YV{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 YV;class gs{static create(){return new gs}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(gs.create).current;return ex(e.disposeEffect),e}const Yh=_.forwardRef(function(t,n){const[s,i]=_.useState();Le(()=>{J8&&i("button")},[]);const a={tabIndex:0,role:s};return h.jsx("span",{...t,ref:n,style:mp,"aria-hidden":s?void 0:!0,...a,"data-base-ui-focus-guard":""})});let fC=0;function Oy(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:i=!1}=t;s&&cancelAnimationFrame(fC);const a=()=>e?.focus({preventScroll:n});i?a():fC=requestAnimationFrame(a)}const Sc={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function dC(e){return e==="inert"?Sc.inert:e==="aria-hidden"?Sc["aria-hidden"]:Sc.none}let $d=new WeakSet,Bd={},My=0;const yA=e=>e&&(e.host||yA(e.parentNode)),XV=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=yA(n);return e.contains(s)?s:null}).filter(n=>n!=null);function QV(e,t,n,s){const i="data-base-ui-inert",a=s?"inert":n?"aria-hidden":null,l=XV(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=dC(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 My+=1,()=>{p.forEach(x=>{const S=dC(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)}),My-=1,My||(Sc.inert=new WeakMap,Sc["aria-hidden"]=new WeakMap,Sc.none=new WeakMap,$d=new WeakSet,Bd={})}}function WV(e,t=!1,n=!1){const s=Rt(e[0]).body;return QV(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const vA=_.createContext(null),bA=()=>_.useContext(vA),JV=Tu("portal");function xA(e={}){const{ref:t,container:n,componentProps:s=an,elementProps:i}=e,a=Ku(),f=bA()?.portalNode,[d,p]=_.useState(null),[g,y]=_.useState(null),b=ke(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,[JV]:""},i]});return{portalNode:g,portalSubtree:d&&S?hi.createPortal(S,d):null}}const SA=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,renderGuards:f,...d}=t,{portalNode:p,portalSubtree:g}=xA({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(z){p&&z.relatedTarget&&du(z)&&(z.type==="focusin"?uC:VV)(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||uC(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(vA.Provider,{value:R,children:[N&&p&&h.jsx(Yh,{"data-type":"outside",ref:y,onFocus:M=>{if(du(M,p))x.current?.focus();else{const z=w?w.domReference:null;gA(z)?.focus()}}}),N&&p&&h.jsx("span",{"aria-owns":p.id,style:Q9}),p&&hi.createPortal(s,p),N&&p&&h.jsx(Yh,{"data-type":"outside",ref:b,onFocus:M=>{if(du(M,p))S.current?.focus();else{const z=w?w.domReference:null;mA(z)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Yt(Lj,M.nativeEvent))}}})]})]})});function Hs(e){return e==null?e:"current"in e?e.current:e}function e7(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 hC=20;let Vo=[];function ix(){Vo=Vo.filter(e=>e.deref()?.isConnected)}function t7(e){ix(),e&&yi(e)!=="body"&&(Vo.push(new WeakRef(e)),Vo.length>hC&&(Vo=Vo.slice(-hC)))}function Iy(){return ix(),Vo[Vo.length-1]?.deref()}function n7(e){if(!e)return null;const t=Qu();return hA(e,t)?e:wp(e,t)[0]||e}function r7(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():xr(e).display!=="none"}function pC(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Qu(),i=qV(e,n).filter(l=>{const f=l.getAttribute("data-tabindex")||"";return hA(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 _A(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=ke(()=>N.current.floatingContext?.nodeId),M=i===!1,z=oC(T)&&M,j=_.useRef(["content"]),A=Jo(i),P=Jo(a),Q=Jo(p),B=Tp(x),U=bA(),Z=_.useRef(null),G=_.useRef(null),ee=_.useRef(!1),D=_.useRef(!1),K=_.useRef(!1),q=_.useRef(-1),V=_.useRef(""),L=_.useRef(""),I=_.useRef(null),H=_.useRef(null),W=so(I,b,U?.beforeInsideRef),Y=so(H,U?.afterInsideRef),ae=ns(),se=ns(),fe=ox(),Se=U!=null,pe=Bh(C),Me=ke((he=pe)=>he?wp(he,Qu()):[]),_e=ke(he=>{const ie=Me(he);return j.current.map(()=>ie).filter(Boolean).flat()});_.useEffect(()=>{if(s||!f)return;function he(we){we.key==="Tab"&&Ot(pe,Fo(Rt(pe)))&&Me().length===0&&!z&&Gi(we)}const ie=Rt(pe);return ie.addEventListener("keydown",he),()=>{ie.removeEventListener("keydown",he)}},[s,T,pe,f,j,z,Me,_e]),_.useEffect(()=>{if(s||!w)return;const he=Rt(pe);function ie(){K.current=!1}function we(xe){const ve=Ur(xe),Ie=Ot(C,ve)||Ot(T,ve)||Ot(U?.portalNode,ve);K.current=!Ie,L.current=xe.pointerType||"keyboard",ve?.closest(`[${Z9}]`)&&(D.current=!0)}function ye(){L.current="keyboard"}return he.addEventListener("pointerdown",we,!0),he.addEventListener("pointerup",ie,!0),he.addEventListener("pointercancel",ie,!0),he.addEventListener("keydown",ye,!0),()=>{he.removeEventListener("pointerdown",we,!0),he.removeEventListener("pointerup",ie,!0),he.removeEventListener("pointercancel",ie,!0),he.removeEventListener("keydown",ye,!0)}},[s,C,T,pe,w,U]),_.useEffect(()=>{if(s||!d)return;const he=Rt(pe);function ie(){D.current=!0,se.start(0,()=>{D.current=!1})}function we(Ue){const Ee=Ur(Ue),Qe=Me().indexOf(Ee);Qe!==-1&&(q.current=Qe)}function ye(Ue){const Ee=Ue.relatedTarget,Ve=Ue.currentTarget,Qe=Ur(Ue);queueMicrotask(()=>{const Be=R(),We=S.context.triggerElements,He=Ee?.hasAttribute(Tu("focus-guard"))&&[I.current,H.current,U?.beforeInsideRef.current,U?.afterInsideRef.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,Hs(y),Hs(g)].includes(Ee),me=!(Ot(T,Ee)||Ot(C,Ee)||Ot(Ee,C)||Ot(U?.portalNode,Ee)||Ee!=null&&We.hasElement(Ee)||We.hasMatchingElement(Te=>Ot(Te,Ee))||He||B&&(xc(B.nodesRef.current,Be).find(Te=>Ot(Te.context?.elements.floating,Ee)||Ot(Te.context?.elements.domReference,Ee))||iC(B.nodesRef.current,Be).find(Te=>[Te.context?.elements.floating,Bh(Te.context?.elements.floating)].includes(Ee)||Te.context?.elements.domReference===Ee)));if(Ve===T&&pe&&pC(pe,j),l&&Ve!==T&&!r7(Qe)&&Fo(he)===he.body){if(Zt(pe)&&(pe.focus(),l==="popup")){fe.request(()=>{pe.focus()});return}const Te=q.current,qe=Me(),ht=qe[Te]||qe[qe.length-1]||pe;Zt(ht)&&ht.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(z||!f)&&Ee&&me&&!D.current&&(z||Ee!==Iy())&&(ee.current=!0,S.setOpen(!1,Yt(Lj,Ue)))})}function xe(){K.current||(N.current.insideReactTree=!0,ae.start(0,()=>{N.current.insideReactTree=!1}))}const ve=Zt(T)?T:null,Ie=[];if(!(!C&&!ve))return ve&&(ve.addEventListener("focusout",ye),ve.addEventListener("pointerdown",ie),Ie.push(()=>{ve.removeEventListener("focusout",ye),ve.removeEventListener("pointerdown",ie)})),C&&(C.addEventListener("focusin",we),C.addEventListener("focusout",ye),U&&(C.addEventListener("focusout",xe,!0),Ie.push(()=>{C.removeEventListener("focusout",xe,!0)})),Ie.push(()=>{C.removeEventListener("focusin",we),C.removeEventListener("focusout",ye)})),()=>{Ie.forEach(Ue=>{Ue()})}},[s,T,C,pe,f,B,U,S,d,l,Me,z,R,j,N,ae,se,fe,g,y]),_.useEffect(()=>{if(s||!C||!w)return;const he=Array.from(U?.portalNode?.querySelectorAll(`[${Tu("portal")}]`)||[]),we=(B?iC(B.nodesRef.current,R()):[]).find(xe=>oC(xe.context?.elements.domReference||null))?.context?.elements.domReference,ye=[C,we,...he,Z.current,G.current,I.current,H.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,Hs(y),Hs(g),z?T:null].filter(xe=>xe!=null);return WV(ye,f||z)},[w,s,T,C,f,j,U,z,B,R,g,y]),Le(()=>{if(!w||s||!Zt(pe))return;const he=Rt(pe),ie=Fo(he);queueMicrotask(()=>{const we=_e(pe),ye=A.current,xe=typeof ye=="function"?ye(Q.current||""):ye;if(xe===void 0||xe===!1)return;let ve;xe===!0||xe===null?ve=we[0]||pe:ve=Hs(xe),ve=ve||we[0]||pe,!Ot(pe,ie)&&Oy(ve,{preventScroll:ve===pe})})},[s,w,pe,M,_e,A,Q]),Le(()=>{if(s||!pe)return;const he=Rt(pe),ie=Fo(he);t7(ie);function we(ve){if(ve.open||(V.current=e7(ve.nativeEvent,L.current)),ve.reason===Ov&&ve.nativeEvent.type==="mouseleave"&&(ee.current=!0),ve.reason===zj)if(ve.nested)ee.current=!1;else if(lV(ve.nativeEvent)||uV(ve.nativeEvent))ee.current=!1;else{let Ie=!1;document.createElement("div").focus({get preventScroll(){return Ie=!0,!1}}),Ie?ee.current=!1:ee.current=!0}}O.on("openchange",we);const ye=he.createElement("span");ye.setAttribute("tabindex","-1"),ye.setAttribute("aria-hidden","true"),Object.assign(ye.style,mp),Se&&T&&T.insertAdjacentElement("afterend",ye);function xe(){const ve=P.current;let Ie=typeof ve=="function"?ve(V.current):ve;if(Ie===void 0||Ie===!1)return null;if(Ie===null&&(Ie=!0),typeof Ie=="boolean"){const Ee=T||Iy();return Ee&&Ee.isConnected?Ee:ye}const Ue=T||Iy()||ye;return Hs(Ie)||Ue}return()=>{O.off("openchange",we);const ve=Fo(he),Ie=Ot(C,ve)||B&&xc(B.nodesRef.current,R(),!1).some(Ee=>Ot(Ee.context?.elements.floating,ve)),Ue=xe();queueMicrotask(()=>{const Ee=n7(Ue),Ve=typeof P.current!="boolean";P.current&&!ee.current&&Zt(Ee)&&(!(!Ve&&Ee!==ve&&ve!==he.body)||Ie)&&Ee.focus({preventScroll:!0}),ye.remove(),ee.current=!1})}},[s,C,pe,P,N,O,B,Se,T,R]),Le(()=>{if(!tx||w||!C)return;const he=Fo(Rt(C));!Zt(he)||!oA(he)||Ot(C,he)&&he.blur()},[w,C]),Le(()=>{if(!(s||!U))return U.setFocusManagerState({modal:f,closeOnFocusOut:d,open:w,onOpenChange:S.setOpen,domReference:T}),()=>{U.setFocusManagerState(null)}},[s,U,f,w,S,d,T]),Le(()=>{if(!(s||!pe))return pC(pe,j),()=>{queueMicrotask(ix)}},[s,pe,j]);const re=!s&&(f?!z:!0)&&(Se||f);return h.jsxs(_.Fragment,{children:[re&&h.jsx(Yh,{"data-type":"inside",ref:W,onFocus:he=>{if(f){const ie=_e();Oy(ie[ie.length-1])}else U?.portalNode&&(ee.current=!1,du(he,U.portalNode)?mA(T)?.focus():Hs(y??U.beforeOutsideRef)?.focus())}}),n,re&&h.jsx(Yh,{"data-type":"inside",ref:Y,onFocus:he=>{f?Oy(_e()[0]):U?.portalNode&&(d&&(ee.current=!0),du(he,U.portalNode)?gA(T)?.focus():Hs(g??U.afterOutsideRef)?.focus())}})]})}function mC(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 s7(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}=ao(t,e),S=iA(x),T=f[b?y==="floating"?"reference":"floating":y],C=qh(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=qh(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 o7=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}=mC(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:z}=await O({x:g,y,initialPlacement:s,placement:b,strategy:i,middlewareData:x,rects:p,platform:{...l,detectOverflow:(w=l.detectOverflow)!=null?w:s7},elements:{reference:e,floating:t}});g=N??g,y=R??y,x={...x,[C]:{...x[C],...M}},z&&S<=50&&(S++,typeof z=="object"&&(z.placement&&(b=z.placement),z.rects&&(p=z.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):z.rects),{x:g,y}=mC(p,b,d)),T=-1)}return{x:g,y,placement:b,strategy:i,middlewareData:x}},i7=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}=ao(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?[Hh(f)]:vV(f)),z=S!=="none";!b&&z&&M.push(..._V(f,w,S,R));const j=[f,...M],A=await d.detectOverflow(t,T),P=[];let Q=((s=a.flip)==null?void 0:s.overflows)||[];if(g&&P.push(A[C]),y){const G=yV(i,l,R);P.push(A[G[0]],A[G[1]])}if(Q=[...Q,{placement:i,overflows:P}],!P.every(G=>G<=0)){var B,U;const G=(((B=a.flip)==null?void 0:B.index)||0)+1,ee=j[G];if(ee&&(!(y==="alignment"?O!==Fr(ee):!1)||Q.every(q=>Fr(q.placement)===O?q.overflows[0]>0:!0)))return{data:{index:G,overflows:Q},reset:{placement:ee}};let D=(U=Q.filter(K=>K.overflows[0]<=0).sort((K,q)=>K.overflows[1]-q.overflows[1])[0])==null?void 0:U.placement;if(!D)switch(x){case"bestFit":{var Z;const K=(Z=Q.filter(q=>{if(z){const V=Fr(q.placement);return V===O||V==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(V=>V>0).reduce((V,L)=>V+L,0)]).sort((q,V)=>q[1]-V[1])[0])==null?void 0:Z[0];K&&(D=K);break}case"initialPlacement":D=f;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function gC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yC(e){return hV.some(t=>e[t]>=0)}const a7=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...a}=ao(e,t);switch(i){case"referenceHidden":{const l=await s.detectOverflow(t,{...a,elementContext:"reference"}),f=gC(l,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:yC(f)}}}case"escaped":{const l=await s.detectOverflow(t,{...a,altBoundary:!0}),f=gC(l,n.floating);return{data:{escapedOffsets:f,escaped:yC(f)}}}default:return{}}}}},wA=new Set(["left","top"]);async function c7(e,t){const{placement:n,platform:s,elements:i}=e,a=await(s.isRTL==null?void 0:s.isRTL(i.floating)),l=Zn(n),f=Si(n),d=Fr(n)==="y",p=wA.has(l)?-1:1,g=a&&d?-1:1,y=ao(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 l7=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 c7(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}}}}},u7=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}=ao(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=Pv(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=Pv(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}}}}}},f7=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}=ao(e,t),g={x:n,y:s},y=Fr(i),b=nx(y);let x=g[b],S=g[y];const w=ao(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=wA.has(Zn(i)),M=a.reference[y]-a.floating[N]+(R&&((C=l.offset)==null?void 0:C[y])||0)+(R?0:T.crossAxis),z=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>z&&(S=z)}return{[b]:x,[y]:S}}}},d7=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}=ao(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=Lc(w-g[T],O),M=Lc(S-g[C],N),z=!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),z&&!b){const Q=dr(g.left,0),B=dr(g.right,0),U=dr(g.top,0),Z=dr(g.bottom,0);x?A=S-2*(Q!==0||B!==0?Q+B:dr(g.left,g.right)):j=w-2*(U!==0||Z!==0?U+Z: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 EA(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=Fh(n)!==a||Fh(s)!==l;return f&&(n=a,s=l),{width:n,height:s,$:f}}function ax(e){return jt(e)?e:e.contextElement}function _c(e){const t=ax(e);if(!Zt(t))return bs(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:a}=EA(t);let l=(a?Fh(n.width):n.width)/s,f=(a?Fh(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const h7=bs(0);function TA(e){const t=un(e);return!vp()||!t.visualViewport?h7:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function p7(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=bs(1);t&&(s?jt(s)&&(l=_c(s)):l=_c(e));const f=p7(a,n,s)?TA(a):bs(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=Av(S);for(;w&&s&&x!==S;){const T=_c(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=Av(S)}}return qh({width:g,height:y,x:d,y:p})}function Cp(e,t){const n=bp(e).scrollLeft;return t?t.left+n:da(Ss(e)).left+n}function CA(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-Cp(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function m7(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const a=i==="fixed",l=Ss(s),f=t?yp(t.floating):!1;if(s===l||f&&a)return n;let d={scrollLeft:0,scrollTop:0},p=bs(1);const g=bs(0),y=Zt(s);if((y||!y&&!a)&&((yi(s)!=="body"||vi(l))&&(d=bp(s)),Zt(s))){const x=da(s);p=_c(s),g.x=x.x+s.clientLeft,g.y=x.y+s.clientTop}const b=l&&!y&&!a?CA(l,d):bs(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 g7(e){return Array.from(e.getClientRects())}function y7(e){const t=Ss(e),n=bp(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+Cp(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 vC=25;function v7(e,t){const n=un(e),s=Ss(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=vp();(!g||g&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const p=Cp(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<=vC&&(a-=S)}else p<=vC&&(a+=p);return{width:a,height:l,x:f,y:d}}const b7=new Set(["absolute","fixed"]);function x7(e,t){const n=da(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zt(e)?_c(e):bs(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 bC(e,t,n){let s;if(t==="viewport")s=v7(e,n);else if(t==="document")s=y7(Ss(e));else if(jt(t))s=x7(t,n);else{const i=TA(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return qh(s)}function RA(e,t){const n=oo(e);return n===t||!jt(n)||Ys(n)?!1:xr(n).position==="fixed"||RA(n,t)}function S7(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=Zb(l);!d&&f.position==="fixed"&&(i=null),(a?!d&&!i:!d&&f.position==="static"&&!!i&&b7.has(i.position)||vi(l)&&!d&&RA(e,l))?s=s.filter(g=>g!==l):i=f,l=oo(l)}return t.set(e,s),s}function _7(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const l=[...n==="clippingAncestors"?yp(t)?[]:S7(t,this._c):[].concat(n),s],f=l[0],d=l.reduce((p,g)=>{const y=bC(t,g,i);return p.top=dr(y.top,p.top),p.right=Lc(y.right,p.right),p.bottom=Lc(y.bottom,p.bottom),p.left=dr(y.left,p.left),p},bC(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function w7(e){const{width:t,height:n}=EA(e);return{width:t,height:n}}function E7(e,t,n){const s=Zt(t),i=Ss(t),a=n==="fixed",l=da(e,!0,a,t);let f={scrollLeft:0,scrollTop:0};const d=bs(0);function p(){d.x=Cp(i)}if(s||!s&&!a)if((yi(t)!=="body"||vi(i))&&(f=bp(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?CA(i,f):bs(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 Py(e){return xr(e).position==="static"}function xC(e,t){if(!Zt(e)||xr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ss(e)===n&&(n=n.ownerDocument.body),n}function NA(e,t){const n=un(e);if(yp(e))return n;if(!Zt(e)){let i=oo(e);for(;i&&!Ys(i);){if(jt(i)&&!Py(i))return i;i=oo(i)}return n}let s=xC(e,t);for(;s&&i8(s)&&Py(s);)s=xC(s,t);return s&&Ys(s)&&Py(s)&&!Zb(s)?n:s||f8(e)||n}const T7=async function(e){const t=this.getOffsetParent||NA,n=this.getDimensions,s=await n(e.floating);return{reference:E7(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function C7(e){return xr(e).direction==="rtl"}const R7={convertOffsetParentRelativeRectToViewportRelativeRect:m7,getDocumentElement:Ss,getClippingRect:_7,getOffsetParent:NA,getElementRects:T7,getClientRects:g7,getDimensions:w7,getScale:_c,isElement:jt,isRTL:C7};function jA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function N7(e,t){let n=null,s;const i=Ss(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=hc(y),w=hc(i.clientWidth-(g+b)),T=hc(i.clientHeight-(y+x)),C=hc(g),N={rootMargin:-S+"px "+-w+"px "+-T+"px "+-C+"px",threshold:dr(0,Lc(1,d))||1};let R=!0;function M(z){const j=z[0].intersectionRatio;if(j!==d){if(!R)return l();j?l(!1,j):s=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!jA(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 SC(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?N7(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&&!jA(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 j7=l7,A7=u7,k7=i7,O7=d7,M7=a7,I7=f7,P7=(e,t,n)=>{const s=new Map,i={platform:R7,...n},a={...i.platform,_c:s};return o7(e,t,{...i,platform:a})};var D7=typeof document<"u",z7=function(){},lh=D7?_.useLayoutEffect:z7;function Xh(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(!Xh(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)&&!Xh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function AA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _C(e,t){const n=AA(e);return Math.round(t*n)/n}function Dy(e){const t=_.useRef(e);return lh(()=>{t.current=e}),t}function L7(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);Xh(b,s)||x(s);const[S,w]=_.useState(null),[T,C]=_.useState(null),O=_.useCallback(q=>{q!==z.current&&(z.current=q,w(q))},[]),N=_.useCallback(q=>{q!==j.current&&(j.current=q,C(q))},[]),R=a||S,M=l||T,z=_.useRef(null),j=_.useRef(null),A=_.useRef(g),P=d!=null,Q=Dy(d),B=Dy(i),U=Dy(p),Z=_.useCallback(()=>{if(!z.current||!j.current)return;const q={placement:t,strategy:n,middleware:b};B.current&&(q.platform=B.current),P7(z.current,j.current,q).then(V=>{const L={...V,isPositioned:U.current!==!1};G.current&&!Xh(A.current,L)&&(A.current=L,hi.flushSync(()=>{y(L)}))})},[b,t,n,B,U]);lh(()=>{p===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,y(q=>({...q,isPositioned:!1})))},[p]);const G=_.useRef(!1);lh(()=>(G.current=!0,()=>{G.current=!1}),[]),lh(()=>{if(R&&(z.current=R),M&&(j.current=M),R&&M){if(Q.current)return Q.current(R,M,Z);Z()}},[R,M,Z,Q,P]);const ee=_.useMemo(()=>({reference:z,floating:j,setReference:O,setFloating:N}),[O,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=_C(D.floating,g.x),L=_C(D.floating,g.y);return f?{...q,transform:"translate("+V+"px, "+L+"px)",...AA(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:L}},[n,f,D.floating,g.x,g.y]);return _.useMemo(()=>({...g,update:Z,refs:ee,elements:D,floatingStyles:K}),[g,Z,ee,D,K])}const U7=(e,t)=>({...j7(e),options:[e,t]}),$7=(e,t)=>({...A7(e),options:[e,t]}),B7=(e,t)=>({...I7(e),options:[e,t]}),F7=(e,t)=>({...k7(e),options:[e,t]}),H7=(e,t)=>({...O7(e),options:[e,t]}),q7=(e,t)=>({...M7(e),options:[e,t]}),V7={intentional:"onClick",sloppy:"onPointerDown"};function G7(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function K7(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=Tp(C),N=ke(typeof y=="function"?y:()=>!1),R=typeof y=="function"?N:y,M=_.useRef(!1),{escapeKey:z,outsidePress:j}=G7(T),A=_.useRef(null),P=ns(),Q=ns(),B=ke(()=>{Q.clear(),d.current.insideReactTree=!1}),U=_.useRef(!1),Z=_.useRef(""),G=ke(re=>{Z.current=re.pointerType}),ee=ke(()=>{const re=Z.current,he=re==="pen"||!re?"mouse":re,ie=typeof b=="function"?b():b;return typeof ie=="string"?ie:ie[he]}),D=ke(re=>{if(!s||!p||!g||re.key!=="Escape"||U.current)return;const he=d.current.floatingContext?.nodeId,ie=O?xc(O.nodesRef.current,he):[];if(!z&&ie.length>0){let xe=!0;if(ie.forEach(ve=>{ve.context?.open&&!ve.context.dataRef.current.__escapeKeyBubbles&&(xe=!1)}),!xe)return}const we=cV(re)?re.nativeEvent:re,ye=Yt(y8,we);n.setOpen(!1,ye),!z&&!ye.isPropagationAllowed&&re.stopPropagation()}),K=ke(re=>{const he=ee();return he==="intentional"&&re.type!=="click"||he==="sloppy"&&re.type==="click"}),q=ke(()=>{d.current.insideReactTree=!0,Q.start(0,B)}),V=ke((re,he=!1)=>{if(K(re)){B();return}if(d.current.insideReactTree){B();return}if(ee()==="intentional"&&he||typeof R=="function"&&!R(re))return;const ie=Ur(re),we=`[${Tu("inert")}]`,ye=Rt(n.select("floatingElement")).querySelectorAll(we),xe=n.context.triggerElements;if(ie&&(xe.hasElement(ie)||xe.hasMatchingElement(Ve=>Ot(Ve,ie))))return;let ve=jt(ie)?ie:null;for(;ve&&!Ys(ve);){const Ve=oo(ve);if(Ys(Ve)||!jt(Ve))break;ve=Ve}if(ye.length&&jt(ie)&&!aV(ie)&&!Ot(ie,n.select("floatingElement"))&&Array.from(ye).every(Ve=>!Ot(ve,Ve)))return;if(Zt(ie)&&!("touches"in re)){const Ve=Ys(ie),Qe=xr(ie),Be=/auto|scroll/,We=Ve||Be.test(Qe.overflowX),He=Ve||Be.test(Qe.overflowY),me=We&&ie.clientWidth>0&&ie.scrollWidth>ie.clientWidth,Te=He&&ie.clientHeight>0&&ie.scrollHeight>ie.clientHeight,qe=Qe.direction==="rtl",ht=Te&&(qe?re.offsetX<=ie.offsetWidth-ie.clientWidth:re.offsetX>ie.clientWidth),lt=me&&re.offsetY>ie.clientHeight;if(ht||lt)return}const Ie=d.current.floatingContext?.nodeId,Ue=O&&xc(O.nodesRef.current,Ie).some(Ve=>Jr(re,Ve.context?.elements.floating));if(Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement"))||Ue)return;const Ee=O?xc(O.nodesRef.current,Ie):[];if(Ee.length>0){let Ve=!0;if(Ee.forEach(Qe=>{Qe.context?.open&&!Qe.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}n.setOpen(!1,Yt(zj,re)),B()}),L=ke(re=>{ee()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!p||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement"))||V(re)}),I=ke(re=>{if(ee()!=="sloppy"||!n.select("open")||!p||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement")))return;const he=re.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=ke(re=>{const he=Ur(re);function ie(){I(re),he?.removeEventListener(re.type,ie)}he?.addEventListener(re.type,ie)}),W=ke(re=>{const he=M.current;if(M.current=!1,P.clear(),re.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const ie=Ur(re);function we(){re.type==="pointerdown"?L(re):V(re,he),ie?.removeEventListener(re.type,we)}ie?.addEventListener(re.type,we)}),Y=ke(re=>{if(ee()!=="sloppy"||!A.current||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement")))return;const he=re.touches[0];if(!he)return;const ie=Math.abs(he.clientX-A.current.startX),we=Math.abs(he.clientY-A.current.startY),ye=Math.sqrt(ie*ie+we*we);ye>5&&(A.current.dismissOnTouchEnd=!0),ye>10&&(V(re),P.clear(),A.current=null)}),ae=ke(re=>{const he=Ur(re);function ie(){Y(re),he?.removeEventListener(re.type,ie)}he?.addEventListener(re.type,ie)}),se=ke(re=>{ee()!=="sloppy"||!A.current||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&V(re),P.clear(),A.current=null)}),fe=ke(re=>{const he=Ur(re);function ie(){se(re),he?.removeEventListener(re.type,ie)}he?.addEventListener(re.type,ie)});_.useEffect(()=>{if(!s||!p)return;d.current.__escapeKeyBubbles=z,d.current.__outsidePressBubbles=j;const re=new ai;function he(ve){n.setOpen(!1,Yt(ii,ve))}function ie(){re.clear(),U.current=!0}function we(){re.start(vp()?5:0,()=>{U.current=!1})}const ye=Rt(i);ye.addEventListener("pointerdown",G,!0),g&&(ye.addEventListener("keydown",D),ye.addEventListener("compositionstart",ie),ye.addEventListener("compositionend",we)),R&&(ye.addEventListener("click",W,!0),ye.addEventListener("pointerdown",W,!0),ye.addEventListener("touchstart",H,!0),ye.addEventListener("touchmove",ae,!0),ye.addEventListener("touchend",fe,!0),ye.addEventListener("mousedown",W,!0));let xe=[];return w&&(jt(l)&&(xe=Wo(l)),jt(i)&&(xe=xe.concat(Wo(i))),!jt(a)&&a&&a.contextElement&&(xe=xe.concat(Wo(a.contextElement)))),xe=xe.filter(ve=>ve!==ye.defaultView?.visualViewport),xe.forEach(ve=>{ve.addEventListener("scroll",he,{passive:!0})}),()=>{ye.removeEventListener("pointerdown",G,!0),g&&(ye.removeEventListener("keydown",D),ye.removeEventListener("compositionstart",ie),ye.removeEventListener("compositionend",we)),R&&(ye.removeEventListener("click",W,!0),ye.removeEventListener("pointerdown",W,!0),ye.removeEventListener("touchstart",H,!0),ye.removeEventListener("touchmove",ae,!0),ye.removeEventListener("touchend",fe,!0),ye.removeEventListener("mousedown",W,!0)),xe.forEach(ve=>{ve.removeEventListener("scroll",he)}),re.clear(),M.current=!1}},[d,i,a,l,g,R,s,f,w,p,z,j,D,V,W,L,H,ae,fe,G,n]),_.useEffect(B,[R,B]);const Se=_.useMemo(()=>({onKeyDown:D,...x&&{[V7[S]]:re=>{n.setOpen(!1,Yt(sC,re.nativeEvent))},...S!=="intentional"&&{onClick(re){n.setOpen(!1,Yt(sC,re.nativeEvent))}}}}),[D,n,x,S]),pe=ke(re=>{const he=Ur(re.nativeEvent);!Ot(n.select("floatingElement"),he)||re.button!==0||(M.current=!0)}),Me=ke(re=>{!s||!p||re.button!==0||(M.current=!0)}),_e=_.useMemo(()=>({onKeyDown:D,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:q,onMouseDownCapture(re){q(),Me(re)},onPointerDownCapture(re){q(),Me(re)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[D,pe,q,Me]);return _.useMemo(()=>p?{reference:Se,floating:_e,trigger:Se}:{},[p,Se,_e])}nj({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 Z7=qN();const Y7=Gb(19),X7=Y7?W7:J7;function at(e,t,n,s,i){return X7(e,t,n,s,i)}function Q7(e,t,n,s,i){const a=_.useCallback(()=>t(e.getSnapshot(),n,s,i),[e,t,n,s,i]);return Z7.useSyncExternalStore(e.subscribe,a,a)}function W7(e,t,n,s,i){return Q7(e,t,n,s,i)}function J7(e,t,n,s,i){return VN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,s,i))}class eG{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 kA extends eG{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=ke(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 tG={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 kA{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:GV(),nested:n,noEmit:s,triggerElements:a},tG)}setOpen=(t,n)=>{if((!t||!this.state.open||dV(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 Rp(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=gs.request(()=>{i("ending")});return()=>{gs.cancel(f)}}},[e,a,s,n]),Le(()=>{if(!e||t)return;const f=gs.request(()=>{i(void 0)});return()=>{gs.cancel(f)}},[t,e]),Le(()=>{if(!e||!t)return;e&&a&&s!=="idle"&&i("starting");const f=gs.request(()=>{i("idle")});return()=>{gs.cancel(f)}},[t,e,a,i,s]),_.useMemo(()=>({mounted:a,setMounted:l,transitionStatus:s}),[a,s])}let Cu=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const nG={[Cu.startingStyle]:""},rG={[Cu.endingStyle]:""},ba={transitionStatus(e){return e==="starting"?nG:e==="ending"?rG:null}};function sG(e,t=!1,n=!0){const s=ox();return ke((i,a=null)=>{s.cancel();function l(){hi.flushSync(i)}const f=Hs(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=Cu.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=ke(i),l=sG(s,n,!1);_.useEffect(()=>{if(!t)return;const f=new AbortController;return l(a,f.signal),()=>{f.abort()}},[t,n,a,l])}function oG(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 iG(e,t,n){const{mounted:s,setMounted:i,transitionStatus:a}=Rp(e);t.useSyncedValues({mounted:s,transitionStatus:a});const l=ke(()=>{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 aG(){return new cx({open:!1,floatingElement:null,referenceElement:null,triggerElements:new lx,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function cG(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:aG(),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),lG={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 uG(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,i=Ku(),a=Ep()!=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 fG(e={}){const{nodeId:t,externalTree:n}=e,s=uG(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=Tp(n);Le(()=>{a.domReference&&(d.current=a.domReference)},[a.domReference]);const g=L7({...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"),z=_.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=z;const j=p?.nodesRef.current.find(A=>A.id===t);j&&(j.context=z)}),_.useMemo(()=>({...g,context:z,refs:O,elements:N,rootStore:i}),[g,O,N,z,i])}function dG(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:i}=e,a=Ku(),l=Ep()!=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 wC=Tu("safe-polygon"),hG=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${sA}`;function pG(e){return e?!!e.closest(hG):!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 mG(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 gG=new Set(["click","mousedown"]);function yG(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=mG(n),g=Tp(),y=Ep(),b=ke(()=>p.interactedInside?!0:l.current.openEvent?gG.has(l.current.openEvent.type):!1),x=ke(()=>{const N=l.current.openEvent?.type;return N?.includes("mouse")&&N!=="mousedown"}),S=ke(N=>iV(N,n.context.triggerElements)),w=_.useCallback((N,R=!0)=>{const M=vG(d,p.pointerType);M&&!p.handler?p.openChangeTimeout.start(M,()=>n.setOpen(!1,Yt(Ov,N))):R&&(p.openChangeTimeout.clear(),n.setOpen(!1,Yt(Ov,N)))},[d,n,p]),T=ke(()=>{p.unbindMouseMove(),p.handler=void 0}),C=ke(()=>{if(p.performedPointerEventsMutation){const N=Rt(i).body;N.style.pointerEvents="",N.removeAttribute(wC),p.performedPointerEventsMutation=!1}}),O=ke(N=>{const R=Ur(N);if(!pG(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(wC,"");const R=a,M=i,z=g?.nodesRef.current.find(j=>j.id===y)?.context?.elements.floating;return z&&(z.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 z=i;return z&&(z.addEventListener("mouseleave",N),z.addEventListener("mouseenter",R),z.addEventListener("mouseleave",M),z.addEventListener("pointerdown",O,!0)),()=>{z&&(z.removeEventListener("mouseleave",N),z.removeEventListener("mouseenter",R),z.removeEventListener("mouseleave",M),z.removeEventListener("pointerdown",O,!0))}},[f,i,n,l,b,S,w,C,T,O,p])}function vG(e,t){return t&&!fV(t)?0:typeof e=="function"?e():e}function bG(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[Iv]="");for(const l in e)i&&e&&(l===nA||l===rA)||(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&&EC(a,f,i,s)}return EC(a,e,i,s),a}function EC(e,t,n,s){for(const i in t){const a=t[i];n&&(i===nA||i===rA)||(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 xG=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function SG(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=Ku(),p=a?.id||d,g=_.useMemo(()=>Bh(l)?.id||i,[l,i]),y=xG.get(f)??f,x=Ep()!=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=Cu.startingStyle]="startingStyle",e[e.endingStyle=Cu.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),TC=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const _G={[TC.popupOpen]:"",[TC.pressed]:""},wG={[Qi.open]:""},EG={[Qi.closed]:""},TG={[Qi.anchorHidden]:""},CG={open(e){return e?_G:null}},nl={open(e){return e?wG:EG},anchorHidden(e){return e?TG:null}},OA=_.createContext(void 0);function RG(){const e=_.useContext(OA);if(e===void 0)throw new Error(yn(70));return e}const NG=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,...f}=t,{portalNode:d,portalSubtree:p}=xA({container:i,ref:n,componentProps:t,elementProps:f});return!p&&!d?null:h.jsxs(_.Fragment,{children:[p,d&&hi.createPortal(s,d)]})}),jG=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t;return Jb().useState("mounted")||s?h.jsx(OA.Provider,{value:s,children:h.jsx(NG,{ref:n,...i})}):null}),MA=_.createContext(void 0);function AG(){const e=_.useContext(MA);if(e===void 0)throw new Error(yn(71));return e}const kG=_.createContext(void 0);function IA(){return _.useContext(kG)?.direction??"ltr"}const OG=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"}=ao(e,t)||{};if(p==null)return{};const b=iA(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],z=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-z/2,Q=A/2-T[w]/2-1,B=Math.min(b[O],Q),U=Math.min(b[N],Q),Z=B,G=A-T[w]-U,ee=A/2-T[w]/2+P,D=Pv(Z,ee,G),K=!d.arrow&&Si(i)!=null&&ee!==D&&a.reference[w]/2-(ee<Z?B:U)-T[w]/2<0,q=K?ee<Z?ee-Z:ee-G:0;return{[S]:x[S]+q,data:{[S]:D,centerOffset:ee-D-q,...K&&{alignmentOffset:q}},reset:K}}}),MG=(e,t)=>({...OG(e),options:[e,t]}),IG={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 q7().fn(e)).data?.referenceHidden||a}}}},uh={sideX:"left",sideY:"top"},PG={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 PA(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 CC(e,t,n){const{rects:s,placement:i}=e;return{side:PA(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 DA(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,z]=_.useState(null);!S&&M!==null&&z(null);const j=w.side||"flip",A=w.align||"flip",P=w.fallbackAxisSide||"end",Q=typeof t=="function"?t:void 0,B=ke(Q),U=Q?B:t,Z=Jo(t),ee=IA()==="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,L=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+L,right:q+W,bottom:q+I,left:q+H}:q&&(q={top:(q.top||0)+L,right:(q.right||0)+W,bottom:(q.bottom||0)+I,left:(q.left||0)+H});const Y={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:q},ae=_.useRef(null),se=Jo(i),fe=Jo(l),Me=[U7(ot=>{const Wt=CC(ot,s,ee),vn=typeof se.current=="function"?se.current(Wt):se.current,kt=typeof fe.current=="function"?fe.current(Wt):fe.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",re=!_e&&(p||T||j==="shift"),he=j==="none"?null:F7({...Y,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}),ie=_e?null:$7(ot=>{const Wt=Rt(ot.elements.floating).documentElement;return{...Y,rootBoundary:T?{x:0,y:0,width:Wt.clientWidth,height:Wt.clientHeight}:void 0,mainAxis:A!=="none",crossAxis:re,limiter:p||T?void 0:B7(vn=>{if(!ae.current)return{};const{width:kt,height:Cn}=ae.current.getBoundingClientRect(),er=Fr(Zn(vn.placement)),An=er==="y"?kt:Cn,is=er==="y"?q.left+q.right:q.top+q.bottom;return{offset:An/2+is/2}})}},[Y,p,T,q,A]);j==="shift"||A==="shift"||a==="center"?Me.push(ie,he):Me.push(he,ie),Me.push(H7({...Y,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`)}}),MG(()=>({element:ae.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),is=Fr(An),as=ae.current,_a=vn.arrow?.x||0,wi=vn.arrow?.y||0,Ei=as?.clientWidth||0,_s=as?.clientHeight||0,tr=_a+Ei/2,cs=wi+_s/2,fo=Math.abs(vn.shift?.y||0),ho=Cn.reference.height/2,nr=typeof i=="function"?i(CC(ot,s,ee)):i,sl=fo>nr,af={top:`${tr}px calc(100% + ${nr}px)`,bottom:`${tr}px ${-nr}px`,left:`calc(100% + ${nr}px) ${cs}px`,right:`${-nr}px ${cs}px`}[An],cf=`${tr}px ${Cn.reference.y+ho-er}px`;return Wt.floating.style.setProperty("--transform-origin",re&&is==="y"&&sl?cf:af),{}}},IG,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:ye,elements:xe,x:ve,y:Ie,middlewareData:Ue,update:Ee,placement:Ve,context:Qe,isPositioned:Be,floatingStyles:We}=fG({rootContext:x,placement:K,middleware:Me,strategy:n,whileElementsMounted:b?void 0:(...ot)=>SC(...ot,we),nodeId:C,externalTree:R}),{sideX:He,sideY:me}=Ue.adaptiveOrigin||uh,Te=Be?n:"fixed",qe=_.useMemo(()=>{const ot=O?{position:Te,[He]:ve,[me]:Ie}:{position:Te,...We};return Be||(ot.opacity=0),ot},[O,Te,He,ve,me,Ie,We,Be]),ht=_.useRef(null);Le(()=>{if(!S)return;const ot=Z.current,Wt=typeof ot=="function"?ot():ot,kt=(RC(Wt)?Wt.current:Wt)||null||null;kt!==ht.current&&(ye.setPositionReference(kt),ht.current=kt)},[S,ye,U,Z]),_.useEffect(()=>{if(!S)return;const ot=Z.current;typeof ot!="function"&&RC(ot)&&ot.current!==ht.current&&(ye.setPositionReference(ot.current),ht.current=ot.current)},[S,ye,U,Z]),_.useEffect(()=>{if(b&&S&&xe.domReference&&xe.floating)return SC(xe.domReference,xe.floating,Ee,we)},[b,S,xe,Ee,we]);const lt=Zn(Ve),wr=PA(s,lt,ee),Er=Si(Ve)||"center",Qt=!!Ue.hide?.referenceHidden;Le(()=>{N&&S&&Be&&z(lt)},[N,S,Be,lt]);const ut=_.useMemo(()=>({position:"absolute",top:Ue.arrow?.y,left:Ue.arrow?.x}),[Ue.arrow]),xt=Ue.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:qe,arrowStyles:ut,arrowRef:ae,arrowUncentered:xt,side:wr,align:Er,physicalSide:lt,anchorHidden:Qt,refs:ye,context:Qe,isPositioned:Be,update:Ee}),[qe,ut,ae,xt,wr,Er,lt,Qt,ye,Qe,Be,Ee])}function RC(e){return e!=null&&"current"in e}function Np(e){return e==="starting"?K9:an}const DG=_.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=RG(),R=O.useState("open"),M=O.useState("mounted"),z=O.useState("trackCursorAxis"),j=O.useState("disableHoverablePopup"),A=O.useState("floatingRootContext"),P=O.useState("instantType"),Q=O.useState("transitionStatus"),B=O.useState("hasViewport"),U=DA({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?PG:void 0}),Z=_.useMemo(()=>{const K={};return(!R||z==="both"||j)&&(K.pointerEvents="none"),{role:"presentation",hidden:!M,style:{...U.positionerStyles,...K}}},[R,z,j,M,U.positionerStyles]),G=_.useMemo(()=>({open:R,side:U.side,align:U.align,anchorHidden:U.anchorHidden,instant:z!=="none"?"tracking-cursor":P}),[R,U.side,U.align,U.anchorHidden,z,P]),ee=_.useMemo(()=>({...G,arrowRef:U.arrowRef,arrowStyles:U.arrowStyles,arrowUncentered:U.arrowUncentered}),[G,U.arrowRef,U.arrowStyles,U.arrowUncentered]),D=zt("div",t,{state:G,props:[Z,Np(Q),C],ref:[n,O.useStateSetter("positionerElement")],stateAttributesMapping:nl});return h.jsx(MA.Provider,{value:ee,children:D})}),zG={...nl,...ba},LG=_.forwardRef(function(t,n){const{className:s,render:i,...a}=t,l=Jb(),{side:f,align:d}=AG(),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 yG(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,Np(y),a],stateAttributesMapping:zG})});function fx(e){return Gb(19)?e:e?"true":void 0}const UG=_.forwardRef(({className:e,sideOffset:t=4,children:n,...s},i)=>h.jsx(jG,{children:h.jsx(DG,{sideOffset:t,children:h.jsx(LG,{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})})}));UG.displayName="TooltipContent";function NC(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const zA=_.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),Q=P?S:b,B=P?w:x,U=P?240:260,Z=P?130:150,G=C*A-Math.PI/2;T[j.id]={x:Q+U*Math.cos(G),y:B+Z*Math.sin(G)}});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,z=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:[z," 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),Q=P?S:b,B=P?w:x,U=NC(j.status),Z=j.status==="syncing"?2.5:1.5;if(j.status==="offline")return h.jsx("line",{x1:Q,y1:B,x2:A.x,y2:A.y,stroke:U,strokeWidth:1,strokeDasharray:"3 6",opacity:.2},`line-${j.id}`);const G=j.status==="syncing"?"1.2s":"2.8s",ee=`${Number.parseFloat(G)/2}s`;return h.jsxs("g",{children:[h.jsx("line",{x1:Q,y1:B,x2:A.x,y2:A.y,stroke:U,strokeWidth:Z,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:U,opacity:.7,children:[h.jsx("animateMotion",{dur:G,repeatCount:"indefinite",path:`M${Q},${B} L${A.x},${A.y}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.7;0.7;0",dur:G,repeatCount:"indefinite"})]}),h.jsxs("circle",{r:2,fill:U,opacity:.5,children:[h.jsx("animateMotion",{dur:G,begin:ee,repeatCount:"indefinite",path:`M${A.x},${A.y} L${Q},${B}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.5;0.5;0",dur:G,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=NC(j.status),Q=j.status==="offline"?.25:1,B=j.actor.replace("user-","").replace("svc-",""),U=s.includes(j.id);return h.jsxs("g",{opacity:Q,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,U?" · relay":""]})]},`node-${j.id}`)})]})]})});zA.displayName="TopologyHero";let jC=(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 LA(e){return _.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[jC.checked]:""}:{[jC.unchecked]:""}},...bi}),[e.indeterminate])}const $G=_.createContext({disabled:!1});function BG(){return _.useContext($G)}const FG=_.createContext(void 0);function HG(e=!0){const t=_.useContext(FG);if(t===void 0&&!e)throw new Error(yn(3));return t}const UA=_.createContext(void 0);function qG(){const e=_.useContext(UA);if(e===void 0)throw new Error(yn(14));return e}const VG="data-parent",GG=_.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}=el(),{disabled:M,name:z,setDirty:j,setFilled:A,setFocused:P,setTouched:Q,state:B,validationMode:U,validityData:Z,shouldValidateOnChange:G,validation:ee}=xi(),D=BG(),{labelId:K,controlId:q,registerControlId:V,getDescriptionProps:L}=lo(),I=HG(),H=I?.parent,W=H&&I.allValues,Y=M||D.disabled||I?.disabled||l,ae=z??g,se=C??ae,fe=br(),Se=br();let pe=q;W?pe=b?Se:`${H.id}-${se}`:f&&(pe=f);let Me={};W&&(b?Me=I.parent.getParentProps():se&&(Me=I.parent.getChildProps(se)));const _e=ke(y),{checked:re=s,indeterminate:he=d,onCheckedChange:ie,...we}=Me,ye=I?.value,xe=I?.setValue,ve=I?.defaultValue,Ie=_.useRef(null),Ue=zn(()=>Symbol("checkbox-control")),Ee=_.useRef(!1),{getButtonProps:Ve,buttonRef:Qe}=Jc({disabled:Y,native:O}),Be=I?.validation??ee,[We,He]=pp({controlled:se&&ye&&!b?ye.includes(se):re,default:se&&ve&&!b?ve.includes(se):a,name:"Checkbox",state:"checked"});Le(()=>{V!==jn&&(Ee.current=!0,V(Ue.current,pe))},[pe,I,V,b,Ue]),_.useEffect(()=>{const ut=Ue.current;return()=>{!Ee.current||V===jn||(Ee.current=!1,V(ut,void 0))}},[V,Ue]),Ij({enabled:!I,id:fe,commit:Be.commit,value:We,controlRef:Ie,name:ae,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]),Uj(We,()=>{I&&!b||(R(ae),A(We),j(We!==Z.initialValue),G()?Be.commit(We):Be.commit(We,!0))});const qe=oi({checked:We,disabled:Y,name:b?void 0:ae,id:O?void 0:pe??void 0,required:w,ref:Te,style:ae?Tj:mp,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(ie?.(xt,ot),_e(xt,ot),!ot.isCanceled&&(He(xt),se&&ye&&xe&&!b)){const Wt=xt?[...ye,se]:ye.filter(vn=>vn!==se);xe(Wt,ot)}},onFocus(){Ie.current?.focus()}},C!==void 0?{value:(I?We&&C:C)||""}:an,L,I?Be.getValidationProps:Be.getInputValidationProps),ht=W?!!re:We,lt=W&&he||d;_.useEffect(()=>{if(!H||!se)return;const ut=H.disabledStatesRef.current;return ut.set(se,Y),()=>{ut.delete(se)}},[H,Y,se]);const wr=_.useMemo(()=>({...B,checked:ht,disabled:Y,readOnly:x,required:w,indeterminate:lt}),[B,ht,Y,x,w,lt]),Er=LA(wr),Qt=zt("span",t,{state:wr,ref:[Qe,Ie,n,I?.registerControlRef],props:[{id:O?pe??void 0:fe,role:"checkbox","aria-checked":he?"mixed":We,"aria-readonly":x||void 0,"aria-required":w||void 0,"aria-labelledby":K,[VG]:b?"":void 0,onFocus(){P(!0)},onBlur(){const ut=me.current;ut&&(Q(!0),P(!1),U==="onBlur"&&Be.commit(I?ye:ut.checked))},onClick(ut){x||Y||(ut.preventDefault(),me.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ut.shiftKey,ctrlKey:ut.ctrlKey,altKey:ut.altKey,metaKey:ut.metaKey})))}},L,Be.getValidationProps,N,we,Ve],stateAttributesMapping:Er});return h.jsxs(UA.Provider,{value:wr,children:[Qt,!We&&!I&&ae&&!b&&T!==void 0&&h.jsx("input",{type:"hidden",name:ae,value:T}),h.jsx("input",{...qe})]})}),KG=_.forwardRef(function(t,n){const{render:s,className:i,keepMounted:a=!1,...l}=t,f=qG(),d=f.checked||f.indeterminate,{mounted:p,transitionStatus:g,setMounted:y}=Rp(d),b=_.useRef(null),x={...f,transitionStatus:g};xa({open:d,ref:b,onComplete(){d||y(!1)}});const S=LA(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}),Uv=_.forwardRef(({className:e,label:t,...n},s)=>{const i=h.jsx(GG,{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(KG,{className:"flex items-center justify-center text-white",children:h.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M1.5 4L3.25 5.75L6.5 2.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})});return t?h.jsxs("span",{className:"inline-flex items-center gap-2 cursor-pointer font-mono text-[11px] text-neutral-400",children:[i,h.jsx("span",{children:t})]}):i});Uv.displayName="Checkbox";const ZG=_.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function YG(e=!1){const t=_.useContext(ZG);if(!t&&!e)throw new Error(yn(86));return t}const XG=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}=lo(),y=ke((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(Pj.Provider,{value:x,children:t.children})},fh=Object.keys(xp);function QG(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 WG(e){const{formRef:t,clearErrors:n}=el(),{setValidityData:s,validate:i,validityData:a,validationDebounceTime:l,invalid:f,markedDirtyRef:d,state:p,name:g,shouldValidateOnChange:y}=e,{controlId:b,getDescriptionProps:x}=lo(),S=ns(),w=_.useRef(null),T=ke(async(N,R=!1)=>{const M=w.current;if(!M)return;if(R){if(p.valid!==!1)return;const Z=M.validity;if(!Z.valueMissing){const ee={value:N,state:{...xp,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,...kv(ee,!1)})}s(ee);return}const G=fh.reduce((ee,D)=>(ee[D]=Z[D],ee),{});if(!G.valid&&!QG(G))return}function z(Z){const G=fh.reduce((D,K)=>(D[K]=Z.validity[K],D),{});let ee=!1;for(const D of fh)if(D!=="valid"){if(D==="valueMissing"&&G[D])ee=!0;else if(G[D])return G}return ee&&!d.current&&(G.valid=!0,G.valueMissing=!1),G}S.clear();let j=null,A=[];const P=z(M);let Q;const B=y();if(M.validationMessage&&!B)Q=M.validationMessage,A=[M.validationMessage];else{const Z=Array.from(t.current.fields.values()).reduce((ee,D)=>(D.name&&(ee[D.name]=D.getValue()),ee),{}),G=i(N,Z);typeof G=="object"&&G!==null&&"then"in G?j=await G:j=G,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?(Q=M.validationMessage,A=[M.validationMessage]):M.validity.valid&&!P.valid&&(P.valid=!0))}const U={value:N,state:P,error:Q??(Array.isArray(j)?j[0]:j??""),errors:A,initialValue:a.initialValue};if(b){const Z=t.current.fields.get(b);Z&&t.current.fields.set(b,{...Z,...kv(U,f)})}s(U)}),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 JG=_.forwardRef(function(t,n){const{errors:s,validationMode:i,submitAttemptedRef:a}=el(),{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}=YG(),N=ke(d||(()=>null)),R=O||b,[M,z]=_.useState(!1),[j,A]=_.useState(!1),[P,Q]=_.useState(!1),[B,U]=_.useState(!1),Z=S??j,G=w??M,ee=_.useRef(!1),D=ke(Se=>{S===void 0&&(Se&&(ee.current=!0),A(Se))}),K=ke(Se=>{w===void 0&&z(Se)}),q=ke(()=>g==="onChange"||g==="onSubmit"&&a.current),V=!!(x||y&&{}.hasOwnProperty.call(s,y)&&s[y]!==void 0),[L,I]=_.useState({state:xp,error:"",errors:[],value:null,initialValue:null}),H=!V&&L.state.valid,W=_.useMemo(()=>({disabled:R,touched:G,dirty:Z,valid:H,filled:P,focused:B}),[R,G,Z,H,P,B]),Y=WG({setValidityData:I,validate:N,validityData:L,validationDebounceTime:p,invalid:V,markedDirtyRef:ee,state:W,name:y,shouldValidateOnChange:q}),ae=_.useCallback(()=>{ee.current=!0,Y.commit(L.value)},[Y,L]);_.useImperativeHandle(T,()=>({validate:ae}),[ae]);const se=_.useMemo(()=>({invalid:V,name:y,validityData:L,setValidityData:I,disabled:R,touched:G,setTouched:K,dirty:Z,setDirty:D,filled:P,setFilled:Q,focused:B,setFocused:U,validate:N,validationMode:g,validationDebounceTime:p,shouldValidateOnChange:q,state:W,markedDirtyRef:ee,validation:Y}),[V,y,L,R,G,K,Z,D,P,Q,B,U,N,g,p,q,W,Y]),fe=zt("div",t,{ref:n,state:W,props:C,stateAttributesMapping:bi});return h.jsx(Mj.Provider,{value:se,children:fe})}),eK=_.forwardRef(function(t,n){return h.jsx(XG,{children:h.jsx(JG,{...t,ref:n})})}),tK=_.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}=lo(),b=br(a),x=_.useRef(null),S=ke(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})}),nK={...bi,...ba},rK=_.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}=lo(),{errors:x}=el(),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}=Rp(w);Le(()=>{if(!(!w||!d))return b(U=>U.concat(d)),()=>{b(U=>U.filter(Z=>Z!==d))}},[w,d,b]);const N=_.useRef(null),[R,M]=_.useState(null),[z,j]=_.useState(null),A=S||(p.errors.length>1?h.jsx("ul",{children:p.errors.map(U=>h.jsx("li",{children:U},U))}):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!==z&&(j(P),M(A)),xa({open:w,ref:N,onComplete(){w||O(!1)}});const Q={...g,transitionStatus:C},B=zt("div",t,{ref:[n,N],state:Q,props:[{id:d,children:w?A:R},f],stateAttributesMapping:nK,enabled:T});return T?B:null}),sK=_.forwardRef(function(t,n){const{render:s,id:i,className:a,...l}=t,f=br(i),d=xi(!1),{setMessageIds:p}=lo();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})}),ps=eK,es=_.forwardRef(({className:e,...t},n)=>h.jsx(tK,{ref:n,className:ge("font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",e),...t}));es.displayName="FieldLabel";const pc=_.forwardRef(({className:e,...t},n)=>h.jsx(sK,{ref:n,className:ge("font-mono text-[9px] text-neutral-600 mt-0.5",e),...t}));pc.displayName="FieldDescription";const oK=_.forwardRef(({className:e,...t},n)=>h.jsx(rK,{ref:n,className:ge("font-mono text-[10px] text-offline mt-1",e),...t}));oK.displayName="FieldError";const iK=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge(e),...t}));iK.displayName="FieldContent";const aK=_.createContext(null),cK=_.createContext(null);function Wu(){const e=_.useContext(aK);if(e===null)throw new Error(yn(60));return e}function $A(){const e=_.useContext(cK);if(e===null)throw new Error(yn(61));return e}function $c(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function lK(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:$c(t,s,n))}function zy(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:$c(s,t,n))}function uK(e,t,n){return e.filter(s=>!$c(t,s,n))}function AC(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function fK(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function dK(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(fK(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 hK(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?AC(e.value):AC(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:hK(t,s)!==""}),hasNullItemLabel:Pe((e,t)=>t?dK(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=>$c(n,a,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:$c(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 pK(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 mK(e){const[t,n]=_.useState(null),s=ke((f,d)=>{e||n(d||(tA?"touch":""))}),i=_.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:l}=pK(s);return _.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:l}}),[t,i,a,l])}function gK(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,yK=400,kC=200,vK={...CG,...bi,value:()=>null},bK=_.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}=lo(),{store:w,setOpen:T,selectionRef:C,validation:O,readOnly:N,required:R,alignItemWithTriggerActiveRef:M,disabled:z,keyboardActiveRef:j}=Wu(),A=x||z||l,P=at(w,it.open),Q=at(w,it.value),B=at(w,it.triggerProps),U=at(w,it.positionerElement),Z=at(w,it.listElement),G=at(w,it.id),ee=at(w,it.hasSelectedValue),D=!ee&&P,K=at(w,it.hasNullItemLabel,D),q=a??G;Dj({id:q});const V=Jo(U),L=_.useRef(null),{getButtonProps:I,buttonRef:H}=Jc({disabled:A,native:f}),W=ke(re=>{w.set("triggerElement",re)}),Y=so(n,L,H,W),ae=ns(),se=ns(),fe=ns(),Se=ns();_.useEffect(()=>{if(P)return!(ee||K)?fe.start(yK,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}):Se.start(kC,()=>{C.current.allowUnselectedMouseUp=!0,fe.start(kC,()=>{C.current.allowSelectedMouseUp=!0})}),()=>{fe.clear(),Se.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},se.clear()},[P,ee,K,C,se,fe,Se]);const pe=_.useMemo(()=>Z?.id??Bh(U)?.id,[Z,U]),Me=oi(B,{id:q,role:"combobox","aria-expanded":P?"true":"false","aria-haspopup":"listbox","aria-controls":P?pe:void 0,"aria-labelledby":S,"aria-readonly":N||void 0,"aria-required":R||void 0,tabIndex:A?-1:0,ref:Y,onFocus(re){g(!0),P&&M.current&&T(!1,Yt(ii,re.nativeEvent)),ae.start(0,()=>{w.set("forceMount",!0)})},onBlur(re){Ot(U,re.relatedTarget)||(p(!0),g(!1),y==="onBlur"&&O.commit(Q))},onPointerMove(){j.current=!1},onKeyDown(){j.current=!0},onMouseDown(re){if(P)return;const he=Rt(re.currentTarget);function ie(we){if(!L.current)return;const ye=we.target;if(Ot(L.current,ye)||Ot(V.current,ye)||ye===L.current)return;const xe=gK(L.current);we.clientX>=xe.left-qd&&we.clientX<=xe.right+qd&&we.clientY>=xe.top-qd&&we.clientY<=xe.bottom+qd||T(!1,Yt(v8,we))}se.start(0,()=>{he.addEventListener("mouseup",ie,{once:!0})})}},O.getValidationProps,d,I);Me.role="combobox";const _e={...b,open:P,disabled:A,value:Q,readOnly:N,placeholder:!ee};return zt("button",t,{ref:[n,L],state:_e,stateAttributesMapping:vK,props:Me})}),xK=_.createContext(void 0),SK=_.forwardRef(function(t,n){const{store:s}=Wu(),i=at(s,it.mounted),a=at(s,it.forceMount);return i||a?h.jsx(xK.Provider,{value:!0,children:h.jsx(SA,{ref:n,...t})}):null});let OC={},MC={},IC="";function _K(e){if(typeof document>"u")return!1;const t=Rt(e);return un(t).innerWidth-t.documentElement.clientWidth>0}function wK(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 EK(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 TK(e){const t=Rt(e),n=t.documentElement,s=t.body,i=un(n);let a=0,l=0,f=!1;const d=gs.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,OC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},IC=n.style.scrollBehavior,MC={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),z=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=wK(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||z?`calc(100dvh - ${j+z}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,OC),Object.assign(s.style,MC),f||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=IC)}function y(){g(),d.request(p)}return p(),i.addEventListener("resize",y),()=>{d.cancel(),g(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",y)}}class CK{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=tA||!_K(t);this.restore=a?EK(t):TK(t)}}const RK=new CK;function BA(e=!0,t=null){Le(()=>{if(e)return RK.acquire(t)},[e,t])}const FA=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function NK(){return _.useContext(FA)}function HA(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:i}=e,a=ke(i),l=_.useRef(0),f=zn(AK).current,d=zn(jK).current,[p,g]=_.useState(0),y=_.useRef(p),b=ke((C,O)=>{d.set(C,O??null),y.current+=1,g(y.current)}),x=ke(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(kK).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=ke(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(FA.Provider,{value:T,children:t})}function jK(){return new Map}function AK(){return new Set}function kK(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 qA=_.createContext(void 0);function OK(){const e=_.useContext(qA);if(!e)throw new Error(yn(59));return e}const VA=_.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 Qh(e,t){e&&Object.assign(e.style,t)}const OG={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},MG={position:"fixed"},IG=_.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=Z9,...O}=t,{store:N,listRef:R,labelsRef:M,alignItemWithTriggerActiveRef:z,selectedItemTextRef:j,valuesRef:A,initialValueRef:P,popupRef:Q,setValue:B}=Wu(),U=$A(),Z=at(N,it.open),K=at(N,it.mounted),ee=at(N,it.modal),D=at(N,it.value),G=at(N,it.openMethod),q=at(N,it.positionerElement),V=at(N,it.triggerElement),L=at(N,it.isItemEqualToValue),I=at(N,it.transitionStatus),H=_.useRef(null),W=_.useRef(null),[Y,ae]=_.useState(T),se=K&&Y&&G!=="touch";!K&&Y!==T&&ae(T),Le(()=>{K||(it.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),it.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,K]),_.useImperativeHandle(z,()=>se),BA((se||ee)&&Z&&G!=="touch",V);const fe=DA({anchor:s,floatingRootContext:U,positionMethod:i,mounted:K,side:f,sideOffset:p,align:d,alignOffset:g,arrowPadding:x,collisionBoundary:y,collisionPadding:b,sticky:S,disableAnchorTracking:w??se,collisionAvoidance:C,keepMounted:!0}),Se=se?"none":fe.side,pe=se?MG:fe.positionerStyles,Me=_.useMemo(()=>{const xe={};return Z||(xe.pointerEvents="none"),{role:"presentation",hidden:!K,style:{...pe,...xe}}},[Z,K,pe]),_e={open:Z,side:Se,align:fe.align,anchorHidden:fe.anchorHidden},re=ke(xe=>{N.set("positionerElement",xe)}),he=zt("div",t,{ref:[n,re],state:_e,stateAttributesMapping:nl,props:[Me,Np(I),O]}),ie=_.useRef(0),we=ke(xe=>{if(xe.size===0&&ie.current===0||A.current.length===0)return;const ve=ie.current;if(ie.current=xe.size,xe.size===ve)return;const Ie=Yt(ii);if(ve!==0&&!N.state.multiple&&D!==null&&zy(A.current,D,L)===-1){const Ee=P.current,Qe=Ee!=null&&zy(A.current,Ee,L)!==-1?Ee:null;B(Qe,Ie),Qe===null&&(N.set("selectedIndex",null),j.current=null)}if(ve!==0&&N.state.multiple&&Array.isArray(D)){const Ue=Ve=>zy(A.current,Ve,L)!==-1,Ee=D.filter(Ve=>Ue(Ve));(Ee.length!==D.length||Ee.some(Ve=>!cG(D,Ve,L)))&&(B(Ee,Ie),Ee.length===0&&(N.set("selectedIndex",null),j.current=null))}if(Z&&se){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ue={height:""};Qh(q,Ue),Qh(Q.current,Ue)}}),ye=_.useMemo(()=>({...fe,side:Se,alignItemWithTriggerActive:se,setControlledAlignItemWithTrigger:ae,scrollUpArrowRef:H,scrollDownArrowRef:W}),[fe,Se,se,ae]);return h.jsx(HA,{elementsRef:R,labelsRef:M,onMapChange:we,children:h.jsxs(qA.Provider,{value:ye,children:[K&&ee&&h.jsx(VA,{inert:fx(!Z),cutout:V}),he]})})});function KA(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",PC={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}`})}},PG=_.createContext(void 0);function GA(e){return _.useContext(PG)}const wc="ArrowUp",Wi="ArrowDown",Ru="ArrowLeft",Ec="ArrowRight",Ju="Home",ef="End",ZA=new Set([Ru,Ec]),DG=new Set([Ru,Ec,Ju,ef]),YA=new Set([wc,Wi]),zG=new Set([wc,Wi,Ju,ef]),XA=new Set([...ZA,...YA]),LG=new Set([...XA,Ju,ef]),QA=new Set([wc,Wi,Ru,Ec,Ju,ef]),UG="Shift",$G="Control",BG="Alt",FG="Meta",HG=new Set([UG,$G,BG,FG]);function qG(e){return Zt(e)&&e.tagName==="INPUT"}function DC(e){return!!(qG(e)&&e.selectionStart!=null||Zt(e)&&e.tagName==="TEXTAREA")}function zC(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=LC(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=LC(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 LC(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 Ly(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const VG=_.createContext(void 0),KG={disableStyleElements:!1};function GG(){return _.useContext(VG)??KG}const Vi=1,ZG={...nl,...ba},YG=_.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:z,scrollUpArrowRef:j}=kG(),A=GA()!=null,P=$A(),{nonce:Q,disableStyleElements:B}=GG(),U=ns(),Z=at(f,it.id),K=at(f,it.open),ee=at(f,it.mounted),D=at(f,it.popupProps),G=at(f,it.transitionStatus),q=at(f,it.triggerElement),V=at(f,it.positionerElement),L=at(f,it.listElement),I=_.useRef(0),H=_.useRef(!1),W=_.useRef(0),Y=_.useRef(!1),ae=_.useRef({}),se=ox(),fe=ke(_e=>{if(!V||!d.current||!Y.current)return;if(H.current||!R){w();return}const re=V.style.top==="0px",he=V.style.bottom==="0px",ie=V.getBoundingClientRect().height,we=Rt(V),ye=getComputedStyle(V),xe=parseFloat(ye.marginTop),ve=parseFloat(ye.marginBottom),Ie=UC(getComputedStyle(d.current)),Ue=Math.min(we.documentElement.clientHeight-xe-ve,Ie),Ee=_e.scrollTop,Ve=$C(_e);let Qe=0,Be=null,We=!1,He=!1;const me=qe=>{V.style.height=`${qe}px`},Te=(qe,ht)=>{const lt=Ly(qe,0,Ue-ie);lt>0&&me(ie+lt),_e.scrollTop=ht,Ue-(ie+lt)<=Vi&&(H.current=!0),w()};if(re){const qe=Ve-Ee,ht=ie+qe,lt=Math.min(ht,Ue);if(Qe=lt,qe<=Vi){Te(qe,Ve);return}Ue-lt>Vi?He=!0:We=!0}else if(he){const qe=Ee,ht=ie+qe,lt=Math.min(ht,Ue),wr=ht-Ue;if(Qe=lt,qe<=Vi){Te(qe,0);return}Ue-lt>Vi?Be=0:(We=!0,Ee<Ve&&(Be=Ee-(qe-wr)))}if(Qe=Math.ceil(Qe),Qe!==0&&me(Qe),He||Be!=null){const qe=$C(_e),ht=He?qe:Ly(Be,0,qe);Math.abs(_e.scrollTop-ht)>Vi&&(_e.scrollTop=ht)}(We||Qe>=Ue-Vi)&&(H.current=!0),w()});_.useImperativeHandle(T,()=>fe,[fe]),xa({open:K,ref:d,onComplete(){K&&p?.(!0)}});const Se={open:K,transitionStatus:G,side:O,align:N};Le(()=>{!V||!d.current||Object.keys(ae.current).length||(ae.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(()=>{K||R||(Y.current=!1,H.current=!1,I.current=0,W.current=0,Qh(V,ae.current))},[K,R,V,d]),Le(()=>{const _e=d.current;if(!(!K||!q||!V||!_e||f.state.transitionStatus==="ending")){if(!R){Y.current=!0,se.request(w),_e.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const re=XG(_e);_e.style.removeProperty("--transform-origin");try{const he=getComputedStyle(V),ie=getComputedStyle(_e),we=Rt(q),ye=un(V),xe=q.getBoundingClientRect(),ve=V.getBoundingClientRect(),Ie=xe.left,Ue=xe.height,Ee=L||_e,Ve=Ee.scrollHeight,Qe=parseFloat(ie.borderBottomWidth),Be=parseFloat(he.marginTop)||10,We=parseFloat(he.marginBottom)||10,He=parseFloat(he.minHeight)||100,me=UC(ie),Te=5,qe=5,ht=20,lt=we.documentElement.clientHeight-Be-We,wr=we.documentElement.clientWidth,Er=lt-xe.bottom+Ue,Qt=b.current,ut=y.current;let xt,ot=0,Wt=0;if(Qt&&ut){const tr=ut.getBoundingClientRect();xt=Qt.getBoundingClientRect();const cs=tr.left-Ie,fo=xt.left-ve.left,ho=tr.top-xe.top+tr.height/2,nr=xt.top-ve.top+xt.height/2;ot=cs-fo,Wt=nr-ho}const yn=Er+Wt+We+Qe;let kt=Math.min(lt,yn);const Cn=lt-Be-We,er=yn-kt,An=Math.max(Te,Ie+ot),is=wr-qe,as=Math.max(0,An+ve.width-is);V.style.left=`${An-as}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,wi=er>=_a;wi&&(kt=Math.min(lt,ve.height)-(er-_a));const Ei=xe.top<ht||xe.bottom>lt-ht||kt<Math.min(Ve,He),_s=(ye.visualViewport?.scale??1)!==1&&tx;if(Ei||_s){Y.current=!0,Qh(V,ae.current),hi.flushSync(()=>M(!1));return}if(wi){const tr=Math.max(0,lt-yn);V.style.top=ve.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=ve.top,cs=ve.height,fo=xt.top+xt.height/2,ho=cs>0?(fo-tr)/cs*100:50,nr=Ly(ho,0,100);_e.style.setProperty("--transform-origin",`50% ${nr}%`)}(I.current===lt||kt>=me)&&(H.current=!0),w(),setTimeout(()=>{Y.current=!0})}finally{re()}})}},[f,K,V,q,y,b,d,w,R,M,se,z,j,L]),_.useEffect(()=>{if(!R||!V||!K)return;const _e=un(V);function re(he){g(!1,Yt(b8,he))}return _e.addEventListener("resize",re),()=>{_e.removeEventListener("resize",re)}},[g,R,V,K]);const pe={...L?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${Z}-list`},onKeyDown(_e){x.current=!0,A&&QA.has(_e.key)&&_e.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(_e){if(!C||KA(_e)||_e.pointerType==="touch")return;const re=_e.currentTarget;U.start(0,()=>{f.set("activeIndex",null),re.focus({preventScroll:!0})})},onScroll(_e){L||fe(_e.currentTarget)},...R&&{style:L?{height:"100%"}:OG}},Me=zt("div",t,{ref:[n,d],state:Se,stateAttributesMapping:ZG,props:[D,pe,Np(G),{className:!L&&R?PC.className:void 0},l]});return h.jsxs(_.Fragment,{children:[!B&&PC.getElement(Q),h.jsx(_A,{context:P,modal:!1,disabled:!ee,returnFocus:a,restoreFocus:!0,children:Me})]})});function UC(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function $C(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const BC=[["transform","none"],["scale","1"],["translate","0 0"]];function XG(e){const{style:t}=e,n={};for(const[s,i]of BC)n[s]=t.getPropertyValue(s),t.setProperty(s,i,"important");return()=>{for(const[s]of BC){const i=n[s];i?t.setProperty(s,i):t.removeProperty(s)}}}let WA=(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}=RG(),b=_.useRef(-1),[x,S]=_.useState(a??(i===WA.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 QG=_.createContext(void 0),WG=_.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:WA.GuessFromOrder}),{store:b,getItemProps:x,setOpen:S,setValue:w,selectionRef:T,typingRef:C,valuesRef:O,keyboardActiveRef:N,multiple:R,highlightItemOnHover:M}=Wu(),z=ns(),j=at(b,it.isActive,y.index),A=at(b,it.isSelected,y.index,a),P=at(b,it.isSelectedByFocus,y.index),Q=at(b,it.isItemEqualToValue),B=y.index,U=B!==-1,Z=_.useRef(null),K=Jo(B);Le(()=>{if(!U)return;const se=O.current;return se[B]=a,()=>{delete se[B]}},[U,B,a,O]),Le(()=>{if(!U)return;const se=b.state.value;let fe=se;R&&Array.isArray(se)&&se.length>0&&(fe=se[se.length-1]),fe!==void 0&&$c(a,fe,Q)&&b.set("selectedIndex",B)},[U,B,R,Q,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 G=_.useRef(null),q=_.useRef("mouse"),V=_.useRef(!1),{getButtonProps:L,buttonRef:I}=Jc({disabled:f,focusableWhenDisabled:!0,native:d});function H(se){const fe=b.state.value;if(R){const Se=Array.isArray(fe)?fe:[],pe=A?lG(Se,a,Q):[...Se,a];w(pe,Yt(Cy,se))}else w(a,Yt(Cy,se)),S(!1,Yt(Cy,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||KA(se)||z.start(0,()=>{b.state.activeIndex===B&&b.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(se){G.current=se.key,b.set("activeIndex",B)},onClick(se){V.current=!1,!(se.type==="keydown"&&G.current===null)&&(f||G.current===" "&&C.current||q.current!=="touch"&&!j||(G.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 fe=!T.current.allowSelectedMouseUp&&A,Se=!T.current.allowUnselectedMouseUp&&!A;fe||Se||q.current!=="touch"&&!j||H(se.nativeEvent)}},Y=zt("div",t,{ref:[I,n,y.ref,Z],state:ee,props:[D,W,p,L]}),ae=_.useMemo(()=>({selected:A,indexRef:K,textRef:g,selectedByFocus:P,hasRegistered:U}),[A,K,g,P,U]);return h.jsx(QG.Provider,{value:ae,children:Y})})),JG=_.forwardRef(({className:e,children:t,...n},s)=>h.jsx(vG,{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}));JG.displayName="SelectTrigger";const eZ=_.forwardRef(({className:e,portalProps:t,positionerProps:n,...s},i)=>h.jsx(xG,{...t,children:h.jsx(IG,{...n,children:h.jsx(YG,{ref:i,className:ge("bg-panel border border-border rounded-md py-1 shadow-lg z-50",e),...s})})}));eZ.displayName="SelectContent";const tZ=_.forwardRef(({className:e,...t},n)=>h.jsx(WG,{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}));tZ.displayName="SelectItem";const nZ=_.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}));nZ.displayName="Textarea";const JA=_.createContext(void 0);function rZ(e=!0){const t=_.useContext(JA);if(t===void 0&&!e)throw new Error(gn(7));return t}function ek(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=Aj(),{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 sZ(e){const{render:t,className:n,state:s=an,props:i=Eu,refs:a=Eu,metadata:l,stateAttributesMapping:f,tag:d="div",...p}=e,{compositeProps:g,compositeRef:y}=ek({metadata:l});return zt(d,e,{state:s,ref:[...a,y],props:[g,...i,p],stateAttributesMapping:f})}const oZ=_.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=rZ(),T=w?.value??[],C=w?void 0:i,O=(a||w?.disabled)??!1,[N,R]=pp({controlled:w?S!==void 0&&T.indexOf(S)>-1:d,default:C,name:"Toggle",state:"pressed"}),M=ke((U,Z)=>{S&&w?.setGroupValue?.(S,U,Z),f?.(U,Z)}),{getButtonProps:z,buttonRef:j}=Jc({disabled:O,native:b}),A={disabled:O,pressed:N},P=[j,n],Q=[{"aria-pressed":N,onClick(U){const Z=!N,K=Yt(ii,U.nativeEvent);M(Z,K),!K.isCanceled&&R(Z)}},x,z],B=zt("button",t,{enabled:!w,state:A,ref:P,props:Q});return w?h.jsx(sZ,{tag:"button",render:p,className:s,state:A,refs:P,props:Q}):B}),Dr=_.forwardRef(({className:e,...t},n)=>h.jsx(oZ,{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 iZ(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const tk="data-composite-item-active",aZ=[];function cZ(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=aZ}=e,[S,w]=_.useState(0),T=n>1,C=_.useRef(null),O=so(C,p),N=_.useRef([]),R=_.useRef(!1),M=f??S,z=ke((P,Q=!1)=>{if((d??w)(P),Q){const B=N.current[P];zC(C.current,B,l,a)}}),j=ke(P=>{if(P.size===0||R.current)return;R.current=!0;const Q=Array.from(P.keys()),B=Q.find(Z=>Z?.hasAttribute(tk))??null,U=B?Q.indexOf(B):-1;U!==-1&&z(U),zC(C.current,B,l,a)}),A=_.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,ref:O,onFocus(P){!C.current||!DC(P.target)||P.target.setSelectionRange(0,P.target.value.length??0)},onKeyDown(P){const Q=g?LG:XA;if(!Q.has(P.key)||lZ(P,x)||!C.current)return;const U=l==="rtl",Z=U?Ru:Ec,K={horizontal:Z,vertical:Wi,both:Z}[a],ee=U?Ec:Ru,D={horizontal:ee,vertical:wc,both:ee}[a];if(DC(P.target)&&!iZ(P.target)){const W=P.target.selectionStart,Y=P.target.selectionEnd,ae=P.target.value??"";if(W==null||P.shiftKey||W!==Y||P.key!==D&&W<ae.length||P.key!==K&&W>0)return}let G=M;const q=wV(N,b),V=EV(N,b);if(T){const W=t||Array.from({length:N.current.length},()=>({width:1,height:1})),Y=CV(W,n,i),ae=Y.findIndex(fe=>fe!=null&&!fu(N,fe,b)),se=Y.reduce((fe,Se,pe)=>Se!=null&&!fu(N,Se,b)?pe:fe,-1);G=Y[TV({current:Y.map(fe=>fe?N.current[fe]:null)},{event:P,orientation:a,loopFocus:s,cols:n,disabledIndices:NV([...b||N.current.map((fe,Se)=>fu(N,Se)?Se:void 0),void 0],Y),minIndex:ae,maxIndex:se,prevIndex:RV(M>V?q:M,W,Y,n,P.key===Wi?"bl":P.key===Ec?"tr":"tl"),rtl:U})]}const L={horizontal:[Z],vertical:[Wi],both:[Z,Wi]}[a],I={horizontal:[ee],vertical:[wc],both:[ee,wc]}[a],H=T?Q:{horizontal:g?DG:ZA,vertical:g?zG:YA,both:Q}[a];g&&(P.key===Ju?G=q:P.key===ef&&(G=V)),G===M&&(L.includes(P.key)||I.includes(P.key))&&(s&&G===V&&L.includes(P.key)?G=q:s&&G===q&&I.includes(P.key)?G=V:G=fr(N,{startingIndex:G,decrement:I.includes(P.key),disabledIndices:b})),G!==M&&!ch(N,G)&&(y&&P.stopPropagation(),H.has(P.key)&&P.preventDefault(),z(G,!0),queueMicrotask(()=>{N.current[G]?.focus()}))}}),[n,i,l,b,N,g,M,T,t,s,O,x,z,a,y]);return _.useMemo(()=>({props:A,highlightedIndex:M,onHighlightedIndexChange:z,elementsRef:N,disabledIndices:b,onMapChange:j,relayKeyboardEvent:A.onKeyDown}),[A,M,z,N,b,j])}function lZ(e,t){for(const n of HG.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function nk(e){const{render:t,className:n,refs:s=Eu,props:i=Eu,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",...z}=e,j=IA(),{props:A,highlightedIndex:P,onHighlightedIndexChange:Q,elementsRef:B,onMapChange:U,relayKeyboardEvent:Z}=cZ({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}),K=zt(M,e,{state:a,ref:s,props:[A,...i,z],stateAttributesMapping:l}),ee=_.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:Q,highlightItemOnHover:R,relayKeyboardEvent:Z}),[P,Q,R,Z]);return h.jsx(jj.Provider,{value:ee,children:h.jsx(HA,{elementsRef:B,onMapChange:D=>{w?.(D),U(D)},children:K})})}let uZ=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const FC={multiple(e){return e?{[uZ.multiple]:""}:null}},fZ=_.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=GA(),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]=pp({controlled:p,default:S,name:"ToggleGroup",state:"value"}),N=ke((A,P,Q)=>{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,Q),Q.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]),z={role:"group"},j=zt("div",t,{enabled:!!x,state:R,ref:n,props:[z,b],stateAttributesMapping:FC});return h.jsx(JA.Provider,{value:M,children:x?j:h.jsx(nk,{render:y,className:g,state:R,refs:[n],props:[z,b],stateAttributesMapping:FC,loopFocus:a,enableHomeAndEndKeys:!0})})}),dh=_.forwardRef(({className:e,...t},n)=>h.jsx(fZ,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));dh.displayName="ToggleGroup";function rk({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 dZ({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(rk,{active:l,onClick:f,children:a.label},a.id)})})}const hZ=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}}),pZ={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 mZ({color:e,size:t,glow:n,pulse:s,className:i}){return h.jsx("span",{className:ge(hZ({color:e,size:t,glow:n}),s&&"dot-pulse",i),style:n?{boxShadow:pZ[e??"healthy"]}:void 0})}const gZ="0.0.6-46",yZ={version:gZ},vZ=yZ.version;function bZ({label:e,className:t}){return h.jsxs("div",{className:ge("flex items-center gap-3",t),children:[h.jsx(mZ,{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",vZ]})]})}function xZ({brand:e,center:t,right:n,className:s}){return 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 SZ=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(SZ({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 sk=_.createContext(void 0);function rl(e){const t=_.useContext(sk);if(e===!1&&t===void 0)throw new Error(gn(27));return t}const _Z={...nl,...ba},hx=_.forwardRef(function(t,n){const{render:s,className:i,forceRender:a=!1,...l}=t,{store:f}=rl(),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:_Z,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!p})}),ok=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=rl(),d=br(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),zt("p",t,{ref:n,props:[{id:d},l]})});let wZ=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),EZ=(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 ik=_.createContext(void 0);function TZ(){const e=_.useContext(ik);if(e===void 0)throw new Error(gn(26));return e}const CZ={...nl,...ba,nestedDialogOpen(e){return e?{[EZ.nestedDialogOpen]:""}:null}},ak=_.forwardRef(function(t,n){const{className:s,finalFocus:i,initialFocus:a,render:l,...f}=t,{store:d}=rl(),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");TZ(),xa({open:C,ref:d.context.popupRef,onComplete(){C&&d.context.onOpenChangeComplete?.(!0)}});function z(B){return B==="touch"?d.context.popupRef.current:!0}const j=a===void 0?z:a,A=T>0,Q=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){QA.has(B.key)&&B.stopPropagation()},style:{[wZ.nestedDialogs]:T}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:CZ});return h.jsx(_A,{context:y,openInteractionType:O,disabled:!S,closeOnFocusOut:!g,initialFocus:j,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:Q})}),ck=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t,{store:a}=rl(),l=a.useState("mounted"),f=a.useState("modal"),d=a.useState("open");return l||s?h.jsx(ik.Provider,{value:s,children:h.jsxs(SA,{ref:n,...i,children:[l&&f===!0&&h.jsx(VA,{ref:a.context.internalBackdropRef,inert:fx(!d)}),t.children]})}):null});function RZ(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}=pG(i);s7(t);const{forceUnmount:y}=o7(i,t,()=>{g()}),b=ke(Q=>{const B=Yt(Q);return B.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},B}),x=_.useCallback(()=>{t.setOpen(!1,b(v8))},[t,b]);_.useImperativeHandle(s,()=>({unmount:y,close:x}),[y,x]);const S=f7({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,T]=_.useState(0),C=w===0,O=x7(S),N=KK(S,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(Q){if(!t.context.outsidePressEnabledRef.current||"button"in Q&&Q.button!==0||"touches"in Q&&Q.touches.length!==1)return!1;const B=Ur(Q);if(C&&!a){const U=B;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===U||t.context.backdropRef.current===U||Ot(U,f)&&!U?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});BA(i&&l===!0,f);const{getReferenceProps:R,getFloatingProps:M,getTriggerProps:z}=v7([O,N]);t.useContextCallback("onNestedDialogOpen",Q=>{T(Q+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(()=>z(p),[z,p]),P=_.useMemo(()=>M(),[M]);t.useSyncedValues({openMethod:d,activeTriggerProps:j,inactiveTriggerProps:A,popupProps:P,floatingRootContext:S,nestedOpenDialogCount:w})}const NZ={...c7,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 jZ extends kA{constructor(t){super(AZ(t),{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new lx,onOpenChange:void 0,onOpenChangeComplete:void 0},NZ)}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 AZ(e={}){return{...a7(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function kZ(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=rl(!0),x=!!b,S=zn(()=>p?.store??new jZ({open:s,openProp:n,activeTriggerId:y,triggerIdProp:g,modal:f,disablePointerDismissal:l,nested:x})).current;Z8(()=>{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");RZ({store:S,actionsRef:d,parentContext:b?.store.context});const T=_.useMemo(()=>({store:S}),[S]);return h.jsx(sk.Provider,{value:T,children:typeof t=="function"?t({payload:w}):t})}const lk=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=rl(),d=br(a);return f.useSyncedValueWithCleanup("titleElementId",d),zt("h2",t,{ref:n,props:[{id:d},l]})}),$r=kZ,OZ=_.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}));OZ.displayName="DialogOverlay";const hr=_.forwardRef(({className:e,children:t,...n},s)=>h.jsxs(ck,{children:[h.jsx(hx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(ak,{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(lk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));mr.displayName="DialogTitle";const MZ=_.forwardRef(({className:e,...t},n)=>h.jsx(ok,{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));MZ.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(Ce,{size:"sm",variant:"default",disabled:t<=1,onClick:()=>i(t-1),children:"Prev"}),h.jsx(Ce,{size:"sm",variant:"default",disabled:t>=n,onClick:()=>i(t+1),children:"Next"})]})]}));px.displayName="Pagination";const IZ=_.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}));IZ.displayName="Separator";const PZ=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"}}),DZ=_.forwardRef(({className:e,side:t,children:n,...s},i)=>h.jsxs(ck,{children:[h.jsx(hx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(ak,{ref:i,className:ge(PZ({side:t,className:e})),...s,children:n})]}));DZ.displayName="SheetContent";const zZ=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));zZ.displayName="SheetHeader";const LZ=_.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}));LZ.displayName="SheetFooter";const UZ=_.forwardRef(({className:e,...t},n)=>h.jsx(lk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));UZ.displayName="SheetTitle";const $Z=_.forwardRef(({className:e,...t},n)=>h.jsx(ok,{ref:n,className:ge("text-sm text-neutral-400",e),...t}));$Z.displayName="SheetDescription";const BZ=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("rounded-md bg-neutral-800 animate-pulse",e),...t}));BZ.displayName="Skeleton";const FZ=_.createContext(void 0);function mx(){const e=_.useContext(FZ);if(e===void 0)throw new Error(gn(64));return e}let HZ=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const uk={tabActivationDirection:e=>({[HZ.activationDirection]:e})},fk=_.createContext(void 0);function qZ(){const e=_.useContext(fk);if(e===void 0)throw new Error(gn(65));return e}const VZ=_.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}=qZ(),O=br(f),N=_.useMemo(()=>({disabled:i,id:O,value:l}),[i,O,l]),{compositeProps:R,compositeRef:M,index:z}=ek({metadata:N}),j=l===g,A=_.useRef(!1);Le(()=>{if(A.current){A.current=!1;return}if(!(j&&z>-1&&S!==z))return;const V=C;if(V!=null){const L=Fo(Rt(V));if(L&&Ot(V,L))return}i||T(z)},[j,z,S,T,i,C]);const{getButtonProps:P,buttonRef:Q}=Jc({disabled:i,native:d,focusableWhenDisabled:!0}),B=y(l),U=_.useRef(!1),Z=_.useRef(!1);function K(V){j||i||w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"}))}function ee(V){j||(z>-1&&!i&&T(z),!i&&x&&(!U.current||U.current&&Z.current)&&w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"})))}function D(V){if(j||i)return;U.current=!0;function L(){U.current=!1,Z.current=!1}(!V.button||V.button===0)&&(Z.current=!0,Rt(V.currentTarget).addEventListener("pointerup",L,{once:!0}))}return zt("button",t,{state:{disabled:i,active:j,orientation:b},ref:[n,Q,M],props:[R,{role:"tab","aria-controls":B,"aria-selected":j,id:O,onClick:K,onFocus:ee,onPointerDown:D,[tk]:j?"":void 0,onKeyDownCapture(){A.current=!0}},p,P]})});let KZ=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const GZ={...uk,...ba},ZZ=_.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}=Rp(O),z=!N,j=p(i),A={hidden:z,orientation:g,tabActivationDirection:y,transitionStatus:R},P=_.useRef(null),Q=zt("div",t,{state:A,ref:[n,T,P],props:[{"aria-labelledby":j,hidden:z,id:S,role:"tabpanel",tabIndex:O?0:-1,inert:fx(!O),[KZ.index]:C},f],stateAttributesMapping:GZ});return xa({open:O,ref:P,onComplete(){O||M(!1)}}),Le(()=>{if(!(z&&!l)&&S!=null)return b(i,S),()=>{x(i,S)}},[z,l,i,S,b,x]),l||N?Q:null}),YZ=_.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=XZ(y,g,T,d),N=ke((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"},z=_.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:S,onTabActivation:N,setHighlightedTabIndex:w,tabsListElement:T,value:y}),[s,S,N,w,T,y]);return h.jsx(fk.Provider,{value:z,children:h.jsx(nk,{render:l,className:i,state:R,refs:[n,C],props:[M,f],stateAttributesMapping:uk,highlightedIndex:S,enableHomeAndEndKeys:!0,loopFocus:a,orientation:g,onHighlightedIndexChange:w,onMapChange:b,disabledIndices:Eu})})});function HC(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 XZ(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}=HC(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}=HC(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 QZ=_.forwardRef(({className:e,...t},n)=>h.jsx(YZ,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));QZ.displayName="TabsList";const WZ=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"}}),JZ=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx(VZ,{ref:s,className:ge(WZ({variant:t,className:e})),...n}));JZ.displayName="TabsTrigger";const eY=_.forwardRef(({className:e,...t},n)=>h.jsx(ZZ,{ref:n,className:ge("outline-none",e),...t}));eY.displayName="TabsContent";const tY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[11px] text-neutral-300",e),...t}));tY.displayName="Text";const nY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));nY.displayName="TextMuted";const rY=_.forwardRef(({className:e,...t},n)=>h.jsx("code",{ref:n,className:ge("font-mono text-[11px] text-white",e),...t}));rY.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 oY=_.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}));oY.displayName="CodeBlock";const dk=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const iY=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const aY=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const qC=e=>{const t=aY(e);return t.charAt(0).toUpperCase()+t.slice(1)};var cY={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 lY=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const uY=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:l,...f},d)=>_.createElement("svg",{ref:d,...cY,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:dk("lucide",i),...!a&&!lY(f)&&{"aria-hidden":"true"},...f},[...l.map(([p,g])=>_.createElement(p,g)),...Array.isArray(a)?a:[a]]));const fY=(e,t)=>{const n=_.forwardRef(({className:s,...i},a)=>_.createElement(uY,{ref:a,iconNode:t,className:dk(`lucide-${iY(qC(e))}`,`lucide-${e}`,s),...i}));return n.displayName=qC(e),n};const dY=[["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"}]],hY=fY("settings",dY),pY="console:instance-id";function Lt(){const[e,t]=pi(pY,""),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 Ku(t.GET("/console/stats",{params:{query:i}}))},enabled:!!t,refetchInterval:_i(e.refetchIntervalMs,5e3)})}function mY(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 gY(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 yY(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 Ku(n.GET("/console/commits",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function vY(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 bY(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 Ku(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 Ku(n.GET("/console/clients",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function xY(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 SY(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 _Y(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 wY(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 EY(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 Ku(n.GET("/console/operations",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function TY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 CY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 RY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 NY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 jY(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 AY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 kY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 OY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 MY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 IY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 PY(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 DY(){const{config:e}=Dt(),t=_r();return os({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 zY(){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 LY="console:partition-id";function sf(){const[e,t]=pi(LY,""),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 UY=[{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"}],$Y=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],gx="syncular-console-root";function BY(e){e.classList.add(gx)}const FY=[{suffix:"",label:"Command"},{suffix:"/stream",label:"Stream"},{suffix:"/fleet",label:"Fleet"},{suffix:"/ops",label:"Ops"},{suffix:"/storage",label:"Storage"},{suffix:"/config",label:"Config"}];function HY(e){const t=e?.trim()??"";return!t||t==="/"?"":(t.startsWith("/")?t:`/${t}`).replace(/\/+$/g,"")}function Uy(e,t){return e?t?`${e}${t}`:e:t||"/"}function qY({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=HY(e),N=_.useMemo(()=>FY.map(P=>({...P,id:Uy(O,P.suffix)})),[O]),R=Uy(O,""),M=Uy(O,"/config"),z=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(xZ,{brand:h.jsx(bc,{to:R,children:h.jsx(bZ,{label:"console"})}),center:h.jsx(dZ,{items:N,activeId:j,renderItem:(P,{active:Q})=>h.jsx(bc,{to:P.id,children:h.jsx(rk,{active:Q,children:P.label})},P.id)}),right:h.jsxs("div",{className:"flex items-center gap-2",children:[n?h.jsx("div",{className:"hidden md:inline-flex items-center rounded-md border border-healthy/30 bg-healthy/[0.08] px-2 py-1 font-mono text-[10px] uppercase tracking-wider text-neutral-300",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(Ce,{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(Ce,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:w,children:"All"}):null]}),h.jsx(R8,{state:z}),h.jsx(bc,{to:M,children:h.jsx(Ce,{variant:T===M?"secondary":"ghost",size:"icon",children:h.jsx(hY,{})})}),t?h.jsx("a",{href:t,children:h.jsx(Ce,{variant:"primary",size:"sm",children:"App"})}):null]})}),h.jsx("main",{className:"flex-1 overflow-auto pt-[42px] 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(VY,{configPath:M,hasSavedConfig:!!i,isConnecting:l,onConnect:()=>{s()}})})}),a&&h.jsx(Bj,{isLive:a,metrics:A,uptime:"--"})]})}function VY({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(Ce,{variant:"default",onClick:s,disabled:n,children:n?"Connecting...":"Connect"}),h.jsx(bc,{to:e,children:h.jsx(Ce,{variant:"link",children:"Configure connection"})})]})]})}const uo=NH({component:qY});function KY(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("swServer")==="1"}function GY(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),z=_.useRef(0),j=_.useRef(0),A=_.useRef(null),P=_.useRef(null),Q=_.useCallback(()=>{b([]),A.current=null,P.current=null},[]);return _.useEffect(()=>{if(!n||!d||!f?.serverUrl||!f?.token)return;let B=!1;const U=Number.isFinite(i)?Math.max(1,Math.min(500,Math.floor(i))):100;if(KY()||typeof WebSocket>"u"){T("connecting"),S(!1);let V=null,L=!1;const I=async()=>{if(!(B||L)){L=!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(U)),H.searchParams.set("offset","0"),a&&H.searchParams.set("partitionId",a);const Y=await fetch(H.toString(),{headers:{Authorization:`Bearer ${f.token}`}});if(!Y.ok)throw new Error(`Live event polling failed (${Y.status})`);const ae=await Y.json(),fe=(Array.isArray(ae.items)?ae.items:[]).filter(Me=>g?Me.instanceId===g:!0).sort((Me,_e)=>Me.eventId-_e.eventId),Se=P.current??-1,pe=fe.filter(Me=>Me.eventId>Se);if(pe.length>0){const Me=pe.map(re=>({type:re.eventType,timestamp:re.createdAt,data:re})).reverse();b(re=>[...Me,...re].slice(0,t));const _e=pe[pe.length-1];P.current=_e.eventId,A.current=_e.createdAt}else if(fe.length>0){const Me=fe[fe.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{L=!1}}};return I(),V=setInterval(()=>{I()},2e3),()=>{B=!0,V&&clearInterval(V),S(!1),T("disconnected")}}const K=()=>{R.current&&(clearTimeout(R.current),R.current=null)},ee=()=>{M.current&&(clearInterval(M.current),M.current=null)},D=()=>{if(B||R.current)return;z.current+=1;const V=Math.min(3e4,1e3*2**Math.max(0,z.current-1)),L=Math.floor(V*.2*Math.random()),I=V+L;R.current=setTimeout(()=>{R.current=null,B||q()},I)},G=()=>{j.current=Date.now(),S(!0),T("connected")},q=()=>{if(B)return;T("connecting"),K();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="",I.searchParams.set("token",f.token),A.current&&I.searchParams.set("since",A.current),I.searchParams.set("replayLimit",String(U)),a&&I.searchParams.set("partitionId",a),g&&I.searchParams.set("instanceId",g),I.toString()})(),L=new WebSocket(V);N.current=L,L.onopen=()=>{if(B){L.close();return}z.current=0,G(),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)},L.onclose=()=>{B||(S(!1),T("disconnected"),ee(),D())},L.onerror=()=>{B||O(new Error("WebSocket connection failed"))},L.onmessage=I=>{try{const H=JSON.parse(I.data),W=H.type;if(G(),W==="connected"||W==="heartbeat")return;const Y={type:W,timestamp:H.timestamp||new Date().toISOString(),data:H};if(a&&Y.data.partitionId!==a||g&&Y.data.instanceId!==g)return;const ae=Date.parse(A.current??""),se=Date.parse(Y.timestamp);Number.isFinite(se)&&(!Number.isFinite(ae)||se>ae)&&(A.current=Y.timestamp),b(fe=>[Y,...fe].slice(0,t))}catch{}}};return q(),()=>{B=!0,K(),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:Q}}function ZY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 YY=_.createContext(null);function pk(){const[e,t]=pi("console:time-range","24h");return{range:e,setRange:t}}const XY=[{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 QY(e){const t=e.toLowerCase();for(const n of XY)if(t.includes(n.hint))return n.type;return"client"}function WY(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 JY(e,t){return typeof e.lagCommitCount=="number"?Math.max(0,e.lagCommitCount):t?Math.max(0,t.maxCommitSeq-e.cursor):0}function eX(e,t){return e.activityState==="stale"?"offline":t>0?"syncing":"online"}function tX(e,t){return e.length<=16?e:`${e.slice(0,12)}-${t+1}`}function nX(e,t,n={}){const s=n.maxNodes??10;return e.slice(0,s).map((i,a)=>{const l=JY(i,t),f=eX(i,l);return{id:tX(i.clientId,a),type:QY(i.clientId),status:f,cursor:Math.max(0,i.cursor),actor:i.actorId,mode:i.connectionMode,dialect:WY(i.clientId),scopes:Object.keys(i.effectiveScopes||{}),lastSeen:i.updatedAt}})}const rX={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 sX(e){const t=e.length>1&&e.endsWith("/")?e.slice(0,-1):e;return t==="/console"||t.startsWith("/console/")?"/console/stream":"/stream"}function oX(){const e=dp(),t=_.useMemo(()=>typeof window>"u"?"/stream":sX(window.location.pathname),[]),n=pk(),{range:s}=n,{preferences:i}=of(),{partitionId:a}=sf(),l=i.refreshInterval*1e3,[f]=pi("console:alert-config",rX),[d,p]=_.useState("1h"),{data:g}=rf({refetchIntervalMs:l,partitionId:a}),{data:y}=mY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:b}=gY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:x}=yY({limit:5,partitionId:a},{refetchIntervalMs:l}),{data:S}=hk({limit:12,offset:0,partitionId:a},{refetchIntervalMs:l}),{events:w,isConnected:T}=GY({maxEvents:8,partitionId:a}),C=_.useMemo(()=>{const U=y?.buckets??[];let Z=0,K=0;for(const D of U)Z+=D.pushCount+D.pullCount,K+=D.errorCount;const ee=Z>0?K/Z*100:0;return{totalEvents:Z,errorRate:ee}},[y?.buckets]),O=_.useMemo(()=>S?.items?nX(S.items,g,{maxNodes:12}):[],[S?.items,g]),N=O.filter(U=>U.status!=="offline").length,R=O.filter(U=>U.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]),z=_.useMemo(()=>w.map(U=>({type:U.type.toUpperCase(),actor:U.data?.actorId??"",table:(U.data?.tables??[])[0]??"",time:KC(U.timestamp,i.timeFormat)})),[w,i.timeFormat]),j=_.useMemo(()=>{const U=y?.buckets;if(!U?.length)return[];const Z=Math.max(...U.map(K=>Math.max(K.pushCount,K.pullCount)),1);return U.map(K=>({pushPercent:Z>0?K.pushCount/Z*100:0,pullPercent:Z>0?K.pullCount/Z*100:0}))},[y?.buckets]),A=_.useMemo(()=>{if(!b)return[];const U=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/U*100,pullBarPercent:b.pull.p50/U*100},{label:"P90",pushMs:b.push.p90,pullMs:b.pull.p90,pushBarPercent:b.push.p90/U*100,pullBarPercent:b.pull.p90/U*100},{label:"P99",pushMs:b.push.p99,pullMs:b.pull.p99,pushBarPercent:b.push.p99/U*100,pullBarPercent:b.pull.p99/U*100}]},[b]),P=_.useMemo(()=>x?.items?x.items.map(U=>({seq:U.commitSeq,actor:U.actorId,changes:U.changeCount,tables:(U.affectedTables??[]).join(", "),time:KC(U.createdAt,i.timeFormat)})):[],[x?.items,i.timeFormat]),Q=_.useMemo(()=>Math.max(0,100-C.errorRate),[C.errorRate]),B=_.useMemo(()=>{if(!f.enabled||!g)return[];const U=[];return b?.push?.p90&&b.push.p90>f.thresholds.p90Latency&&U.push(`P90 push latency (${b.push.p90}ms) exceeds threshold (${f.thresholds.p90Latency}ms)`),g.minActiveClientCursor!==null&&g.maxCommitSeq-g.minActiveClientCursor>f.thresholds.clientLag&&U.push(`Client lag (${g.maxCommitSeq-g.minActiveClientCursor}) exceeds threshold (${f.thresholds.clientLag})`),C.errorRate>f.thresholds.errorRate&&U.push(`Error rate (${C.errorRate.toFixed(1)}%) exceeds threshold (${f.thresholds.errorRate}%)`),U},[f,g,b,C.errorRate]);return g?h.jsx(YY.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((U,Z)=>h.jsx("span",{className:"block",children:U},Z))})]})}),h.jsx(zA,{clients:O,totalNodes:O.length+2,onlineCount:N,offlineCount:R,relayClientIds:[]}),h.jsx(Gj,{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(Sj,{bars:j,activeRange:d,onRangeChange:p})}),h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(Zj,{buckets:A,successRate:Q})}),h.jsx("div",{className:"border-r border-border",children:h.jsx(Fj,{commits:P,onViewAll:()=>e({href:t})})})]}),h.jsx(Yj,{entries:z,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 iX(){return h.jsx(oX,{})}function aX({children:e}){return h.jsxs("div",{className:"space-y-4 px-5 py-5",children:[h.jsx(cX,{}),h.jsx(hX,{}),h.jsx(pX,{}),e]})}function cX(){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)}},z=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:z,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(Sp,{checked:C,onCheckedChange:O})]})})})}const lX=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 $y(e){if(!e)return"Never";const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():"Invalid date"}function uX(e){return e.length===0?"all scopes":e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`}function fX(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*lX?"expiring":"active"}function dX(e){return e==="revoked"?"destructive":e==="expired"?"offline":e==="expiring"?"syncing":"healthy"}function hX(){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),[z,j]=_.useState([]),[A,P]=_.useState(null),[Q,B]=_.useState(null),[U,Z]=_.useState(null),[K,ee]=_.useState(null),[D,G]=_.useState(null),[q,V]=_.useState(null),[L,I]=_.useState(null),H=_.useMemo(()=>GC(i),[i]),W=H??14,Y=_.useMemo(()=>GC(O),[O]),ae=O.trim().length>0,se=!ae||Y!==null,fe=_.useMemo(()=>({type:e==="all"?void 0:e,status:n==="all"?void 0:n,expiresWithinDays:n==="expiring"?W:void 0}),[e,n,W]),{data:Se,isLoading:pe,error:Me}=jY(fe),_e=AY(),re=OY(),he=kY(),ie=MY(),we=IY();_.useEffect(()=>{const me=new Set((Se?.items??[]).map(Te=>Te.keyId));j(Te=>Te.filter(qe=>me.has(qe)))},[Se?.items]);const ye=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:ae?Y??void 0:void 0});M(Te.secretKey),y(""),w(""),C(""),N("")}catch{}},xe=me=>{navigator.clipboard.writeText(me),B(me),setTimeout(()=>B(null),2e3)},ve=async()=>{if(U)try{await he.mutateAsync(U)}finally{Z(null)}},Ie=async()=>{if(z.length!==0)try{const me=await re.mutateAsync({keyIds:z});P(me),j([])}catch{}},Ue=async()=>{if(K)try{const me=await we.mutateAsync(K.keyId);G({oldKeyId:K.keyId,oldKeyName:K.name,secretKey:me.secretKey})}catch{}},Ee=async()=>{if(D)try{await he.mutateAsync(D.oldKeyId)}finally{G(null),ee(null)}},Ve=async()=>{if(q)try{const me=await ie.mutateAsync(q);I(me.secretKey)}finally{V(null)}};if(pe)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 Qe=(Se?.items??[]).filter(me=>me.revokedAt===null).map(me=>me.keyId),Be=Qe.length>0&&Qe.every(me=>z.includes(me)),We=z.length>0,He=(Se?.items??[]).filter(me=>z.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(Ce,{size:"sm",variant:"destructive",onClick:()=>p(!0),disabled:z.length===0,children:["Revoke Selected (",z.length,")"]}),h.jsx(Ce,{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(ps,{children:[h.jsx(es,{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(ps,{children:[h.jsx(es,{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(ps,{children:[h.jsx(es,{htmlFor:"api-key-expiring-window",children:"Expiring window (days)"}),h.jsx(pc,{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]})]}),Se?.items.length===0?h.jsx(Qb,{message:"No API keys match the current filters."}):h.jsxs(Zu,{children:[h.jsx(Yu,{children:h.jsxs(io,{children:[h.jsx(yt,{children:h.jsx(Uv,{checked:Be,indeterminate:!Be&&We&&Qe.length>0,onCheckedChange:me=>{j(me?Qe:[])},"aria-label":"Select all active keys"})}),h.jsx(yt,{children:"NAME"}),h.jsx(yt,{children:"TYPE"}),h.jsx(yt,{children:"KEY PREFIX"}),h.jsx(yt,{children:"ACTOR"}),h.jsx(yt,{children:"SCOPES"}),h.jsx(yt,{children:"CREATED"}),h.jsx(yt,{children:"LAST USED"}),h.jsx(yt,{children:"EXPIRES"}),h.jsx(yt,{children:"STATUS"}),h.jsx(yt,{children:"ACTIONS"})]})}),h.jsx(Xu,{children:(Se?.items??[]).map(me=>{const Te=fX(me,W);return h.jsxs(io,{children:[h.jsx(vt,{children:h.jsx(Uv,{checked:z.includes(me.keyId),onCheckedChange:qe=>{j(ht=>qe?[...new Set([...ht,me.keyId])]:ht.filter(lt=>lt!==me.keyId))},"aria-label":`Select ${me.name}`,disabled:me.revokedAt!==null})}),h.jsx(vt,{className:"font-medium",children:me.name}),h.jsx(vt,{children:h.jsx(xn,{variant:me.keyType==="admin"?"flow":me.keyType==="proxy"?"ghost":"relay",children:me.keyType})}),h.jsx(vt,{children:h.jsxs("code",{className:"font-mono text-[11px]",children:[me.keyPrefix,"..."]})}),h.jsx(vt,{className:"text-neutral-500",children:me.actorId??"-"}),h.jsx(vt,{className:"max-w-[220px] text-neutral-500",children:h.jsx("code",{className:"font-mono text-[10px]",children:uX(me.scopeKeys)})}),h.jsx(vt,{className:"text-neutral-500",children:$y(me.createdAt)}),h.jsx(vt,{className:"text-neutral-500",children:$y(me.lastUsedAt)}),h.jsx(vt,{className:"text-neutral-500",children:$y(me.expiresAt)}),h.jsx(vt,{children:h.jsx(xn,{variant:dX(Te),children:Te})}),h.jsx(vt,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(Ce,{variant:"default",size:"sm",onClick:()=>ee(me),disabled:me.revokedAt!==null,children:"Stage"}),h.jsx(Ce,{variant:"default",size:"sm",onClick:()=>V(me.keyId),disabled:me.revokedAt!==null,children:"Rotate"}),h.jsx(Ce,{variant:"destructive",size:"sm",onClick:()=>Z(me.keyId),disabled:me.revokedAt!==null,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:Q,onClose:()=>{M(null),f(!1)},onCopy:xe,secretKey:R,warning:"Copy this key now. You will not be able to view it again."}):h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs(ps,{children:[h.jsx(es,{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(ps,{children:[h.jsx(es,{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(ps,{children:[h.jsx(es,{htmlFor:"api-key-actor-id",children:"Actor ID (optional)"}),h.jsx(pc,{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(ps,{children:[h.jsx(es,{htmlFor:"api-key-scope-keys",children:"Scope keys (optional)"}),h.jsx(pc,{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(ps,{children:[h.jsx(es,{htmlFor:"api-key-expires-days",children:"Expires in days (optional)"}),h.jsx(pc,{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(Ce,{variant:"default",onClick:()=>f(!1),children:"Cancel"}),h.jsx(Ce,{variant:"primary",onClick:ye,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(Ce,{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(Ce,{variant:"default",onClick:()=>p(!1),children:"Cancel"}),h.jsx(Ce,{variant:"destructive",onClick:Ie,disabled:re.isPending||z.length===0,children:re.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke Selected"})]})]})]})}),h.jsx($r,{open:K!==null||D!==null,onOpenChange:()=>{ee(null),G(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(Ce,{variant:"default",size:"sm",onClick:()=>xe(D.secretKey),children:Q===D.secretKey?"Copied":"Copy"})]}),h.jsxs(Nn,{children:[h.jsx(Ce,{variant:"default",onClick:()=>{G(null),ee(null)},children:"Keep Old Key Active"}),h.jsx(Ce,{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(Ce,{variant:"default",onClick:()=>ee(null),children:"Cancel"}),h.jsx(Ce,{variant:"primary",onClick:Ue,disabled:we.isPending||!K,children:we.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Staging..."]}):"Create Replacement Key"})]})]})]})}),h.jsx($r,{open:U!==null,onOpenChange:()=>Z(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(Ce,{variant:"default",onClick:()=>Z(null),children:"Cancel"}),h.jsx(Ce,{variant:"destructive",onClick:ve,disabled:he.isPending,children:he.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke"})]})]})}),h.jsx($r,{open:q!==null||L!==null,onOpenChange:()=>{V(null),I(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Rotate API Key"})}),L?h.jsx(ZC,{copiedKeyId:Q,onClose:()=>I(null),onCopy:xe,secretKey:L,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(Ce,{variant:"default",onClick:()=>V(null),children:"Cancel"}),h.jsx(Ce,{variant:"primary",onClick:Ve,disabled:ie.isPending,children:ie.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Rotating..."]}):"Rotate"})]})]})]})})]})}function pX(){const{preferences:e,updatePreference:t,resetPreferences:n}=of(),s=[{type:"filter",label:"Auto-refresh interval",options:UY.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:$Y.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(Xj,{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(Ce,{variant:"default",size:"sm",onClick:()=>n(s),children:e===s?"Copied":"Copy"})]}),h.jsx(Nn,{children:h.jsx(Ce,{variant:"primary",onClick:t,children:"Done"})})]})}function mX(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 gX(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 yX(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 vX(e,t,n){return{id:e.clientId,type:mX(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:gX(e.clientId),scopes:Object.keys(e.effectiveScopes??{}),lastSeen:yX(e.updatedAt,n)}}function bX({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=TY(),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=>vX(N,T,a.timeFormat));return h.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5",children:[O.length>0&&h.jsx(Wj,{clients:O,headSeq:T}),O.length===0?e??h.jsx(F8,{children:h.jsx(Qb,{message:"No clients yet"})}):h.jsx(Vj,{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(Ce,{variant:"default",onClick:()=>i(null),children:"Cancel"}),h.jsx(Ce,{variant:"destructive",onClick:C,disabled:S.isPending,children:S.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Evicting..."]}):"Evict"})]})]})})]})}const xX={latencyThresholdMs:1e3,errorRateThreshold:5,clientLagThreshold:50,enabled:!1};function SX(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 _X(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);return Array.from(new Set(t))}function wX(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 EX(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function TX(e){const t=YC(e.requestPayload),n=YC(e.resultPayload);if(e.operationType==="notify_data_change"){const a=EX(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 CX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function RX(){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(NX,{}),h.jsx(MX,{})]}),h.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[h.jsx(jX,{partitionId:e}),h.jsx(AX,{partitionId:e}),h.jsx(kX,{partitionId:e})]}),h.jsx(OX,{partitionId:e})]})}function NX(){const{data:e,isLoading:t,error:n}=_Y();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?SX(i.snapshotChunkTtlMs):"default"}));return h.jsx(Kj,{handlers:s,tableCount:e?.items.length??0})}function jX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=rf({partitionId:e}),{data:f,isLoading:d,refetch:p}=wY({enabled:!1}),g=CY(),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(_p,{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(xn,{variant:f.commitsToDelete>0?"offline":"ghost",children:f.commitsToDelete})]})]})]}):null}),h.jsxs(Nn,{children:[h.jsx(Ce,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Ce,{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 AX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=rf({partitionId:e}),f=RY(),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(_p,{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(Ce,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Ce,{variant:"primary",onClick:p,disabled:f.isPending,children:f.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Compacting..."]}):"Compact Now"})]})]})})]})}function kX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState("tasks"),[a,l]=_.useState(e??""),[f,d]=_.useState(null),[p,g]=_.useState(null),y=NY(),b=_X(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(_p,{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(ps,{children:[h.jsx(es,{children:"Tables (comma-separated)"}),h.jsx(Gn,{value:s,onChange:T=>i(T.target.value),placeholder:"tasks, notes",disabled:y.isPending}),h.jsx(pc,{children:"Enter one or more table names affected by the external change."})]}),h.jsxs(ps,{children:[h.jsx(es,{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(Ce,{variant:"default",onClick:()=>n(!1),children:f?"Close":"Cancel"}),f?null:h.jsx(Ce,{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 OX({partitionId:e}){const[t,n]=_.useState("all"),{data:s,isLoading:i,error:a}=EY({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(Ce,{variant:t==="all"?"default":"ghost",size:"sm",onClick:()=>n("all"),children:"All"}),h.jsx(Ce,{variant:t==="prune"?"default":"ghost",size:"sm",onClick:()=>n("prune"),children:"Prune"}),h.jsx(Ce,{variant:t==="compact"?"default":"ghost",size:"sm",onClick:()=>n("compact"),children:"Compact"}),h.jsx(Ce,{variant:t==="notify_data_change"?"default":"ghost",size:"sm",onClick:()=>n("notify_data_change"),children:"Notify"}),h.jsx(Ce,{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(Zu,{children:[h.jsx(Yu,{children:h.jsxs(io,{children:[h.jsx(yt,{children:"Time"}),h.jsx(yt,{children:"Type"}),h.jsx(yt,{children:"User"}),h.jsx(yt,{children:"Target"}),h.jsx(yt,{children:"Result"})]})}),h.jsx(Xu,{children:(s?.items??[]).map((l,f)=>h.jsxs(io,{children:[h.jsx(vt,{className:"whitespace-nowrap text-xs text-neutral-400",children:CX(l.createdAt)}),h.jsx(vt,{children:h.jsx(xn,{variant:"ghost",children:wX(l.operationType)})}),h.jsx(vt,{className:"font-mono text-xs",children:l.consoleUserId??"system"}),h.jsx(vt,{className:"font-mono text-xs",children:l.targetClientId??l.partitionId??(l.operationType==="notify_data_change"?"partition default":"global")}),h.jsx(vt,{className:"font-mono text-xs text-neutral-300",children:TX(l)})]},`${l.operationId}:${l.createdAt}:${f}`))})]})})})}function MX(){const[e,t]=pi("console:alert-config",xX),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($j,{enabled:e.enabled,onEnabledChange:i,thresholds:n,onThresholdsChange:s})}function IX(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 PX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function DX(){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}=PY({prefix:n,cursor:i,limit:100}),x=DY(),S=zY();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 z=[...M],j=z.pop();return a(j&&j.length>0?j:void 0),z})}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(Ce,{variant:"default",size:"sm",onClick:w,children:"Filter"}),n&&h.jsx(Ce,{variant:"ghost",size:"sm",onClick:T,children:"Clear"})]}),children:R.length===0?h.jsx(Qb,{message:n?`No storage items matching prefix "${n}".`:"No storage items found."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"overflow-x-auto",children:h.jsxs(Zu,{children:[h.jsx(Yu,{children:h.jsxs(io,{children:[h.jsx(yt,{children:"Key"}),h.jsx(yt,{children:"Size"}),h.jsx(yt,{children:"Type"}),h.jsx(yt,{children:"Uploaded"}),h.jsx(yt,{children:"Actions"})]})}),h.jsx(Xu,{children:R.map(M=>h.jsxs(io,{children:[h.jsx(vt,{className:"font-mono text-xs max-w-[320px]",title:M.key,children:M.key}),h.jsx(vt,{className:"font-mono text-xs text-neutral-400 whitespace-nowrap",children:IX(M.size)}),h.jsx(vt,{children:M.httpMetadata?.contentType?h.jsx(xn,{variant:"ghost",children:M.httpMetadata.contentType}):h.jsx("span",{className:"text-neutral-500 text-xs",children:"--"})}),h.jsx(vt,{className:"whitespace-nowrap text-xs text-neutral-400",children:PX(M.uploaded)}),h.jsx(vt,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(Ce,{variant:"ghost",size:"sm",onClick:()=>{S(M.key)},children:"Download"}),h.jsx(Ce,{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(Ce,{variant:"ghost",size:"sm",disabled:l.length===0,onClick:O,children:"Previous"}),h.jsx(Ce,{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(Ce,{variant:"default",onClick:()=>p(null),children:"Cancel"}),h.jsx(Ce,{variant:"destructive",onClick:N,disabled:x.isPending,children:x.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"})," Deleting..."]}):"Delete"})]})]})})]})}const zX={};function su(e,t){if(t==="absolute")return new Date(e).toLocaleString();const n=new Date(e),i=new Date().getTime()-n.getTime(),a=Math.floor(i/1e3);return a<60?`${a}s`:a<3600?`${Math.floor(a/60)}m`:a<86400?`${Math.floor(a/3600)}h`:`${Math.floor(a/86400)}d`}function LX(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 UX(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 $X(e,t){return e?`#${e.federatedCommitId??(t?`${t}:${e.commitSeq}`:String(e.commitSeq))}`:"#?"}function BX(e,t){return e?`E${e.federatedEventId??(t?`${t}:${e.eventId}`:e.eventId)}`:"E?"}function FX(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=zX?.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),z=_.useRef(!1),j=_.useMemo(()=>LX(S),[S]),A=_.useMemo(()=>new Date(Date.now()-UX(s)).toISOString(),[s]),{data:P,isLoading:Q,refetch:B}=bY({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}),U=ZY(),Z=R?.startsWith("#")?R.slice(1):void 0,K=R?.startsWith("E")?R.slice(1):void 0,ee=Z&&Z!=="?"?Z:void 0,D=K&&K!=="?"?K:void 0,{data:G,isLoading:q,error:V}=vY(ee,{enabled:ee!==void 0,partitionId:n}),{data:L,isLoading:I,error:H}=xY(D,{enabled:D!==void 0,partitionId:n}),{data:W,isLoading:Y,error:ae}=SY(D,{enabled:D!==void 0&&!!L?.payloadRef,partitionId:n}),se=_.useMemo(()=>FX(f,L?.traceId??null,L?.spanId??null),[L?.spanId,L?.traceId]);_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{e&&M(e)},[e]),_.useEffect(()=>{if(!z.current){z.current=!0;return}M(null)},[]),_.useEffect(()=>{C(1),M(null)},[]);const Se=_.useMemo(()=>(P?.items??[]).map(we=>{const ye=we.instanceId??we.commit?.instanceId??we.event?.instanceId,xe=ye?`[${ye}] `:"";if(we.type==="commit"&&we.commit){const Ie=we.commit;return{type:"commit",id:$X(Ie,ye),outcome:"--",duration:"--",actor:Ie.actorId,client:Ie.clientId,detail:`${xe}${Ie.changeCount} chg | ${(Ie.affectedTables??[]).join(", ")}`,time:su(we.timestamp,t.timeFormat)}}const ve=we.event;return ve?{type:ve.eventType,id:BX(ve,ye),outcome:ve.outcome,duration:`${ve.durationMs}ms`,actor:ve.actorId,client:ve.clientId,detail:`${xe}${(ve.tables??[]).join(", ")||"--"}`,time:su(we.timestamp,t.timeFormat)}:{type:"pull",id:"E?",outcome:"unknown",duration:"--",actor:"",client:"",detail:"--",time:su(we.timestamp,t.timeFormat)}}),[t.timeFormat,P?.items]),pe=P?.total??0,Me=Math.max(1,Math.ceil(pe/a)),_e=Q,re=[{label:"",options:[{id:"all",label:"All"},{id:"commits",label:"Commits"},{id:"events",label:"Events"}],activeId:d,onActiveChange:ie=>{p(ie),ie==="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:ie=>{i(ie),C(1)}},{label:"Type",options:[{id:"all",label:"All"},{id:"push",label:"Push"},{id:"pull",label:"Pull"}],activeId:g,onActiveChange:ie=>{y(ie),C(1)}},{label:"Outcome",options:[{id:"all",label:"All"},{id:"applied",label:"Applied"},{id:"error",label:"Error"},{id:"rejected",label:"Rejected"}],activeId:b,onActiveChange:ie=>{x(ie),C(1)}}];function he(){U.mutate(void 0,{onSuccess:()=>{N(!1),B()}})}return h.jsxs("div",{className:"flex flex-col h-full",children:[_e&&Se.length===0?h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})}):h.jsx(Qj,{entries:Se,selectedEntryId:R,onEntryClick:ie=>M(ie.id),filterBar:h.jsx(qj,{groups:re,searchValue:S,searchPlaceholder:"Use actor:, client:, table:, request:, trace: or free text...",onSearchChange:w,actions:h.jsxs(h.Fragment,{children:[h.jsx(Ce,{size:"sm",variant:"ghost",onClick:()=>{B()},children:"Refresh"}),h.jsx(Ce,{size:"sm",variant:"ghost",children:"Export"}),h.jsx(Ce,{size:"sm",variant:"destructive",onClick:()=>N(!0),children:"Clear"})]})}),pagination:h.jsx(px,{page:T,totalPages:Me,totalItems:pe,onPageChange:C})}),h.jsx($r,{open:R!==null,onOpenChange:ie=>{ie||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."}):G?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:G.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:G.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:G.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:su(G.createdAt,t.timeFormat)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Changes"}),h.jsx("div",{className:"text-neutral-100",children:G.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:G.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"}),G.changes.length===0?h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No changes recorded."}):G.changes.map(ie=>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:[ie.table," | ",ie.op]}),h.jsxs("span",{className:"text-neutral-500",children:["#",ie.changeId]})]}),h.jsxs("div",{className:"font-mono text-[11px] text-neutral-400",children:["rowId: ",ie.rowId,ie.rowVersion!==null?` | version: ${ie.rowVersion}`:""]}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Gd(ie.rowJson)})]},ie.changeId))]})]}):L?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:L.eventType})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Path"}),h.jsx("div",{className:"text-neutral-100",children:L.syncPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:L.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Outcome"}),h.jsx("div",{className:"text-neutral-100",children:L.outcome})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Response Status"}),h.jsx("div",{className:"text-neutral-100",children:L.responseStatus})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Actor"}),h.jsx("div",{className:"text-neutral-100",children:L.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:L.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Status"}),h.jsx("div",{className:"text-neutral-100",children:L.statusCode})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Transport"}),h.jsx("div",{className:"text-neutral-100",children:L.transportPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Duration"}),h.jsxs("div",{className:"text-neutral-100",children:[L.durationMs,"ms"]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Request ID"}),h.jsx("div",{className:"text-neutral-100",children:L.requestId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Trace ID"}),h.jsx("div",{className:"text-neutral-100",children:L.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:L.spanId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Commit Seq"}),h.jsx("div",{className:"text-neutral-100",children:L.commitSeq??"--"}),L.commitSeq!==null&&h.jsx(Ce,{variant:"ghost",size:"sm",onClick:()=>M(`#${L.instanceId?`${L.instanceId}:`:""}${L.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:L.subscriptionCount??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Error Code"}),h.jsx("div",{className:"text-neutral-100",children:L.errorCode??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Payload Ref"}),h.jsx("div",{className:"text-neutral-100",children:L.payloadRef??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:su(L.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:L.tables.join(", ")||"--"})]}),L.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(L.scopesSummary)})]}),L.payloadRef&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Payload Snapshot"}),Y?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..."})]}):ae?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."})]}),L.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:L.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(Ce,{variant:"default",size:"sm",onClick:()=>M(null),children:"Close"})})]})}),h.jsx($r,{open:O,onOpenChange:ie=>{ie||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(Ce,{variant:"default",size:"sm",onClick:()=>N(!1),children:"Cancel"}),h.jsx(Ce,{variant:"destructive",size:"sm",onClick:he,disabled:U.isPending,children:U.isPending?"Clearing...":"Clear all"})]})]})})]})}const HX=co({getParentRoute:()=>uo,path:"/config",component:aX}),qX=co({getParentRoute:()=>uo,path:"/fleet",component:bX}),VX=co({getParentRoute:()=>uo,path:"/",component:iX});function KX(){const{seq:e}=mk.useParams();return h.jsx(yx,{initialSelectedEntryId:`#${e}`})}const mk=co({getParentRoute:()=>uo,path:"/investigate/commit/$seq",component:KX});function GX(){const{id:e}=gk.useParams();return h.jsx(yx,{initialSelectedEntryId:`E${e}`})}const gk=co({getParentRoute:()=>uo,path:"/investigate/event/$id",component:GX}),ZX=co({getParentRoute:()=>uo,path:"/ops",component:RX}),YX=co({getParentRoute:()=>uo,path:"/storage",component:DX}),XX=co({getParentRoute:()=>uo,path:"/stream",component:yx}),yk=uo.addChildren([VX,XX,mk,gk,qX,ZX,YX,HX]),QX="syncular-console-basepath",WX="syncular-console-server-url",JX="syncular-console-token";function eQ(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function $v(e){const t=globalThis.document;if(!t)return;const n=t.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return eQ(n)}function vk(e){return!e||e==="/"?"/":(e.startsWith("/")?e:`/${e}`).replace(/\/+$/g,"")||"/"}function tQ(){return vk($v(QX))}function nQ(){const e=$v(WX),t=$v(JX);return!e||!t?null:{serverUrl:e,token:t}}XN({routeTree:yk,basepath:"/"});function rQ(){return new k6({defaultOptions:{queries:{staleTime:5e3,retry:1}}})}function sQ(e){return vk(e??tQ())}function oQ(e){const[t]=_.useState(()=>rQ()),n=_.useMemo(()=>XN({routeTree:yk,basepath:sQ(e.basePath)}),[e.basePath]),s=e.defaultConfig===void 0?nQ():e.defaultConfig;return h.jsx(O6,{client:t,children:h.jsx(QH,{defaultConfig:s,children:h.jsx(LH,{router:n})})})}function iQ(e){return h.jsx("div",{className:gx,children:h.jsx(oQ,{...e})})}function aQ(e){const t=document.querySelector(e);if(!t)throw new Error(`Unable to mount console: ${e} not found`);return t}function cQ(e,t={}){const n=aQ(e);BY(n);const s=a6.createRoot(n),i=h.jsx(iQ,{basePath:t.basePath,defaultConfig:t.defaultConfig});return t.strictMode===!1?(s.render(i),s):(s.render(h.jsx(_.StrictMode,{children:i})),s)}var lQ={};const uQ="syncular-sentry-dsn",fQ="syncular-sentry-environment",dQ="syncular-sentry-release";function hu(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function By(e){if(typeof document>"u")return;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return hu(t)}function Fy(e){if(!(typeof process>"u"))return hu(lQ[e])}function Hy(e){for(const t of e)if(t)return t}function hQ(){const e=Hy([hu(globalThis.__SYNCULAR_SENTRY_DSN__),By(uQ),Fy("SYNCULAR_SENTRY_DSN")]);if(!e)return null;const t=Hy([hu(globalThis.__SYNCULAR_SENTRY_ENVIRONMENT__),By(fQ),Fy("SYNCULAR_SENTRY_ENVIRONMENT")]),n=Hy([hu(globalThis.__SYNCULAR_SENTRY_RELEASE__),By(dQ),Fy("SYNCULAR_SENTRY_RELEASE")]);return{dsn:e,environment:t,release:n,enableLogs:!0,tracesSampleRate:.2,tracePropagationTargets:[/^https?:\/\/.*\/api\/.*/]}}const XC=hQ();XC&&WB(XC);cQ("#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 Qh(e,t){e&&Object.assign(e.style,t)}const MK={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},IK={position:"fixed"},PK=_.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:z,selectedItemTextRef:j,valuesRef:A,initialValueRef:P,popupRef:Q,setValue:B}=Wu(),U=$A(),Z=at(N,it.open),G=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),L=at(N,it.isItemEqualToValue),I=at(N,it.transitionStatus),H=_.useRef(null),W=_.useRef(null),[Y,ae]=_.useState(T),se=G&&Y&&K!=="touch";!G&&Y!==T&&ae(T),Le(()=>{G||(it.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),it.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,G]),_.useImperativeHandle(z,()=>se),BA((se||ee)&&Z&&K!=="touch",V);const fe=DA({anchor:s,floatingRootContext:U,positionMethod:i,mounted:G,side:f,sideOffset:p,align:d,alignOffset:g,arrowPadding:x,collisionBoundary:y,collisionPadding:b,sticky:S,disableAnchorTracking:w??se,collisionAvoidance:C,keepMounted:!0}),Se=se?"none":fe.side,pe=se?IK:fe.positionerStyles,Me=_.useMemo(()=>{const xe={};return Z||(xe.pointerEvents="none"),{role:"presentation",hidden:!G,style:{...pe,...xe}}},[Z,G,pe]),_e={open:Z,side:Se,align:fe.align,anchorHidden:fe.anchorHidden},re=ke(xe=>{N.set("positionerElement",xe)}),he=zt("div",t,{ref:[n,re],state:_e,stateAttributesMapping:nl,props:[Me,Np(I),O]}),ie=_.useRef(0),we=ke(xe=>{if(xe.size===0&&ie.current===0||A.current.length===0)return;const ve=ie.current;if(ie.current=xe.size,xe.size===ve)return;const Ie=Yt(ii);if(ve!==0&&!N.state.multiple&&D!==null&&zy(A.current,D,L)===-1){const Ee=P.current,Qe=Ee!=null&&zy(A.current,Ee,L)!==-1?Ee:null;B(Qe,Ie),Qe===null&&(N.set("selectedIndex",null),j.current=null)}if(ve!==0&&N.state.multiple&&Array.isArray(D)){const Ue=Ve=>zy(A.current,Ve,L)!==-1,Ee=D.filter(Ve=>Ue(Ve));(Ee.length!==D.length||Ee.some(Ve=>!lK(D,Ve,L)))&&(B(Ee,Ie),Ee.length===0&&(N.set("selectedIndex",null),j.current=null))}if(Z&&se){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ue={height:""};Qh(q,Ue),Qh(Q.current,Ue)}}),ye=_.useMemo(()=>({...fe,side:Se,alignItemWithTriggerActive:se,setControlledAlignItemWithTrigger:ae,scrollUpArrowRef:H,scrollDownArrowRef:W}),[fe,Se,se,ae]);return h.jsx(HA,{elementsRef:R,labelsRef:M,onMapChange:we,children:h.jsxs(qA.Provider,{value:ye,children:[G&&ee&&h.jsx(VA,{inert:fx(!Z),cutout:V}),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",PC={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}`})}},DK=_.createContext(void 0);function KA(e){return _.useContext(DK)}const wc="ArrowUp",Wi="ArrowDown",Ru="ArrowLeft",Ec="ArrowRight",Ju="Home",ef="End",ZA=new Set([Ru,Ec]),zK=new Set([Ru,Ec,Ju,ef]),YA=new Set([wc,Wi]),LK=new Set([wc,Wi,Ju,ef]),XA=new Set([...ZA,...YA]),UK=new Set([...XA,Ju,ef]),QA=new Set([wc,Wi,Ru,Ec,Ju,ef]),$K="Shift",BK="Control",FK="Alt",HK="Meta",qK=new Set([$K,BK,FK,HK]);function VK(e){return Zt(e)&&e.tagName==="INPUT"}function DC(e){return!!(VK(e)&&e.selectionStart!=null||Zt(e)&&e.tagName==="TEXTAREA")}function zC(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=LC(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=LC(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 LC(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 Ly(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const GK=_.createContext(void 0),KK={disableStyleElements:!1};function ZK(){return _.useContext(GK)??KK}const Vi=1,YK={...nl,...ba},XK=_.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:z,scrollUpArrowRef:j}=OK(),A=KA()!=null,P=$A(),{nonce:Q,disableStyleElements:B}=ZK(),U=ns(),Z=at(f,it.id),G=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),L=at(f,it.listElement),I=_.useRef(0),H=_.useRef(!1),W=_.useRef(0),Y=_.useRef(!1),ae=_.useRef({}),se=ox(),fe=ke(_e=>{if(!V||!d.current||!Y.current)return;if(H.current||!R){w();return}const re=V.style.top==="0px",he=V.style.bottom==="0px",ie=V.getBoundingClientRect().height,we=Rt(V),ye=getComputedStyle(V),xe=parseFloat(ye.marginTop),ve=parseFloat(ye.marginBottom),Ie=UC(getComputedStyle(d.current)),Ue=Math.min(we.documentElement.clientHeight-xe-ve,Ie),Ee=_e.scrollTop,Ve=$C(_e);let Qe=0,Be=null,We=!1,He=!1;const me=qe=>{V.style.height=`${qe}px`},Te=(qe,ht)=>{const lt=Ly(qe,0,Ue-ie);lt>0&&me(ie+lt),_e.scrollTop=ht,Ue-(ie+lt)<=Vi&&(H.current=!0),w()};if(re){const qe=Ve-Ee,ht=ie+qe,lt=Math.min(ht,Ue);if(Qe=lt,qe<=Vi){Te(qe,Ve);return}Ue-lt>Vi?He=!0:We=!0}else if(he){const qe=Ee,ht=ie+qe,lt=Math.min(ht,Ue),wr=ht-Ue;if(Qe=lt,qe<=Vi){Te(qe,0);return}Ue-lt>Vi?Be=0:(We=!0,Ee<Ve&&(Be=Ee-(qe-wr)))}if(Qe=Math.ceil(Qe),Qe!==0&&me(Qe),He||Be!=null){const qe=$C(_e),ht=He?qe:Ly(Be,0,qe);Math.abs(_e.scrollTop-ht)>Vi&&(_e.scrollTop=ht)}(We||Qe>=Ue-Vi)&&(H.current=!0),w()});_.useImperativeHandle(T,()=>fe,[fe]),xa({open:G,ref:d,onComplete(){G&&p?.(!0)}});const Se={open:G,transitionStatus:K,side:O,align:N};Le(()=>{!V||!d.current||Object.keys(ae.current).length||(ae.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(()=>{G||R||(Y.current=!1,H.current=!1,I.current=0,W.current=0,Qh(V,ae.current))},[G,R,V,d]),Le(()=>{const _e=d.current;if(!(!G||!q||!V||!_e||f.state.transitionStatus==="ending")){if(!R){Y.current=!0,se.request(w),_e.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const re=QK(_e);_e.style.removeProperty("--transform-origin");try{const he=getComputedStyle(V),ie=getComputedStyle(_e),we=Rt(q),ye=un(V),xe=q.getBoundingClientRect(),ve=V.getBoundingClientRect(),Ie=xe.left,Ue=xe.height,Ee=L||_e,Ve=Ee.scrollHeight,Qe=parseFloat(ie.borderBottomWidth),Be=parseFloat(he.marginTop)||10,We=parseFloat(he.marginBottom)||10,He=parseFloat(he.minHeight)||100,me=UC(ie),Te=5,qe=5,ht=20,lt=we.documentElement.clientHeight-Be-We,wr=we.documentElement.clientWidth,Er=lt-xe.bottom+Ue,Qt=b.current,ut=y.current;let xt,ot=0,Wt=0;if(Qt&&ut){const tr=ut.getBoundingClientRect();xt=Qt.getBoundingClientRect();const cs=tr.left-Ie,fo=xt.left-ve.left,ho=tr.top-xe.top+tr.height/2,nr=xt.top-ve.top+xt.height/2;ot=cs-fo,Wt=nr-ho}const vn=Er+Wt+We+Qe;let kt=Math.min(lt,vn);const Cn=lt-Be-We,er=vn-kt,An=Math.max(Te,Ie+ot),is=wr-qe,as=Math.max(0,An+ve.width-is);V.style.left=`${An-as}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,wi=er>=_a;wi&&(kt=Math.min(lt,ve.height)-(er-_a));const Ei=xe.top<ht||xe.bottom>lt-ht||kt<Math.min(Ve,He),_s=(ye.visualViewport?.scale??1)!==1&&tx;if(Ei||_s){Y.current=!0,Qh(V,ae.current),hi.flushSync(()=>M(!1));return}if(wi){const tr=Math.max(0,lt-vn);V.style.top=ve.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=ve.top,cs=ve.height,fo=xt.top+xt.height/2,ho=cs>0?(fo-tr)/cs*100:50,nr=Ly(ho,0,100);_e.style.setProperty("--transform-origin",`50% ${nr}%`)}(I.current===lt||kt>=me)&&(H.current=!0),w(),setTimeout(()=>{Y.current=!0})}finally{re()}})}},[f,G,V,q,y,b,d,w,R,M,se,z,j,L]),_.useEffect(()=>{if(!R||!V||!G)return;const _e=un(V);function re(he){g(!1,Yt(x8,he))}return _e.addEventListener("resize",re),()=>{_e.removeEventListener("resize",re)}},[g,R,V,G]);const pe={...L?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${Z}-list`},onKeyDown(_e){x.current=!0,A&&QA.has(_e.key)&&_e.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(_e){if(!C||GA(_e)||_e.pointerType==="touch")return;const re=_e.currentTarget;U.start(0,()=>{f.set("activeIndex",null),re.focus({preventScroll:!0})})},onScroll(_e){L||fe(_e.currentTarget)},...R&&{style:L?{height:"100%"}:MK}},Me=zt("div",t,{ref:[n,d],state:Se,stateAttributesMapping:YK,props:[D,pe,Np(K),{className:!L&&R?PC.className:void 0},l]});return h.jsxs(_.Fragment,{children:[!B&&PC.getElement(Q),h.jsx(_A,{context:P,modal:!1,disabled:!ee,returnFocus:a,restoreFocus:!0,children:Me})]})});function UC(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function $C(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const BC=[["transform","none"],["scale","1"],["translate","0 0"]];function QK(e){const{style:t}=e,n={};for(const[s,i]of BC)n[s]=t.getPropertyValue(s),t.setProperty(s,i,"important");return()=>{for(const[s]of BC){const i=n[s];i?t.setProperty(s,i):t.removeProperty(s)}}}let WA=(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}=NK(),b=_.useRef(-1),[x,S]=_.useState(a??(i===WA.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 WK=_.createContext(void 0),JK=_.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:WA.GuessFromOrder}),{store:b,getItemProps:x,setOpen:S,setValue:w,selectionRef:T,typingRef:C,valuesRef:O,keyboardActiveRef:N,multiple:R,highlightItemOnHover:M}=Wu(),z=ns(),j=at(b,it.isActive,y.index),A=at(b,it.isSelected,y.index,a),P=at(b,it.isSelectedByFocus,y.index),Q=at(b,it.isItemEqualToValue),B=y.index,U=B!==-1,Z=_.useRef(null),G=Jo(B);Le(()=>{if(!U)return;const se=O.current;return se[B]=a,()=>{delete se[B]}},[U,B,a,O]),Le(()=>{if(!U)return;const se=b.state.value;let fe=se;R&&Array.isArray(se)&&se.length>0&&(fe=se[se.length-1]),fe!==void 0&&$c(a,fe,Q)&&b.set("selectedIndex",B)},[U,B,R,Q,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:L,buttonRef:I}=Jc({disabled:f,focusableWhenDisabled:!0,native:d});function H(se){const fe=b.state.value;if(R){const Se=Array.isArray(fe)?fe:[],pe=A?uK(Se,a,Q):[...Se,a];w(pe,Yt(Cy,se))}else w(a,Yt(Cy,se)),S(!1,Yt(Cy,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)||z.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 fe=!T.current.allowSelectedMouseUp&&A,Se=!T.current.allowUnselectedMouseUp&&!A;fe||Se||q.current!=="touch"&&!j||H(se.nativeEvent)}},Y=zt("div",t,{ref:[I,n,y.ref,Z],state:ee,props:[D,W,p,L]}),ae=_.useMemo(()=>({selected:A,indexRef:G,textRef:g,selectedByFocus:P,hasRegistered:U}),[A,G,g,P,U]);return h.jsx(WK.Provider,{value:ae,children:Y})})),eZ=_.forwardRef(({className:e,children:t,...n},s)=>h.jsx(bK,{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}));eZ.displayName="SelectTrigger";const tZ=_.forwardRef(({className:e,portalProps:t,positionerProps:n,...s},i)=>h.jsx(SK,{...t,children:h.jsx(PK,{...n,children:h.jsx(XK,{ref:i,className:ge("bg-panel border border-border rounded-md py-1 shadow-lg z-50",e),...s})})}));tZ.displayName="SelectContent";const nZ=_.forwardRef(({className:e,...t},n)=>h.jsx(JK,{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}));nZ.displayName="SelectItem";const rZ=_.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}));rZ.displayName="Textarea";const JA=_.createContext(void 0);function sZ(e=!0){const t=_.useContext(JA);if(t===void 0&&!e)throw new Error(yn(7));return t}function ek(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=Aj(),{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 oZ(e){const{render:t,className:n,state:s=an,props:i=Eu,refs:a=Eu,metadata:l,stateAttributesMapping:f,tag:d="div",...p}=e,{compositeProps:g,compositeRef:y}=ek({metadata:l});return zt(d,e,{state:s,ref:[...a,y],props:[g,...i,p],stateAttributesMapping:f})}const iZ=_.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=sZ(),T=w?.value??[],C=w?void 0:i,O=(a||w?.disabled)??!1,[N,R]=pp({controlled:w?S!==void 0&&T.indexOf(S)>-1:d,default:C,name:"Toggle",state:"pressed"}),M=ke((U,Z)=>{S&&w?.setGroupValue?.(S,U,Z),f?.(U,Z)}),{getButtonProps:z,buttonRef:j}=Jc({disabled:O,native:b}),A={disabled:O,pressed:N},P=[j,n],Q=[{"aria-pressed":N,onClick(U){const Z=!N,G=Yt(ii,U.nativeEvent);M(Z,G),!G.isCanceled&&R(Z)}},x,z],B=zt("button",t,{enabled:!w,state:A,ref:P,props:Q});return w?h.jsx(oZ,{tag:"button",render:p,className:s,state:A,refs:P,props:Q}):B}),Dr=_.forwardRef(({className:e,...t},n)=>h.jsx(iZ,{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 aZ(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const tk="data-composite-item-active",cZ=[];function lZ(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=cZ}=e,[S,w]=_.useState(0),T=n>1,C=_.useRef(null),O=so(C,p),N=_.useRef([]),R=_.useRef(!1),M=f??S,z=ke((P,Q=!1)=>{if((d??w)(P),Q){const B=N.current[P];zC(C.current,B,l,a)}}),j=ke(P=>{if(P.size===0||R.current)return;R.current=!0;const Q=Array.from(P.keys()),B=Q.find(Z=>Z?.hasAttribute(tk))??null,U=B?Q.indexOf(B):-1;U!==-1&&z(U),zC(C.current,B,l,a)}),A=_.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,ref:O,onFocus(P){!C.current||!DC(P.target)||P.target.setSelectionRange(0,P.target.value.length??0)},onKeyDown(P){const Q=g?UK:XA;if(!Q.has(P.key)||uZ(P,x)||!C.current)return;const U=l==="rtl",Z=U?Ru:Ec,G={horizontal:Z,vertical:Wi,both:Z}[a],ee=U?Ec:Ru,D={horizontal:ee,vertical:wc,both:ee}[a];if(DC(P.target)&&!aZ(P.target)){const W=P.target.selectionStart,Y=P.target.selectionEnd,ae=P.target.value??"";if(W==null||P.shiftKey||W!==Y||P.key!==D&&W<ae.length||P.key!==G&&W>0)return}let K=M;const q=EV(N,b),V=TV(N,b);if(T){const W=t||Array.from({length:N.current.length},()=>({width:1,height:1})),Y=RV(W,n,i),ae=Y.findIndex(fe=>fe!=null&&!fu(N,fe,b)),se=Y.reduce((fe,Se,pe)=>Se!=null&&!fu(N,Se,b)?pe:fe,-1);K=Y[CV({current:Y.map(fe=>fe?N.current[fe]:null)},{event:P,orientation:a,loopFocus:s,cols:n,disabledIndices:jV([...b||N.current.map((fe,Se)=>fu(N,Se)?Se:void 0),void 0],Y),minIndex:ae,maxIndex:se,prevIndex:NV(M>V?q:M,W,Y,n,P.key===Wi?"bl":P.key===Ec?"tr":"tl"),rtl:U})]}const L={horizontal:[Z],vertical:[Wi],both:[Z,Wi]}[a],I={horizontal:[ee],vertical:[wc],both:[ee,wc]}[a],H=T?Q:{horizontal:g?zK:ZA,vertical:g?LK:YA,both:Q}[a];g&&(P.key===Ju?K=q:P.key===ef&&(K=V)),K===M&&(L.includes(P.key)||I.includes(P.key))&&(s&&K===V&&L.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&&!ch(N,K)&&(y&&P.stopPropagation(),H.has(P.key)&&P.preventDefault(),z(K,!0),queueMicrotask(()=>{N.current[K]?.focus()}))}}),[n,i,l,b,N,g,M,T,t,s,O,x,z,a,y]);return _.useMemo(()=>({props:A,highlightedIndex:M,onHighlightedIndexChange:z,elementsRef:N,disabledIndices:b,onMapChange:j,relayKeyboardEvent:A.onKeyDown}),[A,M,z,N,b,j])}function uZ(e,t){for(const n of qK.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function nk(e){const{render:t,className:n,refs:s=Eu,props:i=Eu,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",...z}=e,j=IA(),{props:A,highlightedIndex:P,onHighlightedIndexChange:Q,elementsRef:B,onMapChange:U,relayKeyboardEvent:Z}=lZ({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}),G=zt(M,e,{state:a,ref:s,props:[A,...i,z],stateAttributesMapping:l}),ee=_.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:Q,highlightItemOnHover:R,relayKeyboardEvent:Z}),[P,Q,R,Z]);return h.jsx(jj.Provider,{value:ee,children:h.jsx(HA,{elementsRef:B,onMapChange:D=>{w?.(D),U(D)},children:G})})}let fZ=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const FC={multiple(e){return e?{[fZ.multiple]:""}:null}},dZ=_.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=KA(),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]=pp({controlled:p,default:S,name:"ToggleGroup",state:"value"}),N=ke((A,P,Q)=>{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,Q),Q.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]),z={role:"group"},j=zt("div",t,{enabled:!!x,state:R,ref:n,props:[z,b],stateAttributesMapping:FC});return h.jsx(JA.Provider,{value:M,children:x?j:h.jsx(nk,{render:y,className:g,state:R,refs:[n],props:[z,b],stateAttributesMapping:FC,loopFocus:a,enableHomeAndEndKeys:!0})})}),dh=_.forwardRef(({className:e,...t},n)=>h.jsx(dZ,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));dh.displayName="ToggleGroup";function rk({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 hZ({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(rk,{active:l,onClick:f,children:a.label},a.id)})})}const pZ=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}}),mZ={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 gZ({color:e,size:t,glow:n,pulse:s,className:i}){return h.jsx("span",{className:ge(pZ({color:e,size:t,glow:n}),s&&"dot-pulse",i),style:n?{boxShadow:mZ[e??"healthy"]}:void 0})}const yZ="0.0.6-48",vZ={version:yZ},bZ=vZ.version;function xZ({label:e,className:t}){return h.jsxs("div",{className:ge("flex items-center gap-3",t),children:[h.jsx(gZ,{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",bZ]})]})}function SZ({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 _Z=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(_Z({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 sk=_.createContext(void 0);function rl(e){const t=_.useContext(sk);if(e===!1&&t===void 0)throw new Error(yn(27));return t}const wZ={...nl,...ba},hx=_.forwardRef(function(t,n){const{render:s,className:i,forceRender:a=!1,...l}=t,{store:f}=rl(),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:wZ,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!p})}),ok=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=rl(),d=br(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),zt("p",t,{ref:n,props:[{id:d},l]})});let EZ=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),TZ=(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 ik=_.createContext(void 0);function CZ(){const e=_.useContext(ik);if(e===void 0)throw new Error(yn(26));return e}const RZ={...nl,...ba,nestedDialogOpen(e){return e?{[TZ.nestedDialogOpen]:""}:null}},ak=_.forwardRef(function(t,n){const{className:s,finalFocus:i,initialFocus:a,render:l,...f}=t,{store:d}=rl(),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");CZ(),xa({open:C,ref:d.context.popupRef,onComplete(){C&&d.context.onOpenChangeComplete?.(!0)}});function z(B){return B==="touch"?d.context.popupRef.current:!0}const j=a===void 0?z:a,A=T>0,Q=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){QA.has(B.key)&&B.stopPropagation()},style:{[EZ.nestedDialogs]:T}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:RZ});return h.jsx(_A,{context:y,openInteractionType:O,disabled:!S,closeOnFocusOut:!g,initialFocus:j,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:Q})}),ck=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t,{store:a}=rl(),l=a.useState("mounted"),f=a.useState("modal"),d=a.useState("open");return l||s?h.jsx(ik.Provider,{value:s,children:h.jsxs(SA,{ref:n,...i,children:[l&&f===!0&&h.jsx(VA,{ref:a.context.internalBackdropRef,inert:fx(!d)}),t.children]})}):null});function NZ(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}=mK(i);oG(t);const{forceUnmount:y}=iG(i,t,()=>{g()}),b=ke(Q=>{const B=Yt(Q);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=dG({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,T]=_.useState(0),C=w===0,O=SG(S),N=K7(S,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(Q){if(!t.context.outsidePressEnabledRef.current||"button"in Q&&Q.button!==0||"touches"in Q&&Q.touches.length!==1)return!1;const B=Ur(Q);if(C&&!a){const U=B;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===U||t.context.backdropRef.current===U||Ot(U,f)&&!U?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});BA(i&&l===!0,f);const{getReferenceProps:R,getFloatingProps:M,getTriggerProps:z}=bG([O,N]);t.useContextCallback("onNestedDialogOpen",Q=>{T(Q+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(()=>z(p),[z,p]),P=_.useMemo(()=>M(),[M]);t.useSyncedValues({openMethod:d,activeTriggerProps:j,inactiveTriggerProps:A,popupProps:P,floatingRootContext:S,nestedOpenDialogCount:w})}const jZ={...lG,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 AZ extends kA{constructor(t){super(kZ(t),{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new lx,onOpenChange:void 0,onOpenChangeComplete:void 0},jZ)}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 kZ(e={}){return{...cG(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function OZ(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=rl(!0),x=!!b,S=zn(()=>p?.store??new AZ({open:s,openProp:n,activeTriggerId:y,triggerIdProp:g,modal:f,disablePointerDismissal:l,nested:x})).current;Y8(()=>{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");NZ({store:S,actionsRef:d,parentContext:b?.store.context});const T=_.useMemo(()=>({store:S}),[S]);return h.jsx(sk.Provider,{value:T,children:typeof t=="function"?t({payload:w}):t})}const lk=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=rl(),d=br(a);return f.useSyncedValueWithCleanup("titleElementId",d),zt("h2",t,{ref:n,props:[{id:d},l]})}),$r=OZ,MZ=_.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}));MZ.displayName="DialogOverlay";const hr=_.forwardRef(({className:e,children:t,...n},s)=>h.jsxs(ck,{children:[h.jsx(hx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(ak,{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(lk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));mr.displayName="DialogTitle";const IZ=_.forwardRef(({className:e,...t},n)=>h.jsx(ok,{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));IZ.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(Ce,{size:"sm",variant:"default",disabled:t<=1,onClick:()=>i(t-1),children:"Prev"}),h.jsx(Ce,{size:"sm",variant:"default",disabled:t>=n,onClick:()=>i(t+1),children:"Next"})]})]}));px.displayName="Pagination";const PZ=_.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}));PZ.displayName="Separator";const DZ=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(ck,{children:[h.jsx(hx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(ak,{ref:i,className:ge(DZ({side:t,className:e})),...s,children:n})]}));zZ.displayName="SheetContent";const LZ=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));LZ.displayName="SheetHeader";const UZ=_.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}));UZ.displayName="SheetFooter";const $Z=_.forwardRef(({className:e,...t},n)=>h.jsx(lk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));$Z.displayName="SheetTitle";const BZ=_.forwardRef(({className:e,...t},n)=>h.jsx(ok,{ref:n,className:ge("text-sm text-neutral-400",e),...t}));BZ.displayName="SheetDescription";const FZ=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("rounded-md bg-neutral-800 animate-pulse",e),...t}));FZ.displayName="Skeleton";const HZ=_.createContext(void 0);function mx(){const e=_.useContext(HZ);if(e===void 0)throw new Error(yn(64));return e}let qZ=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const uk={tabActivationDirection:e=>({[qZ.activationDirection]:e})},fk=_.createContext(void 0);function VZ(){const e=_.useContext(fk);if(e===void 0)throw new Error(yn(65));return e}const GZ=_.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}=VZ(),O=br(f),N=_.useMemo(()=>({disabled:i,id:O,value:l}),[i,O,l]),{compositeProps:R,compositeRef:M,index:z}=ek({metadata:N}),j=l===g,A=_.useRef(!1);Le(()=>{if(A.current){A.current=!1;return}if(!(j&&z>-1&&S!==z))return;const V=C;if(V!=null){const L=Fo(Rt(V));if(L&&Ot(V,L))return}i||T(z)},[j,z,S,T,i,C]);const{getButtonProps:P,buttonRef:Q}=Jc({disabled:i,native:d,focusableWhenDisabled:!0}),B=y(l),U=_.useRef(!1),Z=_.useRef(!1);function G(V){j||i||w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"}))}function ee(V){j||(z>-1&&!i&&T(z),!i&&x&&(!U.current||U.current&&Z.current)&&w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"})))}function D(V){if(j||i)return;U.current=!0;function L(){U.current=!1,Z.current=!1}(!V.button||V.button===0)&&(Z.current=!0,Rt(V.currentTarget).addEventListener("pointerup",L,{once:!0}))}return zt("button",t,{state:{disabled:i,active:j,orientation:b},ref:[n,Q,M],props:[R,{role:"tab","aria-controls":B,"aria-selected":j,id:O,onClick:G,onFocus:ee,onPointerDown:D,[tk]:j?"":void 0,onKeyDownCapture(){A.current=!0}},p,P]})});let KZ=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const ZZ={...uk,...ba},YZ=_.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}=Rp(O),z=!N,j=p(i),A={hidden:z,orientation:g,tabActivationDirection:y,transitionStatus:R},P=_.useRef(null),Q=zt("div",t,{state:A,ref:[n,T,P],props:[{"aria-labelledby":j,hidden:z,id:S,role:"tabpanel",tabIndex:O?0:-1,inert:fx(!O),[KZ.index]:C},f],stateAttributesMapping:ZZ});return xa({open:O,ref:P,onComplete(){O||M(!1)}}),Le(()=>{if(!(z&&!l)&&S!=null)return b(i,S),()=>{x(i,S)}},[z,l,i,S,b,x]),l||N?Q:null}),XZ=_.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=QZ(y,g,T,d),N=ke((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"},z=_.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:S,onTabActivation:N,setHighlightedTabIndex:w,tabsListElement:T,value:y}),[s,S,N,w,T,y]);return h.jsx(fk.Provider,{value:z,children:h.jsx(nk,{render:l,className:i,state:R,refs:[n,C],props:[M,f],stateAttributesMapping:uk,highlightedIndex:S,enableHomeAndEndKeys:!0,loopFocus:a,orientation:g,onHighlightedIndexChange:w,onMapChange:b,disabledIndices:Eu})})});function HC(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 QZ(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}=HC(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}=HC(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 WZ=_.forwardRef(({className:e,...t},n)=>h.jsx(XZ,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));WZ.displayName="TabsList";const JZ=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"}}),eY=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx(GZ,{ref:s,className:ge(JZ({variant:t,className:e})),...n}));eY.displayName="TabsTrigger";const tY=_.forwardRef(({className:e,...t},n)=>h.jsx(YZ,{ref:n,className:ge("outline-none",e),...t}));tY.displayName="TabsContent";const nY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[11px] text-neutral-300",e),...t}));nY.displayName="Text";const rY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));rY.displayName="TextMuted";const sY=_.forwardRef(({className:e,...t},n)=>h.jsx("code",{ref:n,className:ge("font-mono text-[11px] text-white",e),...t}));sY.displayName="TextCode";const oY=_.forwardRef(({className:e,...t},n)=>h.jsx("span",{ref:n,className:ge("font-mono text-[9px] uppercase tracking-wider text-neutral-500",e),...t}));oY.displayName="TextLabel";const iY=_.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}));iY.displayName="CodeBlock";const dk=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const aY=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const cY=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const qC=e=>{const t=cY(e);return t.charAt(0).toUpperCase()+t.slice(1)};var lY={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 uY=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const fY=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:l,...f},d)=>_.createElement("svg",{ref:d,...lY,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:dk("lucide",i),...!a&&!uY(f)&&{"aria-hidden":"true"},...f},[...l.map(([p,g])=>_.createElement(p,g)),...Array.isArray(a)?a:[a]]));const hk=(e,t)=>{const n=_.forwardRef(({className:s,...i},a)=>_.createElement(fY,{ref:a,iconNode:t,className:dk(`lucide-${aY(qC(e))}`,`lucide-${e}`,s),...i}));return n.displayName=qC(e),n};const dY=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],hY=hk("arrow-left",dY);const pY=[["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"}]],mY=hk("settings",pY),gY="console:instance-id";function Lt(){const[e,t]=pi(gY,""),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 Gu(t.GET("/console/stats",{params:{query:i}}))},enabled:!!t,refetchInterval:_i(e.refetchIntervalMs,5e3)})}function yY(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 vY(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 bY(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 Gu(n.GET("/console/commits",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function xY(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 SY(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 Gu(n.GET("/console/timeline",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function pk(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 Gu(n.GET("/console/clients",{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.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 wY(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 EY(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 TY(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 CY(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 Gu(n.GET("/console/operations",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function RY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 NY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 jY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 AY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 kY(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 OY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 MY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 IY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 PY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 DY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 zY(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 LY(){const{config:e}=Dt(),t=_r();return os({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 UY(){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 $Y="console:partition-id";function sf(){const[e,t]=pi($Y,""),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 BY=[{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"}],FY=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],gx="syncular-console-root";function HY(e){e.classList.add(gx)}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 VY(e){const t=e?.trim()??"";return!t||t==="/"?"":(t.startsWith("/")?t:`/${t}`).replace(/\/+$/g,"")}function Uy(e,t){return e?t?`${e}${t}`:e:t||"/"}function GY({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=VY(e),N=_.useMemo(()=>qY.map(P=>({...P,id:Uy(O,P.suffix)})),[O]),R=Uy(O,""),M=Uy(O,"/config"),z=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(SZ,{brand:h.jsx(bc,{to:R,children:h.jsx(xZ,{label:"console"})}),center:h.jsx(hZ,{items:N,activeId:j,renderItem:(P,{active:Q})=>h.jsx(bc,{to:P.id,children:h.jsx(rk,{active:Q,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(Kn,{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(Ce,{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(Kn,{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(Ce,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:w,children:"All"}):null]}),h.jsx(N8,{state:z}),h.jsx(bc,{to:M,children:h.jsx(Ce,{variant:T===M?"secondary":"ghost",size:"icon",children:h.jsx(mY,{})})}),t?h.jsx("a",{href:t,children:h.jsxs(Ce,{variant:"primary",size:"sm",className:"h-8",children:[h.jsx(hY,{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(KY,{configPath:M,hasSavedConfig:!!i,isConnecting:l,onConnect:()=>{s()}})})}),a&&h.jsx(Bj,{isLive:a,metrics:A,uptime:"--"})]})}function KY({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(Ce,{variant:"default",onClick:s,disabled:n,children:n?"Connecting...":"Connect"}),h.jsx(bc,{to:e,children:h.jsx(Ce,{variant:"link",children:"Configure connection"})})]})]})}const uo=jH({component:GY});function ZY(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("swServer")==="1"}function YY(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),z=_.useRef(0),j=_.useRef(0),A=_.useRef(null),P=_.useRef(null),Q=_.useCallback(()=>{b([]),A.current=null,P.current=null},[]);return _.useEffect(()=>{if(!n||!d||!f?.serverUrl||!f?.token)return;let B=!1;const U=Number.isFinite(i)?Math.max(1,Math.min(500,Math.floor(i))):100;if(ZY()||typeof WebSocket>"u"){T("connecting"),S(!1);let V=null,L=!1;const I=async()=>{if(!(B||L)){L=!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(U)),H.searchParams.set("offset","0"),a&&H.searchParams.set("partitionId",a);const Y=await fetch(H.toString(),{headers:{Authorization:`Bearer ${f.token}`}});if(!Y.ok)throw new Error(`Live event polling failed (${Y.status})`);const ae=await Y.json(),fe=(Array.isArray(ae.items)?ae.items:[]).filter(Me=>g?Me.instanceId===g:!0).sort((Me,_e)=>Me.eventId-_e.eventId),Se=P.current??-1,pe=fe.filter(Me=>Me.eventId>Se);if(pe.length>0){const Me=pe.map(re=>({type:re.eventType,timestamp:re.createdAt,data:re})).reverse();b(re=>[...Me,...re].slice(0,t));const _e=pe[pe.length-1];P.current=_e.eventId,A.current=_e.createdAt}else if(fe.length>0){const Me=fe[fe.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{L=!1}}};return I(),V=setInterval(()=>{I()},2e3),()=>{B=!0,V&&clearInterval(V),S(!1),T("disconnected")}}const G=()=>{R.current&&(clearTimeout(R.current),R.current=null)},ee=()=>{M.current&&(clearInterval(M.current),M.current=null)},D=()=>{if(B||R.current)return;z.current+=1;const V=Math.min(3e4,1e3*2**Math.max(0,z.current-1)),L=Math.floor(V*.2*Math.random()),I=V+L;R.current=setTimeout(()=>{R.current=null,B||q()},I)},K=()=>{j.current=Date.now(),S(!0),T("connected")},q=()=>{if(B)return;T("connecting"),G();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="",I.searchParams.set("token",f.token),A.current&&I.searchParams.set("since",A.current),I.searchParams.set("replayLimit",String(U)),a&&I.searchParams.set("partitionId",a),g&&I.searchParams.set("instanceId",g),I.toString()})(),L=new WebSocket(V);N.current=L,L.onopen=()=>{if(B){L.close();return}z.current=0,K(),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)},L.onclose=()=>{B||(S(!1),T("disconnected"),ee(),D())},L.onerror=()=>{B||O(new Error("WebSocket connection failed"))},L.onmessage=I=>{try{const H=JSON.parse(I.data),W=H.type;if(K(),W==="connected"||W==="heartbeat")return;const Y={type:W,timestamp:H.timestamp||new Date().toISOString(),data:H};if(a&&Y.data.partitionId!==a||g&&Y.data.instanceId!==g)return;const ae=Date.parse(A.current??""),se=Date.parse(Y.timestamp);Number.isFinite(se)&&(!Number.isFinite(ae)||se>ae)&&(A.current=Y.timestamp),b(fe=>[Y,...fe].slice(0,t))}catch{}}};return q(),()=>{B=!0,G(),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:Q}}function XY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return os({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 QY=_.createContext(null);function mk(){const[e,t]=pi("console:time-range","24h");return{range:e,setRange:t}}const WY=[{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 JY(e){const t=e.toLowerCase();for(const n of WY)if(t.includes(n.hint))return n.type;return"client"}function eX(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 tX(e,t){return typeof e.lagCommitCount=="number"?Math.max(0,e.lagCommitCount):t?Math.max(0,t.maxCommitSeq-e.cursor):0}function nX(e,t){return e.activityState==="stale"?"offline":t>0?"syncing":"online"}function rX(e,t){return e.length<=16?e:`${e.slice(0,12)}-${t+1}`}function sX(e,t,n={}){const s=n.maxNodes??10;return e.slice(0,s).map((i,a)=>{const l=tX(i,t),f=nX(i,l);return{id:rX(i.clientId,a),type:JY(i.clientId),status:f,cursor:Math.max(0,i.cursor),actor:i.actorId,mode:i.connectionMode,dialect:eX(i.clientId),scopes:Object.keys(i.effectiveScopes||{}),lastSeen:i.updatedAt}})}const oX={enabled:!1,thresholds:{p90Latency:500,errorRate:5,clientLag:100}};function GC(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 iX(e){const t=e.length>1&&e.endsWith("/")?e.slice(0,-1):e;return t==="/console"||t.startsWith("/console/")?"/console/stream":"/stream"}function aX(){const e=dp(),t=_.useMemo(()=>typeof window>"u"?"/stream":iX(window.location.pathname),[]),n=mk(),{range:s}=n,{preferences:i}=of(),{partitionId:a}=sf(),l=i.refreshInterval*1e3,[f]=pi("console:alert-config",oX),[d,p]=_.useState("1h"),{data:g}=rf({refetchIntervalMs:l,partitionId:a}),{data:y}=yY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:b}=vY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:x}=bY({limit:5,partitionId:a},{refetchIntervalMs:l}),{data:S}=pk({limit:12,offset:0,partitionId:a},{refetchIntervalMs:l}),{events:w,isConnected:T}=YY({maxEvents:8,partitionId:a}),C=_.useMemo(()=>{const U=y?.buckets??[];let Z=0,G=0;for(const D of U)Z+=D.pushCount+D.pullCount,G+=D.errorCount;const ee=Z>0?G/Z*100:0;return{totalEvents:Z,errorRate:ee}},[y?.buckets]),O=_.useMemo(()=>S?.items?sX(S.items,g,{maxNodes:12}):[],[S?.items,g]),N=O.filter(U=>U.status!=="offline").length,R=O.filter(U=>U.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]),z=_.useMemo(()=>w.map(U=>({type:U.type.toUpperCase(),actor:U.data?.actorId??"",table:(U.data?.tables??[])[0]??"",time:GC(U.timestamp,i.timeFormat)})),[w,i.timeFormat]),j=_.useMemo(()=>{const U=y?.buckets;if(!U?.length)return[];const Z=Math.max(...U.map(G=>Math.max(G.pushCount,G.pullCount)),1);return U.map(G=>({pushPercent:Z>0?G.pushCount/Z*100:0,pullPercent:Z>0?G.pullCount/Z*100:0}))},[y?.buckets]),A=_.useMemo(()=>{if(!b)return[];const U=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/U*100,pullBarPercent:b.pull.p50/U*100},{label:"P90",pushMs:b.push.p90,pullMs:b.pull.p90,pushBarPercent:b.push.p90/U*100,pullBarPercent:b.pull.p90/U*100},{label:"P99",pushMs:b.push.p99,pullMs:b.pull.p99,pushBarPercent:b.push.p99/U*100,pullBarPercent:b.pull.p99/U*100}]},[b]),P=_.useMemo(()=>x?.items?x.items.map(U=>({seq:U.commitSeq,actor:U.actorId,changes:U.changeCount,tables:(U.affectedTables??[]).join(", "),time:GC(U.createdAt,i.timeFormat)})):[],[x?.items,i.timeFormat]),Q=_.useMemo(()=>Math.max(0,100-C.errorRate),[C.errorRate]),B=_.useMemo(()=>{if(!f.enabled||!g)return[];const U=[];return b?.push?.p90&&b.push.p90>f.thresholds.p90Latency&&U.push(`P90 push latency (${b.push.p90}ms) exceeds threshold (${f.thresholds.p90Latency}ms)`),g.minActiveClientCursor!==null&&g.maxCommitSeq-g.minActiveClientCursor>f.thresholds.clientLag&&U.push(`Client lag (${g.maxCommitSeq-g.minActiveClientCursor}) exceeds threshold (${f.thresholds.clientLag})`),C.errorRate>f.thresholds.errorRate&&U.push(`Error rate (${C.errorRate.toFixed(1)}%) exceeds threshold (${f.thresholds.errorRate}%)`),U},[f,g,b,C.errorRate]);return g?h.jsx(QY.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((U,Z)=>h.jsx("span",{className:"block",children:U},Z))})]})}),h.jsx(zA,{clients:O,totalNodes:O.length+2,onlineCount:N,offlineCount:R,relayClientIds:[]}),h.jsx(Kj,{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(Sj,{bars:j,activeRange:d,onRangeChange:p})}),h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(Zj,{buckets:A,successRate:Q})}),h.jsx("div",{className:"border-r border-border",children:h.jsx(Fj,{commits:P,onViewAll:()=>e({href:t})})})]}),h.jsx(Yj,{entries:z,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 cX(){return h.jsx(aX,{})}function lX({children:e}){return h.jsxs("div",{className:"space-y-4 px-5 py-5",children:[h.jsx(uX,{}),h.jsx(mX,{}),h.jsx(gX,{}),e]})}function uX(){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)}},z=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:z,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(Sp,{checked:C,onCheckedChange:O})]})})})}const fX=1440*60*1e3;function KC(e){const t=e.trim();if(!t)return null;const n=Number.parseInt(t,10);return!Number.isInteger(n)||n<=0?null:n}function $y(e){if(!e)return"Never";const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():"Invalid date"}function dX(e){return e.length===0?"all scopes":e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`}function hX(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*fX?"expiring":"active"}function pX(e){return e==="revoked"?"destructive":e==="expired"?"offline":e==="expiring"?"syncing":"healthy"}function mX(){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),[z,j]=_.useState([]),[A,P]=_.useState(null),[Q,B]=_.useState(null),[U,Z]=_.useState(null),[G,ee]=_.useState(null),[D,K]=_.useState(null),[q,V]=_.useState(null),[L,I]=_.useState(null),H=_.useMemo(()=>KC(i),[i]),W=H??14,Y=_.useMemo(()=>KC(O),[O]),ae=O.trim().length>0,se=!ae||Y!==null,fe=_.useMemo(()=>({type:e==="all"?void 0:e,status:n==="all"?void 0:n,expiresWithinDays:n==="expiring"?W:void 0}),[e,n,W]),{data:Se,isLoading:pe,error:Me}=kY(fe),_e=OY(),re=IY(),he=MY(),ie=PY(),we=DY();_.useEffect(()=>{const me=new Set((Se?.items??[]).map(Te=>Te.keyId));j(Te=>Te.filter(qe=>me.has(qe)))},[Se?.items]);const ye=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:ae?Y??void 0:void 0});M(Te.secretKey),y(""),w(""),C(""),N("")}catch{}},xe=me=>{navigator.clipboard.writeText(me),B(me),setTimeout(()=>B(null),2e3)},ve=async()=>{if(U)try{await he.mutateAsync(U)}finally{Z(null)}},Ie=async()=>{if(z.length!==0)try{const me=await re.mutateAsync({keyIds:z});P(me),j([])}catch{}},Ue=async()=>{if(G)try{const me=await we.mutateAsync(G.keyId);K({oldKeyId:G.keyId,oldKeyName:G.name,secretKey:me.secretKey})}catch{}},Ee=async()=>{if(D)try{await he.mutateAsync(D.oldKeyId)}finally{K(null),ee(null)}},Ve=async()=>{if(q)try{const me=await ie.mutateAsync(q);I(me.secretKey)}finally{V(null)}};if(pe)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 Qe=(Se?.items??[]).filter(me=>me.revokedAt===null).map(me=>me.keyId),Be=Qe.length>0&&Qe.every(me=>z.includes(me)),We=z.length>0,He=(Se?.items??[]).filter(me=>z.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(Ce,{size:"sm",variant:"destructive",onClick:()=>p(!0),disabled:z.length===0,children:["Revoke Selected (",z.length,")"]}),h.jsx(Ce,{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(ps,{children:[h.jsx(es,{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(ps,{children:[h.jsx(es,{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(ps,{children:[h.jsx(es,{htmlFor:"api-key-expiring-window",children:"Expiring window (days)"}),h.jsx(pc,{children:"Used when status filter is set to expiring."}),h.jsx(Kn,{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]})]}),Se?.items.length===0?h.jsx(Qb,{message:"No API keys match the current filters."}):h.jsxs(Zu,{children:[h.jsx(Yu,{children:h.jsxs(io,{children:[h.jsx(yt,{children:h.jsx(Uv,{checked:Be,indeterminate:!Be&&We&&Qe.length>0,onCheckedChange:me=>{j(me?Qe:[])},"aria-label":"Select all active keys"})}),h.jsx(yt,{children:"NAME"}),h.jsx(yt,{children:"TYPE"}),h.jsx(yt,{children:"KEY PREFIX"}),h.jsx(yt,{children:"ACTOR"}),h.jsx(yt,{children:"SCOPES"}),h.jsx(yt,{children:"CREATED"}),h.jsx(yt,{children:"LAST USED"}),h.jsx(yt,{children:"EXPIRES"}),h.jsx(yt,{children:"STATUS"}),h.jsx(yt,{children:"ACTIONS"})]})}),h.jsx(Xu,{children:(Se?.items??[]).map(me=>{const Te=hX(me,W);return h.jsxs(io,{children:[h.jsx(vt,{children:h.jsx(Uv,{checked:z.includes(me.keyId),onCheckedChange:qe=>{j(ht=>qe?[...new Set([...ht,me.keyId])]:ht.filter(lt=>lt!==me.keyId))},"aria-label":`Select ${me.name}`,disabled:me.revokedAt!==null})}),h.jsx(vt,{className:"font-medium",children:me.name}),h.jsx(vt,{children:h.jsx(mn,{variant:me.keyType==="admin"?"flow":me.keyType==="proxy"?"ghost":"relay",children:me.keyType})}),h.jsx(vt,{children:h.jsxs("code",{className:"font-mono text-[11px]",children:[me.keyPrefix,"..."]})}),h.jsx(vt,{className:"text-neutral-500",children:me.actorId??"-"}),h.jsx(vt,{className:"max-w-[220px] text-neutral-500",children:h.jsx("code",{className:"font-mono text-[10px]",children:dX(me.scopeKeys)})}),h.jsx(vt,{className:"text-neutral-500",children:$y(me.createdAt)}),h.jsx(vt,{className:"text-neutral-500",children:$y(me.lastUsedAt)}),h.jsx(vt,{className:"text-neutral-500",children:$y(me.expiresAt)}),h.jsx(vt,{children:h.jsx(mn,{variant:pX(Te),children:Te})}),h.jsx(vt,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(Ce,{variant:"default",size:"sm",onClick:()=>ee(me),disabled:me.revokedAt!==null,children:"Stage"}),h.jsx(Ce,{variant:"default",size:"sm",onClick:()=>V(me.keyId),disabled:me.revokedAt!==null,children:"Rotate"}),h.jsx(Ce,{variant:"destructive",size:"sm",onClick:()=>Z(me.keyId),disabled:me.revokedAt!==null,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:Q,onClose:()=>{M(null),f(!1)},onCopy:xe,secretKey:R,warning:"Copy this key now. You will not be able to view it again."}):h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs(ps,{children:[h.jsx(es,{htmlFor:"api-key-name",children:"Name"}),h.jsx(Kn,{id:"api-key-name",placeholder:"Backend Relay Key",value:g,onChange:me=>y(me.target.value)})]}),h.jsxs(ps,{children:[h.jsx(es,{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(ps,{children:[h.jsx(es,{htmlFor:"api-key-actor-id",children:"Actor ID (optional)"}),h.jsx(pc,{children:"Pin this key to a fixed actor ID"}),h.jsx(Kn,{id:"api-key-actor-id",placeholder:"actor-123",value:S,onChange:me=>w(me.target.value)})]}),h.jsxs(ps,{children:[h.jsx(es,{htmlFor:"api-key-scope-keys",children:"Scope keys (optional)"}),h.jsx(pc,{children:"Comma-separated list of allowed scope keys"}),h.jsx(Kn,{id:"api-key-scope-keys",placeholder:"scope-a, scope-b",value:T,onChange:me=>C(me.target.value)})]}),h.jsxs(ps,{children:[h.jsx(es,{htmlFor:"api-key-expires-days",children:"Expires in days (optional)"}),h.jsx(pc,{children:"Leave empty to keep the key non-expiring."}),h.jsx(Kn,{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(Ce,{variant:"default",onClick:()=>f(!1),children:"Cancel"}),h.jsx(Ce,{variant:"primary",onClick:ye,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(Ce,{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(Ce,{variant:"default",onClick:()=>p(!1),children:"Cancel"}),h.jsx(Ce,{variant:"destructive",onClick:Ie,disabled:re.isPending||z.length===0,children:re.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke Selected"})]})]})]})}),h.jsx($r,{open:G!==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(Ce,{variant:"default",size:"sm",onClick:()=>xe(D.secretKey),children:Q===D.secretKey?"Copied":"Copy"})]}),h.jsxs(Nn,{children:[h.jsx(Ce,{variant:"default",onClick:()=>{K(null),ee(null)},children:"Keep Old Key Active"}),h.jsx(Ce,{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(Ce,{variant:"default",onClick:()=>ee(null),children:"Cancel"}),h.jsx(Ce,{variant:"primary",onClick:Ue,disabled:we.isPending||!G,children:we.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Staging..."]}):"Create Replacement Key"})]})]})]})}),h.jsx($r,{open:U!==null,onOpenChange:()=>Z(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(Ce,{variant:"default",onClick:()=>Z(null),children:"Cancel"}),h.jsx(Ce,{variant:"destructive",onClick:ve,disabled:he.isPending,children:he.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke"})]})]})}),h.jsx($r,{open:q!==null||L!==null,onOpenChange:()=>{V(null),I(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Rotate API Key"})}),L?h.jsx(ZC,{copiedKeyId:Q,onClose:()=>I(null),onCopy:xe,secretKey:L,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(Ce,{variant:"default",onClick:()=>V(null),children:"Cancel"}),h.jsx(Ce,{variant:"primary",onClick:Ve,disabled:ie.isPending,children:ie.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Rotating..."]}):"Rotate"})]})]})]})})]})}function gX(){const{preferences:e,updatePreference:t,resetPreferences:n}=of(),s=[{type:"filter",label:"Auto-refresh interval",options:BY.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:FY.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(Xj,{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(Ce,{variant:"default",size:"sm",onClick:()=>n(s),children:e===s?"Copied":"Copy"})]}),h.jsx(Nn,{children:h.jsx(Ce,{variant:"primary",onClick:t,children:"Done"})})]})}function yX(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 vX(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 bX(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 xX(e,t,n){return{id:e.clientId,type:yX(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:vX(e.clientId),scopes:Object.keys(e.effectiveScopes??{}),lastSeen:bX(e.updatedAt,n)}}function SX({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}=pk({limit:f,offset:(t-1)*f,partitionId:l},{refetchIntervalMs:d}),S=RY(),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=>xX(N,T,a.timeFormat));return h.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5",children:[O.length>0&&h.jsx(Wj,{clients:O,headSeq:T}),O.length===0?e??h.jsx(H8,{children:h.jsx(Qb,{message:"No clients yet"})}):h.jsx(Vj,{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(Ce,{variant:"default",onClick:()=>i(null),children:"Cancel"}),h.jsx(Ce,{variant:"destructive",onClick:C,disabled:S.isPending,children:S.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Evicting..."]}):"Evict"})]})]})})]})}const _X={latencyThresholdMs:1e3,errorRateThreshold:5,clientLagThreshold:50,enabled:!1};function wX(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 EX(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);return Array.from(new Set(t))}function TX(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 CX(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function RX(e){const t=YC(e.requestPayload),n=YC(e.resultPayload);if(e.operationType==="notify_data_change"){const a=CX(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 NX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function jX(){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(AX,{}),h.jsx(PX,{})]}),h.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[h.jsx(kX,{partitionId:e}),h.jsx(OX,{partitionId:e}),h.jsx(MX,{partitionId:e})]}),h.jsx(IX,{partitionId:e})]})}function AX(){const{data:e,isLoading:t,error:n}=EY();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?wX(i.snapshotChunkTtlMs):"default"}));return h.jsx(Gj,{handlers:s,tableCount:e?.items.length??0})}function kX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=rf({partitionId:e}),{data:f,isLoading:d,refetch:p}=TY({enabled:!1}),g=NY(),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(_p,{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(Ce,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Ce,{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 OX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=rf({partitionId:e}),f=jY(),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(_p,{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(Ce,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Ce,{variant:"primary",onClick:p,disabled:f.isPending,children:f.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Compacting..."]}):"Compact Now"})]})]})})]})}function MX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState("tasks"),[a,l]=_.useState(e??""),[f,d]=_.useState(null),[p,g]=_.useState(null),y=AY(),b=EX(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(_p,{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(ps,{children:[h.jsx(es,{children:"Tables (comma-separated)"}),h.jsx(Kn,{value:s,onChange:T=>i(T.target.value),placeholder:"tasks, notes",disabled:y.isPending}),h.jsx(pc,{children:"Enter one or more table names affected by the external change."})]}),h.jsxs(ps,{children:[h.jsx(es,{children:"Partition ID (optional)"}),h.jsx(Kn,{value:a,onChange:T=>l(T.target.value),placeholder:"default",disabled:y.isPending})]})]}),h.jsxs(Nn,{children:[h.jsx(Ce,{variant:"default",onClick:()=>n(!1),children:f?"Close":"Cancel"}),f?null:h.jsx(Ce,{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 IX({partitionId:e}){const[t,n]=_.useState("all"),{data:s,isLoading:i,error:a}=CY({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(Ce,{variant:t==="all"?"default":"ghost",size:"sm",onClick:()=>n("all"),children:"All"}),h.jsx(Ce,{variant:t==="prune"?"default":"ghost",size:"sm",onClick:()=>n("prune"),children:"Prune"}),h.jsx(Ce,{variant:t==="compact"?"default":"ghost",size:"sm",onClick:()=>n("compact"),children:"Compact"}),h.jsx(Ce,{variant:t==="notify_data_change"?"default":"ghost",size:"sm",onClick:()=>n("notify_data_change"),children:"Notify"}),h.jsx(Ce,{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(Zu,{children:[h.jsx(Yu,{children:h.jsxs(io,{children:[h.jsx(yt,{children:"Time"}),h.jsx(yt,{children:"Type"}),h.jsx(yt,{children:"User"}),h.jsx(yt,{children:"Target"}),h.jsx(yt,{children:"Result"})]})}),h.jsx(Xu,{children:(s?.items??[]).map((l,f)=>h.jsxs(io,{children:[h.jsx(vt,{className:"whitespace-nowrap text-xs text-neutral-400",children:NX(l.createdAt)}),h.jsx(vt,{children:h.jsx(mn,{variant:"ghost",children:TX(l.operationType)})}),h.jsx(vt,{className:"font-mono text-xs",children:l.consoleUserId??"system"}),h.jsx(vt,{className:"font-mono text-xs",children:l.targetClientId??l.partitionId??(l.operationType==="notify_data_change"?"partition default":"global")}),h.jsx(vt,{className:"font-mono text-xs text-neutral-300",children:RX(l)})]},`${l.operationId}:${l.createdAt}:${f}`))})]})})})}function PX(){const[e,t]=pi("console:alert-config",_X),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($j,{enabled:e.enabled,onEnabledChange:i,thresholds:n,onThresholdsChange:s})}function DX(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 zX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function LX(){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}=zY({prefix:n,cursor:i,limit:100}),x=LY(),S=UY();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 z=[...M],j=z.pop();return a(j&&j.length>0?j:void 0),z})}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(Kn,{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(Ce,{variant:"default",size:"sm",onClick:w,children:"Filter"}),n&&h.jsx(Ce,{variant:"ghost",size:"sm",onClick:T,children:"Clear"})]}),children:R.length===0?h.jsx(Qb,{message:n?`No storage items matching prefix "${n}".`:"No storage items found."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"overflow-x-auto",children:h.jsxs(Zu,{children:[h.jsx(Yu,{children:h.jsxs(io,{children:[h.jsx(yt,{children:"Key"}),h.jsx(yt,{children:"Size"}),h.jsx(yt,{children:"Type"}),h.jsx(yt,{children:"Uploaded"}),h.jsx(yt,{children:"Actions"})]})}),h.jsx(Xu,{children:R.map(M=>h.jsxs(io,{children:[h.jsx(vt,{className:"font-mono text-xs max-w-[320px]",title:M.key,children:M.key}),h.jsx(vt,{className:"font-mono text-xs text-neutral-400 whitespace-nowrap",children:DX(M.size)}),h.jsx(vt,{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(vt,{className:"whitespace-nowrap text-xs text-neutral-400",children:zX(M.uploaded)}),h.jsx(vt,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(Ce,{variant:"ghost",size:"sm",onClick:()=>{S(M.key)},children:"Download"}),h.jsx(Ce,{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(Ce,{variant:"ghost",size:"sm",disabled:l.length===0,onClick:O,children:"Previous"}),h.jsx(Ce,{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(Ce,{variant:"default",onClick:()=>p(null),children:"Cancel"}),h.jsx(Ce,{variant:"destructive",onClick:N,disabled:x.isPending,children:x.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"})," Deleting..."]}):"Delete"})]})]})})]})}const UX={};function su(e,t){if(t==="absolute")return new Date(e).toLocaleString();const n=new Date(e),i=new Date().getTime()-n.getTime(),a=Math.floor(i/1e3);return a<60?`${a}s`:a<3600?`${Math.floor(a/60)}m`:a<86400?`${Math.floor(a/3600)}h`:`${Math.floor(a/86400)}d`}function $X(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 BX(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 Kd(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function FX(e,t){return e?`#${e.federatedCommitId??(t?`${t}:${e.commitSeq}`:String(e.commitSeq))}`:"#?"}function HX(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 yx({initialSelectedEntryId:e}={}){const{preferences:t}=of(),{partitionId:n}=sf(),{range:s,setRange:i}=mk(),a=t.pageSize,l=t.refreshInterval*1e3,f=UX?.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),z=_.useRef(!1),j=_.useMemo(()=>$X(S),[S]),A=_.useMemo(()=>new Date(Date.now()-BX(s)).toISOString(),[s]),{data:P,isLoading:Q,refetch:B}=SY({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}),U=XY(),Z=R?.startsWith("#")?R.slice(1):void 0,G=R?.startsWith("E")?R.slice(1):void 0,ee=Z&&Z!=="?"?Z:void 0,D=G&&G!=="?"?G:void 0,{data:K,isLoading:q,error:V}=xY(ee,{enabled:ee!==void 0,partitionId:n}),{data:L,isLoading:I,error:H}=_Y(D,{enabled:D!==void 0,partitionId:n}),{data:W,isLoading:Y,error:ae}=wY(D,{enabled:D!==void 0&&!!L?.payloadRef,partitionId:n}),se=_.useMemo(()=>qX(f,L?.traceId??null,L?.spanId??null),[L?.spanId,L?.traceId]);_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{e&&M(e)},[e]),_.useEffect(()=>{if(!z.current){z.current=!0;return}M(null)},[]),_.useEffect(()=>{C(1),M(null)},[]);const Se=_.useMemo(()=>(P?.items??[]).map(we=>{const ye=we.instanceId??we.commit?.instanceId??we.event?.instanceId,xe=ye?`[${ye}] `:"";if(we.type==="commit"&&we.commit){const Ie=we.commit;return{type:"commit",id:FX(Ie,ye),outcome:"--",duration:"--",actor:Ie.actorId,client:Ie.clientId,detail:`${xe}${Ie.changeCount} chg | ${(Ie.affectedTables??[]).join(", ")}`,time:su(we.timestamp,t.timeFormat)}}const ve=we.event;return ve?{type:ve.eventType,id:HX(ve,ye),outcome:ve.outcome,duration:`${ve.durationMs}ms`,actor:ve.actorId,client:ve.clientId,detail:`${xe}${(ve.tables??[]).join(", ")||"--"}`,time:su(we.timestamp,t.timeFormat)}:{type:"pull",id:"E?",outcome:"unknown",duration:"--",actor:"",client:"",detail:"--",time:su(we.timestamp,t.timeFormat)}}),[t.timeFormat,P?.items]),pe=P?.total??0,Me=Math.max(1,Math.ceil(pe/a)),_e=Q,re=[{label:"",options:[{id:"all",label:"All"},{id:"commits",label:"Commits"},{id:"events",label:"Events"}],activeId:d,onActiveChange:ie=>{p(ie),ie==="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:ie=>{i(ie),C(1)}},{label:"Type",options:[{id:"all",label:"All"},{id:"push",label:"Push"},{id:"pull",label:"Pull"}],activeId:g,onActiveChange:ie=>{y(ie),C(1)}},{label:"Outcome",options:[{id:"all",label:"All"},{id:"applied",label:"Applied"},{id:"error",label:"Error"},{id:"rejected",label:"Rejected"}],activeId:b,onActiveChange:ie=>{x(ie),C(1)}}];function he(){U.mutate(void 0,{onSuccess:()=>{N(!1),B()}})}return h.jsxs("div",{className:"flex flex-col h-full",children:[_e&&Se.length===0?h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})}):h.jsx(Qj,{entries:Se,selectedEntryId:R,onEntryClick:ie=>M(ie.id),filterBar:h.jsx(qj,{groups:re,searchValue:S,searchPlaceholder:"Use actor:, client:, table:, request:, trace: or free text...",onSearchChange:w,actions:h.jsxs(h.Fragment,{children:[h.jsx(Ce,{size:"sm",variant:"ghost",onClick:()=>{B()},children:"Refresh"}),h.jsx(Ce,{size:"sm",variant:"ghost",children:"Export"}),h.jsx(Ce,{size:"sm",variant:"destructive",onClick:()=>N(!0),children:"Clear"})]})}),pagination:h.jsx(px,{page:T,totalPages:Me,totalItems:pe,onPageChange:C})}),h.jsx($r,{open:R!==null,onOpenChange:ie=>{ie||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:su(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(ie=>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:[ie.table," | ",ie.op]}),h.jsxs("span",{className:"text-neutral-500",children:["#",ie.changeId]})]}),h.jsxs("div",{className:"font-mono text-[11px] text-neutral-400",children:["rowId: ",ie.rowId,ie.rowVersion!==null?` | version: ${ie.rowVersion}`:""]}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Kd(ie.rowJson)})]},ie.changeId))]})]}):L?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:L.eventType})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Path"}),h.jsx("div",{className:"text-neutral-100",children:L.syncPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:L.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Outcome"}),h.jsx("div",{className:"text-neutral-100",children:L.outcome})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Response Status"}),h.jsx("div",{className:"text-neutral-100",children:L.responseStatus})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Actor"}),h.jsx("div",{className:"text-neutral-100",children:L.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:L.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Status"}),h.jsx("div",{className:"text-neutral-100",children:L.statusCode})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Transport"}),h.jsx("div",{className:"text-neutral-100",children:L.transportPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Duration"}),h.jsxs("div",{className:"text-neutral-100",children:[L.durationMs,"ms"]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Request ID"}),h.jsx("div",{className:"text-neutral-100",children:L.requestId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Trace ID"}),h.jsx("div",{className:"text-neutral-100",children:L.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:L.spanId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Commit Seq"}),h.jsx("div",{className:"text-neutral-100",children:L.commitSeq??"--"}),L.commitSeq!==null&&h.jsx(Ce,{variant:"ghost",size:"sm",onClick:()=>M(`#${L.instanceId?`${L.instanceId}:`:""}${L.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:L.subscriptionCount??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Error Code"}),h.jsx("div",{className:"text-neutral-100",children:L.errorCode??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Payload Ref"}),h.jsx("div",{className:"text-neutral-100",children:L.payloadRef??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:su(L.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:L.tables.join(", ")||"--"})]}),L.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:Kd(L.scopesSummary)})]}),L.payloadRef&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Payload Snapshot"}),Y?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..."})]}):ae?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:Kd(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:Kd(W.responsePayload)})]}):h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No payload snapshot available."})]}),L.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:L.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(Ce,{variant:"default",size:"sm",onClick:()=>M(null),children:"Close"})})]})}),h.jsx($r,{open:O,onOpenChange:ie=>{ie||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(Ce,{variant:"default",size:"sm",onClick:()=>N(!1),children:"Cancel"}),h.jsx(Ce,{variant:"destructive",size:"sm",onClick:he,disabled:U.isPending,children:U.isPending?"Clearing...":"Clear all"})]})]})})]})}const VX=co({getParentRoute:()=>uo,path:"/config",component:lX}),GX=co({getParentRoute:()=>uo,path:"/fleet",component:SX}),KX=co({getParentRoute:()=>uo,path:"/",component:cX});function ZX(){const{seq:e}=gk.useParams();return h.jsx(yx,{initialSelectedEntryId:`#${e}`})}const gk=co({getParentRoute:()=>uo,path:"/investigate/commit/$seq",component:ZX});function YX(){const{id:e}=yk.useParams();return h.jsx(yx,{initialSelectedEntryId:`E${e}`})}const yk=co({getParentRoute:()=>uo,path:"/investigate/event/$id",component:YX}),XX=co({getParentRoute:()=>uo,path:"/ops",component:jX}),QX=co({getParentRoute:()=>uo,path:"/storage",component:LX}),WX=co({getParentRoute:()=>uo,path:"/stream",component:yx}),vk=uo.addChildren([KX,WX,gk,yk,GX,XX,QX,VX]),JX="syncular-console-basepath",eQ="syncular-console-server-url",tQ="syncular-console-token";function nQ(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function $v(e){const t=globalThis.document;if(!t)return;const n=t.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return nQ(n)}function bk(e){return!e||e==="/"?"/":(e.startsWith("/")?e:`/${e}`).replace(/\/+$/g,"")||"/"}function rQ(){return bk($v(JX))}function sQ(){const e=$v(eQ),t=$v(tQ);return!e||!t?null:{serverUrl:e,token:t}}XN({routeTree:vk,basepath:"/"});function oQ(){return new O6({defaultOptions:{queries:{staleTime:5e3,retry:1}}})}function iQ(e){return bk(e??rQ())}function aQ(e){const[t]=_.useState(()=>oQ()),n=_.useMemo(()=>XN({routeTree:vk,basepath:iQ(e.basePath)}),[e.basePath]),s=e.defaultConfig===void 0?sQ():e.defaultConfig;return h.jsx(M6,{client:t,children:h.jsx(WH,{defaultConfig:s,children:h.jsx(UH,{router:n})})})}function cQ(e){return h.jsx("div",{className:gx,children:h.jsx(aQ,{...e})})}function lQ(e){const t=document.querySelector(e);if(!t)throw new Error(`Unable to mount console: ${e} not found`);return t}function uQ(e,t={}){const n=lQ(e);HY(n);const s=c6.createRoot(n),i=h.jsx(cQ,{basePath:t.basePath,defaultConfig:t.defaultConfig});return t.strictMode===!1?(s.render(i),s):(s.render(h.jsx(_.StrictMode,{children:i})),s)}var fQ={};const dQ="syncular-sentry-dsn",hQ="syncular-sentry-environment",pQ="syncular-sentry-release";function hu(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function By(e){if(typeof document>"u")return;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return hu(t)}function Fy(e){if(!(typeof process>"u"))return hu(fQ[e])}function Hy(e){for(const t of e)if(t)return t}function mQ(){const e=Hy([hu(globalThis.__SYNCULAR_SENTRY_DSN__),By(dQ),Fy("SYNCULAR_SENTRY_DSN")]);if(!e)return null;const t=Hy([hu(globalThis.__SYNCULAR_SENTRY_ENVIRONMENT__),By(hQ),Fy("SYNCULAR_SENTRY_ENVIRONMENT")]),n=Hy([hu(globalThis.__SYNCULAR_SENTRY_RELEASE__),By(pQ),Fy("SYNCULAR_SENTRY_RELEASE")]);return{dsn:e,environment:t,release:n,enableLogs:!0,tracesSampleRate:.2,tracePropagationTargets:[/^https?:\/\/.*\/api\/.*/]}}const XC=mQ();XC&&JB(XC);uQ("#root");