tmex-cli 0.8.1 → 0.9.0-test-1

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,400 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsPage-CNSAuMwZ.js","assets/card-CgiYiquV.js","assets/refresh-cw-EoN3nWHT.js","assets/DevicesPage-BtUqV_Oo.js","assets/DevicePage-Byph1K3m.js"])))=>i.map(i=>d[i]);
2
- var PP=Object.defineProperty;var tC=e=>{throw TypeError(e)};var LP=(e,t,n)=>t in e?PP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var st=(e,t,n)=>LP(e,typeof t!="symbol"?t+"":t,n),Iy=(e,t,n)=>t.has(e)||tC("Cannot "+n);var ie=(e,t,n)=>(Iy(e,t,"read from private field"),n?n.call(e):t.get(e)),pt=(e,t,n)=>t.has(e)?tC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Qe=(e,t,n,r)=>(Iy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Bt=(e,t,n)=>(Iy(e,t,"access private method"),n);var ph=(e,t,n,r)=>({set _(a){Qe(e,t,a,n)},get _(){return ie(e,t,r)}});function jP(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();const _P="modulepreload",zP=function(e){return"/"+e},nC={},bx=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));a=l(n.map(d=>{if(d=zP(d),d in nC)return;nC[d]=!0;const m=d.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":_P,m||(y.as="script"),y.crossOrigin="",y.href=d,f&&y.setAttribute("nonce",f),document.head.appendChild(y),m)return new Promise((g,w)=>{y.addEventListener("load",g),y.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return a.then(l=>{for(const c of l||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};function Fp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Py={exports:{}},ku={};/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var rC;function FP(){if(rC)return ku;rC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var c in a)c!=="key"&&(o[c]=a[c])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:o}}return ku.Fragment=t,ku.jsx=n,ku.jsxs=n,ku}var iC;function BP(){return iC||(iC=1,Py.exports=FP()),Py.exports}var E=BP(),Cc=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(){}},HP={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ro,yx,Yk,UP=(Yk=class{constructor(){pt(this,Ro,HP);pt(this,yx,!1)}setTimeoutProvider(e){Qe(this,Ro,e)}setTimeout(e,t){return ie(this,Ro).setTimeout(e,t)}clearTimeout(e){ie(this,Ro).clearTimeout(e)}setInterval(e,t){return ie(this,Ro).setInterval(e,t)}clearInterval(e){ie(this,Ro).clearInterval(e)}},Ro=new WeakMap,yx=new WeakMap,Yk),Cs=new UP;function VP(e){setTimeout(e,0)}var Bs=typeof window>"u"||"Deno"in globalThis;function Tr(){}function qP(e,t){return typeof e=="function"?e(t):e}function Kb(e){return typeof e=="number"&&e>=0&&e!==1/0}function rM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zo(e,t){return typeof e=="function"?e(t):e}function yi(e,t){return typeof e=="function"?e(t):e}function aC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==vx(l,t.options))return!1}else if(!fd(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||o&&!o(t))}function oC(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Hs(t.options.mutationKey)!==Hs(o))return!1}else if(!fd(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function vx(e,t){return((t==null?void 0:t.queryKeyHashFn)||Hs)(e)}function Hs(e){return JSON.stringify(e,(t,n)=>Gb(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function fd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>fd(e[n],t[n])):!1}var $P=Object.prototype.hasOwnProperty;function iM(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=sC(e)&&sC(t);if(!r&&!(Gb(e)&&Gb(t)))return t;const o=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let d=0;for(let m=0;m<c;m++){const h=r?m:l[m],y=e[h],g=t[h];if(y===g){f[h]=y,(r?m<o:$P.call(e,h))&&d++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){f[h]=g;continue}const w=iM(y,g,n+1);f[h]=w,w===y&&d++}return o===c&&d===o?e:f}function sp(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 sC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Gb(e){if(!lC(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!lC(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function lC(e){return Object.prototype.toString.call(e)==="[object Object]"}function YP(e){return new Promise(t=>{Cs.setTimeout(t,e)})}function Xb(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?iM(e,t):t}function WP(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function KP(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xx=Symbol();function aM(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===xx?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function wx(e,t){return typeof e=="function"?e(...t):!!e}function GP(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var Ms,ko,tc,Wk,XP=(Wk=class extends Cc{constructor(){super();pt(this,Ms);pt(this,ko);pt(this,tc);Qe(this,tc,t=>{if(!Bs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ie(this,ko)||this.setEventListener(ie(this,tc))}onUnsubscribe(){var t;this.hasListeners()||((t=ie(this,ko))==null||t.call(this),Qe(this,ko,void 0))}setEventListener(t){var n;Qe(this,tc,t),(n=ie(this,ko))==null||n.call(this),Qe(this,ko,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ie(this,Ms)!==t&&(Qe(this,Ms,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ie(this,Ms)=="boolean"?ie(this,Ms):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ms=new WeakMap,ko=new WeakMap,tc=new WeakMap,Wk),Sx=new XP;function Qb(){let e,t;const n=new Promise((a,o)=>{e=a,t=o});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var QP=VP;function ZP(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=QP;const o=c=>{t?e.push(c):a(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{o(()=>{c(...f)})},schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var er=ZP(),nc,Mo,rc,Kk,JP=(Kk=class extends Cc{constructor(){super();pt(this,nc,!0);pt(this,Mo);pt(this,rc);Qe(this,rc,t=>{if(!Bs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ie(this,Mo)||this.setEventListener(ie(this,rc))}onUnsubscribe(){var t;this.hasListeners()||((t=ie(this,Mo))==null||t.call(this),Qe(this,Mo,void 0))}setEventListener(t){var n;Qe(this,rc,t),(n=ie(this,Mo))==null||n.call(this),Qe(this,Mo,t(this.setOnline.bind(this)))}setOnline(t){ie(this,nc)!==t&&(Qe(this,nc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ie(this,nc)}},nc=new WeakMap,Mo=new WeakMap,rc=new WeakMap,Kk),lp=new JP;function eL(e){return Math.min(1e3*2**e,3e4)}function oM(e){return(e??"online")==="online"?lp.isOnline():!0}var Zb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function sM(e){let t=!1,n=0,r;const a=Qb(),o=()=>a.status!=="pending",l=C=>{var T;if(!o()){const S=new Zb(C);y(S),(T=e.onCancel)==null||T.call(e,S)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>Sx.isFocused()&&(e.networkMode==="always"||lp.isOnline())&&e.canRun(),m=()=>oM(e.networkMode)&&e.canRun(),h=C=>{o()||(r==null||r(),a.resolve(C))},y=C=>{o()||(r==null||r(),a.reject(C))},g=()=>new Promise(C=>{var T;r=S=>{(o()||d())&&C(S)},(T=e.onPause)==null||T.call(e)}).then(()=>{var C;r=void 0,o()||(C=e.onContinue)==null||C.call(e)}),w=()=>{if(o())return;let C;const T=n===0?e.initialPromise:void 0;try{C=T??e.fn()}catch(S){C=Promise.reject(S)}Promise.resolve(C).then(h).catch(S=>{var O;if(o())return;const R=e.retry??(Bs?0:3),k=e.retryDelay??eL,M=typeof k=="function"?k(n,S):k,D=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,S);if(t||!D){y(S);return}n++,(O=e.onFail)==null||O.call(e,n,S),YP(M).then(()=>d()?void 0:g()).then(()=>{t?y(S):w()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?w():g().then(w),a)}}var Os,Gk,lM=(Gk=class{constructor(){pt(this,Os)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Kb(this.gcTime)&&Qe(this,Os,Cs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Bs?1/0:300*1e3))}clearGcTimeout(){ie(this,Os)&&(Cs.clearTimeout(ie(this,Os)),Qe(this,Os,void 0))}},Os=new WeakMap,Gk),As,ic,mi,Ns,ar,Md,Ds,Pi,Na,Xk,tL=(Xk=class extends lM{constructor(t){super();pt(this,Pi);pt(this,As);pt(this,ic);pt(this,mi);pt(this,Ns);pt(this,ar);pt(this,Md);pt(this,Ds);Qe(this,Ds,!1),Qe(this,Md,t.defaultOptions),this.setOptions(t.options),this.observers=[],Qe(this,Ns,t.client),Qe(this,mi,ie(this,Ns).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Qe(this,As,uC(this.options)),this.state=t.state??ie(this,As),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ie(this,ar))==null?void 0:t.promise}setOptions(t){if(this.options={...ie(this,Md),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=uC(this.options);n.data!==void 0&&(this.setState(cC(n.data,n.dataUpdatedAt)),Qe(this,As,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ie(this,mi).remove(this)}setData(t,n){const r=Xb(this.state.data,t,this.options);return Bt(this,Pi,Na).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Bt(this,Pi,Na).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=ie(this,ar))==null?void 0:r.promise;return(a=ie(this,ar))==null||a.cancel(t),n?n.then(Tr).catch(Tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ie(this,As))}isActive(){return this.observers.some(t=>yi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xx||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>zo(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!rM(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ie(this,ar))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ie(this,ar))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ie(this,mi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ie(this,ar)&&(ie(this,Ds)?ie(this,ar).cancel({revert:!0}):ie(this,ar).cancelRetry()),this.scheduleGc()),ie(this,mi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Bt(this,Pi,Na).call(this,{type:"invalidate"})}async fetch(t,n){var f,d,m,h,y,g,w,C,T,S,R,k;if(this.state.fetchStatus!=="idle"&&((f=ie(this,ar))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ie(this,ar))return ie(this,ar).continueRetry(),ie(this,ar).promise}if(t&&this.setOptions(t),!this.options.queryFn){const M=this.observers.find(D=>D.options.queryFn);M&&this.setOptions(M.options)}const r=new AbortController,a=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(Qe(this,Ds,!0),r.signal)})},o=()=>{const M=aM(this.options,n),O=(()=>{const A={client:ie(this,Ns),queryKey:this.queryKey,meta:this.meta};return a(A),A})();return Qe(this,Ds,!1),this.options.persister?this.options.persister(M,O,this):M(O)},c=(()=>{const M={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ie(this,Ns),state:this.state,fetchFn:o};return a(M),M})();(d=this.options.behavior)==null||d.onFetch(c,this),Qe(this,ic,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&Bt(this,Pi,Na).call(this,{type:"fetch",meta:(h=c.fetchOptions)==null?void 0:h.meta}),Qe(this,ar,sM({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:M=>{M instanceof Zb&&M.revert&&this.setState({...ie(this,ic),fetchStatus:"idle"}),r.abort()},onFail:(M,D)=>{Bt(this,Pi,Na).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{Bt(this,Pi,Na).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Pi,Na).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const M=await ie(this,ar).start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(g=(y=ie(this,mi).config).onSuccess)==null||g.call(y,M,this),(C=(w=ie(this,mi).config).onSettled)==null||C.call(w,M,this.state.error,this),M}catch(M){if(M instanceof Zb){if(M.silent)return ie(this,ar).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw Bt(this,Pi,Na).call(this,{type:"error",error:M}),(S=(T=ie(this,mi).config).onError)==null||S.call(T,M,this),(k=(R=ie(this,mi).config).onSettled)==null||k.call(R,this.state.data,M,this),M}finally{this.scheduleGc()}}},As=new WeakMap,ic=new WeakMap,mi=new WeakMap,Ns=new WeakMap,ar=new WeakMap,Md=new WeakMap,Ds=new WeakMap,Pi=new WeakSet,Na=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...cM(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...cC(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Qe(this,ic,t.manual?a:void 0),a;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),er.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ie(this,mi).notify({query:this,type:"updated",action:t})})},Xk);function cM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function cC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function uC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var _r,nn,Od,Cr,Is,ac,ja,Oo,Ad,oc,sc,Ps,Ls,Ao,lc,fn,qu,Jb,ev,tv,nv,rv,iv,av,uM,Qk,nL=(Qk=class extends Cc{constructor(t,n){super();pt(this,fn);pt(this,_r);pt(this,nn);pt(this,Od);pt(this,Cr);pt(this,Is);pt(this,ac);pt(this,ja);pt(this,Oo);pt(this,Ad);pt(this,oc);pt(this,sc);pt(this,Ps);pt(this,Ls);pt(this,Ao);pt(this,lc,new Set);this.options=n,Qe(this,_r,t),Qe(this,Oo,null),Qe(this,ja,Qb()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ie(this,nn).addObserver(this),dC(ie(this,nn),this.options)?Bt(this,fn,qu).call(this):this.updateResult(),Bt(this,fn,nv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ov(ie(this,nn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ov(ie(this,nn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Bt(this,fn,rv).call(this),Bt(this,fn,iv).call(this),ie(this,nn).removeObserver(this)}setOptions(t){const n=this.options,r=ie(this,nn);if(this.options=ie(this,_r).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof yi(this.options.enabled,ie(this,nn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Bt(this,fn,av).call(this),ie(this,nn).setOptions(this.options),n._defaulted&&!sp(this.options,n)&&ie(this,_r).getQueryCache().notify({type:"observerOptionsUpdated",query:ie(this,nn),observer:this});const a=this.hasListeners();a&&fC(ie(this,nn),r,this.options,n)&&Bt(this,fn,qu).call(this),this.updateResult(),a&&(ie(this,nn)!==r||yi(this.options.enabled,ie(this,nn))!==yi(n.enabled,ie(this,nn))||zo(this.options.staleTime,ie(this,nn))!==zo(n.staleTime,ie(this,nn)))&&Bt(this,fn,Jb).call(this);const o=Bt(this,fn,ev).call(this);a&&(ie(this,nn)!==r||yi(this.options.enabled,ie(this,nn))!==yi(n.enabled,ie(this,nn))||o!==ie(this,Ao))&&Bt(this,fn,tv).call(this,o)}getOptimisticResult(t){const n=ie(this,_r).getQueryCache().build(ie(this,_r),t),r=this.createResult(n,t);return iL(this,r)&&(Qe(this,Cr,r),Qe(this,ac,this.options),Qe(this,Is,ie(this,nn).state)),r}getCurrentResult(){return ie(this,Cr)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&ie(this,ja).status==="pending"&&ie(this,ja).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){ie(this,lc).add(t)}getCurrentQuery(){return ie(this,nn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ie(this,_r).defaultQueryOptions(t),r=ie(this,_r).getQueryCache().build(ie(this,_r),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Bt(this,fn,qu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ie(this,Cr)))}createResult(t,n){var H;const r=ie(this,nn),a=this.options,o=ie(this,Cr),l=ie(this,Is),c=ie(this,ac),d=t!==r?t.state:ie(this,Od),{state:m}=t;let h={...m},y=!1,g;if(n._optimisticResults){const F=this.hasListeners(),W=!F&&dC(t,n),j=F&&fC(t,r,n,a);(W||j)&&(h={...h,...cM(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:C,status:T}=h;g=h.data;let S=!1;if(n.placeholderData!==void 0&&g===void 0&&T==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(F=o.data,S=!0):F=typeof n.placeholderData=="function"?n.placeholderData((H=ie(this,sc))==null?void 0:H.state.data,ie(this,sc)):n.placeholderData,F!==void 0&&(T="success",g=Xb(o==null?void 0:o.data,F,n),y=!0)}if(n.select&&g!==void 0&&!S)if(o&&g===(l==null?void 0:l.data)&&n.select===ie(this,Ad))g=ie(this,oc);else try{Qe(this,Ad,n.select),g=n.select(g),g=Xb(o==null?void 0:o.data,g,n),Qe(this,oc,g),Qe(this,Oo,null)}catch(F){Qe(this,Oo,F)}ie(this,Oo)&&(w=ie(this,Oo),g=ie(this,oc),C=Date.now(),T="error");const R=h.fetchStatus==="fetching",k=T==="pending",M=T==="error",D=k&&R,O=g!==void 0,L={status:T,fetchStatus:h.fetchStatus,isPending:k,isSuccess:T==="success",isError:M,isInitialLoading:D,isLoading:D,data:g,dataUpdatedAt:h.dataUpdatedAt,error:w,errorUpdatedAt:C,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:R,isRefetching:R&&!k,isLoadingError:M&&!O,isPaused:h.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:M&&O,isStale:Ex(t,n),refetch:this.refetch,promise:ie(this,ja),isEnabled:yi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=L.data!==void 0,W=L.status==="error"&&!F,j=B=>{W?B.reject(L.error):F&&B.resolve(L.data)},q=()=>{const B=Qe(this,ja,L.promise=Qb());j(B)},$=ie(this,ja);switch($.status){case"pending":t.queryHash===r.queryHash&&j($);break;case"fulfilled":(W||L.data!==$.value)&&q();break;case"rejected":(!W||L.error!==$.reason)&&q();break}}return L}updateResult(){const t=ie(this,Cr),n=this.createResult(ie(this,nn),this.options);if(Qe(this,Is,ie(this,nn).state),Qe(this,ac,this.options),ie(this,Is).data!==void 0&&Qe(this,sc,ie(this,nn)),sp(n,t))return;Qe(this,Cr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!ie(this,lc).size)return!0;const l=new Set(o??ie(this,lc));return this.options.throwOnError&&l.add("error"),Object.keys(ie(this,Cr)).some(c=>{const f=c;return ie(this,Cr)[f]!==t[f]&&l.has(f)})};Bt(this,fn,uM).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Bt(this,fn,nv).call(this)}},_r=new WeakMap,nn=new WeakMap,Od=new WeakMap,Cr=new WeakMap,Is=new WeakMap,ac=new WeakMap,ja=new WeakMap,Oo=new WeakMap,Ad=new WeakMap,oc=new WeakMap,sc=new WeakMap,Ps=new WeakMap,Ls=new WeakMap,Ao=new WeakMap,lc=new WeakMap,fn=new WeakSet,qu=function(t){Bt(this,fn,av).call(this);let n=ie(this,nn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Tr)),n},Jb=function(){Bt(this,fn,rv).call(this);const t=zo(this.options.staleTime,ie(this,nn));if(Bs||ie(this,Cr).isStale||!Kb(t))return;const r=rM(ie(this,Cr).dataUpdatedAt,t)+1;Qe(this,Ps,Cs.setTimeout(()=>{ie(this,Cr).isStale||this.updateResult()},r))},ev=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ie(this,nn)):this.options.refetchInterval)??!1},tv=function(t){Bt(this,fn,iv).call(this),Qe(this,Ao,t),!(Bs||yi(this.options.enabled,ie(this,nn))===!1||!Kb(ie(this,Ao))||ie(this,Ao)===0)&&Qe(this,Ls,Cs.setInterval(()=>{(this.options.refetchIntervalInBackground||Sx.isFocused())&&Bt(this,fn,qu).call(this)},ie(this,Ao)))},nv=function(){Bt(this,fn,Jb).call(this),Bt(this,fn,tv).call(this,Bt(this,fn,ev).call(this))},rv=function(){ie(this,Ps)&&(Cs.clearTimeout(ie(this,Ps)),Qe(this,Ps,void 0))},iv=function(){ie(this,Ls)&&(Cs.clearInterval(ie(this,Ls)),Qe(this,Ls,void 0))},av=function(){const t=ie(this,_r).getQueryCache().build(ie(this,_r),this.options);if(t===ie(this,nn))return;const n=ie(this,nn);Qe(this,nn,t),Qe(this,Od,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},uM=function(t){er.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ie(this,Cr))}),ie(this,_r).getQueryCache().notify({query:ie(this,nn),type:"observerResultsUpdated"})})},Qk);function rL(e,t){return yi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function dC(e,t){return rL(e,t)||e.state.data!==void 0&&ov(e,t,t.refetchOnMount)}function ov(e,t,n){if(yi(t.enabled,e)!==!1&&zo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ex(e,t)}return!1}function fC(e,t,n,r){return(e!==t||yi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ex(e,n)}function Ex(e,t){return yi(t.enabled,e)!==!1&&e.isStaleByTime(zo(t.staleTime,e))}function iL(e,t){return!sp(e.getCurrentResult(),t)}function hC(e){return{onFetch:(t,n)=>{var m,h,y,g,w;const r=t.options,a=(y=(h=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:h.fetchMore)==null?void 0:y.direction,o=((g=t.state.data)==null?void 0:g.pages)||[],l=((w=t.state.data)==null?void 0:w.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let C=!1;const T=k=>{GP(k,()=>t.signal,()=>C=!0)},S=aM(t.options,t.fetchOptions),R=async(k,M,D)=>{if(C)return Promise.reject();if(M==null&&k.pages.length)return Promise.resolve(k);const A=(()=>{const W={client:t.client,queryKey:t.queryKey,pageParam:M,direction:D?"backward":"forward",meta:t.options.meta};return T(W),W})(),L=await S(A),{maxPages:H}=t.options,F=D?KP:WP;return{pages:F(k.pages,L,H),pageParams:F(k.pageParams,M,H)}};if(a&&o.length){const k=a==="backward",M=k?aL:pC,D={pages:o,pageParams:l},O=M(r,D);c=await R(D,O,k)}else{const k=e??o.length;do{const M=f===0?l[0]??r.initialPageParam:pC(r,c);if(f>0&&M==null)break;c=await R(c,M),f++}while(f<k)}return c};t.options.persister?t.fetchFn=()=>{var C,T;return(T=(C=t.options).persister)==null?void 0:T.call(C,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function pC(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function aL(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Nd,Ki,gr,js,Gi,wo,Zk,oL=(Zk=class extends lM{constructor(t){super();pt(this,Gi);pt(this,Nd);pt(this,Ki);pt(this,gr);pt(this,js);Qe(this,Nd,t.client),this.mutationId=t.mutationId,Qe(this,gr,t.mutationCache),Qe(this,Ki,[]),this.state=t.state||dM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ie(this,Ki).includes(t)||(ie(this,Ki).push(t),this.clearGcTimeout(),ie(this,gr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Qe(this,Ki,ie(this,Ki).filter(n=>n!==t)),this.scheduleGc(),ie(this,gr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ie(this,Ki).length||(this.state.status==="pending"?this.scheduleGc():ie(this,gr).remove(this))}continue(){var t;return((t=ie(this,js))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,f,d,m,h,y,g,w,C,T,S,R,k,M,D,O,A;const n=()=>{Bt(this,Gi,wo).call(this,{type:"continue"})},r={client:ie(this,Nd),meta:this.options.meta,mutationKey:this.options.mutationKey};Qe(this,js,sM({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,H)=>{Bt(this,Gi,wo).call(this,{type:"failed",failureCount:L,error:H})},onPause:()=>{Bt(this,Gi,wo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ie(this,gr).canRun(this)}));const a=this.state.status==="pending",o=!ie(this,js).canStart();try{if(a)n();else{Bt(this,Gi,wo).call(this,{type:"pending",variables:t,isPaused:o}),ie(this,gr).config.onMutate&&await ie(this,gr).config.onMutate(t,this,r);const H=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));H!==this.state.context&&Bt(this,Gi,wo).call(this,{type:"pending",context:H,variables:t,isPaused:o})}const L=await ie(this,js).start();return await((d=(f=ie(this,gr).config).onSuccess)==null?void 0:d.call(f,L,t,this.state.context,this,r)),await((h=(m=this.options).onSuccess)==null?void 0:h.call(m,L,t,this.state.context,r)),await((g=(y=ie(this,gr).config).onSettled)==null?void 0:g.call(y,L,null,this.state.variables,this.state.context,this,r)),await((C=(w=this.options).onSettled)==null?void 0:C.call(w,L,null,t,this.state.context,r)),Bt(this,Gi,wo).call(this,{type:"success",data:L}),L}catch(L){try{await((S=(T=ie(this,gr).config).onError)==null?void 0:S.call(T,L,t,this.state.context,this,r))}catch(H){Promise.reject(H)}try{await((k=(R=this.options).onError)==null?void 0:k.call(R,L,t,this.state.context,r))}catch(H){Promise.reject(H)}try{await((D=(M=ie(this,gr).config).onSettled)==null?void 0:D.call(M,void 0,L,this.state.variables,this.state.context,this,r))}catch(H){Promise.reject(H)}try{await((A=(O=this.options).onSettled)==null?void 0:A.call(O,void 0,L,t,this.state.context,r))}catch(H){Promise.reject(H)}throw Bt(this,Gi,wo).call(this,{type:"error",error:L}),L}finally{ie(this,gr).runNext(this)}}},Nd=new WeakMap,Ki=new WeakMap,gr=new WeakMap,js=new WeakMap,Gi=new WeakSet,wo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),er.batch(()=>{ie(this,Ki).forEach(r=>{r.onMutationUpdate(t)}),ie(this,gr).notify({mutation:this,type:"updated",action:t})})},Zk);function dM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _a,Li,Dd,Jk,sL=(Jk=class extends Cc{constructor(t={}){super();pt(this,_a);pt(this,Li);pt(this,Dd);this.config=t,Qe(this,_a,new Set),Qe(this,Li,new Map),Qe(this,Dd,0)}build(t,n,r){const a=new oL({client:t,mutationCache:this,mutationId:++ph(this,Dd)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){ie(this,_a).add(t);const n=mh(t);if(typeof n=="string"){const r=ie(this,Li).get(n);r?r.push(t):ie(this,Li).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ie(this,_a).delete(t)){const n=mh(t);if(typeof n=="string"){const r=ie(this,Li).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&ie(this,Li).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=mh(t);if(typeof n=="string"){const r=ie(this,Li).get(n),a=r==null?void 0:r.find(o=>o.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=mh(t);if(typeof n=="string"){const a=(r=ie(this,Li).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){er.batch(()=>{ie(this,_a).forEach(t=>{this.notify({type:"removed",mutation:t})}),ie(this,_a).clear(),ie(this,Li).clear()})}getAll(){return Array.from(ie(this,_a))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>oC(n,r))}findAll(t={}){return this.getAll().filter(n=>oC(t,n))}notify(t){er.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return er.batch(()=>Promise.all(t.map(n=>n.continue().catch(Tr))))}},_a=new WeakMap,Li=new WeakMap,Dd=new WeakMap,Jk);function mh(e){var t;return(t=e.options.scope)==null?void 0:t.id}var za,No,zr,Fa,Ha,qh,sv,eM,lL=(eM=class extends Cc{constructor(n,r){super();pt(this,Ha);pt(this,za);pt(this,No);pt(this,zr);pt(this,Fa);Qe(this,za,n),this.setOptions(r),this.bindMethods(),Bt(this,Ha,qh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=ie(this,za).defaultMutationOptions(n),sp(this.options,r)||ie(this,za).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ie(this,zr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Hs(r.mutationKey)!==Hs(this.options.mutationKey)?this.reset():((a=ie(this,zr))==null?void 0:a.state.status)==="pending"&&ie(this,zr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=ie(this,zr))==null||n.removeObserver(this)}onMutationUpdate(n){Bt(this,Ha,qh).call(this),Bt(this,Ha,sv).call(this,n)}getCurrentResult(){return ie(this,No)}reset(){var n;(n=ie(this,zr))==null||n.removeObserver(this),Qe(this,zr,void 0),Bt(this,Ha,qh).call(this),Bt(this,Ha,sv).call(this)}mutate(n,r){var a;return Qe(this,Fa,r),(a=ie(this,zr))==null||a.removeObserver(this),Qe(this,zr,ie(this,za).getMutationCache().build(ie(this,za),this.options)),ie(this,zr).addObserver(this),ie(this,zr).execute(n)}},za=new WeakMap,No=new WeakMap,zr=new WeakMap,Fa=new WeakMap,Ha=new WeakSet,qh=function(){var r;const n=((r=ie(this,zr))==null?void 0:r.state)??dM();Qe(this,No,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},sv=function(n){er.batch(()=>{var r,a,o,l,c,f,d,m;if(ie(this,Fa)&&this.hasListeners()){const h=ie(this,No).variables,y=ie(this,No).context,g={client:ie(this,za),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=ie(this,Fa)).onSuccess)==null||a.call(r,n.data,h,y,g)}catch(w){Promise.reject(w)}try{(l=(o=ie(this,Fa)).onSettled)==null||l.call(o,n.data,null,h,y,g)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=ie(this,Fa)).onError)==null||f.call(c,n.error,h,y,g)}catch(w){Promise.reject(w)}try{(m=(d=ie(this,Fa)).onSettled)==null||m.call(d,void 0,n.error,h,y,g)}catch(w){Promise.reject(w)}}}this.listeners.forEach(h=>{h(ie(this,No))})})},eM),Xi,tM,cL=(tM=class extends Cc{constructor(t={}){super();pt(this,Xi);this.config=t,Qe(this,Xi,new Map)}build(t,n,r){const a=n.queryKey,o=n.queryHash??vx(a,n);let l=this.get(o);return l||(l=new tL({client:t,queryKey:a,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){ie(this,Xi).has(t.queryHash)||(ie(this,Xi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ie(this,Xi).get(t.queryHash);n&&(t.destroy(),n===t&&ie(this,Xi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){er.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ie(this,Xi).get(t)}getAll(){return[...ie(this,Xi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>aC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>aC(t,r)):n}notify(t){er.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){er.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){er.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xi=new WeakMap,tM),_n,Do,Io,cc,uc,Po,dc,fc,nM,uL=(nM=class{constructor(e={}){pt(this,_n);pt(this,Do);pt(this,Io);pt(this,cc);pt(this,uc);pt(this,Po);pt(this,dc);pt(this,fc);Qe(this,_n,e.queryCache||new cL),Qe(this,Do,e.mutationCache||new sL),Qe(this,Io,e.defaultOptions||{}),Qe(this,cc,new Map),Qe(this,uc,new Map),Qe(this,Po,0)}mount(){ph(this,Po)._++,ie(this,Po)===1&&(Qe(this,dc,Sx.subscribe(async e=>{e&&(await this.resumePausedMutations(),ie(this,_n).onFocus())})),Qe(this,fc,lp.subscribe(async e=>{e&&(await this.resumePausedMutations(),ie(this,_n).onOnline())})))}unmount(){var e,t;ph(this,Po)._--,ie(this,Po)===0&&((e=ie(this,dc))==null||e.call(this),Qe(this,dc,void 0),(t=ie(this,fc))==null||t.call(this),Qe(this,fc,void 0))}isFetching(e){return ie(this,_n).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ie(this,Do).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ie(this,_n).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ie(this,_n).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(zo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return ie(this,_n).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=ie(this,_n).get(r.queryHash),o=a==null?void 0:a.state.data,l=qP(t,o);if(l!==void 0)return ie(this,_n).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return er.batch(()=>ie(this,_n).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ie(this,_n).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ie(this,_n);er.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ie(this,_n);return er.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=er.batch(()=>ie(this,_n).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Tr).catch(Tr)}invalidateQueries(e,t={}){return er.batch(()=>(ie(this,_n).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=er.batch(()=>ie(this,_n).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,n);return n.throwOnError||(o=o.catch(Tr)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Tr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ie(this,_n).build(this,t);return n.isStaleByTime(zo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tr).catch(Tr)}fetchInfiniteQuery(e){return e.behavior=hC(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tr).catch(Tr)}ensureInfiniteQueryData(e){return e.behavior=hC(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return lp.isOnline()?ie(this,Do).resumePausedMutations():Promise.resolve()}getQueryCache(){return ie(this,_n)}getMutationCache(){return ie(this,Do)}getDefaultOptions(){return ie(this,Io)}setDefaultOptions(e){Qe(this,Io,e)}setQueryDefaults(e,t){ie(this,cc).set(Hs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ie(this,cc).values()],n={};return t.forEach(r=>{fd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){ie(this,uc).set(Hs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ie(this,uc).values()],n={};return t.forEach(r=>{fd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ie(this,Io).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vx(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===xx&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ie(this,Io).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ie(this,_n).clear(),ie(this,Do).clear()}},_n=new WeakMap,Do=new WeakMap,Io=new WeakMap,cc=new WeakMap,uc=new WeakMap,Po=new WeakMap,dc=new WeakMap,fc=new WeakMap,nM),Ly={exports:{}},It={};/**
11
- * @license React
12
- * react.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var mC;function dL(){if(mC)return It;mC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),y=Symbol.iterator;function g(V){return V===null||typeof V!="object"?null:(V=y&&V[y]||V["@@iterator"],typeof V=="function"?V:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,T={};function S(V,G,I){this.props=V,this.context=G,this.refs=T,this.updater=I||w}S.prototype.isReactComponent={},S.prototype.setState=function(V,G){if(typeof V!="object"&&typeof V!="function"&&V!=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,V,G,"setState")},S.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function R(){}R.prototype=S.prototype;function k(V,G,I){this.props=V,this.context=G,this.refs=T,this.updater=I||w}var M=k.prototype=new R;M.constructor=k,C(M,S.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function O(){}var A={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function H(V,G,I){var Q=I.ref;return{$$typeof:e,type:V,key:G,ref:Q!==void 0?Q:null,props:I}}function F(V,G){return H(V.type,G,V.props)}function W(V){return typeof V=="object"&&V!==null&&V.$$typeof===e}function j(V){var G={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(I){return G[I]})}var q=/\/+/g;function $(V,G){return typeof V=="object"&&V!==null&&V.key!=null?j(""+V.key):G.toString(36)}function B(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(O,O):(V.status="pending",V.then(function(G){V.status==="pending"&&(V.status="fulfilled",V.value=G)},function(G){V.status==="pending"&&(V.status="rejected",V.reason=G)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function _(V,G,I,Q,Z){var te=typeof V;(te==="undefined"||te==="boolean")&&(V=null);var le=!1;if(V===null)le=!0;else switch(te){case"bigint":case"string":case"number":le=!0;break;case"object":switch(V.$$typeof){case e:case t:le=!0;break;case m:return le=V._init,_(le(V._payload),G,I,Q,Z)}}if(le)return Z=Z(V),le=Q===""?"."+$(V,0):Q,D(Z)?(I="",le!=null&&(I=le.replace(q,"$&/")+"/"),_(Z,G,I,"",function(Me){return Me})):Z!=null&&(W(Z)&&(Z=F(Z,I+(Z.key==null||V&&V.key===Z.key?"":(""+Z.key).replace(q,"$&/")+"/")+le)),G.push(Z)),1;le=0;var pe=Q===""?".":Q+":";if(D(V))for(var we=0;we<V.length;we++)Q=V[we],te=pe+$(Q,we),le+=_(Q,G,I,te,Z);else if(we=g(V),typeof we=="function")for(V=we.call(V),we=0;!(Q=V.next()).done;)Q=Q.value,te=pe+$(Q,we++),le+=_(Q,G,I,te,Z);else if(te==="object"){if(typeof V.then=="function")return _(B(V),G,I,Q,Z);throw G=String(V),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return le}function z(V,G,I){if(V==null)return V;var Q=[],Z=0;return _(V,Q,"","",function(te){return G.call(I,te,Z++)}),Q}function U(V){if(V._status===-1){var G=V._result;G=G(),G.then(function(I){(V._status===0||V._status===-1)&&(V._status=1,V._result=I)},function(I){(V._status===0||V._status===-1)&&(V._status=2,V._result=I)}),V._status===-1&&(V._status=0,V._result=G)}if(V._status===1)return V._result.default;throw V._result}var K=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",V);return}console.error(V)},P={map:z,forEach:function(V,G,I){z(V,function(){G.apply(this,arguments)},I)},count:function(V){var G=0;return z(V,function(){G++}),G},toArray:function(V){return z(V,function(G){return G})||[]},only:function(V){if(!W(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return It.Activity=h,It.Children=P,It.Component=S,It.Fragment=n,It.Profiler=a,It.PureComponent=k,It.StrictMode=r,It.Suspense=f,It.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,It.__COMPILER_RUNTIME={__proto__:null,c:function(V){return A.H.useMemoCache(V)}},It.cache=function(V){return function(){return V.apply(null,arguments)}},It.cacheSignal=function(){return null},It.cloneElement=function(V,G,I){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var Q=C({},V.props),Z=V.key;if(G!=null)for(te in G.key!==void 0&&(Z=""+G.key),G)!L.call(G,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&G.ref===void 0||(Q[te]=G[te]);var te=arguments.length-2;if(te===1)Q.children=I;else if(1<te){for(var le=Array(te),pe=0;pe<te;pe++)le[pe]=arguments[pe+2];Q.children=le}return H(V.type,Z,Q)},It.createContext=function(V){return V={$$typeof:l,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:o,_context:V},V},It.createElement=function(V,G,I){var Q,Z={},te=null;if(G!=null)for(Q in G.key!==void 0&&(te=""+G.key),G)L.call(G,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(Z[Q]=G[Q]);var le=arguments.length-2;if(le===1)Z.children=I;else if(1<le){for(var pe=Array(le),we=0;we<le;we++)pe[we]=arguments[we+2];Z.children=pe}if(V&&V.defaultProps)for(Q in le=V.defaultProps,le)Z[Q]===void 0&&(Z[Q]=le[Q]);return H(V,te,Z)},It.createRef=function(){return{current:null}},It.forwardRef=function(V){return{$$typeof:c,render:V}},It.isValidElement=W,It.lazy=function(V){return{$$typeof:m,_payload:{_status:-1,_result:V},_init:U}},It.memo=function(V,G){return{$$typeof:d,type:V,compare:G===void 0?null:G}},It.startTransition=function(V){var G=A.T,I={};A.T=I;try{var Q=V(),Z=A.S;Z!==null&&Z(I,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(O,K)}catch(te){K(te)}finally{G!==null&&I.types!==null&&(G.types=I.types),A.T=G}},It.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},It.use=function(V){return A.H.use(V)},It.useActionState=function(V,G,I){return A.H.useActionState(V,G,I)},It.useCallback=function(V,G){return A.H.useCallback(V,G)},It.useContext=function(V){return A.H.useContext(V)},It.useDebugValue=function(){},It.useDeferredValue=function(V,G){return A.H.useDeferredValue(V,G)},It.useEffect=function(V,G){return A.H.useEffect(V,G)},It.useEffectEvent=function(V){return A.H.useEffectEvent(V)},It.useId=function(){return A.H.useId()},It.useImperativeHandle=function(V,G,I){return A.H.useImperativeHandle(V,G,I)},It.useInsertionEffect=function(V,G){return A.H.useInsertionEffect(V,G)},It.useLayoutEffect=function(V,G){return A.H.useLayoutEffect(V,G)},It.useMemo=function(V,G){return A.H.useMemo(V,G)},It.useOptimistic=function(V,G){return A.H.useOptimistic(V,G)},It.useReducer=function(V,G,I){return A.H.useReducer(V,G,I)},It.useRef=function(V){return A.H.useRef(V)},It.useState=function(V){return A.H.useState(V)},It.useSyncExternalStore=function(V,G,I){return A.H.useSyncExternalStore(V,G,I)},It.useTransition=function(){return A.H.useTransition()},It.version="19.2.4",It}var gC;function Id(){return gC||(gC=1,Ly.exports=dL()),Ly.exports}var v=Id();const Fe=Fp(v),Cx=jP({__proto__:null,default:Fe},[v]);var fM=v.createContext(void 0),Pd=e=>{const t=v.useContext(fM);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},fL=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),E.jsx(fM.Provider,{value:e,children:t})),hM=v.createContext(!1),hL=()=>v.useContext(hM);hM.Provider;function pL(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var mL=v.createContext(pL()),gL=()=>v.useContext(mL),yL=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?wx(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},bL=e=>{v.useEffect(()=>{e.clearReset()},[e])},vL=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||wx(n,[e.error,r])),xL=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},wL=(e,t)=>e.isLoading&&e.isFetching&&!t,SL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,yC=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function EL(e,t,n){var y,g,w,C;const r=hL(),a=gL(),o=Pd(),l=o.defaultQueryOptions(e);(g=(y=o.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||g.call(y,l);const c=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",xL(l),yL(l,a,c),bL(a);const f=!o.getQueryCache().get(l.queryHash),[d]=v.useState(()=>new t(o,l)),m=d.getOptimisticResult(l),h=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(T=>{const S=h?d.subscribe(er.batchCalls(T)):Tr;return d.updateResult(),S},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),v.useEffect(()=>{d.setOptions(l)},[l,d]),SL(l,m))throw yC(l,d,a);if(vL({result:m,errorResetBoundary:a,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;if((C=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||C.call(w,l,m),l.experimental_prefetchInRender&&!Bs&&wL(m,r)){const T=f?yC(l,d,a):c==null?void 0:c.promise;T==null||T.catch(Tr).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?m:d.trackResult(m)}function Vo(e,t){return EL(e,nL)}function hd(e,t){const n=Pd(),[r]=v.useState(()=>new lL(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const a=v.useSyncExternalStore(v.useCallback(l=>r.subscribe(er.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((l,c)=>{r.mutate(l,c).catch(Tr)},[r]);if(a.error&&wx(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}var jy={exports:{}},Mu={},_y={exports:{}},zy={};/**
19
- * @license React
20
- * scheduler.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var bC;function CL(){return bC||(bC=1,(function(e){function t(_,z){var U=_.length;_.push(z);e:for(;0<U;){var K=U-1>>>1,P=_[K];if(0<a(P,z))_[K]=z,_[U]=P,U=K;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var z=_[0],U=_.pop();if(U!==z){_[0]=U;e:for(var K=0,P=_.length,V=P>>>1;K<V;){var G=2*(K+1)-1,I=_[G],Q=G+1,Z=_[Q];if(0>a(I,U))Q<P&&0>a(Z,I)?(_[K]=Z,_[Q]=U,K=Q):(_[K]=I,_[G]=U,K=G);else if(Q<P&&0>a(Z,U))_[K]=Z,_[Q]=U,K=Q;else break e}}return z}function a(_,z){var U=_.sortIndex-z.sortIndex;return U!==0?U:_.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],m=1,h=null,y=3,g=!1,w=!1,C=!1,T=!1,S=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function M(_){for(var z=n(d);z!==null;){if(z.callback===null)r(d);else if(z.startTime<=_)r(d),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(d)}}function D(_){if(C=!1,M(_),!w)if(n(f)!==null)w=!0,O||(O=!0,j());else{var z=n(d);z!==null&&B(D,z.startTime-_)}}var O=!1,A=-1,L=5,H=-1;function F(){return T?!0:!(e.unstable_now()-H<L)}function W(){if(T=!1,O){var _=e.unstable_now();H=_;var z=!0;try{e:{w=!1,C&&(C=!1,R(A),A=-1),g=!0;var U=y;try{t:{for(M(_),h=n(f);h!==null&&!(h.expirationTime>_&&F());){var K=h.callback;if(typeof K=="function"){h.callback=null,y=h.priorityLevel;var P=K(h.expirationTime<=_);if(_=e.unstable_now(),typeof P=="function"){h.callback=P,M(_),z=!0;break t}h===n(f)&&r(f),M(_)}else r(f);h=n(f)}if(h!==null)z=!0;else{var V=n(d);V!==null&&B(D,V.startTime-_),z=!1}}break e}finally{h=null,y=U,g=!1}z=void 0}}finally{z?j():O=!1}}}var j;if(typeof k=="function")j=function(){k(W)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,$=q.port2;q.port1.onmessage=W,j=function(){$.postMessage(null)}}else j=function(){S(W,0)};function B(_,z){A=S(function(){_(e.unstable_now())},z)}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(_){_.callback=null},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(_){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var U=y;y=z;try{return _()}finally{y=U}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(_,z){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var U=y;y=_;try{return z()}finally{y=U}},e.unstable_scheduleCallback=function(_,z,U){var K=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?K+U:K):U=K,_){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=U+P,_={id:m++,callback:z,priorityLevel:_,startTime:U,expirationTime:P,sortIndex:-1},U>K?(_.sortIndex=U,t(d,_),n(f)===null&&_===n(d)&&(C?(R(A),A=-1):C=!0,B(D,U-K))):(_.sortIndex=P,t(f,_),w||g||(w=!0,O||(O=!0,j()))),_},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(_){var z=y;return function(){var U=y;y=z;try{return _.apply(this,arguments)}finally{y=U}}}})(zy)),zy}var vC;function TL(){return vC||(vC=1,_y.exports=CL()),_y.exports}var Fy={exports:{}},mr={};/**
27
- * @license React
28
- * react-dom.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var xC;function RL(){if(xC)return mr;xC=1;var e=Id();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={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},a=Symbol.for("react.portal");function o(f,d,m){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:h==null?null:""+h,children:f,containerInfo:d,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return mr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,mr.createPortal=function(f,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return o(f,d,null,m)},mr.flushSync=function(f){var d=l.T,m=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=d,r.p=m,r.d.f()}},mr.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},mr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},mr.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var m=d.as,h=c(m,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,g=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:y,fetchPriority:g}):m==="script"&&r.d.X(f,{crossOrigin:h,integrity:y,fetchPriority:g,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},mr.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=c(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},mr.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,h=c(m,d.crossOrigin);r.d.L(f,m,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},mr.preloadModule=function(f,d){if(typeof f=="string")if(d){var m=c(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},mr.requestFormReset=function(f){r.d.r(f)},mr.unstable_batchedUpdates=function(f,d){return f(d)},mr.useFormState=function(f,d,m){return l.H.useFormState(f,d,m)},mr.useFormStatus=function(){return l.H.useHostTransitionStatus()},mr.version="19.2.4",mr}var wC;function pM(){if(wC)return Fy.exports;wC=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(),Fy.exports=RL(),Fy.exports}/**
35
- * @license React
36
- * react-dom-client.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var SC;function kL(){if(SC)return Mu;SC=1;var e=TL(),t=Id(),n=pM();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function l(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function c(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(o(i)!==i)throw Error(r(188))}function d(i){var s=i.alternate;if(!s){if(s=o(i),s===null)throw Error(r(188));return s!==i?null:i}for(var u=i,p=s;;){var b=u.return;if(b===null)break;var x=b.alternate;if(x===null){if(p=b.return,p!==null){u=p;continue}break}if(b.child===x.child){for(x=b.child;x;){if(x===u)return f(b),i;if(x===p)return f(b),s;x=x.sibling}throw Error(r(188))}if(u.return!==p.return)u=b,p=x;else{for(var N=!1,Y=b.child;Y;){if(Y===u){N=!0,u=b,p=x;break}if(Y===p){N=!0,p=b,u=x;break}Y=Y.sibling}if(!N){for(Y=x.child;Y;){if(Y===u){N=!0,u=x,p=b;break}if(Y===p){N=!0,p=x,u=b;break}Y=Y.sibling}if(!N)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:s}function m(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=m(i),s!==null)return s;i=i.sibling}return null}var h=Object.assign,y=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),k=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function j(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var q=Symbol.for("react.client.reference");function $(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===q?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case S:return"Profiler";case T:return"StrictMode";case D:return"Suspense";case O:return"SuspenseList";case H:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case k:return i.displayName||"Context";case R:return(i._context.displayName||"Context")+".Consumer";case M:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case A:return s=i.displayName||null,s!==null?s:$(i.type)||"Memo";case L:s=i._payload,i=i._init;try{return $(i(s))}catch{}}return null}var B=Array.isArray,_=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},K=[],P=-1;function V(i){return{current:i}}function G(i){0>P||(i.current=K[P],K[P]=null,P--)}function I(i,s){P++,K[P]=i.current,i.current=s}var Q=V(null),Z=V(null),te=V(null),le=V(null);function pe(i,s){switch(I(te,s),I(Z,i),I(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?CE(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=CE(s),i=TE(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}G(Q),I(Q,i)}function we(){G(Q),G(Z),G(te)}function Me(i){i.memoizedState!==null&&I(le,i);var s=Q.current,u=TE(s,i.type);s!==u&&(I(Z,i),I(Q,u))}function Pe(i){Z.current===i&&(G(Q),G(Z)),le.current===i&&(G(le),Eu._currentValue=U)}var ne,fe;function ye(i){if(ne===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);ne=s&&s[1]||"",fe=-1<u.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+ne+i+fe}var Le=!1;function Oe(i,s){if(!i||Le)return"";Le=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(s){var Ie=function(){throw Error()};if(Object.defineProperty(Ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ie,[])}catch(xe){var be=xe}Reflect.construct(i,[],Ie)}else{try{Ie.call()}catch(xe){be=xe}i.call(Ie.prototype)}}else{try{throw Error()}catch(xe){be=xe}(Ie=i())&&typeof Ie.catch=="function"&&Ie.catch(function(){})}}catch(xe){if(xe&&be&&typeof xe.stack=="string")return[xe.stack,be.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=p.DetermineComponentFrameRoot(),N=x[0],Y=x[1];if(N&&Y){var re=N.split(`
45
- `),ge=Y.split(`
46
- `);for(b=p=0;p<re.length&&!re[p].includes("DetermineComponentFrameRoot");)p++;for(;b<ge.length&&!ge[b].includes("DetermineComponentFrameRoot");)b++;if(p===re.length||b===ge.length)for(p=re.length-1,b=ge.length-1;1<=p&&0<=b&&re[p]!==ge[b];)b--;for(;1<=p&&0<=b;p--,b--)if(re[p]!==ge[b]){if(p!==1||b!==1)do if(p--,b--,0>b||re[p]!==ge[b]){var ke=`
47
- `+re[p].replace(" at new "," at ");return i.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",i.displayName)),ke}while(1<=p&&0<=b);break}}}finally{Le=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?ye(u):""}function Ee(i,s){switch(i.tag){case 26:case 27:case 5:return ye(i.type);case 16:return ye("Lazy");case 13:return i.child!==s&&s!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Oe(i.type,!1);case 11:return Oe(i.type.render,!1);case 1:return Oe(i.type,!0);case 31:return ye("Activity");default:return""}}function Te(i){try{var s="",u=null;do s+=Ee(i,u),u=i,i=i.return;while(i);return s}catch(p){return`
48
- Error generating stack: `+p.message+`
49
- `+p.stack}}var J=Object.prototype.hasOwnProperty,Se=e.unstable_scheduleCallback,ve=e.unstable_cancelCallback,Be=e.unstable_shouldYield,qe=e.unstable_requestPaint,De=e.unstable_now,ut=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,ee=e.unstable_NormalPriority,de=e.unstable_LowPriority,Ae=e.unstable_IdlePriority,He=e.log,$e=e.unstable_setDisableYieldValue,et=null,ze=null;function Ze(i){if(typeof He=="function"&&$e(i),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(et,i)}catch{}}var tt=Math.clz32?Math.clz32:gt,Ct=Math.log,zt=Math.LN2;function gt(i){return i>>>=0,i===0?32:31-(Ct(i)/zt|0)|0}var Ot=256,it=262144,ft=4194304;function yt(i){var s=i&42;if(s!==0)return s;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Ke(i,s,u){var p=i.pendingLanes;if(p===0)return 0;var b=0,x=i.suspendedLanes,N=i.pingedLanes;i=i.warmLanes;var Y=p&134217727;return Y!==0?(p=Y&~x,p!==0?b=yt(p):(N&=Y,N!==0?b=yt(N):u||(u=Y&~i,u!==0&&(b=yt(u))))):(Y=p&~x,Y!==0?b=yt(Y):N!==0?b=yt(N):u||(u=p&~i,u!==0&&(b=yt(u)))),b===0?0:s!==0&&s!==b&&(s&x)===0&&(x=b&-b,u=s&-s,x>=u||x===32&&(u&4194048)!==0)?s:b}function Rt(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function jt(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Tt(){var i=ft;return ft<<=1,(ft&62914560)===0&&(ft=4194304),i}function un(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Ht(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Je(i,s,u,p,b,x){var N=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var Y=i.entanglements,re=i.expirationTimes,ge=i.hiddenUpdates;for(u=N&~u;0<u;){var ke=31-tt(u),Ie=1<<ke;Y[ke]=0,re[ke]=-1;var be=ge[ke];if(be!==null)for(ge[ke]=null,ke=0;ke<be.length;ke++){var xe=be[ke];xe!==null&&(xe.lane&=-536870913)}u&=~Ie}p!==0&&kt(i,p,0),x!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=x&~(N&~s))}function kt(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var p=31-tt(s);i.entangledLanes|=s,i.entanglements[p]=i.entanglements[p]|1073741824|u&261930}function X(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var p=31-tt(u),b=1<<p;b&s|i[p]&s&&(i[p]|=s),u&=~b}}function ae(i,s){var u=s&-s;return u=(u&42)!==0?1:ue(u),(u&(i.suspendedLanes|s))!==0?0:u}function ue(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Re(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function _e(){var i=z.p;return i!==0?i:(i=window.event,i===void 0?32:KE(i.type))}function rt(i,s){var u=z.p;try{return z.p=i,s()}finally{z.p=u}}var nt=Math.random().toString(36).slice(2),We="__reactFiber$"+nt,Xe="__reactProps$"+nt,at="__reactContainer$"+nt,St="__reactEvents$"+nt,ht="__reactListeners$"+nt,Pt="__reactHandles$"+nt,$t="__reactResources$"+nt,An="__reactMarker$"+nt;function In(i){delete i[We],delete i[Xe],delete i[St],delete i[ht],delete i[Pt]}function Pn(i){var s=i[We];if(s)return s;for(var u=i.parentNode;u;){if(s=u[at]||u[We]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=DE(i);i!==null;){if(u=i[We])return u;i=DE(i)}return s}i=u,u=i.parentNode}return null}function Zt(i){if(i=i[We]||i[at]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function rr(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Or(i){var s=i[$t];return s||(s=i[$t]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Mn(i){i[An]=!0}var Ri=new Set,qr={};function ki(i,s){ai(i,s),ai(i+"Capture",s)}function ai(i,s){for(qr[i]=s,i=0;i<s.length;i++)Ri.add(s[i])}var fa=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]*$"),es={},ts={};function Jt(i){return J.call(ts,i)?!0:J.call(es,i)?!1:fa.test(i)?ts[i]=!0:(es[i]=!0,!1)}function Hn(i,s,u){if(Jt(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var p=s.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function Mi(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function lr(i,s,u,p){if(p===null)i.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+p)}}function en(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ns(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function nf(i,s,u){var p=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,x=p.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return b.call(this)},set:function(N){u=""+N,x.call(this,N)}}),Object.defineProperty(i,s,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(N){u=""+N},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Fc(i){if(!i._valueTracker){var s=ns(i)?"checked":"value";i._valueTracker=nf(i,s,""+i[s])}}function y0(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),p="";return i&&(p=ns(i)?i.checked?"true":"false":i.value),i=p,i!==u?(s.setValue(i),!0):!1}function rf(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var M2=/[\n"\\]/g;function oi(i){return i.replace(M2,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function km(i,s,u,p,b,x,N,Y){i.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.type=N:i.removeAttribute("type"),s!=null?N==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+en(s)):i.value!==""+en(s)&&(i.value=""+en(s)):N!=="submit"&&N!=="reset"||i.removeAttribute("value"),s!=null?Mm(i,N,en(s)):u!=null?Mm(i,N,en(u)):p!=null&&i.removeAttribute("value"),b==null&&x!=null&&(i.defaultChecked=!!x),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?i.name=""+en(Y):i.removeAttribute("name")}function b0(i,s,u,p,b,x,N,Y){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.type=x),s!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){Fc(i);return}u=u!=null?""+en(u):"",s=s!=null?""+en(s):u,Y||s===i.value||(i.value=s),i.defaultValue=s}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,i.checked=Y?i.checked:!!p,i.defaultChecked=!!p,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(i.name=N),Fc(i)}function Mm(i,s,u){s==="number"&&rf(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function tl(i,s,u,p){if(i=i.options,s){s={};for(var b=0;b<u.length;b++)s["$"+u[b]]=!0;for(u=0;u<i.length;u++)b=s.hasOwnProperty("$"+i[u].value),i[u].selected!==b&&(i[u].selected=b),b&&p&&(i[u].defaultSelected=!0)}else{for(u=""+en(u),s=null,b=0;b<i.length;b++){if(i[b].value===u){i[b].selected=!0,p&&(i[b].defaultSelected=!0);return}s!==null||i[b].disabled||(s=i[b])}s!==null&&(s.selected=!0)}}function v0(i,s,u){if(s!=null&&(s=""+en(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+en(u):""}function x0(i,s,u,p){if(s==null){if(p!=null){if(u!=null)throw Error(r(92));if(B(p)){if(1<p.length)throw Error(r(93));p=p[0]}u=p}u==null&&(u=""),s=u}u=en(s),i.defaultValue=u,p=i.textContent,p===u&&p!==""&&p!==null&&(i.value=p),Fc(i)}function nl(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var O2=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 w0(i,s,u){var p=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":p?i.setProperty(s,u):typeof u!="number"||u===0||O2.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function S0(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||s!=null&&s.hasOwnProperty(p)||(p.indexOf("--")===0?i.setProperty(p,""):p==="float"?i.cssFloat="":i[p]="");for(var b in s)p=s[b],s.hasOwnProperty(b)&&u[b]!==p&&w0(i,b,p)}else for(var x in s)s.hasOwnProperty(x)&&w0(i,x,s[x])}function Om(i){if(i.indexOf("-")===-1)return!1;switch(i){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 A2=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"]]),N2=/^[\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 af(i){return N2.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function ha(){}var Am=null;function Nm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var rl=null,il=null;function E0(i){var s=Zt(i);if(s&&(i=s.stateNode)){var u=i[Xe]||null;e:switch(i=s.stateNode,s.type){case"input":if(km(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+oi(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var p=u[s];if(p!==i&&p.form===i.form){var b=p[Xe]||null;if(!b)throw Error(r(90));km(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(s=0;s<u.length;s++)p=u[s],p.form===i.form&&y0(p)}break e;case"textarea":v0(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&tl(i,!!u.multiple,s,!1)}}}var Dm=!1;function C0(i,s,u){if(Dm)return i(s,u);Dm=!0;try{var p=i(s);return p}finally{if(Dm=!1,(rl!==null||il!==null)&&(Yf(),rl&&(s=rl,i=il,il=rl=null,E0(s),i)))for(s=0;s<i.length;s++)E0(i[s])}}function Bc(i,s){var u=i.stateNode;if(u===null)return null;var p=u[Xe]||null;if(p===null)return null;u=p[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(i=i.type,p=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!p;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Im=!1;if(pa)try{var Hc={};Object.defineProperty(Hc,"passive",{get:function(){Im=!0}}),window.addEventListener("test",Hc,Hc),window.removeEventListener("test",Hc,Hc)}catch{Im=!1}var Ga=null,Pm=null,of=null;function T0(){if(of)return of;var i,s=Pm,u=s.length,p,b="value"in Ga?Ga.value:Ga.textContent,x=b.length;for(i=0;i<u&&s[i]===b[i];i++);var N=u-i;for(p=1;p<=N&&s[u-p]===b[x-p];p++);return of=b.slice(i,1<p?1-p:void 0)}function sf(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function lf(){return!0}function R0(){return!1}function Ar(i){function s(u,p,b,x,N){this._reactName=u,this._targetInst=b,this.type=p,this.nativeEvent=x,this.target=N,this.currentTarget=null;for(var Y in i)i.hasOwnProperty(Y)&&(u=i[Y],this[Y]=u?u(x):x[Y]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?lf:R0,this.isPropagationStopped=R0,this}return h(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=lf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=lf)},persist:function(){},isPersistent:lf}),s}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cf=Ar(rs),Uc=h({},rs,{view:0,detail:0}),D2=Ar(Uc),Lm,jm,Vc,uf=h({},Uc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zm,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Vc&&(Vc&&i.type==="mousemove"?(Lm=i.screenX-Vc.screenX,jm=i.screenY-Vc.screenY):jm=Lm=0,Vc=i),Lm)},movementY:function(i){return"movementY"in i?i.movementY:jm}}),k0=Ar(uf),I2=h({},uf,{dataTransfer:0}),P2=Ar(I2),L2=h({},Uc,{relatedTarget:0}),_m=Ar(L2),j2=h({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),_2=Ar(j2),z2=h({},rs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),F2=Ar(z2),B2=h({},rs,{data:0}),M0=Ar(B2),H2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},U2={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"},V2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function q2(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=V2[i])?!!s[i]:!1}function zm(){return q2}var $2=h({},Uc,{key:function(i){if(i.key){var s=H2[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=sf(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?U2[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zm,charCode:function(i){return i.type==="keypress"?sf(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?sf(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Y2=Ar($2),W2=h({},uf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),O0=Ar(W2),K2=h({},Uc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zm}),G2=Ar(K2),X2=h({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Q2=Ar(X2),Z2=h({},uf,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),J2=Ar(Z2),eI=h({},rs,{newState:0,oldState:0}),tI=Ar(eI),nI=[9,13,27,32],Fm=pa&&"CompositionEvent"in window,qc=null;pa&&"documentMode"in document&&(qc=document.documentMode);var rI=pa&&"TextEvent"in window&&!qc,A0=pa&&(!Fm||qc&&8<qc&&11>=qc),N0=" ",D0=!1;function I0(i,s){switch(i){case"keyup":return nI.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function P0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var al=!1;function iI(i,s){switch(i){case"compositionend":return P0(s);case"keypress":return s.which!==32?null:(D0=!0,N0);case"textInput":return i=s.data,i===N0&&D0?null:i;default:return null}}function aI(i,s){if(al)return i==="compositionend"||!Fm&&I0(i,s)?(i=T0(),of=Pm=Ga=null,al=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return A0&&s.locale!=="ko"?null:s.data;default:return null}}var oI={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 L0(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!oI[i.type]:s==="textarea"}function j0(i,s,u,p){rl?il?il.push(p):il=[p]:rl=p,s=Jf(s,"onChange"),0<s.length&&(u=new cf("onChange","change",null,u,p),i.push({event:u,listeners:s}))}var $c=null,Yc=null;function sI(i){bE(i,0)}function df(i){var s=rr(i);if(y0(s))return i}function _0(i,s){if(i==="change")return s}var z0=!1;if(pa){var Bm;if(pa){var Hm="oninput"in document;if(!Hm){var F0=document.createElement("div");F0.setAttribute("oninput","return;"),Hm=typeof F0.oninput=="function"}Bm=Hm}else Bm=!1;z0=Bm&&(!document.documentMode||9<document.documentMode)}function B0(){$c&&($c.detachEvent("onpropertychange",H0),Yc=$c=null)}function H0(i){if(i.propertyName==="value"&&df(Yc)){var s=[];j0(s,Yc,i,Nm(i)),C0(sI,s)}}function lI(i,s,u){i==="focusin"?(B0(),$c=s,Yc=u,$c.attachEvent("onpropertychange",H0)):i==="focusout"&&B0()}function cI(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return df(Yc)}function uI(i,s){if(i==="click")return df(s)}function dI(i,s){if(i==="input"||i==="change")return df(s)}function fI(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var $r=typeof Object.is=="function"?Object.is:fI;function Wc(i,s){if($r(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),p=Object.keys(s);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var b=u[p];if(!J.call(s,b)||!$r(i[b],s[b]))return!1}return!0}function U0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function V0(i,s){var u=U0(i);i=0;for(var p;u;){if(u.nodeType===3){if(p=i+u.textContent.length,i<=s&&p>=s)return{node:u,offset:s-i};i=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=U0(u)}}function q0(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?q0(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function $0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=rf(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=rf(i.document)}return s}function Um(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var hI=pa&&"documentMode"in document&&11>=document.documentMode,ol=null,Vm=null,Kc=null,qm=!1;function Y0(i,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;qm||ol==null||ol!==rf(p)||(p=ol,"selectionStart"in p&&Um(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Kc&&Wc(Kc,p)||(Kc=p,p=Jf(Vm,"onSelect"),0<p.length&&(s=new cf("onSelect","select",null,s,u),i.push({event:s,listeners:p}),s.target=ol)))}function is(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var sl={animationend:is("Animation","AnimationEnd"),animationiteration:is("Animation","AnimationIteration"),animationstart:is("Animation","AnimationStart"),transitionrun:is("Transition","TransitionRun"),transitionstart:is("Transition","TransitionStart"),transitioncancel:is("Transition","TransitionCancel"),transitionend:is("Transition","TransitionEnd")},$m={},W0={};pa&&(W0=document.createElement("div").style,"AnimationEvent"in window||(delete sl.animationend.animation,delete sl.animationiteration.animation,delete sl.animationstart.animation),"TransitionEvent"in window||delete sl.transitionend.transition);function as(i){if($m[i])return $m[i];if(!sl[i])return i;var s=sl[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in W0)return $m[i]=s[u];return i}var K0=as("animationend"),G0=as("animationiteration"),X0=as("animationstart"),pI=as("transitionrun"),mI=as("transitionstart"),gI=as("transitioncancel"),Q0=as("transitionend"),Z0=new Map,Ym="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(" ");Ym.push("scrollEnd");function Oi(i,s){Z0.set(i,s),ki(s,[i])}var ff=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=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(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},si=[],ll=0,Wm=0;function hf(){for(var i=ll,s=Wm=ll=0;s<i;){var u=si[s];si[s++]=null;var p=si[s];si[s++]=null;var b=si[s];si[s++]=null;var x=si[s];if(si[s++]=null,p!==null&&b!==null){var N=p.pending;N===null?b.next=b:(b.next=N.next,N.next=b),p.pending=b}x!==0&&J0(u,b,x)}}function pf(i,s,u,p){si[ll++]=i,si[ll++]=s,si[ll++]=u,si[ll++]=p,Wm|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function Km(i,s,u,p){return pf(i,s,u,p),mf(i)}function os(i,s){return pf(i,null,null,s),mf(i)}function J0(i,s,u){i.lanes|=u;var p=i.alternate;p!==null&&(p.lanes|=u);for(var b=!1,x=i.return;x!==null;)x.childLanes|=u,p=x.alternate,p!==null&&(p.childLanes|=u),x.tag===22&&(i=x.stateNode,i===null||i._visibility&1||(b=!0)),i=x,x=x.return;return i.tag===3?(x=i.stateNode,b&&s!==null&&(b=31-tt(u),i=x.hiddenUpdates,p=i[b],p===null?i[b]=[s]:p.push(s),s.lane=u|536870912),x):null}function mf(i){if(50<gu)throw gu=0,ry=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var cl={};function yI(i,s,u,p){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(i,s,u,p){return new yI(i,s,u,p)}function Gm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ma(i,s){var u=i.alternate;return u===null?(u=Yr(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function eS(i,s){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function gf(i,s,u,p,b,x){var N=0;if(p=i,typeof i=="function")Gm(i)&&(N=1);else if(typeof i=="string")N=SP(i,u,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case H:return i=Yr(31,u,s,b),i.elementType=H,i.lanes=x,i;case C:return ss(u.children,b,x,s);case T:N=8,b|=24;break;case S:return i=Yr(12,u,s,b|2),i.elementType=S,i.lanes=x,i;case D:return i=Yr(13,u,s,b),i.elementType=D,i.lanes=x,i;case O:return i=Yr(19,u,s,b),i.elementType=O,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:N=10;break e;case R:N=9;break e;case M:N=11;break e;case A:N=14;break e;case L:N=16,p=null;break e}N=29,u=Error(r(130,i===null?"null":typeof i,"")),p=null}return s=Yr(N,u,s,b),s.elementType=i,s.type=p,s.lanes=x,s}function ss(i,s,u,p){return i=Yr(7,i,p,s),i.lanes=u,i}function Xm(i,s,u){return i=Yr(6,i,null,s),i.lanes=u,i}function tS(i){var s=Yr(18,null,null,0);return s.stateNode=i,s}function Qm(i,s,u){return s=Yr(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var nS=new WeakMap;function li(i,s){if(typeof i=="object"&&i!==null){var u=nS.get(i);return u!==void 0?u:(s={value:i,source:s,stack:Te(s)},nS.set(i,s),s)}return{value:i,source:s,stack:Te(s)}}var ul=[],dl=0,yf=null,Gc=0,ci=[],ui=0,Xa=null,Ui=1,Vi="";function ga(i,s){ul[dl++]=Gc,ul[dl++]=yf,yf=i,Gc=s}function rS(i,s,u){ci[ui++]=Ui,ci[ui++]=Vi,ci[ui++]=Xa,Xa=i;var p=Ui;i=Vi;var b=32-tt(p)-1;p&=~(1<<b),u+=1;var x=32-tt(s)+b;if(30<x){var N=b-b%5;x=(p&(1<<N)-1).toString(32),p>>=N,b-=N,Ui=1<<32-tt(s)+b|u<<b|p,Vi=x+i}else Ui=1<<x|u<<b|p,Vi=i}function Zm(i){i.return!==null&&(ga(i,1),rS(i,1,0))}function Jm(i){for(;i===yf;)yf=ul[--dl],ul[dl]=null,Gc=ul[--dl],ul[dl]=null;for(;i===Xa;)Xa=ci[--ui],ci[ui]=null,Vi=ci[--ui],ci[ui]=null,Ui=ci[--ui],ci[ui]=null}function iS(i,s){ci[ui++]=Ui,ci[ui++]=Vi,ci[ui++]=Xa,Ui=s.id,Vi=s.overflow,Xa=i}var cr=null,Tn=null,tn=!1,Qa=null,di=!1,eg=Error(r(519));function Za(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xc(li(s,i)),eg}function aS(i){var s=i.stateNode,u=i.type,p=i.memoizedProps;switch(s[We]=i,s[Xe]=p,u){case"dialog":Wt("cancel",s),Wt("close",s);break;case"iframe":case"object":case"embed":Wt("load",s);break;case"video":case"audio":for(u=0;u<bu.length;u++)Wt(bu[u],s);break;case"source":Wt("error",s);break;case"img":case"image":case"link":Wt("error",s),Wt("load",s);break;case"details":Wt("toggle",s);break;case"input":Wt("invalid",s),b0(s,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Wt("invalid",s);break;case"textarea":Wt("invalid",s),x0(s,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||p.suppressHydrationWarning===!0||SE(s.textContent,u)?(p.popover!=null&&(Wt("beforetoggle",s),Wt("toggle",s)),p.onScroll!=null&&Wt("scroll",s),p.onScrollEnd!=null&&Wt("scrollend",s),p.onClick!=null&&(s.onclick=ha),s=!0):s=!1,s||Za(i,!0)}function oS(i){for(cr=i.return;cr;)switch(cr.tag){case 5:case 31:case 13:di=!1;return;case 27:case 3:di=!0;return;default:cr=cr.return}}function fl(i){if(i!==cr)return!1;if(!tn)return oS(i),tn=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||by(i.type,i.memoizedProps)),u=!u),u&&Tn&&Za(i),oS(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Tn=NE(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Tn=NE(i)}else s===27?(s=Tn,ho(i.type)?(i=Ey,Ey=null,Tn=i):Tn=s):Tn=cr?hi(i.stateNode.nextSibling):null;return!0}function ls(){Tn=cr=null,tn=!1}function tg(){var i=Qa;return i!==null&&(Pr===null?Pr=i:Pr.push.apply(Pr,i),Qa=null),i}function Xc(i){Qa===null?Qa=[i]:Qa.push(i)}var ng=V(null),cs=null,ya=null;function Ja(i,s,u){I(ng,s._currentValue),s._currentValue=u}function ba(i){i._currentValue=ng.current,G(ng)}function rg(i,s,u){for(;i!==null;){var p=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),i===u)break;i=i.return}}function ig(i,s,u,p){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var x=b.dependencies;if(x!==null){var N=b.child;x=x.firstContext;e:for(;x!==null;){var Y=x;x=b;for(var re=0;re<s.length;re++)if(Y.context===s[re]){x.lanes|=u,Y=x.alternate,Y!==null&&(Y.lanes|=u),rg(x.return,u,i),p||(N=null);break e}x=Y.next}}else if(b.tag===18){if(N=b.return,N===null)throw Error(r(341));N.lanes|=u,x=N.alternate,x!==null&&(x.lanes|=u),rg(N,u,i),N=null}else N=b.child;if(N!==null)N.return=b;else for(N=b;N!==null;){if(N===i){N=null;break}if(b=N.sibling,b!==null){b.return=N.return,N=b;break}N=N.return}b=N}}function hl(i,s,u,p){i=null;for(var b=s,x=!1;b!==null;){if(!x){if((b.flags&524288)!==0)x=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var N=b.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var Y=b.type;$r(b.pendingProps.value,N.value)||(i!==null?i.push(Y):i=[Y])}}else if(b===le.current){if(N=b.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(Eu):i=[Eu])}b=b.return}i!==null&&ig(s,i,u,p),s.flags|=262144}function bf(i){for(i=i.firstContext;i!==null;){if(!$r(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function us(i){cs=i,ya=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function ur(i){return sS(cs,i)}function vf(i,s){return cs===null&&us(i),sS(i,s)}function sS(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},ya===null){if(i===null)throw Error(r(308));ya=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else ya=ya.next=s;return u}var bI=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,p){i.push(p)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},vI=e.unstable_scheduleCallback,xI=e.unstable_NormalPriority,$n={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ag(){return{controller:new bI,data:new Map,refCount:0}}function Qc(i){i.refCount--,i.refCount===0&&vI(xI,function(){i.controller.abort()})}var Zc=null,og=0,pl=0,ml=null;function wI(i,s){if(Zc===null){var u=Zc=[];og=0,pl=cy(),ml={status:"pending",value:void 0,then:function(p){u.push(p)}}}return og++,s.then(lS,lS),s}function lS(){if(--og===0&&Zc!==null){ml!==null&&(ml.status="fulfilled");var i=Zc;Zc=null,pl=0,ml=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function SI(i,s){var u=[],p={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return i.then(function(){p.status="fulfilled",p.value=s;for(var b=0;b<u.length;b++)(0,u[b])(s)},function(b){for(p.status="rejected",p.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),p}var cS=_.S;_.S=function(i,s){Y1=De(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&wI(i,s),cS!==null&&cS(i,s)};var ds=V(null);function sg(){var i=ds.current;return i!==null?i:vn.pooledCache}function xf(i,s){s===null?I(ds,ds.current):I(ds,s.pool)}function uS(){var i=sg();return i===null?null:{parent:$n._currentValue,pool:i}}var gl=Error(r(460)),lg=Error(r(474)),wf=Error(r(542)),Sf={then:function(){}};function dS(i){return i=i.status,i==="fulfilled"||i==="rejected"}function fS(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(ha,ha),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,pS(i),i;default:if(typeof s.status=="string")s.then(ha,ha);else{if(i=vn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(p){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=p}},function(p){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=p}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,pS(i),i}throw hs=s,gl}}function fs(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(hs=u,gl):u}}var hs=null;function hS(){if(hs===null)throw Error(r(459));var i=hs;return hs=null,i}function pS(i){if(i===gl||i===wf)throw Error(r(483))}var yl=null,Jc=0;function Ef(i){var s=Jc;return Jc+=1,yl===null&&(yl=[]),fS(yl,i,s)}function eu(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Cf(i,s){throw s.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function mS(i){function s(ce,oe){if(i){var me=ce.deletions;me===null?(ce.deletions=[oe],ce.flags|=16):me.push(oe)}}function u(ce,oe){if(!i)return null;for(;oe!==null;)s(ce,oe),oe=oe.sibling;return null}function p(ce){for(var oe=new Map;ce!==null;)ce.key!==null?oe.set(ce.key,ce):oe.set(ce.index,ce),ce=ce.sibling;return oe}function b(ce,oe){return ce=ma(ce,oe),ce.index=0,ce.sibling=null,ce}function x(ce,oe,me){return ce.index=me,i?(me=ce.alternate,me!==null?(me=me.index,me<oe?(ce.flags|=67108866,oe):me):(ce.flags|=67108866,oe)):(ce.flags|=1048576,oe)}function N(ce){return i&&ce.alternate===null&&(ce.flags|=67108866),ce}function Y(ce,oe,me,Ne){return oe===null||oe.tag!==6?(oe=Xm(me,ce.mode,Ne),oe.return=ce,oe):(oe=b(oe,me),oe.return=ce,oe)}function re(ce,oe,me,Ne){var mt=me.type;return mt===C?ke(ce,oe,me.props.children,Ne,me.key):oe!==null&&(oe.elementType===mt||typeof mt=="object"&&mt!==null&&mt.$$typeof===L&&fs(mt)===oe.type)?(oe=b(oe,me.props),eu(oe,me),oe.return=ce,oe):(oe=gf(me.type,me.key,me.props,null,ce.mode,Ne),eu(oe,me),oe.return=ce,oe)}function ge(ce,oe,me,Ne){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==me.containerInfo||oe.stateNode.implementation!==me.implementation?(oe=Qm(me,ce.mode,Ne),oe.return=ce,oe):(oe=b(oe,me.children||[]),oe.return=ce,oe)}function ke(ce,oe,me,Ne,mt){return oe===null||oe.tag!==7?(oe=ss(me,ce.mode,Ne,mt),oe.return=ce,oe):(oe=b(oe,me),oe.return=ce,oe)}function Ie(ce,oe,me){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return oe=Xm(""+oe,ce.mode,me),oe.return=ce,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case g:return me=gf(oe.type,oe.key,oe.props,null,ce.mode,me),eu(me,oe),me.return=ce,me;case w:return oe=Qm(oe,ce.mode,me),oe.return=ce,oe;case L:return oe=fs(oe),Ie(ce,oe,me)}if(B(oe)||j(oe))return oe=ss(oe,ce.mode,me,null),oe.return=ce,oe;if(typeof oe.then=="function")return Ie(ce,Ef(oe),me);if(oe.$$typeof===k)return Ie(ce,vf(ce,oe),me);Cf(ce,oe)}return null}function be(ce,oe,me,Ne){var mt=oe!==null?oe.key:null;if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return mt!==null?null:Y(ce,oe,""+me,Ne);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case g:return me.key===mt?re(ce,oe,me,Ne):null;case w:return me.key===mt?ge(ce,oe,me,Ne):null;case L:return me=fs(me),be(ce,oe,me,Ne)}if(B(me)||j(me))return mt!==null?null:ke(ce,oe,me,Ne,null);if(typeof me.then=="function")return be(ce,oe,Ef(me),Ne);if(me.$$typeof===k)return be(ce,oe,vf(ce,me),Ne);Cf(ce,me)}return null}function xe(ce,oe,me,Ne,mt){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return ce=ce.get(me)||null,Y(oe,ce,""+Ne,mt);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case g:return ce=ce.get(Ne.key===null?me:Ne.key)||null,re(oe,ce,Ne,mt);case w:return ce=ce.get(Ne.key===null?me:Ne.key)||null,ge(oe,ce,Ne,mt);case L:return Ne=fs(Ne),xe(ce,oe,me,Ne,mt)}if(B(Ne)||j(Ne))return ce=ce.get(me)||null,ke(oe,ce,Ne,mt,null);if(typeof Ne.then=="function")return xe(ce,oe,me,Ef(Ne),mt);if(Ne.$$typeof===k)return xe(ce,oe,me,vf(oe,Ne),mt);Cf(oe,Ne)}return null}function ot(ce,oe,me,Ne){for(var mt=null,on=null,dt=oe,Ft=oe=0,Xt=null;dt!==null&&Ft<me.length;Ft++){dt.index>Ft?(Xt=dt,dt=null):Xt=dt.sibling;var sn=be(ce,dt,me[Ft],Ne);if(sn===null){dt===null&&(dt=Xt);break}i&&dt&&sn.alternate===null&&s(ce,dt),oe=x(sn,oe,Ft),on===null?mt=sn:on.sibling=sn,on=sn,dt=Xt}if(Ft===me.length)return u(ce,dt),tn&&ga(ce,Ft),mt;if(dt===null){for(;Ft<me.length;Ft++)dt=Ie(ce,me[Ft],Ne),dt!==null&&(oe=x(dt,oe,Ft),on===null?mt=dt:on.sibling=dt,on=dt);return tn&&ga(ce,Ft),mt}for(dt=p(dt);Ft<me.length;Ft++)Xt=xe(dt,ce,Ft,me[Ft],Ne),Xt!==null&&(i&&Xt.alternate!==null&&dt.delete(Xt.key===null?Ft:Xt.key),oe=x(Xt,oe,Ft),on===null?mt=Xt:on.sibling=Xt,on=Xt);return i&&dt.forEach(function(bo){return s(ce,bo)}),tn&&ga(ce,Ft),mt}function xt(ce,oe,me,Ne){if(me==null)throw Error(r(151));for(var mt=null,on=null,dt=oe,Ft=oe=0,Xt=null,sn=me.next();dt!==null&&!sn.done;Ft++,sn=me.next()){dt.index>Ft?(Xt=dt,dt=null):Xt=dt.sibling;var bo=be(ce,dt,sn.value,Ne);if(bo===null){dt===null&&(dt=Xt);break}i&&dt&&bo.alternate===null&&s(ce,dt),oe=x(bo,oe,Ft),on===null?mt=bo:on.sibling=bo,on=bo,dt=Xt}if(sn.done)return u(ce,dt),tn&&ga(ce,Ft),mt;if(dt===null){for(;!sn.done;Ft++,sn=me.next())sn=Ie(ce,sn.value,Ne),sn!==null&&(oe=x(sn,oe,Ft),on===null?mt=sn:on.sibling=sn,on=sn);return tn&&ga(ce,Ft),mt}for(dt=p(dt);!sn.done;Ft++,sn=me.next())sn=xe(dt,ce,Ft,sn.value,Ne),sn!==null&&(i&&sn.alternate!==null&&dt.delete(sn.key===null?Ft:sn.key),oe=x(sn,oe,Ft),on===null?mt=sn:on.sibling=sn,on=sn);return i&&dt.forEach(function(IP){return s(ce,IP)}),tn&&ga(ce,Ft),mt}function bn(ce,oe,me,Ne){if(typeof me=="object"&&me!==null&&me.type===C&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case g:e:{for(var mt=me.key;oe!==null;){if(oe.key===mt){if(mt=me.type,mt===C){if(oe.tag===7){u(ce,oe.sibling),Ne=b(oe,me.props.children),Ne.return=ce,ce=Ne;break e}}else if(oe.elementType===mt||typeof mt=="object"&&mt!==null&&mt.$$typeof===L&&fs(mt)===oe.type){u(ce,oe.sibling),Ne=b(oe,me.props),eu(Ne,me),Ne.return=ce,ce=Ne;break e}u(ce,oe);break}else s(ce,oe);oe=oe.sibling}me.type===C?(Ne=ss(me.props.children,ce.mode,Ne,me.key),Ne.return=ce,ce=Ne):(Ne=gf(me.type,me.key,me.props,null,ce.mode,Ne),eu(Ne,me),Ne.return=ce,ce=Ne)}return N(ce);case w:e:{for(mt=me.key;oe!==null;){if(oe.key===mt)if(oe.tag===4&&oe.stateNode.containerInfo===me.containerInfo&&oe.stateNode.implementation===me.implementation){u(ce,oe.sibling),Ne=b(oe,me.children||[]),Ne.return=ce,ce=Ne;break e}else{u(ce,oe);break}else s(ce,oe);oe=oe.sibling}Ne=Qm(me,ce.mode,Ne),Ne.return=ce,ce=Ne}return N(ce);case L:return me=fs(me),bn(ce,oe,me,Ne)}if(B(me))return ot(ce,oe,me,Ne);if(j(me)){if(mt=j(me),typeof mt!="function")throw Error(r(150));return me=mt.call(me),xt(ce,oe,me,Ne)}if(typeof me.then=="function")return bn(ce,oe,Ef(me),Ne);if(me.$$typeof===k)return bn(ce,oe,vf(ce,me),Ne);Cf(ce,me)}return typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint"?(me=""+me,oe!==null&&oe.tag===6?(u(ce,oe.sibling),Ne=b(oe,me),Ne.return=ce,ce=Ne):(u(ce,oe),Ne=Xm(me,ce.mode,Ne),Ne.return=ce,ce=Ne),N(ce)):u(ce,oe)}return function(ce,oe,me,Ne){try{Jc=0;var mt=bn(ce,oe,me,Ne);return yl=null,mt}catch(dt){if(dt===gl||dt===wf)throw dt;var on=Yr(29,dt,null,ce.mode);return on.lanes=Ne,on.return=ce,on}finally{}}}var ps=mS(!0),gS=mS(!1),eo=!1;function cg(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ug(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function to(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function no(i,s,u){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(dn&2)!==0){var b=p.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),p.pending=s,s=mf(i),J0(i,null,u),s}return pf(i,p,s,u),mf(i)}function tu(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,X(i,u)}}function dg(i,s){var u=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var b=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var N={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?b=x=N:x=x.next=N,u=u.next}while(u!==null);x===null?b=x=s:x=x.next=s}else b=x=s;u={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:x,shared:p.shared,callbacks:p.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var fg=!1;function nu(){if(fg){var i=ml;if(i!==null)throw i}}function ru(i,s,u,p){fg=!1;var b=i.updateQueue;eo=!1;var x=b.firstBaseUpdate,N=b.lastBaseUpdate,Y=b.shared.pending;if(Y!==null){b.shared.pending=null;var re=Y,ge=re.next;re.next=null,N===null?x=ge:N.next=ge,N=re;var ke=i.alternate;ke!==null&&(ke=ke.updateQueue,Y=ke.lastBaseUpdate,Y!==N&&(Y===null?ke.firstBaseUpdate=ge:Y.next=ge,ke.lastBaseUpdate=re))}if(x!==null){var Ie=b.baseState;N=0,ke=ge=re=null,Y=x;do{var be=Y.lane&-536870913,xe=be!==Y.lane;if(xe?(Gt&be)===be:(p&be)===be){be!==0&&be===pl&&(fg=!0),ke!==null&&(ke=ke.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var ot=i,xt=Y;be=s;var bn=u;switch(xt.tag){case 1:if(ot=xt.payload,typeof ot=="function"){Ie=ot.call(bn,Ie,be);break e}Ie=ot;break e;case 3:ot.flags=ot.flags&-65537|128;case 0:if(ot=xt.payload,be=typeof ot=="function"?ot.call(bn,Ie,be):ot,be==null)break e;Ie=h({},Ie,be);break e;case 2:eo=!0}}be=Y.callback,be!==null&&(i.flags|=64,xe&&(i.flags|=8192),xe=b.callbacks,xe===null?b.callbacks=[be]:xe.push(be))}else xe={lane:be,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},ke===null?(ge=ke=xe,re=Ie):ke=ke.next=xe,N|=be;if(Y=Y.next,Y===null){if(Y=b.shared.pending,Y===null)break;xe=Y,Y=xe.next,xe.next=null,b.lastBaseUpdate=xe,b.shared.pending=null}}while(!0);ke===null&&(re=Ie),b.baseState=re,b.firstBaseUpdate=ge,b.lastBaseUpdate=ke,x===null&&(b.shared.lanes=0),so|=N,i.lanes=N,i.memoizedState=Ie}}function yS(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function bS(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)yS(u[i],s)}var bl=V(null),Tf=V(0);function vS(i,s){i=ka,I(Tf,i),I(bl,s),ka=i|s.baseLanes}function hg(){I(Tf,ka),I(bl,bl.current)}function pg(){ka=Tf.current,G(bl),G(Tf)}var Wr=V(null),fi=null;function ro(i){var s=i.alternate;I(Un,Un.current&1),I(Wr,i),fi===null&&(s===null||bl.current!==null||s.memoizedState!==null)&&(fi=i)}function mg(i){I(Un,Un.current),I(Wr,i),fi===null&&(fi=i)}function xS(i){i.tag===22?(I(Un,Un.current),I(Wr,i),fi===null&&(fi=i)):io()}function io(){I(Un,Un.current),I(Wr,Wr.current)}function Kr(i){G(Wr),fi===i&&(fi=null),G(Un)}var Un=V(0);function Rf(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||wy(u)||Sy(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var va=0,_t=null,gn=null,Yn=null,kf=!1,vl=!1,ms=!1,Mf=0,iu=0,xl=null,EI=0;function Ln(){throw Error(r(321))}function gg(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!$r(i[u],s[u]))return!1;return!0}function yg(i,s,u,p,b,x){return va=x,_t=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,_.H=i===null||i.memoizedState===null?r1:Dg,ms=!1,x=u(p,b),ms=!1,vl&&(x=SS(s,u,p,b)),wS(i),x}function wS(i){_.H=su;var s=gn!==null&&gn.next!==null;if(va=0,Yn=gn=_t=null,kf=!1,iu=0,xl=null,s)throw Error(r(300));i===null||Wn||(i=i.dependencies,i!==null&&bf(i)&&(Wn=!0))}function SS(i,s,u,p){_t=i;var b=0;do{if(vl&&(xl=null),iu=0,vl=!1,25<=b)throw Error(r(301));if(b+=1,Yn=gn=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}_.H=i1,x=s(u,p)}while(vl);return x}function CI(){var i=_.H,s=i.useState()[0];return s=typeof s.then=="function"?au(s):s,i=i.useState()[0],(gn!==null?gn.memoizedState:null)!==i&&(_t.flags|=1024),s}function bg(){var i=Mf!==0;return Mf=0,i}function vg(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function xg(i){if(kf){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}kf=!1}va=0,Yn=gn=_t=null,vl=!1,iu=Mf=0,xl=null}function Sr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yn===null?_t.memoizedState=Yn=i:Yn=Yn.next=i,Yn}function Vn(){if(gn===null){var i=_t.alternate;i=i!==null?i.memoizedState:null}else i=gn.next;var s=Yn===null?_t.memoizedState:Yn.next;if(s!==null)Yn=s,gn=i;else{if(i===null)throw _t.alternate===null?Error(r(467)):Error(r(310));gn=i,i={memoizedState:gn.memoizedState,baseState:gn.baseState,baseQueue:gn.baseQueue,queue:gn.queue,next:null},Yn===null?_t.memoizedState=Yn=i:Yn=Yn.next=i}return Yn}function Of(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function au(i){var s=iu;return iu+=1,xl===null&&(xl=[]),i=fS(xl,i,s),s=_t,(Yn===null?s.memoizedState:Yn.next)===null&&(s=s.alternate,_.H=s===null||s.memoizedState===null?r1:Dg),i}function Af(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return au(i);if(i.$$typeof===k)return ur(i)}throw Error(r(438,String(i)))}function wg(i){var s=null,u=_t.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var p=_t.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(b){return b.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Of(),_t.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),p=0;p<i;p++)u[p]=F;return s.index++,u}function xa(i,s){return typeof s=="function"?s(i):s}function Nf(i){var s=Vn();return Sg(s,gn,i)}function Sg(i,s,u){var p=i.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var b=i.baseQueue,x=p.pending;if(x!==null){if(b!==null){var N=b.next;b.next=x.next,x.next=N}s.baseQueue=b=x,p.pending=null}if(x=i.baseState,b===null)i.memoizedState=x;else{s=b.next;var Y=N=null,re=null,ge=s,ke=!1;do{var Ie=ge.lane&-536870913;if(Ie!==ge.lane?(Gt&Ie)===Ie:(va&Ie)===Ie){var be=ge.revertLane;if(be===0)re!==null&&(re=re.next={lane:0,revertLane:0,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),Ie===pl&&(ke=!0);else if((va&be)===be){ge=ge.next,be===pl&&(ke=!0);continue}else Ie={lane:0,revertLane:ge.revertLane,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},re===null?(Y=re=Ie,N=x):re=re.next=Ie,_t.lanes|=be,so|=be;Ie=ge.action,ms&&u(x,Ie),x=ge.hasEagerState?ge.eagerState:u(x,Ie)}else be={lane:Ie,revertLane:ge.revertLane,gesture:ge.gesture,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},re===null?(Y=re=be,N=x):re=re.next=be,_t.lanes|=Ie,so|=Ie;ge=ge.next}while(ge!==null&&ge!==s);if(re===null?N=x:re.next=Y,!$r(x,i.memoizedState)&&(Wn=!0,ke&&(u=ml,u!==null)))throw u;i.memoizedState=x,i.baseState=N,i.baseQueue=re,p.lastRenderedState=x}return b===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function Eg(i){var s=Vn(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var p=u.dispatch,b=u.pending,x=s.memoizedState;if(b!==null){u.pending=null;var N=b=b.next;do x=i(x,N.action),N=N.next;while(N!==b);$r(x,s.memoizedState)||(Wn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,p]}function ES(i,s,u){var p=_t,b=Vn(),x=tn;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=s();var N=!$r((gn||b).memoizedState,u);if(N&&(b.memoizedState=u,Wn=!0),b=b.queue,Rg(RS.bind(null,p,b,i),[i]),b.getSnapshot!==s||N||Yn!==null&&Yn.memoizedState.tag&1){if(p.flags|=2048,wl(9,{destroy:void 0},TS.bind(null,p,b,u,s),null),vn===null)throw Error(r(349));x||(va&127)!==0||CS(p,s,u)}return u}function CS(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=_t.updateQueue,s===null?(s=Of(),_t.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function TS(i,s,u,p){s.value=u,s.getSnapshot=p,kS(s)&&MS(i)}function RS(i,s,u){return u(function(){kS(s)&&MS(i)})}function kS(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!$r(i,u)}catch{return!0}}function MS(i){var s=os(i,2);s!==null&&Lr(s,i,2)}function Cg(i){var s=Sr();if(typeof i=="function"){var u=i;if(i=u(),ms){Ze(!0);try{u()}finally{Ze(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:i},s}function OS(i,s,u,p){return i.baseState=u,Sg(i,gn,typeof p=="function"?p:xa)}function TI(i,s,u,p,b){if(Pf(i))throw Error(r(485));if(i=s.action,i!==null){var x={payload:b,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){x.listeners.push(N)}};_.T!==null?u(!0):x.isTransition=!1,p(x),u=s.pending,u===null?(x.next=s.pending=x,AS(s,x)):(x.next=u.next,s.pending=u.next=x)}}function AS(i,s){var u=s.action,p=s.payload,b=i.state;if(s.isTransition){var x=_.T,N={};_.T=N;try{var Y=u(b,p),re=_.S;re!==null&&re(N,Y),NS(i,s,Y)}catch(ge){Tg(i,s,ge)}finally{x!==null&&N.types!==null&&(x.types=N.types),_.T=x}}else try{x=u(b,p),NS(i,s,x)}catch(ge){Tg(i,s,ge)}}function NS(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){DS(i,s,p)},function(p){return Tg(i,s,p)}):DS(i,s,u)}function DS(i,s,u){s.status="fulfilled",s.value=u,IS(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,AS(i,u)))}function Tg(i,s,u){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=u,IS(s),s=s.next;while(s!==p)}i.action=null}function IS(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function PS(i,s){return s}function LS(i,s){if(tn){var u=vn.formState;if(u!==null){e:{var p=_t;if(tn){if(Tn){t:{for(var b=Tn,x=di;b.nodeType!==8;){if(!x){b=null;break t}if(b=hi(b.nextSibling),b===null){b=null;break t}}x=b.data,b=x==="F!"||x==="F"?b:null}if(b){Tn=hi(b.nextSibling),p=b.data==="F!";break e}}Za(p)}p=!1}p&&(s=u[0])}}return u=Sr(),u.memoizedState=u.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:PS,lastRenderedState:s},u.queue=p,u=e1.bind(null,_t,p),p.dispatch=u,p=Cg(!1),x=Ng.bind(null,_t,!1,p.queue),p=Sr(),b={state:s,dispatch:null,action:i,pending:null},p.queue=b,u=TI.bind(null,_t,b,x,u),b.dispatch=u,p.memoizedState=i,[s,u,!1]}function jS(i){var s=Vn();return _S(s,gn,i)}function _S(i,s,u){if(s=Sg(i,s,PS)[0],i=Nf(xa)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=au(s)}catch(N){throw N===gl?wf:N}else p=s;s=Vn();var b=s.queue,x=b.dispatch;return u!==s.memoizedState&&(_t.flags|=2048,wl(9,{destroy:void 0},RI.bind(null,b,u),null)),[p,x,i]}function RI(i,s){i.action=s}function zS(i){var s=Vn(),u=gn;if(u!==null)return _S(s,u,i);Vn(),s=s.memoizedState,u=Vn();var p=u.queue.dispatch;return u.memoizedState=i,[s,p,!1]}function wl(i,s,u,p){return i={tag:i,create:u,deps:p,inst:s,next:null},s=_t.updateQueue,s===null&&(s=Of(),_t.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(p=u.next,u.next=i,i.next=p,s.lastEffect=i),i}function FS(){return Vn().memoizedState}function Df(i,s,u,p){var b=Sr();_t.flags|=i,b.memoizedState=wl(1|s,{destroy:void 0},u,p===void 0?null:p)}function If(i,s,u,p){var b=Vn();p=p===void 0?null:p;var x=b.memoizedState.inst;gn!==null&&p!==null&&gg(p,gn.memoizedState.deps)?b.memoizedState=wl(s,x,u,p):(_t.flags|=i,b.memoizedState=wl(1|s,x,u,p))}function BS(i,s){Df(8390656,8,i,s)}function Rg(i,s){If(2048,8,i,s)}function kI(i){_t.flags|=4;var s=_t.updateQueue;if(s===null)s=Of(),_t.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function HS(i){var s=Vn().memoizedState;return kI({ref:s,nextImpl:i}),function(){if((dn&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function US(i,s){return If(4,2,i,s)}function VS(i,s){return If(4,4,i,s)}function qS(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function $S(i,s,u){u=u!=null?u.concat([i]):null,If(4,4,qS.bind(null,s,i),u)}function kg(){}function YS(i,s){var u=Vn();s=s===void 0?null:s;var p=u.memoizedState;return s!==null&&gg(s,p[1])?p[0]:(u.memoizedState=[i,s],i)}function WS(i,s){var u=Vn();s=s===void 0?null:s;var p=u.memoizedState;if(s!==null&&gg(s,p[1]))return p[0];if(p=i(),ms){Ze(!0);try{i()}finally{Ze(!1)}}return u.memoizedState=[p,s],p}function Mg(i,s,u){return u===void 0||(va&1073741824)!==0&&(Gt&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=K1(),_t.lanes|=i,so|=i,u)}function KS(i,s,u,p){return $r(u,s)?u:bl.current!==null?(i=Mg(i,u,p),$r(i,s)||(Wn=!0),i):(va&42)===0||(va&1073741824)!==0&&(Gt&261930)===0?(Wn=!0,i.memoizedState=u):(i=K1(),_t.lanes|=i,so|=i,s)}function GS(i,s,u,p,b){var x=z.p;z.p=x!==0&&8>x?x:8;var N=_.T,Y={};_.T=Y,Ng(i,!1,s,u);try{var re=b(),ge=_.S;if(ge!==null&&ge(Y,re),re!==null&&typeof re=="object"&&typeof re.then=="function"){var ke=SI(re,p);ou(i,s,ke,Qr(i))}else ou(i,s,p,Qr(i))}catch(Ie){ou(i,s,{then:function(){},status:"rejected",reason:Ie},Qr())}finally{z.p=x,N!==null&&Y.types!==null&&(N.types=Y.types),_.T=N}}function MI(){}function Og(i,s,u,p){if(i.tag!==5)throw Error(r(476));var b=XS(i).queue;GS(i,b,s,U,u===null?MI:function(){return QS(i),u(p)})}function XS(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:U},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function QS(i){var s=XS(i);s.next===null&&(s=i.alternate.memoizedState),ou(i,s.next.queue,{},Qr())}function Ag(){return ur(Eu)}function ZS(){return Vn().memoizedState}function JS(){return Vn().memoizedState}function OI(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=Qr();i=to(u);var p=no(s,i,u);p!==null&&(Lr(p,s,u),tu(p,s,u)),s={cache:ag()},i.payload=s;return}s=s.return}}function AI(i,s,u){var p=Qr();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Pf(i)?t1(s,u):(u=Km(i,s,u,p),u!==null&&(Lr(u,i,p),n1(u,s,p)))}function e1(i,s,u){var p=Qr();ou(i,s,u,p)}function ou(i,s,u,p){var b={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Pf(i))t1(s,b);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var N=s.lastRenderedState,Y=x(N,u);if(b.hasEagerState=!0,b.eagerState=Y,$r(Y,N))return pf(i,s,b,0),vn===null&&hf(),!1}catch{}finally{}if(u=Km(i,s,b,p),u!==null)return Lr(u,i,p),n1(u,s,p),!0}return!1}function Ng(i,s,u,p){if(p={lane:2,revertLane:cy(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Pf(i)){if(s)throw Error(r(479))}else s=Km(i,u,p,2),s!==null&&Lr(s,i,2)}function Pf(i){var s=i.alternate;return i===_t||s!==null&&s===_t}function t1(i,s){vl=kf=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function n1(i,s,u){if((u&4194048)!==0){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,X(i,u)}}var su={readContext:ur,use:Af,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useLayoutEffect:Ln,useInsertionEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useSyncExternalStore:Ln,useId:Ln,useHostTransitionStatus:Ln,useFormState:Ln,useActionState:Ln,useOptimistic:Ln,useMemoCache:Ln,useCacheRefresh:Ln};su.useEffectEvent=Ln;var r1={readContext:ur,use:Af,useCallback:function(i,s){return Sr().memoizedState=[i,s===void 0?null:s],i},useContext:ur,useEffect:BS,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,Df(4194308,4,qS.bind(null,s,i),u)},useLayoutEffect:function(i,s){return Df(4194308,4,i,s)},useInsertionEffect:function(i,s){Df(4,2,i,s)},useMemo:function(i,s){var u=Sr();s=s===void 0?null:s;var p=i();if(ms){Ze(!0);try{i()}finally{Ze(!1)}}return u.memoizedState=[p,s],p},useReducer:function(i,s,u){var p=Sr();if(u!==void 0){var b=u(s);if(ms){Ze(!0);try{u(s)}finally{Ze(!1)}}}else b=s;return p.memoizedState=p.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},p.queue=i,i=i.dispatch=AI.bind(null,_t,i),[p.memoizedState,i]},useRef:function(i){var s=Sr();return i={current:i},s.memoizedState=i},useState:function(i){i=Cg(i);var s=i.queue,u=e1.bind(null,_t,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:kg,useDeferredValue:function(i,s){var u=Sr();return Mg(u,i,s)},useTransition:function(){var i=Cg(!1);return i=GS.bind(null,_t,i.queue,!0,!1),Sr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var p=_t,b=Sr();if(tn){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),vn===null)throw Error(r(349));(Gt&127)!==0||CS(p,s,u)}b.memoizedState=u;var x={value:u,getSnapshot:s};return b.queue=x,BS(RS.bind(null,p,x,i),[i]),p.flags|=2048,wl(9,{destroy:void 0},TS.bind(null,p,x,u,s),null),u},useId:function(){var i=Sr(),s=vn.identifierPrefix;if(tn){var u=Vi,p=Ui;u=(p&~(1<<32-tt(p)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Mf++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=EI++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Ag,useFormState:LS,useActionState:LS,useOptimistic:function(i){var s=Sr();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Ng.bind(null,_t,!0,u),u.dispatch=s,[i,s]},useMemoCache:wg,useCacheRefresh:function(){return Sr().memoizedState=OI.bind(null,_t)},useEffectEvent:function(i){var s=Sr(),u={impl:i};return s.memoizedState=u,function(){if((dn&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Dg={readContext:ur,use:Af,useCallback:YS,useContext:ur,useEffect:Rg,useImperativeHandle:$S,useInsertionEffect:US,useLayoutEffect:VS,useMemo:WS,useReducer:Nf,useRef:FS,useState:function(){return Nf(xa)},useDebugValue:kg,useDeferredValue:function(i,s){var u=Vn();return KS(u,gn.memoizedState,i,s)},useTransition:function(){var i=Nf(xa)[0],s=Vn().memoizedState;return[typeof i=="boolean"?i:au(i),s]},useSyncExternalStore:ES,useId:ZS,useHostTransitionStatus:Ag,useFormState:jS,useActionState:jS,useOptimistic:function(i,s){var u=Vn();return OS(u,gn,i,s)},useMemoCache:wg,useCacheRefresh:JS};Dg.useEffectEvent=HS;var i1={readContext:ur,use:Af,useCallback:YS,useContext:ur,useEffect:Rg,useImperativeHandle:$S,useInsertionEffect:US,useLayoutEffect:VS,useMemo:WS,useReducer:Eg,useRef:FS,useState:function(){return Eg(xa)},useDebugValue:kg,useDeferredValue:function(i,s){var u=Vn();return gn===null?Mg(u,i,s):KS(u,gn.memoizedState,i,s)},useTransition:function(){var i=Eg(xa)[0],s=Vn().memoizedState;return[typeof i=="boolean"?i:au(i),s]},useSyncExternalStore:ES,useId:ZS,useHostTransitionStatus:Ag,useFormState:zS,useActionState:zS,useOptimistic:function(i,s){var u=Vn();return gn!==null?OS(u,gn,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:wg,useCacheRefresh:JS};i1.useEffectEvent=HS;function Ig(i,s,u,p){s=i.memoizedState,u=u(p,s),u=u==null?s:h({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Pg={enqueueSetState:function(i,s,u){i=i._reactInternals;var p=Qr(),b=to(p);b.payload=s,u!=null&&(b.callback=u),s=no(i,b,p),s!==null&&(Lr(s,i,p),tu(s,i,p))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var p=Qr(),b=to(p);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=no(i,b,p),s!==null&&(Lr(s,i,p),tu(s,i,p))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=Qr(),p=to(u);p.tag=2,s!=null&&(p.callback=s),s=no(i,p,u),s!==null&&(Lr(s,i,u),tu(s,i,u))}};function a1(i,s,u,p,b,x,N){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,x,N):s.prototype&&s.prototype.isPureReactComponent?!Wc(u,p)||!Wc(b,x):!0}function o1(i,s,u,p){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,p),s.state!==i&&Pg.enqueueReplaceState(s,s.state,null)}function gs(i,s){var u=s;if("ref"in s){u={};for(var p in s)p!=="ref"&&(u[p]=s[p])}if(i=i.defaultProps){u===s&&(u=h({},u));for(var b in i)u[b]===void 0&&(u[b]=i[b])}return u}function s1(i){ff(i)}function l1(i){console.error(i)}function c1(i){ff(i)}function Lf(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(p){setTimeout(function(){throw p})}}function u1(i,s,u){try{var p=i.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Lg(i,s,u){return u=to(u),u.tag=3,u.payload={element:null},u.callback=function(){Lf(i,s)},u}function d1(i){return i=to(i),i.tag=3,i}function f1(i,s,u,p){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var x=p.value;i.payload=function(){return b(x)},i.callback=function(){u1(s,u,p)}}var N=u.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(i.callback=function(){u1(s,u,p),typeof b!="function"&&(lo===null?lo=new Set([this]):lo.add(this));var Y=p.stack;this.componentDidCatch(p.value,{componentStack:Y!==null?Y:""})})}function NI(i,s,u,p,b){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=u.alternate,s!==null&&hl(s,u,b,!0),u=Wr.current,u!==null){switch(u.tag){case 31:case 13:return fi===null?Wf():u.alternate===null&&jn===0&&(jn=3),u.flags&=-257,u.flags|=65536,u.lanes=b,p===Sf?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([p]):s.add(p),oy(i,p,b)),!1;case 22:return u.flags|=65536,p===Sf?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([p]):u.add(p)),oy(i,p,b)),!1}throw Error(r(435,u.tag))}return oy(i,p,b),Wf(),!1}if(tn)return s=Wr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,p!==eg&&(i=Error(r(422),{cause:p}),Xc(li(i,u)))):(p!==eg&&(s=Error(r(423),{cause:p}),Xc(li(s,u))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,p=li(p,u),b=Lg(i.stateNode,p,b),dg(i,b),jn!==4&&(jn=2)),!1;var x=Error(r(520),{cause:p});if(x=li(x,u),mu===null?mu=[x]:mu.push(x),jn!==4&&(jn=2),s===null)return!0;p=li(p,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=b&-b,u.lanes|=i,i=Lg(u.stateNode,p,i),dg(u,i),!1;case 1:if(s=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(lo===null||!lo.has(x))))return u.flags|=65536,b&=-b,u.lanes|=b,b=d1(b),f1(b,i,u,p),dg(u,b),!1}u=u.return}while(u!==null);return!1}var jg=Error(r(461)),Wn=!1;function dr(i,s,u,p){s.child=i===null?gS(s,null,u,p):ps(s,i.child,u,p)}function h1(i,s,u,p,b){u=u.render;var x=s.ref;if("ref"in p){var N={};for(var Y in p)Y!=="ref"&&(N[Y]=p[Y])}else N=p;return us(s),p=yg(i,s,u,N,x,b),Y=bg(),i!==null&&!Wn?(vg(i,s,b),wa(i,s,b)):(tn&&Y&&Zm(s),s.flags|=1,dr(i,s,p,b),s.child)}function p1(i,s,u,p,b){if(i===null){var x=u.type;return typeof x=="function"&&!Gm(x)&&x.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=x,m1(i,s,x,p,b)):(i=gf(u.type,null,p,s,s.mode,b),i.ref=s.ref,i.return=s,s.child=i)}if(x=i.child,!qg(i,b)){var N=x.memoizedProps;if(u=u.compare,u=u!==null?u:Wc,u(N,p)&&i.ref===s.ref)return wa(i,s,b)}return s.flags|=1,i=ma(x,p),i.ref=s.ref,i.return=s,s.child=i}function m1(i,s,u,p,b){if(i!==null){var x=i.memoizedProps;if(Wc(x,p)&&i.ref===s.ref)if(Wn=!1,s.pendingProps=p=x,qg(i,b))(i.flags&131072)!==0&&(Wn=!0);else return s.lanes=i.lanes,wa(i,s,b)}return _g(i,s,u,p,b)}function g1(i,s,u,p){var b=p.children,x=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,i!==null){for(p=s.child=i.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~x}else p=0,s.child=null;return y1(i,s,x,u,p)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&xf(s,x!==null?x.cachePool:null),x!==null?vS(s,x):hg(),xS(s);else return p=s.lanes=536870912,y1(i,s,x!==null?x.baseLanes|u:u,u,p)}else x!==null?(xf(s,x.cachePool),vS(s,x),io(),s.memoizedState=null):(i!==null&&xf(s,null),hg(),io());return dr(i,s,b,u),s.child}function lu(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function y1(i,s,u,p,b){var x=sg();return x=x===null?null:{parent:$n._currentValue,pool:x},s.memoizedState={baseLanes:u,cachePool:x},i!==null&&xf(s,null),hg(),xS(s),i!==null&&hl(i,s,p,!0),s.childLanes=b,null}function jf(i,s){return s=zf({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function b1(i,s,u){return ps(s,i.child,null,u),i=jf(s,s.pendingProps),i.flags|=2,Kr(s),s.memoizedState=null,i}function DI(i,s,u){var p=s.pendingProps,b=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(tn){if(p.mode==="hidden")return i=jf(s,p),s.lanes=536870912,lu(null,i);if(mg(s),(i=Tn)?(i=AE(i,di),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Xa!==null?{id:Ui,overflow:Vi}:null,retryLane:536870912,hydrationErrors:null},u=tS(i),u.return=s,s.child=u,cr=s,Tn=null)):i=null,i===null)throw Za(s);return s.lanes=536870912,null}return jf(s,p)}var x=i.memoizedState;if(x!==null){var N=x.dehydrated;if(mg(s),b)if(s.flags&256)s.flags&=-257,s=b1(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(Wn||hl(i,s,u,!1),b=(u&i.childLanes)!==0,Wn||b){if(p=vn,p!==null&&(N=ae(p,u),N!==0&&N!==x.retryLane))throw x.retryLane=N,os(i,N),Lr(p,i,N),jg;Wf(),s=b1(i,s,u)}else i=x.treeContext,Tn=hi(N.nextSibling),cr=s,tn=!0,Qa=null,di=!1,i!==null&&iS(s,i),s=jf(s,p),s.flags|=4096;return s}return i=ma(i.child,{mode:p.mode,children:p.children}),i.ref=s.ref,s.child=i,i.return=s,i}function _f(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function _g(i,s,u,p,b){return us(s),u=yg(i,s,u,p,void 0,b),p=bg(),i!==null&&!Wn?(vg(i,s,b),wa(i,s,b)):(tn&&p&&Zm(s),s.flags|=1,dr(i,s,u,b),s.child)}function v1(i,s,u,p,b,x){return us(s),s.updateQueue=null,u=SS(s,p,u,b),wS(i),p=bg(),i!==null&&!Wn?(vg(i,s,x),wa(i,s,x)):(tn&&p&&Zm(s),s.flags|=1,dr(i,s,u,x),s.child)}function x1(i,s,u,p,b){if(us(s),s.stateNode===null){var x=cl,N=u.contextType;typeof N=="object"&&N!==null&&(x=ur(N)),x=new u(p,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Pg,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=p,x.state=s.memoizedState,x.refs={},cg(s),N=u.contextType,x.context=typeof N=="object"&&N!==null?ur(N):cl,x.state=s.memoizedState,N=u.getDerivedStateFromProps,typeof N=="function"&&(Ig(s,u,N,p),x.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(N=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),N!==x.state&&Pg.enqueueReplaceState(x,x.state,null),ru(s,p,x,b),nu(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),p=!0}else if(i===null){x=s.stateNode;var Y=s.memoizedProps,re=gs(u,Y);x.props=re;var ge=x.context,ke=u.contextType;N=cl,typeof ke=="object"&&ke!==null&&(N=ur(ke));var Ie=u.getDerivedStateFromProps;ke=typeof Ie=="function"||typeof x.getSnapshotBeforeUpdate=="function",Y=s.pendingProps!==Y,ke||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(Y||ge!==N)&&o1(s,x,p,N),eo=!1;var be=s.memoizedState;x.state=be,ru(s,p,x,b),nu(),ge=s.memoizedState,Y||be!==ge||eo?(typeof Ie=="function"&&(Ig(s,u,Ie,p),ge=s.memoizedState),(re=eo||a1(s,u,re,p,be,ge,N))?(ke||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=ge),x.props=p,x.state=ge,x.context=N,p=re):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{x=s.stateNode,ug(i,s),N=s.memoizedProps,ke=gs(u,N),x.props=ke,Ie=s.pendingProps,be=x.context,ge=u.contextType,re=cl,typeof ge=="object"&&ge!==null&&(re=ur(ge)),Y=u.getDerivedStateFromProps,(ge=typeof Y=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(N!==Ie||be!==re)&&o1(s,x,p,re),eo=!1,be=s.memoizedState,x.state=be,ru(s,p,x,b),nu();var xe=s.memoizedState;N!==Ie||be!==xe||eo||i!==null&&i.dependencies!==null&&bf(i.dependencies)?(typeof Y=="function"&&(Ig(s,u,Y,p),xe=s.memoizedState),(ke=eo||a1(s,u,ke,p,be,xe,re)||i!==null&&i.dependencies!==null&&bf(i.dependencies))?(ge||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(p,xe,re),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(p,xe,re)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||N===i.memoizedProps&&be===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===i.memoizedProps&&be===i.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=xe),x.props=p,x.state=xe,x.context=re,p=ke):(typeof x.componentDidUpdate!="function"||N===i.memoizedProps&&be===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===i.memoizedProps&&be===i.memoizedState||(s.flags|=1024),p=!1)}return x=p,_f(i,s),p=(s.flags&128)!==0,x||p?(x=s.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,i!==null&&p?(s.child=ps(s,i.child,null,b),s.child=ps(s,null,u,b)):dr(i,s,u,b),s.memoizedState=x.state,i=s.child):i=wa(i,s,b),i}function w1(i,s,u,p){return ls(),s.flags|=256,dr(i,s,u,p),s.child}var zg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fg(i){return{baseLanes:i,cachePool:uS()}}function Bg(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=Xr),i}function S1(i,s,u){var p=s.pendingProps,b=!1,x=(s.flags&128)!==0,N;if((N=x)||(N=i!==null&&i.memoizedState===null?!1:(Un.current&2)!==0),N&&(b=!0,s.flags&=-129),N=(s.flags&32)!==0,s.flags&=-33,i===null){if(tn){if(b?ro(s):io(),(i=Tn)?(i=AE(i,di),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Xa!==null?{id:Ui,overflow:Vi}:null,retryLane:536870912,hydrationErrors:null},u=tS(i),u.return=s,s.child=u,cr=s,Tn=null)):i=null,i===null)throw Za(s);return Sy(i)?s.lanes=32:s.lanes=536870912,null}var Y=p.children;return p=p.fallback,b?(io(),b=s.mode,Y=zf({mode:"hidden",children:Y},b),p=ss(p,b,u,null),Y.return=s,p.return=s,Y.sibling=p,s.child=Y,p=s.child,p.memoizedState=Fg(u),p.childLanes=Bg(i,N,u),s.memoizedState=zg,lu(null,p)):(ro(s),Hg(s,Y))}var re=i.memoizedState;if(re!==null&&(Y=re.dehydrated,Y!==null)){if(x)s.flags&256?(ro(s),s.flags&=-257,s=Ug(i,s,u)):s.memoizedState!==null?(io(),s.child=i.child,s.flags|=128,s=null):(io(),Y=p.fallback,b=s.mode,p=zf({mode:"visible",children:p.children},b),Y=ss(Y,b,u,null),Y.flags|=2,p.return=s,Y.return=s,p.sibling=Y,s.child=p,ps(s,i.child,null,u),p=s.child,p.memoizedState=Fg(u),p.childLanes=Bg(i,N,u),s.memoizedState=zg,s=lu(null,p));else if(ro(s),Sy(Y)){if(N=Y.nextSibling&&Y.nextSibling.dataset,N)var ge=N.dgst;N=ge,p=Error(r(419)),p.stack="",p.digest=N,Xc({value:p,source:null,stack:null}),s=Ug(i,s,u)}else if(Wn||hl(i,s,u,!1),N=(u&i.childLanes)!==0,Wn||N){if(N=vn,N!==null&&(p=ae(N,u),p!==0&&p!==re.retryLane))throw re.retryLane=p,os(i,p),Lr(N,i,p),jg;wy(Y)||Wf(),s=Ug(i,s,u)}else wy(Y)?(s.flags|=192,s.child=i.child,s=null):(i=re.treeContext,Tn=hi(Y.nextSibling),cr=s,tn=!0,Qa=null,di=!1,i!==null&&iS(s,i),s=Hg(s,p.children),s.flags|=4096);return s}return b?(io(),Y=p.fallback,b=s.mode,re=i.child,ge=re.sibling,p=ma(re,{mode:"hidden",children:p.children}),p.subtreeFlags=re.subtreeFlags&65011712,ge!==null?Y=ma(ge,Y):(Y=ss(Y,b,u,null),Y.flags|=2),Y.return=s,p.return=s,p.sibling=Y,s.child=p,lu(null,p),p=s.child,Y=i.child.memoizedState,Y===null?Y=Fg(u):(b=Y.cachePool,b!==null?(re=$n._currentValue,b=b.parent!==re?{parent:re,pool:re}:b):b=uS(),Y={baseLanes:Y.baseLanes|u,cachePool:b}),p.memoizedState=Y,p.childLanes=Bg(i,N,u),s.memoizedState=zg,lu(i.child,p)):(ro(s),u=i.child,i=u.sibling,u=ma(u,{mode:"visible",children:p.children}),u.return=s,u.sibling=null,i!==null&&(N=s.deletions,N===null?(s.deletions=[i],s.flags|=16):N.push(i)),s.child=u,s.memoizedState=null,u)}function Hg(i,s){return s=zf({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function zf(i,s){return i=Yr(22,i,null,s),i.lanes=0,i}function Ug(i,s,u){return ps(s,i.child,null,u),i=Hg(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function E1(i,s,u){i.lanes|=s;var p=i.alternate;p!==null&&(p.lanes|=s),rg(i.return,s,u)}function Vg(i,s,u,p,b,x){var N=i.memoizedState;N===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:b,treeForkCount:x}:(N.isBackwards=s,N.rendering=null,N.renderingStartTime=0,N.last=p,N.tail=u,N.tailMode=b,N.treeForkCount=x)}function C1(i,s,u){var p=s.pendingProps,b=p.revealOrder,x=p.tail;p=p.children;var N=Un.current,Y=(N&2)!==0;if(Y?(N=N&1|2,s.flags|=128):N&=1,I(Un,N),dr(i,s,p,u),p=tn?Gc:0,!Y&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&E1(i,u,s);else if(i.tag===19)E1(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(b){case"forwards":for(u=s.child,b=null;u!==null;)i=u.alternate,i!==null&&Rf(i)===null&&(b=u),u=u.sibling;u=b,u===null?(b=s.child,s.child=null):(b=u.sibling,u.sibling=null),Vg(s,!1,b,u,x,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=s.child,s.child=null;b!==null;){if(i=b.alternate,i!==null&&Rf(i)===null){s.child=b;break}i=b.sibling,b.sibling=u,u=b,b=i}Vg(s,!0,u,null,x,p);break;case"together":Vg(s,!1,null,null,void 0,p);break;default:s.memoizedState=null}return s.child}function wa(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),so|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(hl(i,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,u=ma(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=ma(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function qg(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&bf(i)))}function II(i,s,u){switch(s.tag){case 3:pe(s,s.stateNode.containerInfo),Ja(s,$n,i.memoizedState.cache),ls();break;case 27:case 5:Me(s);break;case 4:pe(s,s.stateNode.containerInfo);break;case 10:Ja(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,mg(s),null;break;case 13:var p=s.memoizedState;if(p!==null)return p.dehydrated!==null?(ro(s),s.flags|=128,null):(u&s.child.childLanes)!==0?S1(i,s,u):(ro(s),i=wa(i,s,u),i!==null?i.sibling:null);ro(s);break;case 19:var b=(i.flags&128)!==0;if(p=(u&s.childLanes)!==0,p||(hl(i,s,u,!1),p=(u&s.childLanes)!==0),b){if(p)return C1(i,s,u);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),I(Un,Un.current),p)break;return null;case 22:return s.lanes=0,g1(i,s,u,s.pendingProps);case 24:Ja(s,$n,i.memoizedState.cache)}return wa(i,s,u)}function T1(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)Wn=!0;else{if(!qg(i,u)&&(s.flags&128)===0)return Wn=!1,II(i,s,u);Wn=(i.flags&131072)!==0}else Wn=!1,tn&&(s.flags&1048576)!==0&&rS(s,Gc,s.index);switch(s.lanes=0,s.tag){case 16:e:{var p=s.pendingProps;if(i=fs(s.elementType),s.type=i,typeof i=="function")Gm(i)?(p=gs(i,p),s.tag=1,s=x1(null,s,i,p,u)):(s.tag=0,s=_g(null,s,i,p,u));else{if(i!=null){var b=i.$$typeof;if(b===M){s.tag=11,s=h1(null,s,i,p,u);break e}else if(b===A){s.tag=14,s=p1(null,s,i,p,u);break e}}throw s=$(i)||i,Error(r(306,s,""))}}return s;case 0:return _g(i,s,s.type,s.pendingProps,u);case 1:return p=s.type,b=gs(p,s.pendingProps),x1(i,s,p,b,u);case 3:e:{if(pe(s,s.stateNode.containerInfo),i===null)throw Error(r(387));p=s.pendingProps;var x=s.memoizedState;b=x.element,ug(i,s),ru(s,p,null,u);var N=s.memoizedState;if(p=N.cache,Ja(s,$n,p),p!==x.cache&&ig(s,[$n],u,!0),nu(),p=N.element,x.isDehydrated)if(x={element:p,isDehydrated:!1,cache:N.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=w1(i,s,p,u);break e}else if(p!==b){b=li(Error(r(424)),s),Xc(b),s=w1(i,s,p,u);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Tn=hi(i.firstChild),cr=s,tn=!0,Qa=null,di=!0,u=gS(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(ls(),p===b){s=wa(i,s,u);break e}dr(i,s,p,u)}s=s.child}return s;case 26:return _f(i,s),i===null?(u=jE(s.type,null,s.pendingProps,null))?s.memoizedState=u:tn||(u=s.type,i=s.pendingProps,p=eh(te.current).createElement(u),p[We]=s,p[Xe]=i,fr(p,u,i),Mn(p),s.stateNode=p):s.memoizedState=jE(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Me(s),i===null&&tn&&(p=s.stateNode=IE(s.type,s.pendingProps,te.current),cr=s,di=!0,b=Tn,ho(s.type)?(Ey=b,Tn=hi(p.firstChild)):Tn=b),dr(i,s,s.pendingProps.children,u),_f(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&tn&&((b=p=Tn)&&(p=cP(p,s.type,s.pendingProps,di),p!==null?(s.stateNode=p,cr=s,Tn=hi(p.firstChild),di=!1,b=!0):b=!1),b||Za(s)),Me(s),b=s.type,x=s.pendingProps,N=i!==null?i.memoizedProps:null,p=x.children,by(b,x)?p=null:N!==null&&by(b,N)&&(s.flags|=32),s.memoizedState!==null&&(b=yg(i,s,CI,null,null,u),Eu._currentValue=b),_f(i,s),dr(i,s,p,u),s.child;case 6:return i===null&&tn&&((i=u=Tn)&&(u=uP(u,s.pendingProps,di),u!==null?(s.stateNode=u,cr=s,Tn=null,i=!0):i=!1),i||Za(s)),null;case 13:return S1(i,s,u);case 4:return pe(s,s.stateNode.containerInfo),p=s.pendingProps,i===null?s.child=ps(s,null,p,u):dr(i,s,p,u),s.child;case 11:return h1(i,s,s.type,s.pendingProps,u);case 7:return dr(i,s,s.pendingProps,u),s.child;case 8:return dr(i,s,s.pendingProps.children,u),s.child;case 12:return dr(i,s,s.pendingProps.children,u),s.child;case 10:return p=s.pendingProps,Ja(s,s.type,p.value),dr(i,s,p.children,u),s.child;case 9:return b=s.type._context,p=s.pendingProps.children,us(s),b=ur(b),p=p(b),s.flags|=1,dr(i,s,p,u),s.child;case 14:return p1(i,s,s.type,s.pendingProps,u);case 15:return m1(i,s,s.type,s.pendingProps,u);case 19:return C1(i,s,u);case 31:return DI(i,s,u);case 22:return g1(i,s,u,s.pendingProps);case 24:return us(s),p=ur($n),i===null?(b=sg(),b===null&&(b=vn,x=ag(),b.pooledCache=x,x.refCount++,x!==null&&(b.pooledCacheLanes|=u),b=x),s.memoizedState={parent:p,cache:b},cg(s),Ja(s,$n,b)):((i.lanes&u)!==0&&(ug(i,s),ru(s,null,null,u),nu()),b=i.memoizedState,x=s.memoizedState,b.parent!==p?(b={parent:p,cache:p},s.memoizedState=b,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=b),Ja(s,$n,p)):(p=x.cache,Ja(s,$n,p),p!==b.cache&&ig(s,[$n],u,!0))),dr(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Sa(i){i.flags|=4}function $g(i,s,u,p,b){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(b&335544128)===b)if(i.stateNode.complete)i.flags|=8192;else if(Z1())i.flags|=8192;else throw hs=Sf,lg}else i.flags&=-16777217}function R1(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!HE(s))if(Z1())i.flags|=8192;else throw hs=Sf,lg}function Ff(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Tt():536870912,i.lanes|=s,Tl|=s)}function cu(i,s){if(!tn)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function Rn(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,p=0;if(s)for(var b=i.child;b!==null;)u|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=i,b=b.sibling;else for(b=i.child;b!==null;)u|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=i,b=b.sibling;return i.subtreeFlags|=p,i.childLanes=u,s}function PI(i,s,u){var p=s.pendingProps;switch(Jm(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rn(s),null;case 1:return Rn(s),null;case 3:return u=s.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),ba($n),we(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(fl(s)?Sa(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,tg())),Rn(s),null;case 26:var b=s.type,x=s.memoizedState;return i===null?(Sa(s),x!==null?(Rn(s),R1(s,x)):(Rn(s),$g(s,b,null,p,u))):x?x!==i.memoizedState?(Sa(s),Rn(s),R1(s,x)):(Rn(s),s.flags&=-16777217):(i=i.memoizedProps,i!==p&&Sa(s),Rn(s),$g(s,b,i,p,u)),null;case 27:if(Pe(s),u=te.current,b=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Sa(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Rn(s),null}i=Q.current,fl(s)?aS(s):(i=IE(b,p,u),s.stateNode=i,Sa(s))}return Rn(s),null;case 5:if(Pe(s),b=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Sa(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Rn(s),null}if(x=Q.current,fl(s))aS(s);else{var N=eh(te.current);switch(x){case 1:x=N.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:x=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":x=N.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":x=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":x=N.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof p.is=="string"?N.createElement("select",{is:p.is}):N.createElement("select"),p.multiple?x.multiple=!0:p.size&&(x.size=p.size);break;default:x=typeof p.is=="string"?N.createElement(b,{is:p.is}):N.createElement(b)}}x[We]=s,x[Xe]=p;e:for(N=s.child;N!==null;){if(N.tag===5||N.tag===6)x.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===s)break e;for(;N.sibling===null;){if(N.return===null||N.return===s)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}s.stateNode=x;e:switch(fr(x,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Sa(s)}}return Rn(s),$g(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==p&&Sa(s);else{if(typeof p!="string"&&s.stateNode===null)throw Error(r(166));if(i=te.current,fl(s)){if(i=s.stateNode,u=s.memoizedProps,p=null,b=cr,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}i[We]=s,i=!!(i.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||SE(i.nodeValue,u)),i||Za(s,!0)}else i=eh(i).createTextNode(p),i[We]=s,s.stateNode=i}return Rn(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(p=fl(s),u!==null){if(i===null){if(!p)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[We]=s}else ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Rn(s),i=!1}else u=tg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(Kr(s),s):(Kr(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Rn(s),null;case 13:if(p=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=fl(s),p!==null&&p.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[We]=s}else ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Rn(s),b=!1}else b=tg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(Kr(s),s):(Kr(s),null)}return Kr(s),(s.flags&128)!==0?(s.lanes=u,s):(u=p!==null,i=i!==null&&i.memoizedState!==null,u&&(p=s.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),x=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(x=p.memoizedState.cachePool.pool),x!==b&&(p.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),Ff(s,s.updateQueue),Rn(s),null);case 4:return we(),i===null&&hy(s.stateNode.containerInfo),Rn(s),null;case 10:return ba(s.type),Rn(s),null;case 19:if(G(Un),p=s.memoizedState,p===null)return Rn(s),null;if(b=(s.flags&128)!==0,x=p.rendering,x===null)if(b)cu(p,!1);else{if(jn!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(x=Rf(i),x!==null){for(s.flags|=128,cu(p,!1),i=x.updateQueue,s.updateQueue=i,Ff(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)eS(u,i),u=u.sibling;return I(Un,Un.current&1|2),tn&&ga(s,p.treeForkCount),s.child}i=i.sibling}p.tail!==null&&De()>qf&&(s.flags|=128,b=!0,cu(p,!1),s.lanes=4194304)}else{if(!b)if(i=Rf(x),i!==null){if(s.flags|=128,b=!0,i=i.updateQueue,s.updateQueue=i,Ff(s,i),cu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!x.alternate&&!tn)return Rn(s),null}else 2*De()-p.renderingStartTime>qf&&u!==536870912&&(s.flags|=128,b=!0,cu(p,!1),s.lanes=4194304);p.isBackwards?(x.sibling=s.child,s.child=x):(i=p.last,i!==null?i.sibling=x:s.child=x,p.last=x)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=De(),i.sibling=null,u=Un.current,I(Un,b?u&1|2:u&1),tn&&ga(s,p.treeForkCount),i):(Rn(s),null);case 22:case 23:return Kr(s),pg(),p=s.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(u&536870912)!==0&&(s.flags&128)===0&&(Rn(s),s.subtreeFlags&6&&(s.flags|=8192)):Rn(s),u=s.updateQueue,u!==null&&Ff(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==u&&(s.flags|=2048),i!==null&&G(ds),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),ba($n),Rn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function LI(i,s){switch(Jm(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return ba($n),we(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return Pe(s),null;case 31:if(s.memoizedState!==null){if(Kr(s),s.alternate===null)throw Error(r(340));ls()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(Kr(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));ls()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return G(Un),null;case 4:return we(),null;case 10:return ba(s.type),null;case 22:case 23:return Kr(s),pg(),i!==null&&G(ds),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return ba($n),null;case 25:return null;default:return null}}function k1(i,s){switch(Jm(s),s.tag){case 3:ba($n),we();break;case 26:case 27:case 5:Pe(s);break;case 4:we();break;case 31:s.memoizedState!==null&&Kr(s);break;case 13:Kr(s);break;case 19:G(Un);break;case 10:ba(s.type);break;case 22:case 23:Kr(s),pg(),i!==null&&G(ds);break;case 24:ba($n)}}function uu(i,s){try{var u=s.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var b=p.next;u=b;do{if((u.tag&i)===i){p=void 0;var x=u.create,N=u.inst;p=x(),N.destroy=p}u=u.next}while(u!==b)}}catch(Y){pn(s,s.return,Y)}}function ao(i,s,u){try{var p=s.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var x=b.next;p=x;do{if((p.tag&i)===i){var N=p.inst,Y=N.destroy;if(Y!==void 0){N.destroy=void 0,b=s;var re=u,ge=Y;try{ge()}catch(ke){pn(b,re,ke)}}}p=p.next}while(p!==x)}}catch(ke){pn(s,s.return,ke)}}function M1(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{bS(s,u)}catch(p){pn(i,i.return,p)}}}function O1(i,s,u){u.props=gs(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(p){pn(i,s,p)}}function du(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var p=i.stateNode;break;case 30:p=i.stateNode;break;default:p=i.stateNode}typeof u=="function"?i.refCleanup=u(p):u.current=p}}catch(b){pn(i,s,b)}}function qi(i,s){var u=i.ref,p=i.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(b){pn(i,s,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){pn(i,s,b)}else u.current=null}function A1(i){var s=i.type,u=i.memoizedProps,p=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(b){pn(i,i.return,b)}}function Yg(i,s,u){try{var p=i.stateNode;rP(p,i.type,u,s),p[Xe]=s}catch(b){pn(i,i.return,b)}}function N1(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ho(i.type)||i.tag===4}function Wg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||N1(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ho(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Kg(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=ha));else if(p!==4&&(p===27&&ho(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(Kg(i,s,u),i=i.sibling;i!==null;)Kg(i,s,u),i=i.sibling}function Bf(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(p!==4&&(p===27&&ho(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(Bf(i,s,u),i=i.sibling;i!==null;)Bf(i,s,u),i=i.sibling}function D1(i){var s=i.stateNode,u=i.memoizedProps;try{for(var p=i.type,b=s.attributes;b.length;)s.removeAttributeNode(b[0]);fr(s,p,u),s[We]=i,s[Xe]=u}catch(x){pn(i,i.return,x)}}var Ea=!1,Kn=!1,Gg=!1,I1=typeof WeakSet=="function"?WeakSet:Set,ir=null;function jI(i,s){if(i=i.containerInfo,gy=sh,i=$0(i),Um(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var b=p.anchorOffset,x=p.focusNode;p=p.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var N=0,Y=-1,re=-1,ge=0,ke=0,Ie=i,be=null;t:for(;;){for(var xe;Ie!==u||b!==0&&Ie.nodeType!==3||(Y=N+b),Ie!==x||p!==0&&Ie.nodeType!==3||(re=N+p),Ie.nodeType===3&&(N+=Ie.nodeValue.length),(xe=Ie.firstChild)!==null;)be=Ie,Ie=xe;for(;;){if(Ie===i)break t;if(be===u&&++ge===b&&(Y=N),be===x&&++ke===p&&(re=N),(xe=Ie.nextSibling)!==null)break;Ie=be,be=Ie.parentNode}Ie=xe}u=Y===-1||re===-1?null:{start:Y,end:re}}else u=null}u=u||{start:0,end:0}}else u=null;for(yy={focusedElem:i,selectionRange:u},sh=!1,ir=s;ir!==null;)if(s=ir,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,ir=i;else for(;ir!==null;){switch(s=ir,x=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)b=i[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&x!==null){i=void 0,u=s,b=x.memoizedProps,x=x.memoizedState,p=u.stateNode;try{var ot=gs(u.type,b);i=p.getSnapshotBeforeUpdate(ot,x),p.__reactInternalSnapshotBeforeUpdate=i}catch(xt){pn(u,u.return,xt)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)xy(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":xy(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,ir=i;break}ir=s.return}}function P1(i,s,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:Ta(i,u),p&4&&uu(5,u);break;case 1:if(Ta(i,u),p&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(N){pn(u,u.return,N)}else{var b=gs(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(b,s,i.__reactInternalSnapshotBeforeUpdate)}catch(N){pn(u,u.return,N)}}p&64&&M1(u),p&512&&du(u,u.return);break;case 3:if(Ta(i,u),p&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{bS(i,s)}catch(N){pn(u,u.return,N)}}break;case 27:s===null&&p&4&&D1(u);case 26:case 5:Ta(i,u),s===null&&p&4&&A1(u),p&512&&du(u,u.return);break;case 12:Ta(i,u);break;case 31:Ta(i,u),p&4&&_1(i,u);break;case 13:Ta(i,u),p&4&&z1(i,u),p&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=$I.bind(null,u),dP(i,u))));break;case 22:if(p=u.memoizedState!==null||Ea,!p){s=s!==null&&s.memoizedState!==null||Kn,b=Ea;var x=Kn;Ea=p,(Kn=s)&&!x?Ra(i,u,(u.subtreeFlags&8772)!==0):Ta(i,u),Ea=b,Kn=x}break;case 30:break;default:Ta(i,u)}}function L1(i){var s=i.alternate;s!==null&&(i.alternate=null,L1(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&In(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var On=null,Nr=!1;function Ca(i,s,u){for(u=u.child;u!==null;)j1(i,s,u),u=u.sibling}function j1(i,s,u){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(et,u)}catch{}switch(u.tag){case 26:Kn||qi(u,s),Ca(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Kn||qi(u,s);var p=On,b=Nr;ho(u.type)&&(On=u.stateNode,Nr=!1),Ca(i,s,u),xu(u.stateNode),On=p,Nr=b;break;case 5:Kn||qi(u,s);case 6:if(p=On,b=Nr,On=null,Ca(i,s,u),On=p,Nr=b,On!==null)if(Nr)try{(On.nodeType===9?On.body:On.nodeName==="HTML"?On.ownerDocument.body:On).removeChild(u.stateNode)}catch(x){pn(u,s,x)}else try{On.removeChild(u.stateNode)}catch(x){pn(u,s,x)}break;case 18:On!==null&&(Nr?(i=On,ME(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Il(i)):ME(On,u.stateNode));break;case 4:p=On,b=Nr,On=u.stateNode.containerInfo,Nr=!0,Ca(i,s,u),On=p,Nr=b;break;case 0:case 11:case 14:case 15:ao(2,u,s),Kn||ao(4,u,s),Ca(i,s,u);break;case 1:Kn||(qi(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"&&O1(u,s,p)),Ca(i,s,u);break;case 21:Ca(i,s,u);break;case 22:Kn=(p=Kn)||u.memoizedState!==null,Ca(i,s,u),Kn=p;break;default:Ca(i,s,u)}}function _1(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Il(i)}catch(u){pn(s,s.return,u)}}}function z1(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Il(i)}catch(u){pn(s,s.return,u)}}function _I(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new I1),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new I1),s;default:throw Error(r(435,i.tag))}}function Hf(i,s){var u=_I(i);s.forEach(function(p){if(!u.has(p)){u.add(p);var b=YI.bind(null,i,p);p.then(b,b)}})}function Dr(i,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var b=u[p],x=i,N=s,Y=N;e:for(;Y!==null;){switch(Y.tag){case 27:if(ho(Y.type)){On=Y.stateNode,Nr=!1;break e}break;case 5:On=Y.stateNode,Nr=!1;break e;case 3:case 4:On=Y.stateNode.containerInfo,Nr=!0;break e}Y=Y.return}if(On===null)throw Error(r(160));j1(x,N,b),On=null,Nr=!1,x=b.alternate,x!==null&&(x.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)F1(s,i),s=s.sibling}var Ai=null;function F1(i,s){var u=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Dr(s,i),Ir(i),p&4&&(ao(3,i,i.return),uu(3,i),ao(5,i,i.return));break;case 1:Dr(s,i),Ir(i),p&512&&(Kn||u===null||qi(u,u.return)),p&64&&Ea&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var b=Ai;if(Dr(s,i),Ir(i),p&512&&(Kn||u===null||qi(u,u.return)),p&4){var x=u!==null?u.memoizedState:null;if(p=i.memoizedState,u===null)if(p===null)if(i.stateNode===null){e:{p=i.type,u=i.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":x=b.getElementsByTagName("title")[0],(!x||x[An]||x[We]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=b.createElement(p),b.head.insertBefore(x,b.querySelector("head > title"))),fr(x,p,u),x[We]=i,Mn(x),p=x;break e;case"link":var N=FE("link","href",b).get(p+(u.href||""));if(N){for(var Y=0;Y<N.length;Y++)if(x=N[Y],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){N.splice(Y,1);break t}}x=b.createElement(p),fr(x,p,u),b.head.appendChild(x);break;case"meta":if(N=FE("meta","content",b).get(p+(u.content||""))){for(Y=0;Y<N.length;Y++)if(x=N[Y],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){N.splice(Y,1);break t}}x=b.createElement(p),fr(x,p,u),b.head.appendChild(x);break;default:throw Error(r(468,p))}x[We]=i,Mn(x),p=x}i.stateNode=p}else BE(b,i.type,i.stateNode);else i.stateNode=zE(b,p,i.memoizedProps);else x!==p?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,p===null?BE(b,i.type,i.stateNode):zE(b,p,i.memoizedProps)):p===null&&i.stateNode!==null&&Yg(i,i.memoizedProps,u.memoizedProps)}break;case 27:Dr(s,i),Ir(i),p&512&&(Kn||u===null||qi(u,u.return)),u!==null&&p&4&&Yg(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Dr(s,i),Ir(i),p&512&&(Kn||u===null||qi(u,u.return)),i.flags&32){b=i.stateNode;try{nl(b,"")}catch(ot){pn(i,i.return,ot)}}p&4&&i.stateNode!=null&&(b=i.memoizedProps,Yg(i,b,u!==null?u.memoizedProps:b)),p&1024&&(Gg=!0);break;case 6:if(Dr(s,i),Ir(i),p&4){if(i.stateNode===null)throw Error(r(162));p=i.memoizedProps,u=i.stateNode;try{u.nodeValue=p}catch(ot){pn(i,i.return,ot)}}break;case 3:if(rh=null,b=Ai,Ai=th(s.containerInfo),Dr(s,i),Ai=b,Ir(i),p&4&&u!==null&&u.memoizedState.isDehydrated)try{Il(s.containerInfo)}catch(ot){pn(i,i.return,ot)}Gg&&(Gg=!1,B1(i));break;case 4:p=Ai,Ai=th(i.stateNode.containerInfo),Dr(s,i),Ir(i),Ai=p;break;case 12:Dr(s,i),Ir(i);break;case 31:Dr(s,i),Ir(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Hf(i,p)));break;case 13:Dr(s,i),Ir(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Vf=De()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Hf(i,p)));break;case 22:b=i.memoizedState!==null;var re=u!==null&&u.memoizedState!==null,ge=Ea,ke=Kn;if(Ea=ge||b,Kn=ke||re,Dr(s,i),Kn=ke,Ea=ge,Ir(i),p&8192)e:for(s=i.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(u===null||re||Ea||Kn||ys(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){re=u=s;try{if(x=re.stateNode,b)N=x.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{Y=re.stateNode;var Ie=re.memoizedProps.style,be=Ie!=null&&Ie.hasOwnProperty("display")?Ie.display:null;Y.style.display=be==null||typeof be=="boolean"?"":(""+be).trim()}}catch(ot){pn(re,re.return,ot)}}}else if(s.tag===6){if(u===null){re=s;try{re.stateNode.nodeValue=b?"":re.memoizedProps}catch(ot){pn(re,re.return,ot)}}}else if(s.tag===18){if(u===null){re=s;try{var xe=re.stateNode;b?OE(xe,!0):OE(re.stateNode,!1)}catch(ot){pn(re,re.return,ot)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}p&4&&(p=i.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Hf(i,u))));break;case 19:Dr(s,i),Ir(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Hf(i,p)));break;case 30:break;case 21:break;default:Dr(s,i),Ir(i)}}function Ir(i){var s=i.flags;if(s&2){try{for(var u,p=i.return;p!==null;){if(N1(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,x=Wg(i);Bf(i,x,b);break;case 5:var N=u.stateNode;u.flags&32&&(nl(N,""),u.flags&=-33);var Y=Wg(i);Bf(i,Y,N);break;case 3:case 4:var re=u.stateNode.containerInfo,ge=Wg(i);Kg(i,ge,re);break;default:throw Error(r(161))}}catch(ke){pn(i,i.return,ke)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function B1(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;B1(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Ta(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)P1(i,s.alternate,s),s=s.sibling}function ys(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:ao(4,s,s.return),ys(s);break;case 1:qi(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&O1(s,s.return,u),ys(s);break;case 27:xu(s.stateNode);case 26:case 5:qi(s,s.return),ys(s);break;case 22:s.memoizedState===null&&ys(s);break;case 30:ys(s);break;default:ys(s)}i=i.sibling}}function Ra(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var p=s.alternate,b=i,x=s,N=x.flags;switch(x.tag){case 0:case 11:case 15:Ra(b,x,u),uu(4,x);break;case 1:if(Ra(b,x,u),p=x,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ge){pn(p,p.return,ge)}if(p=x,b=p.updateQueue,b!==null){var Y=p.stateNode;try{var re=b.shared.hiddenCallbacks;if(re!==null)for(b.shared.hiddenCallbacks=null,b=0;b<re.length;b++)yS(re[b],Y)}catch(ge){pn(p,p.return,ge)}}u&&N&64&&M1(x),du(x,x.return);break;case 27:D1(x);case 26:case 5:Ra(b,x,u),u&&p===null&&N&4&&A1(x),du(x,x.return);break;case 12:Ra(b,x,u);break;case 31:Ra(b,x,u),u&&N&4&&_1(b,x);break;case 13:Ra(b,x,u),u&&N&4&&z1(b,x);break;case 22:x.memoizedState===null&&Ra(b,x,u),du(x,x.return);break;case 30:break;default:Ra(b,x,u)}s=s.sibling}}function Xg(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&Qc(u))}function Qg(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Qc(i))}function Ni(i,s,u,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)H1(i,s,u,p),s=s.sibling}function H1(i,s,u,p){var b=s.flags;switch(s.tag){case 0:case 11:case 15:Ni(i,s,u,p),b&2048&&uu(9,s);break;case 1:Ni(i,s,u,p);break;case 3:Ni(i,s,u,p),b&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Qc(i)));break;case 12:if(b&2048){Ni(i,s,u,p),i=s.stateNode;try{var x=s.memoizedProps,N=x.id,Y=x.onPostCommit;typeof Y=="function"&&Y(N,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(re){pn(s,s.return,re)}}else Ni(i,s,u,p);break;case 31:Ni(i,s,u,p);break;case 13:Ni(i,s,u,p);break;case 23:break;case 22:x=s.stateNode,N=s.alternate,s.memoizedState!==null?x._visibility&2?Ni(i,s,u,p):fu(i,s):x._visibility&2?Ni(i,s,u,p):(x._visibility|=2,Sl(i,s,u,p,(s.subtreeFlags&10256)!==0||!1)),b&2048&&Xg(N,s);break;case 24:Ni(i,s,u,p),b&2048&&Qg(s.alternate,s);break;default:Ni(i,s,u,p)}}function Sl(i,s,u,p,b){for(b=b&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=i,N=s,Y=u,re=p,ge=N.flags;switch(N.tag){case 0:case 11:case 15:Sl(x,N,Y,re,b),uu(8,N);break;case 23:break;case 22:var ke=N.stateNode;N.memoizedState!==null?ke._visibility&2?Sl(x,N,Y,re,b):fu(x,N):(ke._visibility|=2,Sl(x,N,Y,re,b)),b&&ge&2048&&Xg(N.alternate,N);break;case 24:Sl(x,N,Y,re,b),b&&ge&2048&&Qg(N.alternate,N);break;default:Sl(x,N,Y,re,b)}s=s.sibling}}function fu(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,p=s,b=p.flags;switch(p.tag){case 22:fu(u,p),b&2048&&Xg(p.alternate,p);break;case 24:fu(u,p),b&2048&&Qg(p.alternate,p);break;default:fu(u,p)}s=s.sibling}}var hu=8192;function El(i,s,u){if(i.subtreeFlags&hu)for(i=i.child;i!==null;)U1(i,s,u),i=i.sibling}function U1(i,s,u){switch(i.tag){case 26:El(i,s,u),i.flags&hu&&i.memoizedState!==null&&EP(u,Ai,i.memoizedState,i.memoizedProps);break;case 5:El(i,s,u);break;case 3:case 4:var p=Ai;Ai=th(i.stateNode.containerInfo),El(i,s,u),Ai=p;break;case 22:i.memoizedState===null&&(p=i.alternate,p!==null&&p.memoizedState!==null?(p=hu,hu=16777216,El(i,s,u),hu=p):El(i,s,u));break;default:El(i,s,u)}}function V1(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function pu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];ir=p,$1(p,i)}V1(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)q1(i),i=i.sibling}function q1(i){switch(i.tag){case 0:case 11:case 15:pu(i),i.flags&2048&&ao(9,i,i.return);break;case 3:pu(i);break;case 12:pu(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Uf(i)):pu(i);break;default:pu(i)}}function Uf(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];ir=p,$1(p,i)}V1(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:ao(8,s,s.return),Uf(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Uf(s));break;default:Uf(s)}i=i.sibling}}function $1(i,s){for(;ir!==null;){var u=ir;switch(u.tag){case 0:case 11:case 15:ao(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Qc(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,ir=p;else e:for(u=i;ir!==null;){p=ir;var b=p.sibling,x=p.return;if(L1(p),p===u){ir=null;break e}if(b!==null){b.return=x,ir=b;break e}ir=x}}}var zI={getCacheForType:function(i){var s=ur($n),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return ur($n).controller.signal}},FI=typeof WeakMap=="function"?WeakMap:Map,dn=0,vn=null,Yt=null,Gt=0,hn=0,Gr=null,oo=!1,Cl=!1,Zg=!1,ka=0,jn=0,so=0,bs=0,Jg=0,Xr=0,Tl=0,mu=null,Pr=null,ey=!1,Vf=0,Y1=0,qf=1/0,$f=null,lo=null,Qn=0,co=null,Rl=null,Ma=0,ty=0,ny=null,W1=null,gu=0,ry=null;function Qr(){return(dn&2)!==0&&Gt!==0?Gt&-Gt:_.T!==null?cy():_e()}function K1(){if(Xr===0)if((Gt&536870912)===0||tn){var i=it;it<<=1,(it&3932160)===0&&(it=262144),Xr=i}else Xr=536870912;return i=Wr.current,i!==null&&(i.flags|=32),Xr}function Lr(i,s,u){(i===vn&&(hn===2||hn===9)||i.cancelPendingCommit!==null)&&(kl(i,0),uo(i,Gt,Xr,!1)),Ht(i,u),((dn&2)===0||i!==vn)&&(i===vn&&((dn&2)===0&&(bs|=u),jn===4&&uo(i,Gt,Xr,!1)),$i(i))}function G1(i,s,u){if((dn&6)!==0)throw Error(r(327));var p=!u&&(s&127)===0&&(s&i.expiredLanes)===0||Rt(i,s),b=p?UI(i,s):ay(i,s,!0),x=p;do{if(b===0){Cl&&!p&&uo(i,s,0,!1);break}else{if(u=i.current.alternate,x&&!BI(u)){b=ay(i,s,!1),x=!1;continue}if(b===2){if(x=s,i.errorRecoveryDisabledLanes&x)var N=0;else N=i.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){s=N;e:{var Y=i;b=mu;var re=Y.current.memoizedState.isDehydrated;if(re&&(kl(Y,N).flags|=256),N=ay(Y,N,!1),N!==2){if(Zg&&!re){Y.errorRecoveryDisabledLanes|=x,bs|=x,b=4;break e}x=Pr,Pr=b,x!==null&&(Pr===null?Pr=x:Pr.push.apply(Pr,x))}b=N}if(x=!1,b!==2)continue}}if(b===1){kl(i,0),uo(i,s,0,!0);break}e:{switch(p=i,x=b,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:uo(p,s,Xr,!oo);break e;case 2:Pr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(b=Vf+300-De(),10<b)){if(uo(p,s,Xr,!oo),Ke(p,0,!0)!==0)break e;Ma=s,p.timeoutHandle=RE(X1.bind(null,p,u,Pr,$f,ey,s,Xr,bs,Tl,oo,x,"Throttled",-0,0),b);break e}X1(p,u,Pr,$f,ey,s,Xr,bs,Tl,oo,x,null,-0,0)}}break}while(!0);$i(i)}function X1(i,s,u,p,b,x,N,Y,re,ge,ke,Ie,be,xe){if(i.timeoutHandle=-1,Ie=s.subtreeFlags,Ie&8192||(Ie&16785408)===16785408){Ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ha},U1(s,x,Ie);var ot=(x&62914560)===x?Vf-De():(x&4194048)===x?Y1-De():0;if(ot=CP(Ie,ot),ot!==null){Ma=x,i.cancelPendingCommit=ot(iE.bind(null,i,s,x,u,p,b,N,Y,re,ke,Ie,null,be,xe)),uo(i,x,N,!ge);return}}iE(i,s,x,u,p,b,N,Y,re)}function BI(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var b=u[p],x=b.getSnapshot;b=b.value;try{if(!$r(x(),b))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function uo(i,s,u,p){s&=~Jg,s&=~bs,i.suspendedLanes|=s,i.pingedLanes&=~s,p&&(i.warmLanes|=s),p=i.expirationTimes;for(var b=s;0<b;){var x=31-tt(b),N=1<<x;p[x]=-1,b&=~N}u!==0&&kt(i,u,s)}function Yf(){return(dn&6)===0?(yu(0),!1):!0}function iy(){if(Yt!==null){if(hn===0)var i=Yt.return;else i=Yt,ya=cs=null,xg(i),yl=null,Jc=0,i=Yt;for(;i!==null;)k1(i.alternate,i),i=i.return;Yt=null}}function kl(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,oP(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),Ma=0,iy(),vn=i,Yt=u=ma(i.current,null),Gt=s,hn=0,Gr=null,oo=!1,Cl=Rt(i,s),Zg=!1,Tl=Xr=Jg=bs=so=jn=0,Pr=mu=null,ey=!1,(s&8)!==0&&(s|=s&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=s;0<p;){var b=31-tt(p),x=1<<b;s|=i[b],p&=~x}return ka=s,hf(),u}function Q1(i,s){_t=null,_.H=su,s===gl||s===wf?(s=hS(),hn=3):s===lg?(s=hS(),hn=4):hn=s===jg?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Gr=s,Yt===null&&(jn=1,Lf(i,li(s,i.current)))}function Z1(){var i=Wr.current;return i===null?!0:(Gt&4194048)===Gt?fi===null:(Gt&62914560)===Gt||(Gt&536870912)!==0?i===fi:!1}function J1(){var i=_.H;return _.H=su,i===null?su:i}function eE(){var i=_.A;return _.A=zI,i}function Wf(){jn=4,oo||(Gt&4194048)!==Gt&&Wr.current!==null||(Cl=!0),(so&134217727)===0&&(bs&134217727)===0||vn===null||uo(vn,Gt,Xr,!1)}function ay(i,s,u){var p=dn;dn|=2;var b=J1(),x=eE();(vn!==i||Gt!==s)&&($f=null,kl(i,s)),s=!1;var N=jn;e:do try{if(hn!==0&&Yt!==null){var Y=Yt,re=Gr;switch(hn){case 8:iy(),N=6;break e;case 3:case 2:case 9:case 6:Wr.current===null&&(s=!0);var ge=hn;if(hn=0,Gr=null,Ml(i,Y,re,ge),u&&Cl){N=0;break e}break;default:ge=hn,hn=0,Gr=null,Ml(i,Y,re,ge)}}HI(),N=jn;break}catch(ke){Q1(i,ke)}while(!0);return s&&i.shellSuspendCounter++,ya=cs=null,dn=p,_.H=b,_.A=x,Yt===null&&(vn=null,Gt=0,hf()),N}function HI(){for(;Yt!==null;)tE(Yt)}function UI(i,s){var u=dn;dn|=2;var p=J1(),b=eE();vn!==i||Gt!==s?($f=null,qf=De()+500,kl(i,s)):Cl=Rt(i,s);e:do try{if(hn!==0&&Yt!==null){s=Yt;var x=Gr;t:switch(hn){case 1:hn=0,Gr=null,Ml(i,s,x,1);break;case 2:case 9:if(dS(x)){hn=0,Gr=null,nE(s);break}s=function(){hn!==2&&hn!==9||vn!==i||(hn=7),$i(i)},x.then(s,s);break e;case 3:hn=7;break e;case 4:hn=5;break e;case 7:dS(x)?(hn=0,Gr=null,nE(s)):(hn=0,Gr=null,Ml(i,s,x,7));break;case 5:var N=null;switch(Yt.tag){case 26:N=Yt.memoizedState;case 5:case 27:var Y=Yt;if(N?HE(N):Y.stateNode.complete){hn=0,Gr=null;var re=Y.sibling;if(re!==null)Yt=re;else{var ge=Y.return;ge!==null?(Yt=ge,Kf(ge)):Yt=null}break t}}hn=0,Gr=null,Ml(i,s,x,5);break;case 6:hn=0,Gr=null,Ml(i,s,x,6);break;case 8:iy(),jn=6;break e;default:throw Error(r(462))}}VI();break}catch(ke){Q1(i,ke)}while(!0);return ya=cs=null,_.H=p,_.A=b,dn=u,Yt!==null?0:(vn=null,Gt=0,hf(),jn)}function VI(){for(;Yt!==null&&!Be();)tE(Yt)}function tE(i){var s=T1(i.alternate,i,ka);i.memoizedProps=i.pendingProps,s===null?Kf(i):Yt=s}function nE(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=v1(u,s,s.pendingProps,s.type,void 0,Gt);break;case 11:s=v1(u,s,s.pendingProps,s.type.render,s.ref,Gt);break;case 5:xg(s);default:k1(u,s),s=Yt=eS(s,ka),s=T1(u,s,ka)}i.memoizedProps=i.pendingProps,s===null?Kf(i):Yt=s}function Ml(i,s,u,p){ya=cs=null,xg(s),yl=null,Jc=0;var b=s.return;try{if(NI(i,b,s,u,Gt)){jn=1,Lf(i,li(u,i.current)),Yt=null;return}}catch(x){if(b!==null)throw Yt=b,x;jn=1,Lf(i,li(u,i.current)),Yt=null;return}s.flags&32768?(tn||p===1?i=!0:Cl||(Gt&536870912)!==0?i=!1:(oo=i=!0,(p===2||p===9||p===3||p===6)&&(p=Wr.current,p!==null&&p.tag===13&&(p.flags|=16384))),rE(s,i)):Kf(s)}function Kf(i){var s=i;do{if((s.flags&32768)!==0){rE(s,oo);return}i=s.return;var u=PI(s.alternate,s,ka);if(u!==null){Yt=u;return}if(s=s.sibling,s!==null){Yt=s;return}Yt=s=i}while(s!==null);jn===0&&(jn=5)}function rE(i,s){do{var u=LI(i.alternate,i);if(u!==null){u.flags&=32767,Yt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){Yt=i;return}Yt=i=u}while(i!==null);jn=6,Yt=null}function iE(i,s,u,p,b,x,N,Y,re){i.cancelPendingCommit=null;do Gf();while(Qn!==0);if((dn&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=Wm,Je(i,u,x,N,Y,re),i===vn&&(Yt=vn=null,Gt=0),Rl=s,co=i,Ma=u,ty=x,ny=b,W1=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,WI(ee,function(){return cE(),null})):(i.callbackNode=null,i.callbackPriority=0),p=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||p){p=_.T,_.T=null,b=z.p,z.p=2,N=dn,dn|=4;try{jI(i,s,u)}finally{dn=N,z.p=b,_.T=p}}Qn=1,aE(),oE(),sE()}}function aE(){if(Qn===1){Qn=0;var i=co,s=Rl,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=_.T,_.T=null;var p=z.p;z.p=2;var b=dn;dn|=4;try{F1(s,i);var x=yy,N=$0(i.containerInfo),Y=x.focusedElem,re=x.selectionRange;if(N!==Y&&Y&&Y.ownerDocument&&q0(Y.ownerDocument.documentElement,Y)){if(re!==null&&Um(Y)){var ge=re.start,ke=re.end;if(ke===void 0&&(ke=ge),"selectionStart"in Y)Y.selectionStart=ge,Y.selectionEnd=Math.min(ke,Y.value.length);else{var Ie=Y.ownerDocument||document,be=Ie&&Ie.defaultView||window;if(be.getSelection){var xe=be.getSelection(),ot=Y.textContent.length,xt=Math.min(re.start,ot),bn=re.end===void 0?xt:Math.min(re.end,ot);!xe.extend&&xt>bn&&(N=bn,bn=xt,xt=N);var ce=V0(Y,xt),oe=V0(Y,bn);if(ce&&oe&&(xe.rangeCount!==1||xe.anchorNode!==ce.node||xe.anchorOffset!==ce.offset||xe.focusNode!==oe.node||xe.focusOffset!==oe.offset)){var me=Ie.createRange();me.setStart(ce.node,ce.offset),xe.removeAllRanges(),xt>bn?(xe.addRange(me),xe.extend(oe.node,oe.offset)):(me.setEnd(oe.node,oe.offset),xe.addRange(me))}}}}for(Ie=[],xe=Y;xe=xe.parentNode;)xe.nodeType===1&&Ie.push({element:xe,left:xe.scrollLeft,top:xe.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y<Ie.length;Y++){var Ne=Ie[Y];Ne.element.scrollLeft=Ne.left,Ne.element.scrollTop=Ne.top}}sh=!!gy,yy=gy=null}finally{dn=b,z.p=p,_.T=u}}i.current=s,Qn=2}}function oE(){if(Qn===2){Qn=0;var i=co,s=Rl,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=_.T,_.T=null;var p=z.p;z.p=2;var b=dn;dn|=4;try{P1(i,s.alternate,s)}finally{dn=b,z.p=p,_.T=u}}Qn=3}}function sE(){if(Qn===4||Qn===3){Qn=0,qe();var i=co,s=Rl,u=Ma,p=W1;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Qn=5:(Qn=0,Rl=co=null,lE(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(lo=null),Re(u),s=s.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(et,s,void 0,(s.current.flags&128)===128)}catch{}if(p!==null){s=_.T,b=z.p,z.p=2,_.T=null;try{for(var x=i.onRecoverableError,N=0;N<p.length;N++){var Y=p[N];x(Y.value,{componentStack:Y.stack})}}finally{_.T=s,z.p=b}}(Ma&3)!==0&&Gf(),$i(i),b=i.pendingLanes,(u&261930)!==0&&(b&42)!==0?i===ry?gu++:(gu=0,ry=i):gu=0,yu(0)}}function lE(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,Qc(s)))}function Gf(){return aE(),oE(),sE(),cE()}function cE(){if(Qn!==5)return!1;var i=co,s=ty;ty=0;var u=Re(Ma),p=_.T,b=z.p;try{z.p=32>u?32:u,_.T=null,u=ny,ny=null;var x=co,N=Ma;if(Qn=0,Rl=co=null,Ma=0,(dn&6)!==0)throw Error(r(331));var Y=dn;if(dn|=4,q1(x.current),H1(x,x.current,N,u),dn=Y,yu(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(et,x)}catch{}return!0}finally{z.p=b,_.T=p,lE(i,s)}}function uE(i,s,u){s=li(u,s),s=Lg(i.stateNode,s,2),i=no(i,s,2),i!==null&&(Ht(i,2),$i(i))}function pn(i,s,u){if(i.tag===3)uE(i,i,u);else for(;s!==null;){if(s.tag===3){uE(s,i,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(lo===null||!lo.has(p))){i=li(u,i),u=d1(2),p=no(s,u,2),p!==null&&(f1(u,p,s,i),Ht(p,2),$i(p));break}}s=s.return}}function oy(i,s,u){var p=i.pingCache;if(p===null){p=i.pingCache=new FI;var b=new Set;p.set(s,b)}else b=p.get(s),b===void 0&&(b=new Set,p.set(s,b));b.has(u)||(Zg=!0,b.add(u),i=qI.bind(null,i,s,u),s.then(i,i))}function qI(i,s,u){var p=i.pingCache;p!==null&&p.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,vn===i&&(Gt&u)===u&&(jn===4||jn===3&&(Gt&62914560)===Gt&&300>De()-Vf?(dn&2)===0&&kl(i,0):Jg|=u,Tl===Gt&&(Tl=0)),$i(i)}function dE(i,s){s===0&&(s=Tt()),i=os(i,s),i!==null&&(Ht(i,s),$i(i))}function $I(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),dE(i,u)}function YI(i,s){var u=0;switch(i.tag){case 31:case 13:var p=i.stateNode,b=i.memoizedState;b!==null&&(u=b.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(s),dE(i,u)}function WI(i,s){return Se(i,s)}var Xf=null,Ol=null,sy=!1,Qf=!1,ly=!1,fo=0;function $i(i){i!==Ol&&i.next===null&&(Ol===null?Xf=Ol=i:Ol=Ol.next=i),Qf=!0,sy||(sy=!0,GI())}function yu(i,s){if(!ly&&Qf){ly=!0;do for(var u=!1,p=Xf;p!==null;){if(i!==0){var b=p.pendingLanes;if(b===0)var x=0;else{var N=p.suspendedLanes,Y=p.pingedLanes;x=(1<<31-tt(42|i)+1)-1,x&=b&~(N&~Y),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,mE(p,x))}else x=Gt,x=Ke(p,p===vn?x:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(x&3)===0||Rt(p,x)||(u=!0,mE(p,x));p=p.next}while(u);ly=!1}}function KI(){fE()}function fE(){Qf=sy=!1;var i=0;fo!==0&&aP()&&(i=fo);for(var s=De(),u=null,p=Xf;p!==null;){var b=p.next,x=hE(p,s);x===0?(p.next=null,u===null?Xf=b:u.next=b,b===null&&(Ol=u)):(u=p,(i!==0||(x&3)!==0)&&(Qf=!0)),p=b}Qn!==0&&Qn!==5||yu(i),fo!==0&&(fo=0)}function hE(i,s){for(var u=i.suspendedLanes,p=i.pingedLanes,b=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var N=31-tt(x),Y=1<<N,re=b[N];re===-1?((Y&u)===0||(Y&p)!==0)&&(b[N]=jt(Y,s)):re<=s&&(i.expiredLanes|=Y),x&=~Y}if(s=vn,u=Gt,u=Ke(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p=i.callbackNode,u===0||i===s&&(hn===2||hn===9)||i.cancelPendingCommit!==null)return p!==null&&p!==null&&ve(p),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Rt(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(p!==null&&ve(p),Re(u)){case 2:case 8:u=Ce;break;case 32:u=ee;break;case 268435456:u=Ae;break;default:u=ee}return p=pE.bind(null,i),u=Se(u,p),i.callbackPriority=s,i.callbackNode=u,s}return p!==null&&p!==null&&ve(p),i.callbackPriority=2,i.callbackNode=null,2}function pE(i,s){if(Qn!==0&&Qn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Gf()&&i.callbackNode!==u)return null;var p=Gt;return p=Ke(i,i===vn?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p===0?null:(G1(i,p,s),hE(i,De()),i.callbackNode!=null&&i.callbackNode===u?pE.bind(null,i):null)}function mE(i,s){if(Gf())return null;G1(i,s,!0)}function GI(){sP(function(){(dn&6)!==0?Se(he,KI):fE()})}function cy(){if(fo===0){var i=pl;i===0&&(i=Ot,Ot<<=1,(Ot&261888)===0&&(Ot=256)),fo=i}return fo}function gE(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:af(""+i)}function yE(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function XI(i,s,u,p,b){if(s==="submit"&&u&&u.stateNode===b){var x=gE((b[Xe]||null).action),N=p.submitter;N&&(s=(s=N[Xe]||null)?gE(s.formAction):N.getAttribute("formAction"),s!==null&&(x=s,N=null));var Y=new cf("action","action",null,p,b);i.push({event:Y,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(fo!==0){var re=N?yE(b,N):new FormData(b);Og(u,{pending:!0,data:re,method:b.method,action:x},null,re)}}else typeof x=="function"&&(Y.preventDefault(),re=N?yE(b,N):new FormData(b),Og(u,{pending:!0,data:re,method:b.method,action:x},x,re))},currentTarget:b}]})}}for(var uy=0;uy<Ym.length;uy++){var dy=Ym[uy],QI=dy.toLowerCase(),ZI=dy[0].toUpperCase()+dy.slice(1);Oi(QI,"on"+ZI)}Oi(K0,"onAnimationEnd"),Oi(G0,"onAnimationIteration"),Oi(X0,"onAnimationStart"),Oi("dblclick","onDoubleClick"),Oi("focusin","onFocus"),Oi("focusout","onBlur"),Oi(pI,"onTransitionRun"),Oi(mI,"onTransitionStart"),Oi(gI,"onTransitionCancel"),Oi(Q0,"onTransitionEnd"),ai("onMouseEnter",["mouseout","mouseover"]),ai("onMouseLeave",["mouseout","mouseover"]),ai("onPointerEnter",["pointerout","pointerover"]),ai("onPointerLeave",["pointerout","pointerover"]),ki("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ki("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ki("onBeforeInput",["compositionend","keypress","textInput","paste"]),ki("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ki("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ki("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bu="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(" "),JI=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bu));function bE(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var p=i[u],b=p.event;p=p.listeners;e:{var x=void 0;if(s)for(var N=p.length-1;0<=N;N--){var Y=p[N],re=Y.instance,ge=Y.currentTarget;if(Y=Y.listener,re!==x&&b.isPropagationStopped())break e;x=Y,b.currentTarget=ge;try{x(b)}catch(ke){ff(ke)}b.currentTarget=null,x=re}else for(N=0;N<p.length;N++){if(Y=p[N],re=Y.instance,ge=Y.currentTarget,Y=Y.listener,re!==x&&b.isPropagationStopped())break e;x=Y,b.currentTarget=ge;try{x(b)}catch(ke){ff(ke)}b.currentTarget=null,x=re}}}}function Wt(i,s){var u=s[St];u===void 0&&(u=s[St]=new Set);var p=i+"__bubble";u.has(p)||(vE(s,i,2,!1),u.add(p))}function fy(i,s,u){var p=0;s&&(p|=4),vE(u,i,p,s)}var Zf="_reactListening"+Math.random().toString(36).slice(2);function hy(i){if(!i[Zf]){i[Zf]=!0,Ri.forEach(function(u){u!=="selectionchange"&&(JI.has(u)||fy(u,!1,i),fy(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Zf]||(s[Zf]=!0,fy("selectionchange",!1,s))}}function vE(i,s,u,p){switch(KE(s)){case 2:var b=kP;break;case 8:b=MP;break;default:b=My}u=b.bind(null,s,u,i),b=void 0,!Im||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(b=!0),p?b!==void 0?i.addEventListener(s,u,{capture:!0,passive:b}):i.addEventListener(s,u,!0):b!==void 0?i.addEventListener(s,u,{passive:b}):i.addEventListener(s,u,!1)}function py(i,s,u,p,b){var x=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var N=p.tag;if(N===3||N===4){var Y=p.stateNode.containerInfo;if(Y===b)break;if(N===4)for(N=p.return;N!==null;){var re=N.tag;if((re===3||re===4)&&N.stateNode.containerInfo===b)return;N=N.return}for(;Y!==null;){if(N=Pn(Y),N===null)return;if(re=N.tag,re===5||re===6||re===26||re===27){p=x=N;continue e}Y=Y.parentNode}}p=p.return}C0(function(){var ge=x,ke=Nm(u),Ie=[];e:{var be=Z0.get(i);if(be!==void 0){var xe=cf,ot=i;switch(i){case"keypress":if(sf(u)===0)break e;case"keydown":case"keyup":xe=Y2;break;case"focusin":ot="focus",xe=_m;break;case"focusout":ot="blur",xe=_m;break;case"beforeblur":case"afterblur":xe=_m;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xe=k0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=P2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=G2;break;case K0:case G0:case X0:xe=_2;break;case Q0:xe=Q2;break;case"scroll":case"scrollend":xe=D2;break;case"wheel":xe=J2;break;case"copy":case"cut":case"paste":xe=F2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=O0;break;case"toggle":case"beforetoggle":xe=tI}var xt=(s&4)!==0,bn=!xt&&(i==="scroll"||i==="scrollend"),ce=xt?be!==null?be+"Capture":null:be;xt=[];for(var oe=ge,me;oe!==null;){var Ne=oe;if(me=Ne.stateNode,Ne=Ne.tag,Ne!==5&&Ne!==26&&Ne!==27||me===null||ce===null||(Ne=Bc(oe,ce),Ne!=null&&xt.push(vu(oe,Ne,me))),bn)break;oe=oe.return}0<xt.length&&(be=new xe(be,ot,null,u,ke),Ie.push({event:be,listeners:xt}))}}if((s&7)===0){e:{if(be=i==="mouseover"||i==="pointerover",xe=i==="mouseout"||i==="pointerout",be&&u!==Am&&(ot=u.relatedTarget||u.fromElement)&&(Pn(ot)||ot[at]))break e;if((xe||be)&&(be=ke.window===ke?ke:(be=ke.ownerDocument)?be.defaultView||be.parentWindow:window,xe?(ot=u.relatedTarget||u.toElement,xe=ge,ot=ot?Pn(ot):null,ot!==null&&(bn=o(ot),xt=ot.tag,ot!==bn||xt!==5&&xt!==27&&xt!==6)&&(ot=null)):(xe=null,ot=ge),xe!==ot)){if(xt=k0,Ne="onMouseLeave",ce="onMouseEnter",oe="mouse",(i==="pointerout"||i==="pointerover")&&(xt=O0,Ne="onPointerLeave",ce="onPointerEnter",oe="pointer"),bn=xe==null?be:rr(xe),me=ot==null?be:rr(ot),be=new xt(Ne,oe+"leave",xe,u,ke),be.target=bn,be.relatedTarget=me,Ne=null,Pn(ke)===ge&&(xt=new xt(ce,oe+"enter",ot,u,ke),xt.target=me,xt.relatedTarget=bn,Ne=xt),bn=Ne,xe&&ot)t:{for(xt=eP,ce=xe,oe=ot,me=0,Ne=ce;Ne;Ne=xt(Ne))me++;Ne=0;for(var mt=oe;mt;mt=xt(mt))Ne++;for(;0<me-Ne;)ce=xt(ce),me--;for(;0<Ne-me;)oe=xt(oe),Ne--;for(;me--;){if(ce===oe||oe!==null&&ce===oe.alternate){xt=ce;break t}ce=xt(ce),oe=xt(oe)}xt=null}else xt=null;xe!==null&&xE(Ie,be,xe,xt,!1),ot!==null&&bn!==null&&xE(Ie,bn,ot,xt,!0)}}e:{if(be=ge?rr(ge):window,xe=be.nodeName&&be.nodeName.toLowerCase(),xe==="select"||xe==="input"&&be.type==="file")var on=_0;else if(L0(be))if(z0)on=dI;else{on=cI;var dt=lI}else xe=be.nodeName,!xe||xe.toLowerCase()!=="input"||be.type!=="checkbox"&&be.type!=="radio"?ge&&Om(ge.elementType)&&(on=_0):on=uI;if(on&&(on=on(i,ge))){j0(Ie,on,u,ke);break e}dt&&dt(i,be,ge),i==="focusout"&&ge&&be.type==="number"&&ge.memoizedProps.value!=null&&Mm(be,"number",be.value)}switch(dt=ge?rr(ge):window,i){case"focusin":(L0(dt)||dt.contentEditable==="true")&&(ol=dt,Vm=ge,Kc=null);break;case"focusout":Kc=Vm=ol=null;break;case"mousedown":qm=!0;break;case"contextmenu":case"mouseup":case"dragend":qm=!1,Y0(Ie,u,ke);break;case"selectionchange":if(hI)break;case"keydown":case"keyup":Y0(Ie,u,ke)}var Ft;if(Fm)e:{switch(i){case"compositionstart":var Xt="onCompositionStart";break e;case"compositionend":Xt="onCompositionEnd";break e;case"compositionupdate":Xt="onCompositionUpdate";break e}Xt=void 0}else al?I0(i,u)&&(Xt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Xt="onCompositionStart");Xt&&(A0&&u.locale!=="ko"&&(al||Xt!=="onCompositionStart"?Xt==="onCompositionEnd"&&al&&(Ft=T0()):(Ga=ke,Pm="value"in Ga?Ga.value:Ga.textContent,al=!0)),dt=Jf(ge,Xt),0<dt.length&&(Xt=new M0(Xt,i,null,u,ke),Ie.push({event:Xt,listeners:dt}),Ft?Xt.data=Ft:(Ft=P0(u),Ft!==null&&(Xt.data=Ft)))),(Ft=rI?iI(i,u):aI(i,u))&&(Xt=Jf(ge,"onBeforeInput"),0<Xt.length&&(dt=new M0("onBeforeInput","beforeinput",null,u,ke),Ie.push({event:dt,listeners:Xt}),dt.data=Ft)),XI(Ie,i,ge,u,ke)}bE(Ie,s)})}function vu(i,s,u){return{instance:i,listener:s,currentTarget:u}}function Jf(i,s){for(var u=s+"Capture",p=[];i!==null;){var b=i,x=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||x===null||(b=Bc(i,u),b!=null&&p.unshift(vu(i,b,x)),b=Bc(i,s),b!=null&&p.push(vu(i,b,x))),i.tag===3)return p;i=i.return}return[]}function eP(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function xE(i,s,u,p,b){for(var x=s._reactName,N=[];u!==null&&u!==p;){var Y=u,re=Y.alternate,ge=Y.stateNode;if(Y=Y.tag,re!==null&&re===p)break;Y!==5&&Y!==26&&Y!==27||ge===null||(re=ge,b?(ge=Bc(u,x),ge!=null&&N.unshift(vu(u,ge,re))):b||(ge=Bc(u,x),ge!=null&&N.push(vu(u,ge,re)))),u=u.return}N.length!==0&&i.push({event:s,listeners:N})}var tP=/\r\n?/g,nP=/\u0000|\uFFFD/g;function wE(i){return(typeof i=="string"?i:""+i).replace(tP,`
50
- `).replace(nP,"")}function SE(i,s){return s=wE(s),wE(i)===s}function yn(i,s,u,p,b,x){switch(u){case"children":typeof p=="string"?s==="body"||s==="textarea"&&p===""||nl(i,p):(typeof p=="number"||typeof p=="bigint")&&s!=="body"&&nl(i,""+p);break;case"className":Mi(i,"class",p);break;case"tabIndex":Mi(i,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Mi(i,u,p);break;case"style":S0(i,p,x);break;case"data":if(s!=="object"){Mi(i,"data",p);break}case"src":case"href":if(p===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=af(""+p),i.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){i.setAttribute(u,"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 x=="function"&&(u==="formAction"?(s!=="input"&&yn(i,s,"name",b.name,b,null),yn(i,s,"formEncType",b.formEncType,b,null),yn(i,s,"formMethod",b.formMethod,b,null),yn(i,s,"formTarget",b.formTarget,b,null)):(yn(i,s,"encType",b.encType,b,null),yn(i,s,"method",b.method,b,null),yn(i,s,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=af(""+p),i.setAttribute(u,p);break;case"onClick":p!=null&&(i.onclick=ha);break;case"onScroll":p!=null&&Wt("scroll",i);break;case"onScrollEnd":p!=null&&Wt("scrollend",i);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":i.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){i.removeAttribute("xlink:href");break}u=af(""+p),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""+p):i.removeAttribute(u);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":p&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":p===!0?i.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,p):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?i.setAttribute(u,p):i.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?i.removeAttribute(u):i.setAttribute(u,p);break;case"popover":Wt("beforetoggle",i),Wt("toggle",i),Hn(i,"popover",p);break;case"xlinkActuate":lr(i,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":lr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":lr(i,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":lr(i,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":lr(i,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":lr(i,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":lr(i,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":lr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":lr(i,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Hn(i,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=A2.get(u)||u,Hn(i,u,p))}}function my(i,s,u,p,b,x){switch(u){case"style":S0(i,p,x);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof p=="string"?nl(i,p):(typeof p=="number"||typeof p=="bigint")&&nl(i,""+p);break;case"onScroll":p!=null&&Wt("scroll",i);break;case"onScrollEnd":p!=null&&Wt("scrollend",i);break;case"onClick":p!=null&&(i.onclick=ha);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qr.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),s=u.slice(2,b?u.length-7:void 0),x=i[Xe]||null,x=x!=null?x[u]:null,typeof x=="function"&&i.removeEventListener(s,x,b),typeof p=="function")){typeof x!="function"&&x!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,p,b);break e}u in i?i[u]=p:p===!0?i.setAttribute(u,""):Hn(i,u,p)}}}function fr(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Wt("error",i),Wt("load",i);var p=!1,b=!1,x;for(x in u)if(u.hasOwnProperty(x)){var N=u[x];if(N!=null)switch(x){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:yn(i,s,x,N,u,null)}}b&&yn(i,s,"srcSet",u.srcSet,u,null),p&&yn(i,s,"src",u.src,u,null);return;case"input":Wt("invalid",i);var Y=x=N=b=null,re=null,ge=null;for(p in u)if(u.hasOwnProperty(p)){var ke=u[p];if(ke!=null)switch(p){case"name":b=ke;break;case"type":N=ke;break;case"checked":re=ke;break;case"defaultChecked":ge=ke;break;case"value":x=ke;break;case"defaultValue":Y=ke;break;case"children":case"dangerouslySetInnerHTML":if(ke!=null)throw Error(r(137,s));break;default:yn(i,s,p,ke,u,null)}}b0(i,x,Y,re,ge,N,b,!1);return;case"select":Wt("invalid",i),p=N=x=null;for(b in u)if(u.hasOwnProperty(b)&&(Y=u[b],Y!=null))switch(b){case"value":x=Y;break;case"defaultValue":N=Y;break;case"multiple":p=Y;default:yn(i,s,b,Y,u,null)}s=x,u=N,i.multiple=!!p,s!=null?tl(i,!!p,s,!1):u!=null&&tl(i,!!p,u,!0);return;case"textarea":Wt("invalid",i),x=b=p=null;for(N in u)if(u.hasOwnProperty(N)&&(Y=u[N],Y!=null))switch(N){case"value":p=Y;break;case"defaultValue":b=Y;break;case"children":x=Y;break;case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(91));break;default:yn(i,s,N,Y,u,null)}x0(i,p,b,x);return;case"option":for(re in u)if(u.hasOwnProperty(re)&&(p=u[re],p!=null))switch(re){case"selected":i.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:yn(i,s,re,p,u,null)}return;case"dialog":Wt("beforetoggle",i),Wt("toggle",i),Wt("cancel",i),Wt("close",i);break;case"iframe":case"object":Wt("load",i);break;case"video":case"audio":for(p=0;p<bu.length;p++)Wt(bu[p],i);break;case"image":Wt("error",i),Wt("load",i);break;case"details":Wt("toggle",i);break;case"embed":case"source":case"link":Wt("error",i),Wt("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ge in u)if(u.hasOwnProperty(ge)&&(p=u[ge],p!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:yn(i,s,ge,p,u,null)}return;default:if(Om(s)){for(ke in u)u.hasOwnProperty(ke)&&(p=u[ke],p!==void 0&&my(i,s,ke,p,u,void 0));return}}for(Y in u)u.hasOwnProperty(Y)&&(p=u[Y],p!=null&&yn(i,s,Y,p,u,null))}function rP(i,s,u,p){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,x=null,N=null,Y=null,re=null,ge=null,ke=null;for(xe in u){var Ie=u[xe];if(u.hasOwnProperty(xe)&&Ie!=null)switch(xe){case"checked":break;case"value":break;case"defaultValue":re=Ie;default:p.hasOwnProperty(xe)||yn(i,s,xe,null,p,Ie)}}for(var be in p){var xe=p[be];if(Ie=u[be],p.hasOwnProperty(be)&&(xe!=null||Ie!=null))switch(be){case"type":x=xe;break;case"name":b=xe;break;case"checked":ge=xe;break;case"defaultChecked":ke=xe;break;case"value":N=xe;break;case"defaultValue":Y=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(137,s));break;default:xe!==Ie&&yn(i,s,be,xe,p,Ie)}}km(i,N,Y,re,ge,ke,x,b);return;case"select":xe=N=Y=be=null;for(x in u)if(re=u[x],u.hasOwnProperty(x)&&re!=null)switch(x){case"value":break;case"multiple":xe=re;default:p.hasOwnProperty(x)||yn(i,s,x,null,p,re)}for(b in p)if(x=p[b],re=u[b],p.hasOwnProperty(b)&&(x!=null||re!=null))switch(b){case"value":be=x;break;case"defaultValue":Y=x;break;case"multiple":N=x;default:x!==re&&yn(i,s,b,x,p,re)}s=Y,u=N,p=xe,be!=null?tl(i,!!u,be,!1):!!p!=!!u&&(s!=null?tl(i,!!u,s,!0):tl(i,!!u,u?[]:"",!1));return;case"textarea":xe=be=null;for(Y in u)if(b=u[Y],u.hasOwnProperty(Y)&&b!=null&&!p.hasOwnProperty(Y))switch(Y){case"value":break;case"children":break;default:yn(i,s,Y,null,p,b)}for(N in p)if(b=p[N],x=u[N],p.hasOwnProperty(N)&&(b!=null||x!=null))switch(N){case"value":be=b;break;case"defaultValue":xe=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==x&&yn(i,s,N,b,p,x)}v0(i,be,xe);return;case"option":for(var ot in u)if(be=u[ot],u.hasOwnProperty(ot)&&be!=null&&!p.hasOwnProperty(ot))switch(ot){case"selected":i.selected=!1;break;default:yn(i,s,ot,null,p,be)}for(re in p)if(be=p[re],xe=u[re],p.hasOwnProperty(re)&&be!==xe&&(be!=null||xe!=null))switch(re){case"selected":i.selected=be&&typeof be!="function"&&typeof be!="symbol";break;default:yn(i,s,re,be,p,xe)}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 xt in u)be=u[xt],u.hasOwnProperty(xt)&&be!=null&&!p.hasOwnProperty(xt)&&yn(i,s,xt,null,p,be);for(ge in p)if(be=p[ge],xe=u[ge],p.hasOwnProperty(ge)&&be!==xe&&(be!=null||xe!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,s));break;default:yn(i,s,ge,be,p,xe)}return;default:if(Om(s)){for(var bn in u)be=u[bn],u.hasOwnProperty(bn)&&be!==void 0&&!p.hasOwnProperty(bn)&&my(i,s,bn,void 0,p,be);for(ke in p)be=p[ke],xe=u[ke],!p.hasOwnProperty(ke)||be===xe||be===void 0&&xe===void 0||my(i,s,ke,be,p,xe);return}}for(var ce in u)be=u[ce],u.hasOwnProperty(ce)&&be!=null&&!p.hasOwnProperty(ce)&&yn(i,s,ce,null,p,be);for(Ie in p)be=p[Ie],xe=u[Ie],!p.hasOwnProperty(Ie)||be===xe||be==null&&xe==null||yn(i,s,Ie,be,p,xe)}function EE(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iP(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var b=u[p],x=b.transferSize,N=b.initiatorType,Y=b.duration;if(x&&Y&&EE(N)){for(N=0,Y=b.responseEnd,p+=1;p<u.length;p++){var re=u[p],ge=re.startTime;if(ge>Y)break;var ke=re.transferSize,Ie=re.initiatorType;ke&&EE(Ie)&&(re=re.responseEnd,N+=ke*(re<Y?1:(Y-ge)/(re-ge)))}if(--p,s+=8*(x+N)/(b.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var gy=null,yy=null;function eh(i){return i.nodeType===9?i:i.ownerDocument}function CE(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function TE(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function by(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var vy=null;function aP(){var i=window.event;return i&&i.type==="popstate"?i===vy?!1:(vy=i,!0):(vy=null,!1)}var RE=typeof setTimeout=="function"?setTimeout:void 0,oP=typeof clearTimeout=="function"?clearTimeout:void 0,kE=typeof Promise=="function"?Promise:void 0,sP=typeof queueMicrotask=="function"?queueMicrotask:typeof kE<"u"?function(i){return kE.resolve(null).then(i).catch(lP)}:RE;function lP(i){setTimeout(function(){throw i})}function ho(i){return i==="head"}function ME(i,s){var u=s,p=0;do{var b=u.nextSibling;if(i.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(p===0){i.removeChild(b),Il(s);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")xu(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,xu(u);for(var x=u.firstChild;x;){var N=x.nextSibling,Y=x.nodeName;x[An]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=N}}else u==="body"&&xu(i.ownerDocument.body);u=b}while(u);Il(s)}function OE(i,s){var u=i;i=0;do{var p=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=p}while(u)}function xy(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":xy(u),In(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function cP(i,s,u,p){for(;i.nodeType===1;){var b=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!p&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(p){if(!i[An])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(x=i.getAttribute("rel"),x==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(x!==b.rel||i.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||i.getAttribute("title")!==(b.title==null?null:b.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(x=i.getAttribute("src"),(x!==(b.src==null?null:b.src)||i.getAttribute("type")!==(b.type==null?null:b.type)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&x&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var x=b.name==null?null:""+b.name;if(b.type==="hidden"&&i.getAttribute("name")===x)return i}else return i;if(i=hi(i.nextSibling),i===null)break}return null}function uP(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=hi(i.nextSibling),i===null))return null;return i}function AE(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=hi(i.nextSibling),i===null))return null;return i}function wy(i){return i.data==="$?"||i.data==="$~"}function Sy(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function dP(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var p=function(){s(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),i._reactRetry=p}}function hi(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Ey=null;function NE(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return hi(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function DE(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function IE(i,s,u){switch(s=eh(u),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function xu(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);In(i)}var pi=new Map,PE=new Set;function th(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Oa=z.d;z.d={f:fP,r:hP,D:pP,C:mP,L:gP,m:yP,X:vP,S:bP,M:xP};function fP(){var i=Oa.f(),s=Yf();return i||s}function hP(i){var s=Zt(i);s!==null&&s.tag===5&&s.type==="form"?QS(s):Oa.r(i)}var Al=typeof document>"u"?null:document;function LE(i,s,u){var p=Al;if(p&&typeof s=="string"&&s){var b=oi(s);b='link[rel="'+i+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),PE.has(b)||(PE.add(b),i={rel:i,crossOrigin:u,href:s},p.querySelector(b)===null&&(s=p.createElement("link"),fr(s,"link",i),Mn(s),p.head.appendChild(s)))}}function pP(i){Oa.D(i),LE("dns-prefetch",i,null)}function mP(i,s){Oa.C(i,s),LE("preconnect",i,s)}function gP(i,s,u){Oa.L(i,s,u);var p=Al;if(p&&i&&s){var b='link[rel="preload"][as="'+oi(s)+'"]';s==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+oi(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+oi(u.imageSizes)+'"]')):b+='[href="'+oi(i)+'"]';var x=b;switch(s){case"style":x=Nl(i);break;case"script":x=Dl(i)}pi.has(x)||(i=h({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),pi.set(x,i),p.querySelector(b)!==null||s==="style"&&p.querySelector(wu(x))||s==="script"&&p.querySelector(Su(x))||(s=p.createElement("link"),fr(s,"link",i),Mn(s),p.head.appendChild(s)))}}function yP(i,s){Oa.m(i,s);var u=Al;if(u&&i){var p=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+oi(p)+'"][href="'+oi(i)+'"]',x=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Dl(i)}if(!pi.has(x)&&(i=h({rel:"modulepreload",href:i},s),pi.set(x,i),u.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Su(x)))return}p=u.createElement("link"),fr(p,"link",i),Mn(p),u.head.appendChild(p)}}}function bP(i,s,u){Oa.S(i,s,u);var p=Al;if(p&&i){var b=Or(p).hoistableStyles,x=Nl(i);s=s||"default";var N=b.get(x);if(!N){var Y={loading:0,preload:null};if(N=p.querySelector(wu(x)))Y.loading=5;else{i=h({rel:"stylesheet",href:i,"data-precedence":s},u),(u=pi.get(x))&&Cy(i,u);var re=N=p.createElement("link");Mn(re),fr(re,"link",i),re._p=new Promise(function(ge,ke){re.onload=ge,re.onerror=ke}),re.addEventListener("load",function(){Y.loading|=1}),re.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,nh(N,s,p)}N={type:"stylesheet",instance:N,count:1,state:Y},b.set(x,N)}}}function vP(i,s){Oa.X(i,s);var u=Al;if(u&&i){var p=Or(u).hoistableScripts,b=Dl(i),x=p.get(b);x||(x=u.querySelector(Su(b)),x||(i=h({src:i,async:!0},s),(s=pi.get(b))&&Ty(i,s),x=u.createElement("script"),Mn(x),fr(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(b,x))}}function xP(i,s){Oa.M(i,s);var u=Al;if(u&&i){var p=Or(u).hoistableScripts,b=Dl(i),x=p.get(b);x||(x=u.querySelector(Su(b)),x||(i=h({src:i,async:!0,type:"module"},s),(s=pi.get(b))&&Ty(i,s),x=u.createElement("script"),Mn(x),fr(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(b,x))}}function jE(i,s,u,p){var b=(b=te.current)?th(b):null;if(!b)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=Nl(u.href),u=Or(b).hoistableStyles,p=u.get(s),p||(p={type:"style",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Nl(u.href);var x=Or(b).hoistableStyles,N=x.get(i);if(N||(b=b.ownerDocument||b,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(i,N),(x=b.querySelector(wu(i)))&&!x._p&&(N.instance=x,N.state.loading=5),pi.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},pi.set(i,u),x||wP(b,i,u,N.state))),s&&p===null)throw Error(r(528,""));return N}if(s&&p!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Dl(u),u=Or(b).hoistableScripts,p=u.get(s),p||(p={type:"script",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Nl(i){return'href="'+oi(i)+'"'}function wu(i){return'link[rel="stylesheet"]['+i+"]"}function _E(i){return h({},i,{"data-precedence":i.precedence,precedence:null})}function wP(i,s,u,p){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?p.loading=1:(s=i.createElement("link"),p.preload=s,s.addEventListener("load",function(){return p.loading|=1}),s.addEventListener("error",function(){return p.loading|=2}),fr(s,"link",u),Mn(s),i.head.appendChild(s))}function Dl(i){return'[src="'+oi(i)+'"]'}function Su(i){return"script[async]"+i}function zE(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var p=i.querySelector('style[data-href~="'+oi(u.href)+'"]');if(p)return s.instance=p,Mn(p),p;var b=h({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(i.ownerDocument||i).createElement("style"),Mn(p),fr(p,"style",b),nh(p,u.precedence,i),s.instance=p;case"stylesheet":b=Nl(u.href);var x=i.querySelector(wu(b));if(x)return s.state.loading|=4,s.instance=x,Mn(x),x;p=_E(u),(b=pi.get(b))&&Cy(p,b),x=(i.ownerDocument||i).createElement("link"),Mn(x);var N=x;return N._p=new Promise(function(Y,re){N.onload=Y,N.onerror=re}),fr(x,"link",p),s.state.loading|=4,nh(x,u.precedence,i),s.instance=x;case"script":return x=Dl(u.src),(b=i.querySelector(Su(x)))?(s.instance=b,Mn(b),b):(p=u,(b=pi.get(x))&&(p=h({},u),Ty(p,b)),i=i.ownerDocument||i,b=i.createElement("script"),Mn(b),fr(b,"link",p),i.head.appendChild(b),s.instance=b);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(p=s.instance,s.state.loading|=4,nh(p,u.precedence,i));return s.instance}function nh(i,s,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,x=b,N=0;N<p.length;N++){var Y=p[N];if(Y.dataset.precedence===s)x=Y;else if(x!==b)break}x?x.parentNode.insertBefore(i,x.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function Cy(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Ty(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var rh=null;function FE(i,s,u){if(rh===null){var p=new Map,b=rh=new Map;b.set(u,p)}else b=rh,p=b.get(u),p||(p=new Map,b.set(u,p));if(p.has(i))return p;for(p.set(i,null),u=u.getElementsByTagName(i),b=0;b<u.length;b++){var x=u[b];if(!(x[An]||x[We]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var N=x.getAttribute(s)||"";N=i+N;var Y=p.get(N);Y?Y.push(x):p.set(N,[x])}}return p}function BE(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function SP(i,s,u){if(u===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function HE(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function EP(i,s,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=Nl(p.href),x=s.querySelector(wu(b));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=ih.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=x,Mn(x);return}x=s.ownerDocument||s,p=_E(p),(b=pi.get(b))&&Cy(p,b),x=x.createElement("link"),Mn(x);var N=x;N._p=new Promise(function(Y,re){N.onload=Y,N.onerror=re}),fr(x,"link",p),u.instance=x}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=ih.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var Ry=0;function CP(i,s){return i.stylesheets&&i.count===0&&oh(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var p=setTimeout(function(){if(i.stylesheets&&oh(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+s);0<i.imgBytes&&Ry===0&&(Ry=62500*iP());var b=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&oh(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>Ry?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function ih(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)oh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var ah=null;function oh(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,ah=new Map,s.forEach(TP,i),ah=null,ih.call(i))}function TP(i,s){if(!(s.state.loading&4)){var u=ah.get(i);if(u)var p=u.get(null);else{u=new Map,ah.set(i,u);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<b.length;x++){var N=b[x];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(u.set(N.dataset.precedence,N),p=N)}p&&u.set(null,p)}b=s.instance,N=b.getAttribute("data-precedence"),x=u.get(N)||p,x===p&&u.set(null,b),u.set(N,b),this.count++,p=ih.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),x?x.parentNode.insertBefore(b,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(b,i.firstChild)),s.state.loading|=4}}var Eu={$$typeof:k,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function RP(i,s,u,p,b,x,N,Y,re){this.tag=1,this.containerInfo=i,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=un(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=un(0),this.hiddenUpdates=un(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=x,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=re,this.incompleteTransitions=new Map}function UE(i,s,u,p,b,x,N,Y,re,ge,ke,Ie){return i=new RP(i,s,u,N,re,ge,ke,Ie,Y),s=1,x===!0&&(s|=24),x=Yr(3,null,null,s),i.current=x,x.stateNode=i,s=ag(),s.refCount++,i.pooledCache=s,s.refCount++,x.memoizedState={element:p,isDehydrated:u,cache:s},cg(x),i}function VE(i){return i?(i=cl,i):cl}function qE(i,s,u,p,b,x){b=VE(b),p.context===null?p.context=b:p.pendingContext=b,p=to(s),p.payload={element:u},x=x===void 0?null:x,x!==null&&(p.callback=x),u=no(i,p,s),u!==null&&(Lr(u,i,s),tu(u,i,s))}function $E(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function ky(i,s){$E(i,s),(i=i.alternate)&&$E(i,s)}function YE(i){if(i.tag===13||i.tag===31){var s=os(i,67108864);s!==null&&Lr(s,i,67108864),ky(i,67108864)}}function WE(i){if(i.tag===13||i.tag===31){var s=Qr();s=ue(s);var u=os(i,s);u!==null&&Lr(u,i,s),ky(i,s)}}var sh=!0;function kP(i,s,u,p){var b=_.T;_.T=null;var x=z.p;try{z.p=2,My(i,s,u,p)}finally{z.p=x,_.T=b}}function MP(i,s,u,p){var b=_.T;_.T=null;var x=z.p;try{z.p=8,My(i,s,u,p)}finally{z.p=x,_.T=b}}function My(i,s,u,p){if(sh){var b=Oy(p);if(b===null)py(i,s,p,lh,u),GE(i,p);else if(AP(b,i,s,u,p))p.stopPropagation();else if(GE(i,p),s&4&&-1<OP.indexOf(i)){for(;b!==null;){var x=Zt(b);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var N=yt(x.pendingLanes);if(N!==0){var Y=x;for(Y.pendingLanes|=2,Y.entangledLanes|=2;N;){var re=1<<31-tt(N);Y.entanglements[1]|=re,N&=~re}$i(x),(dn&6)===0&&(qf=De()+500,yu(0))}}break;case 31:case 13:Y=os(x,2),Y!==null&&Lr(Y,x,2),Yf(),ky(x,2)}if(x=Oy(p),x===null&&py(i,s,p,lh,u),x===b)break;b=x}b!==null&&p.stopPropagation()}else py(i,s,p,null,u)}}function Oy(i){return i=Nm(i),Ay(i)}var lh=null;function Ay(i){if(lh=null,i=Pn(i),i!==null){var s=o(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=l(s),i!==null)return i;i=null}else if(u===31){if(i=c(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return lh=i,null}function KE(i){switch(i){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(ut()){case he:return 2;case Ce:return 8;case ee:case de:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var Ny=!1,po=null,mo=null,go=null,Cu=new Map,Tu=new Map,yo=[],OP="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 GE(i,s){switch(i){case"focusin":case"focusout":po=null;break;case"dragenter":case"dragleave":mo=null;break;case"mouseover":case"mouseout":go=null;break;case"pointerover":case"pointerout":Cu.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tu.delete(s.pointerId)}}function Ru(i,s,u,p,b,x){return i===null||i.nativeEvent!==x?(i={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:x,targetContainers:[b]},s!==null&&(s=Zt(s),s!==null&&YE(s)),i):(i.eventSystemFlags|=p,s=i.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),i)}function AP(i,s,u,p,b){switch(s){case"focusin":return po=Ru(po,i,s,u,p,b),!0;case"dragenter":return mo=Ru(mo,i,s,u,p,b),!0;case"mouseover":return go=Ru(go,i,s,u,p,b),!0;case"pointerover":var x=b.pointerId;return Cu.set(x,Ru(Cu.get(x)||null,i,s,u,p,b)),!0;case"gotpointercapture":return x=b.pointerId,Tu.set(x,Ru(Tu.get(x)||null,i,s,u,p,b)),!0}return!1}function XE(i){var s=Pn(i.target);if(s!==null){var u=o(s);if(u!==null){if(s=u.tag,s===13){if(s=l(u),s!==null){i.blockedOn=s,rt(i.priority,function(){WE(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,rt(i.priority,function(){WE(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function ch(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=Oy(i.nativeEvent);if(u===null){u=i.nativeEvent;var p=new u.constructor(u.type,u);Am=p,u.target.dispatchEvent(p),Am=null}else return s=Zt(u),s!==null&&YE(s),i.blockedOn=u,!1;s.shift()}return!0}function QE(i,s,u){ch(i)&&u.delete(s)}function NP(){Ny=!1,po!==null&&ch(po)&&(po=null),mo!==null&&ch(mo)&&(mo=null),go!==null&&ch(go)&&(go=null),Cu.forEach(QE),Tu.forEach(QE)}function uh(i,s){i.blockedOn===s&&(i.blockedOn=null,Ny||(Ny=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,NP)))}var dh=null;function ZE(i){dh!==i&&(dh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){dh===i&&(dh=null);for(var s=0;s<i.length;s+=3){var u=i[s],p=i[s+1],b=i[s+2];if(typeof p!="function"){if(Ay(p||u)===null)continue;break}var x=Zt(u);x!==null&&(i.splice(s,3),s-=3,Og(x,{pending:!0,data:b,method:u.method,action:p},p,b))}}))}function Il(i){function s(re){return uh(re,i)}po!==null&&uh(po,i),mo!==null&&uh(mo,i),go!==null&&uh(go,i),Cu.forEach(s),Tu.forEach(s);for(var u=0;u<yo.length;u++){var p=yo[u];p.blockedOn===i&&(p.blockedOn=null)}for(;0<yo.length&&(u=yo[0],u.blockedOn===null);)XE(u),u.blockedOn===null&&yo.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var b=u[p],x=u[p+1],N=b[Xe]||null;if(typeof x=="function")N||ZE(u);else if(N){var Y=null;if(x&&x.hasAttribute("formAction")){if(b=x,N=x[Xe]||null)Y=N.formAction;else if(Ay(b)!==null)continue}else Y=N.action;typeof Y=="function"?u[p+1]=Y:(u.splice(p,3),p-=3),ZE(u)}}}function JE(){function i(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(N){return b=N})},focusReset:"manual",scroll:"manual"})}function s(){b!==null&&(b(),b=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,b=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),b!==null&&(b(),b=null)}}}function Dy(i){this._internalRoot=i}fh.prototype.render=Dy.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,p=Qr();qE(u,p,i,s,null,null)},fh.prototype.unmount=Dy.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;qE(i.current,2,null,i,null,null),Yf(),s[at]=null}};function fh(i){this._internalRoot=i}fh.prototype.unstable_scheduleHydration=function(i){if(i){var s=_e();i={blockedOn:null,target:i,priority:s};for(var u=0;u<yo.length&&s!==0&&s<yo[u].priority;u++);yo.splice(u,0,i),u===0&&XE(i)}};var eC=t.version;if(eC!=="19.2.4")throw Error(r(527,eC,"19.2.4"));z.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(s),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var DP={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hh.isDisabled&&hh.supportsFiber)try{et=hh.inject(DP),ze=hh}catch{}}return Mu.createRoot=function(i,s){if(!a(i))throw Error(r(299));var u=!1,p="",b=s1,x=l1,N=c1;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(b=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError)),s=UE(i,1,!1,null,null,u,p,null,b,x,N,JE),i[at]=s.current,hy(i),new Dy(s)},Mu.hydrateRoot=function(i,s,u){if(!a(i))throw Error(r(299));var p=!1,b="",x=s1,N=l1,Y=c1,re=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(Y=u.onRecoverableError),u.formState!==void 0&&(re=u.formState)),s=UE(i,1,!0,s,u??null,p,b,re,x,N,Y,JE),s.context=VE(null),u=s.current,p=Qr(),p=ue(p),b=to(p),b.callback=null,no(u,b,p),u=p,s.current.lanes=u,Ht(s,u),$i(s),i[at]=s.current,hy(i),new fh(s)},Mu.version="19.2.4",Mu}var EC;function ML(){if(EC)return jy.exports;EC=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(),jy.exports=kL(),jy.exports}var OL=ML();/**
51
- * react-router v7.13.0
52
- *
53
- * Copyright (c) Remix Software Inc.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE.md file in the root directory of this source tree.
57
- *
58
- * @license MIT
59
- */var mM=e=>{throw TypeError(e)},AL=(e,t,n)=>t.has(e)||mM("Cannot "+n),By=(e,t,n)=>(AL(e,t,"read from private field"),n?n.call(e):t.get(e)),NL=(e,t,n)=>t.has(e)?mM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),CC="popstate";function DL(e={}){function t(r,a){let{pathname:o,search:l,hash:c}=r.location;return pd("",{pathname:o,search:l,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:na(a)}return PL(t,n,null,e)}function Vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function IL(){return Math.random().toString(36).substring(2,10)}function TC(e,t){return{usr:e.state,key:e.key,idx:t}}function pd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Yo(t):t,state:n,key:t&&t.key||r||IL()}}function na({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Yo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function PL(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,l=a.history,c="POP",f=null,d=m();d==null&&(d=0,l.replaceState({...l.state,idx:d},""));function m(){return(l.state||{idx:null}).idx}function h(){c="POP";let T=m(),S=T==null?null:T-d;d=T,f&&f({action:c,location:C.location,delta:S})}function y(T,S){c="PUSH";let R=pd(C.location,T,S);d=m()+1;let k=TC(R,d),M=C.createHref(R);try{l.pushState(k,"",M)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;a.location.assign(M)}o&&f&&f({action:c,location:C.location,delta:1})}function g(T,S){c="REPLACE";let R=pd(C.location,T,S);d=m();let k=TC(R,d),M=C.createHref(R);l.replaceState(k,"",M),o&&f&&f({action:c,location:C.location,delta:0})}function w(T){return gM(T)}let C={get action(){return c},get location(){return e(a,l)},listen(T){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(CC,h),f=T,()=>{a.removeEventListener(CC,h),f=null}},createHref(T){return t(a,T)},createURL:w,encodeLocation(T){let S=w(T);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:g,go(T){return l.go(T)}};return C}function gM(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Vt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:na(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var $u,RC=class{constructor(e){if(NL(this,$u,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(By(this,$u).has(e))return By(this,$u).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){By(this,$u).set(e,t)}};$u=new WeakMap;var LL=new Set(["lazy","caseSensitive","path","id","index","children"]);function jL(e){return LL.has(e)}var _L=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function zL(e){return _L.has(e)}function FL(e){return e.index===!0}function md(e,t,n=[],r={},a=!1){return e.map((o,l)=>{let c=[...n,String(l)],f=typeof o.id=="string"?o.id:c.join("-");if(Vt(o.index!==!0||!o.children,"Cannot specify children on an index route"),Vt(a||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),FL(o)){let d={...o,id:f};return r[f]=kC(d,t(d)),d}else{let d={...o,id:f,children:void 0};return r[f]=kC(d,t(d)),o.children&&(d.children=md(o.children,t,c,r,a)),d}})}function kC(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Co(e,t,n="/"){return Yu(e,t,n,!1)}function Yu(e,t,n,r){let a=typeof t=="string"?Yo(t):t,o=Si(a.pathname||"/",n);if(o==null)return null;let l=yM(e);HL(l);let c=null;for(let f=0;c==null&&f<l.length;++f){let d=vM(o);c=XL(l[f],d,r)}return c}function BL(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function yM(e,t=[],n=[],r="",a=!1){let o=(l,c,f=a,d)=>{let m={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;Vt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let h=Ji([r,m.relativePath]),y=n.concat(m);l.children&&l.children.length>0&&(Vt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),yM(l.children,t,y,h,f)),!(l.path==null&&!l.index)&&t.push({path:h,score:KL(h,l.index),routesMeta:y})};return e.forEach((l,c)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))o(l,c);else for(let d of bM(l.path))o(l,c,!0,d)}),t}function bM(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let l=bM(r.join("/")),c=[];return c.push(...l.map(f=>f===""?o:[o,f].join("/"))),a&&c.push(...l),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function HL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:GL(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var UL=/^:[\w-]+$/,VL=3,qL=2,$L=1,YL=10,WL=-2,MC=e=>e==="*";function KL(e,t){let n=e.split("/"),r=n.length;return n.some(MC)&&(r+=WL),t&&(r+=qL),n.filter(a=>!MC(a)).reduce((a,o)=>a+(UL.test(o)?VL:o===""?$L:YL),r)}function GL(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function XL(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",l=[];for(let c=0;c<r.length;++c){let f=r[c],d=c===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",h=hc({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},m),y=f.route;if(!h&&d&&n&&!r[r.length-1].route.index&&(h=hc({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!h)return null;Object.assign(a,h.params),l.push({params:a,pathname:Ji([o,h.pathname]),pathnameBase:ej(Ji([o,h.pathnameBase])),route:y}),h.pathnameBase!=="/"&&(o=Ji([o,h.pathnameBase]))}return l}function hc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=QL(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((d,{paramName:m,isOptional:h},y)=>{if(m==="*"){let w=c[y]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const g=c[y];return h&&!g?d[m]=void 0:d[m]=(g||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:l,pattern:e}}function QL(e,t=!1,n=!0){Xn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,f)=>(r.push({paramName:c,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function vM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Xn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Si(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function ZL({basename:e,pathname:t}){return t==="/"?e:Ji([e,t])}var xM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tx=e=>xM.test(e);function JL(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Yo(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=OC(n.substring(1),"/"):o=OC(n,t)):o=t,{pathname:o,search:tj(r),hash:nj(a)}}function OC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Hy(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function wM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Rx(e){let t=wM(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function kx(e,t,n,r=!1){let a;typeof e=="string"?a=Yo(e):(a={...e},Vt(!a.pathname||!a.pathname.includes("?"),Hy("?","pathname","search",a)),Vt(!a.pathname||!a.pathname.includes("#"),Hy("#","pathname","hash",a)),Vt(!a.search||!a.search.includes("#"),Hy("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,c;if(l==null)c=n;else{let h=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),h-=1;a.pathname=y.join("/")}c=h>=0?t[h]:"/"}let f=JL(a,c),d=l&&l!=="/"&&l.endsWith("/"),m=(o||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(d||m)&&(f.pathname+="/"),f}var Ji=e=>e.join("/").replace(/\/\/+/g,"/"),ej=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),tj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,nj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ld=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function gd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function jd(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var SM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function EM(e,t){let n=e;if(typeof n!="string"||!xM.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(SM)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),c=Si(l.pathname,t);l.origin===o.origin&&c!=null?n=c+l.search+l.hash:a=!0}catch{Xn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}var Lo=Symbol("Uninstrumented");function rj(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(o){let l=Object.keys(n);for(let c of l)o[c]&&n[c].push(o[c])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let a=Ul(n.lazy,t.lazy,()=>{});a&&(r.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(o=>{let l=a[o],c=n[`lazy.${o}`];if(typeof l=="function"&&c.length>0){let f=Ul(c,l,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[o]:f}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&n[a].length>0){let l=o[Lo]??o,c=Ul(n[a],l,(...f)=>AC(f[0]));c&&(a==="loader"&&l.hydrate===!0&&(c.hydrate=!0),c[Lo]=l,r[a]=c)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(a=>{let o=a[Lo]??a,l=Ul(n.middleware,o,(...c)=>AC(c[0]));return l?(l[Lo]=o,l):a})),r}function ij(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(a){let o=Object.keys(a);for(let l of o)a[l]&&n[l].push(a[l])}})),n.navigate.length>0){let r=e.navigate[Lo]??e.navigate,a=Ul(n.navigate,r,(...o)=>{let[l,c]=o;return{to:typeof l=="number"||typeof l=="string"?l:l?na(l):".",...NC(e,c??{})}});a&&(a[Lo]=r,e.navigate=a)}if(n.fetch.length>0){let r=e.fetch[Lo]??e.fetch,a=Ul(n.fetch,r,(...o)=>{let[l,,c,f]=o;return{href:c??".",fetcherKey:l,...NC(e,f??{})}});a&&(a[Lo]=r,e.fetch=a)}return e}function Ul(e,t,n){return e.length===0?null:async(...r)=>{let a=await CM(e,n(...r),()=>t(...r),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function CM(e,t,n,r){let a=e[r],o;if(a){let l,c=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=CM(e,t,n,r-1),o=await l,Vt(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(c,t)}catch(f){console.error("An instrumentation function threw an error:",f)}l||await c(),await l}else try{o={type:"success",value:await n()}}catch(l){o={type:"error",value:l}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function AC(e){let{request:t,context:n,params:r,unstable_pattern:a}=e;return{request:aj(t),params:{...r},unstable_pattern:a,context:oj(n)}}function NC(e,t){return{currentUrl:na(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function aj(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function oj(e){if(lj(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var sj=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lj(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===sj}var TM=["POST","PUT","PATCH","DELETE"],cj=new Set(TM),uj=["GET",...TM],dj=new Set(uj),RM=new Set([301,302,303,307,308]),fj=new Set([307,308]),Uy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},hj={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ou={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},pj=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),kM="remix-router-transitions",MM=Symbol("ResetLoaderData");function mj(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Vt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||pj,o=a;if(e.unstable_instrumentations){let X=e.unstable_instrumentations;o=ae=>({...a(ae),...rj(X.map(ue=>ue.route).filter(Boolean),ae)})}let l={},c=md(e.routes,o,void 0,l),f,d=e.basename||"/";d.startsWith("/")||(d=`/${d}`);let m=e.dataStrategy||xj,h={...e.future},y=null,g=new Set,w=null,C=null,T=null,S=e.hydrationData!=null,R=Co(c,e.history.location,d),k=!1,M=null,D;if(R==null&&!e.patchRoutesOnNavigation){let X=gi(404,{pathname:e.history.location.pathname}),{matches:ae,route:ue}=gh(c);D=!0,R=ae,M={[ue.id]:X}}else if(R&&!e.hydrationData&&Tt(R,c,e.history.location.pathname).active&&(R=null),R)if(R.some(X=>X.route.lazy))D=!1;else if(!R.some(X=>Mx(X.route)))D=!0;else{let X=e.hydrationData?e.hydrationData.loaderData:null,ae=e.hydrationData?e.hydrationData.errors:null;if(ae){let ue=R.findIndex(Re=>ae[Re.route.id]!==void 0);D=R.slice(0,ue+1).every(Re=>!cv(Re.route,X,ae))}else D=R.every(ue=>!cv(ue.route,X,ae))}else{D=!1,R=[];let X=Tt(null,c,e.history.location.pathname);X.active&&X.matches&&(k=!0,R=X.matches)}let O,A={historyAction:e.history.action,location:e.history.location,matches:R,initialized:D,navigation:Uy,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||M,fetchers:new Map,blockers:new Map},L="POP",H=null,F=!1,W,j=!1,q=new Map,$=null,B=!1,_=!1,z=new Set,U=new Map,K=0,P=-1,V=new Map,G=new Set,I=new Map,Q=new Map,Z=new Set,te=new Map,le,pe=null;function we(){if(y=e.history.listen(({action:X,location:ae,delta:ue})=>{if(le){le(),le=void 0;return}Xn(te.size===0||ue!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Re=it({currentLocation:A.location,nextLocation:ae,historyAction:X});if(Re&&ue!=null){let _e=new Promise(rt=>{le=rt});e.history.go(ue*-1),Ot(Re,{state:"blocked",location:ae,proceed(){Ot(Re,{state:"proceeding",proceed:void 0,reset:void 0,location:ae}),_e.then(()=>e.history.go(ue))},reset(){let rt=new Map(A.blockers);rt.set(Re,Ou),ne({blockers:rt})}}),H==null||H.resolve(),H=null;return}return Oe(X,ae)}),n){zj(t,q);let X=()=>Fj(t,q);t.addEventListener("pagehide",X),$=()=>t.removeEventListener("pagehide",X)}return A.initialized||Oe("POP",A.location,{initialHydration:!0}),O}function Me(){y&&y(),$&&$(),g.clear(),W&&W.abort(),A.fetchers.forEach((X,ae)=>$e(ae)),A.blockers.forEach((X,ae)=>gt(ae))}function Pe(X){return g.add(X),()=>g.delete(X)}function ne(X,ae={}){X.matches&&(X.matches=X.matches.map(_e=>{let rt=l[_e.route.id],nt=_e.route;return nt.element!==rt.element||nt.errorElement!==rt.errorElement||nt.hydrateFallbackElement!==rt.hydrateFallbackElement?{..._e,route:rt}:_e})),A={...A,...X};let ue=[],Re=[];A.fetchers.forEach((_e,rt)=>{_e.state==="idle"&&(Z.has(rt)?ue.push(rt):Re.push(rt))}),Z.forEach(_e=>{!A.fetchers.has(_e)&&!U.has(_e)&&ue.push(_e)}),[...g].forEach(_e=>_e(A,{deletedFetchers:ue,newErrors:X.errors??null,viewTransitionOpts:ae.viewTransitionOpts,flushSync:ae.flushSync===!0})),ue.forEach(_e=>$e(_e)),Re.forEach(_e=>A.fetchers.delete(_e))}function fe(X,ae,{flushSync:ue}={}){var St,ht;let Re=A.actionData!=null&&A.navigation.formMethod!=null&&yr(A.navigation.formMethod)&&A.navigation.state==="loading"&&((St=X.state)==null?void 0:St._isRedirect)!==!0,_e;ae.actionData?Object.keys(ae.actionData).length>0?_e=ae.actionData:_e=null:Re?_e=A.actionData:_e=null;let rt=ae.loaderData?HC(A.loaderData,ae.loaderData,ae.matches||[],ae.errors):A.loaderData,nt=A.blockers;nt.size>0&&(nt=new Map(nt),nt.forEach((Pt,$t)=>nt.set($t,Ou)));let We=B?!1:jt(X,ae.matches||A.matches),Xe=F===!0||A.navigation.formMethod!=null&&yr(A.navigation.formMethod)&&((ht=X.state)==null?void 0:ht._isRedirect)!==!0;f&&(c=f,f=void 0),B||L==="POP"||(L==="PUSH"?e.history.push(X,X.state):L==="REPLACE"&&e.history.replace(X,X.state));let at;if(L==="POP"){let Pt=q.get(A.location.pathname);Pt&&Pt.has(X.pathname)?at={currentLocation:A.location,nextLocation:X}:q.has(X.pathname)&&(at={currentLocation:X,nextLocation:A.location})}else if(j){let Pt=q.get(A.location.pathname);Pt?Pt.add(X.pathname):(Pt=new Set([X.pathname]),q.set(A.location.pathname,Pt)),at={currentLocation:A.location,nextLocation:X}}ne({...ae,actionData:_e,loaderData:rt,historyAction:L,location:X,initialized:!0,navigation:Uy,revalidation:"idle",restoreScrollPosition:We,preventScrollReset:Xe,blockers:nt},{viewTransitionOpts:at,flushSync:ue===!0}),L="POP",F=!1,j=!1,B=!1,_=!1,H==null||H.resolve(),H=null,pe==null||pe.resolve(),pe=null}async function ye(X,ae){if(H==null||H.resolve(),H=null,typeof X=="number"){H||(H=$C());let $t=H.promise;return e.history.go(X),$t}let ue=lv(A.location,A.matches,d,X,ae==null?void 0:ae.fromRouteId,ae==null?void 0:ae.relative),{path:Re,submission:_e,error:rt}=DC(!1,ue,ae),nt=A.location,We=pd(A.location,Re,ae&&ae.state);We={...We,...e.history.encodeLocation(We)};let Xe=ae&&ae.replace!=null?ae.replace:void 0,at="PUSH";Xe===!0?at="REPLACE":Xe===!1||_e!=null&&yr(_e.formMethod)&&_e.formAction===A.location.pathname+A.location.search&&(at="REPLACE");let St=ae&&"preventScrollReset"in ae?ae.preventScrollReset===!0:void 0,ht=(ae&&ae.flushSync)===!0,Pt=it({currentLocation:nt,nextLocation:We,historyAction:at});if(Pt){Ot(Pt,{state:"blocked",location:We,proceed(){Ot(Pt,{state:"proceeding",proceed:void 0,reset:void 0,location:We}),ye(X,ae)},reset(){let $t=new Map(A.blockers);$t.set(Pt,Ou),ne({blockers:$t})}});return}await Oe(at,We,{submission:_e,pendingError:rt,preventScrollReset:St,replace:ae&&ae.replace,enableViewTransition:ae&&ae.viewTransition,flushSync:ht,callSiteDefaultShouldRevalidate:ae&&ae.unstable_defaultShouldRevalidate})}function Le(){pe||(pe=$C()),Ce(),ne({revalidation:"loading"});let X=pe.promise;return A.navigation.state==="submitting"?X:A.navigation.state==="idle"?(Oe(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),X):(Oe(L||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:j===!0}),X)}async function Oe(X,ae,ue){W&&W.abort(),W=null,L=X,B=(ue&&ue.startUninterruptedRevalidation)===!0,Rt(A.location,A.matches),F=(ue&&ue.preventScrollReset)===!0,j=(ue&&ue.enableViewTransition)===!0;let Re=f||c,_e=ue&&ue.overrideNavigation,rt=ue!=null&&ue.initialHydration&&A.matches&&A.matches.length>0&&!k?A.matches:Co(Re,ae,d),nt=(ue&&ue.flushSync)===!0;if(rt&&A.initialized&&!_&&Mj(A.location,ae)&&!(ue&&ue.submission&&yr(ue.submission.formMethod))){fe(ae,{matches:rt},{flushSync:nt});return}let We=Tt(rt,Re,ae.pathname);if(We.active&&We.matches&&(rt=We.matches),!rt){let{error:In,notFoundMatches:Pn,route:Zt}=ft(ae.pathname);fe(ae,{matches:Pn,loaderData:{},errors:{[Zt.id]:In}},{flushSync:nt});return}W=new AbortController;let Xe=Fl(e.history,ae,W.signal,ue&&ue.submission),at=e.getContext?await e.getContext():new RC,St;if(ue&&ue.pendingError)St=[To(rt).route.id,{type:"error",error:ue.pendingError}];else if(ue&&ue.submission&&yr(ue.submission.formMethod)){let In=await Ee(Xe,ae,ue.submission,rt,at,We.active,ue&&ue.initialHydration===!0,{replace:ue.replace,flushSync:nt});if(In.shortCircuited)return;if(In.pendingActionResult){let[Pn,Zt]=In.pendingActionResult;if(Jr(Zt)&&gd(Zt.error)&&Zt.error.status===404){W=null,fe(ae,{matches:In.matches,loaderData:{},errors:{[Pn]:Zt.error}});return}}rt=In.matches||rt,St=In.pendingActionResult,_e=Vy(ae,ue.submission),nt=!1,We.active=!1,Xe=Fl(e.history,Xe.url,Xe.signal)}let{shortCircuited:ht,matches:Pt,loaderData:$t,errors:An}=await Te(Xe,ae,rt,at,We.active,_e,ue&&ue.submission,ue&&ue.fetcherSubmission,ue&&ue.replace,ue&&ue.initialHydration===!0,nt,St,ue&&ue.callSiteDefaultShouldRevalidate);ht||(W=null,fe(ae,{matches:Pt||rt,...UC(St),loaderData:$t,errors:An}))}async function Ee(X,ae,ue,Re,_e,rt,nt,We={}){Ce();let Xe=jj(ae,ue);if(ne({navigation:Xe},{flushSync:We.flushSync===!0}),rt){let ht=await un(Re,ae.pathname,X.signal);if(ht.type==="aborted")return{shortCircuited:!0};if(ht.type==="error"){if(ht.partialMatches.length===0){let{matches:$t,route:An}=gh(c);return{matches:$t,pendingActionResult:[An.id,{type:"error",error:ht.error}]}}let Pt=To(ht.partialMatches).route.id;return{matches:ht.partialMatches,pendingActionResult:[Pt,{type:"error",error:ht.error}]}}else if(ht.matches)Re=ht.matches;else{let{notFoundMatches:Pt,error:$t,route:An}=ft(ae.pathname);return{matches:Pt,pendingActionResult:[An.id,{type:"error",error:$t}]}}}let at,St=$h(Re,ae);if(!St.route.action&&!St.route.lazy)at={type:"error",error:gi(405,{method:X.method,pathname:ae.pathname,routeId:St.route.id})};else{let ht=ql(o,l,X,Re,St,nt?[]:r,_e),Pt=await ut(X,ht,_e,null);if(at=Pt[St.route.id],!at){for(let $t of Re)if(Pt[$t.route.id]){at=Pt[$t.route.id];break}}if(X.signal.aborted)return{shortCircuited:!0}}if(Ts(at)){let ht;return We&&We.replace!=null?ht=We.replace:ht=zC(at.response.headers.get("Location"),new URL(X.url),d,e.history)===A.location.pathname+A.location.search,await De(X,at,!0,{submission:ue,replace:ht}),{shortCircuited:!0}}if(Jr(at)){let ht=To(Re,St.route.id);return(We&&We.replace)!==!0&&(L="PUSH"),{matches:Re,pendingActionResult:[ht.route.id,at,St.route.id]}}return{matches:Re,pendingActionResult:[St.route.id,at]}}async function Te(X,ae,ue,Re,_e,rt,nt,We,Xe,at,St,ht,Pt){let $t=rt||Vy(ae,nt),An=nt||We||qC($t),In=!B&&!at;if(_e){if(In){let Hn=J(ht);ne({navigation:$t,...Hn!==void 0?{actionData:Hn}:{}},{flushSync:St})}let Jt=await un(ue,ae.pathname,X.signal);if(Jt.type==="aborted")return{shortCircuited:!0};if(Jt.type==="error"){if(Jt.partialMatches.length===0){let{matches:Mi,route:lr}=gh(c);return{matches:Mi,loaderData:{},errors:{[lr.id]:Jt.error}}}let Hn=To(Jt.partialMatches).route.id;return{matches:Jt.partialMatches,loaderData:{},errors:{[Hn]:Jt.error}}}else if(Jt.matches)ue=Jt.matches;else{let{error:Hn,notFoundMatches:Mi,route:lr}=ft(ae.pathname);return{matches:Mi,loaderData:{},errors:{[lr.id]:Hn}}}}let Pn=f||c,{dsMatches:Zt,revalidatingFetchers:rr}=IC(X,Re,o,l,e.history,A,ue,An,ae,at?[]:r,at===!0,_,z,Z,I,G,Pn,d,e.patchRoutesOnNavigation!=null,ht,Pt);if(P=++K,!e.dataStrategy&&!Zt.some(Jt=>Jt.shouldLoad)&&!Zt.some(Jt=>Jt.route.middleware&&Jt.route.middleware.length>0)&&rr.length===0){let Jt=tt();return fe(ae,{matches:ue,loaderData:{},errors:ht&&Jr(ht[1])?{[ht[0]]:ht[1].error}:null,...UC(ht),...Jt?{fetchers:new Map(A.fetchers)}:{}},{flushSync:St}),{shortCircuited:!0}}if(In){let Jt={};if(!_e){Jt.navigation=$t;let Hn=J(ht);Hn!==void 0&&(Jt.actionData=Hn)}rr.length>0&&(Jt.fetchers=Se(rr)),ne(Jt,{flushSync:St})}rr.forEach(Jt=>{ze(Jt.key),Jt.controller&&U.set(Jt.key,Jt.controller)});let Or=()=>rr.forEach(Jt=>ze(Jt.key));W&&W.signal.addEventListener("abort",Or);let{loaderResults:Mn,fetcherResults:Ri}=await he(Zt,rr,X,Re);if(X.signal.aborted)return{shortCircuited:!0};W&&W.signal.removeEventListener("abort",Or),rr.forEach(Jt=>U.delete(Jt.key));let qr=yh(Mn);if(qr)return await De(X,qr.result,!0,{replace:Xe}),{shortCircuited:!0};if(qr=yh(Ri),qr)return G.add(qr.key),await De(X,qr.result,!0,{replace:Xe}),{shortCircuited:!0};let{loaderData:ki,errors:ai}=BC(A,ue,Mn,ht,rr,Ri);at&&A.errors&&(ai={...A.errors,...ai});let fa=tt(),es=Ct(P),ts=fa||es||rr.length>0;return{matches:ue,loaderData:ki,errors:ai,...ts?{fetchers:new Map(A.fetchers)}:{}}}function J(X){if(X&&!Jr(X[1]))return{[X[0]]:X[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Se(X){return X.forEach(ae=>{let ue=A.fetchers.get(ae.key),Re=Au(void 0,ue?ue.data:void 0);A.fetchers.set(ae.key,Re)}),new Map(A.fetchers)}async function ve(X,ae,ue,Re){ze(X);let _e=(Re&&Re.flushSync)===!0,rt=f||c,nt=lv(A.location,A.matches,d,ue,ae,Re==null?void 0:Re.relative),We=Co(rt,nt,d),Xe=Tt(We,rt,nt);if(Xe.active&&Xe.matches&&(We=Xe.matches),!We){de(X,ae,gi(404,{pathname:nt}),{flushSync:_e});return}let{path:at,submission:St,error:ht}=DC(!0,nt,Re);if(ht){de(X,ae,ht,{flushSync:_e});return}let Pt=e.getContext?await e.getContext():new RC,$t=(Re&&Re.preventScrollReset)===!0;if(St&&yr(St.formMethod)){await Be(X,ae,at,We,Pt,Xe.active,_e,$t,St,Re&&Re.unstable_defaultShouldRevalidate);return}I.set(X,{routeId:ae,path:at}),await qe(X,ae,at,We,Pt,Xe.active,_e,$t,St)}async function Be(X,ae,ue,Re,_e,rt,nt,We,Xe,at){Ce(),I.delete(X);let St=A.fetchers.get(X);ee(X,_j(Xe,St),{flushSync:nt});let ht=new AbortController,Pt=Fl(e.history,ue,ht.signal,Xe);if(rt){let en=await un(Re,new URL(Pt.url).pathname,Pt.signal,X);if(en.type==="aborted")return;if(en.type==="error"){de(X,ae,en.error,{flushSync:nt});return}else if(en.matches)Re=en.matches;else{de(X,ae,gi(404,{pathname:ue}),{flushSync:nt});return}}let $t=$h(Re,ue);if(!$t.route.action&&!$t.route.lazy){let en=gi(405,{method:Xe.formMethod,pathname:ue,routeId:ae});de(X,ae,en,{flushSync:nt});return}U.set(X,ht);let An=K,In=ql(o,l,Pt,Re,$t,r,_e),Pn=await ut(Pt,In,_e,X),Zt=Pn[$t.route.id];if(!Zt){for(let en of In)if(Pn[en.route.id]){Zt=Pn[en.route.id];break}}if(Pt.signal.aborted){U.get(X)===ht&&U.delete(X);return}if(Z.has(X)){if(Ts(Zt)||Jr(Zt)){ee(X,Da(void 0));return}}else{if(Ts(Zt))if(U.delete(X),P>An){ee(X,Da(void 0));return}else return G.add(X),ee(X,Au(Xe)),De(Pt,Zt,!1,{fetcherSubmission:Xe,preventScrollReset:We});if(Jr(Zt)){de(X,ae,Zt.error);return}}let rr=A.navigation.location||A.location,Or=Fl(e.history,rr,ht.signal),Mn=f||c,Ri=A.navigation.state!=="idle"?Co(Mn,A.navigation.location,d):A.matches;Vt(Ri,"Didn't find any matches after fetcher action");let qr=++K;V.set(X,qr);let ki=Au(Xe,Zt.data);A.fetchers.set(X,ki);let{dsMatches:ai,revalidatingFetchers:fa}=IC(Or,_e,o,l,e.history,A,Ri,Xe,rr,r,!1,_,z,Z,I,G,Mn,d,e.patchRoutesOnNavigation!=null,[$t.route.id,Zt],at);fa.filter(en=>en.key!==X).forEach(en=>{let ns=en.key,nf=A.fetchers.get(ns),Fc=Au(void 0,nf?nf.data:void 0);A.fetchers.set(ns,Fc),ze(ns),en.controller&&U.set(ns,en.controller)}),ne({fetchers:new Map(A.fetchers)});let es=()=>fa.forEach(en=>ze(en.key));ht.signal.addEventListener("abort",es);let{loaderResults:ts,fetcherResults:Jt}=await he(ai,fa,Or,_e);if(ht.signal.aborted)return;if(ht.signal.removeEventListener("abort",es),V.delete(X),U.delete(X),fa.forEach(en=>U.delete(en.key)),A.fetchers.has(X)){let en=Da(Zt.data);A.fetchers.set(X,en)}let Hn=yh(ts);if(Hn)return De(Or,Hn.result,!1,{preventScrollReset:We});if(Hn=yh(Jt),Hn)return G.add(Hn.key),De(Or,Hn.result,!1,{preventScrollReset:We});let{loaderData:Mi,errors:lr}=BC(A,Ri,ts,void 0,fa,Jt);Ct(qr),A.navigation.state==="loading"&&qr>P?(Vt(L,"Expected pending action"),W&&W.abort(),fe(A.navigation.location,{matches:Ri,loaderData:Mi,errors:lr,fetchers:new Map(A.fetchers)})):(ne({errors:lr,loaderData:HC(A.loaderData,Mi,Ri,lr),fetchers:new Map(A.fetchers)}),_=!1)}async function qe(X,ae,ue,Re,_e,rt,nt,We,Xe){let at=A.fetchers.get(X);ee(X,Au(Xe,at?at.data:void 0),{flushSync:nt});let St=new AbortController,ht=Fl(e.history,ue,St.signal);if(rt){let Zt=await un(Re,new URL(ht.url).pathname,ht.signal,X);if(Zt.type==="aborted")return;if(Zt.type==="error"){de(X,ae,Zt.error,{flushSync:nt});return}else if(Zt.matches)Re=Zt.matches;else{de(X,ae,gi(404,{pathname:ue}),{flushSync:nt});return}}let Pt=$h(Re,ue);U.set(X,St);let $t=K,An=ql(o,l,ht,Re,Pt,r,_e),Pn=(await ut(ht,An,_e,X))[Pt.route.id];if(U.get(X)===St&&U.delete(X),!ht.signal.aborted){if(Z.has(X)){ee(X,Da(void 0));return}if(Ts(Pn))if(P>$t){ee(X,Da(void 0));return}else{G.add(X),await De(ht,Pn,!1,{preventScrollReset:We});return}if(Jr(Pn)){de(X,ae,Pn.error);return}ee(X,Da(Pn.data))}}async function De(X,ae,ue,{submission:Re,fetcherSubmission:_e,preventScrollReset:rt,replace:nt}={}){ue||(H==null||H.resolve(),H=null),ae.response.headers.has("X-Remix-Revalidate")&&(_=!0);let We=ae.response.headers.get("Location");Vt(We,"Expected a Location header on the redirect Response"),We=zC(We,new URL(X.url),d,e.history);let Xe=pd(A.location,We,{_isRedirect:!0});if(n){let An=!1;if(ae.response.headers.has("X-Remix-Reload-Document"))An=!0;else if(Tx(We)){const In=gM(We,!0);An=In.origin!==t.location.origin||Si(In.pathname,d)==null}if(An){nt?t.location.replace(We):t.location.assign(We);return}}W=null;let at=nt===!0||ae.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:St,formAction:ht,formEncType:Pt}=A.navigation;!Re&&!_e&&St&&ht&&Pt&&(Re=qC(A.navigation));let $t=Re||_e;if(fj.has(ae.response.status)&&$t&&yr($t.formMethod))await Oe(at,Xe,{submission:{...$t,formAction:We},preventScrollReset:rt||F,enableViewTransition:ue?j:void 0});else{let An=Vy(Xe,Re);await Oe(at,Xe,{overrideNavigation:An,fetcherSubmission:_e,preventScrollReset:rt||F,enableViewTransition:ue?j:void 0})}}async function ut(X,ae,ue,Re){var nt;let _e,rt={};try{_e=await Sj(m,X,ae,Re,ue,!1)}catch(We){return ae.filter(Xe=>Xe.shouldLoad).forEach(Xe=>{rt[Xe.route.id]={type:"error",error:We}}),rt}if(X.signal.aborted)return rt;if(!yr(X.method))for(let We of ae){if(((nt=_e[We.route.id])==null?void 0:nt.type)==="error")break;!_e.hasOwnProperty(We.route.id)&&!A.loaderData.hasOwnProperty(We.route.id)&&(!A.errors||!A.errors.hasOwnProperty(We.route.id))&&We.shouldCallHandler()&&(_e[We.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${We.route.id}`)})}for(let[We,Xe]of Object.entries(_e))if(Dj(Xe)){let at=Xe.result;rt[We]={type:"redirect",response:Rj(at,X,We,ae,d)}}else rt[We]=await Tj(Xe);return rt}async function he(X,ae,ue,Re){let _e=ut(ue,X,Re,null),rt=Promise.all(ae.map(async Xe=>{if(Xe.matches&&Xe.match&&Xe.request&&Xe.controller){let St=(await ut(Xe.request,Xe.matches,Re,Xe.key))[Xe.match.route.id];return{[Xe.key]:St}}else return Promise.resolve({[Xe.key]:{type:"error",error:gi(404,{pathname:Xe.path})}})})),nt=await _e,We=(await rt).reduce((Xe,at)=>Object.assign(Xe,at),{});return{loaderResults:nt,fetcherResults:We}}function Ce(){_=!0,I.forEach((X,ae)=>{U.has(ae)&&z.add(ae),ze(ae)})}function ee(X,ae,ue={}){A.fetchers.set(X,ae),ne({fetchers:new Map(A.fetchers)},{flushSync:(ue&&ue.flushSync)===!0})}function de(X,ae,ue,Re={}){let _e=To(A.matches,ae);$e(X),ne({errors:{[_e.route.id]:ue},fetchers:new Map(A.fetchers)},{flushSync:(Re&&Re.flushSync)===!0})}function Ae(X){return Q.set(X,(Q.get(X)||0)+1),Z.has(X)&&Z.delete(X),A.fetchers.get(X)||hj}function He(X,ae){ze(X,ae==null?void 0:ae.reason),ee(X,Da(null))}function $e(X){let ae=A.fetchers.get(X);U.has(X)&&!(ae&&ae.state==="loading"&&V.has(X))&&ze(X),I.delete(X),V.delete(X),G.delete(X),Z.delete(X),z.delete(X),A.fetchers.delete(X)}function et(X){let ae=(Q.get(X)||0)-1;ae<=0?(Q.delete(X),Z.add(X)):Q.set(X,ae),ne({fetchers:new Map(A.fetchers)})}function ze(X,ae){let ue=U.get(X);ue&&(ue.abort(ae),U.delete(X))}function Ze(X){for(let ae of X){let ue=Ae(ae),Re=Da(ue.data);A.fetchers.set(ae,Re)}}function tt(){let X=[],ae=!1;for(let ue of G){let Re=A.fetchers.get(ue);Vt(Re,`Expected fetcher: ${ue}`),Re.state==="loading"&&(G.delete(ue),X.push(ue),ae=!0)}return Ze(X),ae}function Ct(X){let ae=[];for(let[ue,Re]of V)if(Re<X){let _e=A.fetchers.get(ue);Vt(_e,`Expected fetcher: ${ue}`),_e.state==="loading"&&(ze(ue),V.delete(ue),ae.push(ue))}return Ze(ae),ae.length>0}function zt(X,ae){let ue=A.blockers.get(X)||Ou;return te.get(X)!==ae&&te.set(X,ae),ue}function gt(X){A.blockers.delete(X),te.delete(X)}function Ot(X,ae){let ue=A.blockers.get(X)||Ou;Vt(ue.state==="unblocked"&&ae.state==="blocked"||ue.state==="blocked"&&ae.state==="blocked"||ue.state==="blocked"&&ae.state==="proceeding"||ue.state==="blocked"&&ae.state==="unblocked"||ue.state==="proceeding"&&ae.state==="unblocked",`Invalid blocker state transition: ${ue.state} -> ${ae.state}`);let Re=new Map(A.blockers);Re.set(X,ae),ne({blockers:Re})}function it({currentLocation:X,nextLocation:ae,historyAction:ue}){if(te.size===0)return;te.size>1&&Xn(!1,"A router only supports one blocker at a time");let Re=Array.from(te.entries()),[_e,rt]=Re[Re.length-1],nt=A.blockers.get(_e);if(!(nt&&nt.state==="proceeding")&&rt({currentLocation:X,nextLocation:ae,historyAction:ue}))return _e}function ft(X){let ae=gi(404,{pathname:X}),ue=f||c,{matches:Re,route:_e}=gh(ue);return{notFoundMatches:Re,route:_e,error:ae}}function yt(X,ae,ue){if(w=X,T=ae,C=ue||null,!S&&A.navigation===Uy){S=!0;let Re=jt(A.location,A.matches);Re!=null&&ne({restoreScrollPosition:Re})}return()=>{w=null,T=null,C=null}}function Ke(X,ae){return C&&C(X,ae.map(Re=>BL(Re,A.loaderData)))||X.key}function Rt(X,ae){if(w&&T){let ue=Ke(X,ae);w[ue]=T()}}function jt(X,ae){if(w){let ue=Ke(X,ae),Re=w[ue];if(typeof Re=="number")return Re}return null}function Tt(X,ae,ue){if(e.patchRoutesOnNavigation)if(X){if(Object.keys(X[0].params).length>0)return{active:!0,matches:Yu(ae,ue,d,!0)}}else return{active:!0,matches:Yu(ae,ue,d,!0)||[]};return{active:!1,matches:null}}async function un(X,ae,ue,Re){if(!e.patchRoutesOnNavigation)return{type:"success",matches:X};let _e=X;for(;;){let rt=f==null,nt=f||c,We=l;try{await e.patchRoutesOnNavigation({signal:ue,path:ae,matches:_e,fetcherKey:Re,patch:(St,ht)=>{ue.aborted||PC(St,ht,nt,We,o,!1)}})}catch(St){return{type:"error",error:St,partialMatches:_e}}finally{rt&&!ue.aborted&&(c=[...c])}if(ue.aborted)return{type:"aborted"};let Xe=Co(nt,ae,d),at=null;if(Xe){if(Object.keys(Xe[0].params).length===0)return{type:"success",matches:Xe};if(at=Yu(nt,ae,d,!0),!(at&&_e.length<at.length&&Ht(_e,at.slice(0,_e.length))))return{type:"success",matches:Xe}}if(at||(at=Yu(nt,ae,d,!0)),!at||Ht(_e,at))return{type:"success",matches:null};_e=at}}function Ht(X,ae){return X.length===ae.length&&X.every((ue,Re)=>ue.route.id===ae[Re].route.id)}function Je(X){l={},f=md(X,o,void 0,l)}function kt(X,ae,ue=!1){let Re=f==null;PC(X,ae,f||c,l,o,ue),Re&&(c=[...c],ne({}))}return O={get basename(){return d},get future(){return h},get state(){return A},get routes(){return c},get window(){return t},initialize:we,subscribe:Pe,enableScrollRestoration:yt,navigate:ye,fetch:ve,revalidate:Le,createHref:X=>e.history.createHref(X),encodeLocation:X=>e.history.encodeLocation(X),getFetcher:Ae,resetFetcher:He,deleteFetcher:et,dispose:Me,getBlocker:zt,deleteBlocker:gt,patchRoutes:kt,_internalFetchControllers:U,_internalSetRoutes:Je,_internalSetStateDoNotUseOrYouWillBreakYourApp(X){ne(X)}},e.unstable_instrumentations&&(O=ij(O,e.unstable_instrumentations.map(X=>X.router).filter(Boolean))),O}function gj(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function lv(e,t,n,r,a,o){let l,c;if(a){l=[];for(let d of t)if(l.push(d),d.route.id===a){c=d;break}}else l=t,c=t[t.length-1];let f=kx(r||".",Rx(l),Si(e.pathname,n)||e.pathname,o==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&c){let d=Ax(f.search);if(c.route.index&&!d)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let m=new URLSearchParams(f.search),h=m.getAll("index");m.delete("index"),h.filter(g=>g).forEach(g=>m.append("index",g));let y=m.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=ZL({basename:n,pathname:f.pathname})),na(f)}function DC(e,t,n){if(!n||!gj(n))return{path:t};if(n.formMethod&&!Lj(n.formMethod))return{path:t,error:gi(405,{method:n.formMethod})};let r=()=>({path:t,error:gi(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),l=PM(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!yr(o))return r();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[g,w])=>`${y}${g}=${w}
60
- `,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!yr(o))return r();try{let h=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:h,text:void 0}}}catch{return r()}}}Vt(typeof FormData=="function","FormData is not available in this environment");let c,f;if(n.formData)c=dv(n.formData),f=n.formData;else if(n.body instanceof FormData)c=dv(n.body),f=n.body;else if(n.body instanceof URLSearchParams)c=n.body,f=FC(c);else if(n.body==null)c=new URLSearchParams,f=new FormData;else try{c=new URLSearchParams(n.body),f=FC(c)}catch{return r()}let d={formMethod:o,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(yr(d.formMethod))return{path:t,submission:d};let m=Yo(t);return e&&m.search&&Ax(m.search)&&c.append("index",""),m.search=`?${c}`,{path:na(m),submission:d}}function IC(e,t,n,r,a,o,l,c,f,d,m,h,y,g,w,C,T,S,R,k,M){var B;let D=k?Jr(k[1])?k[1].error:k[1].data:void 0,O=a.createURL(o.location),A=a.createURL(f),L;if(m&&o.errors){let _=Object.keys(o.errors)[0];L=l.findIndex(z=>z.route.id===_)}else if(k&&Jr(k[1])){let _=k[0];L=l.findIndex(z=>z.route.id===_)-1}let H=k?k[1].statusCode:void 0,F=H&&H>=400,W={currentUrl:O,currentParams:((B=o.matches[0])==null?void 0:B.params)||{},nextUrl:A,nextParams:l[0].params,...c,actionResult:D,actionStatus:H},j=jd(l),q=l.map((_,z)=>{let{route:U}=_,K=null;if(L!=null&&z>L?K=!1:U.lazy?K=!0:Mx(U)?m?K=cv(U,o.loaderData,o.errors):yj(o.loaderData,o.matches[z],_)&&(K=!0):K=!1,K!==null)return uv(n,r,e,j,_,d,t,K);let P=!1;typeof M=="boolean"?P=M:F?P=!1:(h||O.pathname+O.search===A.pathname+A.search||O.search!==A.search||bj(o.matches[z],_))&&(P=!0);let V={...W,defaultShouldRevalidate:P},G=Xu(_,V);return uv(n,r,e,j,_,d,t,G,V,M)}),$=[];return w.forEach((_,z)=>{if(m||!l.some(Z=>Z.route.id===_.routeId)||g.has(z))return;let U=o.fetchers.get(z),K=U&&U.state!=="idle"&&U.data===void 0,P=Co(T,_.path,S);if(!P){if(R&&K)return;$.push({key:z,routeId:_.routeId,path:_.path,matches:null,match:null,request:null,controller:null});return}if(C.has(z))return;let V=$h(P,_.path),G=new AbortController,I=Fl(a,_.path,G.signal),Q=null;if(y.has(z))y.delete(z),Q=ql(n,r,I,P,V,d,t);else if(K)h&&(Q=ql(n,r,I,P,V,d,t));else{let Z;typeof M=="boolean"?Z=M:F?Z=!1:Z=h;let te={...W,defaultShouldRevalidate:Z};Xu(V,te)&&(Q=ql(n,r,I,P,V,d,t,te))}Q&&$.push({key:z,routeId:_.routeId,path:_.path,matches:Q,match:V,request:I,controller:G})}),{dsMatches:q,revalidatingFetchers:$}}function Mx(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function cv(e,t,n){if(e.lazy)return!0;if(!Mx(e))return!1;let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;return!r&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!a}function yj(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function bj(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Xu(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function PC(e,t,n,r,a,o){let l;if(e){let d=r[e];Vt(d,`No route found to patch children into: routeId = ${e}`),d.children||(d.children=[]),l=d.children}else l=n;let c=[],f=[];if(t.forEach(d=>{let m=l.find(h=>OM(d,h));m?f.push({existingRoute:m,newRoute:d}):c.push(d)}),c.length>0){let d=md(c,a,[e||"_","patch",String((l==null?void 0:l.length)||"0")],r);l.push(...d)}if(o&&f.length>0)for(let d=0;d<f.length;d++){let{existingRoute:m,newRoute:h}=f[d],y=m,[g]=md([h],a,[],{},!0);Object.assign(y,{element:g.element?g.element:y.element,errorElement:g.errorElement?g.errorElement:y.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:y.hydrateFallbackElement})}}function OM(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var a;return(a=t.children)==null?void 0:a.some(o=>OM(n,o))}):!1}var LC=new WeakMap,AM=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(Vt(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let l=LC.get(a);l||(l={},LC.set(a,l));let c=l[e];if(c)return c;let f=(async()=>{let d=jL(e),h=a[e]!==void 0&&e!=="hasErrorBoundary";if(d)Xn(!d,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(h)Xn(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await o();y!=null&&(Object.assign(a,{[e]:y}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(y=>y===void 0)&&(a.lazy=void 0))})();return l[e]=f,f},jC=new WeakMap;function vj(e,t,n,r,a){let o=n[e.id];if(Vt(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=jC.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let h=(async()=>{Vt(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),g={};for(let w in y){let C=y[w];if(C===void 0)continue;let T=zL(w),R=o[w]!==void 0&&w!=="hasErrorBoundary";T?Xn(!T,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?Xn(!R,`Route "${o.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):g[w]=C}Object.assign(o,g),Object.assign(o,{...r(o),lazy:void 0})})();return jC.set(o,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let l=Object.keys(e.lazy),c=[],f;for(let m of l){if(a&&a.includes(m))continue;let h=AM({key:m,route:e,manifest:n,mapRouteProperties:r});h&&(c.push(h),m===t&&(f=h))}let d=c.length>0?Promise.all(c).then(()=>{}):void 0;return d==null||d.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:f}}async function _C(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{n[t[o].route.id]=a}),n}async function xj(e){return e.matches.some(t=>t.route.middleware)?NM(e,()=>_C(e)):_C(e)}function NM(e,t){return wj(e,t,r=>{if(Pj(r))throw r;return r},Aj,n);function n(r,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:r}}));{let{matches:l}=e,c=Math.min(Math.max(l.findIndex(d=>d.route.id===a),0),Math.max(l.findIndex(d=>d.shouldCallHandler()),0)),f=To(l,l[c].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function wj(e,t,n,r,a){let{matches:o,request:l,params:c,context:f,unstable_pattern:d}=e,m=o.flatMap(y=>y.route.middleware?y.route.middleware.map(g=>[y.route.id,g]):[]);return await DM({request:l,params:c,context:f,unstable_pattern:d},m,t,n,r,a)}async function DM(e,t,n,r,a,o,l=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason??new Error(`Request aborted: ${c.method} ${c.url}`);let f=t[l];if(!f)return await n();let[d,m]=f,h,y=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");try{return h={value:await DM(e,t,n,r,a,o,l+1)},h.value}catch(g){return h={value:await o(g,d,h)},h.value}};try{let g=await m(e,y),w=g!=null?r(g):void 0;return a(w)?w:h?w??h.value:(h={value:await y()},h.value)}catch(g){return await o(g,d,h)}}function IM(e,t,n,r,a){let o=AM({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=vj(r.route,yr(n.method)?"action":"loader",t,e,a);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function uv(e,t,n,r,a,o,l,c,f=null,d){let m=!1,h=IM(e,t,n,a,o);return{...a,_lazyPromises:h,shouldLoad:c,shouldRevalidateArgs:f,shouldCallHandler(y){return m=!0,f?typeof d=="boolean"?Xu(a,{...f,defaultShouldRevalidate:d}):typeof y=="boolean"?Xu(a,{...f,defaultShouldRevalidate:y}):Xu(a,f):c},resolve(y){let{lazy:g,loader:w,middleware:C}=a.route,T=m||c||y&&!yr(n.method)&&(g||w),S=C&&C.length>0&&!w&&!g;return T&&(yr(n.method)||!S)?Ej({request:n,unstable_pattern:r,match:a,lazyHandlerPromise:h==null?void 0:h.handler,lazyRoutePromise:h==null?void 0:h.route,handlerOverride:y,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function ql(e,t,n,r,a,o,l,c=null){return r.map(f=>f.route.id!==a.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:IM(e,t,n,f,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:uv(e,t,n,jd(r),f,o,l,!0,c))}async function Sj(e,t,n,r,a,o){n.some(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware}));let l={request:t,unstable_pattern:jd(n),params:n[0].params,context:a,matches:n},f=await e({...l,fetcherKey:r,runClientMiddleware:d=>{let m=l;return NM(m,()=>d({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(d=>{var m,h;return[(m=d._lazyPromises)==null?void 0:m.handler,(h=d._lazyPromises)==null?void 0:h.route]}))}catch{}return f}async function Ej({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:a,handlerOverride:o,scopedContext:l}){let c,f,d=yr(e.method),m=d?"action":"loader",h=y=>{let g,w=new Promise((S,R)=>g=R);f=()=>g(),e.signal.addEventListener("abort",f);let C=S=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:l},...S!==void 0?[S]:[]),T=(async()=>{try{return{type:"data",result:await(o?o(R=>C(R)):C())}}catch(S){return{type:"error",result:S}}})();return Promise.race([T,w])};try{let y=d?n.route.action:n.route.loader;if(r||a)if(y){let g,[w]=await Promise.all([h(y).catch(C=>{g=C}),r,a]);if(g!==void 0)throw g;c=w}else{await r;let g=d?n.route.action:n.route.loader;if(g)[c]=await Promise.all([h(g),a]);else if(m==="action"){let w=new URL(e.url),C=w.pathname+w.search;throw gi(405,{method:e.method,pathname:C,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)c=await h(y);else{let g=new URL(e.url),w=g.pathname+g.search;throw gi(404,{pathname:w})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return c}async function Cj(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Tj(e){var r,a,o,l,c;let{result:t,type:n}=e;if(Ox(t)){let f;try{f=await Cj(t)}catch(d){return{type:"error",error:d}}return n==="error"?{type:"error",error:new Ld(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?VC(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:Oj(t),statusCode:gd(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:gd(t)?t.status:void 0}:VC(t)?{type:"data",data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Rj(e,t,n,r,a){let o=e.headers.get("Location");if(Vt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Tx(o)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);o=lv(new URL(t.url),l,a,o),e.headers.set("Location",o)}return e}function zC(e,t,n,r){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Tx(e)){let o=e,l=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(a.includes(l.protocol))throw new Error("Invalid redirect location");let c=Si(l.pathname,n)!=null;if(l.origin===t.origin&&c)return l.pathname+l.search+l.hash}try{let o=r.createURL(e);if(a.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Fl(e,t,n,r){let a=e.createURL(PM(t)).toString(),o={signal:n};if(r&&yr(r.formMethod)){let{formMethod:l,formEncType:c}=r;o.method=l.toUpperCase(),c==="application/json"?(o.headers=new Headers({"Content-Type":c}),o.body=JSON.stringify(r.json)):c==="text/plain"?o.body=r.text:c==="application/x-www-form-urlencoded"&&r.formData?o.body=dv(r.formData):o.body=r.formData}return new Request(a,o)}function dv(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function FC(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function kj(e,t,n,r=!1,a=!1){let o={},l=null,c,f=!1,d={},m=n&&Jr(n[1])?n[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let y=h.route.id,g=t[y];if(Vt(!Ts(g),"Cannot handle redirect results in processLoaderData"),Jr(g)){let w=g.error;if(m!==void 0&&(w=m,m=void 0),l=l||{},a)l[y]=w;else{let C=To(e,y);l[C.route.id]==null&&(l[C.route.id]=w)}r||(o[y]=MM),f||(f=!0,c=gd(g.error)?g.error.status:500),g.headers&&(d[y]=g.headers)}else o[y]=g.data,g.statusCode&&g.statusCode!==200&&!f&&(c=g.statusCode),g.headers&&(d[y]=g.headers)}),m!==void 0&&n&&(l={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:l,statusCode:c||200,loaderHeaders:d}}function BC(e,t,n,r,a,o){let{loaderData:l,errors:c}=kj(t,n,r);return a.filter(f=>!f.matches||f.matches.some(d=>d.shouldLoad)).forEach(f=>{let{key:d,match:m,controller:h}=f;if(h&&h.signal.aborted)return;let y=o[d];if(Vt(y,"Did not find corresponding fetcher result"),Jr(y)){let g=To(e.matches,m==null?void 0:m.route.id);c&&c[g.route.id]||(c={...c,[g.route.id]:y.error}),e.fetchers.delete(d)}else if(Ts(y))Vt(!1,"Unhandled fetcher revalidation redirect");else{let g=Da(y.data);e.fetchers.set(d,g)}}),{loaderData:l,errors:c}}function HC(e,t,n,r){let a=Object.entries(t).filter(([,o])=>o!==MM).reduce((o,[l,c])=>(o[l]=c,o),{});for(let o of n){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(a[l]=e[l]),r&&r.hasOwnProperty(l))break}return a}function UC(e){return e?Jr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function To(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function gh(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function gi(e,{pathname:t,routeId:n,method:r,type:a,message:o}={}){let l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",r&&t&&n?c=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c=`Route "${n}" does not match URL "${t}"`):e===404?(l="Not Found",c=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",r&&t&&n?c=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(c=`Invalid request method "${r.toUpperCase()}"`)),new Ld(e||500,l,new Error(c),!0)}function yh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(Ts(a))return{key:r,result:a}}}function PM(e){let t=typeof e=="string"?Yo(e):e;return na({...t,hash:""})}function Mj(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Oj(e){var t,n;return new Ld(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function Aj(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&Nj(n))}function Nj(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function Dj(e){return Ox(e.result)&&RM.has(e.result.status)}function Jr(e){return e.type==="error"}function Ts(e){return(e&&e.type)==="redirect"}function VC(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ox(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Ij(e){return RM.has(e)}function Pj(e){return Ox(e)&&Ij(e.status)&&e.headers.has("Location")}function Lj(e){return dj.has(e.toUpperCase())}function yr(e){return cj.has(e.toUpperCase())}function Ax(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function $h(e,t){let n=typeof t=="string"?Yo(t).search:t.search;if(e[e.length-1].route.index&&Ax(n||""))return e[e.length-1];let r=wM(e);return r[r.length-1]}function qC(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:o,json:l}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function Vy(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function jj(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Au(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function _j(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Da(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function zj(e,t){try{let n=e.sessionStorage.getItem(kM);if(n){let r=JSON.parse(n);for(let[a,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function Fj(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(kM,JSON.stringify(n))}catch(r){Xn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function $C(){let e,t,n=new Promise((r,a)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{a(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Zs=v.createContext(null);Zs.displayName="DataRouter";var _d=v.createContext(null);_d.displayName="DataRouterState";var LM=v.createContext(!1);function Bj(){return v.useContext(LM)}var Nx=v.createContext({isTransitioning:!1});Nx.displayName="ViewTransition";var jM=v.createContext(new Map);jM.displayName="Fetchers";var Hj=v.createContext(null);Hj.displayName="Await";var Ci=v.createContext(null);Ci.displayName="Navigation";var Bp=v.createContext(null);Bp.displayName="Location";var Bi=v.createContext({outlet:null,matches:[],isDataRoute:!1});Bi.displayName="Route";var Dx=v.createContext(null);Dx.displayName="RouteError";var _M="REACT_ROUTER_ERROR",Uj="REDIRECT",Vj="ROUTE_ERROR_RESPONSE";function qj(e){if(e.startsWith(`${_M}:${Uj}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function $j(e){if(e.startsWith(`${_M}:${Vj}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ld(t.status,t.statusText,t.data)}catch{}}function Yj(e,{relative:t}={}){Vt(Tc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(Ci),{hash:a,pathname:o,search:l}=zd(e,{relative:t}),c=o;return n!=="/"&&(c=o==="/"?n:Ji([n,o])),r.createHref({pathname:c,search:l,hash:a})}function Tc(){return v.useContext(Bp)!=null}function sa(){return Vt(Tc(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Bp).location}function Wj(e){Vt(Tc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=sa();return v.useMemo(()=>hc(e,vM(t)),[t,e])}var zM="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function FM(e){v.useContext(Ci).static||v.useLayoutEffect(e)}function Ix(){let{isDataRoute:e}=v.useContext(Bi);return e?c_():Kj()}function Kj(){Vt(Tc(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Zs),{basename:t,navigator:n}=v.useContext(Ci),{matches:r}=v.useContext(Bi),{pathname:a}=sa(),o=JSON.stringify(Rx(r)),l=v.useRef(!1);return FM(()=>{l.current=!0}),v.useCallback((f,d={})=>{if(Xn(l.current,zM),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=kx(f,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Ji([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,o,a,e])}var Gj=v.createContext(null);function Xj(e){let t=v.useContext(Bi).outlet;return v.useMemo(()=>t&&v.createElement(Gj.Provider,{value:e},t),[t,e])}function Qj(){let{matches:e}=v.useContext(Bi),t=e[e.length-1];return t?t.params:{}}function zd(e,{relative:t}={}){let{matches:n}=v.useContext(Bi),{pathname:r}=sa(),a=JSON.stringify(Rx(n));return v.useMemo(()=>kx(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function Zj(e,t,n,r,a){Vt(Tc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=v.useContext(Ci),{matches:l}=v.useContext(Bi),c=l[l.length-1],f=c?c.params:{},d=c?c.pathname:"/",m=c?c.pathnameBase:"/",h=c&&c.route;{let R=h&&h.path||"";HM(d,!h||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
61
-
62
- Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let y=sa(),g;g=y;let w=g.pathname||"/",C=w;if(m!=="/"){let R=m.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(R.length).join("/")}let T=Co(e,{pathname:C});return Xn(h||T!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Xn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),r_(T&&T.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Ji([m,o.encodeLocation?o.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?m:Ji([m,o.encodeLocation?o.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),l,n,r,a)}function Jj(){let e=l_(),t=gd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:a},n):null,l)}var e_=v.createElement(Jj,null),BM=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=$j(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(Bi.Provider,{value:this.props.routeContext},v.createElement(Dx.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(t_,{error:e},t):t}};BM.contextType=LM;var qy=new WeakMap;function t_({children:e,error:t}){let{basename:n}=v.useContext(Ci);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=qj(t.digest);if(r){let a=qy.get(t);if(a)throw a;let o=EM(r.location,n);if(SM&&!qy.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw qy.set(t,l),l}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function n_({routeContext:e,match:t,children:n}){let r=v.useContext(Zs);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Bi.Provider,{value:e},n)}function r_(e,t=[],n=null,r=null,a=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=n==null?void 0:n.errors;if(l!=null){let m=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);Vt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let c=!1,f=-1;if(n)for(let m=0;m<o.length;m++){let h=o[m];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(f=m),h.route.id){let{loaderData:y,errors:g}=n,w=h.route.loader&&!y.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||w){c=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}let d=n&&r?(m,h)=>{var y,g;r(m,{location:n.location,params:((g=(y=n.matches)==null?void 0:y[0])==null?void 0:g.params)??{},unstable_pattern:jd(n.matches),errorInfo:h})}:void 0;return o.reduceRight((m,h,y)=>{let g,w=!1,C=null,T=null;n&&(g=l&&h.route.id?l[h.route.id]:void 0,C=h.route.errorElement||e_,c&&(f<0&&y===0?(HM("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,T=null):f===y&&(w=!0,T=h.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,y+1)),R=()=>{let k;return g?k=C:w?k=T:h.route.Component?k=v.createElement(h.route.Component,null):h.route.element?k=h.route.element:k=m,v.createElement(n_,{match:h,routeContext:{outlet:m,matches:S,isDataRoute:n!=null},children:k})};return n&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?v.createElement(BM,{location:n.location,revalidation:n.revalidation,component:C,error:g,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:d}):R()},null)}function Px(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function i_(e){let t=v.useContext(Zs);return Vt(t,Px(e)),t}function a_(e){let t=v.useContext(_d);return Vt(t,Px(e)),t}function o_(e){let t=v.useContext(Bi);return Vt(t,Px(e)),t}function Lx(e){let t=o_(e),n=t.matches[t.matches.length-1];return Vt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function s_(){return Lx("useRouteId")}function l_(){var r;let e=v.useContext(Dx),t=a_("useRouteError"),n=Lx("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function c_(){let{router:e}=i_("useNavigate"),t=Lx("useNavigate"),n=v.useRef(!1);return FM(()=>{n.current=!0}),v.useCallback(async(a,o={})=>{Xn(n.current,zM),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var YC={};function HM(e,t,n){!t&&!YC[e]&&(YC[e]=!0,Xn(!1,n))}var WC={};function KC(e,t){!e&&!WC[t]&&(WC[t]=!0,console.warn(t))}var u_="useOptimistic",GC=Cx[u_],d_=()=>{};function f_(e){return GC?GC(e):[e,d_]}function h_(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Xn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Xn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Xn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var p_=["HydrateFallback","hydrateFallbackElement"],m_=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function g_({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=Bj()||r;let[o,l]=v.useState(e.state),[c,f]=f_(o),[d,m]=v.useState(),[h,y]=v.useState({isTransitioning:!1}),[g,w]=v.useState(),[C,T]=v.useState(),[S,R]=v.useState(),k=v.useRef(new Map),M=v.useCallback((L,{deletedFetchers:H,newErrors:F,flushSync:W,viewTransitionOpts:j})=>{F&&n&&Object.values(F).forEach($=>{var B;return n($,{location:L.location,params:((B=L.matches[0])==null?void 0:B.params)??{},unstable_pattern:jd(L.matches)})}),L.fetchers.forEach(($,B)=>{$.data!==void 0&&k.current.set(B,$.data)}),H.forEach($=>k.current.delete($)),KC(W===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let q=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(KC(j==null||q,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!j||!q){t&&W?t(()=>l(L)):r===!1?l(L):v.startTransition(()=>{r===!0&&f($=>XC($,L)),l(L)});return}if(t&&W){t(()=>{C&&(g==null||g.resolve(),C.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:j.currentLocation,nextLocation:j.nextLocation})});let $=e.window.document.startViewTransition(()=>{t(()=>l(L))});$.finished.finally(()=>{t(()=>{w(void 0),T(void 0),m(void 0),y({isTransitioning:!1})})}),t(()=>T($));return}C?(g==null||g.resolve(),C.skipTransition(),R({state:L,currentLocation:j.currentLocation,nextLocation:j.nextLocation})):(m(L),y({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}))},[e.window,t,C,g,r,f,n]);v.useLayoutEffect(()=>e.subscribe(M),[e,M]),v.useEffect(()=>{h.isTransitioning&&!h.flushSync&&w(new m_)},[h]),v.useEffect(()=>{if(g&&d&&e.window){let L=d,H=g.promise,F=e.window.document.startViewTransition(async()=>{r===!1?l(L):v.startTransition(()=>{r===!0&&f(W=>XC(W,L)),l(L)}),await H});F.finished.finally(()=>{w(void 0),T(void 0),m(void 0),y({isTransitioning:!1})}),T(F)}},[d,g,e.window,r,f]),v.useEffect(()=>{g&&d&&c.location.key===d.location.key&&g.resolve()},[g,C,c.location,d]),v.useEffect(()=>{!h.isTransitioning&&S&&(m(S.state),y({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),R(void 0))},[h.isTransitioning,S]);let D=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:L=>e.navigate(L),push:(L,H,F)=>e.navigate(L,{state:H,preventScrollReset:F==null?void 0:F.preventScrollReset}),replace:(L,H,F)=>e.navigate(L,{replace:!0,state:H,preventScrollReset:F==null?void 0:F.preventScrollReset})}),[e]),O=e.basename||"/",A=v.useMemo(()=>({router:e,navigator:D,static:!1,basename:O,onError:n}),[e,D,O,n]);return v.createElement(v.Fragment,null,v.createElement(Zs.Provider,{value:A},v.createElement(_d.Provider,{value:c},v.createElement(jM.Provider,{value:k.current},v.createElement(Nx.Provider,{value:h},v.createElement(x_,{basename:O,location:c.location,navigationType:c.historyAction,navigator:D,unstable_useTransitions:r},v.createElement(y_,{routes:e.routes,future:e.future,state:c,onError:n})))))),null)}function XC(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var y_=v.memo(b_);function b_({routes:e,future:t,state:n,onError:r}){return Zj(e,void 0,n,r,t)}function v_(e){return Xj(e.context)}function x_({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1,unstable_useTransitions:l}){Vt(!Tc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:c,navigator:a,static:o,unstable_useTransitions:l,future:{}}),[c,a,o,l]);typeof n=="string"&&(n=Yo(n));let{pathname:d="/",search:m="",hash:h="",state:y=null,key:g="default"}=n,w=v.useMemo(()=>{let C=Si(d,c);return C==null?null:{location:{pathname:C,search:m,hash:h,state:y,key:g},navigationType:r}},[c,d,m,h,y,g,r]);return Xn(w!=null,`<Router basename="${c}"> is not able to match the URL "${d}${m}${h}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:v.createElement(Ci.Provider,{value:f},v.createElement(Bp.Provider,{children:t,value:w}))}var Yh="get",Wh="application/x-www-form-urlencoded";function Hp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function w_(e){return Hp(e)&&e.tagName.toLowerCase()==="button"}function S_(e){return Hp(e)&&e.tagName.toLowerCase()==="form"}function E_(e){return Hp(e)&&e.tagName.toLowerCase()==="input"}function C_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function T_(e,t){return e.button===0&&(!t||t==="_self")&&!C_(e)}var bh=null;function R_(){if(bh===null)try{new FormData(document.createElement("form"),0),bh=!1}catch{bh=!0}return bh}var k_=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $y(e){return e!=null&&!k_.has(e)?(Xn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Wh}"`),null):e}function M_(e,t){let n,r,a,o,l;if(S_(e)){let c=e.getAttribute("action");r=c?Si(c,t):null,n=e.getAttribute("method")||Yh,a=$y(e.getAttribute("enctype"))||Wh,o=new FormData(e)}else if(w_(e)||E_(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(r=f?Si(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Yh,a=$y(e.getAttribute("formenctype"))||$y(c.getAttribute("enctype"))||Wh,o=new FormData(c,e),!R_()){let{name:d,type:m,value:h}=e;if(m==="image"){let y=d?`${d}.`:"";o.append(`${y}x`,"0"),o.append(`${y}y`,"0")}else d&&o.append(d,h)}}else{if(Hp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Yh,r=null,a=Wh,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function jx(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function O_(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&Si(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function A_(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function N_(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function D_(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await A_(o,n);return l.links?l.links():[]}return[]}));return j_(r.flat(1).filter(N_).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function QC(e,t,n,r,a,o){let l=(f,d)=>n[d]?f.route.id!==n[d].route.id:!0,c=(f,d)=>{var m;return n[d].pathname!==f.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,d)=>l(f,d)||c(f,d)):o==="data"?t.filter((f,d)=>{var h;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(l(f,d)||c(f,d))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function I_(e,t,{includeHydrateFallback:n}={}){return P_(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function P_(e){return[...new Set(e)]}function L_(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function j_(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(L_(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}function UM(){let e=v.useContext(Zs);return jx(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function __(){let e=v.useContext(_d);return jx(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var _x=v.createContext(void 0);_x.displayName="FrameworkContext";function VM(){let e=v.useContext(_x);return jx(e,"You must render this element inside a <HydratedRouter> element"),e}function z_(e,t){let n=v.useContext(_x),[r,a]=v.useState(!1),[o,l]=v.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:d,onMouseLeave:m,onTouchStart:h}=t,y=v.useRef(null);v.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let C=S=>{S.forEach(R=>{l(R.isIntersecting)})},T=new IntersectionObserver(C,{threshold:.5});return y.current&&T.observe(y.current),()=>{T.disconnect()}}},[e]),v.useEffect(()=>{if(r){let C=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(C)}}},[r]);let g=()=>{a(!0)},w=()=>{a(!1),l(!1)};return n?e!=="intent"?[o,y,{}]:[o,y,{onFocus:Nu(c,g),onBlur:Nu(f,w),onMouseEnter:Nu(d,g),onMouseLeave:Nu(m,w),onTouchStart:Nu(h,g)}]:[!1,y,{}]}function Nu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function F_({page:e,...t}){let{router:n}=UM(),r=v.useMemo(()=>Co(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(H_,{page:e,matches:r,...t}):null}function B_(e){let{manifest:t,routeModules:n}=VM(),[r,a]=v.useState([]);return v.useEffect(()=>{let o=!1;return D_(e,t,n).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,n]),r}function H_({page:e,matches:t,...n}){let r=sa(),{future:a,manifest:o,routeModules:l}=VM(),{basename:c}=UM(),{loaderData:f,matches:d}=__(),m=v.useMemo(()=>QC(e,t,d,o,r,"data"),[e,t,d,o,r]),h=v.useMemo(()=>QC(e,t,d,o,r,"assets"),[e,t,d,o,r]),y=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,T=!1;if(t.forEach(R=>{var M;let k=o.routes[R.route.id];!k||!k.hasLoader||(!m.some(D=>D.route.id===R.route.id)&&R.route.id in f&&((M=l[R.route.id])!=null&&M.shouldRevalidate)||k.hasClientLoader?T=!0:C.add(R.route.id))}),C.size===0)return[];let S=O_(e,c,a.unstable_trailingSlashAwareDataRequests,"data");return T&&C.size>0&&S.searchParams.set("_routes",t.filter(R=>C.has(R.route.id)).map(R=>R.route.id).join(",")),[S.pathname+S.search]},[c,a.unstable_trailingSlashAwareDataRequests,f,r,o,m,t,e,l]),g=v.useMemo(()=>I_(h,o),[h,o]),w=B_(h);return v.createElement(v.Fragment,null,y.map(C=>v.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),g.map(C=>v.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),w.map(({key:C,link:T})=>v.createElement("link",{key:C,nonce:n.nonce,...T,crossOrigin:T.crossOrigin??n.crossOrigin})))}function U_(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var V_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{V_&&(window.__reactRouterVersion="7.13.0")}catch{}function q_(e,t){return mj({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:DL({window:t==null?void 0:t.window}),hydrationData:$_(),routes:e,mapRouteProperties:h_,hydrationRouteProperties:p_,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function $_(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Y_(e.errors)}),e}function Y_(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new Ld(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let l=new o(a.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}var qM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zx=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:o,replace:l,state:c,target:f,to:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y,...g},w){let{basename:C,unstable_useTransitions:T}=v.useContext(Ci),S=typeof d=="string"&&qM.test(d),R=EM(d,C);d=R.to;let k=Yj(d,{relative:a}),[M,D,O]=z_(r,g),A=X_(d,{replace:l,state:c,target:f,preventScrollReset:m,relative:a,viewTransition:h,unstable_defaultShouldRevalidate:y,unstable_useTransitions:T});function L(F){t&&t(F),F.defaultPrevented||A(F)}let H=v.createElement("a",{...g,...O,href:R.absoluteURL||k,onClick:R.isExternal||o?t:L,ref:U_(w,D),target:f,"data-discover":!S&&n==="render"?"true":void 0});return M&&!S?v.createElement(v.Fragment,null,H,v.createElement(F_,{page:k})):H});zx.displayName="Link";var W_=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:o,to:l,viewTransition:c,children:f,...d},m){let h=zd(l,{relative:d.relative}),y=sa(),g=v.useContext(_d),{navigator:w,basename:C}=v.useContext(Ci),T=g!=null&&tz(h)&&c===!0,S=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,R=y.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(R=R.toLowerCase(),k=k?k.toLowerCase():null,S=S.toLowerCase()),k&&C&&(k=Si(k,C)||k);const M=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let D=R===S||!a&&R.startsWith(S)&&R.charAt(M)==="/",O=k!=null&&(k===S||!a&&k.startsWith(S)&&k.charAt(S.length)==="/"),A={isActive:D,isPending:O,isTransitioning:T},L=D?t:void 0,H;typeof r=="function"?H=r(A):H=[r,D?"active":null,O?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(A):o;return v.createElement(zx,{...d,"aria-current":L,className:H,ref:m,style:F,to:l,viewTransition:c},typeof f=="function"?f(A):f)});W_.displayName="NavLink";var K_=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:l=Yh,action:c,onSubmit:f,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y,...g},w)=>{let{unstable_useTransitions:C}=v.useContext(Ci),T=J_(),S=ez(c,{relative:d}),R=l.toLowerCase()==="get"?"get":"post",k=typeof c=="string"&&qM.test(c),M=D=>{if(f&&f(D),D.defaultPrevented)return;D.preventDefault();let O=D.nativeEvent.submitter,A=(O==null?void 0:O.getAttribute("formmethod"))||l,L=()=>T(O||D.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:a,state:o,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y});C&&n!==!1?v.startTransition(()=>L()):L()};return v.createElement("form",{ref:w,method:R,action:S,onSubmit:r?f:M,...g,"data-discover":!k&&e==="render"?"true":void 0})});K_.displayName="Form";function G_(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $M(e){let t=v.useContext(Zs);return Vt(t,G_(e)),t}function X_(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:f}={}){let d=Ix(),m=sa(),h=zd(e,{relative:o});return v.useCallback(y=>{if(T_(y,t)){y.preventDefault();let g=n!==void 0?n:na(m)===na(h),w=()=>d(e,{replace:g,state:r,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c});f?v.startTransition(()=>w()):w()}},[m,d,h,n,r,t,e,a,o,l,c,f])}var Q_=0,Z_=()=>`__${String(++Q_)}__`;function J_(){let{router:e}=$M("useSubmit"),{basename:t}=v.useContext(Ci),n=s_(),r=e.fetch,a=e.navigate;return v.useCallback(async(o,l={})=>{let{action:c,method:f,encType:d,formData:m,body:h}=M_(o,t);if(l.navigate===!1){let y=l.fetcherKey||Z_();await r(y,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:h,formMethod:l.method||f,formEncType:l.encType||d,flushSync:l.flushSync})}else await a(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:h,formMethod:l.method||f,formEncType:l.encType||d,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function ez(e,{relative:t}={}){let{basename:n}=v.useContext(Ci),r=v.useContext(Bi);Vt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={...zd(e||".",{relative:t})},l=sa();if(e==null){o.search=l.search;let c=new URLSearchParams(o.search),f=c.getAll("index");if(f.some(m=>m==="")){c.delete("index"),f.filter(h=>h).forEach(h=>c.append("index",h));let m=c.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ji([n,o.pathname])),na(o)}function tz(e,{relative:t}={}){let n=v.useContext(Nx);Vt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=$M("useViewTransitionState"),a=zd(e,{relative:t});if(!n.isTransitioning)return!1;let o=Si(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Si(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hc(a.pathname,l)!=null||hc(a.pathname,o)!=null}var pr=pM();const nz=Fp(pr);function rz(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const iz=e=>{switch(e){case"success":return sz;case"info":return cz;case"warning":return lz;case"error":return uz;default:return null}},az=Array(12).fill(0),oz=({visible:e,className:t})=>Fe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Fe.createElement("div",{className:"sonner-spinner"},az.map((n,r)=>Fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),sz=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),lz=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),cz=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),uz=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),dz=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),fz=()=>{const[e,t]=Fe.useState(document.hidden);return Fe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let fv=1;class hz{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...a}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:fv++,l=this.toasts.find(f=>f.id===o),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(f=>f.id===o?(this.publish({...f,...t,id:o,title:r}),{...f,...t,id:o,dismissible:c,title:r}):f):this.addToast({title:r,...a,dismissible:c,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const c=a.then(async d=>{if(l=["resolve",d],Fe.isValidElement(d))o=!1,this.create({id:r,type:"default",message:d});else if(mz(d)&&!d.ok){o=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,y=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:y,...w})}else if(d instanceof Error){o=!1;const h=typeof n.error=="function"?await n.error(d):n.error,y=typeof n.description=="function"?await n.description(d):n.description,w=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:y,...w})}else if(n.success!==void 0){o=!1;const h=typeof n.success=="function"?await n.success(d):n.success,y=typeof n.description=="function"?await n.description(d):n.description,w=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:y,...w})}}).catch(async d=>{if(l=["reject",d],n.error!==void 0){o=!1;const m=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,g=typeof m=="object"&&!Fe.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:h,...g})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((d,m)=>c.then(()=>l[0]==="reject"?m(l[1]):d(l[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||fv++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Fr=new hz,pz=(e,t)=>{const n=(t==null?void 0:t.id)||fv++;return Fr.addToast({title:e,...t,id:n}),n},mz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",gz=pz,yz=()=>Fr.toasts,bz=()=>Fr.getActiveToasts(),mn=Object.assign(gz,{success:Fr.success,info:Fr.info,warning:Fr.warning,error:Fr.error,custom:Fr.custom,message:Fr.message,promise:Fr.promise,dismiss:Fr.dismiss,loading:Fr.loading},{getHistory:yz,getToasts:bz});rz("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function vh(e){return e.label!==void 0}const vz=3,xz="24px",wz="16px",ZC=4e3,Sz=356,Ez=14,Cz=45,Tz=200;function Yi(...e){return e.filter(Boolean).join(" ")}function Rz(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const kz=e=>{var t,n,r,a,o,l,c,f,d;const{invert:m,toast:h,unstyled:y,interacting:g,setHeights:w,visibleToasts:C,heights:T,index:S,toasts:R,expanded:k,removeToast:M,defaultRichColors:D,closeButton:O,style:A,cancelButtonStyle:L,actionButtonStyle:H,className:F="",descriptionClassName:W="",duration:j,position:q,gap:$,expandByDefault:B,classNames:_,icons:z,closeButtonAriaLabel:U="Close toast"}=e,[K,P]=Fe.useState(null),[V,G]=Fe.useState(null),[I,Q]=Fe.useState(!1),[Z,te]=Fe.useState(!1),[le,pe]=Fe.useState(!1),[we,Me]=Fe.useState(!1),[Pe,ne]=Fe.useState(!1),[fe,ye]=Fe.useState(0),[Le,Oe]=Fe.useState(0),Ee=Fe.useRef(h.duration||j||ZC),Te=Fe.useRef(null),J=Fe.useRef(null),Se=S===0,ve=S+1<=C,Be=h.type,qe=h.dismissible!==!1,De=h.className||"",ut=h.descriptionClassName||"",he=Fe.useMemo(()=>T.findIndex(Ke=>Ke.toastId===h.id)||0,[T,h.id]),Ce=Fe.useMemo(()=>{var Ke;return(Ke=h.closeButton)!=null?Ke:O},[h.closeButton,O]),ee=Fe.useMemo(()=>h.duration||j||ZC,[h.duration,j]),de=Fe.useRef(0),Ae=Fe.useRef(0),He=Fe.useRef(0),$e=Fe.useRef(null),[et,ze]=q.split("-"),Ze=Fe.useMemo(()=>T.reduce((Ke,Rt,jt)=>jt>=he?Ke:Ke+Rt.height,0),[T,he]),tt=fz(),Ct=h.invert||m,zt=Be==="loading";Ae.current=Fe.useMemo(()=>he*$+Ze,[he,Ze]),Fe.useEffect(()=>{Ee.current=ee},[ee]),Fe.useEffect(()=>{Q(!0)},[]),Fe.useEffect(()=>{const Ke=J.current;if(Ke){const Rt=Ke.getBoundingClientRect().height;return Oe(Rt),w(jt=>[{toastId:h.id,height:Rt,position:h.position},...jt]),()=>w(jt=>jt.filter(Tt=>Tt.toastId!==h.id))}},[w,h.id]),Fe.useLayoutEffect(()=>{if(!I)return;const Ke=J.current,Rt=Ke.style.height;Ke.style.height="auto";const jt=Ke.getBoundingClientRect().height;Ke.style.height=Rt,Oe(jt),w(Tt=>Tt.find(Ht=>Ht.toastId===h.id)?Tt.map(Ht=>Ht.toastId===h.id?{...Ht,height:jt}:Ht):[{toastId:h.id,height:jt,position:h.position},...Tt])},[I,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const gt=Fe.useCallback(()=>{te(!0),ye(Ae.current),w(Ke=>Ke.filter(Rt=>Rt.toastId!==h.id)),setTimeout(()=>{M(h)},Tz)},[h,M,w,Ae]);Fe.useEffect(()=>{if(h.promise&&Be==="loading"||h.duration===1/0||h.type==="loading")return;let Ke;return k||g||tt?(()=>{if(He.current<de.current){const Tt=new Date().getTime()-de.current;Ee.current=Ee.current-Tt}He.current=new Date().getTime()})():(()=>{Ee.current!==1/0&&(de.current=new Date().getTime(),Ke=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),gt()},Ee.current))})(),()=>clearTimeout(Ke)},[k,g,h,Be,tt,gt]),Fe.useEffect(()=>{h.delete&&(gt(),h.onDismiss==null||h.onDismiss.call(h,h))},[gt,h.delete]);function Ot(){var Ke;if(z!=null&&z.loading){var Rt;return Fe.createElement("div",{className:Yi(_==null?void 0:_.loader,h==null||(Rt=h.classNames)==null?void 0:Rt.loader,"sonner-loader"),"data-visible":Be==="loading"},z.loading)}return Fe.createElement(oz,{className:Yi(_==null?void 0:_.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader),visible:Be==="loading"})}const it=h.icon||(z==null?void 0:z[Be])||iz(Be);var ft,yt;return Fe.createElement("li",{tabIndex:0,ref:J,className:Yi(F,De,_==null?void 0:_.toast,h==null||(t=h.classNames)==null?void 0:t.toast,_==null?void 0:_.default,_==null?void 0:_[Be],h==null||(n=h.classNames)==null?void 0:n[Be]),"data-sonner-toast":"","data-rich-colors":(ft=h.richColors)!=null?ft:D,"data-styled":!(h.jsx||h.unstyled||y),"data-mounted":I,"data-promise":!!h.promise,"data-swiped":Pe,"data-removed":Z,"data-visible":ve,"data-y-position":et,"data-x-position":ze,"data-index":S,"data-front":Se,"data-swiping":le,"data-dismissible":qe,"data-type":Be,"data-invert":Ct,"data-swipe-out":we,"data-swipe-direction":V,"data-expanded":!!(k||B&&I),"data-testid":h.testId,style:{"--index":S,"--toasts-before":S,"--z-index":R.length-S,"--offset":`${Z?fe:Ae.current}px`,"--initial-height":B?"auto":`${Le}px`,...A,...h.style},onDragEnd:()=>{pe(!1),P(null),$e.current=null},onPointerDown:Ke=>{Ke.button!==2&&(zt||!qe||(Te.current=new Date,ye(Ae.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(pe(!0),$e.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,Rt,jt;if(we||!qe)return;$e.current=null;const Tt=Number(((Ke=J.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),un=Number(((Rt=J.current)==null?void 0:Rt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ht=new Date().getTime()-((jt=Te.current)==null?void 0:jt.getTime()),Je=K==="x"?Tt:un,kt=Math.abs(Je)/Ht;if(Math.abs(Je)>=Cz||kt>.11){ye(Ae.current),h.onDismiss==null||h.onDismiss.call(h,h),G(K==="x"?Tt>0?"right":"left":un>0?"down":"up"),gt(),Me(!0);return}else{var X,ae;(X=J.current)==null||X.style.setProperty("--swipe-amount-x","0px"),(ae=J.current)==null||ae.style.setProperty("--swipe-amount-y","0px")}ne(!1),pe(!1),P(null)},onPointerMove:Ke=>{var Rt,jt,Tt;if(!$e.current||!qe||((Rt=window.getSelection())==null?void 0:Rt.toString().length)>0)return;const Ht=Ke.clientY-$e.current.y,Je=Ke.clientX-$e.current.x;var kt;const X=(kt=e.swipeDirections)!=null?kt:Rz(q);!K&&(Math.abs(Je)>1||Math.abs(Ht)>1)&&P(Math.abs(Je)>Math.abs(Ht)?"x":"y");let ae={x:0,y:0};const ue=Re=>1/(1.5+Math.abs(Re)/20);if(K==="y"){if(X.includes("top")||X.includes("bottom"))if(X.includes("top")&&Ht<0||X.includes("bottom")&&Ht>0)ae.y=Ht;else{const Re=Ht*ue(Ht);ae.y=Math.abs(Re)<Math.abs(Ht)?Re:Ht}}else if(K==="x"&&(X.includes("left")||X.includes("right")))if(X.includes("left")&&Je<0||X.includes("right")&&Je>0)ae.x=Je;else{const Re=Je*ue(Je);ae.x=Math.abs(Re)<Math.abs(Je)?Re:Je}(Math.abs(ae.x)>0||Math.abs(ae.y)>0)&&ne(!0),(jt=J.current)==null||jt.style.setProperty("--swipe-amount-x",`${ae.x}px`),(Tt=J.current)==null||Tt.style.setProperty("--swipe-amount-y",`${ae.y}px`)}},Ce&&!h.jsx&&Be!=="loading"?Fe.createElement("button",{"aria-label":U,"data-disabled":zt,"data-close-button":!0,onClick:zt||!qe?()=>{}:()=>{gt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Yi(_==null?void 0:_.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(yt=z==null?void 0:z.close)!=null?yt:dz):null,(Be||h.icon||h.promise)&&h.icon!==null&&((z==null?void 0:z[Be])!==null||h.icon)?Fe.createElement("div",{"data-icon":"",className:Yi(_==null?void 0:_.icon,h==null||(a=h.classNames)==null?void 0:a.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Ot():null,h.type!=="loading"?it:null):null,Fe.createElement("div",{"data-content":"",className:Yi(_==null?void 0:_.content,h==null||(o=h.classNames)==null?void 0:o.content)},Fe.createElement("div",{"data-title":"",className:Yi(_==null?void 0:_.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Fe.createElement("div",{"data-description":"",className:Yi(W,ut,_==null?void 0:_.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),Fe.isValidElement(h.cancel)?h.cancel:h.cancel&&vh(h.cancel)?Fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||L,onClick:Ke=>{vh(h.cancel)&&qe&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ke),gt())},className:Yi(_==null?void 0:_.cancelButton,h==null||(f=h.classNames)==null?void 0:f.cancelButton)},h.cancel.label):null,Fe.isValidElement(h.action)?h.action:h.action&&vh(h.action)?Fe.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||H,onClick:Ke=>{vh(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ke),!Ke.defaultPrevented&&gt())},className:Yi(_==null?void 0:_.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function JC(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Mz(e,t){const n={};return[e,t].forEach((r,a)=>{const o=a===1,l=o?"--mobile-offset":"--offset",c=o?wz:xz;function f(d){["top","right","bottom","left"].forEach(m=>{n[`${l}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${l}-${d}`]=c:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):f(c)}),n}const Oz=Fe.forwardRef(function(t,n){const{id:r,invert:a,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:d,offset:m,mobileOffset:h,theme:y="light",richColors:g,duration:w,style:C,visibleToasts:T=vz,toastOptions:S,dir:R=JC(),gap:k=Ez,icons:M,containerAriaLabel:D="Notifications"}=t,[O,A]=Fe.useState([]),L=Fe.useMemo(()=>r?O.filter(I=>I.toasterId===r):O.filter(I=>!I.toasterId),[O,r]),H=Fe.useMemo(()=>Array.from(new Set([o].concat(L.filter(I=>I.position).map(I=>I.position)))),[L,o]),[F,W]=Fe.useState([]),[j,q]=Fe.useState(!1),[$,B]=Fe.useState(!1),[_,z]=Fe.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=Fe.useRef(null),K=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=Fe.useRef(null),V=Fe.useRef(!1),G=Fe.useCallback(I=>{A(Q=>{var Z;return(Z=Q.find(te=>te.id===I.id))!=null&&Z.delete||Fr.dismiss(I.id),Q.filter(({id:te})=>te!==I.id)})},[]);return Fe.useEffect(()=>Fr.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{A(Q=>Q.map(Z=>Z.id===I.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{nz.flushSync(()=>{A(Q=>{const Z=Q.findIndex(te=>te.id===I.id);return Z!==-1?[...Q.slice(0,Z),{...Q[Z],...I},...Q.slice(Z+1)]:[I,...Q]})})})}),[O]),Fe.useEffect(()=>{if(y!=="system"){z(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:Q})=>{z(Q?"dark":"light")})}catch{I.addListener(({matches:Z})=>{try{z(Z?"dark":"light")}catch(te){console.error(te)}})}},[y]),Fe.useEffect(()=>{O.length<=1&&q(!1)},[O]),Fe.useEffect(()=>{const I=Q=>{var Z;if(l.every(pe=>Q[pe]||Q.code===pe)){var le;q(!0),(le=U.current)==null||le.focus()}Q.code==="Escape"&&(document.activeElement===U.current||(Z=U.current)!=null&&Z.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[l]),Fe.useEffect(()=>{if(U.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,V.current=!1)}},[U.current]),Fe.createElement("section",{ref:n,"aria-label":`${D} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},H.map((I,Q)=>{var Z;const[te,le]=I.split("-");return L.length?Fe.createElement("ol",{key:I,dir:R==="auto"?JC():R,tabIndex:-1,ref:U,className:d,"data-sonner-toaster":!0,"data-sonner-theme":_,"data-y-position":te,"data-x-position":le,style:{"--front-toast-height":`${((Z=F[0])==null?void 0:Z.height)||0}px`,"--width":`${Sz}px`,"--gap":`${k}px`,...C,...Mz(m,h)},onBlur:pe=>{V.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(V.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||V.current||(V.current=!0,P.current=pe.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{$||q(!1)},onDragEnd:()=>q(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},L.filter(pe=>!pe.position&&Q===0||pe.position===I).map((pe,we)=>{var Me,Pe;return Fe.createElement(kz,{key:pe.id,icons:M,index:we,toast:pe,defaultRichColors:g,duration:(Me=S==null?void 0:S.duration)!=null?Me:w,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:a,visibleToasts:T,closeButton:(Pe=S==null?void 0:S.closeButton)!=null?Pe:f,interacting:$,position:I,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:G,toasts:L.filter(ne=>ne.position==pe.position),heights:F.filter(ne=>ne.position==pe.position),setHeights:W,expandByDefault:c,gap:k,expanded:j,swipeDirections:t.swipeDirections})})):null}))}),Mt=e=>typeof e=="string",Du=()=>{let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},eT=e=>e==null?"":""+e,Az=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Nz=/###/g,tT=e=>e&&e.indexOf("###")>-1?e.replace(Nz,"."):e,nT=e=>!e||Mt(e),Qu=(e,t,n)=>{const r=Mt(t)?t.split("."):t;let a=0;for(;a<r.length-1;){if(nT(e))return{};const o=tT(r[a]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++a}return nT(e)?{}:{obj:e,k:tT(r[a])}},rT=(e,t,n)=>{const{obj:r,k:a}=Qu(e,t,Object);if(r!==void 0||t.length===1){r[a]=n;return}let o=t[t.length-1],l=t.slice(0,t.length-1),c=Qu(e,l,Object);for(;c.obj===void 0&&l.length;)o=`${l[l.length-1]}.${o}`,l=l.slice(0,l.length-1),c=Qu(e,l,Object),c!=null&&c.obj&&typeof c.obj[`${c.k}.${o}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${o}`]=n},Dz=(e,t,n,r)=>{const{obj:a,k:o}=Qu(e,t,Object);a[o]=a[o]||[],a[o].push(n)},cp=(e,t)=>{const{obj:n,k:r}=Qu(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Iz=(e,t,n)=>{const r=cp(e,n);return r!==void 0?r:cp(t,n)},YM=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Mt(e[r])||e[r]instanceof String||Mt(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):YM(e[r],t[r],n):e[r]=t[r]);return e},Pl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Pz={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Lz=e=>Mt(e)?e.replace(/[&<>"'\/]/g,t=>Pz[t]):e;class jz{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const _z=[" ",",","?","!",";"],zz=new jz(20),Fz=(e,t,n)=>{t=t||"",n=n||"";const r=_z.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const a=zz.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let o=!a.test(e);if(!o){const l=e.indexOf(n);l>0&&!a.test(e.substring(0,l))&&(o=!0)}return o},hv=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let a=e;for(let o=0;o<r.length;){if(!a||typeof a!="object")return;let l,c="";for(let f=o;f<r.length;++f)if(f!==o&&(c+=n),c+=r[f],l=a[c],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&f<r.length-1)continue;o+=f-o+1;break}a=l}return a},yd=e=>e==null?void 0:e.replace("_","-"),Bz={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class up{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Bz,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,a){return a&&!this.debug?null:(Mt(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new up(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new up(this.logger,t)}}var Zi=new up;class Up{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([a,o])=>{for(let l=0;l<o;l++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,o])=>{for(let l=0;l<o;l++)a.apply(a,[t,...n])})}}class iT extends Up{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,a={}){var d,m;const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,l=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):Mt(r)&&o?c.push(...r.split(o)):c.push(r)));const f=cp(this.data,c);return!f&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),f||!l||!Mt(r)?f:hv((m=(d=this.data)==null?void 0:d[t])==null?void 0:m[n],r,o)}addResource(t,n,r,a,o={silent:!1}){const l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(c=t.split("."),a=n,n=c[1]),this.addNamespaces(n),rT(this.data,c,a),o.silent||this.emit("added",t,n,r,a)}addResources(t,n,r,a={silent:!1}){for(const o in r)(Mt(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,o,l={silent:!1,skipCopy:!1}){let c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),a=r,r=n,n=c[1]),this.addNamespaces(n);let f=cp(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?YM(f,r,o):f={...f,...r},rT(this.data,c,f),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var WM={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(o=>{var l;t=((l=this.processors[o])==null?void 0:l.process(t,n,r,a))??t}),t}};const KM=Symbol("i18next/PATH_KEY");function Hz(){const e=[],t=Object.create(null);let n;return t.get=(r,a)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),a===KM?e:(e.push(a),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function pv(e,t){const{[KM]:n}=e(Hz());return n.join((t==null?void 0:t.keySeparator)??".")}const aT={},Yy=e=>!Mt(e)&&typeof e!="boolean"&&typeof e!="number";class dp extends Up{constructor(t,n={}){super(),Az(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Zi.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const a=this.resolve(t,r);if((a==null?void 0:a.res)===void 0)return!1;const o=Yy(a.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Fz(t,r,a);if(l&&!c){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:Mt(o)?[o]:o};const d=t.split(r);(r!==a||r===a&&this.options.ns.indexOf(d[0])>-1)&&(o=d.shift()),t=d.join(a)}return{key:t,namespaces:Mt(o)?[o]:o}}translate(t,n,r){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),t==null)return"";typeof t=="function"&&(t=pv(t,{...this.options,...a})),Array.isArray(t)||(t=[String(t)]);const o=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:c,namespaces:f}=this.extractFromKey(t[t.length-1],a),d=f[f.length-1];let m=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const h=a.lng||this.language,y=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode")return y?o?{res:`${d}${m}${c}`,usedKey:c,exactUsedKey:c,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:`${d}${m}${c}`:o?{res:c,usedKey:c,exactUsedKey:c,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:c;const g=this.resolve(t,a);let w=g==null?void 0:g.res;const C=(g==null?void 0:g.usedKey)||c,T=(g==null?void 0:g.exactUsedKey)||c,S=["[object Number]","[object Function]","[object RegExp]"],R=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,M=a.count!==void 0&&!Mt(a.count),D=dp.hasDefaultValue(a),O=M?this.pluralResolver.getSuffix(h,a.count,a):"",A=a.ordinal&&M?this.pluralResolver.getSuffix(h,a.count,{ordinal:!1}):"",L=M&&!a.ordinal&&a.count===0,H=L&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${O}`]||a[`defaultValue${A}`]||a.defaultValue;let F=w;k&&!w&&D&&(F=H);const W=Yy(F),j=Object.prototype.toString.apply(F);if(k&&F&&W&&S.indexOf(j)<0&&!(Mt(R)&&Array.isArray(F))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const q=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,F,{...a,ns:f}):`key '${c} (${this.language})' returned an object instead of string.`;return o?(g.res=q,g.usedParams=this.getUsedParamsDetails(a),g):q}if(l){const q=Array.isArray(F),$=q?[]:{},B=q?T:C;for(const _ in F)if(Object.prototype.hasOwnProperty.call(F,_)){const z=`${B}${l}${_}`;D&&!w?$[_]=this.translate(z,{...a,defaultValue:Yy(H)?H[_]:void 0,joinArrays:!1,ns:f}):$[_]=this.translate(z,{...a,joinArrays:!1,ns:f}),$[_]===z&&($[_]=F[_])}w=$}}else if(k&&Mt(R)&&Array.isArray(w))w=w.join(R),w&&(w=this.extendTranslation(w,t,a,r));else{let q=!1,$=!1;!this.isValidLookup(w)&&D&&(q=!0,w=H),this.isValidLookup(w)||($=!0,w=c);const _=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&$?void 0:w,z=D&&H!==w&&this.options.updateMissing;if($||q||z){if(this.logger.log(z?"updateKey":"missingKey",h,d,c,z?H:w),l){const V=this.resolve(c,{...a,keySeparator:!1});V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let U=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let V=0;V<K.length;V++)U.push(K[V]);else this.options.saveMissingTo==="all"?U=this.languageUtils.toResolveHierarchy(a.lng||this.language):U.push(a.lng||this.language);const P=(V,G,I)=>{var Z;const Q=D&&I!==w?I:_;this.options.missingKeyHandler?this.options.missingKeyHandler(V,d,G,Q,z,a):(Z=this.backendConnector)!=null&&Z.saveMissing&&this.backendConnector.saveMissing(V,d,G,Q,z,a),this.emit("missingKey",V,d,G,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?U.forEach(V=>{const G=this.pluralResolver.getSuffixes(V,a);L&&a[`defaultValue${this.options.pluralSeparator}zero`]&&G.indexOf(`${this.options.pluralSeparator}zero`)<0&&G.push(`${this.options.pluralSeparator}zero`),G.forEach(I=>{P([V],c+I,a[`defaultValue${I}`]||H)})}):P(U,c,H))}w=this.extendTranslation(w,t,a,g,r),$&&w===c&&this.options.appendNamespaceToMissingKey&&(w=`${d}${m}${c}`),($||q)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${m}${c}`:c,q?w:void 0,a))}return o?(g.res=w,g.usedParams=this.getUsedParamsDetails(a),g):w}extendTranslation(t,n,r,a,o){var f,d;if((f=this.i18nFormat)!=null&&f.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const m=Mt(t)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(m){const g=t.match(this.interpolator.nestingRegexp);h=g&&g.length}let y=r.replace&&!Mt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),t=this.interpolator.interpolate(t,y,r.lng||this.language||a.usedLng,r),m){const g=t.match(this.interpolator.nestingRegexp),w=g&&g.length;h<w&&(r.nest=!1)}!r.lng&&a&&a.res&&(r.lng=this.language||a.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...g)=>(o==null?void 0:o[0])===g[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):this.translate(...g,n),r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,c=Mt(l)?[l]:l;return t!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(t=WM.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,a,o,l,c;return Mt(t)&&(t=[t]),t.forEach(f=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(f,n),m=d.key;a=m;let h=d.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const y=n.count!==void 0&&!Mt(n.count),g=y&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(Mt(n.context)||typeof n.context=="number")&&n.context!=="",C=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);h.forEach(T=>{var S,R;this.isValidLookup(r)||(c=T,!aT[`${C[0]}-${T}`]&&((S=this.utils)!=null&&S.hasLoadedNamespace)&&!((R=this.utils)!=null&&R.hasLoadedNamespace(c))&&(aT[`${C[0]}-${T}`]=!0,this.logger.warn(`key "${a}" for languages "${C.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(k=>{var O;if(this.isValidLookup(r))return;l=k;const M=[m];if((O=this.i18nFormat)!=null&&O.addLookupKeys)this.i18nFormat.addLookupKeys(M,m,k,T,n);else{let A;y&&(A=this.pluralResolver.getSuffix(k,n.count,n));const L=`${this.options.pluralSeparator}zero`,H=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&A.indexOf(H)===0&&M.push(m+A.replace(H,this.options.pluralSeparator)),M.push(m+A),g&&M.push(m+L)),w){const F=`${m}${this.options.contextSeparator||"_"}${n.context}`;M.push(F),y&&(n.ordinal&&A.indexOf(H)===0&&M.push(F+A.replace(H,this.options.pluralSeparator)),M.push(F+A),g&&M.push(F+L))}}let D;for(;D=M.pop();)this.isValidLookup(r)||(o=D,r=this.getResource(k,T,D,n))}))})}),{res:r,usedKey:a,exactUsedKey:o,usedLng:l,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,a={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!Mt(t.replace);let a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const o of n)delete a[o]}return a}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class oT{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Zi.create("languageUtils")}getScriptPartFromCode(t){if(t=yd(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=yd(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Mt(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getScriptPartFromCode(r);if(this.isSupportedCode(a))return n=a;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(l=>{if(l===o)return l;if(!(l.indexOf("-")<0&&o.indexOf("-")<0)&&(l.indexOf("-")>0&&o.indexOf("-")<0&&l.substring(0,l.indexOf("-"))===o||l.indexOf(o)===0&&o.length>1))return l})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Mt(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),a=[],o=l=>{l&&(this.isSupportedCode(l)?a.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return Mt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Mt(t)&&o(this.formatLanguageCode(t)),r.forEach(l=>{a.indexOf(l)<0&&o(this.formatLanguageCode(l))}),a}}const sT={zero:0,one:1,two:2,few:3,many:4,other:5},lT={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Uz{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Zi.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=yd(t==="dev"?"en":t),a=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:a});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let l;try{l=new Intl.PluralRules(r,{type:a})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),lT;if(!t.match(/-|_/))return lT;const f=this.languageUtils.getLanguagePartFromCode(t);l=this.getRule(f,n)}return this.pluralRulesCache[o]=l,l}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(a=>`${n}${a}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((a,o)=>sT[a]-sT[o]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(t,n,r={}){const a=this.getRule(t,r);return a?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const cT=(e,t,n,r=".",a=!0)=>{let o=Iz(e,t,n);return!o&&a&&Mt(n)&&(o=hv(e,n,r),o===void 0&&(o=hv(t,n,r))),o},Wy=e=>e.replace(/\$/g,"$$$$");class uT{constructor(t={}){var n;this.logger=Zi.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:a,prefix:o,prefixEscaped:l,suffix:c,suffixEscaped:f,formatSeparator:d,unescapeSuffix:m,unescapePrefix:h,nestingPrefix:y,nestingPrefixEscaped:g,nestingSuffix:w,nestingSuffixEscaped:C,nestingOptionsSeparator:T,maxReplaces:S,alwaysFormat:R}=t.interpolation;this.escape=n!==void 0?n:Lz,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=o?Pl(o):l||"{{",this.suffix=c?Pl(c):f||"}}",this.formatSeparator=d||",",this.unescapePrefix=m?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=y?Pl(y):g||Pl("$t("),this.nestingSuffix=w?Pl(w):C||Pl(")"),this.nestingOptionsSeparator=T||",",this.maxReplaces=S||1e3,this.alwaysFormat=R!==void 0?R:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,a){var g;let o,l,c;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=w=>{if(w.indexOf(this.formatSeparator)<0){const R=cT(n,f,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(R,void 0,r,{...a,...n,interpolationkey:w}):R}const C=w.split(this.formatSeparator),T=C.shift().trim(),S=C.join(this.formatSeparator).trim();return this.format(cT(n,f,T,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...a,...n,interpolationkey:T})};this.resetRegExp();const m=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((g=a==null?void 0:a.interpolation)==null?void 0:g.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>Wy(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?Wy(this.escape(w)):Wy(w)}].forEach(w=>{for(c=0;o=w.regex.exec(t);){const C=o[1].trim();if(l=d(C),l===void 0)if(typeof m=="function"){const S=m(t,o,a);l=Mt(S)?S:""}else if(a&&Object.prototype.hasOwnProperty.call(a,C))l="";else if(h){l=o[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${t}`),l="";else!Mt(l)&&!this.useRawValueToEscape&&(l=eT(l));const T=w.safeValue(l);if(t=t.replace(o[0],T),h?(w.regex.lastIndex+=l.length,w.regex.lastIndex-=o[0].length):w.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n,r={}){let a,o,l;const c=(f,d)=>{const m=this.nestingOptionsSeparator;if(f.indexOf(m)<0)return f;const h=f.split(new RegExp(`${m}[ ]*{`));let y=`{${h[1]}`;f=h[0],y=this.interpolate(y,l);const g=y.match(/'/g),w=y.match(/"/g);(((g==null?void 0:g.length)??0)%2===0&&!w||w.length%2!==0)&&(y=y.replace(/'/g,'"'));try{l=JSON.parse(y),d&&(l={...d,...l})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,C),`${f}${m}${y}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,f};for(;a=this.nestingRegexp.exec(t);){let f=[];l={...r},l=l.replace&&!Mt(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const d=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(d!==-1&&(f=a[1].slice(d).split(this.formatSeparator).map(m=>m.trim()).filter(Boolean),a[1]=a[1].slice(0,d)),o=n(c.call(this,a[1].trim(),l),l),o&&a[0]===t&&!Mt(o))return o;Mt(o)||(o=eT(o)),o||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),o=""),f.length&&(o=f.reduce((m,h)=>this.format(m,h,r.lng,{...r,interpolationkey:a[1].trim()}),o.trim())),t=t.replace(a[0],o),this.regexp.lastIndex=0}return t}}const Vz=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);t==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(l=>{if(l){const[c,...f]=l.split(":"),d=f.join(":").trim().replace(/^'+|'+$/g,""),m=c.trim();n[m]||(n[m]=d),d==="false"&&(n[m]=!1),d==="true"&&(n[m]=!0),isNaN(d)||(n[m]=parseInt(d,10))}})}return{formatName:t,formatOptions:n}},dT=e=>{const t={};return(n,r,a)=>{let o=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(o={...o,[a.interpolationkey]:void 0});const l=r+JSON.stringify(o);let c=t[l];return c||(c=e(yd(r),a),t[l]=c),c(n)}},qz=e=>(t,n,r)=>e(yd(n),r)(t);class $z{constructor(t={}){this.logger=Zi.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?dT:qz;this.formats={number:r((a,o)=>{const l=new Intl.NumberFormat(a,{...o});return c=>l.format(c)}),currency:r((a,o)=>{const l=new Intl.NumberFormat(a,{...o,style:"currency"});return c=>l.format(c)}),datetime:r((a,o)=>{const l=new Intl.DateTimeFormat(a,{...o});return c=>l.format(c)}),relativetime:r((a,o)=>{const l=new Intl.RelativeTimeFormat(a,{...o});return c=>l.format(c,o.range||"day")}),list:r((a,o)=>{const l=new Intl.ListFormat(a,{...o});return c=>l.format(c)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=dT(n)}format(t,n,r,a={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(c=>c.indexOf(")")>-1)){const c=o.findIndex(f=>f.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,c)].join(this.formatSeparator)}return o.reduce((c,f)=>{var h;const{formatName:d,formatOptions:m}=Vz(f);if(this.formats[d]){let y=c;try{const g=((h=a==null?void 0:a.formatParams)==null?void 0:h[a.interpolationkey])||{},w=g.locale||g.lng||a.locale||a.lng||r;y=this.formats[d](c,w,{...m,...a,...g})}catch(g){this.logger.warn(g)}return y}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const Yz=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Wz extends Up{constructor(t,n,r,a={}){var o,l;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=Zi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],(l=(o=this.backend)==null?void 0:o.init)==null||l.call(o,r,a.backend,a)}queueLoad(t,n,r,a){const o={},l={},c={},f={};return t.forEach(d=>{let m=!0;n.forEach(h=>{const y=`${d}|${h}`;!r.reload&&this.store.hasResourceBundle(d,h)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?l[y]===void 0&&(l[y]=!0):(this.state[y]=1,m=!1,l[y]===void 0&&(l[y]=!0),o[y]===void 0&&(o[y]=!0),f[h]===void 0&&(f[h]=!0)))}),m||(c[d]=!0)}),(Object.keys(o).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(o),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(f)}}loaded(t,n,r){const a=t.split("|"),o=a[0],l=a[1];n&&this.emit("failedLoading",o,l,n),!n&&r&&this.store.addResourceBundle(o,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(f=>{Dz(f.loaded,[o],l),Yz(f,t),n&&f.errors.push(n),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(d=>{c[d]||(c[d]={});const m=f.loaded[d];m.length&&m.forEach(h=>{c[d][h]===void 0&&(c[d][h]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(f=>!f.done)}read(t,n,r,a=0,o=this.retryTimeout,l){if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:a,wait:o,callback:l});return}this.readingCalls++;const c=(d,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(d&&m&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,a+1,o*2,l)},o);return}l(d,m)},f=this.backend[r].bind(this.backend);if(f.length===2){try{const d=f(t,n);d&&typeof d.then=="function"?d.then(m=>c(null,m)).catch(c):c(null,d)}catch(d){c(d)}return}return f(t,n,c)}prepareLoading(t,n,r={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();Mt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Mt(n)&&(n=[n]);const o=this.queueLoad(t,n,r,a);if(!o.toLoad.length)return o.pending.length||a(),null;o.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),a=r[0],o=r[1];this.read(a,o,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${o} for language ${a} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${o} for language ${a}`,c),this.loaded(t,l,c)})}saveMissing(t,n,r,a,o,l={},c=()=>{}){var f,d,m,h,y;if((d=(f=this.services)==null?void 0:f.utils)!=null&&d.hasLoadedNamespace&&!((h=(m=this.services)==null?void 0:m.utils)!=null&&h.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((y=this.backend)!=null&&y.create){const g={...l,isUpdate:o},w=this.backend.create.bind(this.backend);if(w.length<6)try{let C;w.length===5?C=w(t,n,r,a,g):C=w(t,n,r,a),C&&typeof C.then=="function"?C.then(T=>c(null,T)).catch(c):c(null,C)}catch(C){c(C)}else w(t,n,r,a,c,g)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}const Ky=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Mt(e[1])&&(t.defaultValue=e[1]),Mt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),fT=e=>{var t,n;return Mt(e.ns)&&(e.ns=[e.ns]),Mt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Mt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},xh=()=>{},Kz=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},Gz=e=>{var t,n,r,a,o,l,c,f,d;return!!(((r=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((c=(l=(o=(a=e==null?void 0:e.modules)==null?void 0:a.backend)==null?void 0:o.constructor)==null?void 0:l.name)==null?void 0:c.indexOf("Locize"))>0||(d=(f=e==null?void 0:e.options)==null?void 0:f.backend)!=null&&d.backends&&e.options.backend.backends.some(m=>{var h,y,g;return((h=m==null?void 0:m.name)==null?void 0:h.indexOf("Locize"))>0||((g=(y=m==null?void 0:m.constructor)==null?void 0:y.name)==null?void 0:g.indexOf("Locize"))>0}))};class Zu extends Up{constructor(t={},n){if(super(),this.options=fT(t),this.services={},this.logger=Zi,this.modules={external:[]},Kz(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Mt(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Ky();this.options={...r,...this.options,...fT(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Gz(this)&&typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const a=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Zi.init(a(this.modules.logger),this.options):Zi.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=$z;const m=new oT(this.options);this.store=new iT(this.options.resources,this.options);const h=this.services;h.logger=Zi,h.resourceStore=this.store,h.languageUtils=m,h.pluralResolver=new Uz(m,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),d&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(h.formatter=a(d),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new uT(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new Wz(a(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(g,...w)=>{this.emit(g,...w)}),this.modules.languageDetector&&(h.languageDetector=a(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=a(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new dp(this.services,this.options),this.translator.on("*",(g,...w)=>{this.emit(g,...w)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,n||(n=xh),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=(...m)=>this.store[d](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(...m)=>(this.store[d](...m),this)});const c=Du(),f=()=>{const d=(m,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(h),n(m,h)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),c}loadResources(t,n=xh){var o,l;let r=n;const a=Mt(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((a==null?void 0:a.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const c=[],f=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(h=>{h!=="cimode"&&c.indexOf(h)<0&&c.push(h)})};a?f(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>f(m)),(l=(o=this.options.preload)==null?void 0:o.forEach)==null||l.call(o,d=>f(d)),this.services.backendConnector.load(c,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(d)})}else r(null)}reloadResources(t,n,r){const a=Du();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=xh),this.services.backendConnector.reload(t,n,o=>{a.resolve(),r(o)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&WM.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=Du();this.emit("languageChanging",t);const a=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,f)=>{f?this.isLanguageChangingTo===t&&(a(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,r.resolve((...d)=>this.t(...d)),n&&n(c,(...d)=>this.t(...d))},l=c=>{var m,h;!t&&!c&&this.services.languageDetector&&(c=[]);const f=Mt(c)?c:c&&c[0],d=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(Mt(c)?[c]:c);d&&(this.language||a(d),this.translator.language||this.translator.changeLanguage(d),(h=(m=this.services.languageDetector)==null?void 0:m.cacheUserLanguage)==null||h.call(m,d)),this.loadResources(d,y=>{o(y,d)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),r}getFixedT(t,n,r){const a=(o,l,...c)=>{let f;typeof l!="object"?f=this.options.overloadTranslationOptionHandler([o,l].concat(c)):f={...l},f.lng=f.lng||a.lng,f.lngs=f.lngs||a.lngs,f.ns=f.ns||a.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||r||a.keyPrefix);const d=this.options.keySeparator||".";let m;return f.keyPrefix&&Array.isArray(o)?m=o.map(h=>(typeof h=="function"&&(h=pv(h,{...this.options,...l})),`${f.keyPrefix}${d}${h}`)):(typeof o=="function"&&(o=pv(o,{...this.options,...l})),m=f.keyPrefix?`${f.keyPrefix}${d}${o}`:o),this.t(m,f)};return Mt(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,f)=>{const d=this.services.backendConnector.state[`${c}|${f}`];return d===-1||d===0||d===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!a||l(o,t)))}loadNamespaces(t,n){const r=Du();return this.options.ns?(Mt(t)&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Du();Mt(t)&&(t=[t]);const a=this.options.preload||[],o=t.filter(l=>a.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return o.length?(this.options.preload=a.concat(o),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){var a,o;if(t||(t=this.resolvedLanguage||(((a=this.languages)==null?void 0:a.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const l=new Intl.Locale(t);if(l&&l.getTextInfo){const c=l.getTextInfo();if(c&&c.direction)return c.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((o=this.services)==null?void 0:o.languageUtils)||new oT(Ky());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new Zu(t,n);return r.createInstance=Zu.createInstance,r}cloneInstance(t={},n=xh){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},o=new Zu(a);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(c=>{o[c]=this[c]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const c=Object.keys(this.store.data).reduce((f,d)=>(f[d]={...this.store.data[d]},f[d]=Object.keys(f[d]).reduce((m,h)=>(m[h]={...f[d][h]},m),f[d]),f),{});o.store=new iT(c,a),o.services.resourceStore=o.store}if(t.interpolation){const f={...Ky().interpolation,...this.options.interpolation,...t.interpolation},d={...a,interpolation:f};o.services.interpolator=new uT(d)}return o.translator=new dp(o.services,a),o.translator.on("*",(c,...f)=>{o.emit(c,...f)}),o.init(a,n),o.translator.options=a,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const En=Zu.createInstance();En.createInstance;En.dir;En.init;En.loadResources;En.reloadResources;En.use;En.changeLanguage;En.getFixedT;En.t;En.exists;En.setDefaultNamespace;En.hasLoadedNamespace;En.loadNamespaces;En.loadLanguages;const Xz=(e,t,n,r)=>{var o,l,c,f;const a=[n,{code:t,...r||{}}];if((l=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&l.forward)return e.services.logger.forward(a,"warn","react-i18next::",!0);Us(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(f=(c=e==null?void 0:e.services)==null?void 0:c.logger)!=null&&f.warn?e.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},hT={},GM=(e,t,n,r)=>{Us(n)&&hT[n]||(Us(n)&&(hT[n]=new Date),Xz(e,t,n,r))},XM=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},mv=(e,t,n)=>{e.loadNamespaces(t,XM(e,n))},pT=(e,t,n,r)=>{if(Us(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return mv(e,n,r);n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,XM(e,r))},Qz=(e,t,n={})=>!t.languages||!t.languages.length?(GM(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,e))return!1}}),Us=e=>typeof e=="string",Zz=e=>typeof e=="object"&&e!==null,Jz=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,e3={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},t3=e=>e3[e],n3=e=>e.replace(Jz,t3);let gv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:n3,transDefaultProps:void 0};const r3=(e={})=>{gv={...gv,...e}},i3=()=>gv;let QM;const a3=e=>{QM=e},o3=()=>QM,s3={type:"3rdParty",init(e){r3(e.options.react),a3(e)}},l3=v.createContext();class c3{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Gy={exports:{}},Xy={};/**
63
- * @license React
64
- * use-sync-external-store-shim.production.js
65
- *
66
- * Copyright (c) Meta Platforms, Inc. and affiliates.
67
- *
68
- * This source code is licensed under the MIT license found in the
69
- * LICENSE file in the root directory of this source tree.
70
- */var mT;function u3(){if(mT)return Xy;mT=1;var e=Id();function t(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function c(h,y){var g=y(),w=r({inst:{value:g,getSnapshot:y}}),C=w[0].inst,T=w[1];return o(function(){C.value=g,C.getSnapshot=y,f(C)&&T({inst:C})},[h,g,y]),a(function(){return f(C)&&T({inst:C}),h(function(){f(C)&&T({inst:C})})},[h]),l(g),g}function f(h){var y=h.getSnapshot;h=h.value;try{var g=y();return!n(h,g)}catch{return!0}}function d(h,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return Xy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Xy}var gT;function ZM(){return gT||(gT=1,Gy.exports=u3()),Gy.exports}var Fx=ZM();const d3=(e,t)=>Us(t)?t:Zz(t)&&Us(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,f3={t:d3,ready:!1},h3=()=>()=>{},Sn=(e,t={})=>{var H,F,W;const{i18n:n}=t,{i18n:r,defaultNS:a}=v.useContext(l3)||{},o=n||r||o3();o&&!o.reportNamespaces&&(o.reportNamespaces=new c3),o||GM(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=v.useMemo(()=>{var j;return{...i3(),...(j=o==null?void 0:o.options)==null?void 0:j.react,...t}},[o,t]),{useSuspense:c,keyPrefix:f}=l,d=a||((H=o==null?void 0:o.options)==null?void 0:H.defaultNS),m=Us(d)?[d]:d||["translation"],h=v.useMemo(()=>m,m);(W=(F=o==null?void 0:o.reportNamespaces)==null?void 0:F.addUsedNamespaces)==null||W.call(F,h);const y=v.useRef(0),g=v.useCallback(j=>{if(!o)return h3;const{bindI18n:q,bindI18nStore:$}=l,B=()=>{y.current+=1,j()};return q&&o.on(q,B),$&&o.store.on($,B),()=>{q&&q.split(" ").forEach(_=>o.off(_,B)),$&&$.split(" ").forEach(_=>o.store.off(_,B))}},[o,l]),w=v.useRef(),C=v.useCallback(()=>{if(!o)return f3;const j=!!(o.isInitialized||o.initializedStoreOnce)&&h.every(U=>Qz(U,o,l)),q=t.lng||o.language,$=y.current,B=w.current;if(B&&B.ready===j&&B.lng===q&&B.keyPrefix===f&&B.revision===$)return B;const z={t:o.getFixedT(q,l.nsMode==="fallback"?h:h[0],f),ready:j,lng:q,keyPrefix:f,revision:$};return w.current=z,z},[o,h,f,l,t.lng]),[T,S]=v.useState(0),{t:R,ready:k}=Fx.useSyncExternalStore(g,C,C);v.useEffect(()=>{if(o&&!k&&!c){const j=()=>S(q=>q+1);t.lng?pT(o,t.lng,h,j):mv(o,h,j)}},[o,t.lng,h,k,c,T]);const M=o||{},D=v.useRef(null),O=v.useRef(),A=j=>{const q=Object.getOwnPropertyDescriptors(j);q.__original&&delete q.__original;const $=Object.create(Object.getPrototypeOf(j),q);if(!Object.prototype.hasOwnProperty.call($,"__original"))try{Object.defineProperty($,"__original",{value:j,writable:!1,enumerable:!1,configurable:!1})}catch{}return $},L=v.useMemo(()=>{const j=M,q=j==null?void 0:j.language;let $=j;j&&(D.current&&D.current.__original===j?O.current!==q?($=A(j),D.current=$,O.current=q):$=D.current:($=A(j),D.current=$,O.current=q));const B=[R,$,k];return B.t=R,B.i18n=$,B.ready=k,B},[R,M,k,M.resolvedLanguage,M.language,M.languages]);if(o&&c&&!k)throw new Promise(j=>{const q=()=>j();t.lng?pT(o,t.lng,h,q):mv(o,h,q)});return L},p3={en_US:{translation:{common:{loading:"Loading...",save:"Save",saving:"Saving...",cancel:"Cancel",add:"Add",delete:"Delete",edit:"Edit",confirm:"Confirm",close:"Close",expand:"Expand",collapse:"Collapse",refresh:"Refresh",test:"Test",send:"Send",success:"Success",error:"Error",warning:"Warning",info:"Info",yes:"Yes",no:"No",enabled:"Enabled",disabled:"Disabled",pending:"Pending",authorized:"Authorized",unknown:"Unknown",empty:"Empty",none:"None",default:"Default",optional:"Optional",required:"Required",pwaInstallTitle:"Install as app",pwaInstallHintIOSSafari:'iOS Safari does not show an automatic install prompt. Tap Share, then "Add to Home Screen".',pwaInstallHintIOSChrome:'iOS Chrome does not show an automatic install prompt. Tap Share, then "Add to Home Screen".'},nav:{manageDevices:"Manage Devices",settings:"Settings",sidebarExpand:"Expand Sidebar",sidebarCollapse:"Collapse Sidebar",openSidebar:"Open Sidebar",closeSidebar:"Close Sidebar",jumpToLatest:"Jump to Latest",switchToEditor:"Switch to Editor Input",switchToDirect:"Switch to Direct Input",refreshPage:"Refresh Page",refreshPageConfirm:"Are you sure you want to refresh the page? Unsaved content will be lost."},device:{title:"Device Management",devices:"Devices",addDevice:"Add Device",addDeviceDescription:"Fill in device details and choose a connection method",addFirstDevice:"Add First Device",editDevice:"Edit Device",editDeviceDescription:"Update device configuration",sectionBasic:"Basic Info",sectionConnection:"Connection",sectionAuth:"Authentication",noDevices:"No Devices",noDevicesDescription:"Add a local or SSH device to get started",name:"Device Name",namePlaceholder:"e.g., My Server",type:"Type",typeLocal:"Local Device",typeSSH:"SSH Remote Device",typeSSHBadge:"SSH",host:"Host",hostPlaceholder:"example.com",port:"Port",username:"Username",usernamePlaceholder:"root",session:"Tmux Session Name",sessionPlaceholder:"tmex",sessionHint:'Leave empty to use default "tmex"',authMode:"Authentication Mode",authPassword:"Password",authKey:"Private Key",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"Password",privateKey:"Private Key",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"Private Key Passphrase (Optional)",passphrase:"Passphrase",connect:"Connect",connected:"Connected",disconnect:"Disconnect",disconnected:"Disconnected",connecting:"Connecting...",dragHandle:"Drag to reorder device",reorderFailed:"Failed to reorder devices",deleteConfirm:"Delete this device?",deleteDescription:'Device "{{name}}" will be permanently removed. This action cannot be undone.',deleteSuccess:"Device deleted",createSuccess:"Device created",updateSuccess:"Device updated",deleteFailed:"Failed to delete device",createFailed:"Failed to create device",updateFailed:"Failed to update device",loadFailed:"Failed to load devices",localDevice:"Local Device",subtitle:"{{username}}@{{host}}:{{port}}",modify:"Modify Device",delete:"Delete"},terminal:{initializing:"Initializing terminal...",connecting:"Connecting to device...",initFailed:"Terminal initialization failed",inputPlaceholder:"Type command here...",clear:"Clear",deviceError:"Device Error",deviceErrorWithType:"[{{type}}] Device Error",noDeviceSelected:"No device selected",windowClosed:"Current window has been closed, please select a window from the sidebar.",paneClosed:"Current pane has been closed, please select a pane from the sidebar.",bellNotification:"Terminal Bell Notification",bellDescription:"Window {{window}} · Pane {{pane}}",bellFallback:"Received tmux bell",paneTitle:"Pane {{index}}",activePane:"Current Pane",activeWindow:"Current Window",editorPlaceholder:"Enter commands here...",editorClear:"Clear",editorSendWithEnter:"Send with Enter",editorSendLineByLine:"Send Line by Line",editorSend:"Send",sendShortcut:"Send {{key}}",inputModeDirect:"Direct Input",inputModeEditor:"Editor",newWindow:"New Window",closeWindow:"Close Window",closePane:"Close Pane",copy:"Copy",paste:"Paste",copied:"Copied to clipboard",copyFailed:"Copy failed",pasteFailed:"Could not read clipboard, check browser permissions",clearSelection:"Dismiss selection"},settings:{title:"System Settings",siteSettings:"Site Settings",siteName:"Site Name",siteNamePlaceholder:"tmex",siteUrl:"Site URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell Throttle (seconds)",notificationThrottle:"Notification Throttle (seconds)",enableBrowserBellToast:"Enable Browser Bell Toast",enableBrowserNotificationToast:"Enable Browser Notification Toast",enableTelegramBellPush:"Enable Telegram Bell Push",enableTelegramNotificationPush:"Enable Telegram Notification Push",sshReconnectRetries:"SSH Reconnect Retries",sshReconnectDelay:"SSH Reconnect Delay (seconds)",language:"Language",languagePlaceholder:"Select language",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"Theme",themeLight:"Light",themeDark:"Dark",siteTab:"Site",notificationsTab:"Notifications",refreshToApply:"Refresh to apply language change",saveSettings:"Save Settings",settingsSaved:"Settings saved",saveFailed:"Failed to save settings",loadFailed:"Failed to load settings",restartGateway:"Restart Gateway",restartScheduled:"Gateway restart scheduled",restartConfirm:"Are you sure you want to restart Gateway? This will interrupt all active connections.",restartFailed:"Failed to restart gateway",sshReconnectMaxRetries:"SSH Reconnect Retries",llm:{title:"LLM Providers",name:"Name",namePlaceholder:"e.g. OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"Adds /v1 automatically; end with / to keep the path as-is",protocol:"Protocol",apiKey:"API Key",apiKeyPlaceholder:"Enter API key",apiKeySetPlaceholder:"Already set, leave blank to keep",addProvider:"Add Provider",editProvider:"Edit Provider",formHint:"Configure the provider connection",models:"Models",modelsTitle:"Models for {{name}}",modelsHint:"Manage the available models for this provider: toggle and add manually",modelManual:"Manual",addModelPlaceholder:"Add a model ID",empty:"No providers yet",refreshModels:"Refresh Models",modelsCount:"{{total}} models",modelsNotFetched:"Models not fetched yet",modelsFetchFailed:"Failed to fetch models: {{error}}",deleteProvider:"Delete Provider",deleteConfirm:'Delete provider "{{name}}"?',defaults:"Global Defaults",defaultProvider:"Default Provider",defaultProviderNone:"Not set",defaultModel:"Default Model",defaultModelPlaceholder:"Type or pick a model ID",saveDefaults:"Save Defaults",loadFailed:"Failed to load LLM providers",createFailed:"Failed to create provider",updateFailed:"Failed to update provider",deleteFailed:"Failed to delete provider",refreshModelsFailed:"Failed to refresh models",settingsLoadFailed:"Failed to load LLM settings",settingsSaveFailed:"Failed to save LLM settings"},search:{title:"Search",provider:"Search Provider",providerNone:"Disabled",tavilyApiKey:"Tavily API Key",braveApiKey:"Brave API Key",keyPlaceholder:"Enter API key",keySetPlaceholder:"Already set, leave blank to keep",clearKey:"Clear",clearKeyConfirm:"Clear this API key? You will need to enter it again.",loadFailed:"Failed to load search settings",saveFailed:"Failed to save search settings"}},telegram:{title:"Telegram Bot Management",botName:"Bot Name",botNamePlaceholder:"e.g., ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Add Bot",enableBot:"Enable Bot",allowAuthRequests:"Allow Authorization Requests",pendingChats:"Pending Authorization",chats:"Authorized Chats",authorizedChats:"Authorized",noPendingChats:"No pending chats",noAuthorizedChats:"No authorized chats",approve:"Approve",authorize:"Authorize",reject:"Reject",revokeAuth:"Revoke Authorization",testMessage:"Test Message",sendTestMessage:"Send Test Message",deleteBot:"Delete Bot",tokenOptional:"Token (leave empty to keep unchanged)",tokenPlaceholder:"Enter new token",botCreated:"Bot created",botUpdated:"Bot updated",botDeleted:"Bot deleted",authApproved:"Authorization approved",chatRemoved:"Chat removed",testMessageSent:"Test message sent",createFailed:"Failed to create bot",updateFailed:"Failed to update bot",deleteFailed:"Failed to delete bot",approveFailed:"Failed to approve authorization",removeFailed:"Failed to remove chat",testMessageFailed:"Failed to send test message",loadBotsFailed:"Failed to load bot list",loadChatsFailed:"Failed to load chat list",noBots:"No bots yet, add one first.",expand:"Expand",collapse:"Collapse",authCount:"{{authorized}} authorized / {{pending}} pending (max 8)",chatId:"Chat ID",applyTime:"Application Time",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}: Connection error on device "{{deviceName}}" ({{host}}) [{{category}}]
71
- {{error}}`,agentCredentialWarning:'⚠️ {{siteName}}: A message in agent session "{{sessionTitle}}" appears to contain credentials ({{types}}). It will be sent to the LLM and stored — risk of leakage.',authSuccess:"✅ Authorized. You will now receive notifications.",authPending:"⏳ Authorization request received. Please approve in tmex settings.",authFailed:"❌ Authorization request failed. Please contact administrator.",testMessageTemplate:`🧪 Test Message
72
- Site: {{siteName}}
73
- Time: {{time}}`,approveMessageTemplate:`✅ Authorized via tmex.
74
- Bot: {{botName}}
75
- Time: {{time}}`,botNotFound:"Bot not found or unavailable",botNotRunning:"Bot is not running or unavailable"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"Secret",secretPlaceholder:"Used to sign payloads (HMAC-SHA256)",enabled:"Enabled",eventMask:"Events",add:"Add Webhook",empty:"No webhooks yet.",createFailed:"Failed to create webhook",deleteFailed:"Failed to delete webhook",loadFailed:"Failed to load webhooks"},sshError:{sshConfigRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",configRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",agentUnavailable:"SSH Agent unavailable: SSH_AUTH_SOCK not detected. Please check agent environment.",agentNoIdentity:"SSH Agent has no available keys. Please run ssh-add first.",agentNoIdentities:"SSH Agent has no available keys. Please run ssh-add first.",authFailed:"Authentication failed: incorrect username, password, or key. Please check device configuration.",authFailedGeneric:"Authentication failed: incorrect username, password, or key. Please check device configuration.",networkUnreachable:"Network unreachable: Please check routing, firewall, or VPN configuration.",connectionRefused:"Connection refused: Unable to connect to target host. Please check host address and port.",timeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",connectionTimeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",hostNotFound:"Host not found: Unable to resolve hostname. Please check DNS or hostname configuration.",handshakeFailed:"Handshake failed: Unable to establish secure connection. Possibly incompatible key exchange algorithm.",tmuxUnavailable:"Remote tmux unavailable or failed to start. Please ensure tmux is installed and available in the remote shell PATH.",connectionClosed:"Connection closed, attempting to reconnect",unknown:"Connection failed: {{message}}",reconnecting:"Connection interrupted, reconnecting in {{delay}} seconds ({{attempt}}/{{maxRetries}})",reconnectFailed:"Auto-reconnect failed, please retry manually",reconnected:"Device reconnected automatically"},deviceStatus:{reconnecting:"Reconnecting {{delay}}s",offline:"Offline",errorBadge:{authFailed:"Auth failed",agentUnavailable:"Agent unavailable",agentNoIdentity:"Agent has no keys",configRefNotSupported:"SSH Config unsupported",networkUnreachable:"Network unreachable",connectionRefused:"Refused",timeout:"Timeout",hostNotFound:"Host not found",handshakeFailed:"Handshake failed",tmuxUnavailable:"Tmux unavailable",connectionClosed:"Disconnected",unknown:"Connection error"}},websocket:{error:"WebSocket connection error",checkGateway:"Please check Gateway status",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"Please check Gateway status"},apiError:{siteNameRequired:"Site name cannot be empty",siteUrlInvalid:"Site URL must start with http:// or https://",bellThrottleInvalid:"Bell throttle seconds must be between 0-300",sshRetriesInvalid:"SSH reconnect retries must be between 0-20",sshDelayInvalid:"SSH reconnect delay must be between 1-300 seconds",languageInvalid:"Language must be one of the supported locales",botNameRequired:"Bot name cannot be empty",botTokenRequired:"Bot token cannot be empty",missingFields:"Missing required fields",sshRequiresHost:"SSH device requires host or sshConfigRef",invalidRequest:"Invalid request",deviceNotFound:"Device not found",botNotFound:"Bot not found",chatNotFound:"Chat not found",urlAndSecretRequired:"URL and secret are required",notFound:"Not found",llmProviderNameRequired:"Provider name cannot be empty",llmProviderProtocolInvalid:"Protocol must be openai-chat or openai-responses",llmProviderBaseUrlInvalid:"Base URL must start with http:// or https://",llmProviderApiKeyRequired:"API key cannot be empty",llmProviderNotFound:"LLM provider not found",llmProviderDisabled:"LLM provider {{name}} is disabled",llmNoDefaultProvider:"No LLM provider specified and no default provider configured",llmNoDefaultModel:"No model specified and no default model configured",llmDefaultProviderNotFound:"Default provider does not exist",llmSearchProviderInvalid:"Search provider must be none, tavily or brave",llmFetchModelsFailed:"Failed to fetch model list: {{detail}}",agentSessionNotFound:"Agent session not found",agentSessionBusy:"Agent session is currently running, stop it or wait for completion",agentSessionAwaitingConfirmation:"Agent session has pending confirmations, resolve them first",agentDeviceRequired:"Device is required",agentPaneRequired:"Terminal pane is required",agentWriteModeInvalid:"Write mode must be confirm or auto",agentMaxStepsInvalid:"Max steps per turn must be between 1 and 100",agentProviderWebSearchRequiresResponses:"Provider built-in web search requires the openai-responses protocol",agentHostedToolUnknown:"Unknown hosted tool: {{name}}",agentHostedToolRequiresResponses:"Provider hosted tools require the openai-responses protocol",agentSessionOrphaned:"This agent session is orphaned (its terminal is gone) and is read-only",agentQueuedMessageNotFound:"Queued message not found",agentConfirmationNotFound:"Confirmation not found",agentConfirmationAlreadyDecided:"Confirmation has already been decided",agentMessageTextRequired:"Message text is required",watchRuleNotFound:"Watch rule not found",watchNameRequired:"Rule name is required",watchTriggerTypeInvalid:"Trigger type must be match, unchanged or llm",watchPatternRequired:"match/unchanged rules require a regular expression",watchPatternInvalid:"Invalid regular expression: {{detail}}",watchUnchangedMinutesInvalid:"unchanged rules require unchangedMinutes greater than 0",watchExtractGroupInvalid:"Capture group index must be an integer >= 0",watchConditionPromptRequired:"llm rules require a condition prompt",watchIntervalInvalid:"Sampling interval must be at least {{min}} seconds",watchNoMatchBehaviorInvalid:"No-match behavior must be reset or ignore",watchFireModeInvalid:"Fire mode must be once or repeat",watchCooldownInvalid:"Cooldown seconds must be an integer >= 0",watchAssistDescriptionRequired:"Please describe what to match",watchAssistModelUnavailable:"Model call failed: {{detail}}"},notification:{clickToJump:"Click to jump to corresponding pane",eventType:{terminal_bell:"🔔 Terminal Bell",terminal_notification:"🔔 Terminal Notification",tmux_window_close:"🪟 Window Closed",tmux_pane_close:"📱 Pane Closed",device_tmux_missing:"⚠️ Tmux Missing",device_disconnect:"🔌 Device Disconnected",session_created:"🆕 Session Created",session_closed:"🚪 Session Closed",agent_confirmation_pending:"🤖 Agent Confirmation Pending",agent_turn_finished:"🤖 Agent Turn Finished",agent_error:"🤖 Agent Error",watch_triggered:"👁️ Watch Rule Triggered",watch_model_unavailable:"👁️ Watch Model Unavailable",watch_rule_error:"👁️ Watch Rule Error"},site:"Site",device:"Device",window:"Window",pane:"Pane",time:"Time",directLink:"Direct Link",message:"Message",paneTitle:"Title",process:"Process",telegramBell:{title:"🔔 Bell from {{siteName}}: {{terminalTopbarLabel}}",viewLink:"Click to view",terminalTopbarLabel:"Window {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:'Agent "{{title}}" requests to run tool {{toolName}}, awaiting confirmation',turnFinished:'Agent "{{title}}" turn finished',error:'Agent "{{title}}" error: {{message}}'},watch:{matchTriggered:'Watch "{{name}}" matched: {{text}}',unchangedTriggered:'Watch "{{name}}" value "{{value}}" has been unchanged for {{minutes}} minutes',llmTriggered:'Watch "{{name}}" condition met: {{reason}}',summaryTriggered:'Watch "{{name}}": {{summary}}',unconfirmedSuffix:" (model unavailable, not LLM-confirmed)",modelUnavailable:'Watch "{{name}}" model call failed: {{message}}',ruleError:'Watch "{{name}}" failed {{count}} times in a row and has been disabled: {{message}}',paneGone:'Watch "{{name}}" pane ({{paneId}}) was destroyed; the rule has been removed'}},sidebar:{noWindows:"No windows",noDevices:"No devices",addDeviceLink:"Add Device",openSettingsLink:"Open Settings",openSettings:"Open Settings",manageDevices:"Manage Devices",settings:"Settings",currentWindow:"Current Window",currentPane:"Current Pane",newWindow:"Create Window",closeWindow:"Close Window",closePane:"Close Pane",addDevice:"Add Device",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"Orphaned sessions"},agent:{error:{streamStalled:"The model stopped responding (upstream stream stalled). Please retry."},model:{select:"Select model",placeholder:"Model",noProviders:"No models — configure a provider in Settings"},queue:{title:"Queued ({{count}})",steer:"Steer now",steerHint:"Interrupt the current step and inject the queue now",withdraw:"Withdraw"},orphan:{readonly:"This session is orphaned (its terminal is gone) — read-only",title:"Orphaned",process:"Process",startedAt:"Started"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"Select or create a session",inputPlaceholder:"Type a message…",send:"Send",stop:"Stop",retry:"Retry",scrollToBottom:"Scroll to bottom"},session:{none:"No session selected",new:"New agent session",switch:"Switch session",selectPaneHint:"Select a pane in the Panes tab to start a session",noSessions:"No sessions yet",showAll:"Show all sessions",rename:"Rename session",renameTitle:"Rename session",renamePlaceholder:"Session title",save:"Save",cancel:"Cancel",delete:"Delete session",deleteTitle:"Delete this session?",deleteDesc:'"{{title}}" and all its messages will be permanently deleted.',deleteConfirm:"Delete",createDisabledNoPane:"Open a terminal pane to create a session",privacyNotice:"Sessions send terminal screen content to the configured LLM service."},binding:{invalid:"Pane unavailable",mismatchTitle:"This session is bound to a different pane",goTo:"Go to pane",rebind:"Rebind here"},writeMode:{confirm:"Confirm writes",auto:"Auto execute"},confirm:{title:"Approval required",approve:"Allow",deny:"Deny"},tool:{input:"Input",result:"Result",screen:"Screen capture",send_input:"Send input",read_screen:"Read screen",web_search:"Web search",fetch_url:"Fetch URL",denied:"Denied"},reasoning:{title:"Reasoning"},toast:{errorTitle:'Agent "{{title}}" error',credentialWarningTitle:"Message may contain credentials",credentialWarningDescription:"Detected {{types}}. The content is not modified, but it will be sent to the LLM and stored — risk of leakage."}},window:{noWindows:"No windows",new:"New Window",close:"Close window",closePane:"Close pane",closeConfirmTitle:"Close this window?",closePaneConfirmTitle:"Close this pane?",closeConfirmDesc:'Processes running in "{{name}}" will be terminated. This action cannot be undone.',menu:"Window actions",dragHandle:"Drag to reorder window",dragHandlePane:"Drag to reorder pane",rename:"Rename window",renamePlaceholder:"Enter a name",renameDesc:"The custom name overrides the title set by the terminal and is kept until the gateway restarts.",renameReset:"Use automatic name"},watch:{title:"Watch rules",dialogDesc:"Monitor this pane's screen and get notified when conditions are met",openMonitor:"Watch this pane",rules:{empty:"No watch rules for this pane yet",addRule:"New rule",edit:"Edit",delete:"Delete",viewState:"Status",lastTriggered:"Last triggered: {{time}}",neverTriggered:"Never triggered",deleteTitle:"Delete this rule?",deleteDesc:'"{{name}}" will be permanently deleted.',deleteConfirm:"Delete"},type:{match:"Match",unchanged:"Stuck",llm:"LLM"},typeDesc:{match:"Trigger when a regex matches the screen",unchanged:"Trigger when an extracted value stays unchanged for N minutes (e.g. stalled download)",llm:"An LLM periodically checks the screen against a natural-language condition"},form:{createTitle:"New watch rule",editTitle:"Edit watch rule",name:"Rule name",namePlaceholder:"e.g. Download stalled",triggerType:"Trigger type",pattern:"Regular expression",patternPlaceholder:"e.g. (\\d+)%",flags:"Flags",flagsPlaceholder:"e.g. i",extractGroup:"Capture group index",extractGroupHint:"0 = whole match; the group value is tracked over time",unchangedMinutes:"Unchanged for (minutes)",noMatchBehavior:"When nothing matches",noMatchReset:"Reset timer (progress line gone = task done)",noMatchIgnore:"Ignore (keep last value)",conditionPrompt:"Condition (natural language)",conditionPromptPlaceholder:"e.g. The build has failed with a compile error",model:"Model",followGlobalDefault:"Follow global default",modelPlaceholder:"Model ID",modelRequiredHint:"This rule calls an LLM. Make sure the selected (or global default) model is available.",confirmWithLlm:"LLM double-check before notifying",confirmWithLlmDesc:"Reduce false positives; fails open if the model is unavailable",summarizeWithLlm:"LLM notification summary",summarizeWithLlmDesc:"Summarize the screen into the notification text",intervalSeconds:"Sampling interval (seconds)",intervalHint:"Minimum {{min}}s",fireMode:"Fire mode",fireOnce:"Once (auto-disable after firing)",fireRepeat:"Repeat",cooldownSeconds:"Cooldown (seconds)",enabled:"Enabled",assistLabel:"Generate regex from a description",assistPlaceholder:"e.g. match the download progress percentage",assistButton:"Generate",assistExplanation:"Explanation",assistPreview:"Matches on current screen",assistPreviewEmpty:"No matches on the current screen sample",create:"Create",save:"Save",providerUnavailable:"Original provider unavailable",providerDisabled:"disabled"},validation:{nameRequired:"Rule name is required",patternRequired:"Regular expression is required",patternInvalid:"Invalid regular expression: {{detail}}",unchangedMinutesInvalid:"Unchanged minutes must be greater than 0",conditionPromptRequired:"Condition prompt is required",intervalMin:"Sampling interval must be at least {{min}} seconds"},state:{title:"Rule status",back:"Back",lastSampledAt:"Last sampled",lastValue:"Last value",lastValueChangedAt:"Value last changed",lastTriggeredAt:"Last triggered",consecutiveErrors:"Consecutive errors",lastError:"Last error",samples:"Recent samples",samplesEmpty:"No samples yet",hit:"hit",none:"—"},toast:{created:"Watch rule created",updated:"Watch rule updated",deleted:"Watch rule deleted",triggeredTitle:"Watch triggered",openTerminal:"Open terminal",modelUnavailableTitle:"Watch model unavailable",modelUnavailableHint:"The rule keeps running with degraded behavior.",ruleErrorTitle:"Watch rule auto-disabled"},notifPermission:{title:"Enable browser notifications?",desc:"Get notified when watch rules trigger, even when this tab is in the background.",enable:"Enable",dismiss:"Not now"}},validation:{deviceNameRequired:"Device name is required",hostRequired:"Host is required for SSH devices"}}},zh_CN:{translation:{common:{loading:"加载中...",save:"保存",saving:"保存中...",cancel:"取消",add:"添加",delete:"删除",edit:"修改",confirm:"确认",close:"关闭",expand:"展开",collapse:"收起",refresh:"刷新",test:"测试",send:"发送",success:"成功",error:"错误",warning:"警告",info:"信息",yes:"是",no:"否",enabled:"已启用",disabled:"已禁用",pending:"待授权",authorized:"已授权",unknown:"未知",empty:"空",none:"无",default:"默认",optional:"可选",required:"必填",pwaInstallTitle:"安装为应用",pwaInstallHintIOSSafari:"iOS Safari 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」。",pwaInstallHintIOSChrome:"iOS Chrome 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」"},nav:{manageDevices:"管理设备",settings:"设置",sidebarExpand:"展开侧边栏",sidebarCollapse:"收起侧边栏",openSidebar:"打开侧边栏",closeSidebar:"关闭侧边栏",jumpToLatest:"跳转到最新",switchToEditor:"切换到编辑器输入",switchToDirect:"切换到直接输入",refreshPage:"刷新页面",refreshPageConfirm:"确定要刷新页面吗?未保存的内容将会丢失。"},device:{title:"设备管理",devices:"设备",addDevice:"添加设备",addDeviceDescription:"填写设备信息并选择连接方式",addFirstDevice:"添加第一个设备",editDevice:"修改设备",editDeviceDescription:"更新设备配置",sectionBasic:"基本信息",sectionConnection:"连接信息",sectionAuth:"认证信息",noDevices:"暂无设备",noDevicesDescription:"添加本地或 SSH 设备开始使用",name:"设备名称",namePlaceholder:"例如:我的服务器",type:"类型",typeLocal:"本地设备",typeSSH:"SSH 远程设备",typeSSHBadge:"SSH",host:"主机",hostPlaceholder:"example.com",port:"端口",username:"用户名",usernamePlaceholder:"root",session:"Tmux 会话名称",sessionPlaceholder:"tmex",sessionHint:'留空将使用默认值 "tmex"',authMode:"认证方式",authPassword:"密码",authKey:"私钥",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"密码",privateKey:"私钥",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"私钥密码(可选)",passphrase:"私钥密码(可选)",connect:"连接",connected:"已连接",disconnect:"断开",disconnected:"已断开",connecting:"连接中...",dragHandle:"拖动以调整设备顺序",reorderFailed:"设备排序失败",deleteConfirm:"删除此设备?",deleteDescription:'设备 "{{name}}" 将被永久移除,此操作无法撤销。',deleteSuccess:"设备已删除",createSuccess:"设备已创建",updateSuccess:"设备已更新",deleteFailed:"删除设备失败",createFailed:"创建设备失败",updateFailed:"更新设备失败",loadFailed:"加载设备列表失败",localDevice:"本地设备",subtitle:"{{username}}@{{host}}:{{port}}",modify:"修改设备",delete:"删除"},terminal:{initializing:"初始化终端...",connecting:"连接设备...",initFailed:"终端初始化失败",inputPlaceholder:"在此输入命令...",clear:"清空",deviceError:"设备错误",deviceErrorWithType:"[{{type}}] 设备错误",noDeviceSelected:"未选择设备",windowClosed:"当前窗口已关闭,请在侧边栏重新选择窗口。",paneClosed:"当前 Pane 已关闭,请在侧边栏重新选择 Pane。",bellNotification:"终端 Bell 提醒",bellDescription:"窗口 {{window}} · Pane {{pane}}",bellFallback:"收到 tmux bell",paneTitle:"Pane {{index}}",activePane:"当前 pane",activeWindow:"当前窗口",editorPlaceholder:"在此输入命令...",editorClear:"清空",editorSendWithEnter:"发送附带回车",editorSendLineByLine:"逐行发送",editorSend:"发送",sendShortcut:"发送 {{key}}",inputModeDirect:"直接输入",inputModeEditor:"编辑器",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",copy:"复制",paste:"粘贴",copied:"已复制到剪贴板",copyFailed:"复制失败",pasteFailed:"无法读取剪贴板,请检查浏览器权限",clearSelection:"取消选择"},settings:{title:"系统设置",siteSettings:"站点设置",siteName:"站点名称",siteNamePlaceholder:"tmex",siteUrl:"站点访问 URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell 频控(秒)",notificationThrottle:"通知频控(秒)",enableBrowserBellToast:"开启浏览器 Bell Toast",enableBrowserNotificationToast:"开启浏览器通知 Toast",enableTelegramBellPush:"开启 Telegram Bell 推送",enableTelegramNotificationPush:"开启 Telegram 通知推送",sshReconnectRetries:"SSH 重连次数",sshReconnectDelay:"SSH 重连等待(秒)",language:"语言",languagePlaceholder:"选择语言",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"主题",themeLight:"浅色",themeDark:"深色",siteTab:"站点",notificationsTab:"通知",refreshToApply:"刷新后生效",saveSettings:"保存设置",settingsSaved:"站点设置已保存",saveFailed:"保存设置失败",loadFailed:"加载设置失败",restartGateway:"重启 Gateway",restartScheduled:"Gateway 重启请求已发送",restartConfirm:"确定要重启 Gateway 吗?这将中断所有活动连接。",restartFailed:"重启请求失败",sshReconnectMaxRetries:"SSH 重连次数",llm:{title:"LLM 提供商",name:"名称",namePlaceholder:"如 OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"默认自动补全 /v1;以 / 结尾则按原路径不补 /v1",protocol:"协议",apiKey:"API Key",apiKeyPlaceholder:"输入 API Key",apiKeySetPlaceholder:"已设置,留空不修改",addProvider:"添加提供商",editProvider:"编辑供应商",formHint:"配置供应商连接信息",models:"模型",modelsTitle:"{{name}} 的模型",modelsHint:"管理该供应商可用的模型,启停与手动添加",modelManual:"手动",addModelPlaceholder:"添加模型 ID",empty:"暂无提供商",refreshModels:"刷新模型",modelsCount:"{{total}} 个模型",modelsNotFetched:"尚未获取模型列表",modelsFetchFailed:"模型列表获取失败:{{error}}",deleteProvider:"删除提供商",deleteConfirm:"确定要删除提供商「{{name}}」吗?",defaults:"全局默认",defaultProvider:"默认提供商",defaultProviderNone:"未设置",defaultModel:"默认模型",defaultModelPlaceholder:"输入或选择模型 ID",saveDefaults:"保存默认设置",loadFailed:"加载 LLM 提供商失败",createFailed:"创建提供商失败",updateFailed:"更新提供商失败",deleteFailed:"删除提供商失败",refreshModelsFailed:"刷新模型失败",settingsLoadFailed:"加载 LLM 设置失败",settingsSaveFailed:"保存 LLM 设置失败"},search:{title:"搜索",provider:"搜索提供商",providerNone:"不启用",tavilyApiKey:"Tavily API Key",braveApiKey:"Brave API Key",keyPlaceholder:"输入 API Key",keySetPlaceholder:"已设置,留空不修改",clearKey:"清除",clearKeyConfirm:"确定要清除此 API Key 吗?清除后需要重新填写。",loadFailed:"加载搜索设置失败",saveFailed:"保存搜索设置失败"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名称",botNamePlaceholder:"如:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"新增 Bot",enableBot:"启用 Bot",allowAuthRequests:"允许申请授权",pendingChats:"待授权",chats:"已授权",authorizedChats:"已授权",noPendingChats:"暂无待授权 chat",noAuthorizedChats:"暂无已授权 chat",approve:"批准",authorize:"授权",reject:"拒绝",revokeAuth:"撤销授权",testMessage:"测试消息",sendTestMessage:"发送测试消息",deleteBot:"删除 Bot",tokenOptional:"Token(留空不改)",tokenPlaceholder:"输入新 token",botCreated:"Bot 已创建",botUpdated:"Bot 已更新",botDeleted:"Bot 已删除",authApproved:"授权已批准",chatRemoved:"chat 已移除",testMessageSent:"测试消息已发送",createFailed:"新增 Bot 失败",updateFailed:"更新 Bot 失败",deleteFailed:"删除 Bot 失败",approveFailed:"批准授权失败",removeFailed:"删除 chat 失败",testMessageFailed:"发送测试消息失败",loadBotsFailed:"加载 Bot 列表失败",loadChatsFailed:"加载 chat 列表失败",noBots:"暂无 Bot,先添加一个。",expand:"展开",collapse:"收起",authCount:"已授权 {{authorized}} / 待授权 {{pending}}(总上限 8)",chatId:"chatId",applyTime:"申请时间",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:设备「{{deviceName}}」({{host}}) 连接异常 [{{category}}]
76
- {{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent 会话「{{sessionTitle}}」的一条消息疑似包含凭证({{types}})。该内容将发送至 LLM 并存储,存在泄露风险。",authSuccess:"✅ 已授权,可接收通知。",authPending:"⏳ 已收到授权申请,请在 tmex 设置页审批。",authFailed:"❌ 授权申请失败,请联系管理员。",testMessageTemplate:`🧪 测试消息
77
- 站点:{{siteName}}
78
- 时间:{{time}}`,approveMessageTemplate:`✅ 已通过 tmex 授权。
79
- Bot:{{botName}}
80
- 时间:{{time}}`,botNotFound:"Bot 未启动或不可用",botNotRunning:"Bot 未启动或不可用"},webhook:{title:"Webhooks",url:"Webhook 地址",secret:"密钥",secretPlaceholder:"用于签名(HMAC-SHA256)",enabled:"启用",eventMask:"事件",add:"添加 Webhook",empty:"暂无 Webhook。",createFailed:"创建 Webhook 失败",deleteFailed:"删除 Webhook 失败",loadFailed:"加载 Webhook 失败"},sshError:{sshConfigRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",configRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",agentUnavailable:"SSH Agent 不可用:未检测到 SSH_AUTH_SOCK,请检查 agent 环境",agentNoIdentity:"SSH Agent 未加载可用密钥,请先执行 ssh-add",agentNoIdentities:"SSH Agent 未加载可用密钥,请先执行 ssh-add",authFailed:"认证失败:用户名、密码或密钥不正确,请检查设备配置",authFailedGeneric:"认证失败:用户名、密码或密钥不正确,请检查设备配置",networkUnreachable:"网络不可达:请检查路由、防火墙或 VPN 配置",connectionRefused:"连接被拒绝:无法连接到目标主机,请检查主机地址和端口是否正确",timeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",connectionTimeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",hostNotFound:"主机未找到:无法解析主机地址,请检查 DNS 或主机名是否正确",handshakeFailed:"握手失败:无法建立安全连接,可能是密钥交换算法不兼容",tmuxUnavailable:"远端 tmux 不可用或启动失败,请检查远端是否已安装 tmux,且远端 shell PATH 可找到 tmux",connectionClosed:"连接已断开,尝试重连中",unknown:"连接失败:{{message}}",reconnecting:"连接中断,{{delay}} 秒后自动重连({{attempt}}/{{maxRetries}})",reconnectFailed:"自动重连失败,请手动重试",reconnected:"设备已自动重连"},deviceStatus:{reconnecting:"重连中 {{delay}}s",offline:"离线",errorBadge:{authFailed:"认证失败",agentUnavailable:"Agent 不可用",agentNoIdentity:"Agent 无密钥",configRefNotSupported:"不支持 SSH Config",networkUnreachable:"网络不可达",connectionRefused:"连接被拒",timeout:"连接超时",hostNotFound:"主机未找到",handshakeFailed:"握手失败",tmuxUnavailable:"tmux 不可用",connectionClosed:"连接已断开",unknown:"连接异常"}},websocket:{error:"WebSocket 连接错误",checkGateway:"请检查 Gateway 状态",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"请检查 Gateway 状态"},apiError:{siteNameRequired:"站点名称不能为空",siteUrlInvalid:"站点 URL 必须以 http:// 或 https:// 开头",bellThrottleInvalid:"Bell 频控秒数需在 0-300 之间",sshRetriesInvalid:"SSH 重连次数需在 0-20 之间",sshDelayInvalid:"SSH 重连等待时间需在 1-300 秒之间",languageInvalid:"语言必须是受支持的区域设置之一",botNameRequired:"Bot 名称不能为空",botTokenRequired:"Bot token 不能为空",missingFields:"缺少必填字段",sshRequiresHost:"SSH 设备需要 host 或 sshConfigRef",invalidRequest:"请求无效",deviceNotFound:"Device not found",botNotFound:"Bot 不存在",chatNotFound:"Chat 不存在",urlAndSecretRequired:"URL and secret required",notFound:"Not found",llmProviderNameRequired:"Provider 名称不能为空",llmProviderProtocolInvalid:"协议必须是 openai-chat 或 openai-responses",llmProviderBaseUrlInvalid:"Base URL 必须以 http:// 或 https:// 开头",llmProviderApiKeyRequired:"API key 不能为空",llmProviderNotFound:"LLM provider 不存在",llmProviderDisabled:"LLM provider {{name}} 已被禁用",llmNoDefaultProvider:"未指定 LLM provider 且未配置默认 provider",llmNoDefaultModel:"未指定模型且未配置默认模型",llmDefaultProviderNotFound:"默认 provider 不存在",llmSearchProviderInvalid:"搜索服务必须是 none、tavily 或 brave",llmFetchModelsFailed:"拉取模型列表失败:{{detail}}",agentSessionNotFound:"Agent 会话不存在",agentSessionBusy:"Agent 会话正在运行中,请先停止或等待完成",agentSessionAwaitingConfirmation:"Agent 会话有待处理的确认请求,请先处理",agentDeviceRequired:"必须指定设备",agentPaneRequired:"必须指定终端 pane",agentWriteModeInvalid:"写入模式必须是 confirm 或 auto",agentMaxStepsInvalid:"每回合最大步数必须在 1-100 之间",agentProviderWebSearchRequiresResponses:"Provider 内置搜索仅支持 openai-responses 协议",agentHostedToolUnknown:"未知的 hosted 工具:{{name}}",agentHostedToolRequiresResponses:"Provider hosted 工具仅支持 openai-responses 协议",agentSessionOrphaned:"该 Agent 会话已孤立(绑定终端已不存在),仅可只读查看",agentQueuedMessageNotFound:"排队消息不存在",agentConfirmationNotFound:"确认请求不存在",agentConfirmationAlreadyDecided:"确认请求已被处理",agentMessageTextRequired:"消息内容不能为空",watchRuleNotFound:"Watch 规则不存在",watchNameRequired:"规则名称不能为空",watchTriggerTypeInvalid:"触发类型必须是 match、unchanged 或 llm",watchPatternRequired:"match/unchanged 规则必须提供正则表达式",watchPatternInvalid:"正则表达式无效:{{detail}}",watchUnchangedMinutesInvalid:"unchanged 规则的未变化分钟数必须大于 0",watchExtractGroupInvalid:"捕获组序号必须是不小于 0 的整数",watchConditionPromptRequired:"llm 规则必须提供条件描述",watchIntervalInvalid:"采样间隔不能小于 {{min}} 秒",watchNoMatchBehaviorInvalid:"无命中行为必须是 reset 或 ignore",watchFireModeInvalid:"触发模式必须是 once 或 repeat",watchCooldownInvalid:"冷却秒数必须是不小于 0 的整数",watchAssistDescriptionRequired:"请描述要匹配的内容",watchAssistModelUnavailable:"模型调用失败:{{detail}}"},notification:{clickToJump:"点击跳转到对应 Pane",eventType:{terminal_bell:"🔔 终端 Bell",terminal_notification:"🔔 终端通知",tmux_window_close:"🪟 窗口关闭",tmux_pane_close:"📱 Pane 关闭",device_tmux_missing:"⚠️ Tmux 不可用",device_disconnect:"🔌 设备断开",session_created:"🆕 会话创建",session_closed:"🚪 会话关闭",agent_confirmation_pending:"🤖 Agent 等待确认",agent_turn_finished:"🤖 Agent 回合完成",agent_error:"🤖 Agent 错误",watch_triggered:"👁️ Watch 规则触发",watch_model_unavailable:"👁️ Watch 模型不可用",watch_rule_error:"👁️ Watch 规则错误"},site:"站点",device:"设备",window:"窗口",pane:"Pane",time:"时间",directLink:"直达",message:"信息",paneTitle:"标题",process:"进程",telegramBell:{title:"🔔 来自 {{siteName}} 的 Bell:{{terminalTopbarLabel}}",viewLink:"点击查看",terminalTopbarLabel:"窗口 {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:"Agent「{{title}}」请求执行工具 {{toolName}},等待确认",turnFinished:"Agent「{{title}}」回合完成",error:"Agent「{{title}}」出错:{{message}}"},watch:{matchTriggered:"监控「{{name}}」命中:{{text}}",unchangedTriggered:"监控「{{name}}」的值「{{value}}」已 {{minutes}} 分钟未变化",llmTriggered:"监控「{{name}}」条件满足:{{reason}}",summaryTriggered:"监控「{{name}}」:{{summary}}",unconfirmedSuffix:"(模型不可用,未经 LLM 二次确认)",modelUnavailable:"监控「{{name}}」模型调用失败:{{message}}",ruleError:"监控「{{name}}」连续失败 {{count}} 次,已自动停用:{{message}}",paneGone:"监控「{{name}}」的 Pane({{paneId}})已销毁,规则已自动删除"}},sidebar:{noWindows:"暂无窗口",noDevices:"暂无设备",addDeviceLink:"添加设备",openSettingsLink:"打开设置",openSettings:"打开设置",manageDevices:"管理设备",settings:"设置",currentWindow:"当前窗口",currentPane:"当前 pane",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",addDevice:"添加设备",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"孤立会话"},agent:{error:{streamStalled:"模型停止响应(上游流无响应),请重试。"},model:{select:"选择模型",placeholder:"模型",noProviders:"暂无模型 — 请先在设置中配置供应商"},queue:{title:"队列({{count}})",steer:"立即注入",steerHint:"中断当前步骤并立即注入队列",withdraw:"撤回"},orphan:{readonly:"该会话已孤立(绑定终端已不存在),仅可只读查看",title:"孤立会话",process:"进程",startedAt:"创建于"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"选择或创建一个会话",inputPlaceholder:"输入消息…",send:"发送",stop:"停止",retry:"重试",scrollToBottom:"回到底部"},session:{none:"未选择会话",new:"新建 Agent 会话",switch:"切换会话",selectPaneHint:"请在 Panes 标签中选择一个 pane 来开启会话",noSessions:"暂无会话",showAll:"显示全部会话",rename:"重命名会话",renameTitle:"重命名会话",renamePlaceholder:"会话标题",save:"保存",cancel:"取消",delete:"删除会话",deleteTitle:"删除此会话?",deleteDesc:"“{{title}}”及其全部消息将被永久删除。",deleteConfirm:"删除",createDisabledNoPane:"请先打开一个终端 pane 再创建会话",privacyNotice:"会话将把终端屏幕内容发送给配置的 LLM 服务。"},binding:{invalid:"已失效",mismatchTitle:"此会话绑定的 pane 与当前终端不一致",goTo:"跳转过去",rebind:"重绑到当前"},writeMode:{confirm:"写入需确认",auto:"自动执行"},confirm:{title:"等待确认",approve:"允许",deny:"拒绝"},tool:{input:"输入",result:"结果",screen:"屏幕快照",send_input:"发送输入",read_screen:"读取屏幕",web_search:"网络搜索",fetch_url:"抓取网页",denied:"已拒绝"},reasoning:{title:"思考过程"},toast:{errorTitle:"Agent“{{title}}”出错",credentialWarningTitle:"消息疑似包含凭证",credentialWarningDescription:"检测到 {{types}}。内容不会被修改,但会发送至 LLM 并存储,存在泄露风险。"}},window:{noWindows:"暂无窗口",new:"新建窗口",close:"关闭窗口",closePane:"关闭面板",closeConfirmTitle:"关闭此窗口?",closePaneConfirmTitle:"关闭此面板?",closeConfirmDesc:'"{{name}}" 中运行的进程将被终止,此操作无法撤销。',menu:"窗口操作",dragHandle:"拖动以调整窗口顺序",dragHandlePane:"拖动以调整 pane 顺序",rename:"重命名窗口",renamePlaceholder:"输入名称",renameDesc:"自定义名称会覆盖终端设置的标题,并保留至 gateway 重启。",renameReset:"恢复自动名称"},watch:{title:"监控规则",dialogDesc:"监控该终端屏幕,条件满足时发送通知",openMonitor:"监控此终端",rules:{empty:"该终端还没有监控规则",addRule:"新建规则",edit:"编辑",delete:"删除",viewState:"状态",lastTriggered:"最近触发:{{time}}",neverTriggered:"从未触发",deleteTitle:"删除该规则?",deleteDesc:"“{{name}}”将被永久删除。",deleteConfirm:"删除"},type:{match:"匹配",unchanged:"卡住",llm:"LLM"},typeDesc:{match:"正则命中屏幕内容时触发",unchanged:"提取值连续 N 分钟不变时触发(如下载卡住)",llm:"由 LLM 周期查看屏幕并判断自然语言条件"},form:{createTitle:"新建监控规则",editTitle:"编辑监控规则",name:"规则名称",namePlaceholder:"如:下载卡住提醒",triggerType:"触发类型",pattern:"正则表达式",patternPlaceholder:"如:(\\d+)%",flags:"标志",flagsPlaceholder:"如:i",extractGroup:"捕获组序号",extractGroupHint:"0 = 整个匹配;该组的值将被持续跟踪",unchangedMinutes:"不变持续(分钟)",noMatchBehavior:"无命中时",noMatchReset:"重置计时(进度行消失视为任务结束)",noMatchIgnore:"忽略(保留上次值)",conditionPrompt:"条件(自然语言)",conditionPromptPlaceholder:"如:构建因编译错误而失败",model:"模型",followGlobalDefault:"跟随全局默认",modelPlaceholder:"模型 ID",modelRequiredHint:"该规则会调用 LLM,请确保所选(或全局默认)模型可用。",confirmWithLlm:"通知前 LLM 二次确认",confirmWithLlmDesc:"减少误报;模型不可用时直接通知",summarizeWithLlm:"LLM 生成通知摘要",summarizeWithLlmDesc:"由模型总结屏幕内容作为通知正文",intervalSeconds:"采样间隔(秒)",intervalHint:"最低 {{min}} 秒",fireMode:"触发模式",fireOnce:"单次(触发后自动停用)",fireRepeat:"重复",cooldownSeconds:"冷却时间(秒)",enabled:"启用",assistLabel:"用描述生成正则",assistPlaceholder:"如:匹配下载进度百分比",assistButton:"生成",assistExplanation:"说明",assistPreview:"当前屏幕命中",assistPreviewEmpty:"当前屏幕样本无命中",create:"创建",save:"保存",providerUnavailable:"原提供商已不可用",providerDisabled:"已禁用"},validation:{nameRequired:"规则名称不能为空",patternRequired:"正则表达式不能为空",patternInvalid:"正则表达式无效:{{detail}}",unchangedMinutesInvalid:"不变持续分钟数必须大于 0",conditionPromptRequired:"条件描述不能为空",intervalMin:"采样间隔不能低于 {{min}} 秒"},state:{title:"规则状态",back:"返回",lastSampledAt:"最近采样",lastValue:"最近值",lastValueChangedAt:"值最近变化",lastTriggeredAt:"最近触发",consecutiveErrors:"连续错误次数",lastError:"最近错误",samples:"近期样本",samplesEmpty:"暂无样本",hit:"命中",none:"—"},toast:{created:"监控规则已创建",updated:"监控规则已更新",deleted:"监控规则已删除",triggeredTitle:"监控触发",openTerminal:"打开终端",modelUnavailableTitle:"监控模型不可用",modelUnavailableHint:"规则将以降级方式继续运行。",ruleErrorTitle:"监控规则已自动停用"},notifPermission:{title:"启用浏览器通知?",desc:"即使页面在后台,监控触发时也能收到通知。",enable:"启用",dismiss:"暂不"}},validation:{deviceNameRequired:"设备名称为必填项",hostRequired:"SSH 设备需要填写主机地址"}}},ja_JP:{translation:{common:{loading:"読み込み中...",save:"保存",saving:"保存中...",cancel:"キャンセル",add:"追加",delete:"削除",edit:"編集",confirm:"確認",close:"閉じる",expand:"展開",collapse:"折りたたむ",refresh:"更新",test:"テスト",send:"送信",success:"成功",error:"エラー",warning:"警告",info:"情報",yes:"はい",no:"いいえ",enabled:"有効",disabled:"無効",pending:"保留中",authorized:"承認済み",unknown:"不明",empty:"空",none:"なし",default:"デフォルト",optional:"任意",required:"必須",pwaInstallTitle:"アプリとしてインストール",pwaInstallHintIOSSafari:"iOS Safari では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。",pwaInstallHintIOSChrome:"iOS Chrome では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。"},nav:{manageDevices:"デバイス管理",settings:"設定",sidebarExpand:"サイドバーを展開",sidebarCollapse:"サイドバーを折りたたむ",openSidebar:"サイドバーを開く",closeSidebar:"サイドバーを閉じる",jumpToLatest:"最新にジャンプ",switchToEditor:"エディタ入力に切り替え",switchToDirect:"直接入力に切り替え",refreshPage:"ページを更新",refreshPageConfirm:"ページを更新してもよろしいですか?保存されていない内容は失われます。"},device:{title:"デバイス管理",devices:"デバイス",addDevice:"デバイスを追加",addDeviceDescription:"デバイス情報を入力し、接続方法を選択してください",addFirstDevice:"最初のデバイスを追加",editDevice:"デバイスを編集",editDeviceDescription:"デバイス設定を更新",sectionBasic:"基本情報",sectionConnection:"接続情報",sectionAuth:"認証情報",noDevices:"デバイスがありません",noDevicesDescription:"ローカルまたは SSH デバイスを追加して開始",name:"デバイス名",namePlaceholder:"例:My Server",type:"タイプ",typeLocal:"ローカルデバイス",typeSSH:"SSH リモートデバイス",typeSSHBadge:"SSH",host:"ホスト",hostPlaceholder:"example.com",port:"ポート",username:"ユーザー名",usernamePlaceholder:"root",session:"Tmux セッション名",sessionPlaceholder:"tmex",sessionHint:"空の場合、デフォルトの「tmex」が使用されます",authMode:"認証モード",authPassword:"パスワード",authKey:"秘密鍵",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"パスワード",privateKey:"秘密鍵",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"秘密鍵のパスフレーズ(任意)",passphrase:"パスフレーズ",connect:"接続",connected:"接続済み",disconnect:"切断",disconnected:"切断済み",connecting:"接続中...",dragHandle:"ドラッグしてデバイスを並べ替え",reorderFailed:"デバイスの並べ替えに失敗しました",deleteConfirm:"このデバイスを削除しますか?",deleteDescription:"デバイス「{{name}}」は完全に削除されます。この操作は取り消せません。",deleteSuccess:"デバイスを削除しました",createSuccess:"デバイスを作成しました",updateSuccess:"デバイスを更新しました",deleteFailed:"デバイスの削除に失敗しました",createFailed:"デバイスの作成に失敗しました",updateFailed:"デバイスの更新に失敗しました",loadFailed:"デバイス一覧の読み込みに失敗しました",localDevice:"ローカルデバイス",subtitle:"{{username}}@{{host}}:{{port}}",modify:"デバイスを変更",delete:"削除"},terminal:{initializing:"ターミナルを初期化中...",connecting:"デバイスに接続中...",initFailed:"ターミナルの初期化に失敗しました",inputPlaceholder:"ここにコマンドを入力...",clear:"クリア",deviceError:"デバイスエラー",deviceErrorWithType:"[{{type}}] デバイスエラー",noDeviceSelected:"デバイスが選択されていません",windowClosed:"現在のウィンドウは閉じられました。サイドバーからウィンドウを選択してください。",paneClosed:"現在のペインは閉じられました。サイドバーからペインを選択してください。",bellNotification:"ターミナルベル通知",bellDescription:"ウィンドウ {{window}} · ペイン {{pane}}",bellFallback:"tmux ベルを受信",paneTitle:"ペイン {{index}}",activePane:"現在のペイン",activeWindow:"現在のウィンドウ",editorPlaceholder:"ここにコマンドを入力...",editorClear:"クリア",editorSendWithEnter:"Enter で送信",editorSendLineByLine:"1行ずつ送信",editorSend:"送信",sendShortcut:"{{key}} を送信",inputModeDirect:"直接入力",inputModeEditor:"エディタ",newWindow:"新規ウィンドウ",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",copy:"コピー",paste:"貼り付け",copied:"クリップボードにコピーしました",copyFailed:"コピーに失敗しました",pasteFailed:"クリップボードを読み取れません。ブラウザの権限を確認してください",clearSelection:"選択を解除"},settings:{title:"システム設定",siteSettings:"サイト設定",siteName:"サイト名",siteNamePlaceholder:"tmex",siteUrl:"サイト URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"ベル制限(秒)",notificationThrottle:"通知制限(秒)",enableBrowserBellToast:"ブラウザベル Toast を有効にする",enableBrowserNotificationToast:"ブラウザ通知 Toast を有効にする",enableTelegramBellPush:"Telegram ベルプッシュを有効にする",enableTelegramNotificationPush:"Telegram 通知プッシュを有効にする",sshReconnectRetries:"SSH 再接続試行回数",sshReconnectDelay:"SSH 再接続待機(秒)",language:"言語",languagePlaceholder:"言語を選択",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"テーマ",themeLight:"ライト",themeDark:"ダーク",siteTab:"サイト",notificationsTab:"通知",refreshToApply:"言語変更を適用するには更新してください",saveSettings:"設定を保存",settingsSaved:"設定を保存しました",saveFailed:"設定の保存に失敗しました",loadFailed:"設定の読み込みに失敗しました",restartGateway:"Gateway を再起動",restartScheduled:"Gateway の再起動が予定されました",restartConfirm:"Gateway を再起動してもよろしいですか?すべてのアクティブ接続が中断されます。",restartFailed:"Gateway の再起動に失敗しました",sshReconnectMaxRetries:"SSH 再接続試行回数",llm:{title:"LLM プロバイダー",name:"名前",namePlaceholder:"例: OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"デフォルトで /v1 を自動補完。/ で終わるとパスをそのまま使用",protocol:"プロトコル",apiKey:"API キー",apiKeyPlaceholder:"API キーを入力",apiKeySetPlaceholder:"設定済み、空欄の場合は変更されません",addProvider:"プロバイダーを追加",editProvider:"プロバイダーを編集",formHint:"プロバイダーの接続を設定",models:"モデル",modelsTitle:"{{name}} のモデル",modelsHint:"このプロバイダーで利用するモデルを管理(有効化と手動追加)",modelManual:"手動",addModelPlaceholder:"モデル ID を追加",empty:"プロバイダーはまだありません",refreshModels:"モデルを更新",modelsCount:"{{total}} 個のモデル",modelsNotFetched:"モデル一覧は未取得です",modelsFetchFailed:"モデル一覧の取得に失敗しました:{{error}}",deleteProvider:"プロバイダーを削除",deleteConfirm:"プロバイダー「{{name}}」を削除しますか?",defaults:"グローバル既定",defaultProvider:"既定プロバイダー",defaultProviderNone:"未設定",defaultModel:"既定モデル",defaultModelPlaceholder:"モデル ID を入力または選択",saveDefaults:"既定を保存",loadFailed:"LLM プロバイダーの読み込みに失敗しました",createFailed:"プロバイダーの作成に失敗しました",updateFailed:"プロバイダーの更新に失敗しました",deleteFailed:"プロバイダーの削除に失敗しました",refreshModelsFailed:"モデルの更新に失敗しました",settingsLoadFailed:"LLM 設定の読み込みに失敗しました",settingsSaveFailed:"LLM 設定の保存に失敗しました"},search:{title:"検索",provider:"検索プロバイダー",providerNone:"無効",tavilyApiKey:"Tavily API キー",braveApiKey:"Brave API キー",keyPlaceholder:"API キーを入力",keySetPlaceholder:"設定済み、空欄の場合は変更されません",clearKey:"クリア",clearKeyConfirm:"この API キーをクリアしますか?再度入力が必要になります。",loadFailed:"検索設定の読み込みに失敗しました",saveFailed:"検索設定の保存に失敗しました"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名",botNamePlaceholder:"例:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Bot を追加",enableBot:"Bot を有効にする",allowAuthRequests:"認証リクエストを許可",pendingChats:"承認待ち",chats:"承認済み",authorizedChats:"承認済み",noPendingChats:"承認待ちのチャットはありません",noAuthorizedChats:"承認済みのチャットはありません",approve:"承認",authorize:"認証",reject:"拒否",revokeAuth:"認証を取り消す",testMessage:"テストメッセージ",sendTestMessage:"テストメッセージを送信",deleteBot:"Bot を削除",tokenOptional:"Token(変更しない場合は空)",tokenPlaceholder:"新しい token を入力",botCreated:"Bot を作成しました",botUpdated:"Bot を更新しました",botDeleted:"Bot を削除しました",authApproved:"認証が承認されました",chatRemoved:"チャットを削除しました",testMessageSent:"テストメッセージを送信しました",createFailed:"Bot の作成に失敗しました",updateFailed:"Bot の更新に失敗しました",deleteFailed:"Bot の削除に失敗しました",approveFailed:"認証の承認に失敗しました",removeFailed:"チャットの削除に失敗しました",testMessageFailed:"テストメッセージの送信に失敗しました",loadBotsFailed:"Bot 一覧の読み込みに失敗しました",loadChatsFailed:"チャット一覧の読み込みに失敗しました",noBots:"Bot がありません。まず追加してください。",expand:"展開",collapse:"折りたたむ",authCount:"承認済み {{authorized}} / 承認待ち {{pending}}(最大 8)",chatId:"Chat ID",applyTime:"申請時間",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:デバイス「{{deviceName}}」({{host}}) で接続エラー [{{category}}]
81
- {{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent セッション「{{sessionTitle}}」のメッセージに認証情報が含まれている可能性があります({{types}})。LLM に送信され保存されるため、漏洩のリスクがあります。",authSuccess:"✅ 承認されました。通知を受信できます。",authPending:"⏳ 認証リクエストを受信しました。tmex 設定ページで承認してください。",authFailed:"❌ 認証リクエストに失敗しました。管理者に連絡してください。",testMessageTemplate:`🧪 テストメッセージ
82
- サイト:{{siteName}}
83
- 時間:{{time}}`,approveMessageTemplate:`✅ tmex で承認されました。
84
- Bot:{{botName}}
85
- 時間:{{time}}`,botNotFound:"Bot が見つからないか利用できません",botNotRunning:"Bot が起動していないか利用できません"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"シークレット",secretPlaceholder:"署名に使用(HMAC-SHA256)",enabled:"有効",eventMask:"イベント",add:"Webhook を追加",empty:"Webhook がありません。",createFailed:"Webhook の作成に失敗しました",deleteFailed:"Webhook の削除に失敗しました",loadFailed:"Webhook の読み込みに失敗しました"},sshError:{sshConfigRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",configRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",agentUnavailable:"SSH Agent が利用できません:SSH_AUTH_SOCK が検出されません。agent 環境を確認してください。",agentNoIdentity:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",agentNoIdentities:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",authFailed:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",authFailedGeneric:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",networkUnreachable:"ネットワークに到達できません:ルーティング、ファイアウォール、または VPN 設定を確認してください。",connectionRefused:"接続が拒否されました:ターゲットホストに接続できません。ホストアドレスとポートを確認してください。",timeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",connectionTimeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",hostNotFound:"ホストが見つかりません:ホスト名を解決できません。DNS またはホスト名設定を確認してください。",handshakeFailed:"ハンドシェイクに失敗しました:安全な接続を確立できません。キー交換アルゴリズムが互換性がない可能性があります。",tmuxUnavailable:"リモート tmux が利用できないか起動に失敗しました。tmux がインストールされ、リモート shell の PATH から参照できることを確認してください。",connectionClosed:"接続が切断されました。再接続を試みています",unknown:"接続に失敗しました:{{message}}",reconnecting:"接続が中断されました。{{delay}} 秒後に再接続します({{attempt}}/{{maxRetries}})",reconnectFailed:"自動再接続に失敗しました。手動で再試行してください",reconnected:"デバイスが自動的に再接続されました"},deviceStatus:{reconnecting:"再接続中 {{delay}}s",offline:"オフライン",errorBadge:{authFailed:"認証失敗",agentUnavailable:"Agent 利用不可",agentNoIdentity:"Agent に鍵なし",configRefNotSupported:"SSH Config 非対応",networkUnreachable:"ネットワーク不可達",connectionRefused:"接続拒否",timeout:"タイムアウト",hostNotFound:"ホスト未検出",handshakeFailed:"ハンドシェイク失敗",tmuxUnavailable:"tmux 利用不可",connectionClosed:"切断",unknown:"接続エラー"}},websocket:{error:"WebSocket 接続エラー",checkGateway:"Gateway 状態を確認してください",upgradeFailed:"アップグレードに失敗しました",invalidMessage:"無効なメッセージ形式"},wsError:{checkGateway:"Gateway 状態を確認してください"},apiError:{siteNameRequired:"サイト名は空にできません",siteUrlInvalid:"サイト URL は http:// または https:// で始まる必要があります",bellThrottleInvalid:"ベル制限秒数は 0-300 の間である必要があります",sshRetriesInvalid:"SSH 再接続試行回数は 0-20 の間である必要があります",sshDelayInvalid:"SSH 再接続待機時間は 1-300 秒の間である必要があります",languageInvalid:"言語はサポートされているロケールのいずれかである必要があります",botNameRequired:"Bot 名は空にできません",botTokenRequired:"Bot token は空にできません",missingFields:"必須フィールドがありません",sshRequiresHost:"SSH デバイスには host または sshConfigRef が必要です",invalidRequest:"無効なリクエスト",deviceNotFound:"デバイスが見つかりません",botNotFound:"Bot が見つかりません",chatNotFound:"チャットが見つかりません",urlAndSecretRequired:"URL とシークレットが必要です",notFound:"見つかりません",llmProviderNameRequired:"プロバイダー名は空にできません",llmProviderProtocolInvalid:"プロトコルは openai-chat または openai-responses である必要があります",llmProviderBaseUrlInvalid:"Base URL は http:// または https:// で始まる必要があります",llmProviderApiKeyRequired:"API key は空にできません",llmProviderNotFound:"LLM プロバイダーが見つかりません",llmProviderDisabled:"LLM プロバイダー {{name}} は無効化されています",llmNoDefaultProvider:"LLM プロバイダーが指定されておらず、デフォルトプロバイダーも設定されていません",llmNoDefaultModel:"モデルが指定されておらず、デフォルトモデルも設定されていません",llmDefaultProviderNotFound:"デフォルトプロバイダーが存在しません",llmSearchProviderInvalid:"検索プロバイダーは none、tavily、brave のいずれかである必要があります",llmFetchModelsFailed:"モデル一覧の取得に失敗しました:{{detail}}",agentSessionNotFound:"Agent セッションが存在しません",agentSessionBusy:"Agent セッションは実行中です。停止するか完了をお待ちください",agentSessionAwaitingConfirmation:"Agent セッションに未処理の確認リクエストがあります。先に処理してください",agentDeviceRequired:"デバイスを指定してください",agentPaneRequired:"ターミナル pane を指定してください",agentWriteModeInvalid:"書き込みモードは confirm または auto である必要があります",agentMaxStepsInvalid:"1 ターンあたりの最大ステップ数は 1〜100 の範囲で指定してください",agentProviderWebSearchRequiresResponses:"プロバイダ内蔵の Web 検索は openai-responses プロトコルのみ対応しています",agentHostedToolUnknown:"不明な hosted ツール: {{name}}",agentHostedToolRequiresResponses:"プロバイダの hosted ツールは openai-responses プロトコルのみ対応しています",agentSessionOrphaned:"この Agent セッションは孤立しており(端末が存在しません)、読み取り専用です",agentQueuedMessageNotFound:"キューのメッセージが存在しません",agentConfirmationNotFound:"確認リクエストが存在しません",agentConfirmationAlreadyDecided:"確認リクエストは既に処理済みです",agentMessageTextRequired:"メッセージ内容を入力してください",watchRuleNotFound:"Watch ルールが存在しません",watchNameRequired:"ルール名を入力してください",watchTriggerTypeInvalid:"トリガー種別は match、unchanged、llm のいずれかです",watchPatternRequired:"match/unchanged ルールには正規表現が必要です",watchPatternInvalid:"正規表現が無効です:{{detail}}",watchUnchangedMinutesInvalid:"unchanged ルールには 0 より大きい未変化分数が必要です",watchExtractGroupInvalid:"キャプチャグループ番号は 0 以上の整数で指定してください",watchConditionPromptRequired:"llm ルールには条件の説明が必要です",watchIntervalInvalid:"サンプリング間隔は {{min}} 秒以上で指定してください",watchNoMatchBehaviorInvalid:"非マッチ時の挙動は reset または ignore です",watchFireModeInvalid:"発火モードは once または repeat です",watchCooldownInvalid:"クールダウン秒数は 0 以上の整数で指定してください",watchAssistDescriptionRequired:"マッチさせたい内容を記述してください",watchAssistModelUnavailable:"モデル呼び出しに失敗しました:{{detail}}"},notification:{clickToJump:"対応するペインにジャンプ",eventType:{terminal_bell:"🔔 ターミナルベル",terminal_notification:"🔔 ターミナル通知",tmux_window_close:"🪟 ウィンドウ閉じる",tmux_pane_close:"📱 ペイン閉じる",device_tmux_missing:"⚠️ Tmux がありません",device_disconnect:"🔌 デバイス切断",session_created:"🆕 セッション作成",session_closed:"🚪 セッション閉じる",agent_confirmation_pending:"🤖 エージェント確認待ち",agent_turn_finished:"🤖 エージェントターン完了",agent_error:"🤖 エージェントエラー",watch_triggered:"👁️ Watch ルール発動",watch_model_unavailable:"👁️ Watch モデル利用不可",watch_rule_error:"👁️ Watch ルールエラー"},site:"サイト",device:"デバイス",window:"ウィンドウ",pane:"ペイン",time:"時間",directLink:"直接リンク",message:"メッセージ",paneTitle:"タイトル",process:"プロセス",telegramBell:{title:"🔔 {{siteName}} からのベル:{{terminalTopbarLabel}}",viewLink:"表示",terminalTopbarLabel:"ウィンドウ {{window}} · ペイン {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:"Agent「{{title}}」がツール {{toolName}} の実行確認を求めています",turnFinished:"Agent「{{title}}」のターンが完了しました",error:"Agent「{{title}}」でエラーが発生しました:{{message}}"},watch:{matchTriggered:"Watch「{{name}}」がマッチしました:{{text}}",unchangedTriggered:"Watch「{{name}}」の値「{{value}}」が {{minutes}} 分間変化していません",llmTriggered:"Watch「{{name}}」の条件を満たしました:{{reason}}",summaryTriggered:"Watch「{{name}}」:{{summary}}",unconfirmedSuffix:"(モデル利用不可のため LLM 未確認)",modelUnavailable:"Watch「{{name}}」のモデル呼び出しに失敗しました:{{message}}",ruleError:"Watch「{{name}}」が {{count}} 回連続で失敗したため自動停止しました:{{message}}",paneGone:"Watch「{{name}}」のペイン({{paneId}})が破棄されたため、ルールを削除しました"}},sidebar:{noWindows:"ウィンドウがありません",noDevices:"デバイスがありません",addDeviceLink:"デバイスを追加",openSettingsLink:"設定を開く",openSettings:"設定を開く",manageDevices:"デバイス管理",settings:"設定",currentWindow:"現在のウィンドウ",currentPane:"現在のペイン",newWindow:"ウィンドウを作成",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",addDevice:"デバイスを追加",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"孤立セッション"},agent:{error:{streamStalled:"モデルが応答を停止しました(上流ストリームが停止)。再試行してください。"},model:{select:"モデルを選択",placeholder:"モデル",noProviders:"モデルがありません — 設定でプロバイダーを構成してください"},queue:{title:"キュー({{count}})",steer:"今すぐ注入",steerHint:"現在のステップを中断してキューを今すぐ注入",withdraw:"取り消し"},orphan:{readonly:"このセッションは孤立しており(端末が存在しません)、読み取り専用です",title:"孤立セッション",process:"プロセス",startedAt:"作成日時"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"セッションを選択または作成してください",inputPlaceholder:"メッセージを入力…",send:"送信",stop:"停止",retry:"再試行",scrollToBottom:"最下部へ"},session:{none:"セッション未選択",new:"新規エージェントセッション",switch:"セッションを切り替え",selectPaneHint:"Panes タブでペインを選択してセッションを開始してください",noSessions:"セッションがありません",showAll:"すべてのセッションを表示",rename:"セッション名を変更",renameTitle:"セッション名を変更",renamePlaceholder:"セッション名",save:"保存",cancel:"キャンセル",delete:"セッションを削除",deleteTitle:"このセッションを削除しますか?",deleteDesc:"「{{title}}」とそのメッセージはすべて完全に削除されます。",deleteConfirm:"削除",createDisabledNoPane:"ターミナル pane を開いてからセッションを作成してください",privacyNotice:"セッションはターミナル画面の内容を設定済みの LLM サービスへ送信します。"},binding:{invalid:"無効",mismatchTitle:"このセッションは別の pane にバインドされています",goTo:"移動",rebind:"現在の pane に再バインド"},writeMode:{confirm:"書き込み確認",auto:"自動実行"},confirm:{title:"承認待ち",approve:"許可",deny:"拒否"},tool:{input:"入力",result:"結果",screen:"画面キャプチャ",send_input:"入力送信",read_screen:"画面読み取り",web_search:"Web 検索",fetch_url:"URL 取得",denied:"拒否されました"},reasoning:{title:"思考プロセス"},toast:{errorTitle:"Agent「{{title}}」でエラー",credentialWarningTitle:"メッセージに認証情報が含まれる可能性",credentialWarningDescription:"{{types}} を検出しました。内容は変更されませんが、LLM に送信され保存されるため、漏洩のリスクがあります。"}},window:{noWindows:"ウィンドウがありません",new:"新規ウィンドウ",close:"ウィンドウを閉じる",closePane:"ペインを閉じる",closeConfirmTitle:"このウィンドウを閉じますか?",closePaneConfirmTitle:"このペインを閉じますか?",closeConfirmDesc:'"{{name}}" で実行中のプロセスは終了されます。この操作は取り消せません。',menu:"ウィンドウ操作",dragHandle:"ドラッグしてウィンドウを並べ替え",dragHandlePane:"ドラッグしてペインを並べ替え",rename:"ウィンドウ名を変更",renamePlaceholder:"名前を入力",renameDesc:"カスタム名はターミナルが設定したタイトルを上書きし、ゲートウェイが再起動するまで保持されます。",renameReset:"自動名に戻す"},watch:{title:"監視ルール",dialogDesc:"このペインの画面を監視し、条件を満たしたら通知します",openMonitor:"このターミナルを監視",rules:{empty:"このペインにはまだ監視ルールがありません",addRule:"新規ルール",edit:"編集",delete:"削除",viewState:"状態",lastTriggered:"最終トリガー:{{time}}",neverTriggered:"未トリガー",deleteTitle:"このルールを削除しますか?",deleteDesc:"「{{name}}」は完全に削除されます。",deleteConfirm:"削除"},type:{match:"マッチ",unchanged:"停滞",llm:"LLM"},typeDesc:{match:"正規表現が画面にマッチしたらトリガー",unchanged:"抽出した値が N 分間変化しない場合にトリガー(例:ダウンロード停滞)",llm:"LLM が定期的に画面を確認し自然言語の条件を判定"},form:{createTitle:"監視ルールを作成",editTitle:"監視ルールを編集",name:"ルール名",namePlaceholder:"例:ダウンロード停滞アラート",triggerType:"トリガー種別",pattern:"正規表現",patternPlaceholder:"例:(\\d+)%",flags:"フラグ",flagsPlaceholder:"例:i",extractGroup:"キャプチャグループ番号",extractGroupHint:"0 = マッチ全体。このグループの値を追跡します",unchangedMinutes:"変化なし継続(分)",noMatchBehavior:"マッチしない場合",noMatchReset:"タイマーをリセット(進捗行の消失 = タスク完了)",noMatchIgnore:"無視(前回値を保持)",conditionPrompt:"条件(自然言語)",conditionPromptPlaceholder:"例:コンパイルエラーでビルドが失敗した",model:"モデル",followGlobalDefault:"グローバル既定に従う",modelPlaceholder:"モデル ID",modelRequiredHint:"このルールは LLM を呼び出します。選択した(またはグローバル既定の)モデルが利用可能か確認してください。",confirmWithLlm:"通知前に LLM で再確認",confirmWithLlmDesc:"誤検知を低減。モデル利用不可時はそのまま通知",summarizeWithLlm:"LLM による通知要約",summarizeWithLlmDesc:"画面内容をモデルが要約して通知本文にします",intervalSeconds:"サンプリング間隔(秒)",intervalHint:"最小 {{min}} 秒",fireMode:"発火モード",fireOnce:"一回(発火後に自動停止)",fireRepeat:"繰り返し",cooldownSeconds:"クールダウン(秒)",enabled:"有効",assistLabel:"説明から正規表現を生成",assistPlaceholder:"例:ダウンロード進捗のパーセンテージにマッチ",assistButton:"生成",assistExplanation:"説明",assistPreview:"現在の画面でのマッチ",assistPreviewEmpty:"現在の画面サンプルにマッチなし",create:"作成",save:"保存",providerUnavailable:"元のプロバイダーは利用できません",providerDisabled:"無効"},validation:{nameRequired:"ルール名は必須です",patternRequired:"正規表現は必須です",patternInvalid:"正規表現が無効です:{{detail}}",unchangedMinutesInvalid:"変化なし継続分は 0 より大きい必要があります",conditionPromptRequired:"条件の説明は必須です",intervalMin:"サンプリング間隔は {{min}} 秒以上にしてください"},state:{title:"ルール状態",back:"戻る",lastSampledAt:"最終サンプリング",lastValue:"最新値",lastValueChangedAt:"値の最終変化",lastTriggeredAt:"最終トリガー",consecutiveErrors:"連続エラー回数",lastError:"最新エラー",samples:"直近サンプル",samplesEmpty:"サンプルなし",hit:"ヒット",none:"—"},toast:{created:"監視ルールを作成しました",updated:"監視ルールを更新しました",deleted:"監視ルールを削除しました",triggeredTitle:"監視トリガー",openTerminal:"ターミナルを開く",modelUnavailableTitle:"監視モデル利用不可",modelUnavailableHint:"ルールは縮退動作で継続します。",ruleErrorTitle:"監視ルールを自動停止しました"},notifPermission:{title:"ブラウザ通知を有効にしますか?",desc:"タブがバックグラウンドでも監視トリガー時に通知を受け取れます。",enable:"有効にする",dismiss:"今はしない"}},validation:{deviceNameRequired:"デバイス名は必須です",hostRequired:"SSH デバイスにはホストアドレスが必要です"}}}},Bx="en_US",yee={locales:[{code:"en_US",name:"English",nativeName:"English",flag:"🇺🇸",isDefault:!0},{code:"zh_CN",name:"简体中文",nativeName:"简体中文",flag:"🇨🇳",isDefault:!1},{code:"ja_JP",name:"日本語",nativeName:"日本語",flag:"🇯🇵",isDefault:!1}]};function JM(e){return e.replace("_","-")}var Qy={},vs={},xs={},yT;function m3(){if(yT)return xs;yT=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.BinaryReader=xs.BinaryWriter=void 0;class e{constructor(r=1024){st(this,"buffer");st(this,"view");st(this,"offset",0);this.buffer=new Uint8Array(r),this.view=new DataView(this.buffer.buffer)}ensureCapacity(r){const a=this.offset+r;if(a<=this.buffer.length)return;let o=this.buffer.length;for(;o<a;)o*=2;const l=new Uint8Array(o);l.set(this.buffer),this.buffer=l,this.view=new DataView(this.buffer.buffer)}writeUint8(r){this.ensureCapacity(1),this.view.setUint8(this.offset,r),this.offset+=1}writeUint16(r){this.ensureCapacity(2),this.view.setUint16(this.offset,r,!0),this.offset+=2}writeUint32(r){this.ensureCapacity(4),this.view.setUint32(this.offset,r,!0),this.offset+=4}writeUint64(r){this.ensureCapacity(8),this.view.setBigUint64(this.offset,r,!0),this.offset+=8}writeUint128(r){this.ensureCapacity(16);const a=r&BigInt("0xFFFFFFFFFFFFFFFF"),o=r>>BigInt(64);this.writeUint64(a),this.writeUint64(o)}writeInt8(r){this.ensureCapacity(1),this.view.setInt8(this.offset,r),this.offset+=1}writeInt16(r){this.ensureCapacity(2),this.view.setInt16(this.offset,r,!0),this.offset+=2}writeInt32(r){this.ensureCapacity(4),this.view.setInt32(this.offset,r,!0),this.offset+=4}writeInt64(r){this.ensureCapacity(8),this.view.setBigInt64(this.offset,r,!0),this.offset+=8}writeInt128(r){this.ensureCapacity(16);const a=r&BigInt("0xFFFFFFFFFFFFFFFF"),o=r>>BigInt(64);this.writeInt64(a),this.writeInt64(o)}writeFloat32(r){this.ensureCapacity(4),this.view.setFloat32(this.offset,r,!0),this.offset+=4}writeFloat64(r){this.ensureCapacity(8),this.view.setFloat64(this.offset,r,!0),this.offset+=8}writeBool(r){this.writeUint8(r?1:0)}writeString(r){const a=new TextEncoder().encode(r);this.writeUint32(a.length),this.ensureCapacity(a.length),this.buffer.set(a,this.offset),this.offset+=a.length}getBuffer(){return this.buffer.slice(0,this.offset)}}xs.BinaryWriter=e;class t{constructor(r){st(this,"buffer");st(this,"view");st(this,"offset",0);this.buffer=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength)}readUint8(){const r=this.view.getUint8(this.offset);return this.offset+=1,r}readUint16(){const r=this.view.getUint16(this.offset,!0);return this.offset+=2,r}readUint32(){const r=this.view.getUint32(this.offset,!0);return this.offset+=4,r}readUint64(){const r=this.view.getBigUint64(this.offset,!0);return this.offset+=8,r}readUint128(){const r=this.readUint64();return this.readUint64()<<BigInt(64)|r}readInt8(){const r=this.view.getInt8(this.offset);return this.offset+=1,r}readInt16(){const r=this.view.getInt16(this.offset,!0);return this.offset+=2,r}readInt32(){const r=this.view.getInt32(this.offset,!0);return this.offset+=4,r}readInt64(){const r=this.view.getBigInt64(this.offset,!0);return this.offset+=8,r}readInt128(){const r=this.readUint64();return this.readInt64()<<BigInt(64)|r}readFloat32(){const r=this.view.getFloat32(this.offset,!0);return this.offset+=4,r}readFloat64(){const r=this.view.getFloat64(this.offset,!0);return this.offset+=8,r}readBool(){return!!this.readUint8()}readString(){const r=this.readUint32(),a=this.buffer.slice(this.offset,this.offset+r);return this.offset+=r,new TextDecoder().decode(a)}getOffset(){return this.offset}}return xs.BinaryReader=t,xs}var Zy={},bT;function g3(){return bT||(bT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registry=e.TypeRegistry=void 0;class t{constructor(){st(this,"handlers",new Map)}register(r,a){this.handlers.set(r,a)}getHandler(r){const a=this.handlers.get(r);if(!a)throw new Error(`No handler registered for type: ${r}`);return a}}e.TypeRegistry=t,e.registry=new t,e.registry.register("u8",{write:(n,r)=>{if(r<0||r>255||!Number.isInteger(r))throw new Error("Value out of range for u8");n.writeUint8(r)},read:n=>n.readUint8()}),e.registry.register("u16",{write:(n,r)=>{if(r<0||r>65535||!Number.isInteger(r))throw new Error("Value out of range for u16");n.writeUint16(r)},read:n=>n.readUint16()}),e.registry.register("u32",{write:(n,r)=>{if(r<0||r>4294967295||!Number.isInteger(r))throw new Error("Value out of range for u32");n.writeUint32(r)},read:n=>n.readUint32()}),e.registry.register("u64",{write:(n,r)=>{if(r<0n||r>18446744073709551615n)throw new Error("Value out of range for u64");n.writeUint64(r)},read:n=>n.readUint64()}),e.registry.register("u128",{write:(n,r)=>{if(r<0n||r>340282366920938463463374607431768211455n)throw new Error("Value out of range for u128");n.writeUint128(r)},read:n=>n.readUint128()}),e.registry.register("i8",{write:(n,r)=>{if(r<-128||r>127||!Number.isInteger(r))throw new Error("Value out of range for i8");n.writeInt8(r)},read:n=>n.readInt8()}),e.registry.register("i16",{write:(n,r)=>{if(r<-32768||r>32767||!Number.isInteger(r))throw new Error("Value out of range for i16");n.writeInt16(r)},read:n=>n.readInt16()}),e.registry.register("i32",{write:(n,r)=>{if(r<-2147483648||r>2147483647||!Number.isInteger(r))throw new Error("Value out of range for i32");n.writeInt32(r)},read:n=>n.readInt32()}),e.registry.register("i64",{write:(n,r)=>{if(r<-9223372036854775808n||r>9223372036854775807n)throw new Error("Value out of range for i64");n.writeInt64(r)},read:n=>n.readInt64()}),e.registry.register("i128",{write:(n,r)=>{if(r<-170141183460469231731687303715884105728n||r>170141183460469231731687303715884105727n)throw new Error("Value out of range for i128");n.writeInt128(r)},read:n=>n.readInt128()}),e.registry.register("f32",{write:(n,r)=>n.writeFloat32(r),read:n=>n.readFloat32()}),e.registry.register("f64",{write:(n,r)=>{if(Number.isNaN(r))throw new Error("For portability reasons we do not allow serializing NaN values.");n.writeFloat64(r)},read:n=>n.readFloat64()}),e.registry.register("bool",{write:(n,r)=>n.writeBool(r),read:n=>n.readBool()}),e.registry.register("string",{write:(n,r)=>n.writeString(r),read:n=>n.readString()}),e.registry.register("unit",{write:()=>{},read:()=>({})}),e.registry.register("struct",{write:(n,r,a)=>{if(a)for(const[o,l]of Object.entries(a))e.registry.getHandler(l.type).write(n,r[o],l.options)},read:(n,r)=>{if(!r)return{};const a={};for(const[o,l]of Object.entries(r)){const c=e.registry.getHandler(l.type);a[o]=c.read(n,l.options)}return a}}),e.registry.register("vec",{write:(n,r,a)=>{if(!a)return;const{elementType:o,elementOptions:l}=a,c=(ArrayBuffer.isView(r),r.length);n.writeUint32(c);const f=e.registry.getHandler(o);if(ArrayBuffer.isView(r))for(let d=0;d<c;d++)f.write(n,r[d],l);else for(const d of r)f.write(n,d,l)},read:(n,r)=>{if(!r)return[];const{elementType:a,elementOptions:o}=r,l=n.readUint32(),c=e.registry.getHandler(a),f=Array.from({length:l},()=>c.read(n,o));switch(a){case"u8":return new Uint8Array(f);case"u16":return new Uint16Array(f);case"u32":return new Uint32Array(f);case"i8":return new Int8Array(f);case"i16":return new Int16Array(f);case"i32":return new Int32Array(f);case"i64":return new BigInt64Array(f);case"f32":return new Float32Array(f);case"f64":return new Float64Array(f);default:return f}}}),e.registry.register("set",{write:(n,r,a)=>{if(!a)return;const{elementType:o,elementOptions:l}=a,c=Array.from(r).sort();n.writeUint32(c.length);const f=e.registry.getHandler(o);for(const d of c)f.write(n,d,l)},read:(n,r)=>{if(!r)return new Set;const{elementType:a,elementOptions:o}=r,l=n.readUint32(),c=e.registry.getHandler(a),f=Array.from({length:l},()=>c.read(n,o));return new Set(f)}}),e.registry.register("map",{write:(n,r,a)=>{if(!a)return;const{keyType:o,keyOptions:l,valueType:c,valueOptions:f}=a,d=Array.from(r.entries()).sort();n.writeUint32(d.length);const m=e.registry.getHandler(o),h=e.registry.getHandler(c);for(const[y,g]of d)m.write(n,y,l),h.write(n,g,f)},read:(n,r)=>{if(!r)return new Map;const{keyType:a,keyOptions:o,valueType:l,valueOptions:c}=r,f=n.readUint32(),d=e.registry.getHandler(a),m=e.registry.getHandler(l),h=Array.from({length:f},()=>{const y=d.read(n,o),g=m.read(n,c);return[y,g]});return new Map(h)}}),e.registry.register("option",{write:(n,r,a)=>{if(!a)return;const{valueType:o,valueOptions:l}=a,c=r!==null;n.writeUint8(c?1:0),c&&e.registry.getHandler(o).write(n,r,l)},read:(n,r)=>{if(!r)return null;const{valueType:a,valueOptions:o}=r;return n.readUint8()===1?e.registry.getHandler(a).read(n,o):null}}),e.registry.register("enum",{write:(n,r,a)=>{if(!a)return;const o=Object.keys(r)[0],l=r[o],c=a.variants.find(f=>f.name===o);if(!c)throw new Error(`Unknown enum variant: ${o}`);n.writeUint8(c.index),c.type!=="unit"&&e.registry.getHandler(c.type).write(n,l,c.options)},read:(n,r)=>{if(!r)return{};const a=n.readUint8(),o=r.variants.find(f=>f.index===a);if(!o)throw new Error(`Unknown enum variant index: ${a}`);if(o.type==="unit")return{[o.name]:{}};const c=e.registry.getHandler(o.type).read(n,o.options);return{[o.name]:c}}}),e.registry.register("tuple",{write:(n,r,a)=>{if(a){if(r.length!==a.length)throw new Error(`Tuple length mismatch: expected ${a.length}, got ${r.length}`);for(let o=0;o<a.length;o++){const l=a[o];if(!l)throw new Error(`Missing type information for tuple element at index ${o}`);e.registry.getHandler(l.type).write(n,r[o],l.options)}}},read:(n,r)=>{if(!r)return[];const a=[];for(const o of r){const l=e.registry.getHandler(o.type);a.push(l.read(n,o.options))}return a}}),e.registry.register("array",{write:(n,r,a)=>{if(!a)return;const{elementType:o,elementOptions:l,length:c}=a;if(r.length!==c)throw new Error(`Array length mismatch: expected ${c}, got ${r.length}`);const f=e.registry.getHandler(o);for(const d of r)f.write(n,d,l)},read:(n,r)=>{if(!r)return[];const{elementType:a,elementOptions:o,length:l}=r,c=e.registry.getHandler(a);return Array.from({length:l},()=>c.read(n,o))}}),e.registry.register("bytes",{write:(n,r,a)=>{const o=r.length;if((a==null?void 0:a.length)!=null){if(o!==a.length)throw new Error(`Bytes length mismatch: expected ${a.length}, got ${o}`);for(let l=0;l<o;l++)n.writeUint8(r[l])}else{n.writeUint32(o);for(let l=0;l<o;l++)n.writeUint8(r[l])}},read:(n,r)=>{const a=(r==null?void 0:r.length)!=null?r.length:n.readUint32(),o=new Uint8Array(a);for(let l=0;l<a;l++)o[l]=n.readUint8();return o}}),e.registry.register("nativeEnum",{write:(n,r,a)=>{if(!a)return;const{valueToIndexMap:o}=a,l=r,c=o.get(l);if(c===void 0)throw new Error(`Invalid enum value: ${String(r)}`);n.writeUint8(c)},read:(n,r)=>{if(!r)return null;const{indexToValueMap:a}=r,o=n.readUint8(),l=a.get(o);if(l===void 0)throw new Error(`Invalid enum index: ${o}`);return l}})})(Zy)),Zy}var vT;function y3(){if(vT)return vs;vT=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.b=vs.Schema=void 0;const e=m3(),t=g3();class n{constructor(a,o,l){st(this,"type");st(this,"options");st(this,"registry");this.type=a,this.options=o,this.registry=l}serialize(a){const o=new e.BinaryWriter;return this.registry.getHandler(this.type).write(o,a,this.options),o.getBuffer()}deserialize(a){const o=new e.BinaryReader(a);return this.registry.getHandler(this.type).read(o,this.options)}}return vs.Schema=n,vs.b={u8:()=>new n("u8",null,t.registry),u16:()=>new n("u16",null,t.registry),u32:()=>new n("u32",null,t.registry),u64:()=>new n("u64",null,t.registry),u128:()=>new n("u128",null,t.registry),i8:()=>new n("i8",null,t.registry),i16:()=>new n("i16",null,t.registry),i32:()=>new n("i32",null,t.registry),i64:()=>new n("i64",null,t.registry),i128:()=>new n("i128",null,t.registry),f32:()=>new n("f32",null,t.registry),f64:()=>new n("f64",null,t.registry),bool:()=>new n("bool",null,t.registry),string:()=>new n("string",null,t.registry),unit:()=>new n("unit",null,t.registry),vec:r=>new n("vec",{elementType:r.type,elementOptions:r.options},t.registry),hashSet:r=>new n("set",{elementType:r.type,elementOptions:r.options},t.registry),hashMap:(r,a)=>new n("map",{keyType:r.type,keyOptions:r.options,valueType:a.type,valueOptions:a.options},t.registry),option:r=>new n("option",{valueType:r.type,valueOptions:r.options},t.registry),array:(r,a)=>new n("array",{elementType:r.type,elementOptions:r.options,length:a},t.registry),bytes:r=>new n("bytes",r!=null?{length:r}:{},t.registry),enum:r=>{const a=Object.entries(r).map(([o,l],c)=>({index:c,name:o,type:l.type,options:l.options}));return new n("enum",{variants:a},t.registry)},struct:r=>{const a=Object.fromEntries(Object.entries(r).map(([o,l])=>[o,{type:l.type,options:l.options}]));return new n("struct",a,t.registry)},tuple:(...r)=>{const a=r.map(o=>({type:o.type,options:o.options}));return new n("tuple",a,t.registry)},nativeEnum:r=>{const a=Object.entries(r).filter(([m])=>typeof m=="string"&&Number.isNaN(Number(m))),o=a.map(([m,h])=>h),l=o.some(m=>typeof m=="string"),c=o.some(m=>typeof m=="number");if(l&&c)throw new Error("Mixed string/numeric enums are not supported");const f=new Map,d=new Map;if(a.forEach(([m,h],y)=>{f.set(h,y),d.set(y,h)}),a.length>255)throw new Error("Borsh only supports enums with up to 255 variants");return new n("nativeEnum",{enumObj:r,valueToIndexMap:f,indexToValueMap:d},t.registry)}},vs}var xT;function b3(){return xT||(xT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=e.b=void 0;var t=y3();Object.defineProperty(e,"b",{enumerable:!0,get:function(){return t.b}}),Object.defineProperty(e,"Schema",{enumerable:!0,get:function(){return t.Schema}})})(Qy)),Qy}var se=b3();const v3=1,x3=2,w3=3,S3=4,E3=5,C3=257,T3=258,R3=259,k3=260,M3=261,O3=513,A3=514,N3=515,D3=516,I3=517,P3=518,L3=519,j3=520,_3=522,z3=523,F3=524,B3=769,H3=770,U3=771,V3=772,q3=773,$3=774,Y3=1025,W3=1026,K3=1281,G3=1537,X3=1538,Q3=1539,Z3=1793,J3=1,e4=2,t4=3,n4=4,r4=5,i4=6,a4=7,o4=8,s4=9,l4=10,c4=11,u4=12,d4=13,f4=1,h4=2,p4=3,m4=1001,Qi=1002,g4=1003,eO=1004,Kh=1005,y4=1101,b4=1102,v4=1201,x4=1202,w4=1301,S4=1302,E4=1401,C4={[m4]:"Unsupported protocol version",[Qi]:"Invalid frame format",[g4]:"Unknown message kind",[eO]:"Failed to decode payload",[Kh]:"Frame exceeds maximum size",[y4]:"Device not found",[b4]:"Failed to connect device",[v4]:"Tmux target not found",[x4]:"Tmux not ready",[w4]:"Select conflict",[S4]:"Select token mismatch",[E4]:"Internal server error"};function T4(e){return C4[e]??`Unknown error code: ${e}`}class ei extends Error{constructor(t,n=!1,r){super(r??T4(t)),this.code=t,this.retryable=n,this.name="WsBorshError"}}const tO=se.b.struct({magic:se.b.bytes(2),version:se.b.u16(),kind:se.b.u16(),flags:se.b.u16(),seq:se.b.u32(),payload:se.b.bytes()}),R4=se.b.option(se.b.u32()),pc=se.b.option(se.b.u16()),Mr=se.b.option(se.b.string()),k4=se.b.struct({clientImpl:se.b.string(),clientVersion:se.b.string(),maxFrameBytes:se.b.u32(),supportsCompression:se.b.bool(),supportsDiffSnapshot:se.b.bool()}),M4=se.b.struct({serverImpl:se.b.string(),serverVersion:se.b.string(),selectedVersion:se.b.u16(),maxFrameBytes:se.b.u32(),heartbeatIntervalMs:se.b.u32(),capabilities:se.b.vec(se.b.string())}),O4=se.b.struct({nonce:se.b.u32(),timeMs:se.b.u64()});se.b.struct({refSeq:R4,code:se.b.u16(),message:se.b.string(),retryable:se.b.bool()});const A4=se.b.struct({deviceId:se.b.string()}),N4=se.b.struct({deviceId:se.b.string()}),D4=se.b.struct({deviceId:se.b.string()}),I4=se.b.struct({deviceId:se.b.string()}),P4=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),errorType:Mr,message:Mr,rawMessage:Mr}),L4=se.b.struct({deviceId:se.b.string(),windowId:Mr,paneId:Mr,selectToken:se.b.bytes(16),wantHistory:se.b.bool(),cols:pc,rows:pc}),j4=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),_4=se.b.struct({deviceId:se.b.string(),name:Mr}),z4=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),F4=se.b.struct({deviceId:se.b.string(),paneId:se.b.string()}),B4=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),name:se.b.string()}),H4=se.b.struct({deviceId:se.b.string(),style:se.b.string()}),U4=se.b.struct({deviceId:se.b.string(),windowIds:se.b.vec(se.b.string())}),V4=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneIds:se.b.vec(se.b.string())}),q4=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),eventData:se.b.bytes()}),$4=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),Y4=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),nO=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),cols:se.b.u16(),rows:se.b.u16()}),W4=nO,K4=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes()}),G4=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16),encoding:se.b.u8(),alternateScreen:se.b.bool(),data:se.b.bytes()}),X4=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),Q4=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),rO=se.b.struct({chunkStreamId:se.b.u32(),originalKind:se.b.u16(),originalSeq:se.b.u32(),totalChunks:se.b.u16(),chunkIndex:se.b.u16(),data:se.b.bytes()}),Z4=se.b.struct({id:se.b.string(),windowId:se.b.string(),index:se.b.u16(),title:Mr,active:se.b.bool(),width:se.b.u16(),height:se.b.u16()}),J4=se.b.struct({id:se.b.string(),name:se.b.string(),customName:Mr,index:se.b.u16(),active:se.b.bool(),panes:se.b.vec(Z4)}),e5=se.b.struct({id:se.b.string(),name:se.b.string(),windows:se.b.vec(J4)}),t5=se.b.struct({deviceId:se.b.string(),session:se.b.option(e5)});se.b.struct({deviceId:se.b.string(),baseRevision:se.b.u32(),revision:se.b.u32(),diffFormat:se.b.u8(),diffBytes:se.b.bytes()});const n5=se.b.struct({sessionId:se.b.string()}),r5=se.b.struct({sessionId:se.b.string()}),i5=se.b.struct({sessionId:se.b.string(),seq:se.b.u32(),eventType:se.b.u8(),payload:se.b.bytes()}),a5=se.b.struct({ruleId:se.b.string(),deviceId:se.b.string(),paneId:se.b.string(),eventType:se.b.u8(),payload:se.b.bytes()}),o5=se.b.struct({windowId:se.b.string()}),s5=se.b.struct({windowId:se.b.string()}),l5=se.b.struct({windowId:se.b.string(),name:se.b.string()}),c5=se.b.struct({windowId:se.b.string()}),u5=se.b.struct({paneId:se.b.string(),windowId:se.b.string()}),d5=se.b.struct({paneId:se.b.string()}),f5=se.b.struct({windowId:se.b.string(),paneId:se.b.string()}),h5=se.b.struct({windowId:se.b.string(),layout:se.b.string()}),p5=se.b.struct({windowId:Mr,paneId:Mr,windowIndex:pc,paneIndex:pc,paneUrl:Mr}),m5=se.b.struct({source:se.b.u8(),title:Mr,body:se.b.string(),windowId:Mr,paneId:Mr,windowIndex:pc,paneIndex:pc,paneUrl:Mr}),bd=new Uint8Array([84,88]),g5=1;function Gh(e,t,n,r=0,a=g5){const o={magic:bd,version:a,kind:e,flags:r,seq:n,payload:t};return tO.serialize(o)}function tr(e,t){return e.serialize(t)}function y5(e){if(e.length<12)throw new ei(Qi,!1,"Envelope too small");if(e[0]!==bd[0]||e[1]!==bd[1])throw new ei(Qi,!1,"Invalid magic bytes");try{return tO.deserialize(e)}catch(t){throw new ei(Qi,!1,t instanceof Error?t.message:"Failed to decode envelope")}}function La(e,t){try{return e.deserialize(t)}catch(n){throw new ei(eO,!1,n instanceof Error?n.message:"Failed to decode payload")}}function b5(e,t){const n=rO.serialize(e);return Gh(1281,n,t)}function v5(e){return rO.deserialize(e)}function x5(e){return e.length>=2&&e[0]===bd[0]&&e[1]===bd[1]}const w5=5e3,wT=100,yv=1e3;class S5{constructor(){st(this,"streams",new Map);st(this,"lastCleanup",Date.now())}addChunk(t){if(this.cleanup(),t.totalChunks>yv)throw new ei(Qi,!1,`Too many chunks: ${t.totalChunks} > ${yv}`);if(t.chunkIndex>=t.totalChunks)throw new ei(Qi,!1,`Chunk index out of bounds: ${t.chunkIndex} >= ${t.totalChunks}`);let n=this.streams.get(t.chunkStreamId);if(!n){if(this.streams.size>=wT&&(this.cleanup(!0),this.streams.size>=wT))throw new ei(Qi,!1,"Too many concurrent chunk streams");n={chunks:new Map,totalChunks:t.totalChunks,createdAt:Date.now(),originalKind:t.originalKind,originalSeq:t.originalSeq},this.streams.set(t.chunkStreamId,n)}if(n.totalChunks!==t.totalChunks)throw this.streams.delete(t.chunkStreamId),new ei(Qi,!1,"Chunk total count mismatch");if(n.chunks.has(t.chunkIndex))throw new ei(Qi,!1,`Duplicate chunk index: ${t.chunkIndex}`);return n.chunks.set(t.chunkIndex,t),n.chunks.size===n.totalChunks?this.reassemble(t.chunkStreamId,n):null}reassemble(t,n){const r=[];let a=0;for(let c=0;c<n.totalChunks;c++){const f=n.chunks.get(c);if(!f)throw this.streams.delete(t),new ei(Qi,!1,`Missing chunk index: ${c}`);r.push(f.data),a+=f.data.length}const o=new Uint8Array(a);let l=0;for(const c of r)o.set(c,l),l+=c.length;return this.streams.delete(t),{kind:n.originalKind,seq:n.originalSeq,payload:o}}cleanup(t=!1){const n=Date.now();if(!t&&n-this.lastCleanup<5e3)return;this.lastCleanup=n;const r=n-w5;for(const[a,o]of this.streams)o.createdAt<r&&this.streams.delete(a)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function E5(e,t,n,r){const{maxFrameBytes:a,chunkStreamId:o}=r,l=16,c=18,f=a-l;if(f<=0)throw new ei(Kh,!1,`maxFrameBytes too small: ${a}`);if(e.length<=f)return{chunks:[],totalChunks:0};const d=a-l-c;if(d<=0)throw new ei(Kh,!1,`maxFrameBytes too small for chunking: ${a}`);const m=Math.ceil(e.length/d);if(m>yv)throw new ei(Kh,!1,`Too many chunks: ${m}`);const h=[];for(let y=0;y<m;y++){const g=y*d,w=Math.min(g+d,e.length);h.push({chunkStreamId:o,originalKind:t,originalSeq:n,totalChunks:m,chunkIndex:y,data:e.slice(g,w)})}return{chunks:h,totalChunks:m}}let Jy=1;function C5(){const e=Jy;return Jy=Jy%4294967295+1,e}const T5={1:"osc9",2:"osc777",3:"osc1337",4:"osc99"};function R5(e){const t=P4.deserialize(e),n={1:"tmux-missing",2:"disconnected",3:"error",4:"reconnected"};return{deviceId:t.deviceId,type:n[t.eventType]??"error",errorType:t.errorType??void 0,message:t.message??void 0,rawMessage:t.rawMessage??void 0}}function k5(e){const t=q4.deserialize(e),r={1:"window-add",2:"window-close",3:"window-renamed",4:"window-active",5:"pane-add",6:"pane-close",7:"pane-active",8:"layout-change",9:"bell",10:"output",11:"notification"}[t.eventType];if(!r)throw new Error(`Unknown tmux event type: ${t.eventType}`);return{deviceId:t.deviceId,type:r,data:M5(r,t.eventData)}}function M5(e,t){if(t.length===0)return{};try{switch(e){case"window-add":return o5.deserialize(t);case"window-close":return s5.deserialize(t);case"window-renamed":return l5.deserialize(t);case"window-active":return c5.deserialize(t);case"pane-add":return u5.deserialize(t);case"pane-close":return d5.deserialize(t);case"pane-active":return f5.deserialize(t);case"layout-change":return h5.deserialize(t);case"bell":{const n=p5.deserialize(t);return{windowId:n.windowId??void 0,paneId:n.paneId??void 0,windowIndex:n.windowIndex??void 0,paneIndex:n.paneIndex??void 0,paneUrl:n.paneUrl??void 0}}case"notification":{const n=m5.deserialize(t);return{source:T5[n.source]??"osc9",title:n.title??void 0,body:n.body,windowId:n.windowId??void 0,paneId:n.paneId??void 0,windowIndex:n.windowIndex??void 0,paneIndex:n.paneIndex??void 0,paneUrl:n.paneUrl??void 0}}default:return{}}}catch{return{}}}function O5(e){const t=t5.deserialize(e);return{deviceId:t.deviceId,session:t.session?A5(t.session):null}}function A5(e){return{id:e.id,name:e.name,windows:e.windows.map(N5)}}function N5(e){return{id:e.id,name:e.name,customName:e.customName??void 0,index:e.index,active:e.active,panes:e.panes.map(D5)}}function D5(e){return{id:e.id,windowId:e.windowId,index:e.index,title:e.title??void 0,active:e.active,width:e.width,height:e.height}}function I5(){const e=navigator.language;return e.startsWith("zh")?"zh_CN":e.startsWith("ja")?"ja_JP":Bx}En.use(s3).init({resources:p3,lng:I5(),fallbackLng:Bx,interpolation:{escapeValue:!1},returnNull:!1});const P5={background:"#e1e1e1",foreground:"#616161",cursor:"#616161",selectionBackground:"rgba(97, 97, 97, 0.25)",black:"#171717",red:"#bf2172",green:"#009799",yellow:"#9a7200",blue:"#007299",magenta:"#9b1d72",cyan:"#007173",white:"#d9d9d9",brightBlack:"#4e4e4e",brightRed:"#e12672",brightGreen:"#00bddf",brightYellow:"#ffdd00",brightBlue:"#7299bc",brightMagenta:"#e17899",brightCyan:"#6fbcbd",brightWhite:"#f1f1f1"},L5={background:"#262626",foreground:"#d0d0d0",cursor:"#c5c5c5",selectionBackground:"rgba(197, 197, 197, 0.25)",black:"#000000",red:"#ba3c3c",green:"#5d876d",yellow:"#d5a54e",blue:"#887c8d",magenta:"#cd6d6d",cyan:"#618484",white:"#cfcdc3",brightBlack:"#000000",brightRed:"#ea7171",brightGreen:"#7aab7a",brightYellow:"#d1d194",brightBlue:"#afa3b5",brightMagenta:"#e29f9f",brightCyan:"#a0aea3",brightWhite:"#d0d0d0"};function j5(e){const t=e==="light"?P5:L5;return`fg=${t.foreground},bg=${t.background}`}const bee='"JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", "Source Han Mono SC", "Sarasa Mono SC", "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", monospace',_5=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,z5={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:15e3};class F5{constructor(t={}){st(this,"ws",null);st(this,"options");st(this,"state","IDLE");st(this,"seq",0);st(this,"chunkReassembler",new S5);st(this,"reconnectAttempts",0);st(this,"reconnectTimer",null);st(this,"heartbeatTimer",null);st(this,"messageHandlers",new Set);st(this,"stateChangeHandlers",new Set);st(this,"errorHandlers",new Set);st(this,"pendingMessages",[]);st(this,"maxPendingMessages",100);this.options={...z5,...t}}setState(t){if(this.state!==t){console.log(`[borsh-client] State: ${this.state} -> ${t}`),this.state=t;for(const n of this.stateChangeHandlers)try{n(t)}catch(r){console.error("[borsh-client] State change handler error:",r)}t==="READY"&&this.flushPendingMessages()}}getState(){return this.state}isReady(){return this.state==="READY"}onMessage(t){return this.messageHandlers.add(t),()=>this.messageHandlers.delete(t)}onStateChange(t){return this.stateChangeHandlers.add(t),()=>this.stateChangeHandlers.delete(t)}onError(t){return this.errorHandlers.add(t),()=>this.errorHandlers.delete(t)}connect(){var t,n;if(!(((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN||((n=this.ws)==null?void 0:n.readyState)===WebSocket.CONNECTING)){this.setState("WS_CONNECTING");try{this.ws=new WebSocket(_5),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{this.sendHello()},this.ws.onmessage=r=>{this.handleMessage(r.data)},this.ws.onclose=()=>{this.handleClose()},this.ws.onerror=()=>{this.handleError(new Error("WebSocket error"))}}catch(r){this.handleError(r instanceof Error?r:new Error(String(r)))}}}disconnect(){this.setState("CLOSED"),this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null)}handleMessage(t){if(typeof t=="string")return;const n=new Uint8Array(t);if(!x5(n)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const r=y5(n);if(r.kind===K3){const a=v5(r.payload),o=this.chunkReassembler.addChunk(a);o&&this.dispatchMessage({kind:o.kind,seq:o.seq,payload:o.payload});return}if(r.kind===x3){this.handleHelloS2C(r.payload);return}if(r.kind===S3)return;this.dispatchMessage({kind:r.kind,seq:r.seq,payload:r.payload})}catch(r){console.error("[borsh-client] Failed to decode message:",r)}}dispatchMessage(t){for(const n of this.messageHandlers)try{n(t)}catch(r){console.error("[borsh-client] Message handler error:",r)}}handleHelloS2C(t){try{const n=La(M4,t);console.log("[borsh-client] HELLO_S2C received:",n),this.setState("READY"),this.startHeartbeat(),this.reconnectAttempts=0}catch(n){console.error("[borsh-client] Failed to decode HELLO_S2C:",n),this.handleError(new Error("HELLO negotiation failed"))}}handleClose(){this.stopHeartbeat(),this.state!=="CLOSED"&&(this.reconnectAttempts<this.options.maxReconnectAttempts?this.scheduleReconnect():(this.setState("CLOSED"),this.handleError(new Error("Max reconnection attempts reached"))))}handleError(t){console.error("[borsh-client] Error:",t);for(const n of this.errorHandlers)try{n(t)}catch(r){console.error("[borsh-client] Error handler error:",r)}}sendHello(){const t={clientImpl:this.options.clientImpl,clientVersion:this.options.clientVersion,maxFrameBytes:this.options.maxFrameBytes,supportsCompression:!1,supportsDiffSnapshot:!1},n=tr(k4,t),r=this.nextSeq(),a=Gh(v3,n,r);this.sendRaw(a),this.setState("HELLO_NEGOTIATING")}send(t,n){if(!this.isReady())return this.pendingMessages.length<this.maxPendingMessages&&this.pendingMessages.push({kind:t,payload:n}),!1;const r=this.nextSeq(),a=E5(n,t,r,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:C5()});if(a.totalChunks===0){const o=Gh(t,n,r);this.sendRaw(o)}else for(const o of a.chunks){const l=b5(o,this.nextSeq());this.sendRaw(l)}return!0}sendRaw(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(t)}flushPendingMessages(){for(;this.pendingMessages.length>0;){const t=this.pendingMessages.shift();t&&this.send(t.kind,t.payload)}}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.sendPing()},this.options.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}sendPing(){if(!this.isReady())return;const t={nonce:Math.floor(Math.random()*4294967295),timeMs:BigInt(Date.now())},n=tr(O4,t),r=this.nextSeq(),a=Gh(w3,n,r);this.sendRaw(a)}scheduleReconnect(){if(this.reconnectTimer)return;this.reconnectAttempts++,this.setState("RECONNECT_BACKOFF");const t=Math.min(this.options.reconnectDelayMs*2**(this.reconnectAttempts-1),3e4);console.log(`[borsh-client] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat()}nextSeq(){return this.seq=(this.seq+1)%4294967295,this.seq}}let eb=null;function Nn(){return eb||(eb=new F5),eb}class B5{constructor(t={}){st(this,"transactions",new Map);st(this,"outputGates",new Map);st(this,"deferredResets",new Set);st(this,"deferredHistories",new Map);st(this,"deferredFlushes",new Map);st(this,"deferredOutputs",new Map);st(this,"callbacks");st(this,"ackTimeoutMs",1500);st(this,"liveResumeTimeoutMs",2e3);st(this,"timers",new Map);this.callbacks=t}setCallbacks(t){this.callbacks=t;for(const n of this.transactions.keys())this.replayDeferred(n);for(const n of this.deferredResets)this.replayDeferred(n);for(const n of this.deferredHistories.keys())this.replayDeferred(n);for(const n of this.deferredFlushes.keys())this.replayDeferred(n);for(const n of this.deferredOutputs.keys())this.replayDeferred(n)}getTransaction(t){return this.transactions.get(t)}getState(t){var n;return((n=this.transactions.get(t))==null?void 0:n.state)??"STABLE"}isStable(t){return this.getState(t)==="STABLE"}isBuffering(t){var n;return((n=this.outputGates.get(t))==null?void 0:n.state)==="BUFFERING"}dispatch(t){switch(t.type){case"SELECT_START":this.handleSelectStart(t);break;case"SWITCH_ACK":this.handleSwitchAck(t);break;case"HISTORY":this.handleHistory(t);break;case"LIVE_RESUME":this.handleLiveResume(t);break;case"OUTPUT":this.handleOutput(t);break;case"SELECT_FAILED":this.handleSelectFailed(t);break}}handleSelectStart(t){const{deviceId:n,windowId:r,paneId:a,selectToken:o,wantHistory:l}=t;this.cancelTransaction(n),this.clearDeferred(n);const c={state:"SELECTING",deviceId:n,windowId:r,paneId:a,selectToken:new Uint8Array(o),wantHistory:l,startedAt:Date.now()};this.transactions.set(n,c),this.startOutputBuffering(n),this.setTimer(n,()=>{this.handleTimeout(n,"ack")},this.ackTimeoutMs)}handleSwitchAck(t){const{deviceId:n,selectToken:r}=t,a=this.transactions.get(n);!a||!this.validateToken(a.selectToken,r)||a.state==="SELECTING"&&(this.clearTimer(n),a.state="ACKED",this.callbacks.onResetTerminal?this.callbacks.onResetTerminal(n):this.deferredResets.add(n),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleHistory(t){const{deviceId:n,selectToken:r,data:a}=t,o=this.transactions.get(n);!o||!this.validateToken(o.selectToken,r)||o.state==="ACKED"&&(o.state="HISTORY_APPLIED",this.callbacks.onApplyHistory?this.callbacks.onApplyHistory(n,a,t.alternateScreen):this.deferredHistories.set(n,{data:a,alternateScreen:t.alternateScreen}),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleLiveResume(t){const{deviceId:n,selectToken:r}=t,a=this.transactions.get(n);if(!a||!this.validateToken(a.selectToken,r)||a.state!=="ACKED"&&a.state!=="HISTORY_APPLIED")return;this.clearTimer(n),a.state="LIVE";const o=this.stopOutputBuffering(n);this.completeTransaction(n),this.callbacks.onFlushBuffer?this.callbacks.onFlushBuffer(n,o):o.length>0&&this.deferredFlushes.set(n,o),this.replayDeferred(n)}handleOutput(t){const{deviceId:n,paneId:r,data:a}=t,o=this.transactions.get(n);if(o&&o.paneId!==r)return;if(this.isBuffering(n)){this.bufferOutput(n,a);return}if(this.callbacks.onOutput){this.callbacks.onOutput(n,r,a);return}const l=this.deferredOutputs.get(n)??[];l.push({paneId:r,data:new Uint8Array(a)}),this.deferredOutputs.set(n,l)}handleSelectFailed(t){const{deviceId:n}=t;this.failTransaction(n)}handleTimeout(t,n){console.warn(`[select-sm] Timeout at ${n} for ${t}`),this.failTransaction(t)}completeTransaction(t){const n=this.transactions.get(t);n&&(n.state="STABLE",this.transactions.delete(t))}failTransaction(t){var r,a;const n=this.transactions.get(t);n&&(n.state="SELECT_FAILED",this.stopOutputBuffering(t),(a=(r=this.callbacks).onSelectFailed)==null||a.call(r,t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}cancelTransaction(t){this.transactions.get(t)&&(this.stopOutputBuffering(t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}startOutputBuffering(t){this.outputGates.set(t,{state:"BUFFERING",buffer:[]})}stopOutputBuffering(t){const n=this.outputGates.get(t);if(!n)return[];const r=[...n.buffer];return this.outputGates.delete(t),r}bufferOutput(t,n){const r=this.outputGates.get(t);r&&(r.buffer.length>=1e3&&r.buffer.shift(),r.buffer.push(new Uint8Array(n)))}validateToken(t,n){if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}replayDeferred(t){var o,l;this.deferredResets.has(t)&&(this.deferredResets.delete(t),(l=(o=this.callbacks).onResetTerminal)==null||l.call(o,t));const n=this.deferredHistories.get(t);n!==void 0&&this.callbacks.onApplyHistory&&(this.callbacks.onApplyHistory(t,n.data,n.alternateScreen),this.deferredHistories.delete(t));const r=this.deferredFlushes.get(t);r&&this.callbacks.onFlushBuffer&&(this.callbacks.onFlushBuffer(t,r),this.deferredFlushes.delete(t));const a=this.deferredOutputs.get(t);if(a&&this.callbacks.onOutput){for(const c of a)this.callbacks.onOutput(t,c.paneId,c.data);this.deferredOutputs.delete(t)}}clearDeferred(t){this.deferredResets.delete(t),this.deferredHistories.delete(t),this.deferredFlushes.delete(t),this.deferredOutputs.delete(t)}setTimer(t,n,r){this.clearTimer(t);const a=setTimeout(n,r);this.timers.set(t,a)}clearTimer(t){const n=this.timers.get(t);n&&(clearTimeout(n),this.timers.delete(t))}cleanup(t){this.cancelTransaction(t),this.outputGates.delete(t),this.clearDeferred(t)}cleanupAll(){for(const t of this.transactions.keys())this.cleanup(t);this.transactions.clear(),this.outputGates.clear(),this.deferredResets.clear(),this.deferredHistories.clear(),this.deferredFlushes.clear(),this.deferredOutputs.clear();for(const t of this.timers.values())clearTimeout(t);this.timers.clear()}}let Iu=null;function vd(e){return Iu?(e&&Iu.setCallbacks(e),Iu):(Iu=new B5(e),Iu)}function H5(){return crypto.getRandomValues(new Uint8Array(16))}function iO(e){const t=tr(A4,{deviceId:e});return{kind:C3,payload:t}}function U5(e){const t=tr(D4,{deviceId:e});return{kind:R3,payload:t}}function V5(e){const t=tr(L4,{deviceId:e.deviceId,windowId:e.windowId??null,paneId:e.paneId??null,selectToken:e.selectToken,wantHistory:e.wantHistory,cols:e.cols??null,rows:e.rows??null});return{kind:O3,payload:t}}function q5(e,t){const n=tr(j4,{deviceId:e,windowId:t});return{kind:A3,payload:n}}function $5(e,t){const n=tr(_4,{deviceId:e,name:t??null});return{kind:N3,payload:n}}function Y5(e,t){const n=tr(z4,{deviceId:e,windowId:t});return{kind:D3,payload:n}}function W5(e,t){const n=tr(F4,{deviceId:e,paneId:t});return{kind:I3,payload:n}}function K5(e,t,n){const r=tr(B4,{deviceId:e,windowId:t,name:n});return{kind:P3,payload:r}}function G5(e,t){const n=tr(H4,{deviceId:e,style:t});return{kind:_3,payload:n}}function X5(e,t){const n=tr(U4,{deviceId:e,windowIds:t});return{kind:z3,payload:n}}function Q5(e,t,n){const r=tr(V4,{deviceId:e,windowId:t,paneIds:n});return{kind:F3,payload:r}}function Z5(e,t,n,r=!1){const a=new TextEncoder,o=tr($4,{deviceId:e,paneId:t,encoding:2,data:a.encode(n),isComposing:r});return{kind:B3,payload:o}}function J5(e,t,n){const r=new TextEncoder,a=tr(Y4,{deviceId:e,paneId:t,encoding:2,data:r.encode(n),isComposing:!1});return{kind:H3,payload:a}}function eF(e,t,n,r){const a=tr(nO,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:U3,payload:a}}function tF(e,t,n,r){const a=tr(W4,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:V3,payload:a}}function nF(e){const t=tr(n5,{sessionId:e});return{kind:G3,payload:t}}function rF(e){const t=tr(r5,{sessionId:e});return{kind:X3,payload:t}}const ST=e=>{let t;const n=new Set,r=(d,m)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const y=t;t=m??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,y))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,a,c);return c},iF=(e=>e?ST(e):ST),aF=e=>e;function oF(e,t=aF){const n=Fe.useSyncExternalStore(e.subscribe,Fe.useCallback(()=>t(e.getState()),[e,t]),Fe.useCallback(()=>t(e.getInitialState()),[e,t]));return Fe.useDebugValue(n),n}const ET=e=>{const t=iF(e),n=r=>oF(t,r);return Object.assign(n,t),n},Vp=(e=>e?ET(e):ET),tb={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,notificationThrottleSeconds:3,enableBrowserBellToast:!0,enableBrowserNotificationToast:!0,enableTelegramBellPush:!0,enableTelegramNotificationPush:!0,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:Bx,updatedAt:new Date(0).toISOString()};async function CT(){const e=await fetch("/api/settings/site");if(!e.ok)throw new Error("Failed to load site settings");return(await e.json()).settings}const Vs=Vp((e,t)=>({settings:null,loading:!1,fetchSettings:async()=>{const n=t().settings;if(n)return n;e({loading:!0});try{const r=await CT();return e({settings:r,loading:!1}),En.changeLanguage(r.language),r}catch(r){return console.error("[site] failed to fetch settings:",r),e({settings:tb,loading:!1}),En.changeLanguage(tb.language),tb}},refreshSettings:async()=>{e({loading:!0});try{const n=await CT();return e({settings:n,loading:!1}),En.changeLanguage(n.language),n}catch(n){throw console.error("[site] failed to refresh settings:",n),e({loading:!1}),n}}}));function sF(e){const t=typeof e.windowIndex=="number"?`Window ${e.windowIndex}`:typeof e.windowId=="string"&&e.windowId?`Window ${e.windowId}`:"",n=typeof e.paneIndex=="number"?`Pane ${e.paneIndex}`:typeof e.paneId=="string"&&e.paneId?`Pane ${e.paneId}`:"";return[t,n].filter(Boolean).join(" · ")}function lF(e){const t=typeof e.title=="string"&&e.title?e.title:"Terminal Notification",n=sF(e),r=typeof e.body=="string"&&e.body?e.body:typeof e.source=="string"&&e.source?`From ${e.source}`:"Terminal notification";return{title:t,description:n?`${n}
86
- ${r}`:r}}function cF(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var o;const l=f=>f===null?null:JSON.parse(f,void 0),c=(o=n.getItem(a))!=null?o:null;return c instanceof Promise?c.then(l):l(c)},setItem:(a,o)=>n.setItem(a,JSON.stringify(o,void 0)),removeItem:a=>n.removeItem(a)}}const bv=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return bv(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return bv(r)(n)}}}},uF=(e,t)=>(n,r,a)=>{let o={storage:cF(()=>window.localStorage),partialize:T=>T,version:0,merge:(T,S)=>({...S,...T}),...t},l=!1,c=0;const f=new Set,d=new Set;let m=o.storage;if(!m)return e((...T)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...T)},r,a);const h=()=>{const T=o.partialize({...r()});return m.setItem(o.name,{state:T,version:o.version})},y=a.setState;a.setState=(T,S)=>(y(T,S),h());const g=e((...T)=>(n(...T),h()),r,a);a.getInitialState=()=>g;let w;const C=()=>{var T,S;if(!m)return;const R=++c;l=!1,f.forEach(M=>{var D;return M((D=r())!=null?D:g)});const k=((S=o.onRehydrateStorage)==null?void 0:S.call(o,(T=r())!=null?T:g))||void 0;return bv(m.getItem.bind(m))(o.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==o.version){if(o.migrate){const D=o.migrate(M.state,M.version);return D instanceof Promise?D.then(O=>[!0,O]):[!0,D]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var D;if(R!==c)return;const[O,A]=M;if(w=o.merge(A,(D=r())!=null?D:g),n(w,!0),O)return h()}).then(()=>{R===c&&(k==null||k(w,void 0),w=r(),l=!0,d.forEach(M=>M(w)))}).catch(M=>{R===c&&(k==null||k(void 0,M))})};return a.persist={setOptions:T=>{o={...o,...T},T.storage&&(m=T.storage)},clearStorage:()=>{m==null||m.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>C(),hasHydrated:()=>l,onHydrate:T=>(f.add(T),()=>{f.delete(T)}),onFinishHydration:T=>(d.add(T),()=>{d.delete(T)})},o.skipHydration||C(),w||g},aO=uF,ra=Vp()(aO(e=>({sidebarCollapsed:!1,sidebarTab:"panes",inputMode:"direct",editorSendWithEnter:!0,theme:"dark",editorHistory:[],editorDrafts:{},setSidebarCollapsed:t=>e({sidebarCollapsed:t}),setSidebarTab:t=>e({sidebarTab:t}),setInputMode:t=>e({inputMode:t}),setEditorSendWithEnter:t=>e({editorSendWithEnter:t}),setTheme:t=>e({theme:t}),addEditorHistory:t=>e(n=>({editorHistory:[t,...n.editorHistory.slice(0,49)]})),setEditorDraft:(t,n)=>e(r=>({editorDrafts:{...r.editorDrafts,[t]:n}})),removeEditorDraft:t=>e(n=>{if(!(t in n.editorDrafts))return n;const r={...n.editorDrafts};return delete r[t],{editorDrafts:r}})}),{name:"tmex-ui",partialize:e=>({sidebarCollapsed:e.sidebarCollapsed,sidebarTab:e.sidebarTab,inputMode:e.inputMode,editorSendWithEnter:e.editorSendWithEnter,theme:e.theme,editorHistory:e.editorHistory,editorDrafts:e.editorDrafts})})),dF=500,TT=new Map,nb=new Map;function oO(e){const t=Date.now(),n=TT.get(e);return n!==void 0&&t-n<dF?!0:(TT.set(e,t),!1)}let RT=!1;function rb(e){const t=j5(ra.getState().theme),n=G5(e,t);Nn().send(n.kind,n.payload)}function ib(e,t){if(typeof e!="number"||typeof t!="number")return null;const n=Math.max(2,Math.floor(e)),r=Math.max(2,Math.floor(t));return{cols:n,rows:r}}function fF(e,t){if(RT)return;RT=!0;const n=Nn(),r=o=>{const l=t().selectedPanes[o];!l||vd().getTransaction(o)||t().selectPane(o,l.windowId,l.paneId)};n.onStateChange(o=>{e({socketReady:o==="READY"})}),n.onMessage(o=>{const l=vd();switch(o.kind){case T3:{const c=La(N4,o.payload);e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!0},deviceErrors:{...f.deviceErrors,[c.deviceId]:void 0},deviceReconnecting:{...f.deviceReconnecting,[c.deviceId]:void 0}})),rb(c.deviceId),r(c.deviceId);return}case k3:{const c=La(I4,o.payload);l.cleanup(c.deviceId),e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!1}}));return}case M3:{const c=R5(o.payload);hF(e,c),c.type==="reconnected"&&(rb(c.deviceId),r(c.deviceId));return}case j3:{const c=O5(o.payload);e(f=>({snapshots:{...f.snapshots,[c.deviceId]:c}}));return}case L3:{const c=k5(o.payload);pF(e,c);return}case Y3:{const c=La(X4,o.payload);l.dispatch({type:"SWITCH_ACK",deviceId:c.deviceId,selectToken:c.selectToken});return}case $3:{const c=La(G4,o.payload),f=new TextDecoder().decode(c.data);l.dispatch({type:"HISTORY",deviceId:c.deviceId,selectToken:c.selectToken,data:f,alternateScreen:c.alternateScreen});return}case W3:{const c=La(Q4,o.payload);l.dispatch({type:"LIVE_RESUME",deviceId:c.deviceId,selectToken:c.selectToken});return}case q3:{const c=La(K4,o.payload);l.dispatch({type:"OUTPUT",deviceId:c.deviceId,paneId:c.paneId,data:c.data});return}case E3:return}}),n.onError(o=>{console.error("[tmux] borsh ws error:",o),e({socketReady:!1}),mn.error("WebSocket Connection Error",{description:"Please check Gateway status"})}),n.onStateChange(o=>{if(o!=="READY")return;const l=t().connectedDevices;for(const c of l){if(oO(c))continue;const f=iO(c);n.send(f.kind,f.payload)}});let a=ra.getState().theme;ra.subscribe(o=>{if(o.theme===a)return;a=o.theme;const l=t();for(const c of l.connectedDevices)l.deviceConnected[c]&&rb(c)})}function hF(e,t){if(t.type==="error"){const n=t.message??"Device Error",r=t.errorType??"unknown";if(r==="reconnecting"){e(a=>({deviceReconnecting:{...a.deviceReconnecting,[t.deviceId]:{message:n,at:Date.now()}}}));return}e(a=>{const o=a.deviceErrors[t.deviceId];return(!o||o.type!==r)&&mn.error(n),{deviceErrors:{...a.deviceErrors,[t.deviceId]:{message:n,type:r,rawMessage:t.rawMessage,at:Date.now()}},deviceReconnecting:{...a.deviceReconnecting,[t.deviceId]:void 0}}});return}if(t.type==="disconnected"){vd().cleanup(t.deviceId),e(n=>({deviceConnected:{...n.deviceConnected,[t.deviceId]:!1}}));return}t.type==="reconnected"&&e(n=>({deviceConnected:{...n.deviceConnected,[t.deviceId]:!0},deviceErrors:{...n.deviceErrors,[t.deviceId]:void 0},deviceReconnecting:{...n.deviceReconnecting,[t.deviceId]:void 0}}))}function pF(e,t){if(t.type==="bell"){console.log("[tmex] bell",t.data);const n=Vs.getState().settings;if((n==null?void 0:n.enableBrowserBellToast)===!1)return;const r=t.data??{},a="Terminal Bell",o=[typeof r.windowIndex=="number"?`Window ${r.windowIndex}`:void 0,typeof r.paneIndex=="number"?`Pane ${r.paneIndex}`:void 0].filter(Boolean).join(" · "),l=typeof r.paneUrl=="string"?r.paneUrl:void 0;mn(a,{description:o||"Received tmux bell",action:l?{label:"Open",onClick:()=>{window.location.href=l}}:void 0})}if(t.type==="notification"){console.log("[tmex] notification",t.data);const n=Vs.getState().settings;if((n==null?void 0:n.enableBrowserNotificationToast)===!1)return;const r=t.data??{},{title:a,description:o}=lF(r),l=typeof r.paneUrl=="string"?r.paneUrl:void 0;mn(a,{description:o,action:l?{label:"Open",onClick:()=>{window.location.href=l}}:void 0})}if(t.type==="pane-active"){const n=t.data;n!=null&&n.windowId&&(n!=null&&n.paneId)&&e(r=>({activePaneFromEvent:{...r.activePaneFromEvent,[t.deviceId]:{windowId:n.windowId,paneId:n.paneId}}}))}}const qn=Vp((e,t)=>({socketReady:!1,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},deviceReconnecting:{},selectedPanes:{},activePaneFromEvent:{},pendingCreateWindowAt:{},ensureSocketConnected(){fF(e,t),Nn().connect()},connectDevice(n){if(!n||(e(a=>{const o=new Set(a.connectedDevices);return o.add(n),{connectedDevices:o}}),t().ensureSocketConnected(),oO(n)))return;const r=iO(n);Nn().send(r.kind,r.payload)},disconnectDevice(n){if(!n)return;e(a=>{const o=new Set(a.connectedDevices);return o.delete(n),{connectedDevices:o}}),vd().cleanup(n);const r=U5(n);Nn().send(r.kind,r.payload)},clearDeviceError(n){e(r=>({deviceErrors:{...r.deviceErrors,[n]:void 0},deviceReconnecting:{...r.deviceReconnecting,[n]:void 0}}))},hydrateDeviceErrors(n){e(r=>{const a={...r.deviceErrors};for(const o of n)a[o.deviceId]||!o.lastError||!o.lastErrorType||(a[o.deviceId]={message:o.lastError,type:o.lastErrorType,at:0});return{deviceErrors:a}})},selectPane(n,r,a,o){if(!n||!r||!a)return;e(m=>({selectedPanes:{...m.selectedPanes,[n]:{windowId:r,paneId:a}}}));const l=H5(),c=!0;vd().dispatch({type:"SELECT_START",deviceId:n,windowId:r,paneId:a,selectToken:l,wantHistory:c});const f=ib(o==null?void 0:o.cols,o==null?void 0:o.rows)??nb.get(n)??null,d=V5({deviceId:n,windowId:r,paneId:a,selectToken:l,wantHistory:c,cols:f==null?void 0:f.cols,rows:f==null?void 0:f.rows});Nn().send(d.kind,d.payload)},selectWindow(n,r){if(!n||!r)return;const a=q5(n,r);Nn().send(a.kind,a.payload)},sendInput(n,r,a,o=!1){if(!n||!r)return;const l=Z5(n,r,a,o);Nn().send(l.kind,l.payload)},resizePane(n,r,a,o){if(!n||!r)return;const l=ib(a,o);l&&nb.set(n,{...l,at:Date.now()});const c=eF(n,r,a,o);Nn().send(c.kind,c.payload)},syncPaneSize(n,r,a,o){if(!n||!r)return;const l=ib(a,o);l&&nb.set(n,{...l,at:Date.now()});const c=tF(n,r,a,o);Nn().send(c.kind,c.payload)},paste(n,r,a){if(!n||!r)return;const o=J5(n,r,a);Nn().send(o.kind,o.payload)},createWindow(n,r){if(!n)return;const a=$5(n,r);Nn().send(a.kind,a.payload),e(o=>({pendingCreateWindowAt:{...o.pendingCreateWindowAt,[n]:Date.now()}}))},clearPendingCreateWindow(n){n&&e(r=>{if(r.pendingCreateWindowAt[n]===void 0)return r;const a={...r.pendingCreateWindowAt};return delete a[n],{pendingCreateWindowAt:a}})},closeWindow(n,r){if(!n||!r)return;const a=Y5(n,r);Nn().send(a.kind,a.payload)},closePane(n,r){if(!n||!r)return;const a=W5(n,r);Nn().send(a.kind,a.payload)},renameWindow(n,r,a){if(!n||!r)return;const o=K5(n,r,a);Nn().send(o.kind,o.payload)},reorderWindows(n,r){if(!n||r.length===0)return;e(o=>{const l=o.snapshots[n],c=l==null?void 0:l.session;if(!c)return{};const f=new Map(c.windows.map(h=>[h.id,h])),d=r.map(h=>f.get(h)).filter(h=>h!==void 0),m=c.windows.filter(h=>!r.includes(h.id));return{snapshots:{...o.snapshots,[n]:{...l,session:{...c,windows:[...d,...m]}}}}});const a=X5(n,r);Nn().send(a.kind,a.payload)},reorderPanes(n,r,a){if(!n||!r||a.length===0)return;e(l=>{const c=l.snapshots[n],f=c==null?void 0:c.session;if(!f)return{};const d=f.windows.map(m=>{if(m.id!==r)return m;const h=new Map(m.panes.map(w=>[w.id,w])),y=a.map(w=>h.get(w)).filter(w=>w!==void 0),g=m.panes.filter(w=>!a.includes(w.id));return{...m,panes:[...y,...g]}});return{snapshots:{...l.snapshots,[n]:{...c,session:{...f,windows:d}}}}});const o=Q5(n,r,a);Nn().send(o.kind,o.payload)}})),kT="tmex:connectedDevices",sO=v.createContext(null);function mF(){const e=v.useContext(sO);if(!e)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return e}function gF({children:e}){const t=sa(),[n,r]=v.useState(()=>{try{const h=localStorage.getItem(kT);if(h){const y=JSON.parse(h);return new Set(y)}}catch{}return new Set}),a=qn(h=>h.connectDevice),o=qn(h=>h.disconnectDevice),l=qn(h=>h.connectedDevices);v.useEffect(()=>{try{localStorage.setItem(kT,JSON.stringify([...n]))}catch{}},[n]),v.useEffect(()=>{const h=t.pathname.match(/^\/devices\/([^/]+)/),y=h==null?void 0:h[1];y&&!l.has(y)&&a(y)},[t.pathname,l,a]);const c=v.useCallback(h=>{r(y=>{const g=new Set(y);return g.add(h),g}),l.has(h)||a(h)},[l,a]),f=v.useCallback(h=>{r(y=>{const g=new Set(y);return g.delete(h),g}),l.has(h)&&o(h)},[l,o]),d=v.useCallback((h,y)=>{y?f(h):c(h)},[c,f]),m=v.useMemo(()=>({persistedDevices:n,connectDevice:c,disconnectDevice:f,toggleDevice:d}),[n,c,f,d]);return E.jsx(sO.Provider,{value:m,children:e})}/**
87
- * @license lucide-react v0.564.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const lO=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
92
- * @license lucide-react v0.564.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const yF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
97
- * @license lucide-react v0.564.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const bF=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
102
- * @license lucide-react v0.564.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const MT=e=>{const t=bF(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
107
- * @license lucide-react v0.564.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */var vF={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"};/**
112
- * @license lucide-react v0.564.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const xF=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
117
- * @license lucide-react v0.564.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const wF=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...c},f)=>v.createElement("svg",{ref:f,...vF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:lO("lucide",a),...!o&&!xF(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,m])=>v.createElement(d,m)),...Array.isArray(o)?o:[o]]));/**
122
- * @license lucide-react v0.564.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const Lt=(e,t)=>{const n=v.forwardRef(({className:r,...a},o)=>v.createElement(wF,{ref:o,iconNode:t,className:lO(`lucide-${yF(MT(e))}`,`lucide-${e}`,r),...a}));return n.displayName=MT(e),n};/**
127
- * @license lucide-react v0.564.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const SF=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],EF=Lt("activity",SF);/**
132
- * @license lucide-react v0.564.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const CF=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],TF=Lt("arrow-down",CF);/**
137
- * @license lucide-react v0.564.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const RF=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],kF=Lt("arrow-left",RF);/**
142
- * @license lucide-react v0.564.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const MF=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],OF=Lt("bell",MF);/**
147
- * @license lucide-react v0.564.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const AF=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Hx=Lt("bot",AF);/**
152
- * @license lucide-react v0.564.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const NF=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],DF=Lt("brain",NF);/**
157
- * @license lucide-react v0.564.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const IF=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fp=Lt("check",IF);/**
162
- * @license lucide-react v0.564.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const PF=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cO=Lt("chevron-down",PF);/**
167
- * @license lucide-react v0.564.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const LF=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qp=Lt("chevron-right",LF);/**
172
- * @license lucide-react v0.564.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const jF=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],_F=Lt("chevron-up",jF);/**
177
- * @license lucide-react v0.564.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const zF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ju=Lt("circle-alert",zF);/**
182
- * @license lucide-react v0.564.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const FF=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],uO=Lt("ellipsis-vertical",FF);/**
187
- * @license lucide-react v0.564.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const BF=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],HF=Lt("ellipsis",BF);/**
192
- * @license lucide-react v0.564.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const UF=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M2 10h20",key:"1ir3d8"}]],VF=Lt("folder-closed",UF);/**
197
- * @license lucide-react v0.564.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const qF=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],$F=Lt("folder",qF);/**
202
- * @license lucide-react v0.564.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const YF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],dO=Lt("globe",YF);/**
207
- * @license lucide-react v0.564.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const WF=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Ux=Lt("grip-vertical",WF);/**
212
- * @license lucide-react v0.564.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const KF=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],GF=Lt("history",KF);/**
217
- * @license lucide-react v0.564.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const XF=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],QF=Lt("keyboard",XF);/**
222
- * @license lucide-react v0.564.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const ZF=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],JF=Lt("list-tree",ZF);/**
227
- * @license lucide-react v0.564.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const eB=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],mc=Lt("loader-circle",eB);/**
232
- * @license lucide-react v0.564.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const tB=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],nB=Lt("menu",tB);/**
237
- * @license lucide-react v0.564.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const rB=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Vx=Lt("monitor",rB);/**
242
- * @license lucide-react v0.564.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const iB=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],aB=Lt("moon",iB);/**
247
- * @license lucide-react v0.564.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const oB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],sB=Lt("panel-left",oB);/**
252
- * @license lucide-react v0.564.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const lB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],cB=Lt("panels-top-left",lB);/**
257
- * @license lucide-react v0.564.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const uB=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],$p=Lt("pencil",uB);/**
262
- * @license lucide-react v0.564.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const dB=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Yp=Lt("plus",dB);/**
267
- * @license lucide-react v0.564.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const fB=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],hB=Lt("power-off",fB);/**
272
- * @license lucide-react v0.564.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const pB=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],mB=Lt("power",pB);/**
277
- * @license lucide-react v0.564.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const gB=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],yB=Lt("radar",gB);/**
282
- * @license lucide-react v0.564.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const bB=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],vB=Lt("refresh-ccw",bB);/**
287
- * @license lucide-react v0.564.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const xB=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],wB=Lt("search",xB);/**
292
- * @license lucide-react v0.564.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */const SB=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],OT=Lt("send",SB);/**
297
- * @license lucide-react v0.564.0 - ISC
298
- *
299
- * This source code is licensed under the ISC license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */const EB=[["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"}]],CB=Lt("settings",EB);/**
302
- * @license lucide-react v0.564.0 - ISC
303
- *
304
- * This source code is licensed under the ISC license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */const TB=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],RB=Lt("sparkles",TB);/**
307
- * @license lucide-react v0.564.0 - ISC
308
- *
309
- * This source code is licensed under the ISC license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */const kB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],MB=Lt("square",kB);/**
312
- * @license lucide-react v0.564.0 - ISC
313
- *
314
- * This source code is licensed under the ISC license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */const OB=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],AB=Lt("sun",OB);/**
317
- * @license lucide-react v0.564.0 - ISC
318
- *
319
- * This source code is licensed under the ISC license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */const NB=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],DB=Lt("terminal",NB);/**
322
- * @license lucide-react v0.564.0 - ISC
323
- *
324
- * This source code is licensed under the ISC license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */const IB=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],fO=Lt("trash-2",IB);/**
327
- * @license lucide-react v0.564.0 - ISC
328
- *
329
- * This source code is licensed under the ISC license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */const PB=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],LB=Lt("wrench",PB);/**
332
- * @license lucide-react v0.564.0 - ISC
333
- *
334
- * This source code is licensed under the ISC license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */const jB=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ua=Lt("x",jB);/**
337
- * @license lucide-react v0.564.0 - ISC
338
- *
339
- * This source code is licensed under the ISC license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */const _B=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],hO=Lt("zap",_B);function Wp(){return typeof window<"u"}function Wo(e){return qx(e)?(e.nodeName||"").toLowerCase():"#document"}function Bn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function la(e){var t;return(t=(qx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qx(e){return Wp()?e instanceof Node||e instanceof Bn(e).Node:!1}function cn(e){return Wp()?e instanceof Element||e instanceof Bn(e).Element:!1}function kn(e){return Wp()?e instanceof HTMLElement||e instanceof Bn(e).HTMLElement:!1}function vv(e){return!Wp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bn(e).ShadowRoot}const zB=new Set(["inline","contents"]);function Ko(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ii(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!zB.has(a)}const FB=new Set(["table","td","th"]);function BB(e){return FB.has(Wo(e))}const HB=[":popover-open",":modal"];function Kp(e){return HB.some(t=>{try{return e.matches(t)}catch{return!1}})}const UB=["transform","translate","scale","rotate","perspective"],VB=["transform","translate","scale","rotate","perspective","filter"],qB=["paint","layout","strict","content"];function $x(e){const t=Gp(),n=cn(e)?ii(e):e;return UB.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||VB.some(r=>(n.willChange||"").includes(r))||qB.some(r=>(n.contain||"").includes(r))}function $B(e){let t=ia(e);for(;kn(t)&&!ea(t);){if($x(t))return t;if(Kp(t))return null;t=ia(t)}return null}function Gp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const YB=new Set(["html","body","#document"]);function ea(e){return YB.has(Wo(e))}function ii(e){return Bn(e).getComputedStyle(e)}function Xp(e){return cn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ia(e){if(Wo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vv(e)&&e.host||la(e);return vv(t)?t.host:t}function pO(e){const t=ia(e);return ea(t)?e.ownerDocument?e.ownerDocument.body:e.body:kn(t)&&Ko(t)?t:pO(t)}function Fo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=pO(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),l=Bn(a);if(o){const c=xv(l);return t.concat(l,l.visualViewport||[],Ko(a)?a:[],c&&n?Fo(c):[])}return t.concat(a,Fo(a,[],n))}function xv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const AT={};function nr(e,t){const n=v.useRef(AT);return n.current===AT&&(n.current=e(t)),n}const ab=Cx[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],WB=ab&&ab!==v.useLayoutEffect?ab:e=>e();function Ye(e){const t=nr(KB).current;return t.next=e,WB(t.effect),t.trampoline}function KB(){const e={next:void 0,callback:GB,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function GB(){}const XB={...Cx},QB=()=>{},Ve=typeof document<"u"?v.useLayoutEffect:QB;function wv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const ed={};function Ei(e,t,n,r,a){let o={...Sv(e,ed)};return t&&(o=Wu(o,t)),n&&(o=Wu(o,n)),r&&(o=Wu(o,r)),a&&(o=Wu(o,a)),o}function ZB(e){if(e.length===0)return ed;if(e.length===1)return Sv(e[0],ed);let t={...Sv(e[0],ed)};for(let n=1;n<e.length;n+=1)t=Wu(t,e[n]);return t}function Wu(e,t){return mO(t)?t(e):JB(e,t)}function JB(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=wv(e.style,r);break}case"className":{e[n]=gO(e.className,r);break}default:eH(n,r)?e[n]=tH(e[n],r):e[n]=r}}return e}function eH(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),a=e.charCodeAt(2);return n===111&&r===110&&a>=65&&a<=90&&(typeof t=="function"||typeof t>"u")}function mO(e){return typeof e=="function"}function Sv(e,t){return mO(e)?e(t):e??ed}function tH(e,t){return t?e?n=>{if(nH(n)){const a=n;Ev(a);const o=t(a);return a.baseUIHandlerPrevented||e==null||e(a),o}const r=t(n);return e==null||e(n),r}:t:e}function Ev(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function gO(e,t){return t?e?t+" "+e:t:e}function nH(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Cn(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const yO=v.createContext(void 0);function Yx(e=!1){const t=v.useContext(yO);if(t===void 0&&!e)throw new Error(Cn(16));return t}function rH(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:a=0,isNativeButton:o}=e,l=r&&t!==!1,c=r&&t===!1;return{props:v.useMemo(()=>{const d={onKeyDown(m){n&&t&&m.key!=="Tab"&&m.preventDefault()}};return r||(d.tabIndex=a,!o&&n&&(d.tabIndex=t?a:-1)),(o&&(t||l)||!o&&n)&&(d["aria-disabled"]=n),o&&(!t||c)&&(d.disabled=n),d},[r,n,t,l,c,o,a])}}function qa(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:a=!0}=e,o=v.useRef(null),l=Yx(!0)!==void 0,c=Ye(()=>{const y=o.current;return!!((y==null?void 0:y.tagName)==="A"&&(y!=null&&y.href))}),{props:f}=rH({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:a}),d=v.useCallback(()=>{const y=o.current;iH(y)&&l&&t&&f.disabled===void 0&&y.disabled&&(y.disabled=!1)},[t,f.disabled,l]);Ve(d,[d]);const m=v.useCallback((y={})=>{const{onClick:g,onMouseDown:w,onKeyUp:C,onKeyDown:T,onPointerDown:S,...R}=y;return Ei({type:a?"button":void 0,onClick(M){if(t){M.preventDefault();return}g==null||g(M)},onMouseDown(M){t||w==null||w(M)},onKeyDown(M){if(t||(Ev(M),T==null||T(M)),M.baseUIHandlerPrevented)return;const D=M.target===M.currentTarget&&!a&&!c()&&!t,O=M.key==="Enter",A=M.key===" ";D&&((A||O)&&M.preventDefault(),O&&(g==null||g(M)))},onKeyUp(M){t||(Ev(M),C==null||C(M)),!M.baseUIHandlerPrevented&&M.target===M.currentTarget&&!a&&!t&&M.key===" "&&(g==null||g(M))},onPointerDown(M){if(t){M.preventDefault();return}S==null||S(M)}},a?void 0:{role:"button"},f,R)},[t,f,a,c]),h=Ye(y=>{o.current=y,d()});return{getButtonProps:m,buttonRef:h}}function iH(e){return kn(e)&&e.tagName==="BUTTON"}function _i(e,t,n,r){const a=nr(bO).current;return oH(a,e,t,n,r)&&vO(a,[e,t,n,r]),a.callback}function aH(e){const t=nr(bO).current;return sH(t,e)&&vO(t,e),t.callback}function bO(){return{callback:null,cleanup:null,refs:[]}}function oH(e,t,n,r,a){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==a}function sH(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function vO(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 r=Array(t.length).fill(null);for(let a=0;a<t.length;a+=1){const o=t[a];if(o!=null)switch(typeof o){case"function":{const l=o(n);typeof l=="function"&&(r[a]=l);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let a=0;a<t.length;a+=1){const o=t[a];if(o!=null)switch(typeof o){case"function":{const l=r[a];typeof l=="function"?l():o(null);break}case"object":{o.current=null;break}}}}}}}const lH=parseInt(v.version,10);function Wx(e){return lH>=e}function NT(e){if(!v.isValidElement(e))return null;const t=e,n=t.props;return(Wx(19)?n==null?void 0:n.ref:t.ref)??null}function cH(e,t){const n={};for(const r in e){const a=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](a);o!=null&&Object.assign(n,o);continue}a===!0?n[`data-${r.toLowerCase()}`]="":a&&(n[`data-${r.toLowerCase()}`]=a.toString())}return n}function uH(e,t){return typeof e=="function"?e(t):e}function dH(e,t){return typeof e=="function"?e(t):e}function Br(){}const qo=Object.freeze([]),Dn=Object.freeze({}),fH=500,hH=500,pH={style:{transition:"none"}},mH="data-base-ui-click-trigger",xO={fallbackAxisSide:"none"},wO={fallbackAxisSide:"end"},gH={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Dt(e,t,n={}){const r=t.render,a=yH(t,n);if(n.enabled===!1)return null;const o=n.state??Dn;return vH(e,r,a,o)}function yH(e,t={}){const{className:n,style:r,render:a}=e,{state:o=Dn,ref:l,props:c,stateAttributesMapping:f,enabled:d=!0}=t,m=d?uH(n,o):void 0,h=d?dH(r,o):void 0,y=d?cH(o,f):Dn,g=d?wv(y,Array.isArray(c)?ZB(c):c)??Dn:Dn;return typeof document<"u"&&(d?Array.isArray(l)?g.ref=aH([g.ref,NT(a),...l]):g.ref=_i(g.ref,NT(a),l):_i(null,null)),d?(m!==void 0&&(g.className=gO(g.className,m)),h!==void 0&&(g.style=wv(g.style,h)),g):Dn}const bH=Symbol.for("react.lazy");function vH(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const a=Ei(n,t.props);a.ref=n.ref;let o=t;return(o==null?void 0:o.$$typeof)===bH&&(o=v.Children.toArray(t)[0]),v.cloneElement(o,a)}if(e&&typeof e=="string")return xH(e,n);throw new Error(Cn(8))}function xH(e,t){return e==="button"?v.createElement("button",{type:"button",...t,key:t.key}):e==="img"?v.createElement("img",{alt:"",...t,key:t.key}):v.createElement(e,t)}const wH=v.forwardRef(function(t,n){const{render:r,className:a,disabled:o=!1,focusableWhenDisabled:l=!1,nativeButton:c=!0,...f}=t,{getButtonProps:d,buttonRef:m}=qa({disabled:o,focusableWhenDisabled:l,native:c});return Dt("button",t,{state:{disabled:o},ref:[n,m],props:[f,d]})});function SO(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=SO(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function EO(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=SO(e))&&(r&&(r+=" "),r+=t);return r}const DT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,IT=EO,Qp=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return IT(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:o}=t,l=Object.keys(a).map(d=>{const m=n==null?void 0:n[d],h=o==null?void 0:o[d];if(m===null)return null;const y=DT(m)||DT(h);return a[d][y]}),c=n&&Object.entries(n).reduce((d,m)=>{let[h,y]=m;return y===void 0||(d[h]=y),d},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:h,className:y,...g}=m;return Object.entries(g).every(w=>{let[C,T]=w;return Array.isArray(T)?T.includes({...o,...c}[C]):{...o,...c}[C]===T})?[...d,h,y]:d},[]);return IT(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},SH=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},EH=(e,t)=>({classGroupId:e,validator:t}),CO=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hp="-",PT=[],CH="arbitrary..",TH=e=>{const t=kH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return RH(l);const c=l.split(hp),f=c[0]===""&&c.length>1?1:0;return TO(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],d=n[l];return f?d?SH(d,f):f:d||PT}return n[l]||PT}}},TO=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],o=n.nextPart.get(a);if(o){const d=TO(e,t+1,o);if(d)return d}const l=n.validators;if(l===null)return;const c=t===0?e.join(hp):e.slice(t).join(hp),f=l.length;for(let d=0;d<f;d++){const m=l[d];if(m.validator(c))return m.classGroupId}},RH=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?CH+r:void 0})(),kH=e=>{const{theme:t,classGroups:n}=e;return MH(n,t)},MH=(e,t)=>{const n=CO();for(const r in e){const a=e[r];Kx(a,n,r,t)}return n},Kx=(e,t,n,r)=>{const a=e.length;for(let o=0;o<a;o++){const l=e[o];OH(l,t,n,r)}},OH=(e,t,n,r)=>{if(typeof e=="string"){AH(e,t,n);return}if(typeof e=="function"){NH(e,t,n,r);return}DH(e,t,n,r)},AH=(e,t,n)=>{const r=e===""?t:RO(t,e);r.classGroupId=n},NH=(e,t,n,r)=>{if(IH(e)){Kx(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(EH(n,e))},DH=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let l=0;l<o;l++){const[c,f]=a[l];Kx(f,RO(t,c),n,r)}},RO=(e,t)=>{let n=e;const r=t.split(hp),a=r.length;for(let o=0;o<a;o++){const l=r[o];let c=n.nextPart.get(l);c||(c=CO(),n.nextPart.set(l,c)),n=c}return n},IH=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,PH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return a(o,l),l},set(o,l){o in n?n[o]=l:a(o,l)}}},Cv="!",LT=":",LH=[],jT=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),jH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const o=[];let l=0,c=0,f=0,d;const m=a.length;for(let C=0;C<m;C++){const T=a[C];if(l===0&&c===0){if(T===LT){o.push(a.slice(f,C)),f=C+1;continue}if(T==="/"){d=C;continue}}T==="["?l++:T==="]"?l--:T==="("?c++:T===")"&&c--}const h=o.length===0?a:a.slice(f);let y=h,g=!1;h.endsWith(Cv)?(y=h.slice(0,-1),g=!0):h.startsWith(Cv)&&(y=h.slice(1),g=!0);const w=d&&d>f?d-f:void 0;return jT(o,g,y,w)};if(t){const a=t+LT,o=r;r=l=>l.startsWith(a)?o(l.slice(a.length)):jT(LH,!1,l,void 0,!0)}if(n){const a=r;r=o=>n({className:o,parseClassName:a})}return r},_H=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let o=0;o<n.length;o++){const l=n[o],c=l[0]==="[",f=t.has(l);c||f?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(l)):a.push(l)}return a.length>0&&(a.sort(),r.push(...a)),r}},zH=e=>({cache:PH(e.cacheSize),parseClassName:jH(e),sortModifiers:_H(e),...TH(e)}),FH=/\s+/,BH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,l=[],c=e.trim().split(FH);let f="";for(let d=c.length-1;d>=0;d-=1){const m=c[d],{isExternal:h,modifiers:y,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:C}=n(m);if(h){f=m+(f.length>0?" "+f:f);continue}let T=!!C,S=r(T?w.substring(0,C):w);if(!S){if(!T){f=m+(f.length>0?" "+f:f);continue}if(S=r(w),!S){f=m+(f.length>0?" "+f:f);continue}T=!1}const R=y.length===0?"":y.length===1?y[0]:o(y).join(":"),k=g?R+Cv:R,M=k+S;if(l.indexOf(M)>-1)continue;l.push(M);const D=a(S,T);for(let O=0;O<D.length;++O){const A=D[O];l.push(k+A)}f=m+(f.length>0?" "+f:f)}return f},HH=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=kO(n))&&(a&&(a+=" "),a+=r);return a},kO=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=kO(e[r]))&&(n&&(n+=" "),n+=t);return n},UH=(e,...t)=>{let n,r,a,o;const l=f=>{const d=t.reduce((m,h)=>h(m),e());return n=zH(d),r=n.cache.get,a=n.cache.set,o=c,c(f)},c=f=>{const d=r(f);if(d)return d;const m=BH(f,n);return a(f,m),m};return o=l,(...f)=>o(HH(...f))},VH=[],Zn=e=>{const t=n=>n[e]||VH;return t.isThemeGetter=!0,t},MO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,OO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qH=/^\d+\/\d+$/,$H=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,YH=/\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$/,WH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,KH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,GH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ll=e=>qH.test(e),Ut=e=>!!e&&!Number.isNaN(Number(e)),vo=e=>!!e&&Number.isInteger(Number(e)),ob=e=>e.endsWith("%")&&Ut(e.slice(0,-1)),Aa=e=>$H.test(e),XH=()=>!0,QH=e=>YH.test(e)&&!WH.test(e),AO=()=>!1,ZH=e=>KH.test(e),JH=e=>GH.test(e),eU=e=>!lt(e)&&!ct(e),tU=e=>Rc(e,IO,AO),lt=e=>MO.test(e),ws=e=>Rc(e,PO,QH),sb=e=>Rc(e,oU,Ut),_T=e=>Rc(e,NO,AO),nU=e=>Rc(e,DO,JH),wh=e=>Rc(e,LO,ZH),ct=e=>OO.test(e),Pu=e=>kc(e,PO),rU=e=>kc(e,sU),zT=e=>kc(e,NO),iU=e=>kc(e,IO),aU=e=>kc(e,DO),Sh=e=>kc(e,LO,!0),Rc=(e,t,n)=>{const r=MO.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},kc=(e,t,n=!1)=>{const r=OO.exec(e);return r?r[1]?t(r[1]):n:!1},NO=e=>e==="position"||e==="percentage",DO=e=>e==="image"||e==="url",IO=e=>e==="length"||e==="size"||e==="bg-size",PO=e=>e==="length",oU=e=>e==="number",sU=e=>e==="family-name",LO=e=>e==="shadow",lU=()=>{const e=Zn("color"),t=Zn("font"),n=Zn("text"),r=Zn("font-weight"),a=Zn("tracking"),o=Zn("leading"),l=Zn("breakpoint"),c=Zn("container"),f=Zn("spacing"),d=Zn("radius"),m=Zn("shadow"),h=Zn("inset-shadow"),y=Zn("text-shadow"),g=Zn("drop-shadow"),w=Zn("blur"),C=Zn("perspective"),T=Zn("aspect"),S=Zn("ease"),R=Zn("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),ct,lt],O=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],L=()=>[ct,lt,f],H=()=>[Ll,"full","auto",...L()],F=()=>[vo,"none","subgrid",ct,lt],W=()=>["auto",{span:["full",vo,ct,lt]},vo,ct,lt],j=()=>[vo,"auto",ct,lt],q=()=>["auto","min","max","fr",ct,lt],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...L()],z=()=>[Ll,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],U=()=>[e,ct,lt],K=()=>[...M(),zT,_T,{position:[ct,lt]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",iU,tU,{size:[ct,lt]}],G=()=>[ob,Pu,ws],I=()=>["","none","full",d,ct,lt],Q=()=>["",Ut,Pu,ws],Z=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[Ut,ob,zT,_T],pe=()=>["","none",w,ct,lt],we=()=>["none",Ut,ct,lt],Me=()=>["none",Ut,ct,lt],Pe=()=>[Ut,ct,lt],ne=()=>[Ll,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Aa],breakpoint:[Aa],color:[XH],container:[Aa],"drop-shadow":[Aa],ease:["in","out","in-out"],font:[eU],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Aa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Aa],shadow:[Aa],spacing:["px",Ut],text:[Aa],"text-shadow":[Aa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ll,lt,ct,T]}],container:["container"],columns:[{columns:[Ut,lt,ct,c]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:D()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{start:H()}],end:[{end:H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[vo,"auto",ct,lt]}],basis:[{basis:[Ll,"full","auto",c,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ut,Ll,"auto","initial","none",lt]}],grow:[{grow:["",Ut,ct,lt]}],shrink:[{shrink:["",Ut,ct,lt]}],order:[{order:[vo,"first","last","none",ct,lt]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[c,"screen",...z()]}],"min-w":[{"min-w":[c,"screen","none",...z()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,Pu,ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ct,sb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ob,lt]}],"font-family":[{font:[rU,lt,t]}],"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:[a,ct,lt]}],"line-clamp":[{"line-clamp":[Ut,"none",ct,sb]}],leading:[{leading:[o,...L()]}],"list-image":[{"list-image":["none",ct,lt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ct,lt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ut,"from-font","auto",ct,ws]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Ut,"auto",ct,lt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ct,lt]}],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",ct,lt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vo,ct,lt],radial:["",ct,lt],conic:[vo,ct,lt]},aU,nU]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ut,ct,lt]}],"outline-w":[{outline:["",Ut,Pu,ws]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",m,Sh,wh]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",h,Sh,wh]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Ut,ws]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",y,Sh,wh]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Ut,ct,lt]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"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":[Ut]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[ct,lt]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[Ut]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ct,lt]}],filter:[{filter:["","none",ct,lt]}],blur:[{blur:pe()}],brightness:[{brightness:[Ut,ct,lt]}],contrast:[{contrast:[Ut,ct,lt]}],"drop-shadow":[{"drop-shadow":["","none",g,Sh,wh]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Ut,ct,lt]}],"hue-rotate":[{"hue-rotate":[Ut,ct,lt]}],invert:[{invert:["",Ut,ct,lt]}],saturate:[{saturate:[Ut,ct,lt]}],sepia:[{sepia:["",Ut,ct,lt]}],"backdrop-filter":[{"backdrop-filter":["","none",ct,lt]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[Ut,ct,lt]}],"backdrop-contrast":[{"backdrop-contrast":[Ut,ct,lt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ut,ct,lt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ut,ct,lt]}],"backdrop-invert":[{"backdrop-invert":["",Ut,ct,lt]}],"backdrop-opacity":[{"backdrop-opacity":[Ut,ct,lt]}],"backdrop-saturate":[{"backdrop-saturate":[Ut,ct,lt]}],"backdrop-sepia":[{"backdrop-sepia":["",Ut,ct,lt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ct,lt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ut,"initial",ct,lt]}],ease:[{ease:["linear","initial",S,ct,lt]}],delay:[{delay:[Ut,ct,lt]}],animate:[{animate:["none",R,ct,lt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ct,lt]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:Me()}],"scale-x":[{"scale-x":Me()}],"scale-y":[{"scale-y":Me()}],"scale-z":[{"scale-z":Me()}],"scale-3d":["scale-3d"],skew:[{skew:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],transform:[{transform:[ct,lt,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ct,lt]}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",ct,lt]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Ut,Pu,ws,sb]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]}},cU=UH(lU);function je(...e){return cU(EO(e))}const uU=Qp("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function qt({className:e,variant:t="default",size:n="default",...r}){return E.jsx(wH,{"data-slot":"button",className:je(uU({variant:t,size:n,className:e})),...r})}function gc({controlled:e,default:t,name:n,state:r="value"}){const{current:a}=v.useRef(e!==void 0),[o,l]=v.useState(t),c=a?e:o,f=v.useCallback(d=>{a||l(d)},[]);return[c,f]}const jO={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Zp={...jO,position:"fixed",top:0,left:0},_O={...jO,position:"absolute"};let FT=0;function dU(e,t="mui"){const[n,r]=v.useState(e),a=e||n;return v.useEffect(()=>{n==null&&(FT+=1,r(`${t}-${FT}`))},[n,t]),a}const BT=XB.useId;function Js(e,t){if(BT!==void 0){const n=BT();return e??(t?`${t}-${n}`:n)}return dU(e,t)}function Hi(e){return Js(e,"base-ui")}const zO=v.createContext(void 0);function fU(){const e=v.useContext(zO);if(e===void 0)throw new Error(Cn(63));return e}let HT=(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 hU={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Gx={valid(e){return e===null?null:e?{[HT.valid]:""}:{[HT.invalid]:""}}};let UT=(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 FO={...Gx,checked(e){return e?{[UT.checked]:""}:{[UT.unchecked]:""}}};function pU(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const mU=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Br,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Xx(){return v.useContext(mU)}const gU=v.createContext({invalid:void 0,name:void 0,validityData:{state:hU,errors:[],error:"",value:"",initialValue:null},setValidityData:Br,disabled:void 0,touched:!1,setTouched:Br,dirty:!1,setDirty:Br,filled:!1,setFilled:Br,focused:!1,setFocused:Br,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=Dn)=>e,getInputValidationProps:(e=Dn)=>e,inputRef:{current:null},commit:async()=>{}}});function Mc(e=!0){const t=v.useContext(gU);if(t.setValidityData===Br&&!e)throw new Error(Cn(28));return t}function Qx(e){const{enabled:t=!0,value:n,id:r,name:a,controlRef:o,commit:l}=e,{formRef:c}=Xx(),{invalid:f,markedDirtyRef:d,validityData:m,setValidityData:h}=Mc(),y=Ye(e.getValue);Ve(()=>{if(!t)return;let g=n;g===void 0&&(g=y()),m.initialValue===null&&g!==null&&h(w=>({...w,initialValue:g}))},[t,h,n,m.initialValue,y]),Ve(()=>{!t||!r||c.current.fields.set(r,{getValue:y,name:a,controlRef:o,validityData:pU(m,f),validate(g=!0){let w=n;w===void 0&&(w=y()),d.current=!0,g?pr.flushSync(()=>l(w)):l(w)}})},[l,o,t,c,y,r,f,d,a,m,n]),Ve(()=>{const g=c.current.fields;return()=>{r&&g.delete(r)}},[c,r])}const yU=v.createContext({controlId:void 0,registerControlId:Br,labelId:void 0,setLabelId:Br,messageIds:[],setMessageIds:Br,getDescriptionProps:e=>e});function Jp(){return v.useContext(yU)}function em(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:a,registerControlId:o}=Jp(),l=Hi(t),c=n?a:void 0,f=nr(()=>Symbol("labelable-control")),d=v.useRef(!1),m=v.useRef(t!=null),h=Ye(()=>{!d.current||o===Br||(d.current=!1,o(f.current,void 0))});return Ve(()=>{if(o===Br)return;let y;if(n){const g=r==null?void 0:r.current;cn(g)&&g.closest("label")!=null?y=t??null:y=c??l}else if(t!=null)m.current=!0,y=t;else if(m.current)y=l;else{h();return}if(y===void 0){h();return}d.current=!0,o(f.current,y)},[t,r,c,o,n,l,f,h]),v.useEffect(()=>h,[h]),a??l}const zi="none",qs="trigger-press",vr="trigger-hover",$l="trigger-focus",tm="outside-press",td="item-press",bU="close-press",$s="focus-out",nm="escape-key",Xh="list-navigation",BO="cancel-open",Qh="sibling-open",vU="disabled",Zx="imperative-action",xU="window-resize";function vt(e,t,n,r){let a=!1,o=!1;const l=r??Dn;return{reason:e,event:t??new Event("base-ui"),cancel(){a=!0},allowPropagation(){o=!0},get isCanceled(){return a},get isPropagationAllowed(){return o},trigger:n,...l}}function HO(e,t){const n=v.useRef(e),r=Ye(t);Ve(()=>{n.current!==e&&r(n.current)},[e,r]),Ve(()=>{n.current=e},[e])}const wU=v.forwardRef(function(t,n){const{checked:r,className:a,defaultChecked:o,id:l,inputRef:c,name:f,nativeButton:d=!1,onCheckedChange:m,readOnly:h=!1,required:y=!1,disabled:g=!1,render:w,uncheckedValue:C,value:T,...S}=t,{clearErrors:R}=Xx(),{state:k,setTouched:M,setDirty:D,validityData:O,setFilled:A,setFocused:L,shouldValidateOnChange:H,validationMode:F,disabled:W,name:j,validation:q}=Mc(),{labelId:$}=Jp(),B=W||g,_=j??f,z=Ye(m),U=v.useRef(null),K=_i(U,c,q.inputRef),P=v.useRef(null),V=Hi(),G=em({id:l,implicit:!1,controlRef:P}),I=d?void 0:G,[Q,Z]=gc({controlled:r,default:!!o,name:"Switch",state:"checked"});Qx({id:V,commit:q.commit,value:Q,controlRef:P,name:_,getValue:()=>Q}),Ve(()=>{U.current&&A(U.current.checked)},[U,A]),HO(Q,()=>{R(_),D(Q!==O.initialValue),A(Q),H()?q.commit(Q):q.commit(Q,!0)});const{getButtonProps:te,buttonRef:le}=qa({disabled:B,native:d}),pe={id:d?G:V,role:"switch","aria-checked":Q,"aria-readonly":h||void 0,"aria-required":y||void 0,"aria-labelledby":$,onFocus(){B||L(!0)},onBlur(){const ne=U.current;!ne||B||(M(!0),L(!1),F==="onBlur"&&q.commit(ne.checked))},onClick(ne){var fe;h||B||(ne.preventDefault(),(fe=U.current)==null||fe.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ne.shiftKey,ctrlKey:ne.ctrlKey,altKey:ne.altKey,metaKey:ne.metaKey})))}},we=v.useMemo(()=>Ei({checked:Q,disabled:B,id:I,name:_,required:y,style:_?_O:Zp,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:K,onChange(ne){if(ne.nativeEvent.defaultPrevented)return;const fe=ne.target.checked,ye=vt(zi,ne.nativeEvent);z==null||z(fe,ye),!ye.isCanceled&&Z(fe)},onFocus(){var ne;(ne=P.current)==null||ne.focus()}},q.getInputValidationProps,T!==void 0?{value:T}:Dn),[Q,B,K,I,_,z,y,Z,q,T]),Me=v.useMemo(()=>({...k,checked:Q,disabled:B,readOnly:h,required:y}),[k,Q,B,h,y]),Pe=Dt("span",t,{state:Me,ref:[n,P,le],props:[pe,q.getValidationProps,S,te],stateAttributesMapping:FO});return E.jsxs(zO.Provider,{value:Me,children:[Pe,!Q&&_&&C!==void 0&&E.jsx("input",{type:"hidden",name:_,value:C}),E.jsx("input",{...we})]})}),SU=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{state:l}=Mc(),c=fU(),f={...l,...c};return Dt("span",t,{state:f,ref:n,stateAttributesMapping:FO,props:o})});function pp({className:e,size:t="default",...n}){return E.jsx(wU,{"data-slot":"switch","data-size":t,className:je("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:E.jsx(SU,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}function Jx({className:e,...t}){return E.jsx("textarea",{"data-slot":"textarea",className:je("border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-2 aria-invalid:ring-2 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function Ku(){return{texts:[],reasonings:[],toolCalls:[],staleBarrier:!1}}function Yl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function UO(e){if(Yl(e)&&typeof e.type=="string")switch(e.type){case"text":case"json":if("value"in e)return{value:e.value,isError:!1,denied:!1};break;case"error-text":case"error-json":if("value"in e)return{value:e.value,isError:!0,denied:!1};break;case"execution-denied":return{value:typeof e.reason=="string"?e.reason:void 0,isError:!1,denied:!0}}return{value:e,isError:!1,denied:!1}}function VO(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>Yl(t)&&typeof t.text=="string"?t.text:"").filter(Boolean).join(`
342
- `):""}function EU(e){const t=[],n=new Map;for(const r of e){const a=Yl(r.content)?r.content:null;if(!a)continue;const o=a.content;switch(r.role){case"user":{const l=VO(o);l&&t.push({kind:"user",key:`m${r.seq}`,text:l});break}case"assistant":{if(typeof o=="string"){o&&t.push({kind:"assistant-text",key:`m${r.seq}`,text:o,streaming:!1});break}if(!Array.isArray(o))break;o.forEach((l,c)=>{if(!Yl(l))return;const f=`m${r.seq}p${c}`;if(l.type==="text"&&typeof l.text=="string"&&l.text){t.push({kind:"assistant-text",key:f,text:l.text,streaming:!1});return}if(l.type==="reasoning"&&typeof l.text=="string"&&l.text){t.push({kind:"reasoning",key:f,text:l.text,streaming:!1});return}if(l.type==="tool-call"&&typeof l.toolCallId=="string"){const d={toolCallId:l.toolCallId,toolName:typeof l.toolName=="string"?l.toolName:"unknown",input:l.input,isError:!1,denied:!1,resolved:!1};n.set(d.toolCallId,d),t.push({kind:"tool-call",key:f,call:d})}});break}case"tool":{if(!Array.isArray(o))break;for(const l of o){if(!Yl(l)||l.type!=="tool-result")continue;const c=typeof l.toolCallId=="string"?l.toolCallId:"",f=n.get(c),{value:d,isError:m,denied:h}=UO(l.output);f&&(f.output=d,f.isError=m,f.denied=h,f.resolved=!0)}break}}}return{blocks:t,toolBlocksById:n}}function CU(e,t){const{blocks:n,toolBlocksById:r}=EU(e??[]);if(!t)return n;for(const a of t.toolCalls){const o=r.get(a.toolCallId);if(o){!o.resolved&&a.resolved&&(o.output=a.output,o.isError=a.isError,o.denied=a.denied,o.resolved=!0);continue}n.push({kind:"tool-call",key:`live-tool-${a.toolCallId}`,call:a})}for(const a of t.reasonings)a.text&&n.push({kind:"reasoning",key:`live-reasoning-${a.messageId}`,text:a.text,streaming:!0});for(const a of t.texts)a.text&&n.push({kind:"assistant-text",key:`live-text-${a.messageId}`,text:a.text,streaming:!0});return n}function Tv(e){return!e||e.length===0?-1:e[e.length-1].seq}function TU(e){if(!e)return null;for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role!=="user")continue;const r=Yl(n.content)?n.content:null,a=r?VO(r.content):"";if(a)return a}return null}async function Er(e,t){try{return(await e.json()).error??t}catch{return t}}function Lu(e){return Object.values(e).filter(t=>!!t).sort((t,n)=>t.updatedAt<n.updatedAt?1:-1).map(t=>t.id)}function VT(e,t){if(!e||e.length===0)return[...t].sort((r,a)=>r.seq-a.seq);const n=new Map;for(const r of e)n.set(r.seq,r);for(const r of t)n.set(r.seq,r);return[...n.values()].sort((r,a)=>r.seq-a.seq)}let qT=!1;const So=new Set,RU=40,_s=new Map;let ju=null;const kU=120,nd=new Map,lb=new Set,Rv=new Set;function MU(e){const t=nd.get(e);t&&(clearTimeout(t),nd.delete(e)),_s.delete(e),Rv.delete(e)}function kv(e){const t=nF(e);Nn().send(t.kind,t.payload)}function $T(e){const t=rF(e);Nn().send(t.kind,t.payload)}function YT(e,t,n,r){let a=_s.get(e);a||(a={texts:new Map,reasonings:new Map},_s.set(e,a));const o=a[t];o.set(n,(o.get(n)??"")+r)}function OU(e){const t=()=>{if(ju&&(clearTimeout(ju),ju=null),_s.size===0)return;const r=new Map(_s);_s.clear(),e(a=>{const o={...a.inProgress};for(const[l,c]of r){const f=o[l]??Ku(),d={...f,texts:[...f.texts],reasonings:[...f.reasonings]};for(const m of["texts","reasonings"])for(const[h,y]of c[m]){const g=d[m],w=g.findIndex(C=>C.messageId===h);w>=0?g[w]={...g[w],text:g[w].text+y}:g.push({messageId:h,text:y,stale:!1})}o[l]=d}return{inProgress:o}})};return{flush:t,schedule:()=>{ju||(ju=setTimeout(t,RU))}}}function AU(e,t){if(qT)return;qT=!0;const n=Nn(),r=OU(e),a=T=>{nd.get(T)||nd.set(T,setTimeout(()=>{nd.delete(T),t().loadHistory(T)},kU))},o=(T,S)=>{_s.delete(T),e(k=>{const M=k.sessions[T],D=Ku();return S.inProgressText&&D.texts.push({messageId:"__sync__",text:S.inProgressText,stale:!1}),S.inProgressReasoning&&D.reasonings.push({messageId:"__sync_reasoning__",text:S.inProgressReasoning,stale:!1}),{sessions:M?{...k.sessions,[T]:{...M,status:S.status,lastError:S.lastError}}:k.sessions,inProgress:{...k.inProgress,[T]:D},pendingConfirmations:{...k.pendingConfirmations,[T]:S.pendingConfirmations.map(O=>({id:O.confirmationId,toolCallId:O.toolCallId,toolName:O.toolName,input:O.input,createdAt:O.createdAt}))},queued:{...k.queued,[T]:S.queuedMessages.map(O=>({id:O.id,sessionId:T,seq:O.seq,text:O.text,createdAt:O.createdAt}))}}});const R=t();(S.lastMessageSeq>Tv(R.messages[T])||!R.historyLoaded[T])&&R.loadHistory(T)},l=(T,S)=>{const R=!!t().sessions[T];if(e(k=>{const M=k.sessions[T];return M?{sessions:{...k.sessions,[T]:{...M,status:S.status,lastError:S.lastError!==void 0?S.lastError:M.lastError}}}:k}),!R){t().loadSessions();return}t().refreshSession(T)},c=(T,S)=>{r.flush(),e(R=>{const k=R.inProgress[T]??Ku(),M=[...k.toolCalls],D=M.findIndex(A=>A.toolCallId===S.toolCallId),O={toolCallId:S.toolCallId,toolName:S.toolName,input:S.input,isError:!1,denied:!1,resolved:!1,stale:!1};return D>=0?M[D]={...M[D],...O}:M.push(O),{inProgress:{...R.inProgress,[T]:{...k,toolCalls:M}}}})},f=(T,S)=>{r.flush();const{value:R,isError:k,denied:M}=UO(S.output);e(D=>{const O=D.inProgress[T]??Ku(),A=[...O.toolCalls],L=A.findIndex(H=>H.toolCallId===S.toolCallId);return L>=0?A[L]={...A[L],output:R,isError:!!S.isError||k,denied:M,resolved:!0}:A.push({toolCallId:S.toolCallId,toolName:S.toolName,input:void 0,output:R,isError:!!S.isError||k,denied:M,resolved:!0,stale:O.staleBarrier}),{inProgress:{...D.inProgress,[T]:{...O,toolCalls:A}}}})},d=(T,S)=>{e(R=>{const k=R.pendingConfirmations[T]??[];return k.some(M=>M.id===S.confirmationId)?R:{pendingConfirmations:{...R.pendingConfirmations,[T]:[...k,{id:S.confirmationId,toolCallId:S.toolCallId,toolName:S.toolName,input:S.input,createdAt:new Date().toISOString()}]}}})},m=(T,S)=>{e(R=>{const k=R.pendingConfirmations[T];return!k||!k.some(M=>M.id===S.confirmationId)?R:{pendingConfirmations:{...R.pendingConfirmations,[T]:k.filter(M=>M.id!==S.confirmationId)}}})},h=(T,S)=>{r.flush(),(S.role==="assistant"||S.role==="tool")&&e(R=>{const k=R.inProgress[T];return k?{inProgress:{...R.inProgress,[T]:{texts:k.texts.map(M=>({...M,stale:!0})),reasonings:k.reasonings.map(M=>({...M,stale:!0})),toolCalls:k.toolCalls.map(M=>M.resolved?{...M,stale:!0}:M),staleBarrier:!0}}}:R}),a(T)},y=(T,S)=>{r.flush(),e(R=>{const k=R.sessions[T];return{sessions:k?{...R.sessions,[T]:{...k,status:S.sessionStatus}}:R.sessions,inProgress:{...R.inProgress,[T]:Ku()}}}),S.lastMessageSeq>Tv(t().messages[T])&&a(T)},g=(T,S)=>{const R=t().sessions[T];mn.error(En.t("agent.toast.errorTitle",{title:(R==null?void 0:R.title)??"Agent"}),{description:S.message})},w=(T,S)=>{mn.warning(En.t("agent.toast.credentialWarningTitle"),{description:En.t("agent.toast.credentialWarningDescription",{types:S.types.join(", ")}),duration:1e4})},C=(T,S)=>{e(R=>({queued:{...R.queued,[T]:S.queued.map(k=>({id:k.id,sessionId:T,seq:k.seq,text:k.text,createdAt:k.createdAt}))}}))};n.onMessage(T=>{if(T.kind!==Q3)return;let S;try{S=La(i5,T.payload)}catch(M){console.error("[agent] failed to decode AGENT_EVENT:",M);return}let R;try{R=JSON.parse(new TextDecoder().decode(S.payload))}catch(M){console.error("[agent] failed to parse AGENT_EVENT payload:",M);return}const k=S.sessionId;switch(S.eventType){case J3:o(k,R);return;case e4:l(k,R);return;case t4:{const M=R;YT(k,"texts",M.messageId,M.delta),r.schedule();return}case n4:{const M=R;YT(k,"reasonings",M.messageId,M.delta),r.schedule();return}case r4:c(k,R);return;case i4:f(k,R);return;case a4:d(k,R);return;case o4:m(k,R);return;case s4:h(k,R);return;case l4:g(k,R);return;case c4:y(k,R);return;case u4:w(k,R);return;case d4:C(k,R);return;default:return}}),n.onStateChange(T=>{if(T!=="READY")return;for(const R of So)kv(R);const S=t().activeSessionId;S&&t().loadHistory(S)})}const ln=Vp()(aO((e,t)=>({sessions:{},sessionOrder:[],sessionsLoaded:!1,activeSessionId:null,messages:{},historyLoaded:{},inProgress:{},pendingConfirmations:{},queued:{},sending:{},draft:null,defaultWriteMode:"confirm",ensureInitialized(){AU(e,t),Nn().connect();const n=t().activeSessionId;n&&!So.has(n)&&(So.add(n),kv(n))},async loadSessions(){try{const n=await fetch("/api/agent/sessions");if(!n.ok)throw new Error(await Er(n,"Failed to load agent sessions"));const r=await n.json();e(()=>{const o={};for(const l of r.sessions)o[l.id]=l;return{sessions:o,sessionOrder:Lu(o),sessionsLoaded:!0}});const a=t();a.activeSessionId&&!a.sessions[a.activeSessionId]&&a.setActiveSession(null)}catch(n){console.error("[agent] loadSessions failed:",n)}},async refreshSession(n){try{const r=await fetch(`/api/agent/sessions/${n}`);if(r.status===404){await t().loadSessions();return}if(!r.ok)throw new Error(await Er(r,"Failed to load agent session"));const a=await r.json();e(o=>{const l={...o.sessions,[n]:a.session};return{sessions:l,sessionOrder:Lu(l)}})}catch(r){console.error("[agent] refreshSession failed:",r)}},setActiveSession(n){const r=t().activeSessionId;r!==n&&(r&&So.has(r)&&(So.delete(r),$T(r)),e({activeSessionId:n,draft:null}),n&&(So.add(n),kv(n),t().historyLoaded[n]||t().loadHistory(n)))},async createSession(n,r,a){try{const o=await fetch("/api/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:n,paneId:r,...(a==null?void 0:a.providerId)!==void 0?{providerId:a.providerId}:{},...(a==null?void 0:a.modelId)!==void 0&&a.modelId!==null?{modelId:a.modelId}:{},...(a==null?void 0:a.providerHostedTools)!==void 0?{providerHostedTools:a.providerHostedTools}:{},...(a==null?void 0:a.originPaneTitle)!==void 0?{originPaneTitle:a.originPaneTitle}:{},writeMode:(a==null?void 0:a.writeMode)??t().defaultWriteMode})});if(!o.ok)throw new Error(await Er(o,"Failed to create agent session"));const c=(await o.json()).session;return e(f=>{const d={...f.sessions,[c.id]:c};return{sessions:d,sessionOrder:Lu(d),messages:{...f.messages,[c.id]:[]},historyLoaded:{...f.historyLoaded,[c.id]:!0}}}),t().setActiveSession(c.id),c}catch(o){return mn.error(o instanceof Error?o.message:String(o)),null}},async renameSession(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:r})});if(!a.ok)throw new Error(await Er(a,"Failed to rename agent session"));const o=await a.json();return e(l=>{const c={...l.sessions,[n]:o.session};return{sessions:c,sessionOrder:Lu(c)}}),!0}catch(a){return mn.error(a instanceof Error?a.message:String(a)),!1}},async deleteSession(n){try{const r=await fetch(`/api/agent/sessions/${n}`,{method:"DELETE"});if(!r.ok)throw new Error(await Er(r,"Failed to delete agent session"));return t().activeSessionId===n&&t().setActiveSession(null),MU(n),e(a=>{const o={...a.sessions};delete o[n];const l={...a.messages};delete l[n];const c={...a.historyLoaded};delete c[n];const f={...a.inProgress};delete f[n];const d={...a.pendingConfirmations};delete d[n];const m={...a.queued};return delete m[n],{sessions:o,sessionOrder:Lu(o),messages:l,historyLoaded:c,inProgress:f,pendingConfirmations:d,queued:m}}),!0}catch(r){return mn.error(r instanceof Error?r.message:String(r)),!1}},async setWriteMode(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({writeMode:r})});if(!a.ok)throw new Error(await Er(a,"Failed to update write mode"));const o=await a.json();e(l=>({sessions:{...l.sessions,[n]:o.session}}))}catch(a){mn.error(a instanceof Error?a.message:String(a))}},setDefaultWriteMode(n){e({defaultWriteMode:n})},async setSessionModel(n,r,a){try{const o=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:r,modelId:a})});if(!o.ok)throw new Error(await Er(o,"Failed to update model"));const l=await o.json();e(c=>({sessions:{...c.sessions,[n]:l.session}}))}catch(o){mn.error(o instanceof Error?o.message:String(o))}},async rebindPane(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({paneId:r})});if(!a.ok)throw new Error(await Er(a,"Failed to rebind pane"));const o=await a.json();e(l=>({sessions:{...l.sessions,[n]:o.session}}))}catch(a){mn.error(a instanceof Error?a.message:String(a))}},async loadHistory(n){if(lb.has(n)){Rv.add(n);return}lb.add(n);try{const r=t(),a=r.historyLoaded[n]?Tv(r.messages[n]):-1,o=a>=0?`?afterSeq=${a}`:"",l=await fetch(`/api/agent/sessions/${n}/messages${o}`);if(!l.ok)throw new Error(await Er(l,"Failed to load agent messages"));const c=await l.json();e(f=>{const d=VT(a>=0?f.messages[n]:void 0,c.messages),m=f.inProgress[n],h=m&&{texts:m.texts.filter(y=>!y.stale),reasonings:m.reasonings.filter(y=>!y.stale),toolCalls:m.toolCalls.filter(y=>!y.stale),staleBarrier:!1};return{messages:{...f.messages,[n]:d},historyLoaded:{...f.historyLoaded,[n]:!0},inProgress:h?{...f.inProgress,[n]:h}:f.inProgress}})}catch(r){console.error("[agent] loadHistory failed:",r)}finally{lb.delete(n),Rv.delete(n)&&t().loadHistory(n)}},async sendMessage(n,r){e(a=>({sending:{...a.sending,[n]:!0}}));try{const a=await fetch(`/api/agent/sessions/${n}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r})});if(!a.ok)throw new Error(await Er(a,"Failed to send message"));const o=await a.json();if(o.message){const l=o.message;e(c=>{const f=c.sessions[n];return{messages:{...c.messages,[n]:VT(c.messages[n],[l])},sessions:f?{...c.sessions,[n]:{...f,status:"running",lastError:null}}:c.sessions}})}return!0}catch(a){return mn.error(a instanceof Error?a.message:String(a)),!1}finally{e(a=>({sending:{...a.sending,[n]:!1}}))}},async enqueueMessage(n,r,a=!1){try{const o=await fetch(`/api/agent/sessions/${n}/queue`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r,steer:a})});if(!o.ok)throw new Error(await Er(o,"Failed to queue message"))}catch(o){mn.error(o instanceof Error?o.message:String(o))}},async editQueuedMessage(n,r,a){try{const o=await fetch(`/api/agent/queue/${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})});if(!o.ok)throw new Error(await Er(o,"Failed to edit queued message"))}catch(o){mn.error(o instanceof Error?o.message:String(o))}},async withdrawQueuedMessage(n,r){try{const a=await fetch(`/api/agent/queue/${r}`,{method:"DELETE"});if(!a.ok)throw new Error(await Er(a,"Failed to withdraw queued message"))}catch(a){mn.error(a instanceof Error?a.message:String(a))}},startDraft(n,r,a){const o=t().activeSessionId;o&&So.has(o)&&(So.delete(o),$T(o)),e({activeSessionId:null,draft:{deviceId:n,paneId:r,providerId:null,modelId:null,paneTitle:a}})},updateDraft(n){e(r=>r.draft?{draft:{...r.draft,...n}}:r)},clearDraft(){e({draft:null})},async materializeDraft(){const n=t().draft;return n?await t().createSession(n.deviceId,n.paneId,{providerId:n.providerId,modelId:n.modelId,originPaneTitle:n.paneTitle}):null},async stopSession(n){try{const r=await fetch(`/api/agent/sessions/${n}/stop`,{method:"POST"});if(!r.ok)throw new Error(await Er(r,"Failed to stop agent session"));const a=await r.json();if(a.session){const o=a.session;e(l=>({sessions:{...l.sessions,[n]:o}}))}}catch(r){mn.error(r instanceof Error?r.message:String(r))}},async decideConfirmation(n,r,a,o){const l=()=>{e(c=>{const f=c.pendingConfirmations[n];return f?{pendingConfirmations:{...c.pendingConfirmations,[n]:f.filter(d=>d.id!==r)}}:c})};try{const c=await fetch(`/api/agent/confirmations/${r}/decide`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o===void 0?{approved:a}:{approved:a,reason:o})});if(c.status===409){l();try{const f=await fetch(`/api/agent/sessions/${n}/confirmations`);if(f.ok){const d=await f.json();e(m=>({pendingConfirmations:{...m.pendingConfirmations,[n]:d.confirmations.map(h=>({id:h.id,toolCallId:h.toolCallId,toolName:h.toolName,input:h.input,createdAt:h.createdAt}))}}))}}catch{}return}if(!c.ok)throw new Error(await Er(c,"Failed to decide confirmation"));l()}catch(c){mn.error(c instanceof Error?c.message:String(c))}}}),{name:"tmex-agent",partialize:e=>({activeSessionId:e.activeSessionId,defaultWriteMode:e.defaultWriteMode})}));function NU(){const e=Vs.getState().settings;return(e==null?void 0:e.siteName)||"tmex"}function WT(e){const t=e==null?void 0:e.trim();return t&&t.length>0?t:"?"}function DU({paneIdx:e,windowIdx:t,paneTitle:n,windowName:r,windowCustomName:a,deviceName:o}){const l=t??"?",c=e??"?",f=WT(a??n??r),d=WT(o);return`${l}/${c}: ${f}@${d}`}function ew(e){var c,f;const t=(c=e.customName)==null?void 0:c.trim(),n=e.panes.find(d=>d.active)??e.panes[0],r=e.name.trim(),a=(f=n==null?void 0:n.title)==null?void 0:f.trim(),o=t||a||r;return{title:o,processName:!!r&&r!==o?r:void 0}}function IU(e){const{title:t,processName:n}=ew(e);return n?`${n}: ${t}`:t}function vee(e){const t=NU();return e!=null&&e.trim()?`[${t}]${e}`:t}function PU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const LU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_U={};function KT(e,t){return(_U.jsx?jU:LU).test(e)}const zU=/[ \t\n\f\r]/g;function FU(e){return typeof e=="object"?e.type==="text"?GT(e.value):!1:GT(e)}function GT(e){return e.replace(zU,"")===""}class Fd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Fd.prototype.normal={};Fd.prototype.property={};Fd.prototype.space=void 0;function qO(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Fd(n,r,t)}function Mv(e){return e.toLowerCase()}class Ur{constructor(t,n){this.attribute=n,this.property=t}}Ur.prototype.attribute="";Ur.prototype.booleanish=!1;Ur.prototype.boolean=!1;Ur.prototype.commaOrSpaceSeparated=!1;Ur.prototype.commaSeparated=!1;Ur.prototype.defined=!1;Ur.prototype.mustUseProperty=!1;Ur.prototype.number=!1;Ur.prototype.overloadedBoolean=!1;Ur.prototype.property="";Ur.prototype.spaceSeparated=!1;Ur.prototype.space=void 0;let BU=0;const At=el(),Gn=el(),Ov=el(),Ue=el(),xn=el(),zs=el(),Zr=el();function el(){return 2**++BU}const Av=Object.freeze(Object.defineProperty({__proto__:null,boolean:At,booleanish:Gn,commaOrSpaceSeparated:Zr,commaSeparated:zs,number:Ue,overloadedBoolean:Ov,spaceSeparated:xn},Symbol.toStringTag,{value:"Module"})),cb=Object.keys(Av);class tw extends Ur{constructor(t,n,r,a){let o=-1;if(super(t,n),XT(this,"space",a),typeof r=="number")for(;++o<cb.length;){const l=cb[o];XT(this,cb[o],(r&Av[l])===Av[l])}}}tw.prototype.defined=!0;function XT(e,t,n){n&&(e[t]=n)}function Oc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new tw(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Mv(r)]=r,n[Mv(o.attribute)]=r}return new Fd(t,n,e.space)}const $O=Oc({properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:Ue,ariaColIndex:Ue,ariaColSpan:Ue,ariaControls:xn,ariaCurrent:null,ariaDescribedBy:xn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:xn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:xn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xn,ariaLevel:Ue,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:xn,ariaPlaceholder:null,ariaPosInSet:Ue,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:xn,ariaRowCount:Ue,ariaRowIndex:Ue,ariaRowSpan:Ue,ariaSelected:Gn,ariaSetSize:Ue,ariaSort:null,ariaValueMax:Ue,ariaValueMin:Ue,ariaValueNow:Ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function YO(e,t){return t in e?e[t]:t}function WO(e,t){return YO(e,t.toLowerCase())}const HU=Oc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zs,acceptCharset:xn,accessKey:xn,action:null,allow:null,allowFullScreen:At,allowPaymentRequest:At,allowUserMedia:At,alpha:At,alt:null,as:null,async:At,autoCapitalize:null,autoComplete:xn,autoFocus:At,autoPlay:At,blocking:xn,capture:null,charSet:null,checked:At,cite:null,className:xn,closedBy:null,colorSpace:null,cols:Ue,colSpan:Ue,command:null,commandFor:null,content:null,contentEditable:Gn,controls:At,controlsList:xn,coords:Ue|zs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:At,defer:At,dir:null,dirName:null,disabled:At,download:Ov,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:At,formTarget:null,headers:xn,height:Ue,hidden:Ov,high:Ue,href:null,hrefLang:null,htmlFor:xn,httpEquiv:xn,id:null,imageSizes:null,imageSrcSet:null,inert:At,inputMode:null,integrity:null,is:null,isMap:At,itemId:null,itemProp:xn,itemRef:xn,itemScope:At,itemType:xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:At,low:Ue,manifest:null,max:null,maxLength:Ue,media:null,method:null,min:null,minLength:Ue,multiple:At,muted:At,name:null,nonce:null,noModule:At,noValidate:At,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:At,optimum:Ue,pattern:null,ping:xn,placeholder:null,playsInline:At,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:At,referrerPolicy:null,rel:xn,required:At,reversed:At,rows:Ue,rowSpan:Ue,sandbox:xn,scope:null,scoped:At,seamless:At,selected:At,shadowRootClonable:At,shadowRootCustomElementRegistry:At,shadowRootDelegatesFocus:At,shadowRootMode:null,shadowRootSerializable:At,shape:null,size:Ue,sizes:null,slot:null,span:Ue,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ue,step:null,style:null,tabIndex:Ue,target:null,title:null,translate:null,type:null,typeMustMatch:At,useMap:null,value:Gn,width:Ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xn,axis:null,background:null,bgColor:null,border:Ue,borderColor:null,bottomMargin:Ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:At,declare:At,event:null,face:null,frame:null,frameBorder:null,hSpace:Ue,leftMargin:Ue,link:null,longDesc:null,lowSrc:null,marginHeight:Ue,marginWidth:Ue,noResize:At,noHref:At,noShade:At,noWrap:At,object:null,profile:null,prompt:null,rev:null,rightMargin:Ue,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:Ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ue,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:At,disablePictureInPicture:At,disableRemotePlayback:At,exportParts:zs,part:xn,prefix:null,property:null,results:Ue,security:null,unselectable:null},space:"html",transform:WO}),UU=Oc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Zr,accentHeight:Ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ue,amplitude:Ue,arabicForm:null,ascent:Ue,attributeName:null,attributeType:null,azimuth:Ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ue,by:null,calcMode:null,capHeight:Ue,className:xn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ue,diffuseConstant:Ue,direction:null,display:null,dur:null,divisor:Ue,dominantBaseline:null,download:At,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ue,enableBackground:null,end:null,event:null,exponent:Ue,externalResourcesRequired:null,fill:null,fillOpacity:Ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:zs,g2:zs,glyphName:zs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ue,horizOriginX:Ue,horizOriginY:Ue,id:null,ideographic:Ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ue,k:Ue,k1:Ue,k2:Ue,k3:Ue,k4:Ue,kernelMatrix:Zr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ue,overlineThickness:Ue,paintOrder:null,panose1:null,path:null,pathLength:Ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ue,pointsAtY:Ue,pointsAtZ:Ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zr,rev:Zr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zr,requiredFeatures:Zr,requiredFonts:Zr,requiredFormats:Zr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ue,specularExponent:Ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ue,strikethroughThickness:Ue,string:null,stroke:null,strokeDashArray:Zr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ue,strokeOpacity:Ue,strokeWidth:null,style:null,surfaceScale:Ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zr,tabIndex:Ue,tableValues:null,target:null,targetX:Ue,targetY:Ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ue,underlineThickness:Ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ue,values:null,vAlphabetic:Ue,vMathematical:Ue,vectorEffect:null,vHanging:Ue,vIdeographic:Ue,version:null,vertAdvY:Ue,vertOriginX:Ue,vertOriginY:Ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:YO}),KO=Oc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),GO=Oc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:WO}),XO=Oc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),VU={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},qU=/[A-Z]/g,QT=/-[a-z]/g,$U=/^data[-\w.:]+$/i;function YU(e,t){const n=Mv(t);let r=t,a=Ur;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$U.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(QT,KU);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!QT.test(o)){let l=o.replace(qU,WU);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=tw}return new a(r,t)}function WU(e){return"-"+e.toLowerCase()}function KU(e){return e.charAt(1).toUpperCase()}const GU=qO([$O,HU,KO,GO,XO],"html"),nw=qO([$O,UU,KO,GO,XO],"svg");function XU(e){return e.join(" ").trim()}var jl={},ub,ZT;function QU(){if(ZT)return ub;ZT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
343
- `,d="/",m="*",h="",y="comment",g="declaration";function w(T,S){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];S=S||{};var R=1,k=1;function M($){var B=$.match(t);B&&(R+=B.length);var _=$.lastIndexOf(f);k=~_?$.length-_:k+$.length}function D(){var $={line:R,column:k};return function(B){return B.position=new O($),H(),B}}function O($){this.start=$,this.end={line:R,column:k},this.source=S.source}O.prototype.content=T;function A($){var B=new Error(S.source+":"+R+":"+k+": "+$);if(B.reason=$,B.filename=S.source,B.line=R,B.column=k,B.source=T,!S.silent)throw B}function L($){var B=$.exec(T);if(B){var _=B[0];return M(_),T=T.slice(_.length),B}}function H(){L(n)}function F($){var B;for($=$||[];B=W();)B!==!1&&$.push(B);return $}function W(){var $=D();if(!(d!=T.charAt(0)||m!=T.charAt(1))){for(var B=2;h!=T.charAt(B)&&(m!=T.charAt(B)||d!=T.charAt(B+1));)++B;if(B+=2,h===T.charAt(B-1))return A("End of comment missing");var _=T.slice(2,B-2);return k+=2,M(_),T=T.slice(B),k+=2,$({type:y,comment:_})}}function j(){var $=D(),B=L(r);if(B){if(W(),!L(a))return A("property missing ':'");var _=L(o),z=$({type:g,property:C(B[0].replace(e,h)),value:_?C(_[0].replace(e,h)):h});return L(l),z}}function q(){var $=[];F($);for(var B;B=j();)B!==!1&&($.push(B),F($));return $}return H(),q()}function C(T){return T?T.replace(c,h):h}return ub=w,ub}var JT;function ZU(){if(JT)return jl;JT=1;var e=jl&&jl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(jl,"__esModule",{value:!0}),jl.default=n;const t=e(QU());function n(r,a){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),c=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:d,value:m}=f;c?a(d,m,f):m&&(o=o||{},o[d]=m)}),o}return jl}var _u={},eR;function JU(){if(eR)return _u;eR=1,Object.defineProperty(_u,"__esModule",{value:!0}),_u.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},l=function(d,m){return m.toUpperCase()},c=function(d,m){return"".concat(m,"-")},f=function(d,m){return m===void 0&&(m={}),o(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(a,c):d=d.replace(r,c),d.replace(t,l))};return _u.camelCase=f,_u}var zu,tR;function e6(){if(tR)return zu;tR=1;var e=zu&&zu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(ZU()),n=JU();function r(a,o){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(c,f){c&&f&&(l[(0,n.camelCase)(c,o)]=f)}),l}return r.default=r,zu=r,zu}var t6=e6();const n6=Fp(t6),QO=ZO("end"),rw=ZO("start");function ZO(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function r6(e){const t=rw(e),n=QO(e);if(t&&n)return{start:t,end:n}}function rd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nR(e.position):"start"in e||"end"in e?nR(e):"line"in e||"column"in e?Nv(e):""}function Nv(e){return rR(e&&e.line)+":"+rR(e&&e.column)}function nR(e){return Nv(e&&e.start)+"-"+Nv(e&&e.end)}function rR(e){return e&&typeof e=="number"?e:1}class wr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(l=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=c?c.line:void 0,this.name=rd(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wr.prototype.file="";wr.prototype.name="";wr.prototype.reason="";wr.prototype.message="";wr.prototype.stack="";wr.prototype.column=void 0;wr.prototype.line=void 0;wr.prototype.ancestors=void 0;wr.prototype.cause=void 0;wr.prototype.fatal=void 0;wr.prototype.place=void 0;wr.prototype.ruleId=void 0;wr.prototype.source=void 0;const iw={}.hasOwnProperty,i6=new Map,a6=/[A-Z]/g,o6=new Set(["table","tbody","thead","tfoot","tr"]),s6=new Set(["td","th"]),JO="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function l6(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=g6(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=m6(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?nw:GU,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=eA(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function eA(e,t,n){if(t.type==="element")return c6(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return u6(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return f6(e,t,n);if(t.type==="mdxjsEsm")return d6(e,t);if(t.type==="root")return h6(e,t,n);if(t.type==="text")return p6(e,t)}function c6(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=nw,e.schema=a),e.ancestors.push(t);const o=nA(e,t.tagName,!1),l=y6(e,t);let c=ow(e,t);return o6.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!FU(f):!0})),tA(e,l,o,t),aw(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function u6(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}xd(e,t.position)}function d6(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xd(e,t.position)}function f6(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=nw,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:nA(e,t.name,!0),l=b6(e,t),c=ow(e,t);return tA(e,l,o,t),aw(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function h6(e,t,n){const r={};return aw(r,ow(e,t)),e.create(t,e.Fragment,r,n)}function p6(e,t){return t.value}function tA(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function aw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function m6(e,t,n){return r;function r(a,o,l,c){const d=Array.isArray(l.children)?n:t;return c?d(o,l,c):d(o,l)}}function g6(e,t){return n;function n(r,a,o,l){const c=Array.isArray(o.children),f=rw(r);return t(a,o,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function y6(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&iw.call(t.properties,a)){const o=v6(e,a,t.properties[a]);if(o){const[l,c]=o;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&s6.has(t.tagName)?r=c:n[l]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function b6(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else xd(e,t.position);else{const a=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else xd(e,t.position);else o=r.value===null?!0:r.value;n[a]=o}return n}function ow(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:i6;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const d=a.get(f)||0;l=f+"-"+d,a.set(f,d+1)}}const c=eA(e,o,l);c!==void 0&&n.push(c)}return n}function v6(e,t,n){const r=YU(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?PU(n):XU(n)),r.property==="style"){let a=typeof n=="object"?n:x6(e,String(n));return e.stylePropertyNameCase==="css"&&(a=w6(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?VU[r.property]||r.property:r.attribute,n]}}function x6(e,t){try{return n6(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new wr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=JO+"#cannot-parse-style-attribute",a}}function nA(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let o=-1,l;for(;++o<a.length;){const c=KT(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=l}else r=KT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return iw.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);xd(e)}function xd(e,t){const n=new wr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=JO+"#cannot-handle-mdx-estrees-without-createevaluater",n}function w6(e){const t={};let n;for(n in e)iw.call(e,n)&&(t[S6(n)]=e[n]);return t}function S6(e){let t=e.replace(a6,E6);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function E6(e){return"-"+e.toLowerCase()}const db={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},C6={};function sw(e,t){const n=C6,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return rA(e,r,a)}function rA(e,t,n){if(T6(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return iR(e.children,t,n)}return Array.isArray(e)?iR(e,t,n):""}function iR(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=rA(e[a],t,n);return r.join("")}function T6(e){return!!(e&&typeof e=="object")}const aR=document.createElement("i");function lw(e){const t="&"+e+";";aR.innerHTML=t;const n=aR.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ri(e,t,n,r){const a=e.length;let o=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function vi(e,t){return e.length>0?(ri(e,e.length,0,t),e):t}const oR={}.hasOwnProperty;function iA(e){const t={};let n=-1;for(;++n<e.length;)R6(t,e[n]);return t}function R6(e,t){let n;for(n in t){const a=(oR.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){oR.call(a,l)||(a[l]=[]);const c=o[l];k6(a[l],Array.isArray(c)?c:c?[c]:[])}}}function k6(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ri(e,0,0,r)}function aA(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ji(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kr=Go(/[A-Za-z]/),xr=Go(/[\dA-Za-z]/),M6=Go(/[#-'*+\--9=?A-Z^-~]/);function mp(e){return e!==null&&(e<32||e===127)}const Dv=Go(/\d/),O6=Go(/[\dA-Fa-f]/),A6=Go(/[!-/:-@[-`{-~]/);function bt(e){return e!==null&&e<-2}function wn(e){return e!==null&&(e<0||e===32)}function Kt(e){return e===-2||e===-1||e===32}const rm=Go(new RegExp("\\p{P}|\\p{S}","u")),Ys=Go(/\s/);function Go(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ac(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&xr(e.charCodeAt(n+1))&&xr(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(l=String.fromCharCode(o,c),a=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function an(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(f){return Kt(f)?(e.enter(n),c(f)):t(f)}function c(f){return Kt(f)&&o++<a?(e.consume(f),c):(e.exit(n),t(f))}}const N6={tokenize:D6};function D6(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),an(e,t,"linePrefix")}function a(c){return e.enter("paragraph"),o(c)}function o(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return bt(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),l)}}const I6={tokenize:P6},sR={tokenize:L6};function P6(e){const t=this,n=[];let r=0,a,o,l;return c;function c(k){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,f,d)(k)}return d(k)}function f(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&R();const M=t.events.length;let D=M,O;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){O=t.events[D][1].end;break}S(r);let A=M;for(;A<t.events.length;)t.events[A][1].end={...O},A++;return ri(t.events,D+1,0,t.events.slice(M)),t.events.length=A,d(k)}return c(k)}function d(k){if(r===n.length){if(!a)return y(k);if(a.currentConstruct&&a.currentConstruct.concrete)return w(k);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(sR,m,h)(k)}function m(k){return a&&R(),S(r),y(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(k)}function y(k){return t.containerState={},e.attempt(sR,g,w)(k)}function g(k){return r++,n.push([t.currentConstruct,t.containerState]),y(k)}function w(k){if(k===null){a&&R(),S(0),e.consume(k);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),C(k)}function C(k){if(k===null){T(e.exit("chunkFlow"),!0),S(0),e.consume(k);return}return bt(k)?(e.consume(k),T(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(k),C)}function T(k,M){const D=t.sliceStream(k);if(M&&D.push(null),k.previous=o,o&&(o.next=k),o=k,a.defineSkip(k.start),a.write(D),t.parser.lazy[k.start.line]){let O=a.events.length;for(;O--;)if(a.events[O][1].start.offset<l&&(!a.events[O][1].end||a.events[O][1].end.offset>l))return;const A=t.events.length;let L=A,H,F;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(H){F=t.events[L][1].end;break}H=!0}for(S(r),O=A;O<t.events.length;)t.events[O][1].end={...F},O++;ri(t.events,L+1,0,t.events.slice(A)),t.events.length=O}}function S(k){let M=n.length;for(;M-- >k;){const D=n[M];t.containerState=D[1],D[0].exit.call(t,e)}n.length=k}function R(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function L6(e,t,n){return an(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function yc(e){if(e===null||wn(e)||Ys(e))return 1;if(rm(e))return 2}function im(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const o=e[a].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Iv={name:"attention",resolveAll:j6,tokenize:_6};function j6(e,t){let n=-1,r,a,o,l,c,f,d,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},y={...e[n][1].start};lR(h,-f),lR(y,f),l={type:f>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=vi(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=vi(d,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",o,t]]),d=vi(d,im(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=vi(d,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=vi(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,ri(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function _6(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=yc(r);let o;return l;function l(f){return o=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===o)return e.consume(f),c;const d=e.exit("attentionSequence"),m=yc(f),h=!m||m===2&&a||n.includes(f),y=!a||a===2&&m||n.includes(r);return d._open=!!(o===42?h:h&&(a||!y)),d._close=!!(o===42?y:y&&(m||!h)),t(f)}}function lR(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const z6={name:"autolink",tokenize:F6};function F6(e,t,n){let r=0;return a;function a(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(g){return kr(g)?(e.consume(g),l):g===64?n(g):d(g)}function l(g){return g===43||g===45||g===46||xr(g)?(r=1,c(g)):d(g)}function c(g){return g===58?(e.consume(g),r=0,f):(g===43||g===45||g===46||xr(g))&&r++<32?(e.consume(g),c):(r=0,d(g))}function f(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||mp(g)?n(g):(e.consume(g),f)}function d(g){return g===64?(e.consume(g),m):M6(g)?(e.consume(g),d):n(g)}function m(g){return xr(g)?h(g):n(g)}function h(g){return g===46?(e.consume(g),r=0,m):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):y(g)}function y(g){if((g===45||xr(g))&&r++<63){const w=g===45?y:h;return e.consume(g),w}return n(g)}}const Bd={partial:!0,tokenize:B6};function B6(e,t,n){return r;function r(o){return Kt(o)?an(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||bt(o)?t(o):n(o)}}const oA={continuation:{tokenize:U6},exit:V6,name:"blockQuote",tokenize:H6};function H6(e,t,n){const r=this;return a;function a(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return Kt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function U6(e,t,n){const r=this;return a;function a(l){return Kt(l)?an(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(oA,t,n)(l)}}function V6(e){e.exit("blockQuote")}const sA={name:"characterEscape",tokenize:q6};function q6(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return A6(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const lA={name:"characterReference",tokenize:$6};function $6(e,t,n){const r=this;let a=0,o,l;return c;function c(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),f}function f(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,l=xr,m(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=O6,m):(e.enter("characterReferenceValue"),o=7,l=Dv,m(h))}function m(h){if(h===59&&a){const y=e.exit("characterReferenceValue");return l===xr&&!lw(r.sliceSerialize(y))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(h)&&a++<o?(e.consume(h),m):n(h)}}const cR={partial:!0,tokenize:W6},uR={concrete:!0,name:"codeFenced",tokenize:Y6};function Y6(e,t,n){const r=this,a={partial:!0,tokenize:D};let o=0,l=0,c;return f;function f(O){return d(O)}function d(O){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,c=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(O)}function m(O){return O===c?(l++,e.consume(O),m):l<3?n(O):(e.exit("codeFencedFenceSequence"),Kt(O)?an(e,h,"whitespace")(O):h(O))}function h(O){return O===null||bt(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(cR,C,M)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(O))}function y(O){return O===null||bt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(O)):Kt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),an(e,g,"whitespace")(O)):O===96&&O===c?n(O):(e.consume(O),y)}function g(O){return O===null||bt(O)?h(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(O))}function w(O){return O===null||bt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(O)):O===96&&O===c?n(O):(e.consume(O),w)}function C(O){return e.attempt(a,M,T)(O)}function T(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),S}function S(O){return o>0&&Kt(O)?an(e,R,"linePrefix",o+1)(O):R(O)}function R(O){return O===null||bt(O)?e.check(cR,C,M)(O):(e.enter("codeFlowValue"),k(O))}function k(O){return O===null||bt(O)?(e.exit("codeFlowValue"),R(O)):(e.consume(O),k)}function M(O){return e.exit("codeFenced"),t(O)}function D(O,A,L){let H=0;return F;function F(B){return O.enter("lineEnding"),O.consume(B),O.exit("lineEnding"),W}function W(B){return O.enter("codeFencedFence"),Kt(B)?an(O,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):j(B)}function j(B){return B===c?(O.enter("codeFencedFenceSequence"),q(B)):L(B)}function q(B){return B===c?(H++,O.consume(B),q):H>=l?(O.exit("codeFencedFenceSequence"),Kt(B)?an(O,$,"whitespace")(B):$(B)):L(B)}function $(B){return B===null||bt(B)?(O.exit("codeFencedFence"),A(B)):L(B)}}}function W6(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const fb={name:"codeIndented",tokenize:G6},K6={partial:!0,tokenize:X6};function G6(e,t,n){const r=this;return a;function a(d){return e.enter("codeIndented"),an(e,o,"linePrefix",5)(d)}function o(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):bt(d)?e.attempt(K6,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||bt(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function X6(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):bt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):an(e,o,"linePrefix",5)(l)}function o(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):bt(l)?a(l):n(l)}}const Q6={name:"codeText",previous:J6,resolve:Z6,tokenize:e8};function Z6(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function J6(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function e8(e,t,n){let r=0,a,o;return l;function l(h){return e.enter("codeText"),e.enter("codeTextSequence"),c(h)}function c(h){return h===96?(e.consume(h),r++,c):(e.exit("codeTextSequence"),f(h))}function f(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),f):h===96?(o=e.enter("codeTextSequence"),a=0,m(h)):bt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||bt(h)?(e.exit("codeTextData"),f(h)):(e.consume(h),d)}function m(h){return h===96?(e.consume(h),a++,m):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",d(h))}}class t8{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Fu(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Fu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Fu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Fu(this.left,n.reverse())}}}function Fu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function cA(e){const t={};let n=-1,r,a,o,l,c,f,d;const m=new t8(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,n8(m,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,a=void 0;o--;)if(l=m.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(m.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...m.get(a)[1].start},c=m.slice(a,n),c.unshift(r),m.splice(a,n-a+1,c))}}return ri(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function n8(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],d={};let m,h,y=-1,g=n,w=0,C=0;const T=[C];for(;g;){for(;e.get(++a)[1]!==g;);o.push(a),g._tokenizer||(m=r.sliceStream(g),g.next||m.push(null),h&&l.defineSkip(g.start),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),h=g,g=g.next}for(g=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(C=y+1,T.push(C),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(l.events=[],g?(g._tokenizer=void 0,g.previous=void 0):T.pop(),y=T.length;y--;){const S=c.slice(T[y],T[y+1]),R=o.pop();f.push([R,R+S.length-1]),e.splice(R,2,S)}for(f.reverse(),y=-1;++y<f.length;)d[w+f[y][0]]=w+f[y][1],w+=f[y][1]-f[y][0]-1;return d}const r8={resolve:a8,tokenize:o8},i8={partial:!0,tokenize:s8};function a8(e){return cA(e),e}function o8(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(c)}function a(c){return c===null?o(c):bt(c)?e.check(i8,l,o)(c):(e.consume(c),a)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function s8(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),an(e,o,"linePrefix")}function o(l){if(l===null||bt(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function uA(e,t,n,r,a,o,l,c,f){const d=f||Number.POSITIVE_INFINITY;let m=0;return h;function h(S){return S===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(S),e.exit(o),y):S===null||S===32||S===41||mp(S)?n(S):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),C(S))}function y(S){return S===62?(e.enter(o),e.consume(S),e.exit(o),e.exit(a),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===62?(e.exit("chunkString"),e.exit(c),y(S)):S===null||S===60||bt(S)?n(S):(e.consume(S),S===92?w:g)}function w(S){return S===60||S===62||S===92?(e.consume(S),g):g(S)}function C(S){return!m&&(S===null||S===41||wn(S))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(S)):m<d&&S===40?(e.consume(S),m++,C):S===41?(e.consume(S),m--,C):S===null||S===32||S===40||mp(S)?n(S):(e.consume(S),S===92?T:C)}function T(S){return S===40||S===41||S===92?(e.consume(S),C):C(S)}}function dA(e,t,n,r,a,o){const l=this;let c=0,f;return d;function d(g){return e.enter(r),e.enter(a),e.consume(g),e.exit(a),e.enter(o),m}function m(g){return c>999||g===null||g===91||g===93&&!f||g===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(g):g===93?(e.exit(o),e.enter(a),e.consume(g),e.exit(a),e.exit(r),t):bt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===null||g===91||g===93||bt(g)||c++>999?(e.exit("chunkString"),m(g)):(e.consume(g),f||(f=!Kt(g)),g===92?y:h)}function y(g){return g===91||g===92||g===93?(e.consume(g),c++,h):h(g)}}function fA(e,t,n,r,a,o){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(a),e.consume(y),e.exit(a),l=y===40?41:y,f):n(y)}function f(y){return y===l?(e.enter(a),e.consume(y),e.exit(a),e.exit(r),t):(e.enter(o),d(y))}function d(y){return y===l?(e.exit(o),f(l)):y===null?n(y):bt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),an(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===l||y===null||bt(y)?(e.exit("chunkString"),d(y)):(e.consume(y),y===92?h:m)}function h(y){return y===l||y===92?(e.consume(y),m):m(y)}}function id(e,t){let n;return r;function r(a){return bt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Kt(a)?an(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const l8={name:"definition",tokenize:u8},c8={partial:!0,tokenize:d8};function u8(e,t,n){const r=this;let a;return o;function o(g){return e.enter("definition"),l(g)}function l(g){return dA.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function c(g){return a=ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return wn(g)?id(e,d)(g):d(g)}function d(g){return uA(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function m(g){return e.attempt(c8,h,h)(g)}function h(g){return Kt(g)?an(e,y,"whitespace")(g):y(g)}function y(g){return g===null||bt(g)?(e.exit("definition"),r.parser.defined.push(a),t(g)):n(g)}}function d8(e,t,n){return r;function r(c){return wn(c)?id(e,a)(c):n(c)}function a(c){return fA(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Kt(c)?an(e,l,"whitespace")(c):l(c)}function l(c){return c===null||bt(c)?t(c):n(c)}}const f8={name:"hardBreakEscape",tokenize:h8};function h8(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return bt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const p8={name:"headingAtx",resolve:m8,tokenize:g8};function m8(e,t){let n=e.length-2,r=3,a,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ri(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function g8(e,t,n){let r=0;return a;function a(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||wn(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),f(m)):m===null||bt(m)?(e.exit("atxHeading"),t(m)):Kt(m)?an(e,c,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function f(m){return m===35?(e.consume(m),f):(e.exit("atxHeadingSequence"),c(m))}function d(m){return m===null||m===35||wn(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),d)}}const y8=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],dR=["pre","script","style","textarea"],b8={concrete:!0,name:"htmlFlow",resolveTo:w8,tokenize:S8},v8={partial:!0,tokenize:C8},x8={partial:!0,tokenize:E8};function w8(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function S8(e,t,n){const r=this;let a,o,l,c,f;return d;function d(I){return m(I)}function m(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),h}function h(I){return I===33?(e.consume(I),y):I===47?(e.consume(I),o=!0,C):I===63?(e.consume(I),a=3,r.interrupt?t:P):kr(I)?(e.consume(I),l=String.fromCharCode(I),T):n(I)}function y(I){return I===45?(e.consume(I),a=2,g):I===91?(e.consume(I),a=5,c=0,w):kr(I)?(e.consume(I),a=4,r.interrupt?t:P):n(I)}function g(I){return I===45?(e.consume(I),r.interrupt?t:P):n(I)}function w(I){const Q="CDATA[";return I===Q.charCodeAt(c++)?(e.consume(I),c===Q.length?r.interrupt?t:j:w):n(I)}function C(I){return kr(I)?(e.consume(I),l=String.fromCharCode(I),T):n(I)}function T(I){if(I===null||I===47||I===62||wn(I)){const Q=I===47,Z=l.toLowerCase();return!Q&&!o&&dR.includes(Z)?(a=1,r.interrupt?t(I):j(I)):y8.includes(l.toLowerCase())?(a=6,Q?(e.consume(I),S):r.interrupt?t(I):j(I)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):o?R(I):k(I))}return I===45||xr(I)?(e.consume(I),l+=String.fromCharCode(I),T):n(I)}function S(I){return I===62?(e.consume(I),r.interrupt?t:j):n(I)}function R(I){return Kt(I)?(e.consume(I),R):F(I)}function k(I){return I===47?(e.consume(I),F):I===58||I===95||kr(I)?(e.consume(I),M):Kt(I)?(e.consume(I),k):F(I)}function M(I){return I===45||I===46||I===58||I===95||xr(I)?(e.consume(I),M):D(I)}function D(I){return I===61?(e.consume(I),O):Kt(I)?(e.consume(I),D):k(I)}function O(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),f=I,A):Kt(I)?(e.consume(I),O):L(I)}function A(I){return I===f?(e.consume(I),f=null,H):I===null||bt(I)?n(I):(e.consume(I),A)}function L(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||wn(I)?D(I):(e.consume(I),L)}function H(I){return I===47||I===62||Kt(I)?k(I):n(I)}function F(I){return I===62?(e.consume(I),W):n(I)}function W(I){return I===null||bt(I)?j(I):Kt(I)?(e.consume(I),W):n(I)}function j(I){return I===45&&a===2?(e.consume(I),_):I===60&&a===1?(e.consume(I),z):I===62&&a===4?(e.consume(I),V):I===63&&a===3?(e.consume(I),P):I===93&&a===5?(e.consume(I),K):bt(I)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(v8,G,q)(I)):I===null||bt(I)?(e.exit("htmlFlowData"),q(I)):(e.consume(I),j)}function q(I){return e.check(x8,$,G)(I)}function $(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),B}function B(I){return I===null||bt(I)?q(I):(e.enter("htmlFlowData"),j(I))}function _(I){return I===45?(e.consume(I),P):j(I)}function z(I){return I===47?(e.consume(I),l="",U):j(I)}function U(I){if(I===62){const Q=l.toLowerCase();return dR.includes(Q)?(e.consume(I),V):j(I)}return kr(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),U):j(I)}function K(I){return I===93?(e.consume(I),P):j(I)}function P(I){return I===62?(e.consume(I),V):I===45&&a===2?(e.consume(I),P):j(I)}function V(I){return I===null||bt(I)?(e.exit("htmlFlowData"),G(I)):(e.consume(I),V)}function G(I){return e.exit("htmlFlow"),t(I)}}function E8(e,t,n){const r=this;return a;function a(l){return bt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function C8(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Bd,t,n)}}const T8={name:"htmlText",tokenize:R8};function R8(e,t,n){const r=this;let a,o,l;return c;function c(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),d):P===47?(e.consume(P),D):P===63?(e.consume(P),k):kr(P)?(e.consume(P),L):n(P)}function d(P){return P===45?(e.consume(P),m):P===91?(e.consume(P),o=0,w):kr(P)?(e.consume(P),R):n(P)}function m(P){return P===45?(e.consume(P),g):n(P)}function h(P){return P===null?n(P):P===45?(e.consume(P),y):bt(P)?(l=h,z(P)):(e.consume(P),h)}function y(P){return P===45?(e.consume(P),g):h(P)}function g(P){return P===62?_(P):P===45?y(P):h(P)}function w(P){const V="CDATA[";return P===V.charCodeAt(o++)?(e.consume(P),o===V.length?C:w):n(P)}function C(P){return P===null?n(P):P===93?(e.consume(P),T):bt(P)?(l=C,z(P)):(e.consume(P),C)}function T(P){return P===93?(e.consume(P),S):C(P)}function S(P){return P===62?_(P):P===93?(e.consume(P),S):C(P)}function R(P){return P===null||P===62?_(P):bt(P)?(l=R,z(P)):(e.consume(P),R)}function k(P){return P===null?n(P):P===63?(e.consume(P),M):bt(P)?(l=k,z(P)):(e.consume(P),k)}function M(P){return P===62?_(P):k(P)}function D(P){return kr(P)?(e.consume(P),O):n(P)}function O(P){return P===45||xr(P)?(e.consume(P),O):A(P)}function A(P){return bt(P)?(l=A,z(P)):Kt(P)?(e.consume(P),A):_(P)}function L(P){return P===45||xr(P)?(e.consume(P),L):P===47||P===62||wn(P)?H(P):n(P)}function H(P){return P===47?(e.consume(P),_):P===58||P===95||kr(P)?(e.consume(P),F):bt(P)?(l=H,z(P)):Kt(P)?(e.consume(P),H):_(P)}function F(P){return P===45||P===46||P===58||P===95||xr(P)?(e.consume(P),F):W(P)}function W(P){return P===61?(e.consume(P),j):bt(P)?(l=W,z(P)):Kt(P)?(e.consume(P),W):H(P)}function j(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),a=P,q):bt(P)?(l=j,z(P)):Kt(P)?(e.consume(P),j):(e.consume(P),$)}function q(P){return P===a?(e.consume(P),a=void 0,B):P===null?n(P):bt(P)?(l=q,z(P)):(e.consume(P),q)}function $(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||wn(P)?H(P):(e.consume(P),$)}function B(P){return P===47||P===62||wn(P)?H(P):n(P)}function _(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function z(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),U}function U(P){return Kt(P)?an(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):K(P)}function K(P){return e.enter("htmlTextData"),l(P)}}const cw={name:"labelEnd",resolveAll:A8,resolveTo:N8,tokenize:D8},k8={tokenize:I8},M8={tokenize:P8},O8={tokenize:L8};function A8(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&ri(e,0,e.length,n),e}function N8(e,t){let n=e.length,r=0,a,o,l,c;for(;n--;)if(a=e[n][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=vi(c,e.slice(o+1,o+r+3)),c=vi(c,[["enter",m,t]]),c=vi(c,im(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),c=vi(c,[["exit",m,t],e[l-2],e[l-1],["exit",d,t]]),c=vi(c,e.slice(l+1)),c=vi(c,[["exit",f,t]]),ri(e,o,e.length,c),e}function D8(e,t,n){const r=this;let a=r.events.length,o,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){o=r.events[a][1];break}return c;function c(y){return o?o._inactive?h(y):(l=r.parser.defined.includes(ji(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(k8,m,l?m:h)(y):y===91?e.attempt(M8,m,l?d:h)(y):l?m(y):h(y)}function d(y){return e.attempt(O8,m,h)(y)}function m(y){return t(y)}function h(y){return o._balanced=!0,n(y)}}function I8(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),a}function a(h){return wn(h)?id(e,o)(h):o(h)}function o(h){return h===41?m(h):uA(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return wn(h)?id(e,f)(h):m(h)}function c(h){return n(h)}function f(h){return h===34||h===39||h===40?fA(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function d(h){return wn(h)?id(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function P8(e,t,n){const r=this;return a;function a(c){return dA.call(r,e,o,l,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function L8(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const j8={name:"labelStartImage",resolveAll:cw.resolveAll,tokenize:_8};function _8(e,t,n){const r=this;return a;function a(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const z8={name:"labelStartLink",resolveAll:cw.resolveAll,tokenize:F8};function F8(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const hb={name:"lineEnding",tokenize:B8};function B8(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),an(e,t,"linePrefix")}}const Zh={name:"thematicBreak",tokenize:H8};function H8(e,t,n){let r=0,a;return o;function o(d){return e.enter("thematicBreak"),l(d)}function l(d){return a=d,c(d)}function c(d){return d===a?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||bt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===a?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),Kt(d)?an(e,c,"whitespace")(d):c(d))}}const jr={continuation:{tokenize:$8},exit:W8,name:"list",tokenize:q8},U8={partial:!0,tokenize:K8},V8={partial:!0,tokenize:Y8};function q8(e,t,n){const r=this,a=r.events[r.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return c;function c(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:Dv(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Zh,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return Dv(g)&&++l<10?(e.consume(g),f):(!r.interrupt||l<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(Bd,r.interrupt?n:m,e.attempt(U8,y,h))}function m(g){return r.containerState.initialBlankLine=!0,o++,y(g)}function h(g){return Kt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),y):n(g)}function y(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function $8(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bd,a,o);function a(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,an(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!Kt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(V8,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,an(e,e.attempt(jr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function Y8(e,t,n){const r=this;return an(e,a,"listItemIndent",r.containerState.size+1);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function W8(e){e.exit(this.containerState.type)}function K8(e,t,n){const r=this;return an(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const l=r.events[r.events.length-1];return!Kt(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const fR={name:"setextUnderline",resolveTo:G8,tokenize:X8};function G8(e,t){let n=e.length,r,a,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function X8(e,t,n){const r=this;let a;return o;function o(d){let m=r.events.length,h;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){h=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),a=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===a?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),Kt(d)?an(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||bt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const Q8={tokenize:Z8};function Z8(e){const t=this,n=e.attempt(Bd,r,e.attempt(this.parser.constructs.flowInitial,a,an(e,e.attempt(this.parser.constructs.flow,a,e.attempt(r8,a)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const J8={resolveAll:pA()},e9=hA("string"),t9=hA("text");function hA(e){return{resolveAll:pA(e==="text"?n9:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],o=n.attempt(a,l,c);return l;function l(m){return d(m)?o(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return d(m)?(n.exit("data"),o(m)):(n.consume(m),f)}function d(m){if(m===null)return!0;const h=a[m];let y=-1;if(h)for(;++y<h.length;){const g=h[y];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function pA(e){return t;function t(n,r){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(n,r):n}}function n9(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let o=a.length,l=-1,c=0,f;for(;o--;){const d=a[o];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)f=!0,c++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const r9={42:jr,43:jr,45:jr,48:jr,49:jr,50:jr,51:jr,52:jr,53:jr,54:jr,55:jr,56:jr,57:jr,62:oA},i9={91:l8},a9={[-2]:fb,[-1]:fb,32:fb},o9={35:p8,42:Zh,45:[fR,Zh],60:b8,61:fR,95:Zh,96:uR,126:uR},s9={38:lA,92:sA},l9={[-5]:hb,[-4]:hb,[-3]:hb,33:j8,38:lA,42:Iv,60:[z6,T8],91:z8,92:[f8,sA],93:cw,95:Iv,96:Q6},c9={null:[Iv,J8]},u9={null:[42,95]},d9={null:[]},f9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:u9,contentInitial:i9,disable:d9,document:r9,flow:o9,flowInitial:a9,insideSpan:c9,string:s9,text:l9},Symbol.toStringTag,{value:"Module"}));function h9(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},o=[];let l=[],c=[];const f={attempt:A(D),check:A(O),consume:R,enter:k,exit:M,interrupt:A(O,{interrupt:!0})},d={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:g,write:h};let m=t.tokenize.call(d,f);return t.resolveAll&&o.push(t),d;function h(W){return l=vi(l,W),T(),l[l.length-1]!==null?[]:(L(t,0),d.events=im(o,d.events,d),d.events)}function y(W,j){return m9(g(W),j)}function g(W){return p9(l,W)}function w(){const{_bufferIndex:W,_index:j,line:q,column:$,offset:B}=r;return{_bufferIndex:W,_index:j,line:q,column:$,offset:B}}function C(W){a[W.line]=W.column,F()}function T(){let W;for(;r._index<l.length;){const j=l[r._index];if(typeof j=="string")for(W=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===W&&r._bufferIndex<j.length;)S(j.charCodeAt(r._bufferIndex));else S(j)}}function S(W){m=m(W)}function R(W){bt(W)?(r.line++,r.column=1,r.offset+=W===-3?2:1,F()):W!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=W}function k(W,j){const q=j||{};return q.type=W,q.start=w(),d.events.push(["enter",q,d]),c.push(q),q}function M(W){const j=c.pop();return j.end=w(),d.events.push(["exit",j,d]),j}function D(W,j){L(W,j.from)}function O(W,j){j.restore()}function A(W,j){return q;function q($,B,_){let z,U,K,P;return Array.isArray($)?G($):"tokenize"in $?G([$]):V($);function V(te){return le;function le(pe){const we=pe!==null&&te[pe],Me=pe!==null&&te.null,Pe=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(Me)?Me:Me?[Me]:[]];return G(Pe)(pe)}}function G(te){return z=te,U=0,te.length===0?_:I(te[U])}function I(te){return le;function le(pe){return P=H(),K=te,te.partial||(d.currentConstruct=te),te.name&&d.parser.constructs.disable.null.includes(te.name)?Z():te.tokenize.call(j?Object.assign(Object.create(d),j):d,f,Q,Z)(pe)}}function Q(te){return W(K,P),B}function Z(te){return P.restore(),++U<z.length?I(z[U]):_}}}function L(W,j){W.resolveAll&&!o.includes(W)&&o.push(W),W.resolve&&ri(d.events,j,d.events.length-j,W.resolve(d.events.slice(j),d)),W.resolveTo&&(d.events=W.resolveTo(d.events,d))}function H(){const W=w(),j=d.previous,q=d.currentConstruct,$=d.events.length,B=Array.from(c);return{from:$,restore:_};function _(){r=W,d.previous=j,d.currentConstruct=q,d.events.length=$,c=B,F()}}function F(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function p9(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,o)];else{if(l=e.slice(n,a),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}o>0&&l.push(e[a].slice(0,o))}return l}function m9(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
344
- `;break}case-3:{l=`\r
345
- `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(o)}a=o===-2,r.push(l)}return r.join("")}function g9(e){const r={constructs:iA([f9,...(e||{}).extensions||[]]),content:a(N6),defined:[],document:a(I6),flow:a(Q8),lazy:{},string:a(e9),text:a(t9)};return r;function a(o){return l;function l(c){return h9(r,o,c)}}}function y9(e){for(;!cA(e););return e}const hR=/[\0\t\n\r]/g;function b9(){let e=1,t="",n=!0,r;return a;function a(o,l,c){const f=[];let d,m,h,y,g;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(hR.lastIndex=h,d=hR.exec(o),y=d&&d.index!==void 0?d.index:o.length,g=o.charCodeAt(y),!d){t=o.slice(h);break}if(g===10&&h===y&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),h<y&&(f.push(o.slice(h,y)),e+=y-h),g){case 0:{f.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,f.push(-2);e++<m;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}h=y+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const v9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function x9(e){return e.replace(v9,w9)}function w9(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return aA(n.slice(o?2:1),o?16:10)}return lw(n)||e}const mA={}.hasOwnProperty;function S9(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),E9(n)(y9(g9(n).document().write(b9()(e,t,!0))))}function E9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(J),autolinkProtocol:H,autolinkEmail:H,atxHeading:o(Le),blockQuote:o(Me),characterEscape:H,characterReference:H,codeFenced:o(Pe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Pe,l),codeText:o(ne,l),codeTextData:H,data:H,codeFlowValue:H,definition:o(fe),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(ye),hardBreakEscape:o(Oe),hardBreakTrailing:o(Oe),htmlFlow:o(Ee,l),htmlFlowData:H,htmlText:o(Ee,l),htmlTextData:H,image:o(Te),label:l,link:o(J),listItem:o(ve),listItemValue:y,listOrdered:o(Se,h),listUnordered:o(Se),paragraph:o(Be),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Le),strong:o(qe),thematicBreak:o(ut)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:we,autolinkProtocol:pe,blockQuote:f(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:te,characterReference:le,codeFenced:f(T),codeFencedFence:C,codeFencedFenceInfo:g,codeFencedFenceMeta:w,codeFlowValue:F,codeIndented:f(S),codeText:f(B),codeTextData:F,data:F,definition:f(),definitionDestinationString:M,definitionLabelString:R,definitionTitleString:k,emphasis:f(),hardBreakEscape:f(j),hardBreakTrailing:f(j),htmlFlow:f(q),htmlFlowData:F,htmlText:f($),htmlTextData:F,image:f(z),label:K,labelText:U,lineEnding:W,link:f(_),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:Q,resourceDestinationString:P,resourceTitleString:V,resource:G,setextHeading:f(L),setextHeadingLineSequence:A,setextHeadingText:O,strong:f(),thematicBreak:f()}};gA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(he){let Ce={type:"root",children:[]};const ee={stack:[Ce],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:m,data:n},de=[];let Ae=-1;for(;++Ae<he.length;)if(he[Ae][1].type==="listOrdered"||he[Ae][1].type==="listUnordered")if(he[Ae][0]==="enter")de.push(Ae);else{const He=de.pop();Ae=a(he,He,Ae)}for(Ae=-1;++Ae<he.length;){const He=t[he[Ae][0]];mA.call(He,he[Ae][1].type)&&He[he[Ae][1].type].call(Object.assign({sliceSerialize:he[Ae][2].sliceSerialize},ee),he[Ae][1])}if(ee.tokenStack.length>0){const He=ee.tokenStack[ee.tokenStack.length-1];(He[1]||pR).call(ee,void 0,He[0])}for(Ce.position={start:xo(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:xo(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae<t.transforms.length;)Ce=t.transforms[Ae](Ce)||Ce;return Ce}function a(he,Ce,ee){let de=Ce-1,Ae=-1,He=!1,$e,et,ze,Ze;for(;++de<=ee;){const tt=he[de];switch(tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tt[0]==="enter"?Ae++:Ae--,Ze=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&($e&&!Ze&&!Ae&&!ze&&(ze=de),Ze=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ze=void 0}if(!Ae&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||Ae===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if($e){let Ct=de;for(et=void 0;Ct--;){const zt=he[Ct];if(zt[1].type==="lineEnding"||zt[1].type==="lineEndingBlank"){if(zt[0]==="exit")continue;et&&(he[et][1].type="lineEndingBlank",He=!0),zt[1].type="lineEnding",et=Ct}else if(!(zt[1].type==="linePrefix"||zt[1].type==="blockQuotePrefix"||zt[1].type==="blockQuotePrefixWhitespace"||zt[1].type==="blockQuoteMarker"||zt[1].type==="listItemIndent"))break}ze&&(!et||ze<et)&&($e._spread=!0),$e.end=Object.assign({},et?he[et][1].start:tt[1].end),he.splice(et||de,0,["exit",$e,tt[2]]),de++,ee++}if(tt[1].type==="listItemPrefix"){const Ct={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};$e=Ct,he.splice(de,0,["enter",Ct,tt[2]]),de++,ee++,ze=void 0,Ze=!0}}}return he[Ce][1]._spread=He,ee}function o(he,Ce){return ee;function ee(de){c.call(this,he(de),de),Ce&&Ce.call(this,de)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(he,Ce,ee){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Ce,ee||void 0]),he.position={start:xo(Ce.start),end:void 0}}function f(he){return Ce;function Ce(ee){he&&he.call(this,ee),d.call(this,ee)}}function d(he,Ce){const ee=this.stack.pop(),de=this.tokenStack.pop();if(de)de[0].type!==he.type&&(Ce?Ce.call(this,he,de[0]):(de[1]||pR).call(this,he,de[0]));else throw new Error("Cannot close `"+he.type+"` ("+rd({start:he.start,end:he.end})+"): it’s not open");ee.position.end=xo(he.end)}function m(){return sw(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function y(he){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function g(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=he}function w(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=he}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/(\r?\n|\r)$/g,"")}function R(he){const Ce=this.resume(),ee=this.stack[this.stack.length-1];ee.label=Ce,ee.identifier=ji(this.sliceSerialize(he)).toLowerCase()}function k(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function M(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function D(he){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const ee=this.sliceSerialize(he).length;Ce.depth=ee}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function A(he){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function H(he){const ee=this.stack[this.stack.length-1].children;let de=ee[ee.length-1];(!de||de.type!=="text")&&(de=De(),de.position={start:xo(he.start),end:void 0},ee.push(de)),this.stack.push(de)}function F(he){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(he),Ce.position.end=xo(he.end)}function W(he){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=Ce.children[Ce.children.length-1];ee.position.end=xo(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(H.call(this,he),F.call(this,he))}function j(){this.data.atHardBreak=!0}function q(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function $(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function B(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function _(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function z(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function U(he){const Ce=this.sliceSerialize(he),ee=this.stack[this.stack.length-2];ee.label=x9(Ce),ee.identifier=ji(Ce).toLowerCase()}function K(){const he=this.stack[this.stack.length-1],Ce=this.resume(),ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,ee.type==="link"){const de=he.children;ee.children=de}else ee.alt=Ce}function P(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function V(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function G(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function Q(he){const Ce=this.resume(),ee=this.stack[this.stack.length-1];ee.label=Ce,ee.identifier=ji(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function Z(he){this.data.characterReferenceType=he.type}function te(he){const Ce=this.sliceSerialize(he),ee=this.data.characterReferenceType;let de;ee?(de=aA(Ce,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):de=lw(Ce);const Ae=this.stack[this.stack.length-1];Ae.value+=de}function le(he){const Ce=this.stack.pop();Ce.position.end=xo(he.end)}function pe(he){F.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(he)}function we(he){F.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(he)}function Me(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function ne(){return{type:"inlineCode",value:""}}function fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ye(){return{type:"emphasis",children:[]}}function Le(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function Ee(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function J(){return{type:"link",title:null,url:"",children:[]}}function Se(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function ve(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Be(){return{type:"paragraph",children:[]}}function qe(){return{type:"strong",children:[]}}function De(){return{type:"text",value:""}}function ut(){return{type:"thematicBreak"}}}function xo(e){return{line:e.line,column:e.column,offset:e.offset}}function gA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?gA(e,r):C9(e,r)}}function C9(e,t){let n;for(n in t)if(mA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function pR(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+rd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+rd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+rd({start:t.start,end:t.end})+") is still open")}function T9(e){const t=this;t.parser=n;function n(r){return S9(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function R9(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function k9(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
346
- `}]}function M9(e,t){const n=t.value?t.value+`
347
- `:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function O9(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A9(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function N9(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=Ac(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function D9(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I9(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yA(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),o=a[0];o&&o.type==="text"?o.value="["+o.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function P9(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yA(e,t);const a={src:Ac(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)}function L9(e,t){const n={src:Ac(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function j9(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function _9(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yA(e,t);const a={href:Ac(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function z9(e,t){const n={href:Ac(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function F9(e,t,n){const r=e.all(t),a=n?B9(n):bA(t),o={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let h;m&&m.type==="element"&&m.tagName==="p"?h=m:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(a||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
348
- `}),m.type==="element"&&m.tagName==="p"&&!a?l.push(...m.children):l.push(m)}const f=r[r.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
349
- `});const d={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,d),e.applyData(t,d)}function B9(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=bA(n[r])}return t}function bA(e){const t=e.spread;return t??e.children.length>1}function H9(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function U9(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V9(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function q9(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $9(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=rw(t.children[1]),f=QO(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),a.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function Y9(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let f=-1;const d=[];for(;++f<c;){const h=t.children[f],y={},g=l?l[f]:void 0;g&&(y.align=g);let w={type:"element",tagName:o,properties:y,children:[]};h&&(w.children=e.all(h),e.patch(h,w),w=e.applyData(h,w)),d.push(w)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function W9(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const mR=9,gR=32;function K9(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const o=[];for(;r;)o.push(yR(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return o.push(yR(t.slice(a),a>0,!1)),o.join("")}function yR(e,t,n){let r=0,a=e.length;if(t){let o=e.codePointAt(r);for(;o===mR||o===gR;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(a-1);for(;o===mR||o===gR;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function G9(e,t){const n={type:"text",value:K9(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function X9(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Q9={blockquote:R9,break:k9,code:M9,delete:O9,emphasis:A9,footnoteReference:N9,heading:D9,html:I9,imageReference:P9,image:L9,inlineCode:j9,linkReference:_9,link:z9,listItem:F9,list:H9,paragraph:U9,root:V9,strong:q9,table:$9,tableCell:W9,tableRow:Y9,text:G9,thematicBreak:X9,toml:Eh,yaml:Eh,definition:Eh,footnoteDefinition:Eh};function Eh(){}const vA=-1,am=0,ad=1,gp=2,uw=3,dw=4,fw=5,hw=6,xA=7,wA=8,Z9=typeof self=="object"?self:globalThis,bR=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Z9[e](t)},J9=(e,t)=>{const n=(a,o)=>(e.set(o,a),a),r=a=>{if(e.has(a))return e.get(a);const[o,l]=t[a];switch(o){case am:case vA:return n(l,a);case ad:{const c=n([],a);for(const f of l)c.push(r(f));return c}case gp:{const c=n({},a);for(const[f,d]of l)c[r(f)]=r(d);return c}case uw:return n(new Date(l),a);case dw:{const{source:c,flags:f}=l;return n(new RegExp(c,f),a)}case fw:{const c=n(new Map,a);for(const[f,d]of l)c.set(r(f),r(d));return c}case hw:{const c=n(new Set,a);for(const f of l)c.add(r(f));return c}case xA:{const{name:c,message:f}=l;return n(bR(c,f),a)}case wA:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(bR(o,l),a)};return r},vR=e=>J9(new Map,e)(0),_l="",{toString:eV}={},{keys:tV}=Object,Bu=e=>{const t=typeof e;if(t!=="object"||!e)return[am,t];const n=eV.call(e).slice(8,-1);switch(n){case"Array":return[ad,_l];case"Object":return[gp,_l];case"Date":return[uw,_l];case"RegExp":return[dw,_l];case"Map":return[fw,_l];case"Set":return[hw,_l];case"DataView":return[ad,n]}return n.includes("Array")?[ad,n]:n.includes("Error")?[xA,n]:[gp,n]},Ch=([e,t])=>e===am&&(t==="function"||t==="symbol"),nV=(e,t,n,r)=>{const a=(l,c)=>{const f=r.push(l)-1;return n.set(c,f),f},o=l=>{if(n.has(l))return n.get(l);let[c,f]=Bu(l);switch(c){case am:{let m=l;switch(f){case"bigint":c=wA,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return a([vA],l)}return a([c,m],l)}case ad:{if(f){let y=l;return f==="DataView"?y=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(l)),a([f,[...y]],l)}const m=[],h=a([c,m],l);for(const y of l)m.push(o(y));return h}case gp:{if(f)switch(f){case"BigInt":return a([f,l.toString()],l);case"Boolean":case"Number":case"String":return a([f,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const m=[],h=a([c,m],l);for(const y of tV(l))(e||!Ch(Bu(l[y])))&&m.push([o(y),o(l[y])]);return h}case uw:return a([c,l.toISOString()],l);case dw:{const{source:m,flags:h}=l;return a([c,{source:m,flags:h}],l)}case fw:{const m=[],h=a([c,m],l);for(const[y,g]of l)(e||!(Ch(Bu(y))||Ch(Bu(g))))&&m.push([o(y),o(g)]);return h}case hw:{const m=[],h=a([c,m],l);for(const y of l)(e||!Ch(Bu(y)))&&m.push(o(y));return h}}const{message:d}=l;return a([c,{name:f,message:d}],l)};return o},xR=(e,{json:t,lossy:n}={})=>{const r=[];return nV(!(t||n),!!t,new Map,r)(e),r},yp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?vR(xR(e,t)):structuredClone(e):(e,t)=>vR(xR(e,t));function rV(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function iV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function aV(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rV,r=e.options.footnoteBackLabel||iV,a=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const m=e.all(d),h=String(d.identifier).toUpperCase(),y=Ac(h.toLowerCase());let g=0;const w=[],C=e.footnoteCounts.get(h);for(;C!==void 0&&++g<=C;){w.length>0&&w.push({type:"text",value:" "});let R=typeof n=="string"?n:n(f,g);typeof R=="string"&&(R={type:"text",value:R}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const T=m[m.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const R=T.children[T.children.length-1];R&&R.type==="text"?R.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...w)}else m.push(...w);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(d,S),c.push(S)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...yp(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
350
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
351
- `}]}}const om=(function(e){if(e==null)return cV;if(typeof e=="function")return sm(e);if(typeof e=="object")return Array.isArray(e)?oV(e):sV(e);if(typeof e=="string")return lV(e);throw new Error("Expected function, string, or object as test")});function oV(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=om(e[n]);return sm(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function sV(e){const t=e;return sm(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function lV(e){return sm(t);function t(n){return n&&n.type===e}}function sm(e){return t;function t(n,r,a){return!!(uV(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function cV(){return!0}function uV(e){return e!==null&&typeof e=="object"&&"type"in e}const SA=[],dV=!0,Pv=!1,fV="skip";function EA(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const o=om(a),l=r?-1:1;c(e,void 0,[])();function c(f,d,m){const h=f&&typeof f=="object"?f:{};if(typeof h.type=="string"){const g=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(g?"<"+g+">":""))+")"})}return y;function y(){let g=SA,w,C,T;if((!t||o(f,d,m[m.length-1]||void 0))&&(g=hV(n(f,m)),g[0]===Pv))return g;if("children"in f&&f.children){const S=f;if(S.children&&g[0]!==fV)for(C=(r?S.children.length:-1)+l,T=m.concat(S);C>-1&&C<S.children.length;){const R=S.children[C];if(w=c(R,C,T)(),w[0]===Pv)return w;C=typeof w[1]=="number"?w[1]:C+l}}return g}}}function hV(e){return Array.isArray(e)?e:typeof e=="number"?[dV,e]:e==null?SA:[e]}function pw(e,t,n,r){let a,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,a=n):(o=t,l=n,a=r),EA(e,o,c,a);function c(f,d){const m=d[d.length-1],h=m?m.children.indexOf(f):void 0;return l(f,h,m)}}const Lv={}.hasOwnProperty,pV={};function mV(e,t){const n=t||pV,r=new Map,a=new Map,o=new Map,l={...Q9,...n.handlers},c={all:d,applyData:yV,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:l,one:f,options:n,patch:gV,wrap:vV};return pw(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const h=m.type==="definition"?r:a,y=String(m.identifier).toUpperCase();h.has(y)||h.set(y,m)}}),c;function f(m,h){const y=m.type,g=c.handlers[y];if(Lv.call(c.handlers,y)&&g)return g(c,m,h);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in m){const{children:C,...T}=m,S=yp(T);return S.children=c.all(m),S}return yp(m)}return(c.options.unknownHandler||bV)(c,m,h)}function d(m){const h=[];if("children"in m){const y=m.children;let g=-1;for(;++g<y.length;){const w=c.one(y[g],m);if(w){if(g&&y[g-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=wR(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=wR(C.value))}Array.isArray(w)?h.push(...w):h.push(w)}}}return h}}function gV(e,t){e.position&&(t.position=r6(e))}function yV(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,yp(o)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function bV(e,t){const n=t.data||{},r="value"in t&&!(Lv.call(n,"hProperties")||Lv.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vV(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
352
- `});++r<e.length;)r&&n.push({type:"text",value:`
353
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
354
- `}),n}function wR(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function SR(e,t){const n=mV(e,t),r=n.one(e,void 0),a=aV(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&o.children.push({type:"text",value:`
355
- `},a),o}function xV(e,t){return e&&"run"in e?async function(n,r){const a=SR(n,{file:r,...t});await e.run(a,r)}:function(n,r){return SR(n,{file:r,...e||t})}}function ER(e){if(e)throw e}var pb,CR;function wV(){if(CR)return pb;CR=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),h=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!h)return!1;var y;for(y in d);return typeof y>"u"||e.call(d,y)},l=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},c=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return pb=function f(){var d,m,h,y,g,w,C=arguments[0],T=1,S=arguments.length,R=!1;for(typeof C=="boolean"&&(R=C,C=arguments[1]||{},T=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});T<S;++T)if(d=arguments[T],d!=null)for(m in d)h=c(C,m),y=c(d,m),C!==y&&(R&&y&&(o(y)||(g=a(y)))?(g?(g=!1,w=h&&a(h)?h:[]):w=h&&o(h)?h:{},l(C,{name:m,newValue:f(R,w,y)})):typeof y<"u"&&l(C,{name:m,newValue:y}));return C},pb}var SV=wV();const mb=Fp(SV);function jv(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function EV(){const e=[],t={run:n,use:r};return t;function n(...a){let o=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...a);function c(f,...d){const m=e[++o];let h=-1;if(f){l(f);return}for(;++h<a.length;)(d[h]===null||d[h]===void 0)&&(d[h]=a[h]);a=d,m?CV(m,c)(...d):l(null,...d)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function CV(e,t){let n;return r;function r(...l){const c=e.length>l.length;let f;c&&l.push(a);try{f=e.apply(this,l)}catch(d){const m=d;if(c&&n)throw m;return a(m)}c||(f&&f.then&&typeof f.then=="function"?f.then(o,a):f instanceof Error?a(f):o(f))}function a(l,...c){n||(n=!0,t(l,...c))}function o(l){a(null,l)}}const Wi={basename:TV,dirname:RV,extname:kV,join:MV,sep:"/"};function TV(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hd(e);let n=0,r=-1,a=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else r<0&&(o=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else l<0&&(o=!0,l=a+1),c>-1&&(e.codePointAt(a)===t.codePointAt(c--)?c<0&&(r=a):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function RV(e){if(Hd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function kV(e){Hd(e);let t=e.length,n=-1,r=0,a=-1,o=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?a<0?a=t:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||n<0||o===0||o===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function MV(...e){let t=-1,n;for(;++t<e.length;)Hd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":OV(n)}function OV(e){Hd(e);const t=e.codePointAt(0)===47;let n=AV(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function AV(e,t){let n="",r=0,a=-1,o=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(a===l-1||o===1))if(a!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),a=l,o=0;continue}}else if(n.length>0){n="",r=0,a=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,o=0}else c===46&&o>-1?o++:o=-1}return n}function Hd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const NV={cwd:DV};function DV(){return"/"}function _v(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function IV(e){if(typeof e=="string")e=new URL(e);else if(!_v(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return PV(e)}function PV(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const gb=["history","path","basename","stem","extname","dirname"];class CA{constructor(t){let n;t?_v(t)?n={path:t}:typeof t=="string"||LV(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":NV.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<gb.length;){const o=gb[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let a;for(a in n)gb.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Wi.basename(this.path):void 0}set basename(t){bb(t,"basename"),yb(t,"basename"),this.path=Wi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wi.dirname(this.path):void 0}set dirname(t){TR(this.basename,"dirname"),this.path=Wi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wi.extname(this.path):void 0}set extname(t){if(yb(t,"extname"),TR(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Wi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){_v(t)&&(t=IV(t)),bb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wi.basename(this.path,this.extname):void 0}set stem(t){bb(t,"stem"),yb(t,"stem"),this.path=Wi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new wr(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function yb(e,t){if(e&&e.includes(Wi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wi.sep+"`")}function bb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function TR(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function LV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jV=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),_V={}.hasOwnProperty;class mw extends jV{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=EV()}copy(){const t=new mw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(mb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(wb("data",this.frozen),this.namespace[t]=n,this):_V.call(this.namespace,t)&&this.namespace[t]||void 0:t?(wb("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Th(t),r=this.parser||this.Parser;return vb("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),vb("process",this.parser||this.Parser),xb("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,l){const c=Th(t),f=r.parse(c);r.run(f,c,function(m,h,y){if(m||!h||!y)return d(m);const g=h,w=r.stringify(g,y);BV(w)?y.value=w:y.result=w,d(m,y)});function d(m,h){m||!h?l(m):o?o(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),vb("processSync",this.parser||this.Parser),xb("processSync",this.compiler||this.Compiler),this.process(t,a),kR("processSync","process",n),r;function a(o,l){n=!0,ER(o),r=l}}run(t,n,r){RR(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,c){const f=Th(n);a.run(t,f,d);function d(m,h,y){const g=h||t;m?c(m):l?l(g):r(void 0,g,y)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),kR("runSync","run",r),a;function o(l,c){ER(l),a=c,r=!0}}stringify(t,n){this.freeze();const r=Th(n),a=this.compiler||this.Compiler;return xb("stringify",a),RR(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(wb("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...h]=d;f(m,h)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(a.settings=mb(!0,a.settings,d.settings))}function c(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const h=d[m];o(h)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,m){let h=-1,y=-1;for(;++h<r.length;)if(r[h][0]===d){y=h;break}if(y===-1)r.push([d,...m]);else if(m.length>0){let[g,...w]=m;const C=r[y][1];jv(C)&&jv(g)&&(g=mb(!0,C,g)),r[y]=[d,g,...w]}}}}const zV=new mw().freeze();function vb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wb(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function RR(e){if(!jv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function kR(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Th(e){return FV(e)?e:new CA(e)}function FV(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function BV(e){return typeof e=="string"||HV(e)}function HV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",MR=[],OR={allowDangerousHtml:!0},VV=/^(https?|ircs?|mailto|xmpp)$/i,qV=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function $V(e){const t=YV(e),n=WV(e);return KV(t.runSync(t.parse(n),n),e)}function YV(e){const t=e.rehypePlugins||MR,n=e.remarkPlugins||MR,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...OR}:OR;return zV().use(T9).use(n).use(xV,r).use(t)}function WV(e){const t=e.children||"",n=new CA;return typeof t=="string"&&(n.value=t),n}function KV(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,o=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||GV;for(const m of qV)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+UV+m.id,void 0);return pw(e,d),l6(e,{Fragment:E.Fragment,components:a,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0});function d(m,h,y){if(m.type==="raw"&&y&&typeof h=="number")return l?y.children.splice(h,1):y.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let g;for(g in db)if(Object.hasOwn(db,g)&&Object.hasOwn(m.properties,g)){const w=m.properties[g],C=db[g];(C===null||C.includes(m.tagName))&&(m.properties[g]=f(String(w||""),g,m))}}if(m.type==="element"){let g=n?!n.includes(m.tagName):o?o.includes(m.tagName):!1;if(!g&&r&&typeof h=="number"&&(g=!r(m,h,y)),g&&y&&typeof h=="number")return c&&m.children?y.children.splice(h,1,...m.children):y.children.splice(h,1),h}}}function GV(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||VV.test(e.slice(0,t))?e:""}function AR(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function XV(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function QV(e,t,n){const a=om((n||{}).ignore||[]),o=ZV(t);let l=-1;for(;++l<o.length;)EA(e,"text",c);function c(d,m){let h=-1,y;for(;++h<m.length;){const g=m[h],w=y?y.children:void 0;if(a(g,w?w.indexOf(g):void 0,y))return;y=g}if(y)return f(d,m)}function f(d,m){const h=m[m.length-1],y=o[l][0],g=o[l][1];let w=0;const T=h.children.indexOf(d);let S=!1,R=[];y.lastIndex=0;let k=y.exec(d.value);for(;k;){const M=k.index,D={index:k.index,input:k.input,stack:[...m,d]};let O=g(...k,D);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?y.lastIndex=M+1:(w!==M&&R.push({type:"text",value:d.value.slice(w,M)}),Array.isArray(O)?R.push(...O):O&&R.push(O),w=M+k[0].length,S=!0),!y.global)break;k=y.exec(d.value)}return S?(w<d.value.length&&R.push({type:"text",value:d.value.slice(w)}),h.children.splice(T,1,...R)):R=[d],T+R.length}}function ZV(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([JV(a[0]),eq(a[1])])}return t}function JV(e){return typeof e=="string"?new RegExp(XV(e),"g"):e}function eq(e){return typeof e=="function"?e:function(){return e}}const Sb="phrasing",Eb=["autolink","link","image","label"];function tq(){return{transforms:[lq],enter:{literalAutolink:rq,literalAutolinkEmail:Cb,literalAutolinkHttp:Cb,literalAutolinkWww:Cb},exit:{literalAutolink:sq,literalAutolinkEmail:oq,literalAutolinkHttp:iq,literalAutolinkWww:aq}}}function nq(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Sb,notInConstruct:Eb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Sb,notInConstruct:Eb},{character:":",before:"[ps]",after:"\\/",inConstruct:Sb,notInConstruct:Eb}]}}function rq(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Cb(e){this.config.enter.autolinkProtocol.call(this,e)}function iq(e){this.config.exit.autolinkProtocol.call(this,e)}function aq(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function oq(e){this.config.exit.autolinkEmail.call(this,e)}function sq(e){this.exit(e)}function lq(e){QV(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cq],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),uq]],{ignore:["link","linkReference"]})}function cq(e,t,n,r,a){let o="";if(!TA(a)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!dq(n)))return!1;const l=fq(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function uq(e,t,n,r){return!TA(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function dq(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function fq(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=AR(e,"(");let o=AR(e,")");for(;r!==-1&&a>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function TA(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ys(n)||rm(n))&&(!t||n!==47)}RA.peek=wq;function hq(){this.buffer()}function pq(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function mq(){this.buffer()}function gq(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function yq(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ji(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bq(e){this.exit(e)}function vq(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ji(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xq(e){this.exit(e)}function wq(){return"["}function RA(e,t,n,r){const a=n.createTracker(r);let o=a.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return o+=a.move(n.safe(n.associationId(e),{after:"]",before:o})),c(),l(),o+=a.move("]"),o}function Sq(){return{enter:{gfmFootnoteCallString:hq,gfmFootnoteCall:pq,gfmFootnoteDefinitionLabelString:mq,gfmFootnoteDefinition:gq},exit:{gfmFootnoteCallString:yq,gfmFootnoteCall:bq,gfmFootnoteDefinitionLabelString:vq,gfmFootnoteDefinition:xq}}}function Eq(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:RA},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,o,l){const c=o.createTracker(l);let f=c.move("[^");const d=o.enter("footnoteDefinition"),m=o.enter("label");return f+=c.move(o.safe(o.associationId(r),{before:f,after:"]"})),m(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
356
- `:" ")+o.indentLines(o.containerFlow(r,c.current()),t?kA:Cq))),d(),f}}function Cq(e,t,n){return t===0?e:kA(e,t,n)}function kA(e,t,n){return(n?"":" ")+e}const Tq=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];MA.peek=Aq;function Rq(){return{canContainEols:["delete"],enter:{strikethrough:Mq},exit:{strikethrough:Oq}}}function kq(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Tq}],handlers:{delete:MA}}}function Mq(e){this.enter({type:"delete",children:[]},e)}function Oq(e){this.exit(e)}function MA(e,t,n,r){const a=n.createTracker(r),o=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),o(),l}function Aq(){return"~"}function Nq(e){return e.length}function Dq(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||Nq,o=[],l=[],c=[],f=[];let d=0,m=-1;for(;++m<e.length;){const C=[],T=[];let S=-1;for(e[m].length>d&&(d=e[m].length);++S<e[m].length;){const R=Iq(e[m][S]);if(n.alignDelimiters!==!1){const k=a(R);T[S]=k,(f[S]===void 0||k>f[S])&&(f[S]=k)}C.push(R)}l[m]=C,c[m]=T}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<d;)o[h]=NR(r[h]);else{const C=NR(r);for(;++h<d;)o[h]=C}h=-1;const y=[],g=[];for(;++h<d;){const C=o[h];let T="",S="";C===99?(T=":",S=":"):C===108?T=":":C===114&&(S=":");let R=n.alignDelimiters===!1?1:Math.max(1,f[h]-T.length-S.length);const k=T+"-".repeat(R)+S;n.alignDelimiters!==!1&&(R=T.length+R+S.length,R>f[h]&&(f[h]=R),g[h]=R),y[h]=k}l.splice(1,0,y),c.splice(1,0,g),m=-1;const w=[];for(;++m<l.length;){const C=l[m],T=c[m];h=-1;const S=[];for(;++h<d;){const R=C[h]||"";let k="",M="";if(n.alignDelimiters!==!1){const D=f[h]-(T[h]||0),O=o[h];O===114?k=" ".repeat(D):O===99?D%2?(k=" ".repeat(D/2+.5),M=" ".repeat(D/2-.5)):(k=" ".repeat(D/2),M=k):M=" ".repeat(D)}n.delimiterStart!==!1&&!h&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||h)&&S.push(" "),n.alignDelimiters!==!1&&S.push(k),S.push(R),n.alignDelimiters!==!1&&S.push(M),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||h!==d-1)&&S.push("|")}w.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return w.join(`
357
- `)}function Iq(e){return e==null?"":String(e)}function NR(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Pq(e,t,n,r){const a=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),Lq);return a(),l}function Lq(e,t,n){return">"+(n?"":" ")+e}function jq(e,t){return DR(e,t.inConstruct,!0)&&!DR(e,t.notInConstruct,!1)}function DR(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function IR(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
358
- `&&jq(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
359
- `}function _q(e,t){const n=String(e);let r=n.indexOf(t),a=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++o>l&&(l=o):o=1,a=r+t.length,r=n.indexOf(t,a);return l}function zq(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Fq(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Bq(e,t,n,r){const a=Fq(n),o=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(zq(e,n)){const h=n.enter("codeIndented"),y=n.indentLines(o,Hq);return h(),y}const c=n.createTracker(r),f=a.repeat(Math.max(_q(o,a)+1,3)),d=n.enter("codeFenced");let m=c.move(f);if(e.lang){const h=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
360
- `,encode:["`"],...c.current()})),h()}return m+=c.move(`
361
- `),o&&(m+=c.move(o+`
362
- `)),m+=c.move(f),d(),m}function Hq(e,t,n){return(n?"":" ")+e}function gw(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Uq(e,t,n,r){const a=gw(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
363
- `,...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=f.move(" "+a),d+=f.move(n.safe(e.title,{before:d,after:a,...f.current()})),d+=f.move(a),c()),l(),d}function Vq(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function wd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function bp(e,t,n){const r=yc(e),a=yc(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}OA.peek=qq;function OA(e,t,n,r){const a=Vq(n),o=n.enter("emphasis"),l=n.createTracker(r),c=l.move(a);let f=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const d=f.charCodeAt(0),m=bp(r.before.charCodeAt(r.before.length-1),d,a);m.inside&&(f=wd(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=bp(r.after.charCodeAt(0),h,a);y.inside&&(f=f.slice(0,-1)+wd(h));const g=l.move(a);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function qq(e,t,n){return n.options.emphasis||"*"}function $q(e,t){let n=!1;return pw(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Pv}),!!((!e.depth||e.depth<3)&&sw(e)&&(t.options.setext||n))}function Yq(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if($q(e,n)){const m=n.enter("headingSetext"),h=n.enter("phrasing"),y=n.containerPhrasing(e,{...o.current(),before:`
364
- `,after:`
365
- `});return h(),m(),y+`
366
- `+(a===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
367
- `))+1))}const l="#".repeat(a),c=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
368
- `,...o.current()});return/^[\t ]/.test(d)&&(d=wd(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}AA.peek=Wq;function AA(e){return e.value||""}function Wq(){return"<"}NA.peek=Kq;function NA(e,t,n,r){const a=gw(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=f.move(" "+a),d+=f.move(n.safe(e.title,{before:d,after:a,...f.current()})),d+=f.move(a),c()),d+=f.move(")"),l(),d}function Kq(){return"!"}DA.peek=Gq;function DA(e,t,n,r){const a=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const d=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const h=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,o(),a==="full"||!d||d!==h?f+=c.move(h+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function Gq(){return"!"}IA.peek=Xq;function IA(e,t,n){let r=e.value||"",a="`",o=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(r);){let d=f.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(f.index+1)}}return a+r+a}function Xq(){return"`"}function PA(e,t){const n=sw(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}LA.peek=Qq;function LA(e,t,n,r){const a=gw(n),o=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,f;if(PA(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let h=l.move("<");return h+=l.move(n.containerPhrasing(e,{before:h,after:">",...l.current()})),h+=l.move(">"),c(),n.stack=m,h}c=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=l.move(" "+a),d+=l.move(n.safe(e.title,{before:d,after:a,...l.current()})),d+=l.move(a),f()),d+=l.move(")"),c(),d}function Qq(e,t,n){return PA(e,n)?"<":"["}jA.peek=Zq;function jA(e,t,n,r){const a=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const h=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,o(),a==="full"||!d||d!==h?f+=c.move(h+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function Zq(){return"["}function yw(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Jq(e){const t=yw(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function e7(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function _A(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function t7(e,t,n,r){const a=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?e7(n):yw(n);const c=e.ordered?l==="."?")":".":Jq(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),_A(n)===l&&m){let h=-1;for(;++h<e.children.length;){const y=e.children[h];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,a(),d}function n7(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function r7(e,t,n,r){const a=n7(n);let o=n.bulletCurrent||yw(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(o+" ".repeat(l-o.length)),c.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),m);return f(),d;function m(h,y,g){return y?(g?"":" ".repeat(l))+h:(g?o:o+" ".repeat(l-o.length))+h}}function i7(e,t,n,r){const a=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),a(),l}const a7=om(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function o7(e,t,n,r){return(e.children.some(function(l){return a7(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function s7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}zA.peek=l7;function zA(e,t,n,r){const a=s7(n),o=n.enter("strong"),l=n.createTracker(r),c=l.move(a+a);let f=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const d=f.charCodeAt(0),m=bp(r.before.charCodeAt(r.before.length-1),d,a);m.inside&&(f=wd(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=bp(r.after.charCodeAt(0),h,a);y.inside&&(f=f.slice(0,-1)+wd(h));const g=l.move(a+a);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function l7(e,t,n){return n.options.strong||"*"}function c7(e,t,n,r){return n.safe(e.value,r)}function u7(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function d7(e,t,n){const r=(_A(n)+(n.options.ruleSpaces?" ":"")).repeat(u7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const FA={blockquote:Pq,break:IR,code:Bq,definition:Uq,emphasis:OA,hardBreak:IR,heading:Yq,html:AA,image:NA,imageReference:DA,inlineCode:IA,link:LA,linkReference:jA,list:t7,listItem:r7,paragraph:i7,root:o7,strong:zA,text:c7,thematicBreak:d7};function f7(){return{enter:{table:h7,tableData:PR,tableHeader:PR,tableRow:m7},exit:{codeText:g7,table:p7,tableData:Tb,tableHeader:Tb,tableRow:Tb}}}function h7(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function p7(e){this.exit(e),this.data.inTable=void 0}function m7(e){this.enter({type:"tableRow",children:[]},e)}function Tb(e){this.exit(e)}function PR(e){this.enter({type:"tableCell",children:[]},e)}function g7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,y7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function y7(e,t){return t==="|"?t:e}function b7(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
369
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:f,tableRow:c}};function l(g,w,C,T){return d(m(g,C,T),g.align)}function c(g,w,C,T){const S=h(g,C,T),R=d([S]);return R.slice(0,R.indexOf(`
370
- `))}function f(g,w,C,T){const S=C.enter("tableCell"),R=C.enter("phrasing"),k=C.containerPhrasing(g,{...T,before:o,after:o});return R(),S(),k}function d(g,w){return Dq(g,{align:w,alignDelimiters:r,padding:n,stringLength:a})}function m(g,w,C){const T=g.children;let S=-1;const R=[],k=w.enter("table");for(;++S<T.length;)R[S]=h(T[S],w,C);return k(),R}function h(g,w,C){const T=g.children;let S=-1;const R=[],k=w.enter("tableRow");for(;++S<T.length;)R[S]=f(T[S],g,w,C);return k(),R}function y(g,w,C){let T=FA.inlineCode(g,w,C);return C.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function v7(){return{exit:{taskListCheckValueChecked:LR,taskListCheckValueUnchecked:LR,paragraph:w7}}}function x7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:S7}}}function LR(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function w7(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let o=-1,l;for(;++o<a.length;){const c=a[o];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function S7(e,t,n,r){const a=e.children[0],o=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);o&&c.move(l);let f=FA.listItem(e,t,n,{...r,...c.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(m){return m+l}}function E7(){return[tq(),Sq(),Rq(),f7(),v7()]}function C7(e){return{extensions:[nq(),Eq(e),kq(),b7(e),x7()]}}const T7={tokenize:N7,partial:!0},BA={tokenize:D7,partial:!0},HA={tokenize:I7,partial:!0},UA={tokenize:P7,partial:!0},R7={tokenize:L7,partial:!0},VA={name:"wwwAutolink",tokenize:O7,previous:$A},qA={name:"protocolAutolink",tokenize:A7,previous:YA},$a={name:"emailAutolink",tokenize:M7,previous:WA},ca={};function k7(){return{text:ca}}let Ss=48;for(;Ss<123;)ca[Ss]=$a,Ss++,Ss===58?Ss=65:Ss===91&&(Ss=97);ca[43]=$a;ca[45]=$a;ca[46]=$a;ca[95]=$a;ca[72]=[$a,qA];ca[104]=[$a,qA];ca[87]=[$a,VA];ca[119]=[$a,VA];function M7(e,t,n){const r=this;let a,o;return l;function l(h){return!zv(h)||!WA.call(r,r.previous)||bw(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(h))}function c(h){return zv(h)?(e.consume(h),c):h===64?(e.consume(h),f):n(h)}function f(h){return h===46?e.check(R7,m,d)(h):h===45||h===95||xr(h)?(o=!0,e.consume(h),f):m(h)}function d(h){return e.consume(h),a=!0,f}function m(h){return o&&a&&kr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function O7(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!$A.call(r,r.previous)||bw(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(T7,e.attempt(BA,e.attempt(HA,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function A7(e,t,n){const r=this;let a="",o=!1;return l;function l(h){return(h===72||h===104)&&YA.call(r,r.previous)&&!bw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(h),e.consume(h),c):n(h)}function c(h){if(kr(h)&&a.length<5)return a+=String.fromCodePoint(h),e.consume(h),c;if(h===58){const y=a.toLowerCase();if(y==="http"||y==="https")return e.consume(h),f}return n(h)}function f(h){return h===47?(e.consume(h),o?d:(o=!0,f)):n(h)}function d(h){return h===null||mp(h)||wn(h)||Ys(h)||rm(h)?n(h):e.attempt(BA,e.attempt(HA,m),n)(h)}function m(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function N7(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function D7(e,t,n){let r,a,o;return l;function l(d){return d===46||d===95?e.check(UA,f,c)(d):d===null||wn(d)||Ys(d)||d!==45&&rm(d)?f(d):(o=!0,e.consume(d),l)}function c(d){return d===95?r=!0:(a=r,r=void 0),e.consume(d),l}function f(d){return a||r||!o?n(d):t(d)}}function I7(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(UA,t,o)(l):l===null||wn(l)||Ys(l)?t(l):(e.consume(l),a)}function o(l){return l===41&&r++,e.consume(l),a}}function P7(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),o):c===93?(e.consume(c),a):c===60||c===null||wn(c)||Ys(c)?t(c):n(c)}function a(c){return c===null||c===40||c===91||wn(c)||Ys(c)?t(c):r(c)}function o(c){return kr(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):kr(c)?(e.consume(c),l):n(c)}}function L7(e,t,n){return r;function r(o){return e.consume(o),a}function a(o){return xr(o)?n(o):t(o)}}function $A(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||wn(e)}function YA(e){return!kr(e)}function WA(e){return!(e===47||zv(e))}function zv(e){return e===43||e===45||e===46||e===95||xr(e)}function bw(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const j7={tokenize:q7,partial:!0};function _7(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:H7,continuation:{tokenize:U7},exit:V7}},text:{91:{name:"gfmFootnoteCall",tokenize:B7},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:z7,resolveTo:F7}}}}function z7(e,t,n){const r=this;let a=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const f=r.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const d=ji(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function F7(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function B7(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return c;function c(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),f}function f(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(h){if(o>999||h===93&&!l||h===null||h===91||wn(h))return n(h);if(h===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return a.includes(ji(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return wn(h)||(l=!0),o++,e.consume(h),h===92?m:d}function m(h){return h===91||h===92||h===93?(e.consume(h),o++,d):d(h)}}function H7(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,c;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(w)}function m(w){if(l>999||w===93&&!c||w===null||w===91||wn(w))return n(w);if(w===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return o=ji(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return wn(w)||(c=!0),l++,e.consume(w),w===92?h:m}function h(w){return w===91||w===92||w===93?(e.consume(w),l++,m):m(w)}function y(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),a.includes(o)||a.push(o),an(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function U7(e,t,n){return e.check(Bd,t,e.attempt(j7,t,n))}function V7(e){e.exit("gfmFootnoteDefinition")}function q7(e,t,n){const r=this;return an(e,a,"gfmFootnoteDefinitionIndent",5);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function $7(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let d=f;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[f][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[f][1].end)},h={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[f][1].start)},y=[["enter",m,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",h,c]],g=c.parser.constructs.insideSpan.null;g&&ri(y,y.length,0,im(g,l.slice(d+1,f),c)),ri(y,y.length,0,[["exit",h,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),ri(l,d-1,f-d+3,y),f=d+y.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function o(l,c,f){const d=this.previous,m=this.events;let h=0;return y;function y(w){return d===126&&m[m.length-1][1].type!=="characterEscape"?f(w):(l.enter("strikethroughSequenceTemporary"),g(w))}function g(w){const C=yc(d);if(w===126)return h>1?f(w):(l.consume(w),h++,g);if(h<2&&!n)return f(w);const T=l.exit("strikethroughSequenceTemporary"),S=yc(w);return T._open=!S||S===2&&!!C,T._close=!C||C===2&&!!S,c(w)}}}class Y7{constructor(){this.map=[]}add(t,n,r){W7(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const o of a)t.push(o);a=r.pop()}this.map.length=0}}function W7(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function K7(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function G7(){return{flow:{null:{name:"table",tokenize:X7,resolveAll:Q7}}}}function X7(e,t,n){const r=this;let a=0,o=0,l;return c;function c(F){let W=r.events.length-1;for(;W>-1;){const $=r.events[W][1].type;if($==="lineEnding"||$==="linePrefix")W--;else break}const j=W>-1?r.events[W][1].type:null,q=j==="tableHead"||j==="tableRow"?O:f;return q===O&&r.parser.lazy[r.now().line]?n(F):q(F)}function f(F){return e.enter("tableHead"),e.enter("tableRow"),d(F)}function d(F){return F===124||(l=!0,o+=1),m(F)}function m(F){return F===null?n(F):bt(F)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),g):n(F):Kt(F)?an(e,m,"whitespace")(F):(o+=1,l&&(l=!1,a+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),h(F)))}function h(F){return F===null||F===124||wn(F)?(e.exit("data"),m(F)):(e.consume(F),F===92?y:h)}function y(F){return F===92||F===124?(e.consume(F),h):h(F)}function g(F){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(F):(e.enter("tableDelimiterRow"),l=!1,Kt(F)?an(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):w(F))}function w(F){return F===45||F===58?T(F):F===124?(l=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),C):D(F)}function C(F){return Kt(F)?an(e,T,"whitespace")(F):T(F)}function T(F){return F===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),S):F===45?(o+=1,S(F)):F===null||bt(F)?M(F):D(F)}function S(F){return F===45?(e.enter("tableDelimiterFiller"),R(F)):D(F)}function R(F){return F===45?(e.consume(F),R):F===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(F))}function k(F){return Kt(F)?an(e,M,"whitespace")(F):M(F)}function M(F){return F===124?w(F):F===null||bt(F)?!l||a!==o?D(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):D(F)}function D(F){return n(F)}function O(F){return e.enter("tableRow"),A(F)}function A(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),A):F===null||bt(F)?(e.exit("tableRow"),t(F)):Kt(F)?an(e,A,"whitespace")(F):(e.enter("data"),L(F))}function L(F){return F===null||F===124||wn(F)?(e.exit("data"),A(F)):(e.consume(F),F===92?H:L)}function H(F){return F===92||F===124?(e.consume(F),L):L(F)}}function Q7(e,t){let n=-1,r=!0,a=0,o=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,d,m,h;const y=new Y7;for(;++n<e.length;){const g=e[n],w=g[1];g[0]==="enter"?w.type==="tableHead"?(c=!1,f!==0&&(jR(y,t,f,d,m),m=void 0,f=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",d,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",m,t]])),a=w.type==="tableDelimiterRow"?2:m?3:1):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],h=Rh(y,t,o,a,void 0,h),o=[0,0,0,0]),l[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],h=Rh(y,t,o,a,void 0,h)),o=l,l=[o[1],n,0,0])):w.type==="tableHead"?(c=!0,f=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(f=n,o[1]!==0?(l[0]=l[1],h=Rh(y,t,o,a,n,h)):l[1]!==0&&(h=Rh(y,t,l,a,n,h)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&jR(y,t,f,d,m),y.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=K7(t.events,n))}return e}function Rh(e,t,n,r,a,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(o.end=Object.assign({},Bl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=Bl(t.events,n[1]);if(o={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=Bl(t.events,n[2]),m=Bl(t.events,n[3]),h={type:c,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const y=t.events[n[2]],g=t.events[n[3]];if(y[1].end=Object.assign({},g[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,C=n[3]-n[2]-1;e.add(w,C,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return a!==void 0&&(o.end=Object.assign({},Bl(t.events,a)),e.add(a,0,[["exit",o,t]]),o=void 0),o}function jR(e,t,n,r,a){const o=[],l=Bl(t.events,n);a&&(a.end=Object.assign({},l),o.push(["exit",a,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function Bl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Z7={name:"tasklistCheck",tokenize:e$};function J7(){return{text:{91:Z7}}}function e$(e,t,n){const r=this;return a;function a(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return wn(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return bt(f)?t(f):Kt(f)?e.check({tokenize:t$},t,n)(f):n(f)}}function t$(e,t,n){return an(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function n$(e){return iA([k7(),_7(),$7(e),G7(),J7()])}const r$={};function i$(e){const t=this,n=e||r$,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(n$(n)),o.push(E7()),l.push(C7(n))}function a$(e){const t=e.split(`
371
- `),n=[];let r=[],a=!1;const o=()=>{const l=r.join(`
372
- `);l.trim()&&n.push(l),r=[]};for(const l of t){if(/^\s*(```|~~~)/.test(l)){a=!a,r.push(l);continue}if(!a&&l.trim()===""){o();continue}r.push(l)}return o(),n}const o$={a:({node:e,...t})=>E.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 break-all"}),pre:({node:e,...t})=>E.jsx("pre",{...t,className:"bg-muted overflow-x-auto rounded-md p-2 font-mono text-xs leading-relaxed"}),code:({node:e,className:t,...n})=>E.jsx("code",{...n,className:je("bg-muted rounded px-1 font-mono text-xs",t)}),ul:({node:e,...t})=>E.jsx("ul",{...t,className:"list-disc pl-5"}),ol:({node:e,...t})=>E.jsx("ol",{...t,className:"list-decimal pl-5"}),blockquote:({node:e,...t})=>E.jsx("blockquote",{...t,className:"border-border text-muted-foreground border-l-2 pl-2"}),h1:({node:e,...t})=>E.jsx("h1",{...t,className:"text-base font-semibold"}),h2:({node:e,...t})=>E.jsx("h2",{...t,className:"text-sm font-semibold"}),h3:({node:e,...t})=>E.jsx("h3",{...t,className:"text-sm font-semibold"}),table:({node:e,...t})=>E.jsx("div",{className:"overflow-x-auto",children:E.jsx("table",{...t,className:"border-border w-full border-collapse border text-xs"})}),th:({node:e,...t})=>E.jsx("th",{...t,className:"border-border bg-muted border px-2 py-1 text-left"}),td:({node:e,...t})=>E.jsx("td",{...t,className:"border-border border px-2 py-1"})},s$=v.memo(function({content:t}){return E.jsx($V,{remarkPlugins:[i$],components:o$,children:t})});function l$({text:e,streaming:t=!1,className:n}){const r=v.useMemo(()=>a$(e),[e]);return E.jsxs("div",{className:je("flex min-w-0 flex-col gap-2 text-sm leading-relaxed",n),children:[r.map((a,o)=>E.jsx(s$,{content:a},o)),t&&E.jsx("span",{"data-testid":"agent-streaming-cursor",className:"bg-foreground inline-block h-4 w-2 animate-pulse self-start"})]})}function c$({text:e,streaming:t=!1,className:n}){return E.jsx("div",{"data-testid":"agent-assistant-message",className:je("min-w-0 max-w-full self-start",n),children:E.jsx(l$,{text:e,streaming:t})})}const u$=[];function lm(e){v.useEffect(e,u$)}const kh=null;class d${constructor(){st(this,"callbacks",[]);st(this,"callbacksCount",0);st(this,"nextId",1);st(this,"startId",1);st(this,"isScheduled",!1);st(this,"tick",t=>{var a;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(a=n[o])==null||a.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(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 Mh=new d$;class zn{constructor(){st(this,"currentId",kh);st(this,"cancel",()=>{this.currentId!==kh&&(Mh.cancel(this.currentId),this.currentId=kh)});st(this,"disposeEffect",()=>this.cancel)}static create(){return new zn}static request(t){return Mh.request(t)}static cancel(t){return Mh.cancel(t)}request(t){this.cancel(),this.currentId=Mh.request(()=>{this.currentId=kh,t()})}}function Ud(){const e=nr(zn.create).current;return lm(e.disposeEffect),e}function Ia(e){return e==null?e:"current"in e?e.current:e}let Ws=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const f$={[Ws.startingStyle]:""},h$={[Ws.endingStyle]:""},Ya={transitionStatus(e){return e==="starting"?f$:e==="ending"?h$:null}};function KA(e,t=!1,n=!0){const r=Ud();return Ye((a,o=null)=>{r.cancel();function l(){pr.flushSync(a)}const c=Ia(e);if(c==null)return;const f=c;if(typeof f.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)a();else{let d=function(){const h=Ws.startingStyle;if(!f.hasAttribute(h)){r.request(m);return}const y=new MutationObserver(()=>{f.hasAttribute(h)||(y.disconnect(),m())});y.observe(f,{attributes:!0,attributeFilter:[h]}),o==null||o.addEventListener("abort",()=>y.disconnect(),{once:!0})},m=function(){Promise.all(f.getAnimations().map(h=>h.finished)).then(()=>{o!=null&&o.aborted||l()}).catch(()=>{const h=f.getAnimations();if(n){if(o!=null&&o.aborted)return;l()}else h.length>0&&h.some(y=>y.pending||y.playState!=="finished")&&m()})};if(t){d();return}r.request(m)}})}function Vd(e,t=!1,n=!1){const[r,a]=v.useState(e&&t?"idle":void 0),[o,l]=v.useState(e);return e&&!o&&(l(!0),a("starting")),!e&&o&&r!=="ending"&&!n&&a("ending"),!e&&!o&&r==="ending"&&a(void 0),Ve(()=>{if(!e&&o&&r!=="ending"&&n){const c=zn.request(()=>{a("ending")});return()=>{zn.cancel(c)}}},[e,o,r,n]),Ve(()=>{if(!e||t)return;const c=zn.request(()=>{a(void 0)});return()=>{zn.cancel(c)}},[t,e]),Ve(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&a("starting");const c=zn.request(()=>{a("idle")});return()=>{zn.cancel(c)}},[t,e,o,a,r]),v.useMemo(()=>({mounted:o,setMounted:l,transitionStatus:r}),[o,r])}function p$(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:a}=e,o=t!==void 0,[l,c]=gc({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:f,setMounted:d,transitionStatus:m}=Vd(l,!0,!0),[h,y]=v.useState(l),[{height:g,width:w},C]=v.useState({height:void 0,width:void 0}),T=Hi(),[S,R]=v.useState(),k=S??T,[M,D]=v.useState(!1),[O,A]=v.useState(!1),L=v.useRef(null),H=v.useRef(null),F=v.useRef(null),W=v.useRef(null),j=KA(W,!1),q=Ye($=>{const B=!l,_=vt(qs,$.nativeEvent);if(r(B,_),_.isCanceled)return;const z=W.current;H.current==="css-animation"&&z!=null&&z.style.removeProperty("animation-name"),!M&&!O&&(H.current!=null&&H.current!=="css-animation"&&!f&&B&&d(!0),H.current==="css-animation"&&(!h&&B&&y(!0),!f&&B&&d(!0))),c(B),H.current==="none"&&f&&!B&&d(!1)});return Ve(()=>{o&&H.current==="none"&&!O&&!l&&d(!1)},[o,O,l,t,d]),v.useMemo(()=>({abortControllerRef:L,animationTypeRef:H,disabled:a,handleTrigger:q,height:g,mounted:f,open:l,panelId:k,panelRef:W,runOnceAnimationsFinish:j,setDimensions:C,setHiddenUntilFound:D,setKeepMounted:A,setMounted:d,setOpen:c,setPanelIdState:R,setVisible:y,transitionDimensionRef:F,transitionStatus:m,visible:h,width:w}),[L,H,a,q,g,f,l,k,W,j,C,D,A,d,c,y,F,m,h,w])}const GA=v.createContext(void 0);function XA(){const e=v.useContext(GA);if(e===void 0)throw new Error(Cn(15));return e}let od=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ws.startingStyle]="startingStyle",e[e.endingStyle=Ws.endingStyle]="endingStyle",e})({}),m$=(function(e){return e.panelOpen="data-panel-open",e})({});const g$={[od.open]:""},y$={[od.closed]:""},b$={open(e){return e?{[m$.panelOpen]:""}:null}},v$={open(e){return e?g$:y$}},QA={...v$,...Ya},x$=v.forwardRef(function(t,n){const{render:r,className:a,defaultOpen:o=!1,disabled:l=!1,onOpenChange:c,open:f,...d}=t,m=Ye(c),h=p$({open:f,defaultOpen:o,onOpenChange:m,disabled:l}),y=v.useMemo(()=>({open:h.open,disabled:h.disabled,transitionStatus:h.transitionStatus}),[h.open,h.disabled,h.transitionStatus]),g=v.useMemo(()=>({...h,onOpenChange:m,state:y}),[h,m,y]),w=Dt("div",t,{state:y,ref:n,props:d,stateAttributesMapping:QA});return E.jsx(GA.Provider,{value:g,children:w})}),w$={...b$,...Ya},S$=v.forwardRef(function(t,n){const{panelId:r,open:a,handleTrigger:o,state:l,disabled:c}=XA(),{className:f,disabled:d=c,id:m,render:h,nativeButton:y=!0,...g}=t,{getButtonProps:w,buttonRef:C}=qa({disabled:d,focusableWhenDisabled:!0,native:y}),T=v.useMemo(()=>({"aria-controls":a?r:void 0,"aria-expanded":a,onClick:o}),[r,a,o]);return Dt("button",t,{state:l,ref:[n,C],props:[T,g,w],stateAttributesMapping:w$})});let E$=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function C$(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:a,hiddenUntilFound:o,keepMounted:l,id:c,mounted:f,onOpenChange:d,open:m,panelRef:h,runOnceAnimationsFinish:y,setDimensions:g,setMounted:w,setOpen:C,setVisible:T,transitionDimensionRef:S,visible:R,width:k}=e,M=v.useRef(!1),D=v.useRef(null),O=v.useRef(m),A=v.useRef(m),L=Ud(),H=v.useMemo(()=>n.current==="css-animation"?!R:!m&&!f,[m,f,R,n]),F=Ye(j=>{if(!j)return;if(n.current==null||S.current==null){const B=getComputedStyle(j),_=B.animationName!=="none"&&B.animationName!=="",z=B.transitionDuration!=="0s"&&B.transitionDuration!=="";_&&z||(B.animationName==="none"&&B.transitionDuration!=="0s"?n.current="css-transition":B.animationName!=="none"&&B.transitionDuration==="0s"?n.current="css-animation":n.current="none"),j.getAttribute(E$.orientation)==="horizontal"||B.transitionProperty.indexOf("width")>-1?S.current="width":S.current="height"}if(n.current!=="css-transition")return;(a===void 0||k===void 0)&&(g({height:j.scrollHeight,width:j.scrollWidth}),A.current&&j.style.setProperty("transition-duration","0s"));let q=-1,$=-1;return q=zn.request(()=>{A.current=!1,$=zn.request(()=>{setTimeout(()=>{j.style.removeProperty("transition-duration")})})}),()=>{zn.cancel(q),zn.cancel($)}}),W=_i(r,h,F);return Ve(()=>{if(n.current!=="css-transition")return;const j=h.current;if(!j)return;let q=-1;if(t.current!=null&&(t.current.abort(),t.current=null),m){const $={"justify-content":j.style.justifyContent,"align-items":j.style.alignItems,"align-content":j.style.alignContent,"justify-items":j.style.justifyItems};Object.keys($).forEach(B=>{j.style.setProperty(B,"initial","important")}),!A.current&&!l&&j.setAttribute(od.startingStyle,""),g({height:j.scrollHeight,width:j.scrollWidth}),q=zn.request(()=>{Object.entries($).forEach(([B,_])=>{_===""?j.style.removeProperty(B):j.style.setProperty(B,_)})})}else{if(j.scrollHeight===0&&j.scrollWidth===0)return;g({height:j.scrollHeight,width:j.scrollWidth});const $=new AbortController;t.current=$;const B=$.signal;let _=null;const z=od.endingStyle;return _=new MutationObserver(U=>{U.some(P=>P.type==="attributes"&&P.attributeName===z)&&(_==null||_.disconnect(),_=null,y(()=>{g({height:0,width:0}),j.style.removeProperty("content-visibility"),w(!1),t.current===$&&(t.current=null)},B))}),_.observe(j,{attributes:!0,attributeFilter:[z]}),()=>{_==null||_.disconnect(),L.cancel(),t.current===$&&($.abort(),t.current=null)}}return()=>{zn.cancel(q)}},[t,n,L,o,l,f,m,h,y,g,w]),Ve(()=>{if(n.current!=="css-animation")return;const j=h.current;j&&(D.current=j.style.animationName||D.current,j.style.setProperty("animation-name","none"),g({height:j.scrollHeight,width:j.scrollWidth}),!O.current&&!M.current&&j.style.removeProperty("animation-name"),m?(t.current!=null&&(t.current.abort(),t.current=null),w(!0),T(!0)):(t.current=new AbortController,y(()=>{w(!1),T(!1),t.current=null},t.current.signal)))},[t,n,m,h,y,g,w,T,R]),lm(()=>{const j=zn.request(()=>{O.current=!1});return()=>zn.cancel(j)}),Ve(()=>{if(!o)return;const j=h.current;if(!j)return;let q=-1,$=-1;return m&&M.current&&(j.style.transitionDuration="0s",g({height:j.scrollHeight,width:j.scrollWidth}),q=zn.request(()=>{M.current=!1,$=zn.request(()=>{setTimeout(()=>{j.style.removeProperty("transition-duration")})})})),()=>{zn.cancel(q),zn.cancel($)}},[o,m,h,g]),Ve(()=>{const j=h.current;j&&o&&H&&(j.setAttribute("hidden","until-found"),n.current==="css-transition"&&j.setAttribute(od.startingStyle,""))},[o,H,n,h]),v.useEffect(function(){const q=h.current;if(!q)return;function $(B){M.current=!0,C(!0),d(!0,vt(zi,B))}return q.addEventListener("beforematch",$),()=>{q.removeEventListener("beforematch",$)}},[d,h,C]),v.useMemo(()=>({props:{hidden:H,id:c,ref:W}}),[H,c,W])}let _R=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});function Wa(e){const{enabled:t=!0,open:n,ref:r,onComplete:a}=e,o=Ye(a),l=KA(r,n,!1);v.useEffect(()=>{if(!t)return;const c=new AbortController;return l(o,c.signal),()=>{c.abort()}},[t,n,o,l])}const T$=v.forwardRef(function(t,n){const{className:r,hiddenUntilFound:a,keepMounted:o,render:l,id:c,...f}=t,{abortControllerRef:d,animationTypeRef:m,height:h,mounted:y,onOpenChange:g,open:w,panelId:C,panelRef:T,runOnceAnimationsFinish:S,setDimensions:R,setHiddenUntilFound:k,setKeepMounted:M,setMounted:D,setPanelIdState:O,setOpen:A,setVisible:L,state:H,transitionDimensionRef:F,visible:W,width:j,transitionStatus:q}=XA(),$=a??!1,B=o??!1;Ve(()=>{if(c)return O(c),()=>{O(void 0)}},[c,O]),Ve(()=>{k($)},[k,$]),Ve(()=>{M(B)},[M,B]);const{props:_}=C$({abortControllerRef:d,animationTypeRef:m,externalRef:n,height:h,hiddenUntilFound:$,id:C,keepMounted:B,mounted:y,onOpenChange:g,open:w,panelRef:T,runOnceAnimationsFinish:S,setDimensions:R,setMounted:D,setOpen:A,setVisible:L,transitionDimensionRef:F,visible:W,width:j});Wa({open:w&&q==="idle",ref:T,onComplete(){w&&R({height:void 0,width:void 0})}});const z=v.useMemo(()=>({...H,transitionStatus:q}),[H,q]),U=Dt("div",t,{state:z,ref:[n,T],props:[_,{style:{[_R.collapsiblePanelHeight]:h===void 0?"auto":`${h}px`,[_R.collapsiblePanelWidth]:j===void 0?"auto":`${j}px`}},f],stateAttributesMapping:QA});return B||$||!B&&y?U:null});function cm({...e}){return E.jsx(x$,{"data-slot":"collapsible",...e})}function um({...e}){return E.jsx(S$,{"data-slot":"collapsible-trigger",...e})}function dm({...e}){return E.jsx(T$,{"data-slot":"collapsible-content",...e})}function R$({text:e,streaming:t=!1,className:n}){const{t:r}=Sn();return E.jsxs(cm,{"data-testid":"agent-reasoning-block",className:je("min-w-0 max-w-full self-start",n),children:[E.jsxs(um,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[E.jsx(qp,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),E.jsx(DF,{className:"size-3"}),E.jsx("span",{children:r("agent.reasoning.title")}),t&&E.jsx(mc,{className:"size-3 animate-spin"})]}),E.jsx(dm,{children:E.jsx("div",{className:"text-muted-foreground border-border mt-1 border-l-2 pl-2 text-xs whitespace-pre-wrap break-words",children:e})})]})}function fm(e){return Dt(e.defaultTagName??"div",e,e)}const k$=Qp("h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Ks({className:e,variant:t="default",render:n,...r}){return fm({defaultTagName:"span",props:Ei({className:je(k$({className:e,variant:t}))},r),render:n,state:{slot:"badge",variant:t}})}function $o(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fv(e){if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function M$(e){return $o(e.output)&&typeof e.output.error=="string"?e.output.error:e.isError?Fv(e.output):null}function O$(e){switch(e){case"send_input":return E.jsx(QF,{className:"size-3.5"});case"read_screen":return E.jsx(Vx,{className:"size-3.5"});case"web_search":return E.jsx(wB,{className:"size-3.5"});case"fetch_url":return E.jsx(dO,{className:"size-3.5"});default:return E.jsx(LB,{className:"size-3.5"})}}function bc({label:e,text:t}){return E.jsxs(cm,{children:[E.jsxs(um,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[E.jsx(qp,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),E.jsx("span",{children:e})]}),E.jsx(dm,{children:E.jsx("pre",{className:"bg-muted mt-1 max-h-64 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:t})})]})}function A$(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t.filter($o).map(n=>({title:typeof n.title=="string"?n.title:"",url:typeof n.url=="string"?n.url:"",snippet:typeof n.snippet=="string"?n.snippet:""})).filter(n=>n.url):null}catch{return null}}function N$({call:e}){const{t}=Sn(),n=$o(e.input)?e.input:{},r=typeof n.text=="string"?n.text:"",a=Array.isArray(n.keys)?n.keys.filter(c=>typeof c=="string"):[],o=$o(e.output)?e.output:{},l=typeof o.screenTail=="string"?o.screenTail:"";return E.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&E.jsx("pre",{className:"bg-muted max-h-40 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:r}),a.length>0&&E.jsx("div",{className:"flex flex-wrap items-center gap-1",children:a.map((c,f)=>E.jsx(Ks,{variant:"outline",className:"font-mono",children:c},`${f}-${c}`))}),l&&E.jsx(bc,{label:t("agent.tool.result"),text:l})]})}function D$({call:e}){const{t}=Sn(),n=$o(e.output)?e.output:{},r=typeof n.screen=="string"?n.screen:"";return r?E.jsx(bc,{label:t("agent.tool.screen"),text:r}):null}function I$({call:e}){const{t}=Sn(),n=$o(e.input)?e.input:{},r=typeof n.query=="string"?n.query:"",a=e.resolved&&!e.isError&&!e.denied?A$(e.output):null;return E.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&E.jsxs("p",{className:"text-muted-foreground text-xs break-words",children:["“",r,"”"]}),a&&a.length>0&&E.jsx("ul",{className:"flex flex-col gap-1",children:a.map(o=>E.jsxs("li",{className:"min-w-0 text-xs",children:[E.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate underline underline-offset-2",title:o.title||o.url,children:o.title||o.url}),o.snippet&&E.jsx("p",{className:"text-muted-foreground line-clamp-2 break-words",children:o.snippet})]},o.url))}),e.resolved&&!e.isError&&!e.denied&&!a&&typeof e.output=="string"&&E.jsx(bc,{label:t("agent.tool.result"),text:e.output})]})}function P$({call:e}){const{t}=Sn(),n=$o(e.input)?e.input:{},r=typeof n.url=="string"?n.url:"",a=typeof e.output=="string"?e.output:"";return E.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&E.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate text-xs underline underline-offset-2",title:r,children:r}),e.resolved&&!e.isError&&!e.denied&&a&&E.jsx(bc,{label:t("agent.tool.result"),text:a})]})}const L$=/^[A-Za-z0-9+/]{256,}={0,2}$/,j$=/^https?:\/\/\S+\.(png|jpe?g|webp|gif)(\?\S*)?$/i;function _$(e){return typeof e!="string"||e.length===0?null:e.startsWith("data:image/")||j$.test(e)?e:L$.test(e.replace(/\s/g,""))?`data:image/png;base64,${e.replace(/\s/g,"")}`:null}function z$(e){if(!e.resolved||e.isError||e.denied)return[];const t=[],n=(r,a)=>{if(t.length>=8||a>3)return;const o=_$(r);if(o){t.push(o);return}if(Array.isArray(r)){for(const l of r)n(l,a+1);return}if($o(r))for(const l of["result","image","images","url","b64_json","data"])l in r&&n(r[l],a+1)};return n(e.output,0),[...new Set(t)]}function F$({images:e}){return e.length===0?null:E.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((t,n)=>E.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"block",children:E.jsx("img",{src:t,alt:"generated",className:"max-h-64 max-w-full rounded-md border border-border object-contain",loading:"lazy"})},n))})}function B$({call:e,hideOutput:t}){const{t:n}=Sn();return E.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.input!==void 0&&E.jsx(bc,{label:n("agent.tool.input"),text:Fv(e.input)}),!t&&e.resolved&&!e.isError&&!e.denied&&e.output!==void 0&&E.jsx(bc,{label:n("agent.tool.result"),text:Fv(e.output)})]})}function H$({call:e,confirmationId:t,onDecide:n,className:r}){const{t:a}=Sn(),o=!!t&&!e.resolved,l=e.resolved&&e.denied,c=e.resolved&&!l?M$(e):null,f=!e.resolved&&!o,d=l&&typeof e.output=="string"?e.output:"",m=`agent.tool.${e.toolName}`,h=["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)?a(m):e.toolName,y=z$(e);return E.jsxs("div",{"data-testid":`agent-tool-card-${e.toolCallId}`,"data-tool-name":e.toolName,"data-tool-denied":l||void 0,className:je("border-border bg-card flex max-w-full min-w-0 flex-col gap-1.5 self-start rounded-lg border p-2",c!==null&&"border-destructive/50",l&&"opacity-80",r),children:[E.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[O$(e.toolName),E.jsx("span",{className:"min-w-0 truncate",children:h}),f&&E.jsx(mc,{className:"text-muted-foreground size-3 animate-spin"}),e.resolved&&!l&&c===null&&E.jsx(fp,{className:"size-3 text-emerald-500"}),c!==null&&E.jsx(Ju,{className:"text-destructive size-3"}),l&&E.jsxs("span",{className:"text-destructive flex items-center gap-0.5",children:[E.jsx(Ua,{className:"size-3"}),a("agent.tool.denied")]})]}),e.toolName==="send_input"&&E.jsx(N$,{call:e}),e.toolName==="read_screen"&&E.jsx(D$,{call:e}),e.toolName==="web_search"&&E.jsx(I$,{call:e}),e.toolName==="fetch_url"&&E.jsx(P$,{call:e}),!["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)&&E.jsx(B$,{call:e,hideOutput:y.length>0}),E.jsx(F$,{images:y}),c!==null&&E.jsx("p",{className:"text-destructive text-xs break-words whitespace-pre-wrap",children:c}),d&&E.jsx("p",{className:"text-muted-foreground text-xs break-words whitespace-pre-wrap",children:d}),o&&t&&E.jsxs("div",{"data-testid":`agent-tool-approval-${e.toolCallId}`,className:"flex items-center gap-2 pt-1",children:[E.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:a("agent.confirm.title")}),E.jsxs(qt,{"data-testid":"agent-confirm-approve",size:"xs",variant:"secondary",onClick:()=>n==null?void 0:n(t,!0),children:[E.jsx(fp,{}),a("agent.confirm.approve")]}),E.jsxs(qt,{"data-testid":"agent-confirm-deny",size:"xs",variant:"destructive",onClick:()=>n==null?void 0:n(t,!1),children:[E.jsx(Ua,{}),a("agent.confirm.deny")]})]})]})}function U$({text:e,className:t}){return E.jsx("div",{"data-testid":"agent-user-message",className:je("bg-primary text-primary-foreground max-w-[85%] self-end rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",t),children:e})}const V$=48;function q$(){return E.jsxs("div",{"data-testid":"agent-running-indicator",className:"flex items-center gap-1 self-start px-1",children:[E.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full"}),E.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:150ms]"}),E.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:300ms]"})]})}function $$({blocks:e,running:t,emptyText:n,confirmationByToolCallId:r,onDecide:a,className:o}){const{t:l}=Sn(),c=v.useRef(null),f=v.useRef(!0),[d,m]=v.useState(!1),h=()=>{const g=c.current;g&&(g.scrollTop=g.scrollHeight,f.current=!0,m(!1))};v.useEffect(()=>{if(f.current){const g=c.current;g&&(g.scrollTop=g.scrollHeight)}else m(!0)},[e,t]);const y=()=>{const g=c.current;if(!g)return;const C=g.scrollHeight-g.scrollTop-g.clientHeight<V$;f.current=C,m(!C)};return e.length===0&&!t?E.jsx("div",{"data-testid":"agent-chat-thread",className:je("flex min-h-0 flex-1 items-center justify-center p-4",o),children:E.jsx("p",{className:"text-muted-foreground text-sm",children:n})}):E.jsxs("div",{className:je("relative min-h-0 flex-1",o),children:[E.jsx("div",{ref:c,"data-testid":"agent-chat-thread",className:"h-full overflow-y-auto p-3",onScroll:y,children:E.jsxs("div",{className:"flex flex-col gap-3",children:[e.map(g=>{switch(g.kind){case"user":return E.jsx(U$,{text:g.text},g.key);case"assistant-text":return E.jsx(c$,{text:g.text,streaming:g.streaming},g.key);case"reasoning":return E.jsx(R$,{text:g.text,streaming:g.streaming},g.key);case"tool-call":return E.jsx(H$,{call:g.call,confirmationId:r.get(g.call.toolCallId),onDecide:a},g.key);default:return null}}),t&&E.jsx(q$,{})]})}),d&&E.jsx(qt,{"data-testid":"agent-scroll-to-bottom",size:"icon-sm",variant:"secondary",className:"absolute right-3 bottom-3 z-10 rounded-full shadow-md",onClick:h,"aria-label":l("agent.panel.scrollToBottom"),children:E.jsx(TF,{})})]})}function hm(e){const t=v.useRef(!0);t.current&&(t.current=!1,e())}function sr(e){const t=nr(Y$,e).current;return t.next=e,Ve(t.effect),t}function Y$(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var vp=Symbol("NOT_FOUND");function W$(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function K$(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function G$(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var zR=e=>Array.isArray(e)?e:[e];function X$(e){const t=Array.isArray(e[0])?e[0]:e;return G$(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Q$(e,t){const n=[],{length:r}=e;for(let a=0;a<r;a++)n.push(e[a].apply(null,t));return n}function Z$(e){let t;return{get(n){return t&&e(t.key,n)?t.value:vp},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function J$(e,t){let n=[];function r(c){const f=n.findIndex(d=>t(c,d.key));if(f>-1){const d=n[f];return f>0&&(n.splice(f,1),n.unshift(d)),d.value}return vp}function a(c,f){r(c)===vp&&(n.unshift({key:c,value:f}),n.length>e&&n.pop())}function o(){return n}function l(){n=[]}return{get:r,put:a,getEntries:o,clear:l}}var eY=(e,t)=>e===t;function tY(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:a}=n;for(let o=0;o<a;o++)if(!e(n[o],r[o]))return!1;return!0}}function nY(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=eY,maxSize:a=1,resultEqualityCheck:o}=n,l=tY(r);let c=0;const f=a<=1?Z$(l):J$(a,l);function d(){let m=f.get(arguments);if(m===vp){if(m=e.apply(null,arguments),c++,o){const y=f.getEntries().find(g=>o(g.value,m));y&&(m=y.value,c!==0&&c--)}f.put(arguments,m)}return m}return d.clearCache=()=>{f.clear(),d.resetResultsCount()},d.resultsCount=()=>c,d.resetResultsCount=()=>{c=0},d}var rY=class{constructor(e){this.value=e}deref(){return this.value}},iY=typeof WeakRef<"u"?WeakRef:rY,aY=0,FR=1;function Oh(){return{s:aY,v:void 0,o:null,p:null}}function ZA(e,t={}){let n=Oh();const{resultEqualityCheck:r}=t;let a,o=0;function l(){var h;let c=n;const{length:f}=arguments;for(let y=0,g=f;y<g;y++){const w=arguments[y];if(typeof w=="function"||typeof w=="object"&&w!==null){let C=c.o;C===null&&(c.o=C=new WeakMap);const T=C.get(w);T===void 0?(c=Oh(),C.set(w,c)):c=T}else{let C=c.p;C===null&&(c.p=C=new Map);const T=C.get(w);T===void 0?(c=Oh(),C.set(w,c)):c=T}}const d=c;let m;if(c.s===FR)m=c.v;else if(m=e.apply(null,arguments),o++,r){const y=((h=a==null?void 0:a.deref)==null?void 0:h.call(a))??a;y!=null&&r(y,m)&&(m=y,o!==0&&o--),a=typeof m=="object"&&m!==null||typeof m=="function"?new iY(m):m}return d.s=FR,d.v=m,m}return l.clearCache=()=>{n=Oh(),l.resetResultsCount()},l.resultsCount=()=>o,l.resetResultsCount=()=>{o=0},l}function JA(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...a)=>{let o=0,l=0,c,f={},d=a.pop();typeof d=="object"&&(f=d,d=a.pop()),W$(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...f},{memoize:h,memoizeOptions:y=[],argsMemoize:g=ZA,argsMemoizeOptions:w=[]}=m,C=zR(y),T=zR(w),S=X$(a),R=h(function(){return o++,d.apply(null,arguments)},...C),k=g(function(){l++;const D=Q$(S,arguments);return c=R.apply(null,D),c},...T);return Object.assign(k,{resultFunc:d,memoizedResultFunc:R,dependencies:S,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:h,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var oY=JA(ZA),sY=Object.assign((e,t=oY)=>{K$(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),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((l,c,f)=>(l[n[f]]=c,l),{}))},{withTypes:()=>sY});JA({memoize:nY,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ge=(e,t,n,r,a,o,...l)=>{if(l.length>0)throw new Error(Cn(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var Rb={exports:{}},kb={};/**
373
- * @license React
374
- * use-sync-external-store-shim/with-selector.production.js
375
- *
376
- * Copyright (c) Meta Platforms, Inc. and affiliates.
377
- *
378
- * This source code is licensed under the MIT license found in the
379
- * LICENSE file in the root directory of this source tree.
380
- */var BR;function lY(){if(BR)return kb;BR=1;var e=Id(),t=ZM();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return kb.useSyncExternalStoreWithSelector=function(d,m,h,y,g){var w=o(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=c(function(){function S(O){if(!R){if(R=!0,k=O,O=y(O),g!==void 0&&C.hasValue){var A=C.value;if(g(A,O))return M=A}return M=O}if(A=M,r(k,O))return A;var L=y(O);return g!==void 0&&g(A,L)?(k=O,A):(k=O,M=L)}var R=!1,k,M,D=h===void 0?null:h;return[function(){return S(m())},D===null?void 0:function(){return S(D())}]},[m,h,y,g]);var T=a(d,w[0],w[1]);return l(function(){C.hasValue=!0,C.value=T},[T]),f(T),T},kb}var HR;function cY(){return HR||(HR=1,Rb.exports=lY()),Rb.exports}var uY=cY();const Bv=[];let Hv;function dY(){return Hv}function fY(e){Bv.push(e)}function vw(e){const t=(n,r)=>{const a=nr(hY).current;let o;try{Hv=a;for(const l of Bv)l.before(a);o=e(n,r);for(const l of Bv)l.after(a);a.didInitialize=!0}finally{Hv=void 0}return o};return t.displayName=e.displayName||e.name,t}function eN(e){return v.forwardRef(vw(e))}function hY(){return{didInitialize:!1}}const pY=Wx(19),mY=pY?yY:bY;function Et(e,t,n,r,a){return mY(e,t,n,r,a)}function gY(e,t,n,r,a){const o=v.useCallback(()=>t(e.getSnapshot(),n,r,a),[e,t,n,r,a]);return Fx.useSyncExternalStore(e.subscribe,o,o)}fY({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],a=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,a))&&(t=!0,r.value=a,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const a of e.syncHooks)n.add(a.store);const r=[];for(const a of n)r.push(a.subscribe(t));return()=>{for(const a of r)a()}}),Fx.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function yY(e,t,n,r,a){const o=dY();if(!o)return gY(e,t,n,r,a);const l=o.syncIndex;o.syncIndex+=1;let c;return o.didInitialize?(c=o.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,a))&&(c.store!==e&&(o.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=a,c.didChange=!0)):(c={store:e,selector:t,a1:n,a2:r,a3:a,value:t(e.getSnapshot(),n,r,a),didChange:!1},o.syncHooks.push(c)),c.value}function bY(e,t,n,r,a){return uY.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,a))}class tN{constructor(t){st(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));st(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(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,r,a){return Et(this,t,n,r,a)}}class pm extends tN{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){v.useDebugValue(t),Ve(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;Ve(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);Ve(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){v.useDebugValue(t);const r=n!==void 0;Ve(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,a){const o=this.selectors[t];return o(this.state,n,r,a)}useState(t,n,r,a){return v.useDebugValue(t),Et(this,this.selectors[t],n,r,a)}useContextCallback(t,n){v.useDebugValue(t);const r=Ye(n??Br);this.context[t]=r}useStateSetter(t){const n=v.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let a=r(this.state);return n(a,a,this),this.subscribe(o=>{const l=r(o);if(!Object.is(a,l)){const c=a;a=l,n(l,c,this)}})}}const Hu=0;class aa{constructor(){st(this,"currentId",Hu);st(this,"clear",()=>{this.currentId!==Hu&&(clearTimeout(this.currentId),this.currentId=Hu)});st(this,"disposeEffect",()=>this.clear)}static create(){return new aa}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Hu,n()},t)}isStarted(){return this.currentId!==Hu}}function Fn(){const e=nr(aa.create).current;return lm(e.disposeEffect),e}function Qt(e){return(e==null?void 0:e.ownerDocument)||document}const Nc=typeof navigator<"u",Mb=xY(),nN=SY(),rN=wY(),mm=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),iN=Mb.platform==="MacIntel"&&Mb.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Mb.platform),aN=Nc&&/apple/i.test(navigator.vendor),Uv=Nc&&/android/i.test(nN)||/android/i.test(rN),vY=Nc&&nN.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,oN=rN.includes("jsdom/");function xY(){if(!Nc)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function wY(){if(!Nc)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function SY(){if(!Nc)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const Vv="data-base-ui-focusable",sN="active",lN="selected",cN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Bo="ArrowLeft",Ho="ArrowRight",xw="ArrowUp",qd="ArrowDown";function ti(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Nt(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&vv(n)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function xp(e,t){if(!cn(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(Nt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Rr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Di(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 EY(e){return e.matches("html,body")}function gm(e){return kn(e)&&e.matches(cN)}function qv(e){return e?e.getAttribute("role")==="combobox"&&gm(e):!1}function CY(e){if(!e||oN)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Sd(e){return e?e.hasAttribute(Vv)?e:e.querySelector(`[${Vv}]`)||e:null}function Fs(e,t,n=!0){return e.filter(a=>{var o;return a.parentId===t&&(!n||((o=a.context)==null?void 0:o.open))}).flatMap(a=>[a,...Fs(e,a.id,n)])}function UR(e,t){var a;let n=[],r=(a=e.find(o=>o.id===t))==null?void 0:a.parentId;for(;r;){const o=e.find(l=>l.id===r);r=o==null?void 0:o.parentId,o&&(n=n.concat(o))}return n}function br(e){e.preventDefault(),e.stopPropagation()}function TY(e){return"nativeEvent"in e}function uN(e){return e.pointerType===""&&e.isTrusted?!0:Uv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function dN(e){return oN?!1:!Uv&&e.width===0&&e.height===0||Uv&&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 Gs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function fN(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const RY=["top","right","bottom","left"],vc=Math.min,ni=Math.max,wp=Math.round,Vl=Math.floor,ta=e=>({x:e,y:e}),kY={left:"right",right:"left",bottom:"top",top:"bottom"},MY={start:"end",end:"start"};function $v(e,t,n){return ni(e,vc(t,n))}function Va(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function Xo(e){return e.split("-")[1]}function ww(e){return e==="x"?"y":"x"}function Sw(e){return e==="y"?"height":"width"}const OY=new Set(["top","bottom"]);function xi(e){return OY.has(Hr(e))?"y":"x"}function Ew(e){return ww(xi(e))}function AY(e,t,n){n===void 0&&(n=!1);const r=Xo(e),a=Ew(e),o=Sw(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Sp(l)),[l,Sp(l)]}function NY(e){const t=Sp(e);return[Yv(e),t,Yv(t)]}function Yv(e){return e.replace(/start|end/g,t=>MY[t])}const VR=["left","right"],qR=["right","left"],DY=["top","bottom"],IY=["bottom","top"];function PY(e,t,n){switch(e){case"top":case"bottom":return n?t?qR:VR:t?VR:qR;case"left":case"right":return t?DY:IY;default:return[]}}function LY(e,t,n,r){const a=Xo(e);let o=PY(Hr(e),n==="start",r);return a&&(o=o.map(l=>l+"-"+a),t&&(o=o.concat(o.map(Yv)))),o}function Sp(e){return e.replace(/left|right|bottom|top/g,t=>kY[t])}function jY(e){return{top:0,right:0,bottom:0,left:0,...e}}function hN(e){return typeof e!="number"?jY(e):{top:e,right:e,bottom:e,left:e}}function Ep(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function Ah(e,t,n){return Math.floor(e/t)!==n}function Wl(e,t){return t<0||t>=e.current.length}function Jh(e,t){return hr(e,{disabledIndices:t})}function Wv(e,t){return hr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function hr(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:a=1}={}){let o=t;do o+=n?-a:a;while(o>=0&&o<=e.current.length-1&&Uo(e,o,r));return o}function pN(e,{event:t,orientation:n,loopFocus:r,rtl:a,cols:o,disabledIndices:l,minIndex:c,maxIndex:f,prevIndex:d,stopEvent:m=!1}){let h=d;const y=[],g={};let w=!1;{let S=null,R=-1;e.current.forEach((k,M)=>{if(k==null)return;const D=k.closest('[role="row"]');D&&(w=!0),(D!==S||R===-1)&&(S=D,R+=1,y[R]=[]),y[R].push(M),g[M]=R})}const C=w&&y.length>0&&y.some(S=>S.length!==o);function T(S){if(!C||d===-1)return;const R=g[d];if(R==null)return;const k=y[R].indexOf(d);let M=S==="up"?R-1:R+1;r&&(M<0?M=y.length-1:M>=y.length&&(M=0));const D=new Set;for(;M>=0&&M<y.length&&!D.has(M);){D.add(M);const O=y[M];if(O.length===0){M=S==="up"?M-1:M+1;continue}const A=Math.min(k,O.length-1);for(let L=A;L>=0;L-=1){const H=O[L];if(!Uo(e,H,l))return H}M=S==="up"?M-1:M+1,r&&(M<0?M=y.length-1:M>=y.length&&(M=0))}}if(t.key===xw){const S=T("up");if(S!==void 0)m&&br(t),h=S;else{if(m&&br(t),d===-1)h=f;else if(h=hr(e,{startingIndex:h,amount:o,decrement:!0,disabledIndices:l}),r&&(d-o<c||h<0)){const R=d%o,k=f%o,M=f-(k-R);k===R?h=f:h=k>R?M:M-o}Wl(e,h)&&(h=d)}}if(t.key===qd){const S=T("down");S!==void 0?(m&&br(t),h=S):(m&&br(t),d===-1?h=c:(h=hr(e,{startingIndex:d,amount:o,disabledIndices:l}),r&&d+o>f&&(h=hr(e,{startingIndex:d%o-o,amount:o,disabledIndices:l}))),Wl(e,h)&&(h=d))}if(n==="both"){const S=Vl(d/o);t.key===(a?Bo:Ho)&&(m&&br(t),d%o!==o-1?(h=hr(e,{startingIndex:d,disabledIndices:l}),r&&Ah(h,o,S)&&(h=hr(e,{startingIndex:d-d%o-1,disabledIndices:l}))):r&&(h=hr(e,{startingIndex:d-d%o-1,disabledIndices:l})),Ah(h,o,S)&&(h=d)),t.key===(a?Ho:Bo)&&(m&&br(t),d%o!==0?(h=hr(e,{startingIndex:d,decrement:!0,disabledIndices:l}),r&&Ah(h,o,S)&&(h=hr(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:l}))):r&&(h=hr(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:l})),Ah(h,o,S)&&(h=d));const R=Vl(f/o)===S;Wl(e,h)&&(r&&R?h=t.key===(a?Ho:Bo)?f:hr(e,{startingIndex:d-d%o-1,disabledIndices:l}):h=d)}return h}function mN(e,t,n){const r=[];let a=0;return e.forEach(({width:o,height:l},c)=>{let f=!1;for(n&&(a=0);!f;){const d=[];for(let m=0;m<o;m+=1)for(let h=0;h<l;h+=1)d.push(a+m+h*t);a%t+o<=t&&d.every(m=>r[m]==null)?(d.forEach(m=>{r[m]=c}),f=!0):a+=1}}),[...r]}function gN(e,t,n,r,a){if(e===-1)return-1;const o=n.indexOf(e),l=t[e];switch(a){case"tl":return o;case"tr":return l?o+l.width-1:o;case"bl":return l?o+(l.height-1)*r:o;case"br":return n.lastIndexOf(e);default:return-1}}function yN(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Uo(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}/*!
381
- * tabbable 6.4.0
382
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
383
- */var _Y=["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] *)"],Cp=_Y.join(","),bN=typeof Element>"u",xc=bN?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Tp=!bN&&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==null?void 0:e.ownerDocument},Rp=function(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=a===""||a==="true",l=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Rp(t.parentNode));return l},zY=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},vN=function(t,n,r){if(Rp(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(Cp));return n&&xc.call(t,Cp)&&a.unshift(t),a=a.filter(r),a},kp=function(t,n,r){for(var a=[],o=Array.from(t);o.length;){var l=o.shift();if(!Rp(l,!1))if(l.tagName==="SLOT"){var c=l.assignedElements(),f=c.length?c:l.children,d=kp(f,!0,r);r.flatten?a.push.apply(a,d):a.push({scopeParent:l,candidates:d})}else{var m=xc.call(l,Cp);m&&r.filter(l)&&(n||!t.includes(l))&&a.push(l);var h=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),y=!Rp(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(h&&y){var g=kp(h===!0?l.children:h.children,!0,r);r.flatten?a.push.apply(a,g):a.push({scopeParent:l,candidates:g})}else o.unshift.apply(o,l.children)}}return a},xN=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},wN=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||zY(t))&&!xN(t)?0:t.tabIndex},FY=function(t,n){var r=wN(t);return r<0&&n&&!xN(t)?0:r},BY=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},SN=function(t){return t.tagName==="INPUT"},HY=function(t){return SN(t)&&t.type==="hidden"},UY=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},VY=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},qY=function(t){if(!t.name)return!0;var n=t.form||Tp(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(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 o=VY(a,t.form);return!o||o===t},$Y=function(t){return SN(t)&&t.type==="radio"},YY=function(t){return $Y(t)&&!qY(t)},WY=function(t){var n,r=t&&Tp(t),a=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var l,c,f;for(o=!!((l=a)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(a)||t!=null&&(f=t.ownerDocument)!==null&&f!==void 0&&f.contains(t));!o&&a;){var d,m,h;r=Tp(a),a=(d=r)===null||d===void 0?void 0:d.host,o=!!((m=a)!==null&&m!==void 0&&(h=m.ownerDocument)!==null&&h!==void 0&&h.contains(a))}}return o},$R=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},KY=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var l=xc.call(t,"details>summary:first-of-type"),c=l?t.parentElement:t;if(xc.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof a=="function"){for(var f=t;t;){var d=t.parentElement,m=Tp(t);if(d&&!d.shadowRoot&&a(d)===!0)return $R(t);t.assignedSlot?t=t.assignedSlot:!d&&m!==t.ownerDocument?t=m.host:t=d}t=f}if(WY(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return $R(t);return!1},GY=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return xc.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},Kv=function(t,n){return!(n.disabled||HY(n)||KY(n,t)||UY(n)||GY(n))},Gv=function(t,n){return!(YY(n)||wN(n)<0||!Kv(t,n))},XY=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},EN=function(t){var n=[],r=[];return t.forEach(function(a,o){var l=!!a.scopeParent,c=l?a.scopeParent:a,f=FY(c,l),d=l?EN(a.candidates):c;f===0?l?n.push.apply(n,d):n.push(c):r.push({documentOrder:o,tabIndex:f,item:a,isScope:l,content:d})}),r.sort(BY).reduce(function(a,o){return o.isScope?a.push.apply(a,o.content):a.push(o.content),a},[]).concat(n)},$d=function(t,n){n=n||{};var r;return n.getShadowRoot?r=kp([t],n.includeContainer,{filter:Gv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:XY}):r=vN(t,n.includeContainer,Gv.bind(null,n)),EN(r)},QY=function(t,n){n=n||{};var r;return n.getShadowRoot?r=kp([t],n.includeContainer,{filter:Kv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=vN(t,n.includeContainer,Kv.bind(null,n)),r},CN=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return xc.call(t,Cp)===!1?!1:Gv(n,t)};const Dc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function TN(e,t){const n=$d(e,Dc()),r=n.length;if(r===0)return;const a=ti(Qt(e)),o=n.indexOf(a),l=o===-1?t===1?0:r-1:o+t;return n[l]}function Cw(e){return TN(Qt(e).body,1)||e}function RN(e){return TN(Qt(e).body,-1)||e}function kN(e,t){if(!e)return null;const n=$d(Qt(e).body,Dc()),r=n.length;if(r===0)return null;const a=n.indexOf(e);if(a===-1)return null;const o=(a+t+r)%r;return n[o]}function ZY(e){return kN(e,1)}function JY(e){return kN(e,-1)}function Kl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Nt(n,r)}function eW(e){$d(e,Dc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function YR(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function MN(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class Tw{constructor(){st(this,"nodesRef",{current:[]});st(this,"events",MN())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const ON=v.createContext(null),AN=v.createContext(null),Ka=()=>{var e;return((e=v.useContext(ON))==null?void 0:e.id)||null},Qo=e=>{const t=v.useContext(AN);return e??t};function NN(e){const t=Js(),n=Qo(e),r=Ka();return Ve(()=>{if(!t)return;const a={id:t,parentId:r};return n==null||n.addNode(a),()=>{n==null||n.removeNode(a)}},[n,t,r]),t}function tW(e){const{children:t,id:n}=e,r=Ka();return E.jsx(ON.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function nW(e){const{children:t,externalTree:n}=e,r=nr(()=>n??new Tw).current;return E.jsx(AN.Provider,{value:r,children:t})}function wc(e){return`data-base-ui-${e}`}function ep(e,t,n){if(n&&!Gs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}const rW=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new aa,currentIdRef:{current:null},currentContextRef:{current:null}});function iW(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{open:a}=t,o=v.useContext(rW),{currentIdRef:l,delayRef:c,timeoutMs:f,initialDelayRef:d,currentContextRef:m,hasProvider:h,timeout:y}=o,[g,w]=v.useState(!1);return Ve(()=>{function C(){var T;w(!1),(T=m.current)==null||T.setIsInstantPhase(!1),l.current=null,m.current=null,c.current=d.current}if(l.current&&!a&&l.current===r){if(w(!1),f){const T=r;return y.start(f,()=>{n.select("open")||l.current&&l.current!==T||C()}),()=>{y.clear()}}C()}},[a,r,l,c,f,d,m,y,n]),Ve(()=>{if(!a)return;const C=m.current,T=l.current;y.clear(),m.current={onOpenChange:n.setOpen,setIsInstantPhase:w},l.current=r,c.current={open:0,close:ep(d.current,"close")},T!==null&&T!==r?(w(!0),C==null||C.setIsInstantPhase(!0),C==null||C.onOpenChange(!1,vt(zi))):(w(!1),C==null||C.setIsInstantPhase(!1))},[a,r,n,l,c,f,d,m,y]),Ve(()=>()=>{m.current=null},[m]),v.useMemo(()=>({hasProvider:h,delayRef:c,isInstantPhase:g}),[h,c,g])}const Sc=v.forwardRef(function(t,n){const[r,a]=v.useState();Ve(()=>{aN&&a("button")},[]);const o={tabIndex:0,role:r};return E.jsx("span",{...t,ref:n,style:Zp,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});let WR=0;function sd(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(WR);const o=()=>e==null?void 0:e.focus({preventScroll:n});a?o():WR=requestAnimationFrame(o)}const Gl={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function KR(e){return e==="inert"?Gl.inert:e==="aria-hidden"?Gl["aria-hidden"]:Gl.none}let Nh=new WeakSet,Dh={},Ob=0;const DN=e=>e&&(e.host||DN(e.parentNode)),aW=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=DN(n);return e.contains(r)?r:null}).filter(n=>n!=null);function oW(e,t,n,r){const a="data-base-ui-inert",o=r?"inert":n?"aria-hidden":null,l=aW(t,e),c=new Set,f=new Set(l),d=[];Dh[a]||(Dh[a]=new WeakMap);const m=Dh[a];l.forEach(h),y(t),c.clear();function h(g){!g||c.has(g)||(c.add(g),g.parentNode&&h(g.parentNode))}function y(g){!g||f.has(g)||[].forEach.call(g.children,w=>{if(Wo(w)!=="script")if(c.has(w))y(w);else{const C=o?w.getAttribute(o):null,T=C!==null&&C!=="false",S=KR(o),R=(S.get(w)||0)+1,k=(m.get(w)||0)+1;S.set(w,R),m.set(w,k),d.push(w),R===1&&T&&Nh.add(w),k===1&&w.setAttribute(a,""),!T&&o&&w.setAttribute(o,o==="inert"?"":"true")}})}return Ob+=1,()=>{d.forEach(g=>{const w=KR(o),T=(w.get(g)||0)-1,S=(m.get(g)||0)-1;w.set(g,T),m.set(g,S),T||(!Nh.has(g)&&o&&g.removeAttribute(o),Nh.delete(g)),S||g.removeAttribute(a)}),Ob-=1,Ob||(Gl.inert=new WeakMap,Gl["aria-hidden"]=new WeakMap,Gl.none=new WeakMap,Nh=new WeakSet,Dh={})}}function sW(e,t=!1,n=!1){const r=Qt(e[0]).body;return oW(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const IN=v.createContext(null),PN=()=>v.useContext(IN),lW=wc("portal");function LN(e={}){const{ref:t,container:n,componentProps:r=Dn,elementProps:a}=e,o=Js(),l=PN(),c=l==null?void 0:l.portalNode,[f,d]=v.useState(null),[m,h]=v.useState(null),y=Ye(T=>{T!==null&&h(T)}),g=v.useRef(null);Ve(()=>{if(n===null){g.current&&(g.current=null,h(null),d(null));return}if(o==null)return;const T=(n&&(qx(n)?n:n.current))??c??document.body;if(T==null){g.current&&(g.current=null,h(null),d(null));return}g.current!==T&&(g.current=T,h(null),d(T))},[n,c,o]);const w=Dt("div",r,{ref:[t,y],props:[{id:o,[lW]:""},a]});return{portalNode:m,portalSubtree:f&&w?pr.createPortal(w,f):null}}const Rw=v.forwardRef(function(t,n){const{children:r,container:a,className:o,render:l,renderGuards:c,...f}=t,{portalNode:d,portalSubtree:m}=LN({container:a,ref:n,componentProps:t,elementProps:f}),h=v.useRef(null),y=v.useRef(null),g=v.useRef(null),w=v.useRef(null),[C,T]=v.useState(null),S=C==null?void 0:C.modal,R=C==null?void 0:C.open,k=typeof c=="boolean"?c:!!C&&!C.modal&&C.open&&!!d;v.useEffect(()=>{if(!d||S)return;function D(O){d&&O.relatedTarget&&Kl(O)&&(O.type==="focusin"?YR:eW)(d)}return d.addEventListener("focusin",D,!0),d.addEventListener("focusout",D,!0),()=>{d.removeEventListener("focusin",D,!0),d.removeEventListener("focusout",D,!0)}},[d,S]),v.useEffect(()=>{!d||R||YR(d)},[R,d]);const M=v.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:y,beforeInsideRef:g,afterInsideRef:w,portalNode:d,setFocusManagerState:T}),[d]);return E.jsxs(v.Fragment,{children:[m,E.jsxs(IN.Provider,{value:M,children:[k&&d&&E.jsx(Sc,{"data-type":"outside",ref:h,onFocus:D=>{var O;if(Kl(D,d))(O=g.current)==null||O.focus();else{const A=C?C.domReference:null,L=RN(A);L==null||L.focus()}}}),k&&d&&E.jsx("span",{"aria-owns":d.id,style:gH}),d&&pr.createPortal(r,d),k&&d&&E.jsx(Sc,{"data-type":"outside",ref:y,onFocus:D=>{var O;if(Kl(D,d))(O=w.current)==null||O.focus();else{const A=C?C.domReference:null,L=Cw(A);L==null||L.focus(),C!=null&&C.closeOnFocusOut&&(C==null||C.onOpenChange(!1,vt($s,D.nativeEvent)))}}})]})]})});function cW(e,t){const n=Bn(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 GR=20;let jo=[];function kw(){jo=jo.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function uW(e){kw(),e&&Wo(e)!=="body"&&(jo.push(new WeakRef(e)),jo.length>GR&&(jo=jo.slice(-GR)))}function Ab(){var e;return kw(),(e=jo[jo.length-1])==null?void 0:e.deref()}function dW(e){if(!e)return null;const t=Dc();return CN(e,t)?e:$d(e,t)[0]||e}function fW(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():ii(e).display!=="none"}function XR(e,t){var l;if(!t.current.includes("floating")&&!((l=e.getAttribute("role"))!=null&&l.includes("dialog")))return;const n=Dc(),a=QY(e,n).filter(c=>{const f=c.getAttribute("data-tabindex")||"";return CN(c,n)||c.hasAttribute("data-tabindex")&&!f.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||a.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Mw(e){const{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:o=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:f=!0,openInteractionType:d="",nextFocusableElement:m,previousFocusableElement:h,beforeContentFocusGuardRef:y,externalTree:g}=e,w="rootStore"in t?t.rootStore:t,C=w.useState("open"),T=w.useState("domReferenceElement"),S=w.useState("floatingElement"),{events:R,dataRef:k}=w.context,M=Ye(()=>{var fe;return(fe=k.current.floatingContext)==null?void 0:fe.nodeId}),D=a===!1,O=qv(T)&&D,A=v.useRef(["content"]),L=sr(a),H=sr(o),F=sr(d),W=Qo(g),j=PN(),q=v.useRef(null),$=v.useRef(null),B=v.useRef(!1),_=v.useRef(!1),z=v.useRef(!1),U=v.useRef(-1),K=v.useRef(""),P=v.useRef(""),V=v.useRef(null),G=v.useRef(null),I=_i(V,y,j==null?void 0:j.beforeInsideRef),Q=_i(G,j==null?void 0:j.afterInsideRef),Z=Fn(),te=Fn(),le=Ud(),pe=j!=null,we=Sd(S),Me=Ye((fe=we)=>fe?$d(fe,Dc()):[]),Pe=Ye(fe=>{const ye=Me(fe);return A.current.map(()=>ye).filter(Boolean).flat()});v.useEffect(()=>{if(r||!c)return;function fe(Le){Le.key==="Tab"&&Nt(we,ti(Qt(we)))&&Me().length===0&&!O&&br(Le)}const ye=Qt(we);return ye.addEventListener("keydown",fe),()=>{ye.removeEventListener("keydown",fe)}},[r,T,we,c,A,O,Me,Pe]),v.useEffect(()=>{if(r||!C)return;const fe=Qt(we);function ye(){z.current=!1}function Le(Ee){const Te=Rr(Ee),J=Nt(S,Te)||Nt(T,Te)||Nt(j==null?void 0:j.portalNode,Te);z.current=!J,P.current=Ee.pointerType||"keyboard",Te!=null&&Te.closest(`[${mH}]`)&&(_.current=!0)}function Oe(){P.current="keyboard"}return fe.addEventListener("pointerdown",Le,!0),fe.addEventListener("pointerup",ye,!0),fe.addEventListener("pointercancel",ye,!0),fe.addEventListener("keydown",Oe,!0),()=>{fe.removeEventListener("pointerdown",Le,!0),fe.removeEventListener("pointerup",ye,!0),fe.removeEventListener("pointercancel",ye,!0),fe.removeEventListener("keydown",Oe,!0)}},[r,S,T,we,C,j]),v.useEffect(()=>{if(r||!f)return;const fe=Qt(we);function ye(){_.current=!0,te.start(0,()=>{_.current=!1})}function Le(Se){const ve=Rr(Se),qe=Me().indexOf(ve);qe!==-1&&(U.current=qe)}function Oe(Se){const ve=Se.relatedTarget,Be=Se.currentTarget,qe=Rr(Se);queueMicrotask(()=>{const De=M(),ut=w.context.triggerElements,he=(ve==null?void 0:ve.hasAttribute(wc("focus-guard")))&&[V.current,G.current,j==null?void 0:j.beforeInsideRef.current,j==null?void 0:j.afterInsideRef.current,j==null?void 0:j.beforeOutsideRef.current,j==null?void 0:j.afterOutsideRef.current,Ia(h),Ia(m)].includes(ve),Ce=!(Nt(T,ve)||Nt(S,ve)||Nt(ve,S)||Nt(j==null?void 0:j.portalNode,ve)||ve!=null&&ut.hasElement(ve)||ut.hasMatchingElement(ee=>Nt(ee,ve))||he||W&&(Fs(W.nodesRef.current,De).find(ee=>{var de,Ae;return Nt((de=ee.context)==null?void 0:de.elements.floating,ve)||Nt((Ae=ee.context)==null?void 0:Ae.elements.domReference,ve)})||UR(W.nodesRef.current,De).find(ee=>{var de,Ae,He;return[(de=ee.context)==null?void 0:de.elements.floating,Sd((Ae=ee.context)==null?void 0:Ae.elements.floating)].includes(ve)||((He=ee.context)==null?void 0:He.elements.domReference)===ve})));if(Be===T&&we&&XR(we,A),l&&Be!==T&&!fW(qe)&&ti(fe)===fe.body){if(kn(we)&&(we.focus(),l==="popup")){le.request(()=>{we.focus()});return}const ee=U.current,de=Me(),Ae=de[ee]||de[de.length-1]||we;kn(Ae)&&Ae.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(O||!c)&&ve&&Ce&&!_.current&&(O||ve!==Ab())&&(B.current=!0,w.setOpen(!1,vt($s,Se)))})}function Ee(){z.current||(k.current.insideReactTree=!0,Z.start(0,()=>{k.current.insideReactTree=!1}))}const Te=kn(T)?T:null,J=[];if(!(!S&&!Te))return Te&&(Te.addEventListener("focusout",Oe),Te.addEventListener("pointerdown",ye),J.push(()=>{Te.removeEventListener("focusout",Oe),Te.removeEventListener("pointerdown",ye)})),S&&(S.addEventListener("focusin",Le),S.addEventListener("focusout",Oe),j&&(S.addEventListener("focusout",Ee,!0),J.push(()=>{S.removeEventListener("focusout",Ee,!0)})),J.push(()=>{S.removeEventListener("focusin",Le),S.removeEventListener("focusout",Oe)})),()=>{J.forEach(Se=>{Se()})}},[r,T,S,we,c,W,j,w,f,l,Me,O,M,A,k,Z,te,le,m,h]),v.useEffect(()=>{var Ee,Te,J;if(r||!S||!C)return;const fe=Array.from(((Ee=j==null?void 0:j.portalNode)==null?void 0:Ee.querySelectorAll(`[${wc("portal")}]`))||[]),Le=(J=(Te=(W?UR(W.nodesRef.current,M()):[]).find(Se=>{var ve;return qv(((ve=Se.context)==null?void 0:ve.elements.domReference)||null)}))==null?void 0:Te.context)==null?void 0:J.elements.domReference,Oe=[S,Le,...fe,q.current,$.current,V.current,G.current,j==null?void 0:j.beforeOutsideRef.current,j==null?void 0:j.afterOutsideRef.current,Ia(h),Ia(m),O?T:null].filter(Se=>Se!=null);return sW(Oe,c||O)},[C,r,T,S,c,A,j,O,W,M,m,h]),Ve(()=>{if(!C||r||!kn(we))return;const fe=Qt(we),ye=ti(fe);queueMicrotask(()=>{const Le=Pe(we),Oe=L.current,Ee=typeof Oe=="function"?Oe(F.current||""):Oe;if(Ee===void 0||Ee===!1)return;let Te;Ee===!0||Ee===null?Te=Le[0]||we:Te=Ia(Ee),Te=Te||Le[0]||we,!Nt(we,ye)&&sd(Te,{preventScroll:Te===we})})},[r,C,we,D,Pe,L,F]),Ve(()=>{if(r||!we)return;const fe=Qt(we),ye=ti(fe);uW(ye);function Le(Te){if(Te.open||(K.current=cW(Te.nativeEvent,P.current)),Te.reason===vr&&Te.nativeEvent.type==="mouseleave"&&(B.current=!0),Te.reason===tm)if(Te.nested)B.current=!1;else if(uN(Te.nativeEvent)||dN(Te.nativeEvent))B.current=!1;else{let J=!1;document.createElement("div").focus({get preventScroll(){return J=!0,!1}}),J?B.current=!1:B.current=!0}}R.on("openchange",Le);const Oe=fe.createElement("span");Oe.setAttribute("tabindex","-1"),Oe.setAttribute("aria-hidden","true"),Object.assign(Oe.style,Zp),pe&&T&&T.insertAdjacentElement("afterend",Oe);function Ee(){const Te=H.current;let J=typeof Te=="function"?Te(K.current):Te;if(J===void 0||J===!1)return null;if(J===null&&(J=!0),typeof J=="boolean"){const ve=T||Ab();return ve&&ve.isConnected?ve:Oe}const Se=T||Ab()||Oe;return Ia(J)||Se}return()=>{R.off("openchange",Le);const Te=ti(fe),J=Nt(S,Te)||W&&Fs(W.nodesRef.current,M(),!1).some(ve=>{var Be;return Nt((Be=ve.context)==null?void 0:Be.elements.floating,Te)}),Se=Ee();queueMicrotask(()=>{const ve=dW(Se),Be=typeof H.current!="boolean";H.current&&!B.current&&kn(ve)&&(!(!Be&&ve!==Te&&Te!==fe.body)||J)&&ve.focus({preventScroll:!0}),Oe.remove(),B.current=!1})}},[r,S,we,H,k,R,W,pe,T,M]),Ve(()=>{if(!mm||C||!S)return;const fe=ti(Qt(S));!kn(fe)||!gm(fe)||Nt(S,fe)&&fe.blur()},[C,S]),Ve(()=>{if(!(r||!j))return j.setFocusManagerState({modal:c,closeOnFocusOut:f,open:C,onOpenChange:w.setOpen,domReference:T}),()=>{j.setFocusManagerState(null)}},[r,j,c,C,w,f,T]),Ve(()=>{if(!(r||!we))return XR(we,A),()=>{queueMicrotask(kw)}},[r,we,A]);const ne=!r&&(c?!O:!0)&&(pe||c);return E.jsxs(v.Fragment,{children:[ne&&E.jsx(Sc,{"data-type":"inside",ref:I,onFocus:fe=>{var ye;if(c){const Le=Pe();sd(Le[Le.length-1])}else if(j!=null&&j.portalNode)if(B.current=!1,Kl(fe,j.portalNode)){const Le=Cw(T);Le==null||Le.focus()}else(ye=Ia(h??j.beforeOutsideRef))==null||ye.focus()}}),n,ne&&E.jsx(Sc,{"data-type":"inside",ref:Q,onFocus:fe=>{var ye;if(c)sd(Pe()[0]);else if(j!=null&&j.portalNode)if(f&&(B.current=!0),Kl(fe,j.portalNode)){const Le=RN(T);Le==null||Le.focus()}else(ye=Ia(m??j.afterOutsideRef))==null||ye.focus()}})]})}function jN(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:a=!0,event:o="click",toggle:l=!0,ignoreMouse:c=!1,stickIfOpen:f=!0,touchOpenDelay:d=0,reason:m=qs}=t,h=v.useRef(void 0),y=Ud(),g=Fn(),w=v.useMemo(()=>({onPointerDown(C){h.current=C.pointerType},onMouseDown(C){const T=h.current,S=C.nativeEvent,R=n.select("open");if(C.button!==0||o==="click"||Gs(T,!0)&&c)return;const k=r.current.openEvent,M=k==null?void 0:k.type,D=n.select("domReferenceElement")!==C.currentTarget,O=R&&D||!(R&&l&&(!(k&&f)||M==="click"||M==="mousedown"));if(gm(S.target)){const L=vt(m,S,S.target);O&&T==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,L)}):n.setOpen(O,L);return}const A=C.currentTarget;y.request(()=>{const L=vt(m,S,A);O&&T==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,L)}):n.setOpen(O,L)})},onClick(C){if(o==="mousedown-only")return;const T=h.current;if(o==="mousedown"&&T){h.current=void 0;return}if(Gs(T,!0)&&c)return;const S=n.select("open"),R=r.current.openEvent,k=n.select("domReferenceElement")!==C.currentTarget,M=S&&k||!(S&&l&&(!(R&&f)||fN(R))),D=vt(m,C.nativeEvent,C.currentTarget);M&&T==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,D)}):n.setOpen(M,D)},onKeyDown(){h.current=void 0}}),[r,o,c,n,f,l,y,g,d,m]);return v.useMemo(()=>a?{reference:w}:Dn,[a,w])}function hW(e,t){let n=null,r=null,a=!1;return{contextElement:e||void 0,getBoundingClientRect(){var g;const o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",f=["mouseenter","mousemove"].includes(((g=t.dataRef.current.openEvent)==null?void 0:g.type)||"")&&t.pointerType!=="touch";let d=o.width,m=o.height,h=o.x,y=o.y;return n==null&&t.x&&l&&(n=o.x-t.x),r==null&&t.y&&c&&(r=o.y-t.y),h-=n||0,y-=r||0,d=0,m=0,!a||f?(d=t.axis==="y"?o.width:0,m=t.axis==="x"?o.height:0,h=l&&t.x!=null?t.x:h,y=c&&t.y!=null?t.y:y):a&&!f&&(m=t.axis==="x"?o.height:m,d=t.axis==="y"?o.width:d),a=!0,{width:d,height:m,x:h,y,top:y,right:h+d,bottom:y+m,left:h}}}}function QR(e){return e!=null&&e.clientX!=null}function pW(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("domReferenceElement"),l=n.context.dataRef,{enabled:c=!0,axis:f="both"}=t,d=v.useRef(!1),m=v.useRef(null),[h,y]=v.useState(),[g,w]=v.useState([]),C=Ye((M,D,O)=>{d.current||l.current.openEvent&&!QR(l.current.openEvent)||n.set("positionReference",hW(O??o,{x:M,y:D,axis:f,dataRef:l,pointerType:h}))}),T=Ye(M=>{r?m.current||w([]):C(M.clientX,M.clientY,M.currentTarget)}),S=Gs(h)?a:r,R=v.useCallback(()=>{if(!S||!c)return;const M=Bn(a);function D(O){const A=Rr(O);Nt(a,A)?(M.removeEventListener("mousemove",D),m.current=null):C(O.clientX,O.clientY)}if(!l.current.openEvent||QR(l.current.openEvent)){M.addEventListener("mousemove",D);const O=()=>{M.removeEventListener("mousemove",D),m.current=null};return m.current=O,O}n.set("positionReference",o)},[S,c,a,l,o,n,C]);v.useEffect(()=>R(),[R,g]),v.useEffect(()=>{c&&!a&&(d.current=!1)},[c,a]),v.useEffect(()=>{!c&&r&&(d.current=!0)},[c,r]);const k=v.useMemo(()=>{function M(D){y(D.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:T,onMouseEnter:T}},[T]);return v.useMemo(()=>c?{reference:k,trigger:k}:{},[c,k])}function ZR(e,t,n){let{reference:r,floating:a}=e;const o=xi(t),l=Ew(t),c=Sw(l),f=Hr(t),d=o==="y",m=r.x+r.width/2-a.width/2,h=r.y+r.height/2-a.height/2,y=r[c]/2-a[c]/2;let g;switch(f){case"top":g={x:m,y:r.y-a.height};break;case"bottom":g={x:m,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-a.width,y:h};break;default:g={x:r.x,y:r.y}}switch(Xo(t)){case"start":g[l]-=y*(n&&d?-1:1);break;case"end":g[l]+=y*(n&&d?-1:1);break}return g}async function mW(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:l,elements:c,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:y=!1,padding:g=0}=Va(t,e),w=hN(g),T=c[y?h==="floating"?"reference":"floating":h],S=Ep(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(T)))==null||n?T:T.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:m,strategy:f})),R=h==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),M=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},D=Ep(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:k,strategy:f}):R);return{top:(S.top-D.top+w.top)/M.y,bottom:(D.bottom-S.bottom+w.bottom)/M.y,left:(S.left-D.left+w.left)/M.x,right:(D.right-S.right+w.right)/M.x}}const gW=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:l}=n,c=o.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:h}=ZR(d,r,f),y=r,g={},w=0;for(let T=0;T<c.length;T++){var C;const{name:S,fn:R}=c[T],{x:k,y:M,data:D,reset:O}=await R({x:m,y:h,initialPlacement:r,placement:y,strategy:a,middlewareData:g,rects:d,platform:{...l,detectOverflow:(C=l.detectOverflow)!=null?C:mW},elements:{reference:e,floating:t}});m=k??m,h=M??h,g={...g,[S]:{...g[S],...D}},O&&w<=50&&(w++,typeof O=="object"&&(O.placement&&(y=O.placement),O.rects&&(d=O.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):O.rects),{x:m,y:h}=ZR(d,y,f)),T=-1)}return{x:m,y:h,placement:y,strategy:a,middlewareData:g}},yW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:l,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:y,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...T}=Va(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=Hr(a),R=xi(c),k=Hr(c)===c,M=await(f.isRTL==null?void 0:f.isRTL(d.floating)),D=y||(k||!C?[Sp(c)]:NY(c)),O=w!=="none";!y&&O&&D.push(...LY(c,C,w,M));const A=[c,...D],L=await f.detectOverflow(t,T),H=[];let F=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&H.push(L[S]),h){const $=AY(a,l,M);H.push(L[$[0]],L[$[1]])}if(F=[...F,{placement:a,overflows:H}],!H.every($=>$<=0)){var W,j;const $=(((W=o.flip)==null?void 0:W.index)||0)+1,B=A[$];if(B&&(!(h==="alignment"?R!==xi(B):!1)||F.every(U=>xi(U.placement)===R?U.overflows[0]>0:!0)))return{data:{index:$,overflows:F},reset:{placement:B}};let _=(j=F.filter(z=>z.overflows[0]<=0).sort((z,U)=>z.overflows[1]-U.overflows[1])[0])==null?void 0:j.placement;if(!_)switch(g){case"bestFit":{var q;const z=(q=F.filter(U=>{if(O){const K=xi(U.placement);return K===R||K==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(K=>K>0).reduce((K,P)=>K+P,0)]).sort((U,K)=>U[1]-K[1])[0])==null?void 0:q[0];z&&(_=z);break}case"initialPlacement":_=c;break}if(a!==_)return{reset:{placement:_}}}return{}}}};function JR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ek(e){return RY.some(t=>e[t]>=0)}const bW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...o}=Va(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...o,elementContext:"reference"}),c=JR(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:ek(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...o,altBoundary:!0}),c=JR(l,n.floating);return{data:{escapedOffsets:c,escaped:ek(c)}}}default:return{}}}}},_N=new Set(["left","top"]);async function vW(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Hr(n),c=Xo(n),f=xi(n)==="y",d=_N.has(l)?-1:1,m=o&&f?-1:1,h=Va(t,e);let{mainAxis:y,crossAxis:g,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof w=="number"&&(g=c==="end"?w*-1:w),f?{x:g*m,y:y*d}:{x:y*d,y:g*m}}const xW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:l,middlewareData:c}=t,f=await vW(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:o+f.y,data:{...f,placement:l}}}}},wW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:o}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:S=>{let{x:R,y:k}=S;return{x:R,y:k}}},...d}=Va(e,t),m={x:n,y:r},h=await o.detectOverflow(t,d),y=xi(Hr(a)),g=ww(y);let w=m[g],C=m[y];if(l){const S=g==="y"?"top":"left",R=g==="y"?"bottom":"right",k=w+h[S],M=w-h[R];w=$v(k,w,M)}if(c){const S=y==="y"?"top":"left",R=y==="y"?"bottom":"right",k=C+h[S],M=C-h[R];C=$v(k,C,M)}const T=f.fn({...t,[g]:w,[y]:C});return{...T,data:{x:T.x-n,y:T.y-r,enabled:{[g]:l,[y]:c}}}}}},SW=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:l}=t,{offset:c=0,mainAxis:f=!0,crossAxis:d=!0}=Va(e,t),m={x:n,y:r},h=xi(a),y=ww(h);let g=m[y],w=m[h];const C=Va(c,t),T=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(f){const k=y==="y"?"height":"width",M=o.reference[y]-o.floating[k]+T.mainAxis,D=o.reference[y]+o.reference[k]-T.mainAxis;g<M?g=M:g>D&&(g=D)}if(d){var S,R;const k=y==="y"?"width":"height",M=_N.has(Hr(a)),D=o.reference[h]-o.floating[k]+(M&&((S=l.offset)==null?void 0:S[h])||0)+(M?0:T.crossAxis),O=o.reference[h]+o.reference[k]+(M?0:((R=l.offset)==null?void 0:R[h])||0)-(M?T.crossAxis:0);w<D?w=D:w>O&&(w=O)}return{[y]:g,[h]:w}}}},EW=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:l,elements:c}=t,{apply:f=()=>{},...d}=Va(e,t),m=await l.detectOverflow(t,d),h=Hr(a),y=Xo(a),g=xi(a)==="y",{width:w,height:C}=o.floating;let T,S;h==="top"||h==="bottom"?(T=h,S=y===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(S=h,T=y==="end"?"top":"bottom");const R=C-m.top-m.bottom,k=w-m.left-m.right,M=vc(C-m[T],R),D=vc(w-m[S],k),O=!t.middlewareData.shift;let A=M,L=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=R),O&&!y){const F=ni(m.left,0),W=ni(m.right,0),j=ni(m.top,0),q=ni(m.bottom,0);g?L=w-2*(F!==0||W!==0?F+W:ni(m.left,m.right)):A=C-2*(j!==0||q!==0?j+q:ni(m.top,m.bottom))}await f({...t,availableWidth:L,availableHeight:A});const H=await l.getDimensions(c.floating);return w!==H.width||C!==H.height?{reset:{rects:!0}}:{}}}};function zN(e){const t=ii(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=kn(e),o=a?e.offsetWidth:n,l=a?e.offsetHeight:r,c=wp(n)!==o||wp(r)!==l;return c&&(n=o,r=l),{width:n,height:r,$:c}}function Ow(e){return cn(e)?e:e.contextElement}function Xl(e){const t=Ow(e);if(!kn(t))return ta(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=zN(t);let l=(o?wp(n.width):n.width)/r,c=(o?wp(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const CW=ta(0);function FN(e){const t=Bn(e);return!Gp()||!t.visualViewport?CW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function TW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bn(e)?!1:t}function Xs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=Ow(e);let l=ta(1);t&&(r?cn(r)&&(l=Xl(r)):l=Xl(e));const c=TW(o,n,r)?FN(o):ta(0);let f=(a.left+c.x)/l.x,d=(a.top+c.y)/l.y,m=a.width/l.x,h=a.height/l.y;if(o){const y=Bn(o),g=r&&cn(r)?Bn(r):r;let w=y,C=xv(w);for(;C&&r&&g!==w;){const T=Xl(C),S=C.getBoundingClientRect(),R=ii(C),k=S.left+(C.clientLeft+parseFloat(R.paddingLeft))*T.x,M=S.top+(C.clientTop+parseFloat(R.paddingTop))*T.y;f*=T.x,d*=T.y,m*=T.x,h*=T.y,f+=k,d+=M,w=Bn(C),C=xv(w)}}return Ep({width:m,height:h,x:f,y:d})}function ym(e,t){const n=Xp(e).scrollLeft;return t?t.left+n:Xs(la(e)).left+n}function BN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ym(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function RW(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",l=la(r),c=t?Kp(t.floating):!1;if(r===l||c&&o)return n;let f={scrollLeft:0,scrollTop:0},d=ta(1);const m=ta(0),h=kn(r);if((h||!h&&!o)&&((Wo(r)!=="body"||Ko(l))&&(f=Xp(r)),kn(r))){const g=Xs(r);d=Xl(r),m.x=g.x+r.clientLeft,m.y=g.y+r.clientTop}const y=l&&!h&&!o?BN(l,f):ta(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+m.x+y.x,y:n.y*d.y-f.scrollTop*d.y+m.y+y.y}}function kW(e){return Array.from(e.getClientRects())}function MW(e){const t=la(e),n=Xp(e),r=e.ownerDocument.body,a=ni(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ni(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ym(e);const c=-n.scrollTop;return ii(r).direction==="rtl"&&(l+=ni(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:l,y:c}}const tk=25;function OW(e,t){const n=Bn(e),r=la(e),a=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,c=0,f=0;if(a){o=a.width,l=a.height;const m=Gp();(!m||m&&t==="fixed")&&(c=a.offsetLeft,f=a.offsetTop)}const d=ym(r);if(d<=0){const m=r.ownerDocument,h=m.body,y=getComputedStyle(h),g=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,w=Math.abs(r.clientWidth-h.clientWidth-g);w<=tk&&(o-=w)}else d<=tk&&(o+=d);return{width:o,height:l,x:c,y:f}}const AW=new Set(["absolute","fixed"]);function NW(e,t){const n=Xs(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=kn(e)?Xl(e):ta(1),l=e.clientWidth*o.x,c=e.clientHeight*o.y,f=a*o.x,d=r*o.y;return{width:l,height:c,x:f,y:d}}function nk(e,t,n){let r;if(t==="viewport")r=OW(e,n);else if(t==="document")r=MW(la(e));else if(cn(t))r=NW(t,n);else{const a=FN(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Ep(r)}function HN(e,t){const n=ia(e);return n===t||!cn(n)||ea(n)?!1:ii(n).position==="fixed"||HN(n,t)}function DW(e,t){const n=t.get(e);if(n)return n;let r=Fo(e,[],!1).filter(c=>cn(c)&&Wo(c)!=="body"),a=null;const o=ii(e).position==="fixed";let l=o?ia(e):e;for(;cn(l)&&!ea(l);){const c=ii(l),f=$x(l);!f&&c.position==="fixed"&&(a=null),(o?!f&&!a:!f&&c.position==="static"&&!!a&&AW.has(a.position)||Ko(l)&&!f&&HN(e,l))?r=r.filter(m=>m!==l):a=c,l=ia(l)}return t.set(e,r),r}function IW(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?Kp(t)?[]:DW(t,this._c):[].concat(n),r],c=l[0],f=l.reduce((d,m)=>{const h=nk(t,m,a);return d.top=ni(h.top,d.top),d.right=vc(h.right,d.right),d.bottom=vc(h.bottom,d.bottom),d.left=ni(h.left,d.left),d},nk(t,c,a));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function PW(e){const{width:t,height:n}=zN(e);return{width:t,height:n}}function LW(e,t,n){const r=kn(t),a=la(t),o=n==="fixed",l=Xs(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const f=ta(0);function d(){f.x=ym(a)}if(r||!r&&!o)if((Wo(t)!=="body"||Ko(a))&&(c=Xp(t)),r){const g=Xs(t,!0,o,t);f.x=g.x+t.clientLeft,f.y=g.y+t.clientTop}else a&&d();o&&!r&&a&&d();const m=a&&!r&&!o?BN(a,c):ta(0),h=l.left+c.scrollLeft-f.x-m.x,y=l.top+c.scrollTop-f.y-m.y;return{x:h,y,width:l.width,height:l.height}}function Nb(e){return ii(e).position==="static"}function rk(e,t){if(!kn(e)||ii(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return la(e)===n&&(n=n.ownerDocument.body),n}function UN(e,t){const n=Bn(e);if(Kp(e))return n;if(!kn(e)){let a=ia(e);for(;a&&!ea(a);){if(cn(a)&&!Nb(a))return a;a=ia(a)}return n}let r=rk(e,t);for(;r&&BB(r)&&Nb(r);)r=rk(r,t);return r&&ea(r)&&Nb(r)&&!$x(r)?n:r||$B(e)||n}const jW=async function(e){const t=this.getOffsetParent||UN,n=this.getDimensions,r=await n(e.floating);return{reference:LW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _W(e){return ii(e).direction==="rtl"}const zW={convertOffsetParentRelativeRectToViewportRelativeRect:RW,getDocumentElement:la,getClippingRect:IW,getOffsetParent:UN,getElementRects:jW,getClientRects:kW,getDimensions:PW,getScale:Xl,isElement:cn,isRTL:_W};function VN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function FW(e,t){let n=null,r;const a=la(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function l(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),o();const d=e.getBoundingClientRect(),{left:m,top:h,width:y,height:g}=d;if(c||t(),!y||!g)return;const w=Vl(h),C=Vl(a.clientWidth-(m+y)),T=Vl(a.clientHeight-(h+g)),S=Vl(m),k={rootMargin:-w+"px "+-C+"px "+-T+"px "+-S+"px",threshold:ni(0,vc(1,f))||1};let M=!0;function D(O){const A=O[0].intersectionRatio;if(A!==f){if(!M)return l();A?l(!1,A):r=setTimeout(()=>{l(!1,1e-7)},1e3)}A===1&&!VN(d,e.getBoundingClientRect())&&l(),M=!1}try{n=new IntersectionObserver(D,{...k,root:a.ownerDocument})}catch{n=new IntersectionObserver(D,k)}n.observe(e)}return l(!0),o}function ik(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=Ow(e),m=a||o?[...d?Fo(d):[],...Fo(t)]:[];m.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const h=d&&c?FW(d,n):null;let y=-1,g=null;l&&(g=new ResizeObserver(S=>{let[R]=S;R&&R.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var k;(k=g)==null||k.observe(t)})),n()}),d&&!f&&g.observe(d),g.observe(t));let w,C=f?Xs(e):null;f&&T();function T(){const S=Xs(e);C&&!VN(C,S)&&n(),C=S,w=requestAnimationFrame(T)}return n(),()=>{var S;m.forEach(R=>{a&&R.removeEventListener("scroll",n),o&&R.removeEventListener("resize",n)}),h==null||h(),(S=g)==null||S.disconnect(),g=null,f&&cancelAnimationFrame(w)}}const BW=xW,HW=wW,UW=yW,VW=EW,qW=bW,$W=SW,YW=(e,t,n)=>{const r=new Map,a={platform:zW,...n},o={...a.platform,_c:r};return gW(e,t,{...a,platform:o})};var WW=typeof document<"u",KW=function(){},tp=WW?v.useLayoutEffect:KW;function Mp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Mp(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!Mp(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function qN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ak(e,t){const n=qN(e);return Math.round(t*n)/n}function Db(e){const t=v.useRef(e);return tp(()=>{t.current=e}),t}function GW(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:l}={},transform:c=!0,whileElementsMounted:f,open:d}=e,[m,h]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,g]=v.useState(r);Mp(y,r)||g(r);const[w,C]=v.useState(null),[T,S]=v.useState(null),R=v.useCallback(U=>{U!==O.current&&(O.current=U,C(U))},[]),k=v.useCallback(U=>{U!==A.current&&(A.current=U,S(U))},[]),M=o||w,D=l||T,O=v.useRef(null),A=v.useRef(null),L=v.useRef(m),H=f!=null,F=Db(f),W=Db(a),j=Db(d),q=v.useCallback(()=>{if(!O.current||!A.current)return;const U={placement:t,strategy:n,middleware:y};W.current&&(U.platform=W.current),YW(O.current,A.current,U).then(K=>{const P={...K,isPositioned:j.current!==!1};$.current&&!Mp(L.current,P)&&(L.current=P,pr.flushSync(()=>{h(P)}))})},[y,t,n,W,j]);tp(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,h(U=>({...U,isPositioned:!1})))},[d]);const $=v.useRef(!1);tp(()=>($.current=!0,()=>{$.current=!1}),[]),tp(()=>{if(M&&(O.current=M),D&&(A.current=D),M&&D){if(F.current)return F.current(M,D,q);q()}},[M,D,q,F,H]);const B=v.useMemo(()=>({reference:O,floating:A,setReference:R,setFloating:k}),[R,k]),_=v.useMemo(()=>({reference:M,floating:D}),[M,D]),z=v.useMemo(()=>{const U={position:n,left:0,top:0};if(!_.floating)return U;const K=ak(_.floating,m.x),P=ak(_.floating,m.y);return c?{...U,transform:"translate("+K+"px, "+P+"px)",...qN(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:P}},[n,c,_.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:q,refs:B,elements:_,floatingStyles:z}),[m,q,B,_,z])}const XW=(e,t)=>({...BW(e),options:[e,t]}),QW=(e,t)=>({...HW(e),options:[e,t]}),ZW=(e,t)=>({...$W(e),options:[e,t]}),JW=(e,t)=>({...UW(e),options:[e,t]}),eK=(e,t)=>({...VW(e),options:[e,t]}),tK=(e,t)=>({...qW(e),options:[e,t]}),nK={intentional:"onClick",sloppy:"onPointerDown"};function rK(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function bm(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("referenceElement"),l=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:f}=n.context,{enabled:d=!0,escapeKey:m=!0,outsidePress:h=!0,outsidePressEvent:y="sloppy",referencePress:g=!1,referencePressEvent:w="sloppy",ancestorScroll:C=!1,bubbles:T,externalTree:S}=t,R=Qo(S),k=Ye(typeof h=="function"?h:()=>!1),M=typeof h=="function"?k:h,D=v.useRef(!1),{escapeKey:O,outsidePress:A}=rK(T),L=v.useRef(null),H=Fn(),F=Fn(),W=Ye(()=>{F.clear(),f.current.insideReactTree=!1}),j=v.useRef(!1),q=v.useRef(""),$=Ye(ne=>{q.current=ne.pointerType}),B=Ye(()=>{const ne=q.current,fe=ne==="pen"||!ne?"mouse":ne,ye=typeof y=="function"?y():y;return typeof ye=="string"?ye:ye[fe]}),_=Ye(ne=>{var Ee;if(!r||!d||!m||ne.key!=="Escape"||j.current)return;const fe=(Ee=f.current.floatingContext)==null?void 0:Ee.nodeId,ye=R?Fs(R.nodesRef.current,fe):[];if(!O&&ye.length>0){let Te=!0;if(ye.forEach(J=>{var Se;(Se=J.context)!=null&&Se.open&&!J.context.dataRef.current.__escapeKeyBubbles&&(Te=!1)}),!Te)return}const Le=TY(ne)?ne.nativeEvent:ne,Oe=vt(nm,Le);n.setOpen(!1,Oe),!O&&!Oe.isPropagationAllowed&&ne.stopPropagation()}),z=Ye(ne=>{const fe=B();return fe==="intentional"&&ne.type!=="click"||fe==="sloppy"&&ne.type==="click"}),U=Ye(()=>{f.current.insideReactTree=!0,F.start(0,W)}),K=Ye((ne,fe=!1)=>{var Be;if(z(ne)){W();return}if(f.current.insideReactTree){W();return}if(B()==="intentional"&&fe||typeof M=="function"&&!M(ne))return;const ye=Rr(ne),Le=`[${wc("inert")}]`,Oe=Qt(n.select("floatingElement")).querySelectorAll(Le),Ee=n.context.triggerElements;if(ye&&(Ee.hasElement(ye)||Ee.hasMatchingElement(qe=>Nt(qe,ye))))return;let Te=cn(ye)?ye:null;for(;Te&&!ea(Te);){const qe=ia(Te);if(ea(qe)||!cn(qe))break;Te=qe}if(Oe.length&&cn(ye)&&!EY(ye)&&!Nt(ye,n.select("floatingElement"))&&Array.from(Oe).every(qe=>!Nt(Te,qe)))return;if(kn(ye)&&!("touches"in ne)){const qe=ea(ye),De=ii(ye),ut=/auto|scroll/,he=qe||ut.test(De.overflowX),Ce=qe||ut.test(De.overflowY),ee=he&&ye.clientWidth>0&&ye.scrollWidth>ye.clientWidth,de=Ce&&ye.clientHeight>0&&ye.scrollHeight>ye.clientHeight,Ae=De.direction==="rtl",He=de&&(Ae?ne.offsetX<=ye.offsetWidth-ye.clientWidth:ne.offsetX>ye.clientWidth),$e=ee&&ne.offsetY>ye.clientHeight;if(He||$e)return}const J=(Be=f.current.floatingContext)==null?void 0:Be.nodeId,Se=R&&Fs(R.nodesRef.current,J).some(qe=>{var De;return Di(ne,(De=qe.context)==null?void 0:De.elements.floating)});if(Di(ne,n.select("floatingElement"))||Di(ne,n.select("domReferenceElement"))||Se)return;const ve=R?Fs(R.nodesRef.current,J):[];if(ve.length>0){let qe=!0;if(ve.forEach(De=>{var ut;(ut=De.context)!=null&&ut.open&&!De.context.dataRef.current.__outsidePressBubbles&&(qe=!1)}),!qe)return}n.setOpen(!1,vt(tm,ne)),W()}),P=Ye(ne=>{B()!=="sloppy"||ne.pointerType==="touch"||!n.select("open")||!d||Di(ne,n.select("floatingElement"))||Di(ne,n.select("domReferenceElement"))||K(ne)}),V=Ye(ne=>{if(B()!=="sloppy"||!n.select("open")||!d||Di(ne,n.select("floatingElement"))||Di(ne,n.select("domReferenceElement")))return;const fe=ne.touches[0];fe&&(L.current={startTime:Date.now(),startX:fe.clientX,startY:fe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},H.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}),G=Ye(ne=>{const fe=Rr(ne);function ye(){V(ne),fe==null||fe.removeEventListener(ne.type,ye)}fe==null||fe.addEventListener(ne.type,ye)}),I=Ye(ne=>{const fe=D.current;if(D.current=!1,H.clear(),ne.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const ye=Rr(ne);function Le(){ne.type==="pointerdown"?P(ne):K(ne,fe),ye==null||ye.removeEventListener(ne.type,Le)}ye==null||ye.addEventListener(ne.type,Le)}),Q=Ye(ne=>{if(B()!=="sloppy"||!L.current||Di(ne,n.select("floatingElement"))||Di(ne,n.select("domReferenceElement")))return;const fe=ne.touches[0];if(!fe)return;const ye=Math.abs(fe.clientX-L.current.startX),Le=Math.abs(fe.clientY-L.current.startY),Oe=Math.sqrt(ye*ye+Le*Le);Oe>5&&(L.current.dismissOnTouchEnd=!0),Oe>10&&(K(ne),H.clear(),L.current=null)}),Z=Ye(ne=>{const fe=Rr(ne);function ye(){Q(ne),fe==null||fe.removeEventListener(ne.type,ye)}fe==null||fe.addEventListener(ne.type,ye)}),te=Ye(ne=>{B()!=="sloppy"||!L.current||Di(ne,n.select("floatingElement"))||Di(ne,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&K(ne),H.clear(),L.current=null)}),le=Ye(ne=>{const fe=Rr(ne);function ye(){te(ne),fe==null||fe.removeEventListener(ne.type,ye)}fe==null||fe.addEventListener(ne.type,ye)});v.useEffect(()=>{if(!r||!d)return;f.current.__escapeKeyBubbles=O,f.current.__outsidePressBubbles=A;const ne=new aa;function fe(Te){n.setOpen(!1,vt(zi,Te))}function ye(){ne.clear(),j.current=!0}function Le(){ne.start(Gp()?5:0,()=>{j.current=!1})}const Oe=Qt(a);Oe.addEventListener("pointerdown",$,!0),m&&(Oe.addEventListener("keydown",_),Oe.addEventListener("compositionstart",ye),Oe.addEventListener("compositionend",Le)),M&&(Oe.addEventListener("click",I,!0),Oe.addEventListener("pointerdown",I,!0),Oe.addEventListener("touchstart",G,!0),Oe.addEventListener("touchmove",Z,!0),Oe.addEventListener("touchend",le,!0),Oe.addEventListener("mousedown",I,!0));let Ee=[];return C&&(cn(l)&&(Ee=Fo(l)),cn(a)&&(Ee=Ee.concat(Fo(a))),!cn(o)&&o&&o.contextElement&&(Ee=Ee.concat(Fo(o.contextElement)))),Ee=Ee.filter(Te=>{var J;return Te!==((J=Oe.defaultView)==null?void 0:J.visualViewport)}),Ee.forEach(Te=>{Te.addEventListener("scroll",fe,{passive:!0})}),()=>{Oe.removeEventListener("pointerdown",$,!0),m&&(Oe.removeEventListener("keydown",_),Oe.removeEventListener("compositionstart",ye),Oe.removeEventListener("compositionend",Le)),M&&(Oe.removeEventListener("click",I,!0),Oe.removeEventListener("pointerdown",I,!0),Oe.removeEventListener("touchstart",G,!0),Oe.removeEventListener("touchmove",Z,!0),Oe.removeEventListener("touchend",le,!0),Oe.removeEventListener("mousedown",I,!0)),Ee.forEach(Te=>{Te.removeEventListener("scroll",fe)}),ne.clear(),D.current=!1}},[f,a,o,l,m,M,r,c,C,d,O,A,_,K,I,P,G,Z,le,$,n]),v.useEffect(W,[M,W]);const pe=v.useMemo(()=>({onKeyDown:_,...g&&{[nK[w]]:ne=>{n.setOpen(!1,vt(qs,ne.nativeEvent))},...w!=="intentional"&&{onClick(ne){n.setOpen(!1,vt(qs,ne.nativeEvent))}}}}),[_,n,g,w]),we=Ye(ne=>{const fe=Rr(ne.nativeEvent);!Nt(n.select("floatingElement"),fe)||ne.button!==0||(D.current=!0)}),Me=Ye(ne=>{!r||!d||ne.button!==0||(D.current=!0)}),Pe=v.useMemo(()=>({onKeyDown:_,onPointerDown:we,onMouseDown:we,onMouseUp:we,onClickCapture:U,onMouseDownCapture(ne){U(),Me(ne)},onPointerDownCapture(ne){U(),Me(ne)},onMouseUpCapture:U,onTouchEndCapture:U,onTouchMoveCapture:U}),[_,we,U,Me]);return v.useMemo(()=>d?{reference:pe,floating:Pe,trigger:pe}:{},[d,pe,Pe])}const iK={open:Ge(e=>e.open),domReferenceElement:Ge(e=>e.domReferenceElement),referenceElement:Ge(e=>e.positionReference??e.referenceElement),floatingElement:Ge(e=>e.floatingElement),floatingId:Ge(e=>e.floatingId)};class Aw extends pm{constructor(n){const{nested:r,noEmit:a,onOpenChange:o,triggerElements:l,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:MN(),nested:r,noEmit:a,triggerElements:l},iK);st(this,"setOpen",(n,r)=>{var a,o;if((!n||!this.state.open||fN(r.event))&&(this.context.dataRef.current.openEvent=n?r.event:void 0),!this.context.noEmit){const l={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",l)}(o=(a=this.context).onOpenChange)==null||o.call(a,n,r)})}}function aK(e,t){const n=v.useRef(null),r=v.useRef(null);return v.useCallback(a=>{if(e!==void 0){if(n.current!==null){const o=n.current,l=r.current,c=t.context.triggerElements.getById(o);l&&c===l&&t.context.triggerElements.delete(o),n.current=null,r.current=null}a!==null&&(n.current=e,r.current=a,t.context.triggerElements.add(e,a))}},[t,e])}function $N(e,t,n,r){const a=n.useState("isMountedByTrigger",e),o=aK(e,n),l=Ye(c=>{if(o(c),!c||!n.select("open"))return;const f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:c,...r});return}f==null&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return Ve(()=>{a&&n.update({activeTriggerElement:t.current,...r})},[a,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:a}}function Nw(e){const t=e.useState("open");Ve(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,a]=n.value;e.update({activeTriggerId:r,activeTriggerElement:a})}}},[t,e])}function Dw(e,t,n){const{mounted:r,setMounted:a,transitionStatus:o}=Vd(e);t.useSyncedValues({mounted:r,transitionStatus:o});const l=Ye(()=>{var f,d;a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n==null||n(),(d=(f=t.context).onOpenChangeComplete)==null||d.call(f,!1)}),c=t.useState("preventUnmountingOnClose");return Wa({enabled:!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}class Yd{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),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 oK(){return new Aw({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Yd,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Iw(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:oK(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Dn,inactiveTriggerProps:Dn,popupProps:Dn}}const Ih=Ge(e=>e.triggerIdProp??e.activeTriggerId),Pw={open:Ge(e=>e.openProp??e.open),mounted:Ge(e=>e.mounted),transitionStatus:Ge(e=>e.transitionStatus),floatingRootContext:Ge(e=>e.floatingRootContext),preventUnmountingOnClose:Ge(e=>e.preventUnmountingOnClose),payload:Ge(e=>e.payload),activeTriggerId:Ih,activeTriggerElement:Ge(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Ge((e,t)=>t!==void 0&&Ih(e)===t),isOpenedByTrigger:Ge((e,t)=>t!==void 0&&Ih(e)===t&&e.open),isMountedByTrigger:Ge((e,t)=>t!==void 0&&Ih(e)===t&&e.mounted),triggerProps:Ge((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Ge(e=>e.popupProps),popupElement:Ge(e=>e.popupElement),positionerElement:Ge(e=>e.positionerElement)};function YN(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,a=Js(),o=Ka()!=null,l=nr(()=>new Aw({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Yd,floatingId:a,nested:o,noEmit:!1})).current;return Ve(()=>{const c={open:t,floatingId:a};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=cn(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),l.update(c)},[t,a,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=o,l.context.noEmit=!1,l}function sK(e={}){const{nodeId:t,externalTree:n}=e,r=YN(e),a=e.rootContext||r,o={reference:a.useState("referenceElement"),floating:a.useState("floatingElement"),domReference:a.useState("domReferenceElement")},[l,c]=v.useState(null),f=v.useRef(null),d=Qo(n);Ve(()=>{o.domReference&&(f.current=o.domReference)},[o.domReference]);const m=GW({...e,elements:{...o,...l&&{reference:l}}}),h=v.useCallback(A=>{const L=cn(A)?{getBoundingClientRect:()=>A.getBoundingClientRect(),getClientRects:()=>A.getClientRects(),contextElement:A}:A;c(L),m.refs.setReference(L)},[m.refs]),[y,g]=v.useState(null),[w,C]=v.useState(null);a.useSyncedValue("referenceElement",y),a.useSyncedValue("domReferenceElement",cn(y)?y:null),a.useSyncedValue("floatingElement",w);const T=v.useCallback(A=>{(cn(A)||A===null)&&(f.current=A,g(A)),(cn(m.refs.reference.current)||m.refs.reference.current===null||A!==null&&!cn(A))&&m.refs.setReference(A)},[m.refs,g]),S=v.useCallback(A=>{C(A),m.refs.setFloating(A)},[m.refs]),R=v.useMemo(()=>({...m.refs,setReference:T,setFloating:S,setPositionReference:h,domReference:f}),[m.refs,T,S,h]),k=v.useMemo(()=>({...m.elements,domReference:o.domReference}),[m.elements,o.domReference]),M=a.useState("open"),D=a.useState("floatingId"),O=v.useMemo(()=>({...m,dataRef:a.context.dataRef,open:M,onOpenChange:a.setOpen,events:a.context.events,floatingId:D,refs:R,elements:k,nodeId:t,rootStore:a}),[m,R,k,t,a,M,D]);return Ve(()=>{a.context.dataRef.current.floatingContext=O;const A=d==null?void 0:d.nodesRef.current.find(L=>L.id===t);A&&(A.context=O)}),v.useMemo(()=>({...m,context:O,refs:R,elements:k,rootStore:a}),[m,R,k,O,a])}function Lw(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:a}=e,o=Js(),l=Ka()!=null,c=t.useState("open"),f=t.useState("activeTriggerElement"),d=t.useState(r?"popupElement":"positionerElement"),m=t.context.triggerElements,h=nr(()=>new Aw({open:c,referenceElement:f,floatingElement:d,triggerElements:m,onOpenChange:a,floatingId:o,nested:l,noEmit:n})).current;return Ve(()=>{const y={open:c,floatingId:o,referenceElement:f,floatingElement:d};cn(f)&&(y.domReferenceElement=f),h.state.positionReference===h.state.referenceElement&&(y.positionReference=f),h.update(y)},[c,o,f,d,h]),h.context.onOpenChange=a,h.context.nested=l,h.context.noEmit=n,h}const Ib=vY&&aN;function WN(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:r,dataRef:a}=n.context,{enabled:o=!0,delay:l}=t,c=v.useRef(!1),f=v.useRef(null),d=Fn(),m=v.useRef(!0);v.useEffect(()=>{const y=n.select("domReferenceElement");if(!o)return;const g=Bn(y);function w(){const S=n.select("domReferenceElement");!n.select("open")&&kn(S)&&S===ti(Qt(S))&&(c.current=!0)}function C(){m.current=!0}function T(){m.current=!1}return g.addEventListener("blur",w),Ib&&(g.addEventListener("keydown",C,!0),g.addEventListener("pointerdown",T,!0)),()=>{g.removeEventListener("blur",w),Ib&&(g.removeEventListener("keydown",C,!0),g.removeEventListener("pointerdown",T,!0))}},[n,o]),v.useEffect(()=>{if(!o)return;function y(g){if(g.reason===qs||g.reason===nm){const w=n.select("domReferenceElement");cn(w)&&(f.current=w,c.current=!0)}}return r.on("openchange",y),()=>{r.off("openchange",y)}},[r,o,n]);const h=v.useMemo(()=>({onMouseLeave(){c.current=!1,f.current=null},onFocus(y){const g=y.currentTarget;if(c.current){if(f.current===g)return;c.current=!1,f.current=null}const w=Rr(y.nativeEvent);if(cn(w)){if(Ib&&!y.relatedTarget){if(!m.current&&!gm(w))return}else if(!CY(w))return}const C=xp(y.relatedTarget,n.context.triggerElements),{nativeEvent:T,currentTarget:S}=y,R=typeof l=="function"?l():l;if(n.select("open")&&C||R===0||R===void 0){n.setOpen(!0,vt($l,T,S));return}d.start(R,()=>{c.current||n.setOpen(!0,vt($l,T,S))})},onBlur(y){c.current=!1,f.current=null;const g=y.relatedTarget,w=y.nativeEvent,C=cn(g)&&g.hasAttribute(wc("focus-guard"))&&g.getAttribute("data-type")==="outside";d.start(0,()=>{var k;const T=n.select("domReferenceElement"),S=ti(T?T.ownerDocument:document);!g&&S===T||Nt((k=a.current.floatingContext)==null?void 0:k.refs.floating.current,S)||Nt(T,S)||C||xp(g??S,n.context.triggerElements)||n.setOpen(!1,vt($l,w))})}}),[a,n,d,l]);return v.useMemo(()=>o?{reference:h,trigger:h}:{},[o,h])}const Xv=wc("safe-polygon"),lK=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${cN}`;function cK(e){return e?!!e.closest(lK):!1}class jw{constructor(){st(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});st(this,"disposeEffect",()=>this.dispose);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 aa,this.restTimeout=new aa,this.handleCloseOptions=void 0}static create(){return new jw}}function KN(e){const t=nr(jw.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),lm(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const uK=new Set(["click","mousedown"]);function GN(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:c=!0,closeDelay:f=0}=t,d=KN(n),m=Qo(),h=Ka(),y=Ye(()=>d.interactedInside?!0:l.current.openEvent?uK.has(l.current.openEvent.type):!1),g=Ye(()=>{var M;const k=(M=l.current.openEvent)==null?void 0:M.type;return(k==null?void 0:k.includes("mouse"))&&k!=="mousedown"}),w=Ye(k=>xp(k,n.context.triggerElements)),C=v.useCallback((k,M=!0)=>{const D=dK(f,d.pointerType);D&&!d.handler?d.openChangeTimeout.start(D,()=>n.setOpen(!1,vt(vr,k))):M&&(d.openChangeTimeout.clear(),n.setOpen(!1,vt(vr,k)))},[f,n,d]),T=Ye(()=>{d.unbindMouseMove(),d.handler=void 0}),S=Ye(()=>{if(d.performedPointerEventsMutation){const k=Qt(a).body;k.style.pointerEvents="",k.removeAttribute(Xv),d.performedPointerEventsMutation=!1}}),R=Ye(k=>{const M=Rr(k);if(!cK(M)){d.interactedInside=!1;return}d.interactedInside=!0});Ve(()=>{r||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,T(),S())},[r,d,T,S]),v.useEffect(()=>()=>{T()},[T]),v.useEffect(()=>S,[S]),Ve(()=>{var k,M,D;if(c&&r&&(k=d.handleCloseOptions)!=null&&k.blockPointerEvents&&g()&&cn(o)&&a){d.performedPointerEventsMutation=!0;const O=Qt(a).body;O.setAttribute(Xv,"");const A=o,L=a,H=(D=(M=m==null?void 0:m.nodesRef.current.find(F=>F.id===h))==null?void 0:M.context)==null?void 0:D.elements.floating;return H&&(H.style.pointerEvents=""),O.style.pointerEvents="none",A.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{O.style.pointerEvents="",A.style.pointerEvents="",L.style.pointerEvents=""}}},[c,r,o,a,d,g,m,h]),v.useEffect(()=>{if(!c)return;function k(A){y()||!l.current.floatingContext||!n.select("open")||w(A.relatedTarget)||(S(),T(),y()||C(A))}function M(A){var L;d.openChangeTimeout.clear(),S(),(L=d.handler)==null||L.call(d,A),T()}function D(A){y()||C(A,!1)}const O=a;return O&&(O.addEventListener("mouseleave",k),O.addEventListener("mouseenter",M),O.addEventListener("mouseleave",D),O.addEventListener("pointerdown",R,!0)),()=>{O&&(O.removeEventListener("mouseleave",k),O.removeEventListener("mouseenter",M),O.removeEventListener("mouseleave",D),O.removeEventListener("pointerdown",R,!0))}},[c,a,n,l,y,w,C,S,T,R,d])}function dK(e,t){return t&&!Gs(t)?0:typeof e=="function"?e():e}function Pb(e){return typeof e=="function"?e():e}const fK={current:null};function XN(e,t={}){var F;const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:a}=n.context,{enabled:o=!0,delay:l=0,handleClose:c=null,mouseOnly:f=!1,restMs:d=0,move:m=!0,triggerElementRef:h=fK,externalTree:y,isActiveTrigger:g=!0}=t,w=Qo(y),C=KN(n),T=sr(c),S=sr(l),R=sr(d),k=sr(o);g&&(C.handleCloseOptions=(F=T.current)==null?void 0:F.__options);const M=Ye(()=>C.interactedInside?!0:r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1),D=Ye(W=>xp(W,n.context.triggerElements)),O=v.useCallback((W,j=!0)=>{const q=ep(S.current,"close",C.pointerType);q&&!C.handler?C.openChangeTimeout.start(q,()=>n.setOpen(!1,vt(vr,W))):j&&(C.openChangeTimeout.clear(),n.setOpen(!1,vt(vr,W)))},[S,n,C]),A=Ye(()=>{C.unbindMouseMove(),C.handler=void 0}),L=Ye(()=>{if(C.performedPointerEventsMutation){const W=Qt(n.select("domReferenceElement")).body;W.style.pointerEvents="",W.removeAttribute(Xv),C.performedPointerEventsMutation=!1}});v.useEffect(()=>{if(!o)return;function W(j){j.open||(C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1)}return a.on("openchange",W),()=>{a.off("openchange",W)}},[o,a,C]);const H=Ye(W=>{var q;if(M()||!r.current.floatingContext||D(W.relatedTarget))return;const j=h.current;(q=T.current)==null||q.call(T,{...r.current.floatingContext,tree:w,x:W.clientX,y:W.clientY,onClose(){L(),A(),!M()&&j===n.select("domReferenceElement")&&O(W)}})(W)});return v.useEffect(()=>{if(!o)return;const W=h.current??(g?n.select("domReferenceElement"):null);if(!cn(W))return;function j(B){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,f&&!Gs(C.pointerType)||Pb(R.current)>0&&!ep(S.current,"open"))return;const _=ep(S.current,"open",C.pointerType),z=n.select("domReferenceElement"),U=n.context.triggerElements,K=(U.hasElement(B.target)||U.hasMatchingElement(I=>Nt(I,B.target)))&&(!z||!Nt(z,B.target)),P=B.currentTarget??null,V=n.select("open"),G=!V||K;K&&V?n.setOpen(!0,vt(vr,B,P)):_?C.openChangeTimeout.start(_,()=>{G&&n.setOpen(!0,vt(vr,B,P))}):G&&n.setOpen(!0,vt(vr,B,P))}function q(B){if(M()){L();return}C.unbindMouseMove();const _=n.select("domReferenceElement"),z=Qt(_);if(C.restTimeout.clear(),C.restTimeoutPending=!1,D(B.relatedTarget))return;if(T.current&&r.current.floatingContext){n.select("open")||C.openChangeTimeout.clear();const K=h.current;C.handler=T.current({...r.current.floatingContext,tree:w,x:B.clientX,y:B.clientY,onClose(){L(),A(),k.current&&!M()&&K===n.select("domReferenceElement")&&O(B,!0)}});const P=C.handler;P(B),z.addEventListener("mousemove",P),C.unbindMouseMove=()=>{z.removeEventListener("mousemove",P)};return}(C.pointerType==="touch"?!Nt(n.select("floatingElement"),B.relatedTarget):!0)&&O(B)}function $(B){H(B)}return n.select("open")&&W.addEventListener("mouseleave",$),m&&W.addEventListener("mousemove",j,{once:!0}),W.addEventListener("mouseenter",j),W.addEventListener("mouseleave",q),()=>{W.removeEventListener("mouseleave",$),m&&W.removeEventListener("mousemove",j),W.removeEventListener("mouseenter",j),W.removeEventListener("mouseleave",q)}},[A,L,r,S,O,n,o,T,H,C,g,M,D,f,m,R,h,w,k]),v.useMemo(()=>{if(!o)return;function W(j){C.pointerType=j.pointerType}return{onPointerDown:W,onPointerEnter:W,onMouseMove(j){const{nativeEvent:q}=j,$=j.currentTarget,B=n.select("domReferenceElement"),_=n.context.triggerElements,z=n.select("open"),U=(_.hasElement(j.target)||_.hasMatchingElement(P=>Nt(P,j.target)))&&(!B||!Nt(B,j.target));if(f&&!Gs(C.pointerType)||z&&!U||Pb(R.current)===0||!U&&C.restTimeoutPending&&j.movementX**2+j.movementY**2<2)return;C.restTimeout.clear();function K(){if(C.restTimeoutPending=!1,M())return;const P=n.select("open");!C.blockMouseMove&&(!P||U)&&n.setOpen(!0,vt(vr,q,$))}C.pointerType==="touch"?pr.flushSync(()=>{K()}):U&&z?K():(C.restTimeoutPending=!0,C.restTimeout.start(Pb(R.current),K))}}},[o,C,M,f,n,R])}function Wd(e=[]){const t=e.map(d=>d==null?void 0:d.reference),n=e.map(d=>d==null?void 0:d.floating),r=e.map(d=>d==null?void 0:d.item),a=e.map(d=>d==null?void 0:d.trigger),o=v.useCallback(d=>Ph(d,e,"reference"),t),l=v.useCallback(d=>Ph(d,e,"floating"),n),c=v.useCallback(d=>Ph(d,e,"item"),r),f=v.useCallback(d=>Ph(d,e,"trigger"),a);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:c,getTriggerProps:f}),[o,l,c,f])}function Ph(e,t,n){var l;const r=new Map,a=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[Vv]="");for(const c in e)a&&e&&(c===sN||c===lN)||(o[c]=e[c]);for(let c=0;c<t.length;c+=1){let f;const d=(l=t[c])==null?void 0:l[n];typeof d=="function"?f=e?d(e):null:f=d,f&&ok(o,f,a,r)}return ok(o,e,a,r),o}function ok(e,t,n,r){var a;for(const o in t){const l=t[o];n&&(o===sN||o===lN)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof l=="function"&&((a=r.get(o))==null||a.push(l),e[o]=(...c)=>{var f;return(f=r.get(o))==null?void 0:f.map(d=>d(...c)).find(d=>d!==void 0)})):e[o]=l)}}const hK="Escape";function vm(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Lh(e,t){return vm(t,e===xw||e===qd,e===Bo||e===Ho)}function Lb(e,t,n){return vm(t,e===qd,n?e===Bo:e===Ho)||e==="Enter"||e===" "||e===""}function pK(e,t,n){return vm(t,n?e===Bo:e===Ho,e===qd)}function mK(e,t,n,r){const a=n?e===Ho:e===Bo,o=e===xw;return t==="both"||t==="horizontal"&&r&&r>1?e===hK:vm(t,a,o)}function QN(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("domReferenceElement"),l=n.context.dataRef,{listRef:c,activeIndex:f,onNavigate:d=()=>{},enabled:m=!0,selectedIndex:h=null,allowEscape:y=!1,loopFocus:g=!1,nested:w=!1,rtl:C=!1,virtual:T=!1,focusItemOnOpen:S="auto",focusItemOnHover:R=!0,openOnArrowKeyDown:k=!0,disabledIndices:M=void 0,orientation:D="vertical",parentOrientation:O,cols:A=1,id:L,resetOnPointerLeave:H=!0,externalTree:F}=t,W=Sd(a),j=sr(W),q=Ka(),$=Qo(F);Ve(()=>{l.current.orientation=D},[l,D]);const B=qv(o),_=v.useRef(S),z=v.useRef(h??-1),U=v.useRef(null),K=v.useRef(!0),P=Ye(J=>{d(z.current===-1?null:z.current,J)}),V=v.useRef(P),G=v.useRef(!!a),I=v.useRef(r),Q=v.useRef(!1),Z=v.useRef(!1),te=sr(M),le=sr(r),pe=sr(h),we=sr(H),Me=Ye(()=>{function J(qe){T?$==null||$.events.emit("virtualfocus",qe):sd(qe,{sync:Q.current,preventScroll:!0})}const Se=c.current[z.current],ve=Z.current;Se&&J(Se),(Q.current?qe=>qe():requestAnimationFrame)(()=>{var ut;const qe=c.current[z.current]||Se;if(!qe)return;Se||J(qe),ne&&(ve||!K.current)&&((ut=qe.scrollIntoView)==null||ut.call(qe,{block:"nearest",inline:"nearest"}))})});Ve(()=>{m&&(r&&a?(z.current=h??-1,_.current&&h!=null&&(Z.current=!0,P())):G.current&&(z.current=-1,V.current()))},[m,r,a,h,P]),Ve(()=>{if(m){if(!r){Q.current=!1;return}if(a)if(f==null){if(Q.current=!1,pe.current!=null)return;if(G.current&&(z.current=-1,Me()),(!I.current||!G.current)&&_.current&&(U.current!=null||_.current===!0&&U.current==null)){let J=0;const Se=()=>{c.current[0]==null?(J<2&&(J?requestAnimationFrame:queueMicrotask)(Se),J+=1):(z.current=U.current==null||Lb(U.current,D,C)||w?Jh(c):Wv(c),U.current=null,P())};Se()}}else Wl(c,f)||(z.current=f,Me(),Z.current=!1)}},[m,r,a,f,pe,w,c,D,C,P,Me,te]),Ve(()=>{var qe,De;if(!m||a||!$||T||!G.current)return;const J=$.nodesRef.current,Se=(De=(qe=J.find(ut=>ut.id===q))==null?void 0:qe.context)==null?void 0:De.elements.floating,ve=ti(Qt(a)),Be=J.some(ut=>ut.context&&Nt(ut.context.elements.floating,ve));Se&&!Be&&K.current&&Se.focus({preventScroll:!0})},[m,a,$,q,T]),Ve(()=>{V.current=P,I.current=r,G.current=!!a}),Ve(()=>{r||(U.current=null,_.current=S)},[r,S]);const Pe=f!=null,ne=v.useMemo(()=>{function J(ve){if(!le.current)return;const Be=c.current.indexOf(ve.currentTarget);Be!==-1&&z.current!==Be&&(z.current=Be,P(ve))}return{onFocus(ve){Q.current=!0,J(ve)},onClick:({currentTarget:ve})=>ve.focus({preventScroll:!0}),onMouseMove(ve){Q.current=!0,Z.current=!1,R&&J(ve)},onPointerLeave(ve){var qe;if(!le.current||!K.current||ve.pointerType==="touch")return;Q.current=!0;const Be=ve.relatedTarget;!R||c.current.includes(Be)||we.current&&(sd(null,{sync:!0}),z.current=-1,P(ve),T||(qe=j.current)==null||qe.focus({preventScroll:!0}))}}},[le,j,R,c,P,we,T]),fe=v.useCallback(()=>{var J,Se,ve;return O??((ve=(Se=(J=$==null?void 0:$.nodesRef.current.find(Be=>Be.id===q))==null?void 0:J.context)==null?void 0:Se.dataRef)==null?void 0:ve.current.orientation)},[q,$,O]),ye=Ye(J=>{if(K.current=!1,Q.current=!0,J.which===229||!le.current&&J.currentTarget===j.current)return;if(w&&mK(J.key,D,C,A)){Lh(J.key,fe())||br(J),n.setOpen(!1,vt(Xh,J.nativeEvent)),kn(o)&&(T?$==null||$.events.emit("virtualfocus",o):o.focus());return}const Se=z.current,ve=Jh(c,M),Be=Wv(c,M);if(B||(J.key==="Home"&&(br(J),z.current=ve,P(J)),J.key==="End"&&(br(J),z.current=Be,P(J))),A>1){const qe=Array.from({length:c.current.length},()=>({width:1,height:1})),De=mN(qe,A,!1),ut=De.findIndex(ee=>ee!=null&&!Uo(c,ee,M)),he=De.reduce((ee,de,Ae)=>de!=null&&!Uo(c,de,M)?Ae:ee,-1),Ce=De[pN({current:De.map(ee=>ee!=null?c.current[ee]:null)},{event:J,orientation:D,loopFocus:g,rtl:C,cols:A,disabledIndices:yN([...(typeof M!="function"?M:null)||c.current.map((ee,de)=>Uo(c,de,M)?de:void 0),void 0],De),minIndex:ut,maxIndex:he,prevIndex:gN(z.current>Be?ve:z.current,qe,De,A,J.key===qd?"bl":J.key===(C?Bo:Ho)?"tr":"tl"),stopEvent:!0})];if(Ce!=null&&(z.current=Ce,P(J)),D==="both")return}if(Lh(J.key,D)){if(br(J),r&&!T&&ti(J.currentTarget.ownerDocument)===J.currentTarget){z.current=Lb(J.key,D,C)?ve:Be,P(J);return}Lb(J.key,D,C)?g?Se>=Be?y&&Se!==c.current.length?z.current=-1:(Q.current=!1,z.current=ve):z.current=hr(c,{startingIndex:Se,disabledIndices:M}):z.current=Math.min(Be,hr(c,{startingIndex:Se,disabledIndices:M})):g?Se<=ve?y&&Se!==-1?z.current=c.current.length:(Q.current=!1,z.current=Be):z.current=hr(c,{startingIndex:Se,decrement:!0,disabledIndices:M}):z.current=Math.max(ve,hr(c,{startingIndex:Se,decrement:!0,disabledIndices:M})),Wl(c,z.current)&&(z.current=-1),P(J)}}),Le=v.useMemo(()=>T&&r&&Pe&&{"aria-activedescendant":`${L}-${f}`},[T,r,Pe,L,f]),Oe=v.useMemo(()=>({"aria-orientation":D==="both"?void 0:D,...B?{}:Le,onKeyDown(J){if(J.key==="Tab"&&J.shiftKey&&r&&!T){const Se=Rr(J.nativeEvent);if(Se&&!Nt(j.current,Se))return;br(J),n.setOpen(!1,vt($s,J.nativeEvent)),kn(o)&&o.focus();return}ye(J)},onPointerMove(){K.current=!0}}),[Le,ye,j,D,B,n,r,T,o]),Ee=v.useMemo(()=>{function J(ve){S==="auto"&&uN(ve.nativeEvent)&&(_.current=!T)}function Se(ve){_.current=S,S==="auto"&&dN(ve.nativeEvent)&&(_.current=!0)}return{onKeyDown(ve){const Be=n.select("open");K.current=!1;const qe=ve.key.startsWith("Arrow"),De=pK(ve.key,fe(),C),ut=Lh(ve.key,D),he=(w?De:ut)||ve.key==="Enter"||ve.key.trim()==="";if(T&&Be)return ye(ve);if(!(!Be&&!k&&qe)){if(he){const Ce=Lh(ve.key,fe());U.current=w&&Ce?null:ve.key}if(w){De&&(br(ve),Be?(z.current=Jh(c,te.current),P(ve)):n.setOpen(!0,vt(Xh,ve.nativeEvent,ve.currentTarget)));return}ut&&(pe.current!=null&&(z.current=pe.current),br(ve),!Be&&k?n.setOpen(!0,vt(Xh,ve.nativeEvent,ve.currentTarget)):ye(ve),Be&&P(ve))}},onFocus(ve){n.select("open")&&!T&&(z.current=-1,P(ve))},onPointerDown:Se,onPointerEnter:Se,onMouseDown:J,onClick:J}},[ye,te,S,c,w,P,n,k,D,fe,C,pe,T]),Te=v.useMemo(()=>({...Le,...Ee}),[Le,Ee]);return v.useMemo(()=>m?{reference:Te,floating:Oe,item:ne,trigger:Ee}:{},[m,Te,Oe,Ee,ne])}const gK=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function ZN(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingId"),o=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:c="dialog"}=t,f=Js(),d=(o==null?void 0:o.id)||f,m=v.useMemo(()=>{var R;return((R=Sd(l))==null?void 0:R.id)||a},[l,a]),h=gK.get(c)??c,g=Ka()!=null,w=v.useMemo(()=>h==="tooltip"||c==="label"?Dn:{"aria-haspopup":h==="alertdialog"?"dialog":h,"aria-expanded":"false",...h==="listbox"&&{role:"combobox"},...h==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[h,g,c]),C=v.useMemo(()=>h==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:r?m:void 0}:{...w,"aria-expanded":r?"true":"false","aria-controls":r?m:void 0,...h==="menu"&&{id:d}},[h,m,r,d,c,w]),T=v.useMemo(()=>{const R={id:m,...h&&{role:h}};return h==="tooltip"||c==="label"?R:{...R,...h==="menu"&&{"aria-labelledby":d}}},[h,m,d,c]),S=v.useCallback(({active:R,selected:k})=>{const M={role:"option",...R&&{id:`${m}-fui-option`}};switch(c){case"select":case"combobox":return{...M,"aria-selected":k}}return{}},[m,c]);return v.useMemo(()=>({reference:C,floating:T,item:S,trigger:w}),[C,T,w,S])}function JN(e,t){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,a=n.useState("open"),{listRef:o,activeIndex:l,onMatch:c,onTypingChange:f,enabled:d=!0,resetMs:m=750,selectedIndex:h=null}=t,y=Fn(),g=v.useRef(""),w=v.useRef(h??l??-1),C=v.useRef(null);Ve(()=>{!a&&h!==null||(y.clear(),C.current=null,g.current!==""&&(g.current=""))},[a,h,y]),Ve(()=>{a&&g.current===""&&(w.current=h??l??-1)},[a,h,l]);const T=Ye(D=>{D?r.current.typing||(r.current.typing=D,f==null||f(D)):r.current.typing&&(r.current.typing=D,f==null||f(D))}),S=Ye(D=>{function O(j,q,$){const B=q.find(_=>(_==null?void 0:_.toLocaleLowerCase().indexOf($.toLocaleLowerCase()))===0);return B?j.indexOf(B):-1}const A=o.current;if(g.current.length>0&&g.current[0]!==" "&&(O(A,A,g.current)===-1?T(!1):D.key===" "&&br(D)),A==null||D.key.length!==1||D.ctrlKey||D.metaKey||D.altKey)return;a&&D.key!==" "&&(br(D),T(!0));const L=g.current==="";L&&(w.current=h??l??-1),A.every(j=>{var q,$;return j?((q=j[0])==null?void 0:q.toLocaleLowerCase())!==(($=j[1])==null?void 0:$.toLocaleLowerCase()):!0})&&g.current===D.key&&(g.current="",w.current=C.current),g.current+=D.key,y.start(m,()=>{g.current="",w.current=C.current,T(!1)});const F=L?h??l??-1:w.current,W=O(A,[...A.slice((F||0)+1),...A.slice(0,(F||0)+1)],g.current);W!==-1?(c==null||c(W),C.current=W):D.key!==" "&&(g.current="",T(!1))}),R=Ye(D=>{const O=D.relatedTarget,A=n.select("domReferenceElement"),L=n.select("floatingElement"),H=Nt(A,O),F=Nt(L,O);H||F||(y.clear(),g.current="",w.current=C.current,T(!1))}),k=v.useMemo(()=>({onKeyDown:S,onBlur:R}),[S,R]),M=v.useMemo(()=>({onKeyDown:S,onKeyUp(D){D.key===" "&&T(!1)},onBlur:R}),[S,R,T]);return v.useMemo(()=>d?{reference:k,floating:M}:{},[d,k,M])}function sk(e,t){const[n,r]=e;let a=!1;const o=t.length;for(let l=0,c=o-1;l<o;c=l++){const[f,d]=t[l]||[0,0],[m,h]=t[c]||[0,0];d>=r!=h>=r&&n<=(m-f)*(r-d)/(h-d)+f&&(a=!a)}return a}function yK(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function eD(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,a=new aa;let o=!1,l=null,c=null,f=typeof performance<"u"?performance.now():0;function d(h,y){const g=performance.now(),w=g-f;if(l===null||c===null||w===0)return l=h,c=y,f=g,null;const C=h-l,T=y-c,R=Math.sqrt(C*C+T*T)/w;return l=h,c=y,f=g,R}const m=({x:h,y,placement:g,elements:w,onClose:C,nodeId:T,tree:S})=>function(k){function M(){a.clear(),C()}if(a.clear(),!w.domReference||!w.floating||g==null||h==null||y==null)return;const{clientX:D,clientY:O}=k,A=[D,O],L=Rr(k),H=k.type==="mouseleave",F=Nt(w.floating,L),W=Nt(w.domReference,L),j=w.domReference.getBoundingClientRect(),q=w.floating.getBoundingClientRect(),$=g.split("-")[0],B=h>q.right-q.width/2,_=y>q.bottom-q.height/2,z=yK(A,j),U=q.width>j.width,K=q.height>j.height,P=(U?j:q).left,V=(U?j:q).right,G=(K?j:q).top,I=(K?j:q).bottom;if(F&&(o=!0,!H))return;if(W&&(o=!1),W&&!H){o=!0;return}if(H&&cn(k.relatedTarget)&&Nt(w.floating,k.relatedTarget)||S&&Fs(S.nodesRef.current,T).some(({context:te})=>te==null?void 0:te.open))return;if($==="top"&&y>=j.bottom-1||$==="bottom"&&y<=j.top+1||$==="left"&&h>=j.right-1||$==="right"&&h<=j.left+1)return M();let Q=[];switch($){case"top":Q=[[P,j.top+1],[P,q.bottom-1],[V,q.bottom-1],[V,j.top+1]];break;case"bottom":Q=[[P,q.top+1],[P,j.bottom-1],[V,j.bottom-1],[V,q.top+1]];break;case"left":Q=[[q.right-1,I],[q.right-1,G],[j.left+1,G],[j.left+1,I]];break;case"right":Q=[[j.right-1,I],[j.right-1,G],[q.left+1,G],[q.left+1,I]];break}function Z([te,le]){switch($){case"top":{const pe=[U?te+t/2:B?te+t*4:te-t*4,le+t+1],we=[U?te-t/2:B?te+t*4:te-t*4,le+t+1],Me=[[q.left,B||U?q.bottom-t:q.top],[q.right,B?U?q.bottom-t:q.top:q.bottom-t]];return[pe,we,...Me]}case"bottom":{const pe=[U?te+t/2:B?te+t*4:te-t*4,le-t],we=[U?te-t/2:B?te+t*4:te-t*4,le-t],Me=[[q.left,B||U?q.top+t:q.bottom],[q.right,B?U?q.top+t:q.bottom:q.top+t]];return[pe,we,...Me]}case"left":{const pe=[te+t+1,K?le+t/2:_?le+t*4:le-t*4],we=[te+t+1,K?le-t/2:_?le+t*4:le-t*4];return[...[[_||K?q.right-t:q.left,q.top],[_?K?q.right-t:q.left:q.right-t,q.bottom]],pe,we]}case"right":{const pe=[te-t,K?le+t/2:_?le+t*4:le-t*4],we=[te-t,K?le-t/2:_?le+t*4:le-t*4],Me=[[_||K?q.left+t:q.right,q.top],[_?K?q.left+t:q.right:q.left+t,q.bottom]];return[pe,we,...Me]}default:return[]}}if(!sk([D,O],Q)){if(o&&!z)return M();if(!H&&r){const te=d(k.clientX,k.clientY);if(te!==null&&te<.1)return M()}sk([D,O],Z([h,y]))?!o&&r&&a.start(40,M):M()}};return m.__options={blockPointerEvents:n},m}const tD=v.createContext(null),nD=v.createContext(null);function ua(){const e=v.useContext(tD);if(e===null)throw new Error(Cn(60));return e}function rD(){const e=v.useContext(nD);if(e===null)throw new Error(Cn(61));return e}const bK=(e,t)=>Object.is(e,t);function Ec(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function vK(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:Ec(t,r,n))}function ld(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:Ec(r,t,n))}function xK(e,t,n){return e.filter(r=>!Ec(t,r,n))}function Qv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function iD(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function wK(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(iD(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 SK(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Qv(e)}function Hl(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Qv(e.value):Qv(e)}function aD(e,t,n){function r(){return SK(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const a=iD(t)?t.flatMap(o=>o.items):t;if(e==null||typeof e!="object"){const o=a.find(l=>l.value===e);return o&&o.label!=null?o.label:r()}if("value"in e){const o=a.find(l=>l&&l.value===e.value);if(o&&o.label!=null)return o.label}}return r()}function EK(e,t,n){return e.reduce((r,a,o)=>(o>0&&r.push(", "),r.push(E.jsx(v.Fragment,{children:aD(a,t,n)},o)),r),[])}const wt={id:Ge(e=>e.id),modal:Ge(e=>e.modal),multiple:Ge(e=>e.multiple),items:Ge(e=>e.items),itemToStringLabel:Ge(e=>e.itemToStringLabel),itemToStringValue:Ge(e=>e.itemToStringValue),isItemEqualToValue:Ge(e=>e.isItemEqualToValue),value:Ge(e=>e.value),hasSelectedValue:Ge(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Hl(t,r)!==""}),hasNullItemLabel:Ge((e,t)=>t?wK(e.items):!1),open:Ge(e=>e.open),mounted:Ge(e=>e.mounted),forceMount:Ge(e=>e.forceMount),transitionStatus:Ge(e=>e.transitionStatus),openMethod:Ge(e=>e.openMethod),activeIndex:Ge(e=>e.activeIndex),selectedIndex:Ge(e=>e.selectedIndex),isActive:Ge((e,t)=>e.activeIndex===t),isSelected:Ge((e,t,n)=>{const r=e.isItemEqualToValue,a=e.value;return e.multiple?Array.isArray(a)&&a.some(o=>Ec(n,o,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Ec(n,a,r)}),isSelectedByFocus:Ge((e,t)=>e.selectedIndex===t),popupProps:Ge(e=>e.popupProps),triggerProps:Ge(e=>e.triggerProps),triggerElement:Ge(e=>e.triggerElement),positionerElement:Ge(e=>e.positionerElement),listElement:Ge(e=>e.listElement),scrollUpArrowVisible:Ge(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Ge(e=>e.scrollDownArrowVisible),hasScrollArrows:Ge(e=>e.hasScrollArrows)};function CK(e){const t=v.useRef(""),n=v.useCallback(a=>{a.defaultPrevented||(t.current=a.pointerType,e(a,a.pointerType))},[e]);return{onClick:v.useCallback(a=>{if(a.detail===0){e(a,"keyboard");return}"pointerType"in a?e(a,a.pointerType):e(a,t.current),t.current=""},[e]),onPointerDown:n}}function _w(e){const[t,n]=v.useState(null),r=Ye((c,f)=>{e||n(f||(iN?"touch":""))}),a=v.useCallback(()=>{n(null)},[]),{onClick:o,onPointerDown:l}=CK(r);return v.useMemo(()=>({openMethod:t,reset:a,triggerProps:{onClick:o,onPointerDown:l}}),[t,a,o,l])}function TK(e){const{id:t,value:n,defaultValue:r=null,onValueChange:a,open:o,defaultOpen:l=!1,onOpenChange:c,name:f,autoComplete:d,disabled:m=!1,readOnly:h=!1,required:y=!1,modal:g=!0,actionsRef:w,inputRef:C,onOpenChangeComplete:T,items:S,multiple:R=!1,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D=bK,highlightItemOnHover:O=!0,children:A}=e,{clearErrors:L}=Xx(),{setDirty:H,setTouched:F,setFocused:W,shouldValidateOnChange:j,validityData:q,setFilled:$,name:B,disabled:_,validation:z,validationMode:U}=Mc(),K=em({id:t}),P=_||m,V=B??f,[G,I]=gc({controlled:n,default:R?r??qo:r,name:"Select",state:"value"}),[Q,Z]=gc({controlled:o,default:l,name:"Select",state:"open"}),te=v.useRef([]),le=v.useRef([]),pe=v.useRef(null),we=v.useRef(null),Me=v.useRef(0),Pe=v.useRef(null),ne=v.useRef([]),fe=v.useRef(!1),ye=v.useRef(!1),Le=v.useRef(null),Oe=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Ee=v.useRef(!1),{mounted:Te,setMounted:J,transitionStatus:Se}=Vd(Q),{openMethod:ve,triggerProps:Be,reset:qe}=_w(Q),De=nr(()=>new tN({id:K,modal:g,multiple:R,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,value:G,open:Q,mounted:Te,transitionStatus:Se,items:S,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ut=Et(De,wt.activeIndex),he=Et(De,wt.selectedIndex),Ce=Et(De,wt.triggerElement),ee=Et(De,wt.positionerElement),de=v.useMemo(()=>R&&Array.isArray(G)&&G.length===0?"":Hl(G,M),[R,G,M]),Ae=v.useMemo(()=>R&&Array.isArray(G)?G.map(Je=>Hl(Je,M)):Hl(G,M),[R,G,M]),He=sr(De.state.triggerElement);Qx({id:K,commit:z.commit,value:G,controlRef:He,name:V,getValue:()=>Ae});const $e=v.useRef(G);Ve(()=>{G!==$e.current&&De.set("forceMount",!0)},[De,G]),Ve(()=>{$(R?Array.isArray(G)&&G.length>0:G!=null)},[R,G,$]),Ve(function(){if(Q)return;const kt=ne.current;if(R){const ae=Array.isArray(G)?G:[];if(ae.length===0){De.set("selectedIndex",null);return}const ue=ae[ae.length-1],Re=ld(kt,ue,D);De.set("selectedIndex",Re===-1?null:Re);return}const X=ld(kt,G,D);De.set("selectedIndex",X===-1?null:X)},[R,Q,G,ne,D,De]),HO(G,()=>{L(V),H(G!==q.initialValue),j()?z.commit(G):z.commit(G,!0)});const et=Ye((Je,kt)=>{if(c==null||c(Je,kt),!kt.isCanceled&&(Z(Je),!Je&&(kt.reason===$s||kt.reason===tm)&&(F(!0),W(!1),U==="onBlur"&&z.commit(G)),!Je&&De.state.activeIndex!==null)){const X=te.current[De.state.activeIndex];queueMicrotask(()=>{X==null||X.setAttribute("tabindex","-1")})}}),ze=Ye(()=>{J(!1),De.set("activeIndex",null),qe(),T==null||T(!1)});Wa({enabled:!w,open:Q,ref:pe,onComplete(){Q||ze()}}),v.useImperativeHandle(w,()=>({unmount:ze}),[ze]);const Ze=Ye((Je,kt)=>{a==null||a(Je,kt),!kt.isCanceled&&I(Je)}),tt=Ye(()=>{const Je=De.state.listElement||pe.current;if(!Je)return;const kt=Je.scrollTop,X=Je.scrollTop+Je.clientHeight,ae=kt>1,ue=X<Je.scrollHeight-1;De.state.scrollUpArrowVisible!==ae&&De.set("scrollUpArrowVisible",ae),De.state.scrollDownArrowVisible!==ue&&De.set("scrollDownArrowVisible",ue)}),Ct=YN({open:Q,onOpenChange:et,elements:{reference:Ce,floating:ee}}),zt=jN(Ct,{enabled:!h&&!P,event:"mousedown"}),gt=bm(Ct,{bubbles:!1}),Ot=QN(Ct,{enabled:!h&&!P,listRef:te,activeIndex:ut,selectedIndex:he,disabledIndices:qo,onNavigate(Je){Je===null&&!Q||De.set("activeIndex",Je)},focusItemOnHover:!1}),it=JN(Ct,{enabled:!h&&!P&&(Q||!R),listRef:le,activeIndex:ut,selectedIndex:he,onMatch(Je){Q?De.set("activeIndex",Je):Ze(ne.current[Je],vt("none"))},onTypingChange(Je){fe.current=Je}}),{getReferenceProps:ft,getFloatingProps:yt,getItemProps:Ke}=Wd([zt,gt,Ot,it]),Rt=v.useMemo(()=>Ei(ft(),Be,K?{id:K}:Dn),[ft,Be,K]);hm(()=>{De.update({popupProps:yt(),triggerProps:Rt})}),Ve(()=>{De.update({id:K,modal:g,multiple:R,value:G,open:Q,mounted:Te,transitionStatus:Se,popupProps:yt(),triggerProps:Rt,items:S,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,openMethod:ve})},[De,K,g,R,G,Q,Te,Se,yt,Rt,S,k,M,D,ve]);const jt=v.useMemo(()=>({store:De,name:V,required:y,disabled:P,readOnly:h,multiple:R,itemToStringLabel:k,itemToStringValue:M,highlightItemOnHover:O,setValue:Ze,setOpen:et,listRef:te,popupRef:pe,scrollHandlerRef:we,handleScrollArrowVisibility:tt,scrollArrowsMountedCountRef:Me,getItemProps:Ke,events:Ct.context.events,valueRef:Pe,valuesRef:ne,labelsRef:le,typingRef:fe,selectionRef:Oe,selectedItemTextRef:Le,validation:z,onOpenChangeComplete:T,keyboardActiveRef:ye,alignItemWithTriggerActiveRef:Ee,initialValueRef:$e}),[De,V,y,P,h,R,k,M,O,Ze,et,Ke,Ct.context.events,z,T,tt]),Tt=_i(C,z.inputRef),un=R&&Array.isArray(G)&&G.length>0,Ht=v.useMemo(()=>!R||!Array.isArray(G)||!V?null:G.map(Je=>{const kt=Hl(Je,M);return E.jsx("input",{type:"hidden",name:V,value:kt},kt)}),[R,G,V,M]);return E.jsx(tD.Provider,{value:jt,children:E.jsxs(nD.Provider,{value:Ct,children:[A,E.jsx("input",{...z.getInputValidationProps({onFocus(){var Je;(Je=De.state.triggerElement)==null||Je.focus({focusVisible:!0})},onChange(Je){if(Je.nativeEvent.defaultPrevented)return;const kt=Je.target.value,X=vt(zi,Je.nativeEvent);function ae(){if(R)return;const ue=ne.current.find(Re=>Hl(Re,M).toLowerCase()===kt.toLowerCase());ue!=null&&(H(ue!==q.initialValue),Ze(ue,X),j()&&z.commit(ue))}De.set("forceMount",!0),queueMicrotask(ae)}}),name:R?void 0:V,autoComplete:d,value:de,disabled:P,required:y&&!un,readOnly:h,ref:Tt,style:V?_O:Zp,tabIndex:-1,"aria-hidden":!0}),Ht]})})}let Rs=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ws.startingStyle]="startingStyle",e[e.endingStyle=Ws.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Op=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const RK={[Op.popupOpen]:""},kK={[Op.popupOpen]:"",[Op.pressed]:""},MK={[Rs.open]:""},OK={[Rs.closed]:""},AK={[Rs.anchorHidden]:""},oD={open(e){return e?RK:null}},Zv={open(e){return e?kK:null}},da={open(e){return e?MK:OK},anchorHidden(e){return e?AK:null}};function sD(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const o=parseFloat(n.width)||0,l=parseFloat(n.height)||0,c=parseFloat(r.width)||0,f=parseFloat(r.height)||0,d=Math.max(t.width,o,c),m=Math.max(t.height,l,f),h=d-t.width,y=m-t.height;return{left:t.left-h/2,right:t.right+h/2,top:t.top-y/2,bottom:t.bottom+y/2}}const jh=2,NK=400,lk=200,DK={...Zv,...Gx,value:()=>null},IK=v.forwardRef(function(t,n){const{render:r,className:a,id:o,disabled:l=!1,nativeButton:c=!0,...f}=t,{setTouched:d,setFocused:m,validationMode:h,state:y,disabled:g}=Mc(),{labelId:w}=Jp(),{store:C,setOpen:T,selectionRef:S,validation:R,readOnly:k,required:M,alignItemWithTriggerActiveRef:D,disabled:O,keyboardActiveRef:A}=ua(),L=g||O||l,H=Et(C,wt.open),F=Et(C,wt.value),W=Et(C,wt.triggerProps),j=Et(C,wt.positionerElement),q=Et(C,wt.listElement),$=Et(C,wt.id),B=Et(C,wt.hasSelectedValue),_=!B&&H,z=Et(C,wt.hasNullItemLabel,_),U=o??$;em({id:U});const K=sr(j),P=v.useRef(null),{getButtonProps:V,buttonRef:G}=qa({disabled:L,native:c}),I=Ye(ne=>{C.set("triggerElement",ne)}),Q=_i(n,P,G,I),Z=Fn(),te=Fn(),le=Fn(),pe=Fn();v.useEffect(()=>{if(H)return!(B||z)?le.start(NK,()=>{S.current.allowUnselectedMouseUp=!0,S.current.allowSelectedMouseUp=!0}):pe.start(lk,()=>{S.current.allowUnselectedMouseUp=!0,le.start(lk,()=>{S.current.allowSelectedMouseUp=!0})}),()=>{le.clear(),pe.clear()};S.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},te.clear()},[H,B,z,S,te,le,pe]);const we=v.useMemo(()=>{var ne;return(q==null?void 0:q.id)??((ne=Sd(j))==null?void 0:ne.id)},[q,j]),Me=Ei(W,{id:U,role:"combobox","aria-expanded":H?"true":"false","aria-haspopup":"listbox","aria-controls":H?we:void 0,"aria-labelledby":w,"aria-readonly":k||void 0,"aria-required":M||void 0,tabIndex:L?-1:0,ref:Q,onFocus(ne){m(!0),H&&D.current&&T(!1,vt(zi,ne.nativeEvent)),Z.start(0,()=>{C.set("forceMount",!0)})},onBlur(ne){Nt(j,ne.relatedTarget)||(d(!0),m(!1),h==="onBlur"&&R.commit(F))},onPointerMove(){A.current=!1},onKeyDown(){A.current=!0},onMouseDown(ne){if(H)return;const fe=Qt(ne.currentTarget);function ye(Le){if(!P.current)return;const Oe=Le.target;if(Nt(P.current,Oe)||Nt(K.current,Oe)||Oe===P.current)return;const Ee=sD(P.current);Le.clientX>=Ee.left-jh&&Le.clientX<=Ee.right+jh&&Le.clientY>=Ee.top-jh&&Le.clientY<=Ee.bottom+jh||T(!1,vt(BO,Le))}te.start(0,()=>{fe.addEventListener("mouseup",ye,{once:!0})})}},R.getValidationProps,f,V);Me.role="combobox";const Pe={...y,open:H,disabled:L,value:F,readOnly:k,placeholder:!B};return Dt("button",t,{ref:[n,P],state:Pe,stateAttributesMapping:DK,props:Me})}),PK={value:()=>null},LK=v.forwardRef(function(t,n){const{className:r,render:a,children:o,placeholder:l,...c}=t,{store:f,valueRef:d}=ua(),m=Et(f,wt.value),h=Et(f,wt.items),y=Et(f,wt.itemToStringLabel),g=Et(f,wt.hasSelectedValue),w=!g&&l!=null&&o==null,C=Et(f,wt.hasNullItemLabel,w),T={value:m,placeholder:!g};let S=null;return typeof o=="function"?S=o(m):o!=null?S=o:!g&&l!=null&&!C?S=l:Array.isArray(m)?S=EK(m,h,y):S=aD(m,h,y),Dt("span",t,{state:T,ref:[n,d],props:[{children:S},c],stateAttributesMapping:PK})}),jK=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,{store:l}=ua(),f={open:Et(l,wt.open)};return Dt("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"▼"},o],stateAttributesMapping:oD})}),_K=v.createContext(void 0),zK=v.forwardRef(function(t,n){const{store:r}=ua(),a=Et(r,wt.mounted),o=Et(r,wt.forceMount);return a||o?E.jsx(_K.Provider,{value:!0,children:E.jsx(Rw,{ref:n,...t})}):null});function zw(e){return Wx(19)?e:e?"true":void 0}let ck={},uk={},dk="";function FK(e){if(typeof document>"u")return!1;const t=Qt(e);return Bn(t).innerWidth-t.documentElement.clientWidth>0}function BK(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Qt(e),r=n.documentElement,a=n.body,o=Ko(r)?r:a,l=o.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const f=o.offsetWidth;o.style.overflowY="hidden";const d=o.offsetWidth;return o.style.overflowY=l,r.style.scrollbarGutter=c,f===d}function HK(e){const t=Qt(e),n=t.documentElement,r=t.body,a=Ko(n)?n:r,o={overflowY:a.style.overflowY,overflowX:a.style.overflowX};return Object.assign(a.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(a.style,o)}}function UK(e){var y;const t=Qt(e),n=t.documentElement,r=t.body,a=Bn(n);let o=0,l=0,c=!1;const f=zn.create();if(mm&&(((y=a.visualViewport)==null?void 0:y.scale)??1)!==1)return()=>{};function d(){const g=a.getComputedStyle(n),w=a.getComputedStyle(r),S=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,l=n.scrollLeft,ck={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},dk=n.style.scrollBehavior,uk={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const R=n.scrollHeight>n.clientHeight,k=n.scrollWidth>n.clientWidth,M=g.overflowY==="scroll"||w.overflowY==="scroll",D=g.overflowX==="scroll"||w.overflowX==="scroll",O=Math.max(0,a.innerWidth-r.clientWidth),A=Math.max(0,a.innerHeight-r.clientHeight),L=parseFloat(w.marginTop)+parseFloat(w.marginBottom),H=parseFloat(w.marginLeft)+parseFloat(w.marginRight),F=Ko(n)?n:r;if(c=BK(e),c){n.style.scrollbarGutter=S,F.style.overflowY="hidden",F.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(R||M)&&(n.style.overflowY="scroll"),(k||D)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:L||A?`calc(100dvh - ${L+A}px)`:"100dvh",width:H||O?`calc(100vw - ${H+O}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function m(){Object.assign(n.style,ck),Object.assign(r.style,uk),c||(n.scrollTop=o,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=dk)}function h(){m(),f.request(d)}return d(),a.addEventListener("resize",h),()=>{f.cancel(),m(),typeof a.removeEventListener=="function"&&a.removeEventListener("resize",h)}}class VK{constructor(){st(this,"lockCount",0);st(this,"restore",null);st(this,"timeoutLock",aa.create());st(this,"timeoutUnlock",aa.create());st(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});st(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Qt(t).documentElement,a=Bn(r).getComputedStyle(r).overflowY;if(a==="hidden"||a==="clip"){this.restore=Br;return}const o=iN||!FK(t);this.restore=o?HK(t):UK(t)}}const qK=new VK;function Fw(e=!0,t=null){Ve(()=>{if(e)return qK.acquire(t)},[e,t])}const lD=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function $K(){return v.useContext(lD)}function xm(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:a}=e,o=Ye(a),l=v.useRef(0),c=nr(WK).current,f=nr(YK).current,[d,m]=v.useState(0),h=v.useRef(d),y=Ye((S,R)=>{f.set(S,R??null),h.current+=1,m(h.current)}),g=Ye(S=>{f.delete(S),h.current+=1,m(h.current)}),w=v.useMemo(()=>{const S=new Map;return Array.from(f.keys()).filter(k=>k.isConnected).sort(KK).forEach((k,M)=>{const D=f.get(k)??{};S.set(k,{...D,index:M})}),S},[f,d]);Ve(()=>{if(typeof MutationObserver!="function"||w.size===0)return;const S=new MutationObserver(R=>{const k=new Set,M=D=>k.has(D)?k.delete(D):k.add(D);R.forEach(D=>{D.removedNodes.forEach(M),D.addedNodes.forEach(M)}),k.size===0&&(h.current+=1,m(h.current))});return w.forEach((R,k)=>{k.parentElement&&S.observe(k.parentElement,{childList:!0})}),()=>{S.disconnect()}},[w]),Ve(()=>{h.current===d&&(n.current.length!==w.size&&(n.current.length=w.size),r&&r.current.length!==w.size&&(r.current.length=w.size),l.current=w.size),o(w)},[o,w,n,r,d]),Ve(()=>()=>{n.current=[]},[n]),Ve(()=>()=>{r&&(r.current=[])},[r]);const C=Ye(S=>(c.add(S),()=>{c.delete(S)}));Ve(()=>{c.forEach(S=>S(w))},[c,w]);const T=v.useMemo(()=>({register:y,unregister:g,subscribeMapChange:C,elementsRef:n,labelsRef:r,nextIndexRef:l}),[y,g,C,n,r,l]);return E.jsx(lD.Provider,{value:T,children:t})}function YK(){return new Map}function WK(){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 GK=v.createContext(void 0);function Ic(){const e=v.useContext(GK);return(e==null?void 0:e.direction)??"ltr"}const XK=e=>({name:"arrow",options:e,async fn(t){var K,P;const{x:n,y:r,placement:a,rects:o,platform:l,elements:c,middlewareData:f}=t,{element:d,padding:m=0,offsetParent:h="real"}=Va(e,t)||{};if(d==null)return{};const y=hN(m),g={x:n,y:r},w=Ew(a),C=Sw(w),T=await l.getDimensions(d),S=w==="y",R=S?"top":"left",k=S?"bottom":"right",M=S?"clientHeight":"clientWidth",D=o.reference[C]+o.reference[w]-g[w]-o.floating[C],O=g[w]-o.reference[w],A=h==="real"?await((K=l.getOffsetParent)==null?void 0:K.call(l,d)):c.floating;let L=c.floating[M]||o.floating[C];(!L||!await((P=l.isElement)==null?void 0:P.call(l,A)))&&(L=c.floating[M]||o.floating[C]);const H=D/2-O/2,F=L/2-T[C]/2-1,W=Math.min(y[R],F),j=Math.min(y[k],F),q=W,$=L-T[C]-j,B=L/2-T[C]/2+H,_=$v(q,B,$),z=!f.arrow&&Xo(a)!=null&&B!==_&&o.reference[C]/2-(B<q?W:j)-T[C]/2<0,U=z?B<q?B-q:B-$:0;return{[w]:g[w]+U,data:{[w]:_,centerOffset:B-_-U,...z&&{alignmentOffset:U}},reset:z}}}),QK=(e,t)=>({...XK(e),options:[e,t]}),ZK={name:"hide",async fn(e){var c;const{width:t,height:n,x:r,y:a}=e.rects.reference,o=t===0&&n===0&&r===0&&a===0;return{data:{referenceHidden:((c=(await tK().fn(e)).data)==null?void 0:c.referenceHidden)||o}}}},np={sideX:"left",sideY:"top"},JK={name:"adaptiveOrigin",async fn(e){var R,k;const{x:t,y:n,rects:{floating:r},elements:{floating:a},platform:o,strategy:l,placement:c}=e,f=Bn(a),d=f.getComputedStyle(a);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:t,y:n,data:np};const h=await((R=o.getOffsetParent)==null?void 0:R.call(o,a));let y={width:0,height:0};if(l==="fixed"&&(f!=null&&f.visualViewport))y={width:f.visualViewport.width,height:f.visualViewport.height};else if(h===f){const M=Qt(a);y={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else await((k=o.isElement)==null?void 0:k.call(o,h))&&(y=await o.getDimensions(h));const g=Hr(c);let w=t,C=n;g==="left"&&(w=y.width-(t+r.width)),g==="top"&&(C=y.height-(n+r.height));const T=g==="left"?"right":np.sideX,S=g==="top"?"bottom":np.sideY;return{x:w,y:C,data:{sideX:T,sideY:S}}}};function cD(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function fk(e,t,n){const{rects:r,placement:a}=e;return{side:cD(t,Hr(a),n),align:Xo(a)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Bw(e){var Ct,zt;const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:f=5,sticky:d=!1,arrowPadding:m=5,disableAnchorTracking:h=!1,keepMounted:y=!1,floatingRootContext:g,mounted:w,collisionAvoidance:C,shiftCrossAxis:T=!1,nodeId:S,adaptiveOrigin:R,lazyFlip:k=!1,externalTree:M}=e,[D,O]=v.useState(null);!w&&D!==null&&O(null);const A=C.side||"flip",L=C.align||"flip",H=C.fallbackAxisSide||"end",F=typeof t=="function"?t:void 0,W=Ye(F),j=F?W:t,q=sr(t),B=Ic()==="rtl",_=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[r],z=o==="center"?_:`${_}-${o}`;let U=f;const K=1,P=r==="bottom"?K:0,V=r==="top"?K:0,G=r==="right"?K:0,I=r==="left"?K:0;typeof U=="number"?U={top:U+P,right:U+I,bottom:U+V,left:U+G}:U&&(U={top:(U.top||0)+P,right:(U.right||0)+I,bottom:(U.bottom||0)+V,left:(U.left||0)+G});const Q={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:U},Z=v.useRef(null),te=sr(a),le=sr(l),Me=[XW(gt=>{const Ot=fk(gt,r,B),it=typeof te.current=="function"?te.current(Ot):te.current,ft=typeof le.current=="function"?le.current(Ot):le.current;return{mainAxis:it,crossAxis:ft,alignmentAxis:ft}},[typeof a!="function"?a:0,typeof l!="function"?l:0,B,r])],Pe=L==="none"&&A!=="shift",ne=!Pe&&(d||T||A==="shift"),fe=A==="none"?null:JW({...Q,padding:{top:U.top+K,right:U.right+K,bottom:U.bottom+K,left:U.left+K},mainAxis:!T&&A==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:H}),ye=Pe?null:QW(gt=>{const Ot=Qt(gt.elements.floating).documentElement;return{...Q,rootBoundary:T?{x:0,y:0,width:Ot.clientWidth,height:Ot.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:ne,limiter:d||T?void 0:ZW(it=>{if(!Z.current)return{};const{width:ft,height:yt}=Z.current.getBoundingClientRect(),Ke=xi(Hr(it.placement)),Rt=Ke==="y"?ft:yt,jt=Ke==="y"?U.left+U.right:U.top+U.bottom;return{offset:Rt/2+jt/2}})}},[Q,d,T,U,L]);A==="shift"||L==="shift"||o==="center"?Me.push(ye,fe):Me.push(fe,ye),Me.push(eK({...Q,apply({elements:{floating:gt},rects:{reference:Ot},availableWidth:it,availableHeight:ft}){const yt=gt.style;yt.setProperty("--available-width",`${it}px`),yt.setProperty("--available-height",`${ft}px`),yt.setProperty("--anchor-width",`${Ot.width}px`),yt.setProperty("--anchor-height",`${Ot.height}px`)}}),QK(()=>({element:Z.current||document.createElement("div"),padding:m,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(gt){var Xe,at,St;const{elements:Ot,middlewareData:it,placement:ft,rects:yt,y:Ke}=gt,Rt=Hr(ft),jt=xi(Rt),Tt=Z.current,un=((Xe=it.arrow)==null?void 0:Xe.x)||0,Ht=((at=it.arrow)==null?void 0:at.y)||0,Je=(Tt==null?void 0:Tt.clientWidth)||0,kt=(Tt==null?void 0:Tt.clientHeight)||0,X=un+Je/2,ae=Ht+kt/2,ue=Math.abs(((St=it.shift)==null?void 0:St.y)||0),Re=yt.reference.height/2,_e=typeof a=="function"?a(fk(gt,r,B)):a,rt=ue>_e,nt={top:`${X}px calc(100% + ${_e}px)`,bottom:`${X}px ${-_e}px`,left:`calc(100% + ${_e}px) ${ae}px`,right:`${-_e}px ${ae}px`}[Rt],We=`${X}px ${yt.reference.y+Re-Ke}px`;return Ot.floating.style.setProperty("--transform-origin",ne&&jt==="y"&&rt?We:nt),{}}},ZK,R),Ve(()=>{!w&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[w,g]);const Le=v.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Oe,elements:Ee,x:Te,y:J,middlewareData:Se,update:ve,placement:Be,context:qe,isPositioned:De,floatingStyles:ut}=sK({rootContext:g,placement:z,middleware:Me,strategy:n,whileElementsMounted:y?void 0:(...gt)=>ik(...gt,Le),nodeId:S,externalTree:M}),{sideX:he,sideY:Ce}=Se.adaptiveOrigin||np,ee=De?n:"fixed",de=v.useMemo(()=>{const gt=R?{position:ee,[he]:Te,[Ce]:J}:{position:ee,...ut};return De||(gt.opacity=0),gt},[R,ee,he,Te,Ce,J,ut,De]),Ae=v.useRef(null);Ve(()=>{if(!w)return;const gt=q.current,Ot=typeof gt=="function"?gt():gt,ft=(hk(Ot)?Ot.current:Ot)||null||null;ft!==Ae.current&&(Oe.setPositionReference(ft),Ae.current=ft)},[w,Oe,j,q]),v.useEffect(()=>{if(!w)return;const gt=q.current;typeof gt!="function"&&hk(gt)&&gt.current!==Ae.current&&(Oe.setPositionReference(gt.current),Ae.current=gt.current)},[w,Oe,j,q]),v.useEffect(()=>{if(y&&w&&Ee.domReference&&Ee.floating)return ik(Ee.domReference,Ee.floating,ve,Le)},[y,w,Ee,ve,Le]);const He=Hr(Be),$e=cD(r,He,B),et=Xo(Be)||"center",ze=!!((Ct=Se.hide)!=null&&Ct.referenceHidden);Ve(()=>{k&&w&&De&&O(He)},[k,w,De,He]);const Ze=v.useMemo(()=>{var gt,Ot;return{position:"absolute",top:(gt=Se.arrow)==null?void 0:gt.y,left:(Ot=Se.arrow)==null?void 0:Ot.x}},[Se.arrow]),tt=((zt=Se.arrow)==null?void 0:zt.centerOffset)!==0;return v.useMemo(()=>({positionerStyles:de,arrowStyles:Ze,arrowRef:Z,arrowUncentered:tt,side:$e,align:et,physicalSide:He,anchorHidden:ze,refs:Oe,context:qe,isPositioned:De,update:ve}),[de,Ze,Z,tt,$e,et,He,ze,Oe,qe,De,ve])}function hk(e){return e!=null&&"current"in e}const uD=v.createContext(void 0);function Hw(){const e=v.useContext(uD);if(!e)throw new Error(Cn(59));return e}const Uw=v.forwardRef(function(t,n){const{cutout:r,...a}=t;let o;if(r){const l=r==null?void 0:r.getBoundingClientRect();o=`polygon(
384
- 0% 0%,
385
- 100% 0%,
386
- 100% 100%,
387
- 0% 100%,
388
- 0% 0%,
389
- ${l.left}px ${l.top}px,
390
- ${l.left}px ${l.bottom}px,
391
- ${l.right}px ${l.bottom}px,
392
- ${l.right}px ${l.top}px,
393
- ${l.left}px ${l.top}px
394
- )`}return E.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...a,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function Pc(e){return e==="starting"?pH:Dn}function Ap(e,t){e&&Object.assign(e.style,t)}const dD={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},eG={position:"fixed"},tG=v.forwardRef(function(t,n){const{anchor:r,positionMethod:a="absolute",className:o,render:l,side:c="bottom",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y,arrowPadding:g=5,sticky:w=!1,disableAnchorTracking:C,alignItemWithTrigger:T=!0,collisionAvoidance:S=xO,...R}=t,{store:k,listRef:M,labelsRef:D,alignItemWithTriggerActiveRef:O,selectedItemTextRef:A,valuesRef:L,initialValueRef:H,popupRef:F,setValue:W}=ua(),j=rD(),q=Et(k,wt.open),$=Et(k,wt.mounted),B=Et(k,wt.modal),_=Et(k,wt.value),z=Et(k,wt.openMethod),U=Et(k,wt.positionerElement),K=Et(k,wt.triggerElement),P=Et(k,wt.isItemEqualToValue),V=Et(k,wt.transitionStatus),G=v.useRef(null),I=v.useRef(null),[Q,Z]=v.useState(T),te=$&&Q&&z!=="touch";!$&&Q!==T&&Z(T),Ve(()=>{$||(wt.scrollUpArrowVisible(k.state)&&k.set("scrollUpArrowVisible",!1),wt.scrollDownArrowVisible(k.state)&&k.set("scrollDownArrowVisible",!1))},[k,$]),v.useImperativeHandle(O,()=>te),Fw((te||B)&&q&&z!=="touch",K);const le=Bw({anchor:r,floatingRootContext:j,positionMethod:a,mounted:$,side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:g,collisionBoundary:h,collisionPadding:y,sticky:w,disableAnchorTracking:C??te,collisionAvoidance:S,keepMounted:!0}),pe=te?"none":le.side,we=te?eG:le.positionerStyles,Me=v.useMemo(()=>{const Ee={};return q||(Ee.pointerEvents="none"),{role:"presentation",hidden:!$,style:{...we,...Ee}}},[q,$,we]),Pe={open:q,side:pe,align:le.align,anchorHidden:le.anchorHidden},ne=Ye(Ee=>{k.set("positionerElement",Ee)}),fe=Dt("div",t,{ref:[n,ne],state:Pe,stateAttributesMapping:da,props:[Me,Pc(V),R]}),ye=v.useRef(0),Le=Ye(Ee=>{if(Ee.size===0&&ye.current===0||L.current.length===0)return;const Te=ye.current;if(ye.current=Ee.size,Ee.size===Te)return;const J=vt(zi);if(Te!==0&&!k.state.multiple&&_!==null&&ld(L.current,_,P)===-1){const ve=H.current,qe=ve!=null&&ld(L.current,ve,P)!==-1?ve:null;W(qe,J),qe===null&&(k.set("selectedIndex",null),A.current=null)}if(Te!==0&&k.state.multiple&&Array.isArray(_)){const Se=Be=>ld(L.current,Be,P)!==-1,ve=_.filter(Be=>Se(Be));(ve.length!==_.length||ve.some(Be=>!vK(_,Be,P)))&&(W(ve,J),ve.length===0&&(k.set("selectedIndex",null),A.current=null))}if(q&&te){k.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Se={height:""};Ap(U,Se),Ap(F.current,Se)}}),Oe=v.useMemo(()=>({...le,side:pe,alignItemWithTriggerActive:te,setControlledAlignItemWithTrigger:Z,scrollUpArrowRef:G,scrollDownArrowRef:I}),[le,pe,te,Z]);return E.jsx(xm,{elementsRef:M,labelsRef:D,onMapChange:Le,children:E.jsxs(uD.Provider,{value:Oe,children:[$&&B&&E.jsx(Uw,{inert:zw(!q),cutout:K}),fe]})})});function fD(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 _h="base-ui-disable-scrollbar",Ed={className:_h,getElement(e){return E.jsx("style",{nonce:e,href:_h,precedence:"base-ui:low",children:`.${_h}{scrollbar-width:none}.${_h}::-webkit-scrollbar{display:none}`})}},nG=v.createContext(void 0);function hD(e){return v.useContext(nG)}const Ql="ArrowUp",ks="ArrowDown",Cd="ArrowLeft",Zl="ArrowRight",Kd="Home",Gd="End",pD=new Set([Cd,Zl]),rG=new Set([Cd,Zl,Kd,Gd]),mD=new Set([Ql,ks]),iG=new Set([Ql,ks,Kd,Gd]),gD=new Set([...pD,...mD]),aG=new Set([...gD,Kd,Gd]),Vw=new Set([Ql,ks,Cd,Zl,Kd,Gd]),oG="Shift",sG="Control",lG="Alt",cG="Meta",uG=new Set([oG,sG,lG,cG]);function dG(e){return kn(e)&&e.tagName==="INPUT"}function pk(e){return!!(dG(e)&&e.selectionStart!=null||kn(e)&&e.tagName==="TEXTAREA")}function mk(e,t,n,r){if(!e||!t||!t.scrollTo)return;let a=e.scrollLeft,o=e.scrollTop;const l=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(l&&r!=="vertical"){const f=gk(e,t,"left"),d=zh(e),m=zh(t);n==="ltr"&&(f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight?a=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight:f-m.scrollMarginLeft<e.scrollLeft+d.scrollPaddingLeft&&(a=f-m.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(f-m.scrollMarginRight<e.scrollLeft+d.scrollPaddingLeft?a=f-m.scrollMarginLeft-d.scrollPaddingLeft:f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight&&(a=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight))}if(c&&r!=="horizontal"){const f=gk(e,t,"top"),d=zh(e),m=zh(t);f-m.scrollMarginTop<e.scrollTop+d.scrollPaddingTop?o=f-m.scrollMarginTop-d.scrollPaddingTop:f+t.offsetHeight+m.scrollMarginBottom>e.scrollTop+e.clientHeight-d.scrollPaddingBottom&&(o=f+t.offsetHeight+m.scrollMarginBottom-e.clientHeight+d.scrollPaddingBottom)}e.scrollTo({left:a,top:o,behavior:"auto"})}function gk(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let a=0;for(;t.offsetParent&&(a+=t[r],t.offsetParent!==e);)t=t.offsetParent;return a}function zh(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 Ba(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const fG=v.createContext(void 0),hG={disableStyleElements:!1};function yD(){return v.useContext(fG)??hG}const Es=1,pG={...da,...Ya},mG=v.forwardRef(function(t,n){const{render:r,className:a,finalFocus:o,...l}=t,{store:c,popupRef:f,onOpenChangeComplete:d,setOpen:m,valueRef:h,selectedItemTextRef:y,keyboardActiveRef:g,multiple:w,handleScrollArrowVisibility:C,scrollHandlerRef:T,highlightItemOnHover:S}=ua(),{side:R,align:k,alignItemWithTriggerActive:M,setControlledAlignItemWithTrigger:D,scrollDownArrowRef:O,scrollUpArrowRef:A}=Hw(),L=hD()!=null,H=rD(),{nonce:F,disableStyleElements:W}=yD(),j=Fn(),q=Et(c,wt.id),$=Et(c,wt.open),B=Et(c,wt.mounted),_=Et(c,wt.popupProps),z=Et(c,wt.transitionStatus),U=Et(c,wt.triggerElement),K=Et(c,wt.positionerElement),P=Et(c,wt.listElement),V=v.useRef(0),G=v.useRef(!1),I=v.useRef(0),Q=v.useRef(!1),Z=v.useRef({}),te=Ud(),le=Ye(Pe=>{if(!K||!f.current||!Q.current)return;if(G.current||!M){C();return}const ne=K.style.top==="0px",fe=K.style.bottom==="0px",ye=K.getBoundingClientRect().height,Le=Qt(K),Oe=getComputedStyle(K),Ee=parseFloat(Oe.marginTop),Te=parseFloat(Oe.marginBottom),J=yk(getComputedStyle(f.current)),Se=Math.min(Le.documentElement.clientHeight-Ee-Te,J),ve=Pe.scrollTop,Be=bk(Pe);let qe=0,De=null,ut=!1,he=!1;const Ce=de=>{K.style.height=`${de}px`},ee=(de,Ae)=>{const He=Ba(de,0,Se-ye);He>0&&Ce(ye+He),Pe.scrollTop=Ae,Se-(ye+He)<=Es&&(G.current=!0),C()};if(ne){const de=Be-ve,Ae=ye+de,He=Math.min(Ae,Se);if(qe=He,de<=Es){ee(de,Be);return}Se-He>Es?he=!0:ut=!0}else if(fe){const de=ve,Ae=ye+de,He=Math.min(Ae,Se),$e=Ae-Se;if(qe=He,de<=Es){ee(de,0);return}Se-He>Es?De=0:(ut=!0,ve<Be&&(De=ve-(de-$e)))}if(qe=Math.ceil(qe),qe!==0&&Ce(qe),he||De!=null){const de=bk(Pe),Ae=he?de:Ba(De,0,de);Math.abs(Pe.scrollTop-Ae)>Es&&(Pe.scrollTop=Ae)}(ut||qe>=Se-Es)&&(G.current=!0),C()});v.useImperativeHandle(T,()=>le,[le]),Wa({open:$,ref:f,onComplete(){$&&(d==null||d(!0))}});const pe={open:$,transitionStatus:z,side:R,align:k};Ve(()=>{!K||!f.current||Object.keys(Z.current).length||(Z.current={top:K.style.top||"0",left:K.style.left||"0",right:K.style.right,height:K.style.height,bottom:K.style.bottom,minHeight:K.style.minHeight,maxHeight:K.style.maxHeight,marginTop:K.style.marginTop,marginBottom:K.style.marginBottom})},[f,K]),Ve(()=>{$||M||(Q.current=!1,G.current=!1,V.current=0,I.current=0,Ap(K,Z.current))},[$,M,K,f]),Ve(()=>{const Pe=f.current;if(!(!$||!U||!K||!Pe||c.state.transitionStatus==="ending")){if(!M){Q.current=!0,te.request(C),Pe.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{var fe;const ne=gG(Pe);Pe.style.removeProperty("--transform-origin");try{const ye=getComputedStyle(K),Le=getComputedStyle(Pe),Oe=Qt(U),Ee=Bn(K),Te=U.getBoundingClientRect(),J=K.getBoundingClientRect(),Se=Te.left,ve=Te.height,Be=P||Pe,qe=Be.scrollHeight,De=parseFloat(Le.borderBottomWidth),ut=parseFloat(ye.marginTop)||10,he=parseFloat(ye.marginBottom)||10,Ce=parseFloat(ye.minHeight)||100,ee=yk(Le),de=5,Ae=5,He=20,$e=Oe.documentElement.clientHeight-ut-he,et=Oe.documentElement.clientWidth,ze=$e-Te.bottom+ve,Ze=y.current,tt=h.current;let Ct,zt=0,gt=0;if(Ze&&tt){const kt=tt.getBoundingClientRect();Ct=Ze.getBoundingClientRect();const X=kt.left-Se,ae=Ct.left-J.left,ue=kt.top-Te.top+kt.height/2,Re=Ct.top-J.top+Ct.height/2;zt=X-ae,gt=Re-ue}const Ot=ze+gt+he+De;let it=Math.min($e,Ot);const ft=$e-ut-he,yt=Ot-it,Ke=Math.max(de,Se+zt),Rt=et-Ae,jt=Math.max(0,Ke+J.width-Rt);K.style.left=`${Ke-jt}px`,K.style.height=`${it}px`,K.style.maxHeight="auto",K.style.marginTop=`${ut}px`,K.style.marginBottom=`${he}px`,Pe.style.height="100%";const Tt=Be.scrollHeight-Be.clientHeight,un=yt>=Tt;un&&(it=Math.min($e,J.height)-(yt-Tt));const Ht=Te.top<He||Te.bottom>$e-He||it<Math.min(qe,Ce),Je=(((fe=Ee.visualViewport)==null?void 0:fe.scale)??1)!==1&&mm;if(Ht||Je){Q.current=!0,Ap(K,Z.current),pr.flushSync(()=>D(!1));return}if(un){const kt=Math.max(0,$e-Ot);K.style.top=J.height>=ft?"0":`${kt}px`,K.style.height=`${it}px`,Be.scrollTop=Be.scrollHeight-Be.clientHeight,V.current=Math.max(Ce,it)}else K.style.bottom="0",V.current=Math.max(Ce,it),Be.scrollTop=yt;if(Ct){const kt=J.top,X=J.height,ae=Ct.top+Ct.height/2,ue=X>0?(ae-kt)/X*100:50,Re=Ba(ue,0,100);Pe.style.setProperty("--transform-origin",`50% ${Re}%`)}(V.current===$e||it>=ee)&&(G.current=!0),C(),setTimeout(()=>{Q.current=!0})}finally{ne()}})}},[c,$,K,U,h,y,f,C,M,D,te,O,A,P]),v.useEffect(()=>{if(!M||!K||!$)return;const Pe=Bn(K);function ne(fe){m(!1,vt(xU,fe))}return Pe.addEventListener("resize",ne),()=>{Pe.removeEventListener("resize",ne)}},[m,M,K,$]);const we={...P?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:`${q}-list`},onKeyDown(Pe){g.current=!0,L&&Vw.has(Pe.key)&&Pe.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(Pe){if(!S||fD(Pe)||Pe.pointerType==="touch")return;const ne=Pe.currentTarget;j.start(0,()=>{c.set("activeIndex",null),ne.focus({preventScroll:!0})})},onScroll(Pe){P||le(Pe.currentTarget)},...M&&{style:P?{height:"100%"}:dD}},Me=Dt("div",t,{ref:[n,f],state:pe,stateAttributesMapping:pG,props:[_,we,Pc(z),{className:!P&&M?Ed.className:void 0},l]});return E.jsxs(v.Fragment,{children:[!W&&Ed.getElement(F),E.jsx(Mw,{context:H,modal:!1,disabled:!B,returnFocus:o,restoreFocus:!0,children:Me})]})});function yk(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function bk(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const vk=[["transform","none"],["scale","1"],["translate","0 0"]];function gG(e){const{style:t}=e,n={};for(const[r,a]of vk)n[r]=t.getPropertyValue(r),t.setProperty(r,a,"important");return()=>{for(const[r]of vk){const a=n[r];a?t.setProperty(r,a):t.removeProperty(r)}}}const yG=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,{store:l,scrollHandlerRef:c}=ua(),{alignItemWithTriggerActive:f}=Hw(),d=Et(l,wt.hasScrollArrows),m=Et(l,wt.openMethod),h=Et(l,wt.multiple),g={id:`${Et(l,wt.id)}-list`,role:"listbox","aria-multiselectable":h||void 0,onScroll(C){var T;(T=c.current)==null||T.call(c,C.currentTarget)},...f&&{style:dD},className:d&&m!=="touch"?Ed.className:void 0},w=Ye(C=>{l.set("listElement",C)});return Dt("div",t,{ref:[n,w],props:[g,o]})});let bD=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function qw(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:a,index:o}=e,{register:l,unregister:c,subscribeMapChange:f,elementsRef:d,labelsRef:m,nextIndexRef:h}=$K(),y=v.useRef(-1),[g,w]=v.useState(o??(a===bD.GuessFromOrder?()=>{if(y.current===-1){const S=h.current;h.current+=1,y.current=S}return y.current}:-1)),C=v.useRef(null),T=v.useCallback(S=>{var R;if(C.current=S,g!==-1&&S!==null&&(d.current[g]=S,m)){const k=t!==void 0;m.current[g]=k?t:((R=r==null?void 0:r.current)==null?void 0:R.textContent)??S.textContent}},[g,d,m,t,r]);return Ve(()=>{if(o!=null)return;const S=C.current;if(S)return l(S,n),()=>{c(S)}},[o,l,c,n]),Ve(()=>{if(o==null)return f(S=>{var k;const R=C.current?(k=S.get(C.current))==null?void 0:k.index:null;R!=null&&w(R)})},[o,f,w]),v.useMemo(()=>({ref:T,index:g}),[g,T])}const vD=v.createContext(void 0);function $w(){const e=v.useContext(vD);if(!e)throw new Error(Cn(57));return e}const bG=v.memo(v.forwardRef(function(t,n){const{render:r,className:a,value:o=null,label:l,disabled:c=!1,nativeButton:f=!1,...d}=t,m=v.useRef(null),h=qw({label:l,textRef:m,indexGuessBehavior:bD.GuessFromOrder}),{store:y,getItemProps:g,setOpen:w,setValue:C,selectionRef:T,typingRef:S,valuesRef:R,keyboardActiveRef:k,multiple:M,highlightItemOnHover:D}=ua(),O=Fn(),A=Et(y,wt.isActive,h.index),L=Et(y,wt.isSelected,h.index,o),H=Et(y,wt.isSelectedByFocus,h.index),F=Et(y,wt.isItemEqualToValue),W=h.index,j=W!==-1,q=v.useRef(null),$=sr(W);Ve(()=>{if(!j)return;const te=R.current;return te[W]=o,()=>{delete te[W]}},[j,W,o,R]),Ve(()=>{if(!j)return;const te=y.state.value;let le=te;M&&Array.isArray(te)&&te.length>0&&(le=te[te.length-1]),le!==void 0&&Ec(o,le,F)&&y.set("selectedIndex",W)},[j,W,M,F,y,o]);const B={disabled:c,selected:L,highlighted:A},_=g({active:A,selected:L});_.onFocus=void 0,_.id=void 0;const z=v.useRef(null),U=v.useRef("mouse"),K=v.useRef(!1),{getButtonProps:P,buttonRef:V}=qa({disabled:c,focusableWhenDisabled:!0,native:f});function G(te){const le=y.state.value;if(M){const pe=Array.isArray(le)?le:[],we=L?xK(pe,o,F):[...pe,o];C(we,vt(td,te))}else C(o,vt(td,te)),w(!1,vt(td,te))}const I={role:"option","aria-selected":L,tabIndex:A?0:-1,onFocus(){y.set("activeIndex",W)},onMouseEnter(){!k.current&&y.state.selectedIndex===null&&D&&y.set("activeIndex",W)},onMouseMove(){D&&y.set("activeIndex",W)},onMouseLeave(te){!D||k.current||fD(te)||O.start(0,()=>{y.state.activeIndex===W&&y.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(te){z.current=te.key,y.set("activeIndex",W)},onClick(te){K.current=!1,!(te.type==="keydown"&&z.current===null)&&(c||z.current===" "&&S.current||U.current!=="touch"&&!A||(z.current=null,G(te.nativeEvent)))},onPointerEnter(te){U.current=te.pointerType},onPointerDown(te){U.current=te.pointerType,K.current=!0},onMouseUp(te){if(c)return;if(K.current){K.current=!1;return}const le=!T.current.allowSelectedMouseUp&&L,pe=!T.current.allowUnselectedMouseUp&&!L;le||pe||U.current!=="touch"&&!A||G(te.nativeEvent)}},Q=Dt("div",t,{ref:[V,n,h.ref,q],state:B,props:[_,I,d,P]}),Z=v.useMemo(()=>({selected:L,indexRef:$,textRef:m,selectedByFocus:H,hasRegistered:j}),[L,$,m,H,j]);return E.jsx(vD.Provider,{value:Z,children:Q})})),vG=v.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:a}=$w();return r||a?E.jsx(xG,{...t,ref:n}):null}),xG=v.memo(v.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:a,...o}=e,{selected:l}=$w(),c=v.useRef(null),{transitionStatus:f,setMounted:d}=Vd(l),h=Dt("span",e,{ref:[t,c],state:{selected:l,transitionStatus:f},props:[{"aria-hidden":!0,children:"✔️"},o],stateAttributesMapping:Ya});return Wa({open:l,ref:c,onComplete(){l||d(!1)}}),h})),wG=v.memo(v.forwardRef(function(t,n){const{indexRef:r,textRef:a,selectedByFocus:o,hasRegistered:l}=$w(),{selectedItemTextRef:c}=ua(),{className:f,render:d,...m}=t,h=v.useCallback(g=>{if(!g||!l)return;const w=c.current===null||!c.current.isConnected;(o||w&&r.current===0)&&(c.current=g)},[c,r,o,l]);return Dt("div",t,{ref:[h,n,a],props:m})})),xD=v.forwardRef(function(t,n){const{render:r,className:a,direction:o,keepMounted:l=!1,...c}=t,{store:f,popupRef:d,listRef:m,handleScrollArrowVisibility:h,scrollArrowsMountedCountRef:y}=ua(),{side:g,scrollDownArrowRef:w,scrollUpArrowRef:C}=Hw(),T=o==="up"?wt.scrollUpArrowVisible:wt.scrollDownArrowVisible,S=Et(f,T),R=Et(f,wt.openMethod),k=S&&R!=="touch",M=Fn(),D=o==="up"?C:w,{transitionStatus:O,setMounted:A}=Vd(k);Ve(()=>(y.current+=1,f.state.hasScrollArrows||f.set("hasScrollArrows",!0),()=>{y.current=Math.max(0,y.current-1),y.current===0&&f.state.hasScrollArrows&&f.set("hasScrollArrows",!1)}),[f,y]),Wa({open:k,ref:D,onComplete(){k||A(!1)}});const F=Dt("div",t,{ref:[n,D],state:{direction:o,visible:k,side:g,transitionStatus:O},props:[{"aria-hidden":!0,children:o==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(j){if(j.movementX===0&&j.movementY===0||M.isStarted())return;f.set("activeIndex",null);function q(){var U;const $=f.state.listElement??d.current;if(!$)return;f.set("activeIndex",null),h();const B=$.scrollTop===0,_=Math.round($.scrollTop+$.clientHeight)>=$.scrollHeight;if(m.current.length===0&&(o==="up"?f.set("scrollUpArrowVisible",!B):f.set("scrollDownArrowVisible",!_)),o==="up"&&B||o==="down"&&_){M.clear();return}if((f.state.listElement||d.current)&&m.current&&m.current.length>0){const K=m.current,P=((U=D.current)==null?void 0:U.offsetHeight)||0;if(o==="up"){let V=0;const G=$.scrollTop+P;for(let Q=0;Q<K.length;Q+=1){const Z=K[Q];if(Z&&Z.offsetTop>=G){V=Q;break}}const I=Math.max(0,V-1);if(I<V){const Q=K[I];Q&&($.scrollTop=Math.max(0,Q.offsetTop-P))}else $.scrollTop=0}else{let V=K.length-1;const G=$.scrollTop+$.clientHeight-P;for(let Q=0;Q<K.length;Q+=1){const Z=K[Q];if(Z&&Z.offsetTop+Z.offsetHeight>G){V=Math.max(0,Q-1);break}}const I=Math.min(K.length-1,V+1);if(I>V){const Q=K[I];Q&&($.scrollTop=Q.offsetTop+Q.offsetHeight-$.clientHeight+P)}else $.scrollTop=$.scrollHeight-$.clientHeight}}M.start(40,q)}M.start(40,q)},onMouseLeave(){M.clear()}},c]});return k||l?F:null}),SG=v.forwardRef(function(t,n){return E.jsx(xD,{...t,ref:n,direction:"down"})}),EG=v.forwardRef(function(t,n){return E.jsx(xD,{...t,ref:n,direction:"up"})}),wD=v.createContext(void 0);function CG(){const e=v.useContext(wD);if(e===void 0)throw new Error(Cn(56));return e}const TG=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,[l,c]=v.useState(),f=v.useMemo(()=>({labelId:l,setLabelId:c}),[l,c]),d=Dt("div",t,{ref:n,props:[{role:"group","aria-labelledby":l},o]});return E.jsx(wD.Provider,{value:f,children:d})}),RG=v.forwardRef(function(t,n){const{className:r,render:a,id:o,...l}=t,{setLabelId:c}=CG(),f=Hi(o);return Ve(()=>{c(f)},[f,c]),Dt("div",t,{ref:n,props:[{id:f},l]})}),SD=v.forwardRef(function(t,n){const{className:r,render:a,orientation:o="horizontal",...l}=t;return Dt("div",t,{state:{orientation:o},ref:n,props:[{role:"separator","aria-orientation":o},l]})}),rp=TK;function kG({className:e,...t}){return E.jsx(TG,{"data-slot":"select-group",className:je("scroll-my-1 p-1",e),...t})}function jb({className:e,...t}){return E.jsx(LK,{"data-slot":"select-value",className:je("flex flex-1 text-left",e),...t})}function ip({className:e,size:t="default",children:n,...r}){return E.jsxs(IK,{"data-slot":"select-trigger","data-size":t,className:je("border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-2 aria-invalid:ring-2 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,E.jsx(jK,{render:E.jsx(cO,{className:"text-muted-foreground size-4 pointer-events-none"})})]})}function ap({className:e,children:t,side:n="bottom",sideOffset:r=4,align:a="center",alignOffset:o=0,alignItemWithTrigger:l=!0,...c}){return E.jsx(zK,{children:E.jsx(tG,{side:n,sideOffset:r,align:a,alignOffset:o,alignItemWithTrigger:l,className:"isolate z-50",children:E.jsxs(mG,{"data-slot":"select-content","data-align-trigger":l,className:je("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none",e),...c,children:[E.jsx(OG,{}),E.jsx(yG,{children:t}),E.jsx(AG,{})]})})})}function MG({className:e,...t}){return E.jsx(RG,{"data-slot":"select-label",className:je("text-muted-foreground px-1.5 py-1 text-xs",e),...t})}function Pa({className:e,children:t,...n}){return E.jsxs(bG,{"data-slot":"select-item",className:je("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[E.jsx(wG,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),E.jsx(vG,{render:E.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:E.jsx(fp,{className:"pointer-events-none"})})]})}function OG({className:e,...t}){return E.jsx(EG,{"data-slot":"select-scroll-up-button",className:je("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full",e),...t,children:E.jsx(_F,{})})}function AG({className:e,...t}){return E.jsx(SG,{"data-slot":"select-scroll-down-button",className:je("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full",e),...t,children:E.jsx(cO,{})})}const Jv="::";function xk(e,t){return`${e??""}${Jv}${t}`}function NG(e){const t=e.indexOf(Jv);return t<0?{providerId:null,modelId:e}:{providerId:e.slice(0,t)||null,modelId:e.slice(t+Jv.length)}}function DG({providerId:e,modelId:t,onChange:n,disabled:r,className:a}){var C;const{t:o}=Sn(),{data:l}=Vo({queryKey:["llm-providers"],queryFn:async()=>{const T=await fetch("/api/llm/providers");if(!T.ok)throw new Error("Failed to load providers");return await T.json()},throwOnError:!1}),{data:c}=Vo({queryKey:["llm-settings"],queryFn:async()=>{const T=await fetch("/api/llm/settings");if(!T.ok)throw new Error("Failed to load settings");return await T.json()},throwOnError:!1}),f=((l==null?void 0:l.providers)??[]).filter(T=>T.enabled&&T.models.length>0),d=e??(c==null?void 0:c.settings.defaultProviderId)??null,m=t??(c==null?void 0:c.settings.defaultModelId)??null,h=m?xk(d,m):"",y=f.some(T=>T.id===d&&T.models.includes(m??"")),g=((C=f.find(T=>T.id===d))==null?void 0:C.name)??null,w=m?g?`${g}/${m}`:m:o("agent.model.placeholder");return E.jsxs(rp,{value:h,onValueChange:T=>{if(typeof T!="string"||!T)return;const S=NG(T);n(S.providerId,S.modelId)},disabled:r||f.length===0,children:[E.jsx(ip,{size:"sm",className:je("h-7 w-full min-w-0 border-transparent bg-transparent text-muted-foreground text-xs hover:border-border/40 dark:bg-transparent dark:hover:bg-transparent",a),"data-testid":"agent-model-picker","aria-label":o("agent.model.select"),children:E.jsx("span",{className:"min-w-0 truncate",children:w})}),E.jsxs(ap,{children:[!y&&m&&E.jsx(Pa,{value:h,className:"text-muted-foreground",children:m}),f.map(T=>E.jsxs(kG,{children:[E.jsx(MG,{children:T.name}),T.models.map(S=>E.jsx(Pa,{value:xk(T.id,S),children:S},`${T.id}:${S}`))]},T.id))]})]})}function IG({queued:e,onEdit:t,onWithdraw:n,onSteer:r}){const{t:a}=Sn(),[o,l]=v.useState(null),[c,f]=v.useState("");if(e.length===0)return null;const d=h=>{l(h.id),f(h.text)},m=h=>{const y=c.trim();y&&t(h,y),l(null)};return E.jsxs("div",{"data-testid":"agent-queue",className:"bg-muted/50 mx-3 mb-2 flex shrink-0 flex-col gap-1.5 rounded-xl px-2.5 py-2",children:[E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:a("agent.queue.title",{count:e.length})}),E.jsxs(qt,{"data-testid":"agent-queue-steer",size:"xs",variant:"outline",onClick:r,title:a("agent.queue.steerHint"),children:[E.jsx(hO,{}),a("agent.queue.steer")]})]}),E.jsx("ul",{className:"flex flex-col gap-1",children:e.map(h=>E.jsx("li",{"data-testid":`agent-queue-item-${h.id}`,className:"bg-background/60 flex items-start gap-1.5 rounded-lg px-2 py-1",children:o===h.id?E.jsxs(E.Fragment,{children:[E.jsx(Jx,{value:c,onChange:y=>f(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),m(h.id)),y.key==="Escape"&&l(null)},rows:1,className:"max-h-32 min-h-7 flex-1 resize-none text-xs",autoFocus:!0}),E.jsx(qt,{size:"icon-sm",variant:"ghost",onClick:()=>m(h.id),"aria-label":a("common.save"),children:E.jsx(fp,{})})]}):E.jsxs(E.Fragment,{children:[E.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:h.text}),E.jsx(qt,{size:"icon-sm",variant:"ghost",onClick:()=>d(h),"aria-label":a("common.edit"),children:E.jsx($p,{})}),E.jsx(qt,{"data-testid":`agent-queue-withdraw-${h.id}`,size:"icon-sm",variant:"ghost",onClick:()=>n(h.id),"aria-label":a("agent.queue.withdraw"),children:E.jsx(Ua,{})})]})},h.id))})]})}function PG({onSend:e,onSteer:t,onStop:n,running:r,steerable:a,disabled:o,modelPicker:l,writeModeControl:c}){const{t:f}=Sn(),[d,m]=v.useState(""),h=()=>{const g=d.trim();!g||o||(e==null||e(g),m(""))},y=()=>{const g=d.trim();!g||o||(t==null||t(g),m(""))};return E.jsxs("div",{"data-testid":"agent-chat-input",className:"bg-chat-surface flex shrink-0 flex-col gap-2 mx-3 mb-2.5 rounded-xl mt-1.5 focus-within:ring-1 focus-within:ring-ring/30",children:[E.jsx(Jx,{"data-testid":"agent-chat-input-textarea",value:d,onChange:g=>m(g.target.value),onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&!g.nativeEvent.isComposing&&(g.preventDefault(),h())},placeholder:f("agent.panel.inputPlaceholder"),disabled:o,className:"max-h-40 min-h-[4.5rem] w-full resize-none border-transparent bg-transparent text-[13px] shadow-none focus-visible:border-transparent focus-visible:ring-0 disabled:bg-transparent dark:bg-transparent dark:disabled:bg-transparent",rows:3}),E.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 px-2.5 pb-2.5",children:[E.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c,l&&E.jsx("div",{className:"min-w-0 flex-1",children:l})]}),r?E.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[a&&E.jsx(qt,{"data-testid":"agent-chat-steer",size:"icon",variant:"outline",disabled:o||d.trim().length===0,onClick:y,"aria-label":f("agent.queue.steer"),title:f("agent.queue.steerHint"),children:E.jsx(hO,{})}),E.jsx(qt,{"data-testid":"agent-chat-send",size:"icon",variant:"secondary",disabled:o||d.trim().length===0,onClick:h,"aria-label":f("agent.panel.send"),children:E.jsx(OT,{})}),E.jsx(qt,{"data-testid":"agent-chat-stop",size:"icon",variant:"destructive",onClick:()=>n==null?void 0:n(),"aria-label":f("agent.panel.stop"),children:E.jsx(MB,{})})]}):E.jsx(qt,{"data-testid":"agent-chat-send",size:"icon",className:"ml-auto shrink-0",disabled:o||d.trim().length===0,onClick:h,"aria-label":f("agent.panel.send"),children:E.jsx(OT,{})})]})]})}function LG(e,t,n){var o;if(!e.deviceId||!e.paneId)return null;const r=((o=n==null?void 0:n.find(l=>l.id===e.deviceId))==null?void 0:o.name)??null,a=t[e.deviceId];if(!(a!=null&&a.session))return{label:`${e.paneId}@${r??"?"}`,state:"unknown",windowId:null};for(const l of a.session.windows){const c=l.panes.find(f=>f.id===e.paneId);if(c)return{label:DU({paneIdx:c.index,windowIdx:l.index,paneTitle:c.title,windowName:l.name,windowCustomName:l.customName,deviceName:r}),state:"valid",windowId:l.id}}return{label:`${e.paneId}@${r??"?"}`,state:"invalid",windowId:null}}function jG(){var Q;const{t:e}=Sn(),t=Ix(),n=ra(Z=>Z.setSidebarTab),r=Wj("/devices/:deviceId/windows/:windowId/panes/:paneId"),a=(r==null?void 0:r.params.deviceId)??null,o=(r==null?void 0:r.params.paneId)??null,l=ln(Z=>Z.sessions),c=ln(Z=>Z.activeSessionId),f=ln(Z=>Z.draft),d=ln(Z=>Z.activeSessionId?Z.messages[Z.activeSessionId]:void 0),m=ln(Z=>Z.activeSessionId?Z.inProgress[Z.activeSessionId]:void 0),h=ln(Z=>Z.activeSessionId?Z.pendingConfirmations[Z.activeSessionId]:void 0),y=ln(Z=>Z.activeSessionId?Z.sending[Z.activeSessionId]:void 0),g=ln(Z=>Z.activeSessionId?Z.queued[Z.activeSessionId]:void 0),w=ln(Z=>Z.defaultWriteMode),C=qn(Z=>Z.snapshots),{data:T}=Vo({queryKey:["devices"],queryFn:async()=>{const Z=await fetch("/api/devices");if(!Z.ok)throw new Error("Failed to load devices");return Z.json()},throwOnError:!1});v.useEffect(()=>{const Z=ln.getState();Z.ensureInitialized(),Z.loadSessions()},[]);const S=c?l[c]:void 0,R=v.useMemo(()=>{var te,le;if(!a||!o)return null;const Z=(le=(te=C[a])==null?void 0:te.session)==null?void 0:le.windows;for(const pe of Z??[]){const we=pe.panes.find(Me=>Me.id===o);if(we)return we.title??null}return null},[a,o,C]);v.useEffect(()=>{!S&&!f&&a&&o&&ln.getState().startDraft(a,o,R)},[S,f,a,o,R]);const k=v.useMemo(()=>{const Z=new Map;for(const te of h??[])Z.set(te.toolCallId,te.id);return Z},[h]),M=v.useMemo(()=>{const Z=CU(d,m),te=new Set;for(const pe of Z)pe.kind==="tool-call"&&te.add(pe.call.toolCallId);const le=[];for(const pe of h??[])te.has(pe.toolCallId)||le.push({kind:"tool-call",key:`confirmation-${pe.id}`,call:{toolCallId:pe.toolCallId,toolName:pe.toolName,input:pe.input,isError:!1,denied:!1,resolved:!1}});return le.length>0?[...Z,...le]:Z},[d,m,h]),D=S?LG(S,C,T==null?void 0:T.devices):null,O=!!(S&&o&&a&&(S.paneId!==o||S.deviceId!==a)),A=(S==null?void 0:S.status)==="running",L=TU(d),H=!!(S&&(!S.deviceId||!((Q=T==null?void 0:T.devices)!=null&&Q.some(Z=>Z.id===S.deviceId))||(D==null?void 0:D.state)==="invalid")),F=g??[],W=(Z,te)=>{c&&ln.getState().decideConfirmation(c,Z,te)},j=()=>{if(S!=null&&S.deviceId){if((D==null?void 0:D.state)==="valid"&&D.windowId&&S.paneId){t(`/devices/${S.deviceId}/windows/${D.windowId}/panes/${encodeURIComponent(S.paneId)}`);return}(D==null?void 0:D.state)==="unknown"&&t(`/devices/${S.deviceId}`)}},q=()=>{!a||!o||ln.getState().startDraft(a,o,R)},$=(Z,te)=>{S?ln.getState().setSessionModel(S.id,Z,te):f&&ln.getState().updateDraft({providerId:Z,modelId:te})},B=Z=>{const te=ln.getState();if(S){S.status==="running"?te.enqueueMessage(S.id,Z):te.sendMessage(S.id,Z);return}f&&(async()=>{const le=await te.materializeDraft();le&&await te.sendMessage(le.id,Z)})()},_=Z=>{S&&ln.getState().enqueueMessage(S.id,Z,!0)},z=()=>{if(!S)return;const Z=F[0];if(!Z)return;const te=ln.getState();(async()=>(await te.withdrawQueuedMessage(S.id,Z.id),await te.enqueueMessage(S.id,Z.text,!0)))()},U=S?S.providerId:(f==null?void 0:f.providerId)??null,K=S?S.modelId:(f==null?void 0:f.modelId)??null,P=!!(S||f),V=S?S.writeMode:w,G=!!(S&&((d==null?void 0:d.length)??0)>0),I=H||!P||(S==null?void 0:S.status)==="waiting_confirmation"||!!y;return E.jsxs("div",{"data-testid":"agent-tab",className:"flex h-full min-h-0 flex-col",children:[E.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-3 py-2",children:[S&&D?E.jsxs("button",{type:"button","data-testid":"agent-binding-chip","data-binding-state":D.state,className:je("border-border flex min-w-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs",D.state==="valid"?"hover:bg-muted cursor-pointer":"text-muted-foreground",D.state==="invalid"&&"opacity-60"),onClick:j,disabled:D.state==="invalid",children:[E.jsx(DB,{className:"size-3 shrink-0"}),E.jsx("span",{className:"min-w-0 truncate",children:D.label}),D.state==="invalid"&&E.jsxs("span",{className:"shrink-0",children:["· ",e("agent.binding.invalid")]})]}):E.jsx("div",{className:"min-w-0 flex-1"}),E.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[E.jsx(qt,{"data-testid":"agent-session-switch",size:"icon-sm",variant:"ghost",onClick:()=>n("panes"),"aria-label":e("agent.session.switch"),title:e("agent.session.switch"),children:E.jsx(JF,{})}),G&&E.jsx(qt,{"data-testid":"agent-session-new",size:"icon-sm",variant:"ghost",disabled:!a||!o,onClick:q,"aria-label":e("agent.session.new"),title:e(!a||!o?"agent.session.selectPaneHint":"agent.session.new"),children:E.jsx(Yp,{})})]})]}),H&&E.jsxs("div",{"data-testid":"agent-orphan-banner",className:"bg-muted/50 text-muted-foreground mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[E.jsx(Ju,{className:"mt-0.5 size-3.5 shrink-0"}),E.jsx("span",{className:"min-w-0 flex-1",children:e("agent.orphan.readonly")})]}),S&&!H&&O&&E.jsxs("div",{"data-testid":"agent-pane-mismatch",className:"bg-muted/50 mx-3 mb-1.5 flex shrink-0 flex-wrap items-center gap-2 rounded-lg px-2 py-1.5 text-xs",children:[E.jsx(Ju,{className:"text-muted-foreground size-3.5 shrink-0"}),E.jsx("span",{className:"text-muted-foreground min-w-0 flex-1",children:e("agent.binding.mismatchTitle")}),(D==null?void 0:D.state)==="valid"&&E.jsx(qt,{"data-testid":"agent-binding-goto",size:"xs",variant:"outline",onClick:j,children:e("agent.binding.goTo")}),o&&E.jsx(qt,{"data-testid":"agent-binding-rebind",size:"xs",variant:"outline",onClick:()=>{ln.getState().rebindPane(S.id,o)},children:e("agent.binding.rebind")})]}),(S==null?void 0:S.status)==="error"&&S.lastError&&E.jsxs("div",{"data-testid":"agent-error-banner",className:"bg-destructive/10 text-destructive mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[E.jsx(Ju,{className:"mt-0.5 size-3.5 shrink-0"}),E.jsx("span",{className:"min-w-0 flex-1 break-words",children:S.lastError}),L&&!H&&E.jsx(qt,{"data-testid":"agent-error-retry",size:"xs",variant:"outline",className:"shrink-0",disabled:!!y,onClick:()=>{ln.getState().sendMessage(S.id,L)},children:e("agent.panel.retry")})]}),E.jsx($$,{blocks:S?M:[],running:!!A,emptyText:e(P?"agent.panel.empty":"agent.session.selectPaneHint"),confirmationByToolCallId:k,onDecide:W,className:"bg-chat-surface mx-3 mb-2 overflow-hidden rounded-xl"},(S==null?void 0:S.id)??(f?"draft":"none")),S&&!H&&F.length>0&&E.jsx(IG,{queued:F,onEdit:(Z,te)=>void ln.getState().editQueuedMessage(S.id,Z,te),onWithdraw:Z=>void ln.getState().withdrawQueuedMessage(S.id,Z),onSteer:z}),E.jsx(PG,{disabled:I,running:!!A,steerable:!!S,onSend:B,onSteer:_,onStop:()=>{S&&ln.getState().stopSession(S.id)},modelPicker:P?E.jsx(DG,{providerId:U,modelId:K,onChange:$,disabled:A}):void 0,writeModeControl:E.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[E.jsx("span",{className:"text-muted-foreground text-xs",children:e(V==="auto"?"agent.writeMode.auto":"agent.writeMode.confirm")}),E.jsx(pp,{"data-testid":"agent-write-mode-switch",checked:V==="auto",disabled:!!S&&H,onCheckedChange:Z=>{const te=Z?"auto":"confirm";ln.getState().setDefaultWriteMode(te),S&&ln.getState().setWriteMode(S.id,te)}})]})})]})}function _G(){const{t:e}=Sn();return E.jsxs("div",{"data-testid":"files-tab",className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 px-4 text-center",children:[E.jsx($F,{className:"size-8 opacity-50"}),E.jsx("span",{className:"text-sm",children:e("agent.files.comingSoon")})]})}const _b=768;function zG(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${_b-1}px)`),r=()=>{t(window.innerWidth<_b)};return n.addEventListener("change",r),t(window.innerWidth<_b),()=>n.removeEventListener("change",r)},[]),!!e}const FG=v.forwardRef(function(t,n){const{render:r,className:a,id:o,name:l,value:c,disabled:f=!1,onValueChange:d,defaultValue:m,autoFocus:h=!1,...y}=t,{state:g,name:w,disabled:C,setTouched:T,setDirty:S,validityData:R,setFocused:k,setFilled:M,validationMode:D,validation:O}=Mc(),A=C||f,L=w??l,H={...g,disabled:A},{labelId:F}=Jp(),W=em({id:o});Ve(()=>{var U;const z=c!=null;(U=O.inputRef.current)!=null&&U.value||z&&c!==""?M(!0):z&&c===""&&M(!1)},[O.inputRef,M,c]);const j=v.useRef(null);Ve(()=>{h&&j.current===ti(Qt(j.current))&&k(!0)},[h,k]);const[q]=gc({controlled:c,default:m,name:"FieldControl",state:"value"}),$=c!==void 0,B=$?q:void 0;return Qx({id:W,name:L,commit:O.commit,value:B,getValue:()=>{var z;return(z=O.inputRef.current)==null?void 0:z.value},controlRef:O.inputRef}),Dt("input",t,{ref:[n,j],state:H,props:[{id:W,disabled:A,name:L,ref:O.inputRef,"aria-labelledby":F,autoFocus:h,...$?{value:B}:{defaultValue:m},onChange(z){const U=z.currentTarget.value;d==null||d(U,vt(zi,z.nativeEvent)),S(U!==R.initialValue),M(U!=="")},onFocus(){k(!0)},onBlur(z){T(!0),k(!1),D==="onBlur"&&O.commit(z.currentTarget.value)},onKeyDown(z){z.currentTarget.tagName==="INPUT"&&z.key==="Enter"&&(T(!0),O.commit(z.currentTarget.value))}},O.getInputValidationProps(),y],stateAttributesMapping:Gx})}),BG=v.forwardRef(function(t,n){return E.jsx(FG,{ref:n,...t})});function Ii({className:e,type:t,...n}){return E.jsx(BG,{type:t,"data-slot":"input",className:je("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-2 aria-invalid:ring-2 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e),...n})}function HG({className:e,orientation:t="horizontal",...n}){return E.jsx(SD,{"data-slot":"separator",orientation:t,className:je("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}const Yw=v.createContext(void 0);function Zo(e){const t=v.useContext(Yw);if(e===!1&&t===void 0)throw new Error(Cn(27));return t}const UG={...da,...Ya},Ww=v.forwardRef(function(t,n){const{render:r,className:a,forceRender:o=!1,...l}=t,{store:c}=Zo(),f=c.useState("open"),d=c.useState("nested"),m=c.useState("mounted"),h=c.useState("transitionStatus");return Dt("div",t,{state:{open:f,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:UG,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),wm=v.forwardRef(function(t,n){const{render:r,className:a,disabled:o=!1,nativeButton:l=!0,...c}=t,{store:f}=Zo(),d=f.useState("open");function m(w){d&&f.setOpen(!1,vt(bU,w.nativeEvent))}const{getButtonProps:h,buttonRef:y}=qa({disabled:o,native:l});return Dt("button",t,{state:{disabled:o},ref:[n,y],props:[{onClick:m},c,h]})}),Kw=v.forwardRef(function(t,n){const{render:r,className:a,id:o,...l}=t,{store:c}=Zo(),f=Hi(o);return c.useSyncedValueWithCleanup("descriptionElementId",f),Dt("p",t,{ref:n,props:[{id:f},l]})});let VG=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),qG=(function(e){return e[e.open=Rs.open]="open",e[e.closed=Rs.closed]="closed",e[e.startingStyle=Rs.startingStyle]="startingStyle",e[e.endingStyle=Rs.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const ED=v.createContext(void 0);function $G(){const e=v.useContext(ED);if(e===void 0)throw new Error(Cn(26));return e}const YG={...da,...Ya,nestedDialogOpen(e){return e?{[qG.nestedDialogOpen]:""}:null}},Gw=v.forwardRef(function(t,n){const{className:r,finalFocus:a,initialFocus:o,render:l,...c}=t,{store:f}=Zo(),d=f.useState("descriptionElementId"),m=f.useState("disablePointerDismissal"),h=f.useState("floatingRootContext"),y=f.useState("popupProps"),g=f.useState("modal"),w=f.useState("mounted"),C=f.useState("nested"),T=f.useState("nestedOpenDialogCount"),S=f.useState("open"),R=f.useState("openMethod"),k=f.useState("titleElementId"),M=f.useState("transitionStatus"),D=f.useState("role");$G(),Wa({open:S,ref:f.context.popupRef,onComplete(){var W,j;S&&((j=(W=f.context).onOpenChangeComplete)==null||j.call(W,!0))}});function O(W){return W==="touch"?f.context.popupRef.current:!0}const A=o===void 0?O:o,L=T>0,F=Dt("div",t,{state:{open:S,nested:C,transitionStatus:M,nestedDialogOpen:L},props:[y,{"aria-labelledby":k??void 0,"aria-describedby":d??void 0,role:D,tabIndex:-1,hidden:!w,onKeyDown(W){Vw.has(W.key)&&W.stopPropagation()},style:{[VG.nestedDialogs]:T}},c],ref:[n,f.context.popupRef,f.useStateSetter("popupElement")],stateAttributesMapping:YG});return E.jsx(Mw,{context:h,openInteractionType:R,disabled:!w,closeOnFocusOut:!m,initialFocus:A,returnFocus:a,modal:g!==!1,restoreFocus:"popup",children:F})}),Xw=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t,{store:o}=Zo(),l=o.useState("mounted"),c=o.useState("modal"),f=o.useState("open");return l||r?E.jsx(ED.Provider,{value:r,children:E.jsxs(Rw,{ref:n,...a,children:[l&&c===!0&&E.jsx(Uw,{ref:o.context.internalBackdropRef,inert:zw(!f)}),t.children]})}):null});function CD(e){const{store:t,parentContext:n,actionsRef:r}=e,a=t.useState("open"),o=t.useState("disablePointerDismissal"),l=t.useState("modal"),c=t.useState("popupElement"),{openMethod:f,triggerProps:d,reset:m}=_w(a);Nw(t);const{forceUnmount:h}=Dw(a,t,()=>{m()}),y=Ye(F=>{const W=vt(F);return W.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},W}),g=v.useCallback(()=>{t.setOpen(!1,y(Zx))},[t,y]);v.useImperativeHandle(r,()=>({unmount:h,close:g}),[h,g]);const w=Lw({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[C,T]=v.useState(0),S=C===0,R=ZN(w),k=bm(w,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(F){if(!t.context.outsidePressEnabledRef.current||"button"in F&&F.button!==0||"touches"in F&&F.touches.length!==1)return!1;const W=Rr(F);if(S&&!o){const j=W;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===j||t.context.backdropRef.current===j||Nt(j,c)&&!(j!=null&&j.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:S});Fw(a&&l===!0,c);const{getReferenceProps:M,getFloatingProps:D,getTriggerProps:O}=Wd([R,k]);t.useContextCallback("onNestedDialogOpen",F=>{T(F+1)}),t.useContextCallback("onNestedDialogClose",()=>{T(0)}),v.useEffect(()=>(n!=null&&n.onNestedDialogOpen&&a&&n.onNestedDialogOpen(C),n!=null&&n.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n!=null&&n.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[a,n,C]);const A=v.useMemo(()=>M(d),[M,d]),L=v.useMemo(()=>O(d),[O,d]),H=v.useMemo(()=>D(),[D]);t.useSyncedValues({openMethod:f,activeTriggerProps:A,inactiveTriggerProps:L,popupProps:H,floatingRootContext:w,nestedOpenDialogCount:C})}const WG={...Pw,modal:Ge(e=>e.modal),nested:Ge(e=>e.nested),nestedOpenDialogCount:Ge(e=>e.nestedOpenDialogCount),disablePointerDismissal:Ge(e=>e.disablePointerDismissal),openMethod:Ge(e=>e.openMethod),descriptionElementId:Ge(e=>e.descriptionElementId),titleElementId:Ge(e=>e.titleElementId),viewportElement:Ge(e=>e.viewportElement),role:Ge(e=>e.role)};class TD extends pm{constructor(n){super(KG(n),{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Yd,onOpenChange:void 0,onOpenChangeComplete:void 0},WG);st(this,"setOpen",(n,r)=>{var c,f,d,m;if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(f=(c=this.context).onOpenChange)==null||f.call(c,n,r),r.isCanceled)return;const a={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested};(d=this.state.floatingRootContext.context.events)==null||d.emit("openchange",a);const o={open:n},l=((m=r.trigger)==null?void 0:m.id)??null;(l||n)&&(o.activeTriggerId=l,o.activeTriggerElement=r.trigger??null),this.update(o)})}}function KG(e={}){return{...Iw(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function RD(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:f,handle:d,triggerId:m,defaultTriggerId:h=null}=e,y=Zo(!0),g=!!y,w=nr(()=>(d==null?void 0:d.store)??new TD({open:r,openProp:n,activeTriggerId:h,triggerIdProp:m,modal:c,disablePointerDismissal:l,nested:g})).current;hm(()=>{n===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:h})}),w.useControlledProp("openProp",n),w.useControlledProp("triggerIdProp",m),w.useSyncedValues({disablePointerDismissal:l,nested:g,modal:c}),w.useContextCallback("onOpenChange",a),w.useContextCallback("onOpenChangeComplete",o);const C=w.useState("payload");CD({store:w,actionsRef:f,parentContext:y==null?void 0:y.store.context});const T=v.useMemo(()=>({store:w}),[w]);return E.jsx(Yw.Provider,{value:T,children:typeof t=="function"?t({payload:C}):t})}const Qw=v.forwardRef(function(t,n){const{render:r,className:a,id:o,...l}=t,{store:c}=Zo(),f=Hi(o);return c.useSyncedValueWithCleanup("titleElementId",f),Dt("h2",t,{ref:n,props:[{id:f},l]})});function GG({...e}){return E.jsx(RD,{"data-slot":"sheet",...e})}function XG({...e}){return E.jsx(Xw,{"data-slot":"sheet-portal",...e})}function QG({className:e,...t}){return E.jsx(Ww,{"data-slot":"sheet-overlay",className:je("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",e),...t})}const ZG="data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10";function JG({className:e,children:t,side:n="right",showCloseButton:r=!0,animation:a="slide",...o}){return E.jsxs(XG,{children:[E.jsx(QG,{}),E.jsxs(Gw,{"data-slot":"sheet-content","data-side":n,className:je("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",a==="slide"&&ZG,a==="bottom-up"&&"data-open:slide-in-from-bottom-16 data-closed:slide-out-to-bottom-16",a==="top-down"&&"data-open:slide-in-from-top-16 data-closed:slide-out-to-top-16",e),...o,children:[t,r&&E.jsxs(wm,{"data-slot":"sheet-close",render:E.jsx(qt,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[E.jsx(Ua,{}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function eX({className:e,...t}){return E.jsx("div",{"data-slot":"sheet-header",className:je("gap-0.5 p-4 flex flex-col",e),...t})}function tX({className:e,...t}){return E.jsx(Qw,{"data-slot":"sheet-title",className:je("text-foreground text-base font-medium",e),...t})}function nX({className:e,...t}){return E.jsx(Kw,{"data-slot":"sheet-description",className:je("text-muted-foreground text-sm",e),...t})}const kD=v.createContext(void 0);function Xd(e){const t=v.useContext(kD);if(t===void 0&&!e)throw new Error(Cn(72));return t}const rX={...Pw,disabled:Ge(e=>e.disabled),instantType:Ge(e=>e.instantType),isInstantPhase:Ge(e=>e.isInstantPhase),trackCursorAxis:Ge(e=>e.trackCursorAxis),disableHoverablePopup:Ge(e=>e.disableHoverablePopup),lastOpenChangeReason:Ge(e=>e.openChangeReason),closeDelay:Ge(e=>e.closeDelay),hasViewport:Ge(e=>e.hasViewport)};class Zw extends pm{constructor(n){super({...iX(),...n},{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Yd},rX);st(this,"setOpen",(n,r)=>{var d,m;const a=r.reason,o=a===vr,l=n&&a===$l,c=!n&&(a===qs||a===nm);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(m=(d=this.context).onOpenChange)==null||m.call(d,n,r),r.isCanceled)return;const f=()=>{var g;const h={open:n,openChangeReason:a};l?h.instantType="focus":c?h.instantType="dismiss":a===vr&&(h.instantType=void 0);const y=((g=r.trigger)==null?void 0:g.id)??null;(y||n)&&(h.activeTriggerId=y,h.activeTriggerElement=r.trigger??null),this.update(h)};o?pr.flushSync(f):f()})}static useStore(n,r){const a=nr(()=>new Zw(r)).current,o=n??a,l=Lw({popupStore:o,onOpenChange:o.setOpen});return o.state.floatingRootContext=l,o}}function iX(){return{...Iw(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const aX=vw(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:a,disableHoverablePopup:o=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:f,onOpenChangeComplete:d,handle:m,triggerId:h,defaultTriggerId:y=null,children:g}=t,w=Zw.useStore(m==null?void 0:m.store,{open:r,openProp:a,activeTriggerId:y,triggerIdProp:h});hm(()=>{a===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:y})}),w.useControlledProp("openProp",a),w.useControlledProp("triggerIdProp",h),w.useContextCallback("onOpenChange",f),w.useContextCallback("onOpenChangeComplete",d);const C=w.useState("open"),T=!n&&C,S=w.useState("activeTriggerId"),R=w.useState("payload");w.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:o}),Ve(()=>{C&&n&&w.setOpen(!1,vt(vU))},[C,n,w]),w.useSyncedValue("disabled",n),Nw(w);const{forceUnmount:k,transitionStatus:M}=Dw(T,w),D=w.useState("isInstantPhase"),O=w.useState("instantType"),A=w.useState("lastOpenChangeReason"),L=v.useRef(null);Ve(()=>{M==="ending"&&A===zi||M!=="ending"&&D?(O!=="delay"&&(L.current=O),w.set("instantType","delay")):L.current!==null&&(w.set("instantType",L.current),L.current=null)},[M,D,A,O,w]),Ve(()=>{T&&S==null&&w.set("payload",void 0)},[w,S,T]);const H=v.useCallback(()=>{w.setOpen(!1,oX(w,Zx))},[w]);v.useImperativeHandle(c,()=>({unmount:k,close:H}),[k,H]);const F=w.useState("floatingRootContext"),W=bm(F,{enabled:!n,referencePress:!0}),j=pW(F,{enabled:!n&&l!=="none",axis:l==="none"?void 0:l}),{getReferenceProps:q,getFloatingProps:$,getTriggerProps:B}=Wd([W,j]),_=v.useMemo(()=>q(),[q]),z=v.useMemo(()=>B(),[B]),U=v.useMemo(()=>$(),[$]);return w.useSyncedValues({activeTriggerProps:_,inactiveTriggerProps:z,popupProps:U}),E.jsx(kD.Provider,{value:w,children:typeof g=="function"?g({payload:R}):g})});function oX(e,t){const n=vt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const sX=v.createContext(void 0);function lX(){return v.useContext(sX)}let cX=(function(e){return e[e.popupOpen=Op.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const uX=600,dX=eN(function(t,n){const{className:r,render:a,handle:o,payload:l,disabled:c,delay:f,closeDelay:d,id:m,...h}=t,y=Xd(!0),g=(o==null?void 0:o.store)??y;if(!g)throw new Error(Cn(82));const w=Hi(m),C=g.useState("isTriggerActive",w),T=g.useState("isOpenedByTrigger",w),S=g.useState("floatingRootContext"),R=v.useRef(null),k=f??uX,M=d??0,{registerTrigger:D,isMountedByThisTrigger:O}=$N(w,R,g,{payload:l,closeDelay:M}),A=lX(),{delayRef:L,isInstantPhase:H,hasProvider:F}=iW(S,{open:T});g.useSyncedValue("isInstantPhase",H);const W=g.useState("disabled"),j=c??W,q=g.useState("trackCursorAxis"),$=g.useState("disableHoverablePopup"),B=XN(S,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!$&&q!=="both"?eD():null,restMs(){const P=A==null?void 0:A.delay,V=typeof L.current=="object"?L.current.open:void 0;let G=k;return F&&(V!==0?G=f??P??k:G=0),G},delay(){const P=typeof L.current=="object"?L.current.close:void 0;let V=M;return d==null&&F&&(V=P),{close:V}},triggerElementRef:R,isActiveTrigger:C}),_=WN(S,{enabled:!j}).reference,z={open:T},U=g.useState("triggerProps",O);return Dt("button",t,{state:z,ref:[n,D,R],props:[B,_,U,{id:w,[cX.triggerDisabled]:j?"":void 0},h],stateAttributesMapping:oD})}),MD=v.createContext(void 0);function fX(){const e=v.useContext(MD);if(e===void 0)throw new Error(Cn(70));return e}const hX=v.forwardRef(function(t,n){const{children:r,container:a,className:o,render:l,...c}=t,{portalNode:f,portalSubtree:d}=LN({container:a,ref:n,componentProps:t,elementProps:c});return!d&&!f?null:E.jsxs(v.Fragment,{children:[d,f&&pr.createPortal(r,f)]})}),pX=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t;return Xd().useState("mounted")||r?E.jsx(MD.Provider,{value:r,children:E.jsx(hX,{ref:n,...a})}):null}),OD=v.createContext(void 0);function AD(){const e=v.useContext(OD);if(e===void 0)throw new Error(Cn(71));return e}const mX=v.forwardRef(function(t,n){const{render:r,className:a,anchor:o,positionMethod:l="absolute",side:c="top",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y=5,arrowPadding:g=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:T=wO,...S}=t,R=Xd(),k=fX(),M=R.useState("open"),D=R.useState("mounted"),O=R.useState("trackCursorAxis"),A=R.useState("disableHoverablePopup"),L=R.useState("floatingRootContext"),H=R.useState("instantType"),F=R.useState("transitionStatus"),W=R.useState("hasViewport"),j=Bw({anchor:o,positionMethod:l,floatingRootContext:L,mounted:D,side:c,sideOffset:d,align:f,alignOffset:m,collisionBoundary:h,collisionPadding:y,sticky:w,arrowPadding:g,disableAnchorTracking:C,keepMounted:k,collisionAvoidance:T,adaptiveOrigin:W?JK:void 0}),q=v.useMemo(()=>{const z={};return(!M||O==="both"||A)&&(z.pointerEvents="none"),{role:"presentation",hidden:!D,style:{...j.positionerStyles,...z}}},[M,O,A,D,j.positionerStyles]),$=v.useMemo(()=>({open:M,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:O!=="none"?"tracking-cursor":H}),[M,j.side,j.align,j.anchorHidden,O,H]),B=v.useMemo(()=>({...$,arrowRef:j.arrowRef,arrowStyles:j.arrowStyles,arrowUncentered:j.arrowUncentered}),[$,j.arrowRef,j.arrowStyles,j.arrowUncentered]),_=Dt("div",t,{state:$,props:[q,Pc(F),S],ref:[n,R.useStateSetter("positionerElement")],stateAttributesMapping:da});return E.jsx(OD.Provider,{value:B,children:_})}),gX={...da,...Ya},yX=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,l=Xd(),{side:c,align:f}=AD(),d=l.useState("open"),m=l.useState("instantType"),h=l.useState("transitionStatus"),y=l.useState("popupProps"),g=l.useState("floatingRootContext");Wa({open:d,ref:l.context.popupRef,onComplete(){var R,k;d&&((k=(R=l.context).onOpenChangeComplete)==null||k.call(R,!0))}});const w=l.useState("disabled"),C=l.useState("closeDelay");return GN(g,{enabled:!w,closeDelay:C}),Dt("div",t,{state:{open:d,side:c,align:f,instant:m,transitionStatus:h},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[y,Pc(h),o],stateAttributesMapping:gX})}),bX=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,c=Xd().useState("instantType"),{open:f,arrowRef:d,side:m,align:h,arrowUncentered:y,arrowStyles:g}=AD();return Dt("div",t,{state:{open:f,side:m,align:h,uncentered:y,instant:c},ref:[n,d],props:[{style:g,"aria-hidden":!0},o],stateAttributesMapping:da})});function vX({...e}){return E.jsx(aX,{"data-slot":"tooltip",...e})}function xX({...e}){return E.jsx(dX,{"data-slot":"tooltip-trigger",...e})}function wX({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:a=0,children:o,...l}){return E.jsx(pX,{children:E.jsx(mX,{align:r,alignOffset:a,side:t,sideOffset:n,className:"isolate z-50",children:E.jsxs(yX,{"data-slot":"tooltip-content",className:je("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin)",e),...l,children:[o,E.jsx(bX,{className:"size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const SX="sidebar_state",EX=3600*24*7,zb="100vw",CX="3rem",TX="b",Uu=320,Np=320,RX=450,Fb="tmex_sidebar_width";function kX(){const e=typeof window>"u"?Number.POSITIVE_INFINITY:window.innerWidth;return Math.max(Np,e-RX)}function Fh(e){return Math.min(kX(),Math.max(Np,Math.round(e)))}const ND=v.createContext(null);function Ti(){const e=v.useContext(ND);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function MX({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...l}){const c=zG(),[f,d]=v.useState(!1),m=v.useRef(Uu),[h,y]=v.useState(()=>{if(typeof window>"u")return Uu;const L=Number(window.localStorage.getItem(Fb)),H=Number.isFinite(L)&&L>0?Math.max(Np,Math.round(L)):Uu;return m.current=H,Fh(H)}),[g,w]=v.useState(!1),C=v.useCallback(L=>{const H=Math.max(Np,Math.round(L));m.current=H,y(Fh(L)),window.localStorage.setItem(Fb,String(H))},[]),T=v.useCallback(()=>{m.current=Uu,y(Fh(Uu)),window.localStorage.removeItem(Fb)},[]);v.useEffect(()=>{const L=()=>{y(Fh(m.current))};return window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[]);const[S,R]=v.useState(e),k=t??S,M=v.useCallback(L=>{const H=typeof L=="function"?L(k):L;n?n(H):R(H),document.cookie=`${SX}=${H}; path=/; max-age=${EX}`},[n,k]),D=v.useCallback(()=>c?d(L=>!L):M(L=>!L),[c,M,d]);v.useEffect(()=>{const L=H=>{H.defaultPrevented||H.target instanceof HTMLElement&&H.target.closest(".xterm")||H.key===TX&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),D())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[D]);const O=k?"expanded":"collapsed",A=v.useMemo(()=>({state:O,open:k,setOpen:M,isMobile:c,openMobile:f,setOpenMobile:d,toggleSidebar:D,width:h,setWidth:C,resetWidth:T,isResizing:g,setIsResizing:w}),[O,k,M,c,f,d,D,h,C,T,g]);return E.jsx(ND.Provider,{value:A,children:E.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":`${h}px`,"--sidebar-width-icon":CX,...a},className:je("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...l,children:o})})}function OX({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:a,dir:o,...l}){const{isMobile:c,state:f,openMobile:d,setOpenMobile:m,isResizing:h}=Ti();return n==="none"?E.jsx("div",{"data-slot":"sidebar",className:je("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:a}):c?E.jsx(GG,{open:d,onOpenChange:m,...l,children:E.jsxs(JG,{dir:o,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true","data-testid":"mobile-sidebar-sheet",className:"bg-sidebar text-sidebar-foreground p-0 [&>button]:hidden border-none",style:{"--sidebar-width":zb,width:zb,maxWidth:zb},side:e,animation:"top-down",children:[E.jsxs(eX,{className:"sr-only",children:[E.jsx(tX,{children:"Sidebar"}),E.jsx(nX,{children:"Displays the mobile sidebar."})]}),E.jsx("div",{className:"flex h-full w-full flex-col","data-testid":"sidebar",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:a})]})}):E.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":f,"data-collapsible":f==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[E.jsx("div",{"data-slot":"sidebar-gap",className:je(!h&&"transition-[width] duration-200 ease-linear","relative w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),E.jsxs("div",{"data-slot":"sidebar-container","data-side":e,className:je(!h&&"transition-[left,right,width] duration-200 ease-linear","fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...l,children:[E.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner","data-testid":"sidebar",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:a}),f==="expanded"&&E.jsx(AX,{side:e})]})]})}function AX({side:e}){const{width:t,setWidth:n,resetWidth:r,setIsResizing:a}=Ti(),o=v.useRef(null);return E.jsx("div",{"data-slot":"sidebar-resizer","data-testid":"sidebar-resizer","aria-hidden":"true",className:je("absolute inset-y-0 z-30 w-2 cursor-col-resize touch-none select-none","after:absolute after:inset-y-0 after:w-[2px] after:bg-transparent hover:after:bg-sidebar-border active:after:bg-sidebar-border",e==="left"?"-right-1 after:right-[3px]":"-left-1 after:left-[3px]"),onPointerDown:l=>{l.preventDefault(),o.current={pointerId:l.pointerId,startX:l.clientX,startWidth:t},l.currentTarget.setPointerCapture(l.pointerId),a(!0)},onPointerMove:l=>{const c=o.current;if(!c||c.pointerId!==l.pointerId)return;const f=l.clientX-c.startX;n(c.startWidth+(e==="left"?f:-f))},onPointerUp:l=>{var c;((c=o.current)==null?void 0:c.pointerId)===l.pointerId&&(o.current=null,a(!1))},onPointerCancel:l=>{var c;((c=o.current)==null?void 0:c.pointerId)===l.pointerId&&(o.current=null,a(!1))},onDoubleClick:r})}function NX({className:e,onClick:t,...n}){const{toggleSidebar:r,isMobile:a}=Ti();return E.jsxs(qt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:je(e),onClick:o=>{t==null||t(o),r()},...n,children:[a?E.jsx(nB,{}):E.jsx(sB,{}),E.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function DX({className:e,...t}){return E.jsx("main",{"data-slot":"sidebar-inset",className:je("bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col",e),...t})}function IX({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:je("gap-2 p-2 flex flex-col",e),...t})}function PX({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:je("gap-2 p-2 flex flex-col",e),...t})}function LX({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:je("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function DD({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:je("p-2 relative flex w-full min-w-0 flex-col",e),...t})}function jX({className:e,...t}){return E.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:je("gap-0 flex w-full min-w-0 flex-col",e),...t})}function _X({className:e,...t}){return E.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:je("group/menu-item relative",e),...t})}const zX=Qp("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden group/menu-button disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function FX({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:o,...l}){const{isMobile:c,state:f}=Ti(),d=fm({defaultTagName:"button",props:Ei({className:je(zX({variant:n,size:r}),o)},l),render:a?xX:e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return a?(typeof a=="string"&&(a={children:a}),E.jsxs(vX,{children:[d,E.jsx(wX,{side:"right",align:"center",hidden:f!=="collapsed"||c,...a})]})):d}function BX({className:e,render:t,showOnHover:n=!1,...r}){return fm({defaultTagName:"button",props:Ei({className:je("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0",n&&"peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",e)},r),render:t,state:{slot:"sidebar-menu-action",sidebar:"menu-action"}})}function HX({className:e,...t}){return E.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:je("border-sidebar-border mx-3.5 translate-x-px gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col",e),...t})}function UX({className:e,...t}){return E.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:je("group/menu-sub-item relative",e),...t})}function VX({render:e,size:t="md",isActive:n=!1,className:r,...a}){return fm({defaultTagName:"a",props:Ei({className:je("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0",r)},a),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:n}})}const ID=v.createContext(void 0);function PD(){const e=v.useContext(ID);if(e===void 0)throw new Error(Cn(64));return e}let qX=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const LD={tabActivationDirection:e=>({[qX.activationDirection]:e})},$X=v.forwardRef(function(t,n){const{className:r,defaultValue:a=0,onValueChange:o,orientation:l="horizontal",render:c,value:f,...d}=t,m=Ic(),h=Object.hasOwn(t,"defaultValue"),y=v.useRef([]),[g,w]=v.useState(()=>new Map),[C,T]=gc({controlled:f,default:a,name:"Tabs",state:"value"}),S=f!==void 0,[R,k]=v.useState(()=>new Map),[M,D]=v.useState("none"),O=Ye((z,U)=>{o==null||o(z,U),!U.isCanceled&&(T(z),D(U.activationDirection))}),A=Ye((z,U)=>{w(K=>{if(K.get(z)===U)return K;const P=new Map(K);return P.set(z,U),P})}),L=Ye((z,U)=>{w(K=>{if(!K.has(z)||K.get(z)!==U)return K;const P=new Map(K);return P.delete(z),P})}),H=v.useCallback(z=>g.get(z),[g]),F=v.useCallback(z=>{for(const U of R.values())if(z===(U==null?void 0:U.value))return U==null?void 0:U.id},[R]),W=v.useCallback(z=>{if(z===void 0)return null;for(const[U,K]of R.entries())if(K!=null&&z===(K.value??K.index))return U;return null},[R]),j=v.useMemo(()=>({direction:m,getTabElementBySelectedValue:W,getTabIdByPanelValue:F,getTabPanelIdByValue:H,onValueChange:O,orientation:l,registerMountedTabPanel:A,setTabMap:k,unregisterMountedTabPanel:L,tabActivationDirection:M,value:C}),[m,W,F,H,O,l,A,k,L,M,C]),q=v.useMemo(()=>{for(const z of R.values())if(z!=null&&z.value===C)return z},[R,C]),$=v.useMemo(()=>{for(const z of R.values())if(z!=null&&!z.disabled)return z.value},[R]);Ve(()=>{if(S||R.size===0)return;const z=q==null?void 0:q.disabled,U=q==null&&C!==null;if(h&&z&&C===a||!z&&!U)return;const P=$??null;C!==P&&(T(P),D("none"))},[a,$,h,S,q,D,T,R,C]);const _=Dt("div",t,{state:{orientation:l,tabActivationDirection:M},ref:n,props:d,stateAttributesMapping:LD});return E.jsx(ID.Provider,{value:j,children:E.jsx(xm,{elementsRef:y,children:_})})}),jD="data-composite-item-active";function _D(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Yx(),{ref:a,index:o}=qw(e),l=n===o,c=v.useRef(null),f=_i(a,c);return{compositeProps:v.useMemo(()=>({tabIndex:l?0:-1,onFocus(){r(o)},onMouseMove(){const m=c.current;if(!t||!m)return;const h=m.hasAttribute("disabled")||m.ariaDisabled==="true";!l&&!h&&m.focus()}}),[l,r,o,t]),compositeRef:f,index:o}}const zD=v.createContext(void 0);function YX(){const e=v.useContext(zD);if(e===void 0)throw new Error(Cn(65));return e}const WX=v.forwardRef(function(t,n){const{className:r,disabled:a=!1,render:o,value:l,id:c,nativeButton:f=!0,...d}=t,{value:m,getTabPanelIdByValue:h,orientation:y}=PD(),{activateOnFocus:g,highlightedTabIndex:w,onTabActivation:C,setHighlightedTabIndex:T,tabsListElement:S}=YX(),R=Hi(c),k=v.useMemo(()=>({disabled:a,id:R,value:l}),[a,R,l]),{compositeProps:M,compositeRef:D,index:O}=_D({metadata:k}),A=l===m,L=v.useRef(!1);Ve(()=>{if(L.current){L.current=!1;return}if(!(A&&O>-1&&w!==O))return;const K=S;if(K!=null){const P=ti(Qt(K));if(P&&Nt(K,P))return}a||T(O)},[A,O,w,T,a,S]);const{getButtonProps:H,buttonRef:F}=qa({disabled:a,native:f,focusableWhenDisabled:!0}),W=h(l),j=v.useRef(!1),q=v.useRef(!1);function $(K){A||a||C(l,vt(zi,K.nativeEvent,void 0,{activationDirection:"none"}))}function B(K){A||(O>-1&&!a&&T(O),!a&&g&&(!j.current||j.current&&q.current)&&C(l,vt(zi,K.nativeEvent,void 0,{activationDirection:"none"})))}function _(K){if(A||a)return;j.current=!0;function P(){j.current=!1,q.current=!1}(!K.button||K.button===0)&&(q.current=!0,Qt(K.currentTarget).addEventListener("pointerup",P,{once:!0}))}return Dt("button",t,{state:{disabled:a,active:A,orientation:y},ref:[n,F,D],props:[M,{role:"tab","aria-controls":W,"aria-selected":A,id:R,onClick:$,onFocus:B,onPointerDown:_,[jD]:A?"":void 0,onKeyDownCapture(){L.current=!0}},d,H]})});function KX(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const GX=[];function XX(e){const{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:a=!1,orientation:o="both",direction:l,highlightedIndex:c,onHighlightedIndexChange:f,rootRef:d,enableHomeAndEndKeys:m=!1,stopEventPropagation:h=!1,disabledIndices:y,modifierKeys:g=GX}=e,[w,C]=v.useState(0),T=n>1,S=v.useRef(null),R=_i(S,d),k=v.useRef([]),M=v.useRef(!1),D=c??w,O=Ye((H,F=!1)=>{if((f??C)(H),F){const W=k.current[H];mk(S.current,W,l,o)}}),A=Ye(H=>{if(H.size===0||M.current)return;M.current=!0;const F=Array.from(H.keys()),W=F.find(q=>q==null?void 0:q.hasAttribute(jD))??null,j=W?F.indexOf(W):-1;j!==-1&&O(j),mk(S.current,W,l,o)}),L=v.useMemo(()=>({"aria-orientation":o==="both"?void 0:o,ref:R,onFocus(H){!S.current||!pk(H.target)||H.target.setSelectionRange(0,H.target.value.length??0)},onKeyDown(H){const F=m?aG:gD;if(!F.has(H.key)||QX(H,g)||!S.current)return;const j=l==="rtl",q=j?Cd:Zl,$={horizontal:q,vertical:ks,both:q}[o],B=j?Zl:Cd,_={horizontal:B,vertical:Ql,both:B}[o];if(pk(H.target)&&!KX(H.target)){const I=H.target.selectionStart,Q=H.target.selectionEnd,Z=H.target.value??"";if(I==null||H.shiftKey||I!==Q||H.key!==_&&I<Z.length||H.key!==$&&I>0)return}let z=D;const U=Jh(k,y),K=Wv(k,y);if(T){const I=t||Array.from({length:k.current.length},()=>({width:1,height:1})),Q=mN(I,n,a),Z=Q.findIndex(le=>le!=null&&!Uo(k,le,y)),te=Q.reduce((le,pe,we)=>pe!=null&&!Uo(k,pe,y)?we:le,-1);z=Q[pN({current:Q.map(le=>le?k.current[le]:null)},{event:H,orientation:o,loopFocus:r,cols:n,disabledIndices:yN([...y||k.current.map((le,pe)=>Uo(k,pe)?pe:void 0),void 0],Q),minIndex:Z,maxIndex:te,prevIndex:gN(D>K?U:D,I,Q,n,H.key===ks?"bl":H.key===Zl?"tr":"tl"),rtl:j})]}const P={horizontal:[q],vertical:[ks],both:[q,ks]}[o],V={horizontal:[B],vertical:[Ql],both:[B,Ql]}[o],G=T?F:{horizontal:m?rG:pD,vertical:m?iG:mD,both:F}[o];m&&(H.key===Kd?z=U:H.key===Gd&&(z=K)),z===D&&(P.includes(H.key)||V.includes(H.key))&&(r&&z===K&&P.includes(H.key)?z=U:r&&z===U&&V.includes(H.key)?z=K:z=hr(k,{startingIndex:z,decrement:V.includes(H.key),disabledIndices:y})),z!==D&&!Wl(k,z)&&(h&&H.stopPropagation(),G.has(H.key)&&H.preventDefault(),O(z,!0),queueMicrotask(()=>{var I;(I=k.current[z])==null||I.focus()}))}}),[n,a,l,y,k,m,D,T,t,r,R,g,O,o,h]);return v.useMemo(()=>({props:L,highlightedIndex:D,onHighlightedIndexChange:O,elementsRef:k,disabledIndices:y,onMapChange:A,relayKeyboardEvent:L.onKeyDown}),[L,D,O,k,y,A])}function QX(e,t){for(const n of uG.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function ZX(e){const{render:t,className:n,refs:r=qo,props:a=qo,state:o=Dn,stateAttributesMapping:l,highlightedIndex:c,onHighlightedIndexChange:f,orientation:d,dense:m,itemSizes:h,loopFocus:y,cols:g,enableHomeAndEndKeys:w,onMapChange:C,stopEventPropagation:T=!0,rootRef:S,disabledIndices:R,modifierKeys:k,highlightItemOnHover:M=!1,tag:D="div",...O}=e,A=Ic(),{props:L,highlightedIndex:H,onHighlightedIndexChange:F,elementsRef:W,onMapChange:j,relayKeyboardEvent:q}=XX({itemSizes:h,cols:g,loopFocus:y,dense:m,orientation:d,highlightedIndex:c,onHighlightedIndexChange:f,rootRef:S,stopEventPropagation:T,enableHomeAndEndKeys:w,direction:A,disabledIndices:R,modifierKeys:k}),$=Dt(D,e,{state:o,ref:r,props:[L,...a,O],stateAttributesMapping:l}),B=v.useMemo(()=>({highlightedIndex:H,onHighlightedIndexChange:F,highlightItemOnHover:M,relayKeyboardEvent:q}),[H,F,M,q]);return E.jsx(yO.Provider,{value:B,children:E.jsx(xm,{elementsRef:W,onMapChange:_=>{C==null||C(_),j(_)},children:$})})}const JX=v.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:a,loopFocus:o=!0,render:l,...c}=t,{getTabElementBySelectedValue:f,onValueChange:d,orientation:m,value:h,setTabMap:y,tabActivationDirection:g}=PD(),[w,C]=v.useState(0),[T,S]=v.useState(null),R=eQ(h,m,T,f),k=Ye((A,L)=>{if(A!==h){const H=R(A);L.activationDirection=H,d(A,L)}}),M={orientation:m,tabActivationDirection:g},D={"aria-orientation":m==="vertical"?"vertical":void 0,role:"tablist"},O=v.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:w,onTabActivation:k,setHighlightedTabIndex:C,tabsListElement:T,value:h}),[r,w,k,C,T,h]);return E.jsx(zD.Provider,{value:O,children:E.jsx(ZX,{render:l,className:a,state:M,refs:[n,S],props:[D,c],stateAttributesMapping:LD,highlightedIndex:w,enableHomeAndEndKeys:!0,loopFocus:o,orientation:m,onHighlightedIndexChange:C,onMapChange:y,disabledIndices:qo})})});function wk(e,t){const{left:n,top:r}=e.getBoundingClientRect(),{left:a,top:o}=t.getBoundingClientRect(),l=n-a,c=r-o;return{left:l,top:c}}function eQ(e,t,n,r){const[a,o]=v.useState(null);return Ve(()=>{if(e==null||n==null){o(null);return}const l=r(e);if(l==null){o(null);return}const{left:c,top:f}=wk(l,n);o(t==="horizontal"?c:f)},[t,r,n,e]),v.useCallback(l=>{if(l===e)return"none";if(l==null)return o(null),"none";if(l!=null&&n!=null){const c=r(l);if(c!=null){const{left:f,top:d}=wk(c,n);if(a==null)return o(t==="horizontal"?f:d),"none";if(t==="horizontal"){if(f<a)return o(f),"left";if(f>a)return o(f),"right"}else{if(d<a)return o(d),"up";if(d>a)return o(d),"down"}}}return"none"},[r,t,a,n,e])}function tQ({className:e,orientation:t="horizontal",...n}){return E.jsx($X,{"data-slot":"tabs","data-orientation":t,className:je("gap-2 group/tabs flex data-horizontal:flex-col",e),...n})}const nQ=Qp("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function rQ({className:e,variant:t="default",...n}){return E.jsx(JX,{"data-slot":"tabs-list","data-variant":t,className:je(nQ({variant:t}),e),...n})}function Bb({className:e,...t}){return E.jsx(WX,{"data-slot":"tabs-trigger",className:je("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function Dp({children:e,onClick:t,...n}){const{isMobile:r,setOpenMobile:a}=Ti(),o=l=>{r&&a(!1),t==null||t(l)};return E.jsx(zx,{...n,onClick:o,children:e})}function iQ({items:e}){const{t}=Sn();return E.jsx(DD,{children:E.jsx(jX,{children:e.map(n=>{var r,a;return E.jsxs(cm,{defaultOpen:n.isActive,render:E.jsx(_X,{}),children:[E.jsx(Dp,{to:n.url,children:E.jsxs(FX,{tooltip:t(n.title),children:[E.jsx(n.icon,{}),E.jsx("span",{children:t(n.title)})]})}),(r=n.items)!=null&&r.length?E.jsxs(E.Fragment,{children:[E.jsxs(um,{render:E.jsx(BX,{className:"data-[state=open]:rotate-90"}),children:[E.jsx(qp,{}),E.jsx("span",{className:"sr-only",children:"Toggle"})]}),E.jsx(dm,{children:E.jsx(HX,{children:(a=n.items)==null?void 0:a.map(o=>E.jsx(UX,{children:E.jsx(Dp,{to:o.url,children:E.jsx(VX,{children:E.jsx("span",{children:t(o.title)})})})},o.title))})})]}):null]},n.title)})})})}const aQ={auth_failed:"authFailed",agent_unavailable:"agentUnavailable",agent_no_identity:"agentNoIdentity",ssh_config_ref_not_supported:"configRefNotSupported",network_unreachable:"networkUnreachable",connection_refused:"connectionRefused",timeout:"timeout",host_not_found:"hostNotFound",handshake_failed:"handshakeFailed",tmux_unavailable:"tmuxUnavailable",connection_closed:"connectionClosed"};function oQ({deviceId:e,className:t}){const{t:n}=Sn(),r=qn(o=>o.deviceReconnecting[e]),a=qn(o=>o.deviceErrors[e]);if(r)return E.jsxs(Ks,{variant:"outline",title:r.message,className:je("h-5 gap-1 border-amber-400/40 bg-amber-500/10 px-1.5 text-[10px] font-normal text-amber-700 dark:text-amber-300",t),children:[E.jsx(vB,{className:"h-3 w-3 animate-spin"}),E.jsx("span",{className:"truncate max-w-[120px]",children:r.message})]});if(a){const o=aQ[a.type]??"unknown",l=n(`deviceStatus.errorBadge.${o}`),c=[l,a.message,a.rawMessage].filter(Boolean).join(`
395
- `);return E.jsxs(Ks,{variant:"outline",title:c,className:je("h-5 gap-1 border-red-400/40 bg-red-500/10 px-1.5 text-[10px] font-normal text-red-700 dark:text-red-300",t),children:[E.jsx(Ju,{className:"h-3 w-3"}),E.jsx("span",{className:"truncate max-w-[120px]",children:l})]})}return null}function sQ(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:a,onOpenChangeComplete:o,actionsRef:l,handle:c,triggerId:f,defaultTriggerId:d=null}=e,m=Zo(),h=!!m,y=nr(()=>(c==null?void 0:c.store)??new TD({open:r,openProp:n,activeTriggerId:d,triggerIdProp:f,modal:!0,disablePointerDismissal:!0,nested:h,role:"alertdialog"})).current;y.useControlledProp("openProp",n),y.useControlledProp("triggerIdProp",f),y.useSyncedValue("nested",h),y.useContextCallback("onOpenChange",a),y.useContextCallback("onOpenChangeComplete",o);const g=y.useState("payload");CD({store:y,actionsRef:l,parentContext:m==null?void 0:m.store.context});const w=v.useMemo(()=>({store:y}),[y]);return E.jsx(Yw.Provider,{value:w,children:typeof t=="function"?t({payload:g}):t})}function ex({...e}){return E.jsx(sQ,{"data-slot":"alert-dialog",...e})}function lQ({...e}){return E.jsx(Xw,{"data-slot":"alert-dialog-portal",...e})}function cQ({className:e,...t}){return E.jsx(Ww,{"data-slot":"alert-dialog-overlay",className:je("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function tx({className:e,size:t="default",...n}){return E.jsxs(lQ,{children:[E.jsx(cQ,{}),E.jsx(Gw,{"data-slot":"alert-dialog-content","data-size":t,className:je("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...n})]})}function nx({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-header",className:je("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function rx({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-footer",className:je("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function Sk({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-media",className:je("bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",e),...t})}function ix({className:e,...t}){return E.jsx(Qw,{"data-slot":"alert-dialog-title",className:je("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function ax({className:e,...t}){return E.jsx(Kw,{"data-slot":"alert-dialog-description",className:je("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function ox({className:e,...t}){return E.jsx(qt,{"data-slot":"alert-dialog-action",className:je(e),...t})}function sx({className:e,variant:t="outline",size:n="default",...r}){return E.jsx(wm,{"data-slot":"alert-dialog-cancel",className:je(e),render:E.jsx(qt,{variant:t,size:n}),...r})}function lx({...e}){return E.jsx(RD,{"data-slot":"dialog",...e})}function uQ({...e}){return E.jsx(Xw,{"data-slot":"dialog-portal",...e})}function dQ({className:e,...t}){return E.jsx(Ww,{"data-slot":"dialog-overlay",className:je("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function cx({className:e,children:t,showCloseButton:n=!0,...r}){return E.jsxs(uQ,{children:[E.jsx(dQ,{}),E.jsxs(Gw,{"data-slot":"dialog-content",className:je("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...r,children:[t,n&&E.jsxs(wm,{"data-slot":"dialog-close",render:E.jsx(qt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[E.jsx(Ua,{}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ux({className:e,...t}){return E.jsx("div",{"data-slot":"dialog-header",className:je("gap-2 flex flex-col",e),...t})}function Ek({className:e,showCloseButton:t=!1,children:n,...r}){return E.jsxs("div",{"data-slot":"dialog-footer",className:je("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&E.jsx(wm,{render:E.jsx(qt,{variant:"outline"}),children:"Close"})]})}function dx({className:e,...t}){return E.jsx(Qw,{"data-slot":"dialog-title",className:je("text-base leading-none font-medium",e),...t})}function FD({className:e,...t}){return E.jsx(Kw,{"data-slot":"dialog-description",className:je("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}const BD=v.createContext(void 0);function HD(e){const t=v.useContext(BD);if(t===void 0&&!e)throw new Error(Cn(33));return t}const UD=v.createContext(void 0);function Jo(e){const t=v.useContext(UD);if(t===void 0&&!e)throw new Error(Cn(36));return t}const fQ=v.createContext(void 0);function Qd(e=!0){const t=v.useContext(fQ);if(t===void 0&&!e)throw new Error(Cn(25));return t}const hQ={...da,...Ya},pQ=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,{store:l}=Jo(),c=l.useState("open"),f=l.useState("mounted"),d=l.useState("transitionStatus"),m=l.useState("lastOpenChangeReason"),h=Qd(),y={open:c,transitionStatus:d};return Dt("div",t,{ref:h!=null&&h.backdropRef?[n,h.backdropRef]:n,state:y,stateAttributesMapping:hQ,props:[{role:"presentation",hidden:!f,style:{pointerEvents:m===vr?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},o]})});function mQ(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:a,store:o,itemRef:l,itemMetadata:c}=e,{events:f}=o.useState("floatingTreeRoot"),d=Qd(!0),m=d!==void 0;return v.useMemo(()=>({id:r,role:"menuitem",tabIndex:n?0:-1,onMouseMove(h){a&&f.emit("itemhover",{nodeId:a,target:h.currentTarget})},onClick(h){t&&f.emit("close",{domEvent:h,reason:td})},onMouseUp(h){if(d){const y=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,m&&y&&Math.abs(h.clientX-y.x)<=1&&Math.abs(h.clientY-y.y)<=1)return}l.current&&o.context.allowMouseUpTriggerRef.current&&(!m||h.button===2)&&(!c||c.type==="regular-item")&&l.current.click()}}),[t,n,r,f,a,o,l,d,m,c])}const gQ={type:"regular-item"};function yQ(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:a,store:o,nativeButton:l,itemMetadata:c,nodeId:f}=e,d=v.useRef(null),{getButtonProps:m,buttonRef:h}=qa({disabled:n,focusableWhenDisabled:!0,native:l}),y=mQ({closeOnClick:t,highlighted:r,id:a,nodeId:f,store:o,itemRef:d,itemMetadata:c}),g=v.useCallback(C=>Ei(y,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()},onKeyUp(T){T.key===" "&&o.context.typingRef.current&&T.preventBaseUIHandler()}},C,m),[y,m,o,c]),w=_i(d,h);return v.useMemo(()=>({getItemProps:g,itemRef:w}),[g,w])}const bQ=v.forwardRef(function(t,n){const{render:r,className:a,id:o,label:l,nativeButton:c=!1,disabled:f=!1,closeOnClick:d=!0,...m}=t,h=qw({label:l}),y=HD(!0),g=Hi(o),{store:w}=Jo(),C=w.useState("isActive",h.index),T=w.useState("itemProps"),{getItemProps:S,itemRef:R}=yQ({closeOnClick:d,disabled:f,highlighted:C,id:g,store:w,nativeButton:c,nodeId:y==null?void 0:y.nodeId,itemMetadata:gQ});return Dt("div",t,{state:{disabled:f,highlighted:C},props:[T,m,S],ref:[R,n,h.ref]})}),vQ={...da,...Ya},xQ=v.forwardRef(function(t,n){const{render:r,className:a,finalFocus:o,...l}=t,{store:c}=Jo(),{side:f,align:d}=HD(),m=hD()!=null,h=c.useState("open"),y=c.useState("transitionStatus"),g=c.useState("popupProps"),w=c.useState("mounted"),C=c.useState("instantType"),T=c.useState("activeTriggerElement"),S=c.useState("parent"),R=c.useState("lastOpenChangeReason"),k=c.useState("rootId"),M=c.useState("floatingRootContext"),D=c.useState("floatingTreeRoot"),O=c.useState("closeDelay"),A=c.useState("activeTriggerElement"),L=S.type==="context-menu";Wa({open:h,ref:c.context.popupRef,onComplete(){var $,B;h&&((B=($=c.context).onOpenChangeComplete)==null||B.call($,!0))}}),v.useEffect(()=>{function $(B){c.setOpen(!1,vt(B.reason,B.domEvent))}return D.events.on("close",$),()=>{D.events.off("close",$)}},[D.events,c]);const H=c.useState("hoverEnabled"),F=c.useState("disabled");GN(M,{enabled:H&&!F&&!L&&S.type!=="menubar",closeDelay:O});const W={transitionStatus:y,side:f,align:d,open:h,nested:S.type==="menu",instant:C},j=Dt("div",t,{state:W,ref:[n,c.context.popupRef],stateAttributesMapping:vQ,props:[g,{onKeyDown($){m&&Vw.has($.key)&&$.stopPropagation()}},Pc(y),l,{"data-rootownerid":k}]});let q=S.type===void 0||L;return(T||S.type==="menubar"&&R!==tm)&&(q=!0),E.jsx(Mw,{context:M,modal:L,disabled:!w,returnFocus:o===void 0?q:o,initialFocus:S.type!=="menu",restoreFocus:!0,externalTree:S.type!=="menubar"?D:void 0,previousFocusableElement:A,nextFocusableElement:S.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:S.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:j})}),VD=v.createContext(void 0);function wQ(){const e=v.useContext(VD);if(e===void 0)throw new Error(Cn(32));return e}const SQ=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t,{store:o}=Jo();return o.useState("mounted")||r?E.jsx(VD.Provider,{value:r,children:E.jsx(Rw,{ref:n,...a})}):null}),EQ=v.forwardRef(function(t,n){var Pe;const{anchor:r,positionMethod:a="absolute",className:o,render:l,side:c,align:f,sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y=5,arrowPadding:g=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:T=xO,...S}=t,{store:R}=Jo(),k=wQ(),M=Qd(!0),D=R.useState("parent"),O=R.useState("floatingRootContext"),A=R.useState("floatingTreeRoot"),L=R.useState("mounted"),H=R.useState("open"),F=R.useState("modal"),W=R.useState("activeTriggerElement"),j=R.useState("transitionStatus"),q=R.useState("lastOpenChangeReason"),$=R.useState("floatingNodeId"),B=R.useState("floatingParentNodeId");let _=r,z=d,U=m,K=f,P=T;D.type==="context-menu"&&(_=r??((Pe=D.context)==null?void 0:Pe.anchor),K=K??"start",!c&&K!=="center"&&(U=t.alignOffset??2,z=t.sideOffset??-5));let V=c,G=K;D.type==="menu"?(V=V??"inline-end",G=G??"start",P=t.collisionAvoidance??wO):D.type==="menubar"&&(V=V??"bottom",G=G??"start");const I=D.type==="context-menu",Q=Bw({anchor:_,floatingRootContext:O,positionMethod:M?"fixed":a,mounted:L,side:V,sideOffset:z,align:G,alignOffset:U,arrowPadding:I?0:g,collisionBoundary:h,collisionPadding:y,sticky:w,nodeId:$,keepMounted:k,disableAnchorTracking:C,collisionAvoidance:P,shiftCrossAxis:I&&!("side"in P&&P.side==="flip"),externalTree:A}),Z=v.useMemo(()=>{const ne={};return H||(ne.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...Q.positionerStyles,...ne}}},[H,L,Q.positionerStyles]);v.useEffect(()=>{function ne(fe){fe.open&&(fe.parentNodeId===$&&R.set("hoverEnabled",!1),fe.nodeId!==$&&fe.parentNodeId===R.select("floatingParentNodeId")&&R.setOpen(!1,vt(Qh)))}return A.events.on("menuopenchange",ne),()=>{A.events.off("menuopenchange",ne)}},[R,A.events,$]),v.useEffect(()=>{if(R.select("floatingParentNodeId")==null)return;function ne(fe){if(fe.open||fe.nodeId!==R.select("floatingParentNodeId"))return;const ye=fe.reason??Qh;R.setOpen(!1,vt(ye))}return A.events.on("menuopenchange",ne),()=>{A.events.off("menuopenchange",ne)}},[A.events,R]),v.useEffect(()=>{function ne(fe){!H||fe.nodeId!==R.select("floatingParentNodeId")||fe.target&&W&&W!==fe.target&&R.setOpen(!1,vt(Qh))}return A.events.on("itemhover",ne),()=>{A.events.off("itemhover",ne)}},[A.events,H,W,R]),v.useEffect(()=>{const ne={open:H,nodeId:$,parentNodeId:B,reason:R.select("lastOpenChangeReason")};A.events.emit("menuopenchange",ne)},[A.events,H,R,$,B]);const te={open:H,side:Q.side,align:Q.align,anchorHidden:Q.anchorHidden,nested:D.type==="menu"},le=v.useMemo(()=>({side:Q.side,align:Q.align,arrowRef:Q.arrowRef,arrowUncentered:Q.arrowUncentered,arrowStyles:Q.arrowStyles,nodeId:Q.context.nodeId}),[Q.side,Q.align,Q.arrowRef,Q.arrowUncentered,Q.arrowStyles,Q.context.nodeId]),pe=Dt("div",t,{state:te,stateAttributesMapping:da,ref:[n,R.useStateSetter("positionerElement")],props:[Z,Pc(j),S]}),we=L&&D.type!=="menu"&&(D.type!=="menubar"&&F&&q!==vr||D.type==="menubar"&&D.context.modal);let Me=null;return D.type==="menubar"?Me=D.context.contentElement:D.type===void 0&&(Me=W),E.jsxs(BD.Provider,{value:le,children:[we&&E.jsx(Uw,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:zw(!H),cutout:Me}),E.jsx(tW,{id:$,children:E.jsx(xm,{elementsRef:R.context.itemDomElements,labelsRef:R.context.itemLabels,children:pe})})]})}),CQ=v.createContext(null);function qD(e){return v.useContext(CQ)}const TQ={...Pw,disabled:Ge(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Ge(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:Ge(e=>e.allowMouseEnter),stickIfOpen:Ge(e=>e.stickIfOpen),parent:Ge(e=>e.parent),rootId:Ge(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Ge(e=>e.activeIndex),isActive:Ge((e,t)=>e.activeIndex===t),hoverEnabled:Ge(e=>e.hoverEnabled),instantType:Ge(e=>e.instantType),lastOpenChangeReason:Ge(e=>e.openChangeReason),floatingTreeRoot:Ge(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Ge(e=>e.floatingNodeId),floatingParentNodeId:Ge(e=>e.floatingParentNodeId),itemProps:Ge(e=>e.itemProps),closeDelay:Ge(e=>e.closeDelay),keyboardEventRelay:Ge(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class Jw extends pm{constructor(n){super({...RQ(),...n},{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:new Yd},TQ);st(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",r=>{var a;if((a=this.unsubscribeParentListener)==null||a.call(this),r.type==="menu"){this.unsubscribeParentListener=r.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:r})}static useStore(n,r){const a=nr(()=>new Jw(r)).current;return n??a}}function RQ(){return{...Iw(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Tw,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Dn,keyboardEventRelay:void 0,closeDelay:0}}const kQ=v.createContext(void 0);function MQ(){return v.useContext(kQ)}const OQ=vw(function(t){const{children:n,open:r,onOpenChange:a,onOpenChangeComplete:o,defaultOpen:l=!1,disabled:c=!1,modal:f,loopFocus:d=!0,orientation:m="vertical",actionsRef:h,closeParentOnEsc:y=!1,handle:g,triggerId:w,defaultTriggerId:C=null,highlightItemOnHover:T=!0}=t,S=Qd(!0),R=Jo(!0),k=qD(!0),M=MQ(),D=v.useMemo(()=>M&&R?{type:"menu",store:R.store}:k?{type:"menubar",context:k}:S&&!R?{type:"context-menu",context:S}:{type:void 0},[S,R,k,M]),O=Jw.useStore(g==null?void 0:g.store,{open:l,openProp:r,activeTriggerId:C,triggerIdProp:w,parent:D});hm(()=>{r===void 0&&O.state.open===!1&&l===!0&&O.update({open:!0,activeTriggerId:C})}),O.useControlledProp("openProp",r),O.useControlledProp("triggerIdProp",w),O.useContextCallback("onOpenChangeComplete",o);const A=O.useState("floatingTreeRoot"),L=NN(A),H=Ka();Ve(()=>{S&&!R?O.update({parent:{type:"context-menu",context:S},floatingNodeId:L,floatingParentNodeId:H}):R&&O.update({floatingNodeId:L,floatingParentNodeId:H})},[S,R,L,H,O]);const F=O.useState("open"),W=O.useState("activeTriggerElement"),j=O.useState("positionerElement"),q=O.useState("hoverEnabled"),$=O.useState("modal"),B=O.useState("disabled"),_=O.useState("lastOpenChangeReason"),z=O.useState("parent"),U=O.useState("activeIndex"),K=O.useState("payload"),P=O.useState("floatingParentNodeId"),V=v.useRef(null),G=P!=null;let I;O.useSyncedValues({disabled:c,modal:z.type===void 0?f:void 0,rootId:Js()});const{openMethod:Q,triggerProps:Z,reset:te}=_w(F);Nw(O);const{forceUnmount:le}=Dw(F,O,()=>{O.update({allowMouseEnter:!1,stickIfOpen:!0}),te()}),pe=v.useRef(z.type!=="context-menu"),we=Fn();v.useEffect(()=>{if(F||(V.current=null),z.type==="context-menu"){if(!F){we.clear(),pe.current=!1;return}we.start(500,()=>{pe.current=!0})}},[we,F,z.type]),Fw(F&&$&&_!==vr&&Q!=="touch",j),Ve(()=>{!F&&!q&&O.set("hoverEnabled",!0)},[F,q,O]);const Me=v.useRef(!0),Pe=Fn(),ne=Ye((ze,Ze)=>{var yt;const tt=Ze.reason;if(F===ze&&Ze.trigger===W&&_===tt||(Ze.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},!ze&&Ze.trigger==null&&(Ze.trigger=W??void 0),a==null||a(ze,Ze),Ze.isCanceled))return;const Ct={open:ze,nativeEvent:Ze.event,reason:Ze.reason,nested:G};I==null||I.emit("openchange",Ct);const zt=Ze.event;if(ze===!1&&(zt==null?void 0:zt.type)==="click"&&zt.pointerType==="touch"&&!Me.current)return;if(!ze&&U!==null){const Ke=O.context.itemDomElements.current[U];queueMicrotask(()=>{Ke==null||Ke.setAttribute("tabindex","-1")})}ze&&tt===$l?(Me.current=!1,Pe.start(300,()=>{Me.current=!0})):(Me.current=!0,Pe.clear());const gt=(tt===qs||tt===td)&&zt.detail===0&&(zt==null?void 0:zt.isTrusted),Ot=!ze&&(tt===nm||tt==null),it={open:ze,openChangeReason:tt};V.current=Ze.event??null;const ft=((yt=Ze.trigger)==null?void 0:yt.id)??null;(ft||ze)&&(it.activeTriggerId=ft,it.activeTriggerElement=Ze.trigger??null),O.update(it),z.type==="menubar"&&(tt===$l||tt===$s||tt===vr||tt===Xh||tt===Qh)?O.set("instantType","group"):gt||Ot?O.set("instantType",gt?"click":"dismiss"):O.set("instantType",void 0)}),fe=v.useCallback(ze=>{const Ze=vt(ze);return Ze.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},Ze},[O]),ye=v.useCallback(()=>{O.setOpen(!1,fe(Zx))},[O,fe]);v.useImperativeHandle(h,()=>({unmount:le,close:ye}),[le,ye]);let Le;z.type==="context-menu"&&(Le=z.context),v.useImperativeHandle(Le==null?void 0:Le.positionerRef,()=>j,[j]),v.useImperativeHandle(Le==null?void 0:Le.actionsRef,()=>({setOpen:ne}),[ne]);const Oe=Lw({popupStore:O,onOpenChange:ne});I=Oe.context.events,v.useEffect(()=>{const ze=({open:Ze,eventDetails:tt})=>ne(Ze,tt);return I.on("setOpen",ze),()=>{I==null||I.off("setOpen",ze)}},[I,ne]);const Ee=bm(Oe,{enabled:!B,bubbles:{escapeKey:y&&z.type==="menu"},outsidePress(){var ze;return z.type!=="context-menu"||((ze=V.current)==null?void 0:ze.type)==="contextmenu"?!0:pe.current},externalTree:G?A:void 0}),Te=ZN(Oe,{role:"menu"}),J=Ic(),Se=v.useCallback(ze=>{O.select("activeIndex")!==ze&&O.set("activeIndex",ze)},[O]),ve=QN(Oe,{enabled:!B,listRef:O.context.itemDomElements,activeIndex:U,nested:z.type!==void 0,loopFocus:d,orientation:m,parentOrientation:z.type==="menubar"?z.context.orientation:void 0,rtl:J==="rtl",disabledIndices:qo,onNavigate:Se,openOnArrowKeyDown:z.type!=="context-menu",externalTree:G?A:void 0,focusItemOnHover:T}),Be=v.useCallback(ze=>{O.context.typingRef.current=ze},[O]),qe=JN(Oe,{listRef:O.context.itemLabels,activeIndex:U,resetMs:fH,onMatch:ze=>{F&&ze!==U&&O.set("activeIndex",ze)},onTypingChange:Be}),{getReferenceProps:De,getFloatingProps:ut,getItemProps:he,getTriggerProps:Ce}=Wd([Ee,Te,ve,qe]),ee=v.useMemo(()=>{const ze=Ei(De(),{onMouseMove(){O.set("allowMouseEnter",!0)}},Z);return delete ze.role,ze},[De,O,Z]),de=v.useMemo(()=>{const ze=Ce();if(!ze)return ze;const Ze=Ei(ze,Z);return delete Ze.role,delete Ze["aria-controls"],Ze},[Ce,Z]),Ae=v.useMemo(()=>ut({onMouseMove(){O.set("allowMouseEnter",!0),z.type==="menu"&&O.set("hoverEnabled",!1)},onClick(){O.select("hoverEnabled")&&O.set("hoverEnabled",!1)},onKeyDown(ze){const Ze=O.select("keyboardEventRelay");Ze&&!ze.isPropagationStopped()&&Ze(ze)}}),[ut,z.type,O]),He=v.useMemo(()=>he(),[he]);O.useSyncedValues({floatingRootContext:Oe,activeTriggerProps:ee,inactiveTriggerProps:de,popupProps:Ae,itemProps:He});const $e=v.useMemo(()=>({store:O,parent:D}),[O,D]),et=E.jsx(UD.Provider,{value:$e,children:typeof n=="function"?n({payload:K}):n});return z.type===void 0||z.type==="context-menu"?E.jsx(nW,{externalTree:A,children:et}):et});function AQ(e){const{render:t,className:n,state:r=Dn,props:a=qo,refs:o=qo,metadata:l,stateAttributesMapping:c,tag:f="div",...d}=e,{compositeProps:m,compositeRef:h}=_D({metadata:l});return Dt(f,e,{state:r,ref:[...o,h],props:[m,...a,d],stateAttributesMapping:c})}function $D(e){if(kn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!ea(e))return $D(ia(e))}function NQ(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,a=v.useRef(!1);return v.useMemo(()=>t?{onMouseDown:o=>{(n==="open"&&!r||n==="close"&&r)&&(a.current=!0,Qt(o.currentTarget).addEventListener("click",()=>{a.current=!1},{once:!0}))},onClick:o=>{a.current&&(a.current=!1,o.preventBaseUIHandler())}}:Dn,[t,n,r])}const Bh=2,DQ=eN(function(t,n){const{render:r,className:a,disabled:o=!1,nativeButton:l=!0,id:c,openOnHover:f,delay:d=100,closeDelay:m=0,handle:h,payload:y,...g}=t,w=Jo(!0),C=(h==null?void 0:h.store)??(w==null?void 0:w.store);if(!C)throw new Error(Cn(85));const T=Hi(c),S=C.useState("isTriggerActive",T),R=C.useState("floatingRootContext"),k=C.useState("isOpenedByTrigger",T),M=v.useRef(null),D=PQ(),O=Yx(!0),A=Qo(),L=v.useMemo(()=>A??new Tw,[A]),H=NN(L),F=Ka(),{registerTrigger:W,isMountedByThisTrigger:j}=$N(T,M,C,{payload:y,closeDelay:m,parent:D,floatingTreeRoot:L,floatingNodeId:H,floatingParentNodeId:F,keyboardEventRelay:O==null?void 0:O.relayKeyboardEvent}),q=D.type==="menubar",$=C.useState("disabled"),B=o||$||q&&D.context.disabled,{getButtonProps:_,buttonRef:z}=qa({disabled:B,native:l});v.useEffect(()=>{!k&&D.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,k,D.type]);const U=v.useRef(null),K=Fn(),P=Ye(Ee=>{if(!U.current)return;K.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Te=Ee.target;if(Nt(U.current,Te)||Nt(C.select("positionerElement"),Te)||Te===U.current||Te!=null&&$D(Te)===C.select("rootId"))return;const J=sD(U.current);Ee.clientX>=J.left-Bh&&Ee.clientX<=J.right+Bh&&Ee.clientY>=J.top-Bh&&Ee.clientY<=J.bottom+Bh||L.events.emit("close",{domEvent:Ee,reason:BO})});v.useEffect(()=>{k&&C.select("lastOpenChangeReason")===vr&&Qt(U.current).addEventListener("mouseup",P,{once:!0})},[k,P,C]);const V=q&&D.context.hasSubmenuOpen,I=XN(R,{enabled:(f??V)&&!B&&D.type!=="context-menu"&&(!q||V&&!j),handleClose:eD({blockPointerEvents:!q}),mouseOnly:!0,move:!1,restMs:D.type===void 0?d:void 0,delay:{close:m},triggerElementRef:M,externalTree:L,isActiveTrigger:S}),Q=IQ(k,C.select("lastOpenChangeReason")),Z=jN(R,{enabled:!B&&D.type!=="context-menu",event:k&&q?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?Q:!1}),te=WN(R,{enabled:!B&&V}),le=NQ({open:k,enabled:q,mouseDownAction:"open"}),pe=Wd([Z,te]),we={disabled:B,open:k},Me=C.useState("triggerProps",j),Pe=[U,n,z,W,M],ne=[pe.getReferenceProps(),I??Dn,Me,{"aria-haspopup":"menu",id:T,onMouseDown:Ee=>{if(C.select("open"))return;K.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),Qt(Ee.currentTarget).addEventListener("mouseup",P,{once:!0})}},q?{role:"menuitem"}:{},le,g,_],fe=v.useRef(null),ye=Ye(Ee=>{pr.flushSync(()=>{C.setOpen(!1,vt($s,Ee.nativeEvent,Ee.currentTarget))});const Te=JY(fe.current);Te==null||Te.focus()}),Le=Ye(Ee=>{var J;const Te=C.select("positionerElement");if(Te&&Kl(Ee,Te))(J=C.context.beforeContentFocusGuardRef.current)==null||J.focus();else{pr.flushSync(()=>{C.setOpen(!1,vt($s,Ee.nativeEvent,Ee.currentTarget))});let Se=ZY(C.context.triggerFocusTargetRef.current||M.current);for(;Se!==null&&Nt(Te,Se);){const ve=Se;if(Se=Cw(Se),Se===ve)break}Se==null||Se.focus()}}),Oe=Dt("button",t,{enabled:!q,stateAttributesMapping:Zv,state:we,ref:Pe,props:ne});return q?E.jsx(AQ,{tag:"button",render:r,className:a,state:we,refs:Pe,props:ne,stateAttributesMapping:Zv}):k?E.jsxs(v.Fragment,{children:[E.jsx(Sc,{ref:fe,onFocus:ye},`${T}-pre-focus-guard`),E.jsx(v.Fragment,{children:Oe},T),E.jsx(Sc,{ref:C.context.triggerFocusTargetRef,onFocus:Le},`${T}-post-focus-guard`)]}):E.jsx(v.Fragment,{children:Oe},T)});function IQ(e,t){const n=Fn(),[r,a]=v.useState(!1);return Ve(()=>{e&&t==="trigger-hover"?(a(!0),n.start(hH,()=>{a(!1)})):e||(n.clear(),a(!1))},[e,t,n]),r}function PQ(){const e=Qd(!0),t=Jo(!0),n=qD();return v.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function e0({...e}){return E.jsx(OQ,{"data-slot":"dropdown-menu",...e})}function t0({...e}){return E.jsx(DQ,{"data-slot":"dropdown-menu-trigger",...e})}function n0({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,backdrop:a=!1,className:o,...l}){return E.jsxs(SQ,{children:[a&&E.jsx(pQ,{className:"fixed inset-0 z-50"}),E.jsx(EQ,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:E.jsx(xQ,{"data-slot":"dropdown-menu-content",className:je("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",o),...l})})]})}function Jl({className:e,inset:t,variant:n="default",...r}){return E.jsx(bQ,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:je("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r})}function xee({className:e,...t}){return E.jsx(SD,{"data-slot":"dropdown-menu-separator",className:je("bg-border -mx-1 my-1 h-px",e),...t})}const YD=v.createContext(void 0);function Sm(){const e=v.useContext(YD);if(e===void 0)throw new Error(Cn(53));return e}let Ip=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Hh=500,Ck=16;function wi(e,t,n){if(!e)return 0;const r=getComputedStyle(e),a=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${a}Start`])+parseFloat(r[`${t}${a}End`])}let LQ=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({}),zl=(function(e){return e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const r0={hasOverflowX:e=>e?{[zl.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[zl.hasOverflowY]:""}:null,overflowXStart:e=>e?{[zl.overflowXStart]:""}:null,overflowXEnd:e=>e?{[zl.overflowXEnd]:""}:null,overflowYStart:e=>e?{[zl.overflowYStart]:""}:null,overflowYEnd:e=>e?{[zl.overflowYEnd]:""}:null,cornerHidden:()=>null},jQ={x:0,y:0},Tk={width:0,height:0},_Q={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},zQ={x:!1,y:!1,corner:!1},FQ=v.forwardRef(function(t,n){const{render:r,className:a,overflowEdgeThreshold:o,...l}=t,c=BQ(o),f=Hi(),d=Fn(),m=Fn(),{nonce:h,disableStyleElements:y}=yD(),[g,w]=v.useState(!1),[C,T]=v.useState(!1),[S,R]=v.useState(!1),[k,M]=v.useState(!1),[D,O]=v.useState(Tk),[A,L]=v.useState(Tk),[H,F]=v.useState(_Q),[W,j]=v.useState(zQ),q=v.useRef(null),$=v.useRef(null),B=v.useRef(null),_=v.useRef(null),z=v.useRef(null),U=v.useRef(null),K=v.useRef(null),P=v.useRef(!1),V=v.useRef(0),G=v.useRef(0),I=v.useRef(0),Q=v.useRef(0),Z=v.useRef("vertical"),te=v.useRef(jQ),le=Ye(Ee=>{const Te=Ee.x-te.current.x,J=Ee.y-te.current.y;te.current=Ee,J!==0&&(R(!0),d.start(Hh,()=>{R(!1)})),Te!==0&&(T(!0),m.start(Hh,()=>{T(!1)}))}),pe=Ye(Ee=>{Ee.button===0&&(P.current=!0,V.current=Ee.clientY,G.current=Ee.clientX,Z.current=Ee.currentTarget.getAttribute(LQ.orientation),$.current&&(I.current=$.current.scrollTop,Q.current=$.current.scrollLeft),z.current&&Z.current==="vertical"&&z.current.setPointerCapture(Ee.pointerId),U.current&&Z.current==="horizontal"&&U.current.setPointerCapture(Ee.pointerId))}),we=Ye(Ee=>{if(!P.current)return;const Te=Ee.clientY-V.current,J=Ee.clientX-G.current;if($.current){const Se=$.current.scrollHeight,ve=$.current.clientHeight,Be=$.current.scrollWidth,qe=$.current.clientWidth;if(z.current&&B.current&&Z.current==="vertical"){const De=wi(B.current,"padding","y"),ut=wi(z.current,"margin","y"),he=z.current.offsetHeight,Ce=B.current.offsetHeight-he-De-ut,ee=Te/Ce;$.current.scrollTop=I.current+ee*(Se-ve),Ee.preventDefault(),R(!0),d.start(Hh,()=>{R(!1)})}if(U.current&&_.current&&Z.current==="horizontal"){const De=wi(_.current,"padding","x"),ut=wi(U.current,"margin","x"),he=U.current.offsetWidth,Ce=_.current.offsetWidth-he-De-ut,ee=J/Ce;$.current.scrollLeft=Q.current+ee*(Be-qe),Ee.preventDefault(),T(!0),m.start(Hh,()=>{T(!1)})}}}),Me=Ye(Ee=>{P.current=!1,z.current&&Z.current==="vertical"&&z.current.releasePointerCapture(Ee.pointerId),U.current&&Z.current==="horizontal"&&U.current.releasePointerCapture(Ee.pointerId)});function Pe(Ee){M(Ee.pointerType==="touch")}function ne(Ee){if(Pe(Ee),Ee.pointerType!=="touch"){const Te=Nt(q.current,Ee.target);w(Te)}}const fe=v.useMemo(()=>({scrolling:C||S,hasOverflowX:!W.x,hasOverflowY:!W.y,overflowXStart:H.xStart,overflowXEnd:H.xEnd,overflowYStart:H.yStart,overflowYEnd:H.yEnd,cornerHidden:W.corner}),[C,S,W.x,W.y,W.corner,H]),ye={role:"presentation",onPointerEnter:ne,onPointerMove:ne,onPointerDown:Pe,onPointerLeave(){w(!1)},style:{position:"relative",[Ip.scrollAreaCornerHeight]:`${D.height}px`,[Ip.scrollAreaCornerWidth]:`${D.width}px`}},Le=Dt("div",t,{state:fe,ref:[n,q],props:[ye,l],stateAttributesMapping:r0}),Oe=v.useMemo(()=>({handlePointerDown:pe,handlePointerMove:we,handlePointerUp:Me,handleScroll:le,cornerSize:D,setCornerSize:O,thumbSize:A,setThumbSize:L,touchModality:k,cornerRef:K,scrollingX:C,setScrollingX:T,scrollingY:S,setScrollingY:R,hovering:g,setHovering:w,viewportRef:$,rootRef:q,scrollbarYRef:B,scrollbarXRef:_,thumbYRef:z,thumbXRef:U,rootId:f,hiddenState:W,setHiddenState:j,overflowEdges:H,setOverflowEdges:F,viewportState:fe,overflowEdgeThreshold:c}),[pe,we,Me,le,D,A,k,C,T,S,R,g,w,f,W,H,fe,c]);return E.jsxs(YD.Provider,{value:Oe,children:[!y&&Ed.getElement(h),Le]})});function BQ(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,(e==null?void 0:e.xStart)||0),xEnd:Math.max(0,(e==null?void 0:e.xEnd)||0),yStart:Math.max(0,(e==null?void 0:e.yStart)||0),yEnd:Math.max(0,(e==null?void 0:e.yEnd)||0)}}const HQ=v.createContext(void 0);function UQ(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(r=>{r.forEach(a=>{a.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let _o=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({});const Rk=1;function kk(e,t){if(t<=0)return 0;const n=Ba(e,0,t),r=n,a=t-n,o=r<=Rk,l=a<=Rk;return o&&l?r<=a?0:t:o?0:l?t:n}let Mk=!1;function VQ(){Mk||mm||(typeof CSS<"u"&&"registerProperty"in CSS&&[_o.scrollAreaOverflowXStart,_o.scrollAreaOverflowXEnd,_o.scrollAreaOverflowYStart,_o.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),Mk=!0)}const qQ=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{viewportRef:l,scrollbarYRef:c,scrollbarXRef:f,thumbYRef:d,thumbXRef:m,cornerRef:h,cornerSize:y,setCornerSize:g,setThumbSize:w,rootId:C,setHiddenState:T,hiddenState:S,handleScroll:R,setHovering:k,setOverflowEdges:M,overflowEdges:D,overflowEdgeThreshold:O,scrollingX:A,scrollingY:L}=Sm(),H=Ic(),F=v.useRef(!0),W=Fn(),j=Fn(),q=Ye(()=>{const K=l.current,P=c.current,V=f.current,G=d.current,I=m.current,Q=h.current;if(!K)return;const Z=K.scrollHeight,te=K.scrollWidth,le=K.clientHeight,pe=K.clientWidth,we=K.scrollTop,Me=K.scrollLeft;if(Z===0||te===0)return;const Pe=le>=Z,ne=pe>=te,fe=pe/te,ye=le/Z,Le=Math.max(0,te-pe),Oe=Math.max(0,Z-le);let Ee=0,Te=0;if(!ne){let it=0;H==="rtl"?it=Ba(-Me,0,Le):it=Ba(Me,0,Le),Ee=kk(it,Le),Te=Le-Ee}const J=Pe?0:Ba(we,0,Oe),Se=Pe?0:kk(J,Oe),ve=Pe?0:Oe-Se,Be=ne?0:pe,qe=Pe?0:le;let De=0,ut=0;!ne&&!Pe&&(De=(P==null?void 0:P.offsetWidth)||0,ut=(V==null?void 0:V.offsetHeight)||0);const he=y.width===0&&y.height===0,Ce=he?De:0,ee=he?ut:0,de=wi(V,"padding","x"),Ae=wi(P,"padding","y"),He=wi(I,"margin","x"),$e=wi(G,"margin","y"),et=Be-de-He,ze=qe-Ae-$e,Ze=V?Math.min(V.offsetWidth-Ce,et):et,tt=P?Math.min(P.offsetHeight-ee,ze):ze,Ct=Math.max(Ck,Ze*fe),zt=Math.max(Ck,tt*ye);if(w(it=>it.height===zt&&it.width===Ct?it:{width:Ct,height:zt}),P&&G){const it=P.offsetHeight-zt-Ae-$e,ft=Z-le,yt=ft===0?0:we/ft,Ke=Math.min(it,Math.max(0,yt*it));G.style.transform=`translate3d(0,${Ke}px,0)`}if(V&&I){const it=V.offsetWidth-Ct-de-He,ft=te-pe,yt=ft===0?0:Me/ft,Ke=H==="rtl"?Ba(yt*it,-it,0):Ba(yt*it,0,it);I.style.transform=`translate3d(${Ke}px,0,0)`}const gt=[[_o.scrollAreaOverflowXStart,Ee],[_o.scrollAreaOverflowXEnd,Te],[_o.scrollAreaOverflowYStart,Se],[_o.scrollAreaOverflowYEnd,ve]];for(const[it,ft]of gt)K.style.setProperty(it,`${ft}px`);Q&&(ne||Pe?g({width:0,height:0}):!ne&&!Pe&&g({width:De,height:ut})),T(it=>{const ft=Pe||ne;return it.y===Pe&&it.x===ne&&it.corner===ft?it:{y:Pe,x:ne,corner:ft}});const Ot={xStart:!ne&&Ee>O.xStart,xEnd:!ne&&Te>O.xEnd,yStart:!Pe&&Se>O.yStart,yEnd:!Pe&&ve>O.yEnd};M(it=>it.xStart===Ot.xStart&&it.xEnd===Ot.xEnd&&it.yStart===Ot.yStart&&it.yEnd===Ot.yEnd?it:Ot)});Ve(()=>{if(!l.current)return;VQ();let K=!1;return UQ(l.current,()=>{if(!K){K=!0;return}q()})},[q,l]),Ve(()=>{queueMicrotask(q)},[q,S,H]),Ve(()=>{var K;(K=l.current)!=null&&K.matches(":hover")&&k(!0)},[l,k]),v.useEffect(()=>{const K=l.current;if(typeof ResizeObserver>"u"||!K)return;let P=!1;const V=new ResizeObserver(()=>{if(!P){P=!0;return}q()});return V.observe(K),j.start(0,()=>{const G=K.getAnimations({subtree:!0});G.length!==0&&Promise.allSettled(G.map(I=>I.finished)).then(q).catch(()=>{})}),()=>{V.disconnect(),j.clear()}},[q,l,j]);function $(){F.current=!1}const B={role:"presentation",...C&&{"data-id":`${C}-viewport`},...(!S.x||!S.y)&&{tabIndex:0},className:Ed.className,style:{overflow:"scroll"},onScroll(){l.current&&(q(),F.current||R({x:l.current.scrollLeft,y:l.current.scrollTop}),W.start(100,()=>{F.current=!0}))},onWheel:$,onTouchMove:$,onPointerMove:$,onPointerEnter:$,onKeyDown:$},_=v.useMemo(()=>({scrolling:A||L,hasOverflowX:!S.x,hasOverflowY:!S.y,overflowXStart:D.xStart,overflowXEnd:D.xEnd,overflowYStart:D.yStart,overflowYEnd:D.yEnd,cornerHidden:S.corner}),[A,L,S.x,S.y,S.corner,D]),z=Dt("div",t,{ref:[n,l],state:_,props:[B,o],stateAttributesMapping:r0}),U=v.useMemo(()=>({computeThumbPosition:q}),[q]);return E.jsx(HQ.Provider,{value:U,children:z})}),WD=v.createContext(void 0);function $Q(){const e=v.useContext(WD);if(e===void 0)throw new Error(Cn(54));return e}let Pp=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const YQ=v.forwardRef(function(t,n){const{render:r,className:a,orientation:o="vertical",keepMounted:l=!1,...c}=t,{hovering:f,scrollingX:d,scrollingY:m,hiddenState:h,overflowEdges:y,scrollbarYRef:g,scrollbarXRef:w,viewportRef:C,thumbYRef:T,thumbXRef:S,handlePointerDown:R,handlePointerUp:k,rootId:M,thumbSize:D}=Sm(),O={hovering:f,scrolling:{horizontal:d,vertical:m}[o],orientation:o,hasOverflowX:!h.x,hasOverflowY:!h.y,overflowXStart:y.xStart,overflowXEnd:y.xEnd,overflowYStart:y.yStart,overflowYEnd:y.yEnd,cornerHidden:h.corner},A=Ic();v.useEffect(()=>{const q=C.current,$=o==="vertical"?g.current:w.current;if(!$)return;function B(_){if(!(!q||!$||_.ctrlKey)){if(_.preventDefault(),o==="vertical"){if(q.scrollTop===0&&_.deltaY<0)return}else if(q.scrollLeft===0&&_.deltaX<0)return;if(o==="vertical"){if(q.scrollTop===q.scrollHeight-q.clientHeight&&_.deltaY>0)return}else if(q.scrollLeft===q.scrollWidth-q.clientWidth&&_.deltaX>0)return;o==="vertical"?q.scrollTop+=_.deltaY:q.scrollLeft+=_.deltaX}}return $.addEventListener("wheel",B,{passive:!1}),()=>{$.removeEventListener("wheel",B)}},[o,w,g,C]);const L={...M&&{"data-id":`${M}-scrollbar`},onPointerDown(q){if(q.button===0&&q.currentTarget===q.target&&C.current){if(T.current&&g.current&&o==="vertical"){const $=wi(T.current,"margin","y"),B=wi(g.current,"padding","y"),_=T.current.offsetHeight,z=g.current.getBoundingClientRect(),U=q.clientY-z.top-_/2-B+$/2,K=C.current.scrollHeight,P=C.current.clientHeight,V=g.current.offsetHeight-_-B-$,I=U/V*(K-P);C.current.scrollTop=I}if(S.current&&w.current&&o==="horizontal"){const $=wi(S.current,"margin","x"),B=wi(w.current,"padding","x"),_=S.current.offsetWidth,z=w.current.getBoundingClientRect(),U=q.clientX-z.left-_/2-B+$/2,K=C.current.scrollWidth,P=C.current.clientWidth,V=w.current.offsetWidth-_-B-$,G=U/V;let I;A==="rtl"?(I=(1-G)*(K-P),C.current.scrollLeft<=0&&(I=-I)):I=G*(K-P),C.current.scrollLeft=I}R(q)}},onPointerUp:k,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...o==="vertical"&&{top:0,bottom:`var(${Ip.scrollAreaCornerHeight})`,insetInlineEnd:0,[Pp.scrollAreaThumbHeight]:`${D.height}px`},...o==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Ip.scrollAreaCornerWidth})`,bottom:0,[Pp.scrollAreaThumbWidth]:`${D.width}px`}}},H=Dt("div",t,{ref:[n,o==="vertical"?g:w],state:O,props:[L,c],stateAttributesMapping:r0}),F=v.useMemo(()=>({orientation:o}),[o]),W=o==="vertical"?h.y:h.x;return l||!W?E.jsx(WD.Provider,{value:F,children:H}):null}),WQ=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{thumbYRef:l,thumbXRef:c,handlePointerDown:f,handlePointerMove:d,handlePointerUp:m,setScrollingX:h,setScrollingY:y}=Sm(),{orientation:g}=$Q();return Dt("div",t,{ref:[n,g==="vertical"?l:c],state:{orientation:g},props:[{onPointerDown:f,onPointerMove:d,onPointerUp(T){g==="vertical"&&y(!1),g==="horizontal"&&h(!1),m(T)},style:{...g==="vertical"&&{height:`var(${Pp.scrollAreaThumbHeight})`},...g==="horizontal"&&{width:`var(${Pp.scrollAreaThumbWidth})`}}},o]})}),KQ=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{cornerRef:l,cornerSize:c,hiddenState:f}=Sm(),d=Dt("div",t,{ref:[n,l],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:c.width,height:c.height}},o]});return f.corner?null:d});function GQ({className:e,children:t,...n}){return E.jsxs(FQ,{"data-slot":"scroll-area",className:je("relative",e),...n,children:[E.jsx(qQ,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),E.jsx(XQ,{}),E.jsx(KQ,{})]})}function XQ({className:e,orientation:t="vertical",...n}){return E.jsx(YQ,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:je("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none","[@media(any-pointer:coarse)]:hidden",e),...n,children:E.jsx(WQ,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}const QQ=(e,t)=>["watch-rules",e,t],KD=e=>["watch-rule-state",e];async function Lc(e,t){try{return(await e.json()).error??t}catch{return t}}async function ZQ(e,t){const n=new URLSearchParams({deviceId:e,paneId:t}),r=await fetch(`/api/watch/rules?${n}`);if(!r.ok)throw new Error(await Lc(r,"Failed to load watch rules"));return(await r.json()).rules}async function JQ(e){const t=await fetch("/api/watch/rules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Lc(t,"Failed to create watch rule"));return await t.json()}async function GD(e,t){const n=await fetch(`/api/watch/rules/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Lc(n,"Failed to update watch rule"));return await n.json()}async function eZ(e){const t=await fetch(`/api/watch/rules/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(await Lc(t,"Failed to delete watch rule"))}async function XD(e){const t=await fetch(`/api/watch/rules/${e}/state`);if(!t.ok)throw new Error(await Lc(t,"Failed to load watch rule state"));return await t.json()}async function tZ(e){const t=await fetch("/api/watch/assist-regex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Lc(t,"Failed to generate regex"));return await t.json()}const nZ=["match","unchanged","llm"],Hb="__default__";function Ok(e){return e==="llm"?30:5}function rZ({deviceId:e,paneId:t,rule:n,onSaved:r,onCancel:a}){var Te;const{t:o}=Sn(),l=v.useId(),[c,f]=v.useState((n==null?void 0:n.name)??""),[d,m]=v.useState((n==null?void 0:n.triggerType)??"match"),[h,y]=v.useState((n==null?void 0:n.pattern)??""),[g,w]=v.useState((n==null?void 0:n.patternFlags)??""),[C,T]=v.useState((n==null?void 0:n.extractGroup)??0),[S,R]=v.useState((n==null?void 0:n.unchangedMinutes)??10),[k,M]=v.useState((n==null?void 0:n.noMatchBehavior)??"reset"),[D,O]=v.useState((n==null?void 0:n.conditionPrompt)??""),[A,L]=v.useState((n==null?void 0:n.providerId)??null),[H,F]=v.useState((n==null?void 0:n.modelId)??""),[W,j]=v.useState((n==null?void 0:n.confirmWithLlm)??!1),[q,$]=v.useState((n==null?void 0:n.summarizeWithLlm)??!1),[B,_]=v.useState((n==null?void 0:n.intervalSeconds)??30),[z,U]=v.useState((n==null?void 0:n.fireMode)??"once"),[K,P]=v.useState((n==null?void 0:n.cooldownSeconds)??600),[V,G]=v.useState(""),[I,Q]=v.useState(null),te=((Te=Vo({queryKey:["llm-providers"],queryFn:async()=>{const J=await fetch("/api/llm/providers");if(!J.ok)throw new Error("Failed to load providers");return await J.json()},throwOnError:!1}).data)==null?void 0:Te.providers)??[],le=te.filter(J=>J.enabled),pe=te.find(J=>J.id===A),we=(pe==null?void 0:pe.models)??[],Me=d==="match"||d==="unchanged",Pe=d==="llm"||W||q,ne=Ok(d),fe=J=>{m(J);const Se=Ok(J);_(ve=>ve<Se?J==="llm"?60:30:ve)},ye=()=>{if(!c.trim())return o("watch.validation.nameRequired");if(Me){if(!h)return o("watch.validation.patternRequired");try{new RegExp(h,g.replace(/g/g,""))}catch(J){return o("watch.validation.patternInvalid",{detail:J instanceof Error?J.message:String(J)})}if(d==="unchanged"&&(!S||S<=0))return o("watch.validation.unchangedMinutesInvalid")}else if(!D.trim())return o("watch.validation.conditionPromptRequired");return!Number.isInteger(B)||B<ne?o("watch.validation.intervalMin",{min:ne}):null},Le=hd({mutationFn:async()=>{const J={name:c.trim(),triggerType:d,pattern:Me?h:null,patternFlags:Me?g:"",extractGroup:C,conditionPrompt:d==="llm"?D:null,providerId:A,modelId:A&&H.trim()||null,confirmWithLlm:Me?W:!1,summarizeWithLlm:Me?q:!1,intervalSeconds:B,unchangedMinutes:d==="unchanged"?S:null,noMatchBehavior:k,fireMode:z,cooldownSeconds:K};if(n){const ve=J;return await GD(n.id,ve),!1}const Se={...J,deviceId:e,paneId:t,enabled:!0};return await JQ(Se),!0},onSuccess:J=>{mn.success(o(J?"watch.toast.created":"watch.toast.updated")),r(J)},onError:J=>{mn.error(J instanceof Error?J.message:String(J))}}),Oe=hd({mutationFn:async()=>tZ({description:V.trim(),deviceId:e,paneId:t,providerId:A,modelId:A&&H.trim()||null}),onSuccess:J=>{y(J.pattern),w(J.flags),T(J.extractGroup),Q(J)},onError:J=>{mn.error(J instanceof Error?J.message:String(J))}}),Ee=()=>{const J=ye();if(J){mn.error(J);return}Le.mutate()};return E.jsxs("form",{"data-testid":"watch-rule-form",className:"space-y-4",onSubmit:J=>{J.preventDefault(),Ee()},children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-name`,children:o("watch.form.name")}),E.jsx(Ii,{id:`${l}-name`,"data-testid":"watch-form-name",value:c,maxLength:120,onChange:J=>f(J.target.value),placeholder:o("watch.form.namePlaceholder")})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.triggerType")}),E.jsx("div",{className:"grid gap-2",children:nZ.map(J=>E.jsxs("button",{type:"button","data-testid":`watch-form-type-${J}`,onClick:()=>fe(J),className:je("rounded-lg border px-3 py-2 text-left transition-colors",d===J?"border-primary/50 bg-primary/10":"border-border hover:bg-accent/40"),children:[E.jsx("span",{className:"block text-sm font-medium",children:o(`watch.type.${J}`)}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:o(`watch.typeDesc.${J}`)})]},J))})]}),Me&&E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"space-y-2 rounded-lg border border-dashed border-border p-3",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-assist`,children:o("watch.form.assistLabel")}),E.jsxs("div",{className:"flex gap-2",children:[E.jsx(Ii,{id:`${l}-assist`,"data-testid":"watch-form-assist-input",value:V,onChange:J=>G(J.target.value),placeholder:o("watch.form.assistPlaceholder")}),E.jsxs(qt,{type:"button",variant:"secondary","data-testid":"watch-form-assist-generate",disabled:!V.trim()||Oe.isPending,onClick:()=>Oe.mutate(),children:[Oe.isPending?E.jsx(mc,{className:"h-4 w-4 animate-spin"}):E.jsx(RB,{className:"h-4 w-4"}),o("watch.form.assistButton")]})]}),I&&E.jsxs("div",{className:"space-y-1 text-xs","data-testid":"watch-form-assist-result",children:[E.jsxs("p",{className:"text-muted-foreground",children:[E.jsxs("span",{className:"font-medium text-foreground",children:[o("watch.form.assistExplanation"),":"]})," ",I.explanation]}),E.jsxs("p",{className:"font-medium text-foreground",children:[o("watch.form.assistPreview"),":"]}),I.preview.length===0?E.jsx("p",{className:"text-muted-foreground",children:o("watch.form.assistPreviewEmpty")}):E.jsx("ul",{className:"max-h-24 space-y-0.5 overflow-y-auto",children:I.preview.map((J,Se)=>E.jsx("li",{className:"truncate rounded bg-muted px-1.5 py-0.5 font-mono",children:J},Se))})]})]}),E.jsxs("div",{className:"grid grid-cols-[1fr_5rem] gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-pattern`,children:o("watch.form.pattern")}),E.jsx(Ii,{id:`${l}-pattern`,"data-testid":"watch-form-pattern",value:h,onChange:J=>y(J.target.value),placeholder:o("watch.form.patternPlaceholder"),className:"font-mono"})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-flags`,children:o("watch.form.flags")}),E.jsx(Ii,{id:`${l}-flags`,"data-testid":"watch-form-flags",value:g,onChange:J=>w(J.target.value),placeholder:o("watch.form.flagsPlaceholder"),className:"font-mono"})]})]})]}),d==="unchanged"&&E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-extract-group`,children:o("watch.form.extractGroup")}),E.jsx(Ii,{id:`${l}-extract-group`,"data-testid":"watch-form-extract-group",type:"number",min:0,step:1,value:C,onChange:J=>T(Math.max(0,Number(J.target.value)||0))}),E.jsx("p",{className:"text-xs text-muted-foreground",children:o("watch.form.extractGroupHint")})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-unchanged-minutes`,children:o("watch.form.unchangedMinutes")}),E.jsx(Ii,{id:`${l}-unchanged-minutes`,"data-testid":"watch-form-unchanged-minutes",type:"number",min:1,step:1,value:S,onChange:J=>R(Math.max(1,Number(J.target.value)||1))})]}),E.jsxs("div",{className:"col-span-2 space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.noMatchBehavior")}),E.jsxs(rp,{value:k,onValueChange:J=>{(J==="reset"||J==="ignore")&&M(J)},children:[E.jsx(ip,{className:"w-full","data-testid":"watch-form-no-match-behavior",children:E.jsx(jb,{children:o(k==="reset"?"watch.form.noMatchReset":"watch.form.noMatchIgnore")})}),E.jsxs(ap,{children:[E.jsx(Pa,{value:"reset",children:o("watch.form.noMatchReset")}),E.jsx(Pa,{value:"ignore",children:o("watch.form.noMatchIgnore")})]})]})]})]}),d==="llm"&&E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-condition`,children:o("watch.form.conditionPrompt")}),E.jsx(Jx,{id:`${l}-condition`,"data-testid":"watch-form-condition-prompt",value:D,onChange:J=>O(J.target.value),placeholder:o("watch.form.conditionPromptPlaceholder"),rows:3})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.model")}),E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs(rp,{value:A??Hb,onValueChange:J=>{if(!J)return;const Se=J===Hb?null:J;L(Se),Se===null&&F("")},children:[E.jsx(ip,{className:"w-full","data-testid":"watch-form-provider",children:E.jsx(jb,{children:A?(pe==null?void 0:pe.name)??o("watch.form.providerUnavailable"):o("watch.form.followGlobalDefault")})}),E.jsxs(ap,{children:[E.jsx(Pa,{value:Hb,children:o("watch.form.followGlobalDefault")}),A&&!le.some(J=>J.id===A)&&E.jsx(Pa,{value:A,children:pe?`${pe.name} (${o("watch.form.providerDisabled")})`:o("watch.form.providerUnavailable")}),le.map(J=>E.jsx(Pa,{value:J.id,children:J.name},J.id))]})]}),E.jsx(Ii,{"data-testid":"watch-form-model",list:`${l}-model-options`,value:H,disabled:!A,onChange:J=>F(J.target.value),placeholder:o("watch.form.modelPlaceholder")}),E.jsx("datalist",{id:`${l}-model-options`,children:we.map(J=>E.jsx("option",{value:J},J))})]}),Pe&&E.jsx("p",{className:"rounded-md bg-primary/10 px-2 py-1.5 text-xs text-primary","data-testid":"watch-form-model-hint",children:o("watch.form.modelRequiredHint")})]}),Me&&E.jsxs("div",{className:"space-y-3",children:[E.jsxs("div",{className:"flex items-center justify-between gap-2",children:[E.jsxs("div",{children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.confirmWithLlm")}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:o("watch.form.confirmWithLlmDesc")})]}),E.jsx(pp,{checked:W,onCheckedChange:J=>j(!!J),"data-testid":"watch-form-confirm-llm"})]}),E.jsxs("div",{className:"flex items-center justify-between gap-2",children:[E.jsxs("div",{children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.summarizeWithLlm")}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:o("watch.form.summarizeWithLlmDesc")})]}),E.jsx(pp,{checked:q,onCheckedChange:J=>$(!!J),"data-testid":"watch-form-summarize-llm"})]})]}),E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-interval`,children:o("watch.form.intervalSeconds")}),E.jsx(Ii,{id:`${l}-interval`,"data-testid":"watch-form-interval",type:"number",min:ne,step:1,value:B,onChange:J=>_(Number(J.target.value)||0)}),E.jsx("p",{className:"text-xs text-muted-foreground",children:o("watch.form.intervalHint",{min:ne})})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.fireMode")}),E.jsxs(rp,{value:z,onValueChange:J=>{(J==="once"||J==="repeat")&&U(J)},children:[E.jsx(ip,{className:"w-full","data-testid":"watch-form-fire-mode",children:E.jsx(jb,{children:o(z==="once"?"watch.form.fireOnce":"watch.form.fireRepeat")})}),E.jsxs(ap,{children:[E.jsx(Pa,{value:"once",children:o("watch.form.fireOnce")}),E.jsx(Pa,{value:"repeat",children:o("watch.form.fireRepeat")})]})]}),z==="repeat"&&E.jsx(Ii,{"data-testid":"watch-form-cooldown",type:"number",min:0,step:1,value:K,onChange:J=>P(Math.max(0,Number(J.target.value)||0)),"aria-label":o("watch.form.cooldownSeconds"),placeholder:o("watch.form.cooldownSeconds")})]})]}),E.jsxs("div",{className:"flex justify-end gap-2",children:[E.jsx(qt,{type:"button",variant:"outline",onClick:a,"data-testid":"watch-form-cancel",children:o("common.cancel")}),E.jsxs(qt,{type:"submit",disabled:Le.isPending,"data-testid":"watch-form-save",children:[Le.isPending&&E.jsx(mc,{className:"h-4 w-4 animate-spin"}),o(n?"watch.form.save":"watch.form.create")]})]})]})}function Gu(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString()}function iZ({open:e,onOpenChange:t,deviceId:n,paneId:r}){const{t:a}=Sn(),o=Pd(),[l,c]=v.useState({mode:"list"}),[f,d]=v.useState(null),[m,h]=v.useState(!1);v.useEffect(()=>{e||(c({mode:"list"}),d(null),h(!1))},[e]);const y=Vo({queryKey:QQ(n,r),queryFn:()=>ZQ(n,r),enabled:e,throwOnError:!1}),g=()=>{o.invalidateQueries({queryKey:["watch-rules"]})},w=hd({mutationFn:async({rule:R,enabled:k})=>{await GD(R.id,{enabled:k})},onSuccess:g,onError:R=>{mn.error(R instanceof Error?R.message:String(R)),g()}}),C=hd({mutationFn:async R=>{await eZ(R.id)},onSuccess:()=>{mn.success(a("watch.toast.deleted")),g()},onError:R=>{mn.error(R instanceof Error?R.message:String(R))}}),T=R=>{g(),c({mode:"list"}),R&&typeof Notification<"u"&&Notification.permission==="default"&&h(!0)},S=y.data??[];return E.jsxs(E.Fragment,{children:[E.jsx(lx,{open:e,onOpenChange:t,children:E.jsxs(cx,{className:"sm:max-w-lg max-h-[85dvh] grid-rows-[auto_minmax(0,1fr)]","data-testid":"watch-dialog",children:[E.jsxs(ux,{children:[E.jsxs(dx,{children:[l.mode==="list"&&a("watch.title"),l.mode==="form"&&(l.rule?a("watch.form.editTitle"):a("watch.form.createTitle")),l.mode==="state"&&a("watch.state.title")]}),E.jsx(FD,{children:l.mode==="list"?a("watch.dialogDesc"):null})]}),E.jsxs("div",{className:"min-h-0 overflow-y-auto pr-1",children:[l.mode==="list"&&E.jsxs("div",{className:"space-y-3",children:[m&&E.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-primary/30 bg-primary/10 p-3","data-testid":"watch-notif-banner",children:[E.jsx(OF,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),E.jsxs("div",{className:"min-w-0 flex-1",children:[E.jsx("p",{className:"text-sm font-medium",children:a("watch.notifPermission.title")}),E.jsx("p",{className:"text-xs text-muted-foreground",children:a("watch.notifPermission.desc")}),E.jsxs("div",{className:"mt-2 flex gap-2",children:[E.jsx(qt,{size:"sm","data-testid":"watch-notif-enable",onClick:()=>{Notification.requestPermission().finally(()=>h(!1))},children:a("watch.notifPermission.enable")}),E.jsx(qt,{size:"sm",variant:"ghost",onClick:()=>h(!1),children:a("watch.notifPermission.dismiss")})]})]})]}),y.isLoading&&E.jsx("div",{className:"flex justify-center py-6",children:E.jsx(mc,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!y.isLoading&&S.length===0&&E.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground","data-testid":"watch-rules-empty",children:a("watch.rules.empty")}),S.map(R=>E.jsx(aZ,{rule:R,onToggle:k=>w.mutate({rule:R,enabled:k}),onEdit:()=>c({mode:"form",rule:R}),onViewState:()=>c({mode:"state",rule:R}),onDelete:()=>d(R)},R.id)),E.jsxs(qt,{variant:"outline",className:"w-full","data-testid":"watch-rule-add",onClick:()=>c({mode:"form",rule:null}),children:[E.jsx(Yp,{className:"h-4 w-4"}),a("watch.rules.addRule")]})]}),l.mode==="form"&&E.jsx(rZ,{deviceId:n,paneId:r,rule:l.rule,onSaved:T,onCancel:()=>c({mode:"list"})}),l.mode==="state"&&E.jsx(oZ,{rule:l.rule,onBack:()=>c({mode:"list"})})]})]})}),E.jsx(ex,{open:f!==null,onOpenChange:R=>!R&&d(null),children:E.jsxs(tx,{"data-testid":"watch-rule-delete-dialog",children:[E.jsxs(nx,{children:[E.jsx(ix,{children:a("watch.rules.deleteTitle")}),E.jsx(ax,{children:a("watch.rules.deleteDesc",{name:(f==null?void 0:f.name)??""})})]}),E.jsxs(rx,{children:[E.jsx(sx,{children:a("common.cancel")}),E.jsx(ox,{variant:"destructive","data-testid":"watch-rule-delete-confirm",onClick:()=>{f&&C.mutate(f),d(null)},children:a("watch.rules.deleteConfirm")})]})]})})]})}function aZ({rule:e,onToggle:t,onEdit:n,onViewState:r,onDelete:a}){var f,d;const{t:o}=Sn(),l=Vo({queryKey:KD(e.id),queryFn:()=>XD(e.id),throwOnError:!1}),c=Gu((d=(f=l.data)==null?void 0:f.state)==null?void 0:d.lastTriggeredAt);return E.jsxs("div",{className:"rounded-lg border border-border p-3","data-testid":`watch-rule-item-${e.id}`,"data-rule-name":e.name,children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),E.jsx(Ks,{variant:"secondary",children:o(`watch.type.${e.triggerType}`)}),E.jsx(pp,{checked:e.enabled,onCheckedChange:m=>t(!!m),"data-testid":`watch-rule-toggle-${e.id}`})]}),E.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[E.jsx("span",{className:"truncate text-xs text-muted-foreground",children:c?o("watch.rules.lastTriggered",{time:c}):o("watch.rules.neverTriggered")}),E.jsxs("div",{className:"flex shrink-0 gap-1",children:[E.jsx(qt,{variant:"ghost",size:"icon-xs",onClick:r,title:o("watch.rules.viewState"),"aria-label":o("watch.rules.viewState"),"data-testid":`watch-rule-state-${e.id}`,children:E.jsx(EF,{className:"h-3.5 w-3.5"})}),E.jsx(qt,{variant:"ghost",size:"icon-xs",onClick:n,title:o("watch.rules.edit"),"aria-label":o("watch.rules.edit"),"data-testid":`watch-rule-edit-${e.id}`,children:E.jsx($p,{className:"h-3.5 w-3.5"})}),E.jsx(qt,{variant:"ghost",size:"icon-xs",onClick:a,title:o("watch.rules.delete"),"aria-label":o("watch.rules.delete"),"data-testid":`watch-rule-delete-${e.id}`,children:E.jsx(fO,{className:"h-3.5 w-3.5 text-destructive"})})]})]})]})}function oZ({rule:e,onBack:t}){var f,d;const{t:n}=Sn(),r=Vo({queryKey:KD(e.id),queryFn:()=>XD(e.id),refetchInterval:5e3,throwOnError:!1}),a=((f=r.data)==null?void 0:f.state)??null,o=((d=r.data)==null?void 0:d.samples)??[],l=n("watch.state.none"),c=[{label:n("watch.state.lastSampledAt"),value:Gu(a==null?void 0:a.lastSampledAt)??l},{label:n("watch.state.lastValue"),value:(a==null?void 0:a.lastValue)??l},{label:n("watch.state.lastValueChangedAt"),value:Gu(a==null?void 0:a.lastValueChangedAt)??l},{label:n("watch.state.lastTriggeredAt"),value:Gu(a==null?void 0:a.lastTriggeredAt)??l},{label:n("watch.state.consecutiveErrors"),value:a?String(a.consecutiveErrors):l},{label:n("watch.state.lastError"),value:(a==null?void 0:a.lastError)??l}];return E.jsxs("div",{className:"space-y-3","data-testid":"watch-rule-state-view",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(qt,{variant:"ghost",size:"icon-sm",onClick:t,"aria-label":n("watch.state.back"),children:E.jsx(kF,{className:"h-4 w-4"})}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),E.jsx(Ks,{variant:"secondary",children:n(`watch.type.${e.triggerType}`)})]}),r.isLoading?E.jsx("div",{className:"flex justify-center py-6",children:E.jsx(mc,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):E.jsxs(E.Fragment,{children:[E.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:c.map(m=>E.jsxs("div",{className:"contents",children:[E.jsx("dt",{className:"text-muted-foreground",children:m.label}),E.jsx("dd",{className:"min-w-0 break-all",children:m.value})]},m.label))}),E.jsxs("div",{className:"space-y-1.5",children:[E.jsx("p",{className:"text-sm font-medium",children:n("watch.state.samples")}),o.length===0?E.jsx("p",{className:"text-xs text-muted-foreground",children:n("watch.state.samplesEmpty")}):E.jsx("ul",{className:"max-h-48 space-y-0.5 overflow-y-auto text-xs",children:[...o].reverse().map(m=>E.jsxs("li",{className:"flex items-center gap-2 rounded bg-muted/60 px-2 py-1",children:[E.jsx("span",{className:"shrink-0 font-mono text-muted-foreground",children:Gu(m.at)??m.at}),E.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:m.value??l}),m.hit&&E.jsx(Ks,{variant:"default",className:"h-4 px-1 text-[10px]",children:n("watch.state.hit")})]},m.at))})]})]})]})}function sZ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>r=>{t.forEach(a=>a(r))},t)}const Em=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function i0(e){return"nodeType"in e}function Vr(e){var t,n;return e?jc(e)?e:i0(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function a0(e){const{Document:t}=Vr(e);return e instanceof t}function Zd(e){return jc(e)?!1:e instanceof Vr(e).HTMLElement}function QD(e){return e instanceof Vr(e).SVGElement}function _c(e){return e?jc(e)?e.document:i0(e)?a0(e)?e:Zd(e)||QD(e)?e.ownerDocument:document:document:document}const oa=Em?v.useLayoutEffect:v.useEffect;function o0(e){const t=v.useRef(e);return oa(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}function lZ(){const e=v.useRef(null),t=v.useCallback((r,a)=>{e.current=setInterval(r,a)},[]),n=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Td(e,t){t===void 0&&(t=[e]);const n=v.useRef(e);return oa(()=>{n.current!==e&&(n.current=e)},t),n}function Jd(e,t){const n=v.useRef();return v.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Lp(e){const t=o0(e),n=v.useRef(null),r=v.useCallback(a=>{a!==n.current&&(t==null||t(a,n.current)),n.current=a},[]);return[n,r]}function fx(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let Ub={};function ef(e,t){return v.useMemo(()=>{if(t)return t;const n=Ub[e]==null?0:Ub[e]+1;return Ub[e]=n,e+"-"+n},[e,t])}function ZD(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.reduce((o,l)=>{const c=Object.entries(l);for(const[f,d]of c){const m=o[f];m!=null&&(o[f]=m+e*d)}return o},{...t})}}const ec=ZD(1),Rd=ZD(-1);function cZ(e){return"clientX"in e&&"clientY"in e}function s0(e){if(!e)return!1;const{KeyboardEvent:t}=Vr(e.target);return t&&e instanceof t}function uZ(e){if(!e)return!1;const{TouchEvent:t}=Vr(e.target);return t&&e instanceof t}function hx(e){if(uZ(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return cZ(e)?{x:e.clientX,y:e.clientY}:null}const Qs=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Qs.Translate.toString(e),Qs.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ak="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function dZ(e){return e.matches(Ak)?e:e.querySelector(Ak)}const fZ={display:"none"};function hZ(e){let{id:t,value:n}=e;return Fe.createElement("div",{id:t,style:fZ},n)}function pZ(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Fe.createElement("div",{id:t,style:a,role:"status","aria-live":r,"aria-atomic":!0},n)}function mZ(){const[e,t]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const JD=v.createContext(null);function gZ(e){const t=v.useContext(JD);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function yZ(){const[e]=v.useState(()=>new Set),t=v.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[v.useCallback(r=>{let{type:a,event:o}=r;e.forEach(l=>{var c;return(c=l[a])==null?void 0:c.call(l,o)})},[e]),t]}const bZ={draggable:`
396
- To pick up a draggable item, press the space bar.
397
- While dragging, use the arrow keys to move the item.
398
- Press space again to drop the item in its new position, or press escape to cancel.
399
- `},vZ={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function xZ(e){let{announcements:t=vZ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:a=bZ}=e;const{announce:o,announcement:l}=mZ(),c=ef("DndLiveRegion"),[f,d]=v.useState(!1);if(v.useEffect(()=>{d(!0)},[]),gZ(v.useMemo(()=>({onDragStart(h){let{active:y}=h;o(t.onDragStart({active:y}))},onDragMove(h){let{active:y,over:g}=h;t.onDragMove&&o(t.onDragMove({active:y,over:g}))},onDragOver(h){let{active:y,over:g}=h;o(t.onDragOver({active:y,over:g}))},onDragEnd(h){let{active:y,over:g}=h;o(t.onDragEnd({active:y,over:g}))},onDragCancel(h){let{active:y,over:g}=h;o(t.onDragCancel({active:y,over:g}))}}),[o,t])),!f)return null;const m=Fe.createElement(Fe.Fragment,null,Fe.createElement(hZ,{id:r,value:a.draggable}),Fe.createElement(pZ,{id:c,announcement:l}));return n?pr.createPortal(m,n):m}var Jn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Jn||(Jn={}));function jp(){}function Vb(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function wZ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Fi=Object.freeze({x:0,y:0});function e2(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function t2(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function SZ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Nk(e){let{left:t,top:n,height:r,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+r},{x:t+a,y:n+r}]}function n2(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Dk(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const l0=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=Dk(t,t.left,t.top),o=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=e2(Dk(f),a);o.push({id:c,data:{droppableContainer:l,value:d}})}}return o.sort(t2)},EZ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=Nk(t),o=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=Nk(f),m=a.reduce((y,g,w)=>y+e2(d[w],g),0),h=Number((m/4).toFixed(4));o.push({id:c,data:{droppableContainer:l,value:h}})}}return o.sort(t2)};function CZ(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),l=a-r,c=o-n;if(r<a&&n<o){const f=t.width*t.height,d=e.width*e.height,m=l*c,h=m/(f+d-m);return Number(h.toFixed(4))}return 0}const TZ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=[];for(const o of r){const{id:l}=o,c=n.get(l);if(c){const f=CZ(c,t);f>0&&a.push({id:l,data:{droppableContainer:o,value:f}})}}return a.sort(SZ)};function RZ(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function r2(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Fi}function kZ(e){return function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return a.reduce((l,c)=>({...l,top:l.top+e*c.y,bottom:l.bottom+e*c.y,left:l.left+e*c.x,right:l.right+e*c.x}),{...n})}}const MZ=kZ(1);function OZ(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function AZ(e,t,n){const r=OZ(t);if(!r)return e;const{scaleX:a,scaleY:o,x:l,y:c}=r,f=e.left-l-(1-a)*parseFloat(n),d=e.top-c-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),m=a?e.width/a:e.width,h=o?e.height/o:e.height;return{width:m,height:h,top:d,right:f+m,bottom:d+h,left:f}}const NZ={ignoreTransform:!1};function zc(e,t){t===void 0&&(t=NZ);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:m}=Vr(e).getComputedStyle(e);d&&(n=AZ(n,d,m))}const{top:r,left:a,width:o,height:l,bottom:c,right:f}=n;return{top:r,left:a,width:o,height:l,bottom:c,right:f}}function Ik(e){return zc(e,{ignoreTransform:!0})}function DZ(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function IZ(e,t){return t===void 0&&(t=Vr(e).getComputedStyle(e)),t.position==="fixed"}function PZ(e,t){t===void 0&&(t=Vr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const o=t[a];return typeof o=="string"?n.test(o):!1})}function Cm(e,t){const n=[];function r(a){if(t!=null&&n.length>=t||!a)return n;if(a0(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!Zd(a)||QD(a)||n.includes(a))return n;const o=Vr(e).getComputedStyle(a);return a!==e&&PZ(a,o)&&n.push(a),IZ(a,o)?n:r(a.parentNode)}return e?r(e):n}function i2(e){const[t]=Cm(e,1);return t??null}function qb(e){return!Em||!e?null:jc(e)?e:i0(e)?a0(e)||e===_c(e).scrollingElement?window:Zd(e)?e:null:null}function a2(e){return jc(e)?e.scrollX:e.scrollLeft}function o2(e){return jc(e)?e.scrollY:e.scrollTop}function px(e){return{x:a2(e),y:o2(e)}}var or;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(or||(or={}));function s2(e){return!Em||!e?!1:e===document.scrollingElement}function l2(e){const t={x:0,y:0},n=s2(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},a=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:a,isLeft:o,isBottom:l,isRight:c,maxScroll:r,minScroll:t}}const LZ={x:.2,y:.2};function jZ(e,t,n,r,a){let{top:o,left:l,right:c,bottom:f}=n;r===void 0&&(r=10),a===void 0&&(a=LZ);const{isTop:d,isBottom:m,isLeft:h,isRight:y}=l2(e),g={x:0,y:0},w={x:0,y:0},C={height:t.height*a.y,width:t.width*a.x};return!d&&o<=t.top+C.height?(g.y=or.Backward,w.y=r*Math.abs((t.top+C.height-o)/C.height)):!m&&f>=t.bottom-C.height&&(g.y=or.Forward,w.y=r*Math.abs((t.bottom-C.height-f)/C.height)),!y&&c>=t.right-C.width?(g.x=or.Forward,w.x=r*Math.abs((t.right-C.width-c)/C.width)):!h&&l<=t.left+C.width&&(g.x=or.Backward,w.x=r*Math.abs((t.left+C.width-l)/C.width)),{direction:g,speed:w}}function _Z(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:l}=window;return{top:0,left:0,right:o,bottom:l,width:o,height:l}}const{top:t,left:n,right:r,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:a,width:e.clientWidth,height:e.clientHeight}}function c2(e){return e.reduce((t,n)=>ec(t,px(n)),Fi)}function zZ(e){return e.reduce((t,n)=>t+a2(n),0)}function FZ(e){return e.reduce((t,n)=>t+o2(n),0)}function BZ(e,t){if(t===void 0&&(t=zc),!e)return;const{top:n,left:r,bottom:a,right:o}=t(e);i2(e)&&(a<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const HZ=[["x",["left","right"],zZ],["y",["top","bottom"],FZ]];class c0{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Cm(n),a=c2(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,l,c]of HZ)for(const f of l)Object.defineProperty(this,f,{get:()=>{const d=c(r),m=a[o]-d;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class cd{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var a;(a=this.target)==null||a.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function UZ(e){const{EventTarget:t}=Vr(e);return e instanceof t?e:_c(e)}function $b(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var bi;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(bi||(bi={}));function Pk(e){e.preventDefault()}function VZ(e){e.stopPropagation()}var rn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(rn||(rn={}));const u2={start:[rn.Space,rn.Enter],cancel:[rn.Esc],end:[rn.Space,rn.Enter,rn.Tab]},qZ=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case rn.Right:return{...n,x:n.x+25};case rn.Left:return{...n,x:n.x-25};case rn.Down:return{...n,y:n.y+25};case rn.Up:return{...n,y:n.y-25}}};class u0{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new cd(_c(n)),this.windowListeners=new cd(Vr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(bi.Resize,this.handleCancel),this.windowListeners.add(bi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(bi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&BZ(r),n(Fi)}handleKeyDown(t){if(s0(t)){const{active:n,context:r,options:a}=this.props,{keyboardCodes:o=u2,coordinateGetter:l=qZ,scrollBehavior:c="smooth"}=a,{code:f}=t;if(o.end.includes(f)){this.handleEnd(t);return}if(o.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:d}=r.current,m=d?{x:d.left,y:d.top}:Fi;this.referenceCoordinates||(this.referenceCoordinates=m);const h=l(t,{active:n,context:r.current,currentCoordinates:m});if(h){const y=Rd(h,m),g={x:0,y:0},{scrollableAncestors:w}=r.current;for(const C of w){const T=t.code,{isTop:S,isRight:R,isLeft:k,isBottom:M,maxScroll:D,minScroll:O}=l2(C),A=_Z(C),L={x:Math.min(T===rn.Right?A.right-A.width/2:A.right,Math.max(T===rn.Right?A.left:A.left+A.width/2,h.x)),y:Math.min(T===rn.Down?A.bottom-A.height/2:A.bottom,Math.max(T===rn.Down?A.top:A.top+A.height/2,h.y))},H=T===rn.Right&&!R||T===rn.Left&&!k,F=T===rn.Down&&!M||T===rn.Up&&!S;if(H&&L.x!==h.x){const W=C.scrollLeft+y.x,j=T===rn.Right&&W<=D.x||T===rn.Left&&W>=O.x;if(j&&!y.y){C.scrollTo({left:W,behavior:c});return}j?g.x=C.scrollLeft-W:g.x=T===rn.Right?C.scrollLeft-D.x:C.scrollLeft-O.x,g.x&&C.scrollBy({left:-g.x,behavior:c});break}else if(F&&L.y!==h.y){const W=C.scrollTop+y.y,j=T===rn.Down&&W<=D.y||T===rn.Up&&W>=O.y;if(j&&!y.x){C.scrollTo({top:W,behavior:c});return}j?g.y=C.scrollTop-W:g.y=T===rn.Down?C.scrollTop-D.y:C.scrollTop-O.y,g.y&&C.scrollBy({top:-g.y,behavior:c});break}}this.handleMove(t,ec(Rd(h,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}u0.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=u2,onActivation:a}=t,{active:o}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const c=o.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function Lk(e){return!!(e&&"distance"in e)}function jk(e){return!!(e&&"delay"in e)}class d0{constructor(t,n,r){var a;r===void 0&&(r=UZ(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:l}=o;this.props=t,this.events=n,this.document=_c(l),this.documentListeners=new cd(this.document),this.listeners=new cd(r),this.windowListeners=new cd(Vr(l)),this.initialCoordinates=(a=hx(o))!=null?a:Fi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(bi.Resize,this.handleCancel),this.windowListeners.add(bi.DragStart,Pk),this.windowListeners.add(bi.VisibilityChange,this.handleCancel),this.windowListeners.add(bi.ContextMenu,Pk),this.documentListeners.add(bi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(jk(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Lk(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:a}=this.props;a(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(bi.Click,VZ,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(bi.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:a,props:o}=this,{onMove:l,options:{activationConstraint:c}}=o;if(!a)return;const f=(n=hx(t))!=null?n:Fi,d=Rd(a,f);if(!r&&c){if(Lk(c)){if(c.tolerance!=null&&$b(d,c.tolerance))return this.handleCancel();if($b(d,c.distance))return this.handleStart()}if(jk(c)&&$b(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}t.cancelable&&t.preventDefault(),l(f)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===rn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const $Z={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class d2 extends d0{constructor(t){const{event:n}=t,r=_c(n.target);super(t,$Z,r)}}d2.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const YZ={move:{name:"mousemove"},end:{name:"mouseup"}};var mx;(function(e){e[e.RightClick=2]="RightClick"})(mx||(mx={}));class f2 extends d0{constructor(t){super(t,YZ,_c(t.event.target))}}f2.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===mx.RightClick?!1:(r==null||r({event:n}),!0)}}];const Yb={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class h2 extends d0{constructor(t){super(t,Yb)}static setup(){return window.addEventListener(Yb.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Yb.move.name,t)};function t(){}}}h2.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:a}=n;return a.length>1?!1:(r==null||r({event:n}),!0)}}];var ud;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ud||(ud={}));var _p;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(_p||(_p={}));function WZ(e){let{acceleration:t,activator:n=ud.Pointer,canScroll:r,draggingRect:a,enabled:o,interval:l=5,order:c=_p.TreeOrder,pointerCoordinates:f,scrollableAncestors:d,scrollableAncestorRects:m,delta:h,threshold:y}=e;const g=GZ({delta:h,disabled:!o}),[w,C]=lZ(),T=v.useRef({x:0,y:0}),S=v.useRef({x:0,y:0}),R=v.useMemo(()=>{switch(n){case ud.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case ud.DraggableRect:return a}},[n,a,f]),k=v.useRef(null),M=v.useCallback(()=>{const O=k.current;if(!O)return;const A=T.current.x*S.current.x,L=T.current.y*S.current.y;O.scrollBy(A,L)},[]),D=v.useMemo(()=>c===_p.TreeOrder?[...d].reverse():d,[c,d]);v.useEffect(()=>{if(!o||!d.length||!R){C();return}for(const O of D){if((r==null?void 0:r(O))===!1)continue;const A=d.indexOf(O),L=m[A];if(!L)continue;const{direction:H,speed:F}=jZ(O,L,R,t,y);for(const W of["x","y"])g[W][H[W]]||(F[W]=0,H[W]=0);if(F.x>0||F.y>0){C(),k.current=O,w(M,l),T.current=F,S.current=H;return}}T.current={x:0,y:0},S.current={x:0,y:0},C()},[t,M,r,C,o,l,JSON.stringify(R),JSON.stringify(g),w,d,D,m,JSON.stringify(y)])}const KZ={x:{[or.Backward]:!1,[or.Forward]:!1},y:{[or.Backward]:!1,[or.Forward]:!1}};function GZ(e){let{delta:t,disabled:n}=e;const r=fx(t);return Jd(a=>{if(n||!r||!a)return KZ;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[or.Backward]:a.x[or.Backward]||o.x===-1,[or.Forward]:a.x[or.Forward]||o.x===1},y:{[or.Backward]:a.y[or.Backward]||o.y===-1,[or.Forward]:a.y[or.Forward]||o.y===1}}},[n,t,r])}function XZ(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Jd(a=>{var o;return t==null?null:(o=r??a)!=null?o:null},[r,t])}function QZ(e,t){return v.useMemo(()=>e.reduce((n,r)=>{const{sensor:a}=r,o=a.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...o]},[]),[e,t])}var kd;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(kd||(kd={}));var gx;(function(e){e.Optimized="optimized"})(gx||(gx={}));const _k=new Map;function ZZ(e,t){let{dragging:n,dependencies:r,config:a}=t;const[o,l]=v.useState(null),{frequency:c,measure:f,strategy:d}=a,m=v.useRef(e),h=T(),y=Td(h),g=v.useCallback(function(S){S===void 0&&(S=[]),!y.current&&l(R=>R===null?S:R.concat(S.filter(k=>!R.includes(k))))},[y]),w=v.useRef(null),C=Jd(S=>{if(h&&!n)return _k;if(!S||S===_k||m.current!==e||o!=null){const R=new Map;for(let k of e){if(!k)continue;if(o&&o.length>0&&!o.includes(k.id)&&k.rect.current){R.set(k.id,k.rect.current);continue}const M=k.node.current,D=M?new c0(f(M),M):null;k.rect.current=D,D&&R.set(k.id,D)}return R}return S},[e,o,n,h,f]);return v.useEffect(()=>{m.current=e},[e]),v.useEffect(()=>{h||g()},[n,h]),v.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),v.useEffect(()=>{h||typeof c!="number"||w.current!==null||(w.current=setTimeout(()=>{g(),w.current=null},c))},[c,h,g,...r]),{droppableRects:C,measureDroppableContainers:g,measuringScheduled:o!=null};function T(){switch(d){case kd.Always:return!1;case kd.BeforeDragging:return n;default:return!n}}}function p2(e,t){return Jd(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function JZ(e,t){return p2(e,t)}function eJ(e){let{callback:t,disabled:n}=e;const r=o0(t),a=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return v.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Tm(e){let{callback:t,disabled:n}=e;const r=o0(t),a=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return v.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function tJ(e){return new c0(zc(e),e)}function zk(e,t,n){t===void 0&&(t=tJ);const[r,a]=v.useState(null);function o(){a(f=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=f??n)!=null?d:null}const m=t(e);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const l=eJ({callback(f){if(e)for(const d of f){const{type:m,target:h}=d;if(m==="childList"&&h instanceof HTMLElement&&h.contains(e)){o();break}}}}),c=Tm({callback:o});return oa(()=>{o(),e?(c==null||c.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),l==null||l.disconnect())},[e]),r}function nJ(e){const t=p2(e);return r2(e,t)}const Fk=[];function rJ(e){const t=v.useRef(e),n=Jd(r=>e?r&&r!==Fk&&e&&t.current&&e.parentNode===t.current.parentNode?r:Cm(e):Fk,[e]);return v.useEffect(()=>{t.current=e},[e]),n}function iJ(e){const[t,n]=v.useState(null),r=v.useRef(e),a=v.useCallback(o=>{const l=qb(o.target);l&&n(c=>c?(c.set(l,px(l)),new Map(c)):null)},[]);return v.useEffect(()=>{const o=r.current;if(e!==o){l(o);const c=e.map(f=>{const d=qb(f);return d?(d.addEventListener("scroll",a,{passive:!0}),[d,px(d)]):null}).filter(f=>f!=null);n(c.length?new Map(c):null),r.current=e}return()=>{l(e),l(o)};function l(c){c.forEach(f=>{const d=qb(f);d==null||d.removeEventListener("scroll",a)})}},[a,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,l)=>ec(o,l),Fi):c2(e):Fi,[e,t])}function Bk(e,t){t===void 0&&(t=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},t),v.useEffect(()=>{const r=e!==Fi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Rd(e,n.current):Fi}function aJ(e){v.useEffect(()=>{if(!Em)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function oJ(e,t){return v.useMemo(()=>e.reduce((n,r)=>{let{eventName:a,handler:o}=r;return n[a]=l=>{o(l,t)},n},{}),[e,t])}function m2(e){return v.useMemo(()=>e?DZ(e):null,[e])}const Hk=[];function sJ(e,t){t===void 0&&(t=zc);const[n]=e,r=m2(n?Vr(n):null),[a,o]=v.useState(Hk);function l(){o(()=>e.length?e.map(f=>s2(f)?r:new c0(t(f),f)):Hk)}const c=Tm({callback:l});return oa(()=>{c==null||c.disconnect(),l(),e.forEach(f=>c==null?void 0:c.observe(f))},[e]),a}function lJ(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Zd(t)?t:e}function cJ(e){let{measure:t}=e;const[n,r]=v.useState(null),a=v.useCallback(d=>{for(const{target:m}of d)if(Zd(m)){r(h=>{const y=t(m);return h?{...h,width:y.width,height:y.height}:y});break}},[t]),o=Tm({callback:a}),l=v.useCallback(d=>{const m=lJ(d);o==null||o.disconnect(),m&&(o==null||o.observe(m)),r(m?t(m):null)},[t,o]),[c,f]=Lp(l);return v.useMemo(()=>({nodeRef:c,rect:n,setRef:f}),[n,c,f])}const uJ=[{sensor:d2,options:{}},{sensor:u0,options:{}}],dJ={current:{}},op={draggable:{measure:Ik},droppable:{measure:Ik,strategy:kd.WhileDragging,frequency:gx.Optimized},dragOverlay:{measure:zc}};class dd extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const fJ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new dd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:jp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:op,measureDroppableContainers:jp,windowRect:null,measuringScheduled:!1},hJ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:jp,draggableNodes:new Map,over:null,measureDroppableContainers:jp},Rm=v.createContext(hJ),g2=v.createContext(fJ);function pJ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dd}}}function mJ(e,t){switch(t.type){case Jn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Jn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Jn.DragEnd:case Jn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Jn.RegisterDroppable:{const{element:n}=t,{id:r}=n,a=new dd(e.droppable.containers);return a.set(r,n),{...e,droppable:{...e.droppable,containers:a}}}case Jn.SetDroppableDisabled:{const{id:n,key:r,disabled:a}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new dd(e.droppable.containers);return l.set(n,{...o,disabled:a}),{...e,droppable:{...e.droppable,containers:l}}}case Jn.UnregisterDroppable:{const{id:n,key:r}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const o=new dd(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function gJ(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:a}=v.useContext(Rm),o=fx(r),l=fx(n==null?void 0:n.id);return v.useEffect(()=>{if(!t&&!r&&o&&l!=null){if(!s0(o)||document.activeElement===o.target)return;const c=a.get(l);if(!c)return;const{activatorNode:f,node:d}=c;if(!f.current&&!d.current)return;requestAnimationFrame(()=>{for(const m of[f.current,d.current]){if(!m)continue;const h=dZ(m);if(h){h.focus();break}}})}},[r,t,a,l,o]),null}function yJ(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((a,o)=>o({transform:a,...r}),n):n}function bJ(e){return v.useMemo(()=>({draggable:{...op.draggable,...e==null?void 0:e.draggable},droppable:{...op.droppable,...e==null?void 0:e.droppable},dragOverlay:{...op.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function vJ(e){let{activeNode:t,measure:n,initialRect:r,config:a=!0}=e;const o=v.useRef(!1),{x:l,y:c}=typeof a=="boolean"?{x:a,y:a}:a;oa(()=>{if(!l&&!c||!t){o.current=!1;return}if(o.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const m=n(d),h=r2(m,r);if(l||(h.x=0),c||(h.y=0),o.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const y=i2(d);y&&y.scrollBy({top:h.y,left:h.x})}},[t,l,c,r,n])}const y2=v.createContext({...Fi,scaleX:1,scaleY:1});var Eo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Eo||(Eo={}));const f0=v.memo(function(t){var n,r,a,o;let{id:l,accessibility:c,autoScroll:f=!0,children:d,sensors:m=uJ,collisionDetection:h=TZ,measuring:y,modifiers:g,...w}=t;const C=v.useReducer(mJ,void 0,pJ),[T,S]=C,[R,k]=yZ(),[M,D]=v.useState(Eo.Uninitialized),O=M===Eo.Initialized,{draggable:{active:A,nodes:L,translate:H},droppable:{containers:F}}=T,W=A!=null?L.get(A):null,j=v.useRef({initial:null,translated:null}),q=v.useMemo(()=>{var ft;return A!=null?{id:A,data:(ft=W==null?void 0:W.data)!=null?ft:dJ,rect:j}:null},[A,W]),$=v.useRef(null),[B,_]=v.useState(null),[z,U]=v.useState(null),K=Td(w,Object.values(w)),P=ef("DndDescribedBy",l),V=v.useMemo(()=>F.getEnabled(),[F]),G=bJ(y),{droppableRects:I,measureDroppableContainers:Q,measuringScheduled:Z}=ZZ(V,{dragging:O,dependencies:[H.x,H.y],config:G.droppable}),te=XZ(L,A),le=v.useMemo(()=>z?hx(z):null,[z]),pe=it(),we=JZ(te,G.draggable.measure);vJ({activeNode:A!=null?L.get(A):null,config:pe.layoutShiftCompensation,initialRect:we,measure:G.draggable.measure});const Me=zk(te,G.draggable.measure,we),Pe=zk(te?te.parentElement:null),ne=v.useRef({activatorEvent:null,active:null,activeNode:te,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),fe=F.getNodeFor((n=ne.current.over)==null?void 0:n.id),ye=cJ({measure:G.dragOverlay.measure}),Le=(r=ye.nodeRef.current)!=null?r:te,Oe=O?(a=ye.rect)!=null?a:Me:null,Ee=!!(ye.nodeRef.current&&ye.rect),Te=nJ(Ee?null:Me),J=m2(Le?Vr(Le):null),Se=rJ(O?fe??te:null),ve=sJ(Se),Be=yJ(g,{transform:{x:H.x-Te.x,y:H.y-Te.y,scaleX:1,scaleY:1},activatorEvent:z,active:q,activeNodeRect:Me,containerNodeRect:Pe,draggingNodeRect:Oe,over:ne.current.over,overlayNodeRect:ye.rect,scrollableAncestors:Se,scrollableAncestorRects:ve,windowRect:J}),qe=le?ec(le,H):null,De=iJ(Se),ut=Bk(De),he=Bk(De,[Me]),Ce=ec(Be,ut),ee=Oe?MZ(Oe,Be):null,de=q&&ee?h({active:q,collisionRect:ee,droppableRects:I,droppableContainers:V,pointerCoordinates:qe}):null,Ae=n2(de,"id"),[He,$e]=v.useState(null),et=Ee?Be:ec(Be,he),ze=RZ(et,(o=He==null?void 0:He.rect)!=null?o:null,Me),Ze=v.useRef(null),tt=v.useCallback((ft,yt)=>{let{sensor:Ke,options:Rt}=yt;if($.current==null)return;const jt=L.get($.current);if(!jt)return;const Tt=ft.nativeEvent,un=new Ke({active:$.current,activeNode:jt,event:Tt,options:Rt,context:ne,onAbort(Je){if(!L.get(Je))return;const{onDragAbort:X}=K.current,ae={id:Je};X==null||X(ae),R({type:"onDragAbort",event:ae})},onPending(Je,kt,X,ae){if(!L.get(Je))return;const{onDragPending:Re}=K.current,_e={id:Je,constraint:kt,initialCoordinates:X,offset:ae};Re==null||Re(_e),R({type:"onDragPending",event:_e})},onStart(Je){const kt=$.current;if(kt==null)return;const X=L.get(kt);if(!X)return;const{onDragStart:ae}=K.current,ue={activatorEvent:Tt,active:{id:kt,data:X.data,rect:j}};pr.unstable_batchedUpdates(()=>{ae==null||ae(ue),D(Eo.Initializing),S({type:Jn.DragStart,initialCoordinates:Je,active:kt}),R({type:"onDragStart",event:ue}),_(Ze.current),U(Tt)})},onMove(Je){S({type:Jn.DragMove,coordinates:Je})},onEnd:Ht(Jn.DragEnd),onCancel:Ht(Jn.DragCancel)});Ze.current=un;function Ht(Je){return async function(){const{active:X,collisions:ae,over:ue,scrollAdjustedTranslate:Re}=ne.current;let _e=null;if(X&&Re){const{cancelDrop:rt}=K.current;_e={activatorEvent:Tt,active:X,collisions:ae,delta:Re,over:ue},Je===Jn.DragEnd&&typeof rt=="function"&&await Promise.resolve(rt(_e))&&(Je=Jn.DragCancel)}$.current=null,pr.unstable_batchedUpdates(()=>{S({type:Je}),D(Eo.Uninitialized),$e(null),_(null),U(null),Ze.current=null;const rt=Je===Jn.DragEnd?"onDragEnd":"onDragCancel";if(_e){const nt=K.current[rt];nt==null||nt(_e),R({type:rt,event:_e})}})}}},[L]),Ct=v.useCallback((ft,yt)=>(Ke,Rt)=>{const jt=Ke.nativeEvent,Tt=L.get(Rt);if($.current!==null||!Tt||jt.dndKit||jt.defaultPrevented)return;const un={active:Tt};ft(Ke,yt.options,un)===!0&&(jt.dndKit={capturedBy:yt.sensor},$.current=Rt,tt(Ke,yt))},[L,tt]),zt=QZ(m,Ct);aJ(m),oa(()=>{Me&&M===Eo.Initializing&&D(Eo.Initialized)},[Me,M]),v.useEffect(()=>{const{onDragMove:ft}=K.current,{active:yt,activatorEvent:Ke,collisions:Rt,over:jt}=ne.current;if(!yt||!Ke)return;const Tt={active:yt,activatorEvent:Ke,collisions:Rt,delta:{x:Ce.x,y:Ce.y},over:jt};pr.unstable_batchedUpdates(()=>{ft==null||ft(Tt),R({type:"onDragMove",event:Tt})})},[Ce.x,Ce.y]),v.useEffect(()=>{const{active:ft,activatorEvent:yt,collisions:Ke,droppableContainers:Rt,scrollAdjustedTranslate:jt}=ne.current;if(!ft||$.current==null||!yt||!jt)return;const{onDragOver:Tt}=K.current,un=Rt.get(Ae),Ht=un&&un.rect.current?{id:un.id,rect:un.rect.current,data:un.data,disabled:un.disabled}:null,Je={active:ft,activatorEvent:yt,collisions:Ke,delta:{x:jt.x,y:jt.y},over:Ht};pr.unstable_batchedUpdates(()=>{$e(Ht),Tt==null||Tt(Je),R({type:"onDragOver",event:Je})})},[Ae]),oa(()=>{ne.current={activatorEvent:z,active:q,activeNode:te,collisionRect:ee,collisions:de,droppableRects:I,draggableNodes:L,draggingNode:Le,draggingNodeRect:Oe,droppableContainers:F,over:He,scrollableAncestors:Se,scrollAdjustedTranslate:Ce},j.current={initial:Oe,translated:ee}},[q,te,de,ee,L,Le,Oe,I,F,He,Se,Ce]),WZ({...pe,delta:H,draggingRect:ee,pointerCoordinates:qe,scrollableAncestors:Se,scrollableAncestorRects:ve});const gt=v.useMemo(()=>({active:q,activeNode:te,activeNodeRect:Me,activatorEvent:z,collisions:de,containerNodeRect:Pe,dragOverlay:ye,draggableNodes:L,droppableContainers:F,droppableRects:I,over:He,measureDroppableContainers:Q,scrollableAncestors:Se,scrollableAncestorRects:ve,measuringConfiguration:G,measuringScheduled:Z,windowRect:J}),[q,te,Me,z,de,Pe,ye,L,F,I,He,Q,Se,ve,G,Z,J]),Ot=v.useMemo(()=>({activatorEvent:z,activators:zt,active:q,activeNodeRect:Me,ariaDescribedById:{draggable:P},dispatch:S,draggableNodes:L,over:He,measureDroppableContainers:Q}),[z,zt,q,Me,S,P,L,He,Q]);return Fe.createElement(JD.Provider,{value:k},Fe.createElement(Rm.Provider,{value:Ot},Fe.createElement(g2.Provider,{value:gt},Fe.createElement(y2.Provider,{value:ze},d)),Fe.createElement(gJ,{disabled:(c==null?void 0:c.restoreFocus)===!1})),Fe.createElement(xZ,{...c,hiddenTextDescribedById:P}));function it(){const ft=(B==null?void 0:B.autoScrollEnabled)===!1,yt=typeof f=="object"?f.enabled===!1:f===!1,Ke=O&&!ft&&!yt;return typeof f=="object"?{...f,enabled:Ke}:{enabled:Ke}}}),xJ=v.createContext(null),Uk="button",wJ="Draggable";function SJ(e){let{id:t,data:n,disabled:r=!1,attributes:a}=e;const o=ef(wJ),{activators:l,activatorEvent:c,active:f,activeNodeRect:d,ariaDescribedById:m,draggableNodes:h,over:y}=v.useContext(Rm),{role:g=Uk,roleDescription:w="draggable",tabIndex:C=0}=a??{},T=(f==null?void 0:f.id)===t,S=v.useContext(T?y2:xJ),[R,k]=Lp(),[M,D]=Lp(),O=oJ(l,t),A=Td(n);oa(()=>(h.set(t,{id:t,key:o,node:R,activatorNode:M,data:A}),()=>{const H=h.get(t);H&&H.key===o&&h.delete(t)}),[h,t]);const L=v.useMemo(()=>({role:g,tabIndex:C,"aria-disabled":r,"aria-pressed":T&&g===Uk?!0:void 0,"aria-roledescription":w,"aria-describedby":m.draggable}),[r,g,C,T,w,m.draggable]);return{active:f,activatorEvent:c,activeNodeRect:d,attributes:L,isDragging:T,listeners:r?void 0:O,node:R,over:y,setNodeRef:k,setActivatorNodeRef:D,transform:S}}function EJ(){return v.useContext(g2)}const CJ="Droppable",TJ={timeout:25};function RJ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:a}=e;const o=ef(CJ),{active:l,dispatch:c,over:f,measureDroppableContainers:d}=v.useContext(Rm),m=v.useRef({disabled:n}),h=v.useRef(!1),y=v.useRef(null),g=v.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:T}={...TJ,...a},S=Td(C??r),R=v.useCallback(()=>{if(!h.current){h.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(S.current)?S.current:[S.current]),g.current=null},T)},[T]),k=Tm({callback:R,disabled:w||!l}),M=v.useCallback((L,H)=>{k&&(H&&(k.unobserve(H),h.current=!1),L&&k.observe(L))},[k]),[D,O]=Lp(M),A=Td(t);return v.useEffect(()=>{!k||!D.current||(k.disconnect(),h.current=!1,k.observe(D.current))},[D,k]),v.useEffect(()=>(c({type:Jn.RegisterDroppable,element:{id:r,key:o,disabled:n,node:D,rect:y,data:A}}),()=>c({type:Jn.UnregisterDroppable,key:o,id:r})),[r]),v.useEffect(()=>{n!==m.current.disabled&&(c({type:Jn.SetDroppableDisabled,id:r,key:o,disabled:n}),m.current.disabled=n)},[r,o,n,c]),{active:l,rect:y,isOver:(f==null?void 0:f.id)===r,node:D,over:f,setNodeRef:O}}function tf(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function kJ(e,t){return e.reduce((n,r,a)=>{const o=t.get(r);return o&&(n[a]=o),n},Array(e.length))}function Uh(e){return e!==null&&e>=0}function MJ(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function OJ(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const b2=e=>{let{rects:t,activeIndex:n,overIndex:r,index:a}=e;const o=tf(t,r,n),l=t[a],c=o[a];return!c||!l?null:{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}},Vh={scaleX:1,scaleY:1},h0=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:a,rects:o,overIndex:l}=e;const c=(t=o[n])!=null?t:r;if(!c)return null;if(a===n){const d=o[l];return d?{x:0,y:n<l?d.top+d.height-(c.top+c.height):d.top-c.top,...Vh}:null}const f=AJ(o,a,n);return a>n&&a<=l?{x:0,y:-c.height-f,...Vh}:a<n&&a>=l?{x:0,y:c.height+f,...Vh}:{x:0,y:0,...Vh}};function AJ(e,t,n){const r=e[t],a=e[t-1],o=e[t+1];return r?n<t?a?r.top-(a.top+a.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):a?r.top-(a.top+a.height):0:0}const v2="Sortable",x2=Fe.createContext({activeIndex:-1,containerId:v2,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:b2,disabled:{draggable:!1,droppable:!1}});function p0(e){let{children:t,id:n,items:r,strategy:a=b2,disabled:o=!1}=e;const{active:l,dragOverlay:c,droppableRects:f,over:d,measureDroppableContainers:m}=EJ(),h=ef(v2,n),y=c.rect!==null,g=v.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),w=l!=null,C=l?g.indexOf(l.id):-1,T=d?g.indexOf(d.id):-1,S=v.useRef(g),R=!MJ(g,S.current),k=T!==-1&&C===-1||R,M=OJ(o);oa(()=>{R&&w&&m(g)},[R,g,w,m]),v.useEffect(()=>{S.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:h,disabled:M,disableTransforms:k,items:g,overIndex:T,useDragOverlay:y,sortedRects:kJ(g,f),strategy:a}),[C,h,M.draggable,M.droppable,k,g,T,f,y,a]);return Fe.createElement(x2.Provider,{value:D},t)}const NJ=e=>{let{id:t,items:n,activeIndex:r,overIndex:a}=e;return tf(n,r,a).indexOf(t)},DJ=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:a,items:o,newIndex:l,previousItems:c,previousContainerId:f,transition:d}=e;return!d||!r||c!==o&&a===l?!1:n?!0:l!==a&&t===f},IJ={duration:200,easing:"ease"},w2="transform",PJ=Qs.Transition.toString({property:w2,duration:0,easing:"linear"}),LJ={roleDescription:"sortable"};function jJ(e){let{disabled:t,index:n,node:r,rect:a}=e;const[o,l]=v.useState(null),c=v.useRef(n);return oa(()=>{if(!t&&n!==c.current&&r.current){const f=a.current;if(f){const d=zc(r.current,{ignoreTransform:!0}),m={x:f.left-d.left,y:f.top-d.top,scaleX:f.width/d.width,scaleY:f.height/d.height};(m.x||m.y)&&l(m)}}n!==c.current&&(c.current=n)},[t,n,r,a]),v.useEffect(()=>{o&&l(null)},[o]),o}function m0(e){let{animateLayoutChanges:t=DJ,attributes:n,disabled:r,data:a,getNewIndex:o=NJ,id:l,strategy:c,resizeObserverConfig:f,transition:d=IJ}=e;const{items:m,containerId:h,activeIndex:y,disabled:g,disableTransforms:w,sortedRects:C,overIndex:T,useDragOverlay:S,strategy:R}=v.useContext(x2),k=_J(r,g),M=m.indexOf(l),D=v.useMemo(()=>({sortable:{containerId:h,index:M,items:m},...a}),[h,a,M,m]),O=v.useMemo(()=>m.slice(m.indexOf(l)),[m,l]),{rect:A,node:L,isOver:H,setNodeRef:F}=RJ({id:l,data:D,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...f}}),{active:W,activatorEvent:j,activeNodeRect:q,attributes:$,setNodeRef:B,listeners:_,isDragging:z,over:U,setActivatorNodeRef:K,transform:P}=SJ({id:l,data:D,attributes:{...LJ,...n},disabled:k.draggable}),V=sZ(F,B),G=!!W,I=G&&!w&&Uh(y)&&Uh(T),Q=!S&&z,Z=Q&&I?P:null,le=I?Z??(c??R)({rects:C,activeNodeRect:q,activeIndex:y,overIndex:T,index:M}):null,pe=Uh(y)&&Uh(T)?o({id:l,items:m,activeIndex:y,overIndex:T}):M,we=W==null?void 0:W.id,Me=v.useRef({activeId:we,items:m,newIndex:pe,containerId:h}),Pe=m!==Me.current.items,ne=t({active:W,containerId:h,isDragging:z,isSorting:G,id:l,index:M,items:m,newIndex:Me.current.newIndex,previousItems:Me.current.items,previousContainerId:Me.current.containerId,transition:d,wasDragging:Me.current.activeId!=null}),fe=jJ({disabled:!ne,index:M,node:L,rect:A});return v.useEffect(()=>{G&&Me.current.newIndex!==pe&&(Me.current.newIndex=pe),h!==Me.current.containerId&&(Me.current.containerId=h),m!==Me.current.items&&(Me.current.items=m)},[G,pe,h,m]),v.useEffect(()=>{if(we===Me.current.activeId)return;if(we!=null&&Me.current.activeId==null){Me.current.activeId=we;return}const Le=setTimeout(()=>{Me.current.activeId=we},50);return()=>clearTimeout(Le)},[we]),{active:W,activeIndex:y,attributes:$,data:D,rect:A,index:M,newIndex:pe,items:m,isOver:H,isSorting:G,isDragging:z,listeners:_,node:L,overIndex:T,over:U,setNodeRef:V,setActivatorNodeRef:K,setDroppableNodeRef:F,setDraggableNodeRef:B,transform:fe??le,transition:ye()};function ye(){if(fe||Pe&&Me.current.newIndex===M)return PJ;if(!(Q&&!s0(j)||!d)&&(G||ne))return Qs.Transition.toString({...d,property:w2})}}function _J(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function zp(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const zJ=[rn.Down,rn.Right,rn.Up,rn.Left],FJ=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:a,droppableContainers:o,over:l,scrollableAncestors:c}}=t;if(zJ.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];o.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const y=a.get(h.id);if(y)switch(e.code){case rn.Down:r.top<y.top&&f.push(h);break;case rn.Up:r.top>y.top&&f.push(h);break;case rn.Left:r.left>y.left&&f.push(h);break;case rn.Right:r.left<y.left&&f.push(h);break}});const d=EZ({collisionRect:r,droppableRects:a,droppableContainers:f});let m=n2(d,"id");if(m===(l==null?void 0:l.id)&&d.length>1&&(m=d[1].id),m!=null){const h=o.get(n.id),y=o.get(m),g=y?a.get(y.id):null,w=y==null?void 0:y.node.current;if(w&&g&&h&&y){const T=Cm(w).some((O,A)=>c[A]!==O),S=S2(h,y),R=BJ(h,y),k=T||!S?{x:0,y:0}:{x:R?r.width-g.width:0,y:R?r.height-g.height:0},M={x:g.left,y:g.top};return k.x&&k.y?M:Rd(M,k)}}}};function S2(e,t){return!zp(e)||!zp(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function BJ(e,t){return!zp(e)||!zp(t)||!S2(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function wee(e){return e}function E2(e){return encodeURIComponent(e)}function C2({status:e}){return E.jsx("span",{className:je("size-2 shrink-0 rounded-full",e==="running"?"bg-emerald-500 animate-pulse":e==="error"?"bg-destructive":e==="waiting_confirmation"?"bg-amber-500":"bg-muted-foreground/40")})}function g0(){return wZ(Vb(f2,{activationConstraint:{distance:8}}),Vb(h2,{activationConstraint:{delay:250,tolerance:5}}),Vb(u0,{coordinateGetter:FJ}))}function HJ(){const{t:e}=Sn(),t=sa(),n=Ix(),{isMobile:r,setOpenMobile:a}=Ti(),{toggleDevice:o}=mF(),l=ln(ee=>ee.sessions),c=ln(ee=>ee.activeSessionId),f=ra(ee=>ee.setSidebarTab);v.useEffect(()=>{const ee=ln.getState();ee.ensureInitialized(),ee.loadSessions()},[]);const d=hc("/devices/:deviceId/windows/:windowId/panes/:paneId",t.pathname),m=d==null?void 0:d.params.deviceId,h=d==null?void 0:d.params.windowId,y=d==null?void 0:d.params.paneId,g=qn(ee=>ee.snapshots),w=qn(ee=>ee.connectedDevices),C=qn(ee=>ee.closeWindow),T=qn(ee=>ee.closePane),S=qn(ee=>ee.renameWindow),R=Vs(ee=>{var de;return((de=ee.settings)==null?void 0:de.language)??"en_US"}),{data:k}=Vo({queryKey:["devices"],queryFn:async()=>{const ee=await fetch("/api/devices");if(!ee.ok)throw new Error("Failed to fetch devices");return ee.json()},throwOnError:!1}),M=qn(ee=>ee.hydrateDeviceErrors);v.useEffect(()=>{k!=null&&k.devices&&M(k.devices.map(ee=>({deviceId:ee.id,lastError:ee.lastError??null,lastErrorType:ee.lastErrorType??null})))},[k,M]);const D=v.useCallback((ee,de)=>{n(ee,{replace:(de==null?void 0:de.replace)??!0}),r&&!(de!=null&&de.keepSidebarOpen)&&a(!1)},[n,r,a]),O=v.useCallback((ee,de,Ae,He)=>{F.current=null,window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:ee,windowId:de,paneId:Ae}})),D(`/devices/${ee}/windows/${de}/panes/${E2(Ae)}`,{keepSidebarOpen:He==null?void 0:He.keepSidebarOpen})},[D]),A=v.useCallback(ee=>{var de,Ae;if(ln.getState().setActiveSession(ee.id),f("agent"),ee.deviceId&&ee.paneId){const He=(Ae=(de=qn.getState().snapshots[ee.deviceId])==null?void 0:de.session)==null?void 0:Ae.windows,$e=He==null?void 0:He.find(et=>et.panes.some(ze=>ze.id===ee.paneId));$e&&O(ee.deviceId,$e.id,ee.paneId,{keepSidebarOpen:!0})}},[f,O]),L=v.useCallback((ee,de,Ae)=>{O(ee,de,Ae.id,{keepSidebarOpen:!0}),ln.getState().startDraft(ee,Ae.id,Ae.title??null),f("agent")},[O,f]),H=qn(ee=>ee.selectWindow),F=v.useRef(null);v.useEffect(()=>{var Ze,tt;const ee=F.current;if(!ee)return;if(Date.now()-ee.at>5e3){F.current=null;return}const{deviceId:de,windowId:Ae}=ee,He=g[de],$e=(Ze=He==null?void 0:He.session)==null?void 0:Ze.windows;if(!$e)return;const et=$e.find(Ct=>Ct.id===Ae);if(!((tt=et==null?void 0:et.panes)!=null&&tt.length))return;F.current=null;const ze=et.panes.find(Ct=>Ct.active)??et.panes[0];O(de,Ae,ze.id)},[g,O]);const W=v.useCallback((ee,de,Ae)=>{H(ee,de);const He=Ae.find($e=>$e.active)??Ae[0];He?(O(ee,de,He.id),F.current=null):F.current={deviceId:ee,windowId:de,at:Date.now()}},[O,H]),j=v.useCallback((ee,de)=>{de?ee===m&&D("/devices"):D(`/devices/${ee}`),o(ee,de)},[o,m,D]),q=v.useCallback((ee,de)=>{ee===m&&de===h&&D("/devices"),C(ee,de)},[C,m,h,D]),[$,B]=v.useState(null),_=v.useCallback((ee,de)=>{var $e,et;const Ae=(et=($e=qn.getState().snapshots[ee])==null?void 0:$e.session)==null?void 0:et.windows,He=Ae==null?void 0:Ae.find(ze=>ze.id===de);B({kind:"window",deviceId:ee,windowId:de,name:He?IU(He):""})},[]),z=v.useCallback((ee,de,Ae)=>{var et,ze,Ze,tt;const He=(ze=(et=qn.getState().snapshots[ee])==null?void 0:et.session)==null?void 0:ze.windows,$e=(tt=(Ze=He==null?void 0:He.find(Ct=>Ct.id===de))==null?void 0:Ze.panes)==null?void 0:tt.find(Ct=>Ct.id===Ae);B({kind:"pane",deviceId:ee,paneId:Ae,name:($e==null?void 0:$e.title)||`Pane ${($e==null?void 0:$e.index)??""}`})},[]),U=v.useCallback(()=>{$&&($.kind==="window"?q($.deviceId,$.windowId):T($.deviceId,$.paneId),B(null))},[$,q,T]),[K,P]=v.useState(null),[V,G]=v.useState(""),I=v.useCallback((ee,de)=>{var $e,et;const Ae=(et=($e=qn.getState().snapshots[ee])==null?void 0:$e.session)==null?void 0:et.windows,He=Ae==null?void 0:Ae.find(ze=>ze.id===de);He&&(G(He.customName??ew(He).title),P({deviceId:ee,windowId:de,hasCustomName:!!He.customName}))},[]),Q=v.useCallback(()=>{if(!K)return;const ee=V.trim();ee&&(S(K.deviceId,K.windowId,ee),P(null))},[K,V,S]),Z=v.useCallback(()=>{K&&(S(K.deviceId,K.windowId,""),P(null))},[K,S]),te=v.useCallback(ee=>{qn.getState().createWindow(ee)},[]),[le,pe]=v.useState(null),we=v.useCallback((ee,de)=>{pe({deviceId:ee,paneId:de})},[]),[Me,Pe]=v.useState(null),[ne,fe]=v.useState(""),[ye,Le]=v.useState(null),Oe=v.useCallback(ee=>{fe(ee.title),Pe(ee)},[]),Ee=v.useCallback(()=>{if(!Me)return;const ee=ne.trim();ee&&(ln.getState().renameSession(Me.id,ee),Pe(null))},[Me,ne]),Te=v.useCallback(ee=>{Le(ee)},[]),J=v.useCallback(()=>{ye&&(ln.getState().deleteSession(ye.id),Le(null))},[ye]),Se=Pd(),ve=g0(),Be=hd({mutationFn:async ee=>{const de=await fetch("/api/devices/order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceIds:ee})});if(!de.ok)throw new Error("Failed to reorder devices");return de.json()},onMutate:async ee=>{await Se.cancelQueries({queryKey:["devices"]});const de=Se.getQueryData(["devices"]);if(de){const Ae=new Map(de.devices.map(et=>[et.id,et])),He=ee.map((et,ze)=>{const Ze=Ae.get(et);return Ze?{...Ze,sortOrder:ze}:void 0}).filter(et=>et!==void 0),$e=de.devices.filter(et=>!ee.includes(et.id));Se.setQueryData(["devices"],{devices:[...He,...$e]})}return{previous:de}},onError:(ee,de,Ae)=>{Ae!=null&&Ae.previous&&Se.setQueryData(["devices"],Ae.previous),mn.error(e("device.reorderFailed"))},onSettled:()=>{Se.invalidateQueries({queryKey:["devices"]})}}),qe=(k==null?void 0:k.devices)??[],De=v.useMemo(()=>[...qe].sort((ee,de)=>ee.sortOrder-de.sortOrder||ee.name.localeCompare(de.name,JM(R),{numeric:!0,sensitivity:"base"})),[qe,R]),ut=v.useCallback(ee=>{const{active:de,over:Ae}=ee;if(!Ae||de.id===Ae.id)return;const He=De.map(ze=>ze.id),$e=He.indexOf(String(de.id)),et=He.indexOf(String(Ae.id));$e<0||et<0||Be.mutate(tf(He,$e,et))},[De,Be]),{sessionsByPane:he,orphanSessions:Ce}=v.useMemo(()=>{const ee=new Set(qe.map($e=>$e.id)),de=new Map,Ae=[],He=Object.values(l).filter($e=>!!$e).sort(($e,et)=>$e.updatedAt<et.updatedAt?1:-1);for(const $e of He){if(!$e.deviceId||!$e.paneId||!ee.has($e.deviceId)){Ae.push($e);continue}const et=`${$e.deviceId}:${$e.paneId}`,ze=de.get(et);ze?ze.push($e):de.set(et,[$e])}return{sessionsByPane:de,orphanSessions:Ae}},[l,qe]);return E.jsxs(DD,{className:"flex flex-col flex-1 min-h-0 pt-0",children:[E.jsx(f0,{sensors:ve,collisionDetection:l0,onDragEnd:ut,children:E.jsx(GQ,{className:"flex-1 min-h-0",children:E.jsxs("div",{className:"space-y-1.5 pb-2 pt-1",children:[E.jsx(p0,{items:De.map(ee=>ee.id),strategy:h0,children:De.map(ee=>{var de,Ae;return E.jsx(UJ,{device:ee,windows:((Ae=(de=g[ee.id])==null?void 0:de.session)==null?void 0:Ae.windows)??null,isConnected:w.has(ee.id),isSelected:ee.id===m,selectedWindowId:h,selectedPaneId:y,onConnectToggle:()=>j(ee.id,w.has(ee.id)),onCreateWindow:te,onCloseWindow:_,onClosePane:z,onRenameWindow:I,onPaneClick:O,onWindowClick:W,onWatchPane:we,sessionsByPane:he,activeSessionId:c,onSelectSession:A,onCreateSessionForPane:L,onRenameSession:Oe,onDeleteSession:Te},ee.id)})}),De.length===0&&E.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:e("sidebar.noDevices")}),Ce.length>0&&E.jsx($J,{sessions:Ce,activeSessionId:c,onSelectSession:A,onRenameSession:Oe,onDeleteSession:Te})]})})}),E.jsx(ex,{open:$!==null,onOpenChange:ee=>!ee&&B(null),children:E.jsxs(tx,{children:[E.jsxs(nx,{children:[E.jsx(Sk,{className:"bg-destructive/10",children:E.jsx(Ua,{className:"h-5 w-5 text-destructive"})}),E.jsx(ix,{children:($==null?void 0:$.kind)==="pane"?e("window.closePaneConfirmTitle"):e("window.closeConfirmTitle")}),E.jsx(ax,{children:e("window.closeConfirmDesc",{name:($==null?void 0:$.name)??""})})]}),E.jsxs(rx,{children:[E.jsx(sx,{children:e("common.cancel")}),E.jsx(ox,{variant:"destructive",disabled:!$,onClick:U,children:e("common.close")})]})]})}),E.jsx(lx,{open:K!==null,onOpenChange:ee=>!ee&&P(null),children:E.jsx(cx,{"data-testid":"window-rename-dialog",children:E.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Q()},children:[E.jsxs(ux,{children:[E.jsx(dx,{children:e("window.rename")}),E.jsx(FD,{children:e("window.renameDesc")})]}),E.jsx("div",{className:"py-4",children:E.jsx(Ii,{autoFocus:!0,maxLength:64,value:V,onChange:ee=>G(ee.target.value),placeholder:e("window.renamePlaceholder"),"data-testid":"window-rename-input"})}),E.jsxs(Ek,{children:[(K==null?void 0:K.hasCustomName)&&E.jsx(qt,{type:"button",variant:"ghost",onClick:Z,"data-testid":"window-rename-reset",children:e("window.renameReset")}),E.jsx(qt,{type:"button",variant:"outline",onClick:()=>P(null),children:e("common.cancel")}),E.jsx(qt,{type:"submit",disabled:!V.trim(),"data-testid":"window-rename-save",children:e("common.save")})]})]})})}),E.jsx(lx,{open:Me!==null,onOpenChange:ee=>!ee&&Pe(null),children:E.jsx(cx,{"data-testid":"agent-session-rename-dialog",children:E.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Ee()},children:[E.jsx(ux,{children:E.jsx(dx,{children:e("agent.session.renameTitle")})}),E.jsx("div",{className:"py-4",children:E.jsx(Ii,{autoFocus:!0,maxLength:120,value:ne,onChange:ee=>fe(ee.target.value),placeholder:e("agent.session.renamePlaceholder"),"data-testid":"agent-session-rename-input"})}),E.jsxs(Ek,{children:[E.jsx(qt,{type:"button",variant:"outline",onClick:()=>Pe(null),children:e("agent.session.cancel")}),E.jsx(qt,{type:"submit",disabled:!ne.trim(),"data-testid":"agent-session-rename-save",children:e("agent.session.save")})]})]})})}),E.jsx(ex,{open:ye!==null,onOpenChange:ee=>!ee&&Le(null),children:E.jsxs(tx,{children:[E.jsxs(nx,{children:[E.jsx(Sk,{className:"bg-destructive/10",children:E.jsx(Ua,{className:"h-5 w-5 text-destructive"})}),E.jsx(ix,{children:e("agent.session.deleteTitle")}),E.jsx(ax,{children:e("agent.session.deleteDesc",{title:(ye==null?void 0:ye.title)??""})})]}),E.jsxs(rx,{children:[E.jsx(sx,{children:e("common.cancel")}),E.jsx(ox,{variant:"destructive",disabled:!ye,onClick:J,"data-testid":"agent-session-delete-confirm",children:e("agent.session.deleteConfirm")})]})]})}),le&&E.jsx(iZ,{open:!0,onOpenChange:ee=>!ee&&pe(null),deviceId:le.deviceId,paneId:le.paneId})]})}function UJ({device:e,windows:t,isConnected:n,isSelected:r,selectedWindowId:a,selectedPaneId:o,onConnectToggle:l,onCreateWindow:c,onCloseWindow:f,onClosePane:d,onRenameWindow:m,onPaneClick:h,onWindowClick:y,onWatchPane:g,sessionsByPane:w,activeSessionId:C,onSelectSession:T,onCreateSessionForPane:S,onRenameSession:R,onDeleteSession:k}){const{t:M}=Sn(),D=e.type==="local"?Vx:dO,{attributes:O,listeners:A,setNodeRef:L,setActivatorNodeRef:H,transform:F,transition:W,isDragging:j}=m0({id:e.id}),q=g0(),$=B=>{const{active:_,over:z}=B;if(!z||_.id===z.id||!t)return;const U=t.map(V=>V.id),K=U.indexOf(String(_.id)),P=U.indexOf(String(z.id));K<0||P<0||qn.getState().reorderWindows(e.id,tf(U,K,P))};return E.jsxs("div",{ref:L,style:{transform:Qs.Translate.toString(F),transition:W},"data-testid":`device-item-${e.id}`,className:je("group/device rounded-xl border border-border/60 overflow-hidden text-select-none",r?"bg-card":n?"bg-muted/40":"bg-muted/20",j&&"opacity-60 shadow-lg"),onClick:n?void 0:l,children:[E.jsxs("div",{className:"relative px-3 py-1.5",children:[r&&E.jsx("span",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-muted-foreground/70"}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("button",{type:"button",ref:H,...O,...A,"aria-label":M("device.dragHandle"),onClick:B=>B.stopPropagation(),className:"touch-none cursor-grab shrink-0 -ml-1 text-muted-foreground/50 hover:text-muted-foreground opacity-0 group-hover/device:opacity-100 [@media(any-pointer:coarse)]:opacity-100",children:E.jsx(Ux,{className:"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-5 [@media(any-pointer:coarse)]:w-5"})}),E.jsx(D,{className:"h-4 w-4 text-muted-foreground shrink-0"}),E.jsx("span",{className:"flex-1 truncate text-xs font-medium text-select-none",children:e.name}),E.jsx(oQ,{deviceId:e.id,className:"shrink-0"}),E.jsx("div",{className:je("h-2 w-2 rounded-full shrink-0",n?"bg-emerald-500":"bg-gray-400")}),E.jsx(qt,{variant:"ghost",size:"icon-xs",onClick:B=>{B.stopPropagation(),l()},"data-testid":n?`device-disconnect-${e.id}`:`device-connect-${e.id}`,title:M(n?"device.disconnect":"device.connect"),children:n?E.jsx(hB,{className:"h-3.5 w-3.5 text-orange-500"}):E.jsx(mB,{className:"h-3.5 w-3.5 text-emerald-500"})})]})]}),n&&E.jsxs("div",{className:"p-1.5 space-y-1.5 [@media(any-pointer:coarse)]:space-y-2",children:[!t&&E.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("device.connecting")}),(t==null?void 0:t.length)===0&&E.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("window.noWindows")}),t&&t.length>0&&E.jsx(f0,{sensors:q,collisionDetection:l0,onDragEnd:$,children:E.jsx(p0,{items:t.map(B=>B.id),strategy:h0,children:t.map(B=>E.jsx(VJ,{deviceId:e.id,window:B,isSelected:B.id===a,selectedPaneId:o,onPaneClick:h,onWindowClick:y,onCloseWindow:f,onClosePane:d,onRenameWindow:m,onWatchPane:g,sessionsByPane:w,activeSessionId:C,onSelectSession:T,onCreateSessionForPane:S,onRenameSession:R,onDeleteSession:k},B.id))})}),E.jsxs("button",{type:"button","data-testid":`window-create-${e.id}`,onPointerDown:B=>B.stopPropagation(),onMouseDown:B=>B.stopPropagation(),onClick:()=>c(e.id),className:"w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors text-muted-foreground hover:text-foreground hover:bg-accent/30 border border-dashed border-border/50 hover:border-border",children:[E.jsx(Yp,{className:"h-3.5 w-3.5 shrink-0"}),E.jsx("span",{className:"text-xs",children:M("window.new")})]})]})]})}function VJ({deviceId:e,window:t,isSelected:n,selectedPaneId:r,onPaneClick:a,onWindowClick:o,onCloseWindow:l,onClosePane:c,onRenameWindow:f,onWatchPane:d,sessionsByPane:m,activeSessionId:h,onSelectSession:y,onCreateSessionForPane:g,onRenameSession:w,onDeleteSession:C}){const{t:T}=Sn(),{isMobile:S}=Ti(),R=t.panes.length>1,k=ew(t),M=t.panes.find(B=>B.id===r),D=n&&!!M,{attributes:O,listeners:A,setNodeRef:L,setActivatorNodeRef:H,transform:F,transition:W,isDragging:j}=m0({id:t.id}),q=g0(),$=B=>{const{active:_,over:z}=B;if(!z||_.id===z.id)return;const U=t.panes.map(V=>V.id),K=U.indexOf(String(_.id)),P=U.indexOf(String(z.id));K<0||P<0||qn.getState().reorderPanes(e,t.id,tf(U,K,P))};return E.jsxs("div",{ref:L,style:{transform:Qs.Translate.toString(F),transition:W},className:je("space-y-1",j&&"opacity-60"),children:[E.jsxs("div",{className:"group relative flex items-center gap-1",children:[E.jsx("button",{type:"button",ref:H,...O,...A,"aria-label":T("window.dragHandle"),onClick:B=>B.stopPropagation(),className:je("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100",S?"h-9 w-4":"h-6 w-3.5 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:E.jsx(Ux,{className:je(S?"h-4 w-4":"h-3.5 w-3.5")})}),E.jsxs("button",{type:"button",onClick:()=>o(e,t.id,t.panes),"data-testid":`window-item-${t.id}`,className:je("flex-1 min-w-0 flex items-center gap-2 px-2 py-1.5 rounded-lg text-left transition-colors pr-7 [@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:pr-12",S&&"py-2.5 pr-13",D?"bg-primary/10 text-primary":t.active?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"),children:[E.jsx(Ks,{variant:D?"default":"outline",className:"h-5 text-[10px] px-1.5 shrink-0",children:t.index}),E.jsxs("span",{className:"flex-1 min-w-0",children:[E.jsx("span",{className:"font-mono text-[11px] leading-tight font-medium line-clamp-2 [overflow-wrap:break-word]",children:k.title}),k.processName&&E.jsx("span",{className:"font-mono text-[10.5px] leading-tight text-muted-foreground line-clamp-1 break-all",children:k.processName})]})]}),E.jsxs(e0,{children:[E.jsx(t0,{"data-testid":`window-menu-${t.id}`,"aria-label":T("window.menu"),title:T("window.menu"),className:je("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity data-popup-open:opacity-100",S?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",D?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:E.jsx(uO,{className:je(S?"h-5 w-5":"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-4.5 [@media(any-pointer:coarse)]:w-4.5")})}),E.jsxs(n0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[E.jsxs(Jl,{"data-testid":`window-menu-rename-${t.id}`,className:je("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",S&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>f(e,t.id),children:[E.jsx($p,{className:je("h-4 w-4",S&&"h-5 w-5")}),T("window.rename")]}),E.jsxs(Jl,{"data-testid":`window-menu-new-session-${t.id}`,className:je("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",S&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>g(e,t.id,M||t.panes[0]),children:[E.jsx(Yp,{className:je("h-4 w-4",S&&"h-5 w-5")}),T("agent.session.new")]}),E.jsxs(Jl,{variant:"destructive","data-testid":`window-menu-close-${t.id}`,className:je("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",S&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>l(e,t.id),children:[E.jsx(Ua,{className:je("h-4 w-4",S&&"h-5 w-5")}),T("window.close")]})]})]})]}),R&&E.jsx("div",{className:"ml-4 pl-2 border-l border-border/50 space-y-1 [@media(any-pointer:coarse)]:space-y-1.5",children:E.jsx(f0,{sensors:q,collisionDetection:l0,onDragEnd:$,children:E.jsx(p0,{items:t.panes.map(B=>B.id),strategy:h0,children:t.panes.map(B=>E.jsx(qJ,{deviceId:e,windowId:t.id,pane:B,isActive:B.id===r,isMobile:S,onPaneClick:a,onClosePane:c,onWatchPane:d,sessions:m.get(`${e}:${B.id}`),activeSessionId:h,onSelectSession:y,onRenameSession:w,onDeleteSession:C},B.id))})})}),!R&&t.panes[0]&&E.jsx("div",{className:"ml-[36px] pl-2 border-l border-border/50",children:E.jsx(R2,{sessions:m.get(`${e}:${t.panes[0].id}`),activeSessionId:h,onSelectSession:y,onRenameSession:w,onDeleteSession:C})})]})}function qJ({deviceId:e,windowId:t,pane:n,isActive:r,isMobile:a,onPaneClick:o,onClosePane:l,onWatchPane:c,sessions:f,activeSessionId:d,onSelectSession:m,onRenameSession:h,onDeleteSession:y}){const{t:g}=Sn(),{attributes:w,listeners:C,setNodeRef:T,setActivatorNodeRef:S,transform:R,transition:k,isDragging:M}=m0({id:n.id});return E.jsxs("div",{ref:T,style:{transform:Qs.Translate.toString(R),transition:k},className:je("group relative",M&&"opacity-60"),children:[E.jsxs("div",{className:"flex items-center gap-1",children:[E.jsx("button",{type:"button",ref:S,...w,...C,"aria-label":g("window.dragHandlePane"),onClick:D=>D.stopPropagation(),className:je("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100",a?"h-9 w-4":"h-6 w-3 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:E.jsx(Ux,{className:je(a?"h-4 w-4":"h-3 w-3")})}),E.jsxs("button",{type:"button",onClick:()=>o(e,t,n.id),"data-testid":`pane-item-${n.id}`,className:je("flex-1 min-w-0 flex items-center gap-2 px-2 py-1 rounded-lg text-left transition-colors pr-13 [@media(any-pointer:coarse)]:py-2 [@media(any-pointer:coarse)]:pr-21",a&&"py-2.5 pr-24",r?"bg-primary/10 text-primary":n.active?"bg-accent text-accent-foreground":"hover:bg-accent/30 text-muted-foreground"),children:[E.jsx("span",{className:"text-[10px] font-mono opacity-60 w-4",children:n.index}),E.jsx("span",{className:"flex-1 text-xs line-clamp-2 break-all",children:n.title||`Pane ${n.index}`})]})]}),E.jsxs(e0,{children:[E.jsx(t0,{"data-testid":`pane-menu-${n.id}`,"aria-label":g("watch.openMonitor"),className:je("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity data-popup-open:opacity-100",a?"h-11 w-11 right-11 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-7 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-10.5 [@media(any-pointer:coarse)]:rounded-lg",r?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:E.jsx(uO,{className:je(a?"h-5 w-5":"h-3.5 w-3.5")})}),E.jsx(n0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:E.jsxs(Jl,{"data-testid":`pane-watch-${n.id}`,className:je("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",a&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>c(e,n.id),children:[E.jsx(yB,{className:je("h-4 w-4",a&&"h-5 w-5")}),g("watch.openMonitor")]})})]}),E.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),l(e,t,n.id)},"data-testid":`pane-close-${n.id}`,className:je("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity",a?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",r?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),title:g("window.closePane"),children:E.jsx("span",{className:je("leading-none",a?"text-base":"text-xs"),children:"×"})}),E.jsx(R2,{sessions:f,activeSessionId:d,onSelectSession:m,onRenameSession:h,onDeleteSession:y})]})}function T2({session:e,onRenameSession:t,onDeleteSession:n,className:r,enlargeOnTouch:a=!1}){const{t:o}=Sn(),{isMobile:l}=Ti(),c=a&&l;return E.jsxs(e0,{children:[E.jsx(t0,{render:E.jsx(qt,{variant:"ghost",size:"icon-sm","data-testid":`agent-session-menu-${e.id}`,"aria-label":o("agent.session.rename"),onClick:f=>f.stopPropagation(),className:je("size-5 shrink-0 text-muted-foreground transition-opacity data-popup-open:opacity-100",l?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100",c&&"size-9",r)}),children:E.jsx(HF,{className:je("size-3.5",c&&"size-5")})}),E.jsxs(n0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[E.jsxs(Jl,{"data-testid":"agent-session-rename",className:je("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>t(e),children:[E.jsx($p,{className:je("h-4 w-4",l&&"h-5 w-5")}),o("agent.session.rename")]}),E.jsxs(Jl,{variant:"destructive","data-testid":"agent-session-delete",className:je("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>n(e),children:[E.jsx(fO,{className:je("h-4 w-4",l&&"h-5 w-5")}),o("agent.session.delete")]})]})]})}function R2({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:a}){const{isMobile:o}=Ti();return E.jsx("div",{className:"mt-1 space-y-0.5 [@media(any-pointer:coarse)]:space-y-1",children:e==null?void 0:e.map(l=>{const c=l.id===t;return E.jsxs("div",{className:"group relative",children:[E.jsxs("button",{type:"button","data-testid":`agent-session-item-${l.id}`,onClick:()=>n(l),className:je("w-full flex items-center gap-1.5 px-2 py-1 pr-7 rounded-md text-left transition-colors [@media(any-pointer:coarse)]:min-h-11 [@media(any-pointer:coarse)]:py-2 [@media(any-pointer:coarse)]:pr-12",o&&"min-h-11 py-2 pr-12",c?"bg-primary/10 text-primary":"hover:bg-accent/30 text-muted-foreground"),children:[E.jsx(Hx,{className:"size-3 shrink-0 opacity-70"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:l.title}),E.jsx(C2,{status:l.status})]}),E.jsx("div",{className:"absolute right-0.5 top-1/2 -translate-y-1/2",children:E.jsx(T2,{session:l,onRenameSession:r,onDeleteSession:a,enlargeOnTouch:!0})})]},l.id)})})}function $J({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:a}){const{t:o}=Sn(),[l,c]=v.useState(!1),f=Vs(d=>{var m;return((m=d.settings)==null?void 0:m.language)??"en_US"});return E.jsxs(cm,{open:l,onOpenChange:c,className:"rounded-xl border border-border/60 bg-muted/20",children:[E.jsxs(um,{"data-testid":"agent-orphan-sessions-trigger",className:"flex w-full items-center gap-2 px-3 py-1.5 text-left",children:[E.jsx(GF,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),E.jsx("span",{className:"flex-1 truncate text-xs font-medium text-muted-foreground",children:o("agent.orphan.title",{count:e.length})}),E.jsx(qp,{className:je("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",l&&"rotate-90")})]}),E.jsx(dm,{className:"space-y-0.5 px-1.5 pb-1.5",children:e.map(d=>{const m=d.id===t,h=[d.originPaneTitle,d.originProcessName,d.createdAt?new Date(d.createdAt).toLocaleString(JM(f)):null].filter(y=>!!y);return E.jsxs("div",{className:"group relative",children:[E.jsxs("button",{type:"button","data-testid":`agent-orphan-session-${d.id}`,onClick:()=>n(d),className:je("w-full flex flex-col gap-0.5 px-2 py-1.5 pr-7 rounded-lg text-left transition-colors",m?"bg-primary/10 text-primary":"hover:bg-accent/30"),children:[E.jsxs("span",{className:"flex items-center gap-1.5",children:[E.jsx(Hx,{className:"size-3 shrink-0 opacity-70"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:d.title}),E.jsx(C2,{status:d.status})]}),h.length>0&&E.jsx("span",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:h.join(" · ")})]}),E.jsx("div",{className:"absolute right-0.5 top-1.5",children:E.jsx(T2,{session:d,onRenameSession:r,onDeleteSession:a})})]},d.id)})})]})}function YJ(){const{t:e}=Sn(),{isMobile:t,setOpenMobile:n}=Ti(),r=Vs(m=>{var h;return(h=m.settings)==null?void 0:h.siteName}),a=Vs(m=>m.fetchSettings);v.useEffect(()=>{a()},[a]);const o=r??"tmex",l=ra(m=>m.theme),c=ra(m=>m.setTheme),f=l==="dark",d=()=>{const m=f?"light":"dark";c(m),document.documentElement.classList.toggle("dark",m==="dark")};return E.jsxs("div",{className:"flex items-center gap-2 px-2",children:[t&&E.jsx("button",{type:"button","data-testid":"mobile-sidebar-close",onClick:()=>n(!1),className:"inline-flex h-8 w-8 ml-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("nav.closeSidebar"),title:e("nav.closeSidebar"),children:E.jsx(Ua,{className:"h-4 w-4"})}),E.jsxs(Dp,{to:"/",className:"flex flex-1 items-center gap-3 overflow-hidden",children:[E.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-lg border-2 border-black",children:E.jsx("img",{src:"/logo.png",alt:o,className:"h-full w-full object-cover"})}),E.jsx("span",{className:"truncate text-sm font-semibold tracking-tight",children:o})]}),E.jsx("button",{type:"button",onClick:d,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e(f?"settings.themeLight":"settings.themeDark"),title:e(f?"settings.themeLight":"settings.themeDark"),children:f?E.jsx(AB,{className:"h-4 w-4"}):E.jsx(aB,{className:"h-4 w-4"})}),E.jsx(Dp,{to:"/settings",className:"inline-flex h-8 w-8 mr-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("sidebar.settings"),title:e("sidebar.settings"),children:E.jsx(CB,{className:"h-4 w-4"})})]})}const Wb="rounded-lg data-active:bg-background data-active:text-foreground data-active:border-transparent group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:bg-input/60 dark:data-active:border-transparent text-[13px] transition-colors duration-200 [&_svg:not([class*='size-'])]:size-[15px]",WJ=[{title:"nav.manageDevices",url:"/devices",icon:Vx}];function KJ({...e}){const{t}=Sn(),n=ra(a=>a.sidebarTab),r=ra(a=>a.setSidebarTab);return E.jsxs(OX,{variant:"inset",...e,children:[E.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),E.jsxs(IX,{className:"gap-5 pt-3 pb-0",children:[E.jsx(YJ,{}),E.jsx(tQ,{className:"mb-2.5",value:n,onValueChange:a=>r(a),children:E.jsxs(rQ,{className:"w-full p-1 rounded-xl border border-border/60 group-data-horizontal/tabs:h-11",children:[E.jsxs(Bb,{value:"panes","data-testid":"sidebar-tab-panes",className:Wb,children:[E.jsx(cB,{}),t("sidebar.tab.panes")]}),E.jsxs(Bb,{value:"agent","data-testid":"sidebar-tab-agent",className:Wb,children:[E.jsx(Hx,{}),t("sidebar.tab.agent")]}),E.jsxs(Bb,{value:"files","data-testid":"sidebar-tab-files",className:Wb,children:[E.jsx(VF,{}),t("sidebar.tab.files")]})]})})]}),E.jsxs(LX,{className:"flex min-h-0 flex-col overflow-hidden",children:[n==="panes"&&E.jsx(HJ,{}),n==="agent"&&E.jsx(jG,{}),n==="files"&&E.jsx(_G,{})]}),n==="panes"&&E.jsxs(PX,{children:[E.jsx(iQ,{items:WJ}),E.jsx("div",{className:"h-[var(--tmex-safe-area-bottom)]"})]})]})}let Vk=!1;function GJ(e,t,n){var a,o,l;let r=n;if(!r){const c=(o=(a=qn.getState().snapshots[e])==null?void 0:a.session)==null?void 0:o.windows;r=(l=c==null?void 0:c.find(f=>f.panes.some(d=>d.id===t)))==null?void 0:l.id}return r?`/devices/${e}/windows/${r}/panes/${E2(t)}`:`/devices/${e}`}function XJ(e,t){const n=e.getQueriesData({queryKey:["watch-rules"]});for(const[,r]of n){const a=r==null?void 0:r.find(o=>o.id===t);if(a)return a.name}return null}async function QJ(e,t){var r;const n=XJ(e,t);if(n)return n;try{const a=await fetch(`/api/watch/rules/${t}`);return a.ok?((r=(await a.json()).rule)==null?void 0:r.name)??null:null}catch{return null}}function ZJ(e,t,n){if(!(typeof Notification>"u"||Notification.permission!=="granted"))try{const r=new Notification(e,{body:t});r.onclick=()=>{window.focus(),window.location.href=n}}catch{}}function JJ(e,t){e.invalidateQueries({queryKey:["watch-rules"]}),e.invalidateQueries({queryKey:["watch-rule-state",t]})}async function eee(e,t,n,r,a){const l=await QJ(e,t)??En.t("watch.toast.triggeredTitle"),c=a.summary||a.matchedText||"",f=c.length>200?`${c.slice(0,200)}…`:c,d=GJ(n,r,a.windowId);mn(l,{description:f,action:{label:En.t("watch.toast.openTerminal"),onClick:()=>{window.location.href=d}}}),ZJ(l,f,d)}function tee(e){if(Vk)return;Vk=!0,Nn().onMessage(n=>{if(n.kind!==Z3)return;let r;try{r=La(a5,n.payload)}catch(o){console.error("[watch] failed to decode WATCH_EVENT:",o);return}let a;try{a=JSON.parse(new TextDecoder().decode(r.payload))}catch(o){console.error("[watch] failed to parse WATCH_EVENT payload:",o);return}switch(JJ(e,r.ruleId),r.eventType){case f4:eee(e,r.ruleId,r.deviceId,r.paneId,a);return;case h4:{const o=a;mn.warning(En.t("watch.toast.modelUnavailableTitle"),{description:`${o.message} ${En.t("watch.toast.modelUnavailableHint")}`});return}case p4:{const o=a;mn.error(En.t("watch.toast.ruleErrorTitle"),{description:o.message});return}default:return}})}function nee(){const e=Pd();return v.useEffect(()=>{tee(e),Nn().connect()},[e]),null}const ree=60,iee=.02;function aee(e){if(Math.abs(e.viewportScale-1)>iee)return 0;const t=Math.round(e.windowInnerHeight-e.viewportHeight-e.viewportOffsetTop);return t>=ree?t:0}function See(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),n=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return t||n}function oee(){return typeof window>"u"||typeof navigator>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0}function see(e){const[t,n]=v.useState(0);return v.useEffect(()=>{if(!oee())return;const r=window.visualViewport;if(!r)return;let a=null;const o=()=>{if(e){n(0);return}const c=document.activeElement;if(!(c instanceof Element&&c.closest("[data-virtual-keyboard-avoid]")!==null)){n(0);return}n(aee({windowInnerHeight:window.innerHeight,viewportHeight:r.height,viewportOffsetTop:r.offsetTop,viewportScale:r.scale}))},l=()=>{a===null&&(a=window.requestAnimationFrame(()=>{a=null,o()}))};return o(),r.addEventListener("resize",l),r.addEventListener("scroll",l),window.addEventListener("resize",l),document.addEventListener("focusin",l),document.addEventListener("focusout",l),()=>{r.removeEventListener("resize",l),r.removeEventListener("scroll",l),window.removeEventListener("resize",l),document.removeEventListener("focusin",l),document.removeEventListener("focusout",l),a!==null&&window.cancelAnimationFrame(a)}},[e]),t}function lee(){var e;try{const t=localStorage.getItem("tmex-ui");if(!t){document.documentElement.classList.add("dark");return}const n=JSON.parse(t),r=(e=n==null?void 0:n.state)==null?void 0:e.theme,a=r==="dark"||r===void 0;document.documentElement.classList.toggle("dark",a)}catch{document.documentElement.classList.add("dark")}}lee();const cee=new uL({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function uee(){const{openMobile:e}=Ti(),t=ra(n=>n.theme);return v.useEffect(()=>{const n=e?"--sidebar":"--background";document.body.style.backgroundColor=`var(${n})`,requestAnimationFrame(()=>{var o;const a=getComputedStyle(document.body).backgroundColor;(o=document.querySelector('meta[name="theme-color"]'))==null||o.setAttribute("content",a)})},[e,t]),null}function dee(){return E.jsxs(gF,{children:[E.jsx(nee,{}),E.jsxs(MX,{children:[E.jsx(uee,{}),E.jsx(KJ,{}),E.jsx(fee,{})]})]})}function fee(){const{openMobile:e}=Ti(),t=see(e);return E.jsxs(DX,{className:"h-dvh overflow-hidden md:h-[calc(100dvh-1rem)]",style:t>0?{transform:`translateY(-${t}px)`,transition:"transform 0.12s ease-out"}:void 0,children:[E.jsx(v_,{}),E.jsx("div",{style:{height:t>0?0:"var(--tmex-safe-area-bottom)",transition:"height 0.12s ease-out"}})]})}function Vu({moduleLoader:e}){const[t,n]=v.useState(null),r=Qj();v.useEffect(()=>{e().then(n)},[e]);const a=t==null?void 0:t.default,o=t==null?void 0:t.PageTitle,l=t==null?void 0:t.PageActions;return E.jsxs(E.Fragment,{children:[E.jsxs("header",{className:"sticky top-0 z-10 flex h-12 md:h-16 shrink-0 items-center justify-between gap-2 bg-background/95 backdrop-blur-sm","data-testid":"mobile-topbar",children:[E.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-4",children:[E.jsx(NX,{className:"-ml-1 shrink-0","data-testid":"mobile-sidebar-open"}),E.jsx(HG,{orientation:"vertical",className:"mr-2 shrink-0 data-[orientation=vertical]:h-4"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:o?E.jsx(o,{...r}):""})]}),E.jsx("div",{className:"flex shrink-0 items-center gap-1 px-4",children:l&&E.jsx(l,{...r})})]}),E.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4 !pt-0 p-2 md:p-4",children:E.jsx("div",{className:"bg-muted/50 min-h-0 flex-1 overflow-auto overscroll-auto rounded-xl [-webkit-overflow-scrolling:touch]",children:a?E.jsx(a,{}):null})})]})}const hee=()=>bx(()=>import("./SettingsPage-CNSAuMwZ.js"),__vite__mapDeps([0,1,2])),qk=()=>bx(()=>import("./DevicesPage-BtUqV_Oo.js"),__vite__mapDeps([3,1])),$k=()=>bx(()=>import("./DevicePage-Byph1K3m.js"),__vite__mapDeps([4,2])),pee=q_([{path:"/",Component:dee,children:[{index:!0,element:E.jsx(Vu,{moduleLoader:qk})},{path:"devices",element:E.jsx(Vu,{moduleLoader:qk})},{path:"devices/:deviceId",element:E.jsx(Vu,{moduleLoader:$k})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:E.jsx(Vu,{moduleLoader:$k})},{path:"settings",element:E.jsx(Vu,{moduleLoader:hee})}]}]),k2=document.getElementById("root");if(!k2)throw new Error("Root element not found");OL.createRoot(k2).render(E.jsx(v.StrictMode,{children:E.jsxs(fL,{client:cee,children:[E.jsx(g_,{router:pee}),E.jsx(Oz,{richColors:!0,position:"top-right",closeButton:!0,offset:{top:"calc(16px + env(safe-area-inset-top, 0px))",right:"16px",bottom:"16px",left:"16px"},mobileOffset:{top:"calc(12px + env(safe-area-inset-top, 0px))",right:"12px",bottom:"12px",left:"12px"},toastOptions:{duration:6e3}})]})}));export{oQ as $,ex as A,qt as B,Vo as C,lx as D,Vs as E,ra as F,yee as G,JM as H,Ii as I,En as J,OT as K,mc as L,qn as M,Vx as N,Sk as O,Yp as P,dO as Q,e0 as R,rp as S,fO as T,t0 as U,HF as V,n0 as W,Ua as X,Jl as Y,hO as Z,xee as _,Pd as a,HG as a0,zx as a1,uU as a2,Jx as a3,je as a4,L5 as a5,P5 as a6,vd as a7,bee as a8,Qj as a9,Ix as aa,wee as ab,See as ac,DU as ad,E2 as ae,vee as af,QF as ag,yB as ah,iZ as ai,ZQ as aj,QQ as ak,hd as b,Lt as c,cx as d,ux as e,dx as f,FD as g,ip as h,jb as i,E as j,ap as k,Pa as l,Ek as m,pp as n,Ks as o,$p as p,tx as q,v as r,nx as s,mn as t,Sn as u,ix as v,ax as w,rx as x,sx as y,ox as z};
400
- //# sourceMappingURL=index-DNdArpmQ.js.map