@dhzh/foundry 7.3.2 → 7.4.0

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,135 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-editor-BUDoC1Cq.js","assets/markdown-editor-DMeNDIaI.css"])))=>i.map(i=>d[i]);
2
- function kN(e,n){for(var o=0;o<n.length;o++){const a=n[o];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const u=Object.getOwnPropertyDescriptor(a,s);u&&Object.defineProperty(e,s,u.get?u:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function o(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(s){if(s.ep)return;s.ep=!0;const u=o(s);fetch(s.href,u)}})();function LR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a0={exports:{}},Bu={};var eS;function LN(){if(eS)return Bu;eS=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function o(a,s,u){var c=null;if(u!==void 0&&(c=""+u),s.key!==void 0&&(c=""+s.key),"key"in s){u={};for(var d in s)d!=="key"&&(u[d]=s[d])}else u=s;return s=u.ref,{$$typeof:e,type:a,key:c,ref:s!==void 0?s:null,props:u}}return Bu.Fragment=n,Bu.jsx=o,Bu.jsxs=o,Bu}var tS;function zN(){return tS||(tS=1,a0.exports=LN()),a0.exports}var S=zN(),i0={exports:{}},Tt={};var nS;function _N(){if(nS)return Tt;nS=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),x=Symbol.iterator;function w(I){return I===null||typeof I!="object"?null:(I=x&&I[x]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,T={};function O(I,B,W){this.props=I,this.context=B,this.refs=T,this.updater=W||C}O.prototype.isReactComponent={},O.prototype.setState=function(I,B){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,B,"setState")},O.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function M(){}M.prototype=O.prototype;function A(I,B,W){this.props=I,this.context=B,this.refs=T,this.updater=W||C}var N=A.prototype=new M;N.constructor=A,R(N,O.prototype),N.isPureReactComponent=!0;var k=Array.isArray;function j(){}var D={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function F(I,B,W){var re=W.ref;return{$$typeof:e,type:I,key:B,ref:re!==void 0?re:null,props:W}}function G(I,B){return F(I.type,B,I.props)}function J(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function Y(I){var B={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(W){return B[W]})}var U=/\/+/g;function H(I,B){return typeof I=="object"&&I!==null&&I.key!=null?Y(""+I.key):B.toString(36)}function L(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(j,j):(I.status="pending",I.then(function(B){I.status==="pending"&&(I.status="fulfilled",I.value=B)},function(B){I.status==="pending"&&(I.status="rejected",I.reason=B)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function $(I,B,W,re,Re){var le=typeof I;(le==="undefined"||le==="boolean")&&(I=null);var me=!1;if(I===null)me=!0;else switch(le){case"bigint":case"string":case"number":me=!0;break;case"object":switch(I.$$typeof){case e:case n:me=!0;break;case y:return me=I._init,$(me(I._payload),B,W,re,Re)}}if(me)return Re=Re(I),me=re===""?"."+H(I,0):re,k(Re)?(W="",me!=null&&(W=me.replace(U,"$&/")+"/"),$(Re,B,W,"",function(Te){return Te})):Re!=null&&(J(Re)&&(Re=G(Re,W+(Re.key==null||I&&I.key===Re.key?"":(""+Re.key).replace(U,"$&/")+"/")+me)),B.push(Re)),1;me=0;var ge=re===""?".":re+":";if(k(I))for(var ce=0;ce<I.length;ce++)re=I[ce],le=ge+H(re,ce),me+=$(re,B,W,le,Re);else if(ce=w(I),typeof ce=="function")for(I=ce.call(I),ce=0;!(re=I.next()).done;)re=re.value,le=ge+H(re,ce++),me+=$(re,B,W,le,Re);else if(le==="object"){if(typeof I.then=="function")return $(L(I),B,W,re,Re);throw B=String(I),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return me}function K(I,B,W){if(I==null)return I;var re=[],Re=0;return $(I,re,"","",function(le){return B.call(W,le,Re++)}),re}function V(I){if(I._status===-1){var B=I._result,W=B();W.then(function(re){(I._status===0||I._status===-1)&&(I._status=1,I._result=re,W.status===void 0&&(W.status="fulfilled",W.value=re))},function(re){(I._status===0||I._status===-1)&&(I._status=2,I._result=re,W.status===void 0&&(W.status="rejected",W.reason=re))}),I._status===-1&&(I._status=0,I._result=W)}if(I._status===1)return I._result.default;throw I._result}var X=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=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(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)};function ee(I){var B=D.T,W={};W.types=B!==null?B.types:null,D.T=W;try{var re=I(),Re=D.S;Re!==null&&Re(W,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(j,X)}catch(le){X(le)}finally{B!==null&&W.types!==null&&(B.types=W.types),D.T=B}}function q(I){var B=D.T;if(B!==null){var W=B.types;W===null?B.types=[I]:W.indexOf(I)===-1&&W.push(I)}else ee(q.bind(null,I))}var se={map:K,forEach:function(I,B,W){K(I,function(){B.apply(this,arguments)},W)},count:function(I){var B=0;return K(I,function(){B++}),B},toArray:function(I){return K(I,function(B){return B})||[]},only:function(I){if(!J(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Tt.Activity=h,Tt.Children=se,Tt.Component=O,Tt.Fragment=o,Tt.Profiler=s,Tt.PureComponent=A,Tt.StrictMode=a,Tt.Suspense=p,Tt.ViewTransition=b,Tt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Tt.__COMPILER_RUNTIME={__proto__:null,c:function(I){return D.H.useMemoCache(I)}},Tt.addTransitionType=q,Tt.cache=function(I){return function(){return I.apply(null,arguments)}},Tt.cacheSignal=function(){return null},Tt.cloneElement=function(I,B,W){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var re=R({},I.props),Re=I.key;if(B!=null)for(le in B.key!==void 0&&(Re=""+B.key),B)!z.call(B,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&B.ref===void 0||(re[le]=B[le]);var le=arguments.length-2;if(le===1)re.children=W;else if(1<le){for(var me=Array(le),ge=0;ge<le;ge++)me[ge]=arguments[ge+2];re.children=me}return F(I.type,Re,re)},Tt.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:u,_context:I},I},Tt.createElement=function(I,B,W){var re,Re={},le=null;if(B!=null)for(re in B.key!==void 0&&(le=""+B.key),B)z.call(B,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(Re[re]=B[re]);var me=arguments.length-2;if(me===1)Re.children=W;else if(1<me){for(var ge=Array(me),ce=0;ce<me;ce++)ge[ce]=arguments[ce+2];Re.children=ge}if(I&&I.defaultProps)for(re in me=I.defaultProps,me)Re[re]===void 0&&(Re[re]=me[re]);return F(I,le,Re)},Tt.createRef=function(){return{current:null}},Tt.forwardRef=function(I){return{$$typeof:d,render:I}},Tt.isValidElement=J,Tt.lazy=function(I){return{$$typeof:y,_payload:{_status:-1,_result:I},_init:V}},Tt.memo=function(I,B){return{$$typeof:g,type:I,compare:B===void 0?null:B}},Tt.startTransition=ee,Tt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Tt.use=function(I){return D.H.use(I)},Tt.useActionState=function(I,B,W){return D.H.useActionState(I,B,W)},Tt.useCallback=function(I,B){return D.H.useCallback(I,B)},Tt.useContext=function(I){return D.H.useContext(I)},Tt.useDebugValue=function(){},Tt.useDeferredValue=function(I,B){return D.H.useDeferredValue(I,B)},Tt.useEffect=function(I,B){return D.H.useEffect(I,B)},Tt.useEffectEvent=function(I){return D.H.useEffectEvent(I)},Tt.useId=function(){return D.H.useId()},Tt.useImperativeHandle=function(I,B,W){return D.H.useImperativeHandle(I,B,W)},Tt.useInsertionEffect=function(I,B){return D.H.useInsertionEffect(I,B)},Tt.useLayoutEffect=function(I,B){return D.H.useLayoutEffect(I,B)},Tt.useMemo=function(I,B){return D.H.useMemo(I,B)},Tt.useOptimistic=function(I,B){return D.H.useOptimistic(I,B)},Tt.useReducer=function(I,B,W){return D.H.useReducer(I,B,W)},Tt.useRef=function(I){return D.H.useRef(I)},Tt.useState=function(I){return D.H.useState(I)},Tt.useSyncExternalStore=function(I,B,W){return D.H.useSyncExternalStore(I,B,W)},Tt.useTransition=function(){return D.H.useTransition()},Tt.version="19.3.1",Tt}var rS;function wc(){return rS||(rS=1,i0.exports=_N()),i0.exports}var v=wc();const Ne=LR(v),zR=kN({__proto__:null,default:Ne},[v]);var s0={exports:{}},Vu={},l0={exports:{}},u0={};var oS;function HN(){return oS||(oS=1,(function(e){function n(L,$){var K=L.length;L.push($);e:for(;0<K;){var V=K-1>>>1,X=L[V];if(0<s(X,$))L[V]=$,L[K]=X,K=V;else break e}}function o(L){return L.length===0?null:L[0]}function a(L){if(L.length===0)return null;var $=L[0],K=L.pop();if(K!==$){L[0]=K;e:for(var V=0,X=L.length,ee=X>>>1;V<ee;){var q=2*(V+1)-1,se=L[q],I=q+1,B=L[I];if(0>s(se,K))I<X&&0>s(B,se)?(L[V]=B,L[I]=K,V=I):(L[V]=se,L[q]=K,V=q);else if(I<X&&0>s(B,K))L[V]=B,L[I]=K,V=I;else break e}}return $}function s(L,$){var K=L.sortIndex-$.sortIndex;return K!==0?K:L.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var p=[],g=[],y=1,h=null,b=3,x=!1,w=!1,C=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function A(L){for(var $=o(g);$!==null;){if($.callback===null)a(g);else if($.startTime<=L)a(g),$.sortIndex=$.expirationTime,n(p,$);else break;$=o(g)}}function N(L){if(C=!1,A(L),!w)if(o(p)!==null)w=!0,k||(k=!0,J());else{var $=o(g);$!==null&&H(N,$.startTime-L)}}var k=!1,j=-1,D=5,z=-1;function F(){return R?!0:!(e.unstable_now()-z<D)}function G(){if(R=!1,k){var L=e.unstable_now();z=L;var $=!0;try{e:{w=!1,C&&(C=!1,O(j),j=-1),x=!0;var K=b;try{t:{for(A(L),h=o(p);h!==null&&!(h.expirationTime>L&&F());){var V=h.callback;if(typeof V=="function"){h.callback=null,b=h.priorityLevel;var X=V(h.expirationTime<=L);if(L=e.unstable_now(),typeof X=="function"){h.callback=X,A(L),$=!0;break t}h===o(p)&&a(p),A(L)}else a(p);h=o(p)}if(h!==null)$=!0;else{var ee=o(g);ee!==null&&H(N,ee.startTime-L),$=!1}}break e}finally{h=null,b=K,x=!1}$=void 0}}finally{$?J():k=!1}}}var J;if(typeof M=="function")J=function(){M(G)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,U=Y.port2;Y.port1.onmessage=G,J=function(){U.postMessage(null)}}else J=function(){T(G,0)};function H(L,$){j=T(function(){L(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(L){switch(b){case 1:case 2:case 3:var $=3;break;default:$=b}var K=b;b=$;try{return L()}finally{b=K}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(L,$){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var K=b;b=L;try{return $()}finally{b=K}},e.unstable_scheduleCallback=function(L,$,K){var V=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?V+K:V):K=V,L){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=K+X,L={id:y++,callback:$,priorityLevel:L,startTime:K,expirationTime:X,sortIndex:-1},K>V?(L.sortIndex=K,n(g,L),o(p)===null&&L===o(g)&&(C?(O(j),j=-1):C=!0,H(N,K-V))):(L.sortIndex=X,n(p,L),w||x||(w=!0,k||(k=!0,J()))),L},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(L){var $=b;return function(){var K=b;b=$;try{return L.apply(this,arguments)}finally{b=K}}}})(u0)),u0}var aS;function UN(){return aS||(aS=1,l0.exports=HN()),l0.exports}var c0={exports:{}},xr={};var iS;function FN(){if(iS)return xr;iS=1;var e=wc();function n(y){var h="https://react.dev/errors/"+y;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+y+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var a={d:{f:o,r:function(){throw Error(n(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},s=Symbol.for("react.portal"),u=Symbol.for("react.recoverable"),c=Symbol.for("react.optimistic_key");function d(y,h,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:x==null?null:x===c?c:""+x,children:y,containerInfo:h,implementation:b}}var p=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(y,h){if(y==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return xr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,xr.browser=function(y){return{$$typeof:u,_reason:y}},xr.createPortal=function(y,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return d(y,h,null,b)},xr.flushSync=function(y){var h=p.T,b=a.p;try{if(p.T=null,a.p=2,y)return y()}finally{p.T=h,a.p=b,a.d.f()}},xr.preconnect=function(y,h){typeof y=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(y,h))},xr.prefetchDNS=function(y){typeof y=="string"&&a.d.D(y)},xr.preinit=function(y,h){if(typeof y=="string"&&h&&typeof h.as=="string"){var b=h.as,x=g(b,h.crossOrigin),w=typeof h.integrity=="string"?h.integrity:void 0,C=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?a.d.S(y,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:x,integrity:w,fetchPriority:C}):b==="script"&&a.d.X(y,{crossOrigin:x,integrity:w,fetchPriority:C,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},xr.preinitModule=function(y,h){if(typeof y=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=g(h.as,h.crossOrigin);a.d.M(y,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0})}}else h==null&&a.d.M(y)},xr.preload=function(y,h){if(typeof y=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,x=g(b,h.crossOrigin);a.d.L(y,b,{crossOrigin:x,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},xr.preloadModule=function(y,h){if(typeof y=="string")if(h){var b=g(h.as,h.crossOrigin);a.d.m(y,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0})}else a.d.m(y)},xr.requestFormReset=function(y){a.d.r(y)},xr.unstable_batchedUpdates=function(y,h){return y(h)},xr.useFormState=function(y,h,b){return p.H.useFormState(y,h,b)},xr.useFormStatus=function(){return p.H.useHostTransitionStatus()},xr.version="19.3.1",xr}var sS;function _R(){if(sS)return c0.exports;sS=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(n){console.error(n)}}return e(),c0.exports=FN(),c0.exports}var lS;function BN(){if(lS)return Vu;lS=1;var e=UN(),n=wc(),o=_R();function a(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){for(var r=t,i=r;i&&!i.alternate;)r=i,(r.flags&4098)!==0&&(t=r.return),i=r.return;for(;r.return;)r=r.return;return r.tag===3?t:null}function c(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function d(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function p(t){if(u(t)!==t)throw Error(a(188))}function g(t){var r=t.alternate;if(!r){if(r=u(t),r===null)throw Error(a(188));return r!==t?null:t}for(var i=t,l=r;;){var f=i.return;if(f===null)break;var m=f.alternate;if(m===null){if(l=f.return,l!==null){i=l;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===i)return p(f),t;if(m===l)return p(f),r;m=m.sibling}throw Error(a(188))}if(i.return!==l.return)i=f,l=m;else{for(var E=!1,P=f.child;P;){if(P===i){E=!0,i=f,l=m;break}if(P===l){E=!0,l=f,i=m;break}P=P.sibling}if(!E){for(P=m.child;P;){if(P===i){E=!0,i=m,l=f;break}if(P===l){E=!0,l=m,i=f;break}P=P.sibling}if(!E)throw Error(a(189))}}if(i.alternate!==l)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?t:r}function y(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=y(t),r!==null)return r;t=t.sibling}return null}function h(t,r,i,l,f,m){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&i(t,l,f,m)||(t.tag!==22||t.memoizedState===null)&&(r||t.tag!==5&&t.tag!==27)&&h(t.child,r,i,l,f,m))return!0;t=t.sibling}return!1}function b(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function x(t){var r=!1;for(t=t.return;t!==null&&(t.tag===4&&(r=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return r}function w(t){var r=[null,null],i=b(t);return i===null||C(r,t,i.child,{foundSelf:!1}),r}function C(t,r,i,l){for(;i!==null;){if(i===r)l.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(l.foundSelf)return t[1]=i,!0;t[0]=i}else if((i.tag!==22||i.memoizedState===null)&&C(t,r,i.child,l))return!0;i=i.sibling}return!1}function R(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(a(559))}}var T=null,O=null;function M(t,r,i){return t===i?!0:t===r?(T=t,!0):!1}function A(t,r,i){return t===i?(O=t,!1):t===r?(O!==null&&(T=t),!0):!1}function N(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function k(t,r,i){for(var l=0,f=t;f;f=i(f))l++;f=0;for(var m=r;m;m=i(m))f++;for(;0<l-f;)t=i(t),l--;for(;0<f-l;)r=i(r),f--;for(;l--;){if(t===r||r!==null&&t===r.alternate)return t;t=i(t),r=i(r)}return null}var j=Object.assign,D=Symbol.for("react.element"),z=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),H=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),q=Symbol.for("react.legacy_hidden"),se=Symbol.for("react.memo_cache_sentinel"),I=Symbol.for("react.view_transition"),B=Symbol.for("react.recoverable"),W=Symbol.iterator;function re(t){return t===null||typeof t!="object"?null:(t=W&&t[W]||t["@@iterator"],typeof t=="function"?t:null)}var Re=Symbol.for("react.client.reference");function le(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Re?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case G:return"Fragment";case Y:return"Profiler";case J:return"StrictMode";case $:return"Suspense";case K:return"SuspenseList";case ee:return"Activity";case I:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case F:return"Portal";case H:return t.displayName||"Context";case U:return(t._context.displayName||"Context")+".Consumer";case L:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case V:return r=t.displayName||null,r!==null?r:le(t.type)||"Memo";case X:r=t._payload,t=t._init;try{return le(t(r))}catch{}}return null}var me=Array.isArray,ge=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Te={pending:!1,data:null,method:null,action:null},ve=[],ke=-1;function Me(t){return{current:t}}function Le(t){0>ke||(t.current=ve[ke],ve[ke]=null,ke--)}function Fe(t,r){ke++,ve[ke]=t.current,t.current=r}var Oe=Me(null),He=Me(null),be=Me(null),Ue=Me(null);function Qe(t,r){switch(Fe(be,r),Fe(He,t),Fe(Oe,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?u1(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=u1(r),t=c1(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Le(Oe),Fe(Oe,t)}function it(){Le(Oe),Le(He),Le(be)}function de(t){var r=t.memoizedState;r!==null&&(ul._currentValue=r.memoizedState,Fe(Ue,t)),r=Oe.current;var i=c1(r,t.type);r!==i&&(Fe(He,t),Fe(Oe,i))}function we(t){He.current===t&&(Le(Oe),Le(He)),Ue.current===t&&(Le(Ue),ul._currentValue=Te)}var Ke,De;function Ie(t){if(Ke===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);Ke=r&&r[1]||"",De=-1<i.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Ke+t+De}var yt=!1;function ut(t,r){if(!t||yt)return"";yt=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(Ye){var oe=Ye}Reflect.construct(t,[],Ce)}else{try{Ce.call()}catch(Ye){oe=Ye}Ce=!1;try{var fe=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Ce=!0,new t}finally{Ce&&(fe!==void 0?Object.defineProperty(t.prototype,"props",fe):delete t.prototype.props)}}}else{try{throw Error()}catch(Ye){oe=Ye}(Ce=t())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(Ye){if(Ye&&oe&&typeof Ye.stack=="string")return[Ye.stack,oe.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=l.DetermineComponentFrameRoot(),E=m[0],P=m[1];if(E&&P){var Q=E.split(`
5
- `),ie=P.split(`
6
- `);for(f=l=0;l<Q.length&&!Q[l].includes("DetermineComponentFrameRoot");)l++;for(;f<ie.length&&!ie[f].includes("DetermineComponentFrameRoot");)f++;if(l===Q.length||f===ie.length)for(l=Q.length-1,f=ie.length-1;1<=l&&0<=f&&Q[l]!==ie[f];)f--;for(;1<=l&&0<=f;l--,f--)if(Q[l]!==ie[f]){if(l!==1||f!==1)do if(l--,f--,0>f||Q[l]!==ie[f]){var pe=`
7
- `+Q[l].replace(" at new "," at ");return t.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",t.displayName)),pe}while(1<=l&&0<=f);break}}}finally{yt=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?Ie(i):""}function ht(t,r){switch(t.tag){case 26:case 27:case 5:return Ie(t.type);case 16:return Ie("Lazy");case 13:return t.child!==r&&r!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return ut(t.type,!1);case 11:return ut(t.type.render,!1);case 1:return ut(t.type,!0);case 31:return Ie("Activity");case 30:return Ie("ViewTransition");default:return""}}function Ot(t){try{var r="",i=null;do r+=ht(t,i),i=t,t=t.return;while(t);return r}catch(l){return`
8
- Error generating stack: `+l.message+`
9
- `+l.stack}}var Dt=Object.prototype.hasOwnProperty,Wt=e.unstable_scheduleCallback,rn=e.unstable_cancelCallback,en=e.unstable_shouldYield,We=e.unstable_requestPaint,xt=e.unstable_now,$t=e.unstable_getCurrentPriorityLevel,ft=e.unstable_ImmediatePriority,vt=e.unstable_UserBlockingPriority,gt=e.unstable_NormalPriority,kt=e.unstable_LowPriority,un=e.unstable_IdlePriority,je=e.log,at=e.unstable_setDisableYieldValue,Pe=null,ze=null;function Ge(t){if(typeof je=="function"&&at(t),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(Pe,t)}catch{}}var et=Math.clz32?Math.clz32:Z,Et=Math.log,_=Math.LN2;function Z(t){return t>>>=0,t===0?32:31-(Et(t)/_|0)|0}var ne=256,ye=262144,xe=4194304;function qe(t){var r=t&42;if(r!==0)return r;switch(t&-t){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 t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ve(t,r,i){var l=t.pendingLanes;if(l===0)return 0;var f=0,m=t.suspendedLanes,E=t.pingedLanes;t=t.warmLanes;var P=l&134217727;return P!==0?(l=P&~m,l!==0?f=qe(l):(E&=P,E!==0?f=qe(E):i||(i=P&~t,i!==0&&(f=qe(i))))):(P=l&~m,P!==0?f=qe(P):E!==0?f=qe(E):i||(i=l&~t,i!==0&&(f=qe(i)))),f===0?0:r!==0&&r!==f&&(r&m)===0&&(m=f&-f,i=r&-r,m>=i||m===32&&(i&4194048)!==0)?r:f}function Xe(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function $e(t,r){(r&8)!==0&&(r|=r&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=r;0<i;){var l=31-et(i),f=1<<l;r|=t[l],i&=~f}return r}function st(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 t=xe;return xe<<=1,(xe&62914560)===0&&(xe=4194304),t}function St(t){for(var r=[],i=0;31>i;i++)r.push(t);return r}function ct(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Bt(t,r,i,l,f,m){var E=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var P=t.entanglements,Q=t.expirationTimes,ie=t.hiddenUpdates;for(i=E&~i;0<i;){var pe=31-et(i),Ce=1<<pe;P[pe]=0,Q[pe]=-1;var oe=ie[pe];if(oe!==null)for(ie[pe]=null,pe=0;pe<oe.length;pe++){var fe=oe[pe];fe!==null&&(fe.lane&=-536870913)}i&=~Ce}l!==0&&_t(t,l,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(E&~r))}function _t(t,r,i){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-et(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|i&261930}function On(t,r){var i=t.entangledLanes|=r;for(t=t.entanglements;i;){var l=31-et(i),f=1<<l;f&r|t[l]&r&&(t[l]|=r),i&=~f}}function Vt(t,r){var i=r&-r;return i=(i&42)!==0?1:Ht(i),(i&(t.suspendedLanes|r))!==0?0:i}function Ht(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function En(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Cn(){var t=ce.p;return t!==0?t:(t=window.event,t===void 0?32:G1(t.type))}function Qr(t,r){var i=ce.p;try{return ce.p=t,r()}finally{ce.p=i}}var cn=Math.random().toString(36).slice(2),dn="__reactFiber$"+cn,Mn="__reactProps$"+cn,In="__reactContainer$"+cn,va="__reactEvents$"+cn,Or="__reactListeners$"+cn,Po="__reactHandles$"+cn,Zr="__reactResources$"+cn,go="__reactMarker$"+cn,Pt="__reactLoad$"+cn;function Yn(t){delete t[dn],delete t[Mn],delete t[Or],delete t[Po]}function Fn(t){var r;if(r=t[dn])return r;for(var i=t.parentNode;i;){if(r=i[In]||i[dn]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(t=O1(t);t!==null;){if(i=t[dn])return i;t=O1(t)}return r}t=i,i=t.parentNode}return null}function fr(t){if(t=t[dn]||t[In]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function he(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(a(33))}function Ae(t){var r=t[Zr];return r||(r=t[Zr]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Se(t){t[go]=!0}function nt(t){t[Pt]=void 0}var Ct=new Set,wt={};function Lt(t,r){vn(t,r),vn(t+"Capture",r)}function vn(t,r){for(wt[t]=r,t=0;t<r.length;t++)Ct.add(r[t])}var fn=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]*$"),mt={},At={};function on(t){return Dt.call(At,t)?!0:Dt.call(mt,t)?!1:fn.test(t)?At[t]=!0:(mt[t]=!0,!1)}var pt=!1;function nr(){var t=pt;return pt=!1,t}function Ln(t,r,i){if(on(r))if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,i)}}function Jr(t,r,i){if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,i)}}function Gn(t,r,i,l){if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(r,i,l)}}function $n(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Os(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Zl(t,r,i){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,m=l.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return f.call(this)},set:function(E){i=""+E,m.call(this,E)}}),Object.defineProperty(t,r,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(E){i=""+E},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function ba(t){if(!t._valueTracker){var r=Os(t)?"checked":"value";t._valueTracker=Zl(t,r,""+t[r])}}function Ms(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var i=r.getValue(),l="";return t&&(l=Os(t)?t.checked?"true":"false":t.value),t=l,t!==i?(r.setValue(t),!0):!1}var Qc=/[\n"\\]/g;function Nn(t){return t.replace(Qc,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function wr(t,r,i,l,f,m,E,P){t.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.type=E:t.removeAttribute("type"),r!=null?E==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+$n(r)):t.value!==""+$n(r)&&(t.value=""+$n(r)):E!=="submit"&&E!=="reset"||t.removeAttribute("value"),r!=null?E==="number"&&t.value==r?As(t,$n(t.value)):As(t,$n(r)):i!=null?As(t,$n(i)):l!=null&&t.removeAttribute("value"),f==null&&m!=null&&(t.defaultChecked=!!m),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?t.name=""+$n(P):t.removeAttribute("name")}function Ya(t,r,i,l,f,m,E,P){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),r!=null||i!=null){if(!(m!=="submit"&&m!=="reset"||r!=null)){ba(t);return}i=i!=null?""+$n(i):"",r=r!=null?""+$n(r):i,P||r===t.value||(t.value=r),t.defaultValue=r}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=P?t.checked:!!l,t.defaultChecked=!!l,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(t.name=E),ba(t)}function As(t,r){t.defaultValue!==""+r&&(t.defaultValue=""+r)}function Fr(t,r,i,l){if(t=t.options,r){r={};for(var f=0;f<i.length;f++)r["$"+i[f]]=!0;for(i=0;i<t.length;i++)f=r.hasOwnProperty("$"+t[i].value),t[i].selected!==f&&(t[i].selected=f),f&&l&&(t[i].defaultSelected=!0)}else{for(i=""+$n(i),r=null,f=0;f<t.length;f++){if(t[f].value===i){t[f].selected=!0,l&&(t[f].defaultSelected=!0);return}r!==null||t[f].disabled||(r=t[f])}r!==null&&(r.selected=!0)}}function Ds(t,r,i){if(r!=null&&(r=""+$n(r),r!==t.value&&(t.value=r),i==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=i!=null?""+$n(i):""}function Wr(t,r,i,l){if(r==null){if(l!=null){if(i!=null)throw Error(a(92));if(me(l)){if(1<l.length)throw Error(a(93));l=l[0]}i=l}i==null&&(i=""),r=i}i=$n(r),t.defaultValue=i,l=t.textContent,l===i&&l!==""&&l!==null&&(t.value=l),ba(t)}function Mr(t,r){if(r){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=r;return}}t.textContent=r}var Ka=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 Jl(t,r,i){var l=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,i):typeof i!="number"||i===0||Ka.has(r)?r==="float"?t.cssFloat=i:t[r]=(""+i).trim():t[r]=i+"px"}function eo(t,r,i){if(r!=null&&typeof r!="object")throw Error(a(62));if(t=t.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="",pt=!0);for(var f in r)l=r[f],r.hasOwnProperty(f)&&i[f]!==l&&(Jl(t,f,l),pt=!0)}else for(var m in r)r.hasOwnProperty(m)&&Jl(t,m,r[m])}function Pi(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Wl=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"],["maskType","mask-type"],["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"]]),eu=/^[\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 hr(t){return eu.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ar(){}var ki=null;function Li(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var tn=null,ar=null;function mo(t){var r=fr(t);if(r&&(t=r.stateNode)){var i=t[Mn]||null;e:switch(t=r.stateNode,r.type){case"input":if(wr(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Nn(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var l=i[r];if(l!==t&&l.form===t.form){var f=l[Mn]||null;if(!f)throw Error(a(90));wr(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<i.length;r++)l=i[r],l.form===t.form&&Ms(l)}break e;case"textarea":Ds(t,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&Fr(t,!!i.multiple,r,!1)}}}var to=!1;function zi(t,r,i){if(to)return t(r,i);to=!0;try{var l=t(r);return l}finally{if(to=!1,(tn!==null||ar!==null)&&(Qd(),tn&&(r=tn,t=ar,ar=tn=null,mo(r),t)))for(r=0;r<t.length;r++)mo(t[r])}}function xa(t,r){var i=t.stateNode;if(i===null)return null;var l=i[Mn]||null;if(l===null)return null;i=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(a(231,r,typeof i));return i}var pr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_i=!1;if(pr)try{var tu={};Object.defineProperty(tu,"passive",{get:function(){_i=!0}}),window.addEventListener("test",tu,tu),window.removeEventListener("test",tu,tu)}catch{_i=!1}var Ga=null,Vp=null,Zc=null;function ab(){if(Zc)return Zc;var t,r=Vp,i=r.length,l,f="value"in Ga?Ga.value:Ga.textContent,m=f.length;for(t=0;t<i&&r[t]===f[t];t++);var E=i-t;for(l=1;l<=E&&r[i-l]===f[m-l];l++);return Zc=f.slice(t,1<l?1-l:void 0)}function Jc(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Wc(){return!0}function ib(){return!1}function Dr(t){function r(i,l,f,m,E){this._reactName=i,this._targetInst=f,this.type=l,this.nativeEvent=m,this.target=E,this.currentTarget=null;for(var P in t)t.hasOwnProperty(P)&&(i=t[P],this[P]=i?i(m):m[P]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Wc:ib,this.isPropagationStopped=ib,this}return j(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Wc)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Wc)},persist:function(){},isPersistent:Wc}),r}var $a={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ed=Dr($a),nu=j({},$a,{view:0,detail:0}),iA=Dr(nu),qp,Yp,ru,td=j({},nu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gp,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ru&&(ru&&t.type==="mousemove"?(qp=t.screenX-ru.screenX,Yp=t.screenY-ru.screenY):Yp=qp=0,ru=t),qp)},movementY:function(t){return"movementY"in t?t.movementY:Yp}}),sb=Dr(td),sA=j({},td,{dataTransfer:0}),lA=Dr(sA),uA=j({},nu,{relatedTarget:0}),Kp=Dr(uA),cA=j({},$a,{animationName:0,elapsedTime:0,pseudoElement:0}),dA=Dr(cA),fA=j({},$a,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),hA=Dr(fA),pA=j({},$a,{data:0}),lb=Dr(pA),gA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mA={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"},yA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vA(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=yA[t])?!!r[t]:!1}function Gp(){return vA}var bA=j({},nu,{key:function(t){if(t.key){var r=gA[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Jc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?mA[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gp,charCode:function(t){return t.type==="keypress"?Jc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Jc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),xA=Dr(bA),SA=j({},td,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ub=Dr(SA),wA=j({},$a,{submitter:0}),RA=Dr(wA),EA=j({},nu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gp}),CA=Dr(EA),TA=j({},$a,{propertyName:0,elapsedTime:0,pseudoElement:0}),OA=Dr(TA),MA=j({},td,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),AA=Dr(MA),DA=j({},$a,{newState:0,oldState:0,source:0}),NA=Dr(DA),IA=[9,13,27,32],$p=pr&&"CompositionEvent"in window,ou=null;pr&&"documentMode"in document&&(ou=document.documentMode);var jA=pr&&"TextEvent"in window&&!ou,cb=pr&&(!$p||ou&&8<ou&&11>=ou),db=" ",fb=!1;function hb(t,r){switch(t){case"keyup":return IA.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pb(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ns=!1;function PA(t,r){switch(t){case"compositionend":return pb(r);case"keypress":return r.which!==32?null:(fb=!0,db);case"textInput":return t=r.data,t===db&&fb?null:t;default:return null}}function kA(t,r){if(Ns)return t==="compositionend"||!$p&&hb(t,r)?(t=ab(),Zc=Vp=Ga=null,Ns=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return cb&&r.locale!=="ko"?null:r.data;default:return null}}var LA={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 gb(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!LA[t.type]:r==="textarea"}function mb(t,r,i,l){tn?ar?ar.push(l):ar=[l]:tn=l,r=nf(r,"onChange"),0<r.length&&(i=new ed("onChange","change",null,i,l),t.push({event:i,listeners:r}))}var au=null,iu=null;function zA(t){r1(t,0)}function nd(t){var r=he(t);if(Ms(r))return t}function yb(t,r){if(t==="change")return r}var vb=!1;if(pr){var Xp;if(pr){var Qp="oninput"in document;if(!Qp){var bb=document.createElement("div");bb.setAttribute("oninput","return;"),Qp=typeof bb.oninput=="function"}Xp=Qp}else Xp=!1;vb=Xp&&(!document.documentMode||9<document.documentMode)}function xb(){au&&(au.detachEvent("onpropertychange",Sb),iu=au=null)}function Sb(t){if(t.propertyName==="value"&&nd(iu)){var r=[];mb(r,iu,t,Li(t)),zi(zA,r)}}function _A(t,r,i){t==="focusin"?(xb(),au=r,iu=i,au.attachEvent("onpropertychange",Sb)):t==="focusout"&&xb()}function HA(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return nd(iu)}function UA(t,r){if(t==="click")return nd(r)}function FA(t,r){if(t==="input"||t==="change")return nd(r)}function BA(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var no=typeof Object.is=="function"?Object.is:BA;function su(t,r){if(no(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var i=Object.keys(t),l=Object.keys(r);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var f=i[l];if(!Dt.call(r,f)||!no(t[f],r[f]))return!1}return!0}function Zp(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function wb(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Rb(t,r){var i=wb(t);t=0;for(var l;i;){if(i.nodeType===3){if(l=t+i.textContent.length,t<=r&&l>=r)return{node:i,offset:r-t};t=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=wb(i)}}function Eb(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Eb(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Cb(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Zp(t.document);r instanceof t.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)t=r.contentWindow;else break;r=Zp(t.document)}return r}function Jp(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var VA=pr&&"documentMode"in document&&11>=document.documentMode,Is=null,Wp=null,lu=null,eg=!1;function Tb(t,r,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;eg||Is==null||Is!==Zp(l)||(l=Is,"selectionStart"in l&&Jp(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),lu&&su(lu,l)||(lu=l,l=nf(Wp,"onSelect"),0<l.length&&(r=new ed("onSelect","select",null,r,i),t.push({event:r,listeners:l}),r.target=Is)))}function Hi(t,r){var i={};return i[t.toLowerCase()]=r.toLowerCase(),i["Webkit"+t]="webkit"+r,i["Moz"+t]="moz"+r,i}var js={animationend:Hi("Animation","AnimationEnd"),animationiteration:Hi("Animation","AnimationIteration"),animationstart:Hi("Animation","AnimationStart"),transitionrun:Hi("Transition","TransitionRun"),transitionstart:Hi("Transition","TransitionStart"),transitioncancel:Hi("Transition","TransitionCancel"),transitionend:Hi("Transition","TransitionEnd")},tg={},Ob={};pr&&(Ob=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function Ui(t){if(tg[t])return tg[t];if(!js[t])return t;var r=js[t],i;for(i in r)if(r.hasOwnProperty(i)&&i in Ob)return tg[t]=r[i];return t}var Mb=Ui("animationend"),Ab=Ui("animationiteration"),Db=Ui("animationstart"),qA=Ui("transitionrun"),YA=Ui("transitionstart"),KA=Ui("transitioncancel"),Nb=Ui("transitionend"),Ib=new Map,ng="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");ng.push("scrollEnd");function ko(t,r){Ib.set(t,r),Lt(r,[t])}var GA=0;function Sa(t,r){if(t.name!=null&&t.name!=="auto")return t.name;if(r.autoName!==null)return r.autoName;t=Ho.identifierPrefix;var i=GA++;return t="_"+t+"t_"+i.toString(32)+"_",r.autoName=t}function jb(t){if(t==null||typeof t=="string")return t;var r=null,i=Ws;if(i!==null)for(var l=0;l<i.length;l++){var f=t[i[l]];if(f!=null){if(f==="none")return"none";r=r==null?f:r+(" "+f)}}return r??t.default}function wa(t,r){return t=jb(t),r=jb(r),r==null?t==="auto"?null:t:r==="auto"?null:r}var rd=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},yo=[],Ps=0,rg=0;function od(){for(var t=Ps,r=rg=Ps=0;r<t;){var i=yo[r];yo[r++]=null;var l=yo[r];yo[r++]=null;var f=yo[r];yo[r++]=null;var m=yo[r];if(yo[r++]=null,l!==null&&f!==null){var E=l.pending;E===null?f.next=f:(f.next=E.next,E.next=f),l.pending=f}m!==0&&Pb(i,f,m)}}function ad(t,r,i,l){yo[Ps++]=t,yo[Ps++]=r,yo[Ps++]=i,yo[Ps++]=l,rg|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function og(t,r,i,l){return ad(t,r,i,l),id(t)}function Fi(t,r){return ad(t,null,null,r),id(t)}function Pb(t,r,i){t.lanes|=i;var l=t.alternate;l!==null&&(l.lanes|=i);for(var f=!1,m=t.return;m!==null;)m.childLanes|=i,l=m.alternate,l!==null&&(l.childLanes|=i),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(f=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,f&&r!==null&&(f=31-et(i),t=m.hiddenUpdates,l=t[f],l===null?t[f]=[r]:l.push(r),r.lane=i|536870912),m):null}function id(t){if(50<Du)throw Du=0,Xd=null,Error(a(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var ks={};function $A(t,r,i,l){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Br(t,r,i,l){return new $A(t,r,i,l)}function ag(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ra(t,r){var i=t.alternate;return i===null?(i=Br(t.tag,r,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=r,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&1206910976,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,r=t.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function kb(t,r){t.flags&=1206910978;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,r=i.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function sd(t,r,i,l,f,m){var E=0;if(l=t,typeof l=="function")ag(l)&&(E=1);else if(typeof l=="string")E=wN(t,i,Oe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(l){case ee:return t=Br(31,i,r,f),t.elementType=ee,t.lanes=m,t;case G:return Bi(i.children,f,m,r);case J:E=8,f|=24;break;case Y:return t=Br(12,i,r,f|2),t.elementType=Y,t.lanes=m,t;case $:return t=Br(13,i,r,f),t.elementType=$,t.lanes=m,t;case K:return t=Br(19,i,r,f),t.elementType=K,t.lanes=m,t;case q:case I:return t=f|32,t=Br(30,i,r,t),t.elementType=I,t.lanes=m,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case H:E=10;break e;case U:E=9;break e;case L:E=11;break e;case V:E=14;break e;case X:E=16,l=null;break e}E=29,i=Error(a(130,t===null?"null":typeof t,"")),l=null}return r=Br(E,i,r,f),r.elementType=t,r.type=l,r.lanes=m,r}function Bi(t,r,i,l){return t=Br(7,t,l,r),t.lanes=i,t}function ig(t,r,i){return t=Br(6,t,null,r),t.lanes=i,t}function Lb(t){var r=Br(18,null,null,0);return r.stateNode=t,r}function sg(t,r,i){return r=Br(4,t.children!==null?t.children:[],t.key,r),r.lanes=i,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var zb=new WeakMap;function vo(t,r){if(typeof t=="object"&&t!==null){var i=zb.get(t);return i!==void 0?i:(r={value:t,source:r,stack:Ot(r)},zb.set(t,r),r)}return{value:t,source:r,stack:Ot(r)}}var Ls=[],zs=0,ld=null,uu=0,bo=[],xo=0,Xa=null,Xo=1,Qo="";function Ea(t,r){Ls[zs++]=uu,Ls[zs++]=ld,ld=t,uu=r}function _b(t,r,i){bo[xo++]=Xo,bo[xo++]=Qo,bo[xo++]=Xa,Xa=t;var l=Xo;t=Qo;var f=32-et(l)-1;l&=~(1<<f),i+=1;var m=32-et(r)+f;if(30<m){var E=f-f%5;m=(l&(1<<E)-1).toString(32),l>>=E,f-=E,Xo=1<<32-et(r)+f|i<<f|l,Qo=m+t}else Xo=1<<m|i<<f|l,Qo=t}function ud(t){t.return!==null&&(Ea(t,1),_b(t,1,0))}function lg(t){for(;t===ld;)ld=Ls[--zs],Ls[zs]=null,uu=Ls[--zs],Ls[zs]=null;for(;t===Xa;)Xa=bo[--xo],bo[xo]=null,Qo=bo[--xo],bo[xo]=null,Xo=bo[--xo],bo[xo]=null}function Hb(t,r){bo[xo++]=Xo,bo[xo++]=Qo,bo[xo++]=Xa,Xo=r.id,Qo=r.overflow,Xa=t}var ir=null,An=null,Ut=!1,Qa=null,So=!1,ug=Error(a(519));function Za(t){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw cu(vo(r,t)),ug}function Ub(t){var r=t.stateNode,i=t.type,l=t.memoizedProps;switch(r[dn]=t,r[Mn]=l,i){case"dialog":Yt("cancel",r),Yt("close",r);break;case"iframe":case"object":case"embed":Yt("load",r);break;case"video":case"audio":for(i=0;i<Iu.length;i++)Yt(Iu[i],r);break;case"source":Yt("error",r);break;case"img":case"image":case"link":Yt("error",r),Yt("load",r);break;case"details":Yt("toggle",r);break;case"input":Yt("invalid",r),Ya(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Yt("invalid",r);break;case"textarea":Yt("invalid",r),Wr(r,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||l.suppressHydrationWarning===!0||s1(r.textContent,i)?(l.popover!=null&&(Yt("beforetoggle",r),Yt("toggle",r)),l.onScroll!=null&&Yt("scroll",r),l.onScrollEnd!=null&&Yt("scrollend",r),l.onClick!=null&&(r.onclick=Ar),r=!0):r=!1,r||Za(t,!0)}function cd(t){for(ir=t.return;ir;)switch(ir.tag){case 5:case 31:case 13:So=!1;return;case 27:case 3:So=!0;return;default:ir=ir.return}}function _s(t){if(t!==ir)return!1;if(!Ut)return cd(t),Ut=!0,!1;var r=t.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||Hm(t.type,t.memoizedProps)),i=!i),i&&An&&Za(t),cd(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));An=T1(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));An=T1(t)}else r===27?(r=An,hi(t.type)?(t=$m,$m=null,An=t):An=r):An=ir?Ro(t.stateNode.nextSibling):null;return!0}function Vi(){An=ir=null,Ut=!1}function cg(){var t=Qa;return t!==null&&(Yr===null?Yr=t:Yr.push.apply(Yr,t),Qa=null),t}function cu(t){Qa===null?Qa=[t]:Qa.push(t)}var dg=Me(null),qi=null,Ca=null;function Ja(t,r,i){Fe(dg,r._currentValue),r._currentValue=i}function Ta(t){t._currentValue=dg.current,Le(dg)}function dd(t,r,i){for(;t!==null;){var l=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),t===i)break;t=t.return}}function fg(t,r,i,l){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var m=f.dependencies;if(m!==null){var E=f.child;m=m.firstContext;e:for(;m!==null;){var P=m;m=f;for(var Q=0;Q<r.length;Q++)if(P.context===r[Q]){m.lanes|=i,P=m.alternate,P!==null&&(P.lanes|=i),dd(m.return,i,t),l||(E=null);break e}m=P.next}}else if(f.tag===18){if(E=f.return,E===null)throw Error(a(341));E.lanes|=i,m=E.alternate,m!==null&&(m.lanes|=i),dd(E,i,t),E=null}else f.tag===13&&f.memoizedState!==null&&f.memoizedState.dehydrated===null?(f.lanes|=i,E=f.alternate,E!==null&&(E.lanes|=i),dd(f.return,i,t),E=f.child,E=E!==null?E.sibling:null):E=f.child;if(E!==null)E.return=f;else for(E=f;E!==null;){if(E===t){E=null;break}if(f=E.sibling,f!==null){f.return=E.return,E=f;break}E=E.return}f=E}}function Yi(t,r,i,l){t=null;for(var f=r,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var E=f.alternate;if(E===null)throw Error(a(387));if(E=E.memoizedProps,E!==null){var P=f.type;no(f.pendingProps.value,E.value)||(t!==null?t.push(P):t=[P])}}else if(f===Ue.current){if(E=f.alternate,E===null)throw Error(a(387));E.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(ul):t=[ul])}f=f.return}return t!==null&&fg(r,t,i,l),r.flags|=262144,t!==null}function fd(t){for(t=t.firstContext;t!==null;){if(!no(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ki(t){qi=t,Ca=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function gr(t){return Fb(qi,t)}function hd(t,r){return qi===null&&Ki(t),Fb(t,r)}function Fb(t,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},Ca===null){if(t===null)throw Error(a(308));Ca=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Ca=Ca.next=r;return i}var XA=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(i,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(i){return i()})}},QA=e.unstable_scheduleCallback,ZA=e.unstable_NormalPriority,Xn={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hg(){return{controller:new XA,data:new Map,refCount:0}}function du(t){t.refCount--,t.refCount===0&&QA(ZA,function(){t.controller.abort()})}function Bb(t,r){if((t.pendingLanes&4194048)!==0){var i=t.transitionTypes;for(i===null&&(i=t.transitionTypes=[]),t=0;t<r.length;t++){var l=r[t];i.indexOf(l)===-1&&i.push(l)}}}var fu=null;function JA(t){var r=t.transitionTypes;return t.transitionTypes=null,r}var hu=null,pg=0,Gi=0,Hs=null;function WA(t,r){if(hu===null){var i=hu=[];pg=0,Gi=Dm(),Hs={status:"pending",value:void 0,then:function(l){i.push(l)}}}return pg++,r.then(Vb,Vb),r}function Vb(){if(--pg===0&&(fu=null,hu!==null)){Hs!==null&&(Hs.status="fulfilled");var t=hu;hu=null,Gi=0,Hs=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function eD(t,r){var i=[],l={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var f=0;f<i.length;f++)(0,i[f])(r)},function(f){for(l.status="rejected",l.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),l}var qb=ge.S;ge.S=function(t,r){if(L2=xt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&WA(t,r),fu!==null)for(var i=rl;i!==null;)Bb(i,fu),i=i.next;if(i=t.types,i!==null){for(var l=rl;l!==null;)Bb(l,i),l=l.next;if(Gi!==0){l=fu,l===null&&(l=fu=[]);for(var f=0;f<i.length;f++){var m=i[f];l.indexOf(m)===-1&&l.push(m)}}}qb!==null&&qb(t,r)};var $i=Me(null);function gg(){var t=$i.current;return t!==null?t:Tn.pooledCache}function pd(t,r){r===null?Fe($i,$i.current):Fe($i,r.pool)}function Yb(){var t=gg();return t===null?null:{parent:Xn._currentValue,pool:t}}var Us=Error(a(460)),mg=Error(a(474)),gd=Error(a(542)),md={then:function(){}};function Kb(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Gb(t,r,i){switch(i=t[i],i===void 0?t.push(r):i!==r&&(r.then(Ar,Ar),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Xb(t),t===void 0&&!("reason"in r)?Error(a(600)):t;default:if(typeof r.status=="string")r.then(Ar,Ar);else{if(t=Tn,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=l}},function(l){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Xb(t),t}throw Qi=r,Us}}function Xi(t){try{var r=t._init;return r(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Qi=i,Us):i}}var Qi=null;function $b(){if(Qi===null)throw Error(a(459));var t=Qi;return Qi=null,t}function Xb(t){if(t===Us||t===gd)throw Error(a(483))}var Fs=null,pu=0;function yd(t){var r=pu;return pu+=1,Fs===null&&(Fs=[]),Gb(Fs,t,r)}function Wa(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function vd(t,r){throw r.$$typeof===D?Error(a(525)):(t=Object.prototype.toString.call(r),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Qb(t){function r(ae,te){if(t){var ue=ae.deletions;ue===null?(ae.deletions=[te],ae.flags|=16):ue.push(te)}}function i(ae,te){if(!t)return null;for(;te!==null;)r(ae,te),te=te.sibling;return null}function l(ae){for(var te=new Map;ae!==null;)ae.key===null?te.set(ae.index,ae):te.set(ae.key,ae),ae=ae.sibling;return te}function f(ae,te){return ae=Ra(ae,te),ae.index=0,ae.sibling=null,ae}function m(ae,te,ue){return ae.index=ue,t?(ue=ae.alternate,ue!==null?(ue=ue.index,ue<te?(ae.flags|=2,te):ue):(ae.flags|=134217730,te)):(ae.flags|=1048576,te)}function E(ae){return t&&ae.alternate===null&&(ae.flags|=134217730),ae}function P(ae,te,ue,Ee){return te===null||te.tag!==6?(te=ig(ue,ae.mode,Ee),te.return=ae,te):(te=f(te,ue),te.return=ae,te)}function Q(ae,te,ue,Ee){var Je=ue.type;return Je===G?(ae=pe(ae,te,ue.props.children,Ee,ue.key),Wa(ae,ue),ae):te!==null&&(te.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===X&&Xi(Je)===te.type)?(te=f(te,ue.props),Wa(te,ue),te.return=ae,te):(te=sd(ue.type,ue.key,ue.props,null,ae.mode,Ee),Wa(te,ue),te.return=ae,te)}function ie(ae,te,ue,Ee){return te===null||te.tag!==4||te.stateNode.containerInfo!==ue.containerInfo||te.stateNode.implementation!==ue.implementation?(te=sg(ue,ae.mode,Ee),te.return=ae,te):(te=f(te,ue.children||[]),te.return=ae,te)}function pe(ae,te,ue,Ee,Je){return te===null||te.tag!==7?(te=Bi(ue,ae.mode,Ee,Je),te.return=ae,te):(te=f(te,ue),te.return=ae,te)}function Ce(ae,te,ue){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=ig(""+te,ae.mode,ue),te.return=ae,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case z:return ue=sd(te.type,te.key,te.props,null,ae.mode,ue),Wa(ue,te),ue.return=ae,ue;case F:return te=sg(te,ae.mode,ue),te.return=ae,te;case X:return te=Xi(te),Ce(ae,te,ue)}if(me(te)||re(te))return te=Bi(te,ae.mode,ue,null),te.return=ae,te;if(typeof te.then=="function")return Ce(ae,yd(te),ue);if(te.$$typeof===H)return Ce(ae,hd(ae,te),ue);vd(ae,te)}return null}function oe(ae,te,ue,Ee){var Je=te!==null?te.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Je!==null?null:P(ae,te,""+ue,Ee);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case z:return ue.key===Je?Q(ae,te,ue,Ee):null;case F:return ue.key===Je?ie(ae,te,ue,Ee):null;case X:return ue=Xi(ue),oe(ae,te,ue,Ee)}if(me(ue)||re(ue))return Je!==null?null:pe(ae,te,ue,Ee,null);if(typeof ue.then=="function")return oe(ae,te,yd(ue),Ee);if(ue.$$typeof===H)return oe(ae,te,hd(ae,ue),Ee);vd(ae,ue)}return null}function fe(ae,te,ue,Ee,Je){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return ae=ae.get(ue)||null,P(te,ae,""+Ee,Je);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case z:return ae=ae.get(Ee.key===null?ue:Ee.key)||null,Q(te,ae,Ee,Je);case F:return ae=ae.get(Ee.key===null?ue:Ee.key)||null,ie(te,ae,Ee,Je);case X:return Ee=Xi(Ee),fe(ae,te,ue,Ee,Je)}if(me(Ee)||re(Ee))return ae=ae.get(ue)||null,pe(te,ae,Ee,Je,null);if(typeof Ee.then=="function")return fe(ae,te,ue,yd(Ee),Je);if(Ee.$$typeof===H)return fe(ae,te,ue,hd(te,Ee),Je);vd(te,Ee)}return null}function Ye(ae,te,ue,Ee){for(var Je=null,Qt=null,lt=te,bt=te=0,Jn=null;lt!==null&&bt<ue.length;bt++){lt.index>bt?(Jn=lt,lt=null):Jn=lt.sibling;var nn=oe(ae,lt,ue[bt],Ee);if(nn===null){lt===null&&(lt=Jn);break}t&&lt&&nn.alternate===null&&r(ae,lt),te=m(nn,te,bt),Qt===null?Je=nn:Qt.sibling=nn,Qt=nn,lt=Jn}if(bt===ue.length)return i(ae,lt),Ut&&Ea(ae,bt),Je;if(lt===null){for(;bt<ue.length;bt++)lt=Ce(ae,ue[bt],Ee),lt!==null&&(te=m(lt,te,bt),Qt===null?Je=lt:Qt.sibling=lt,Qt=lt);return Ut&&Ea(ae,bt),Je}for(lt=l(lt);bt<ue.length;bt++)Jn=fe(lt,ae,bt,ue[bt],Ee),Jn!==null&&(t&&(nn=Jn.alternate,nn!==null&&lt.delete(nn.key===null?bt:nn.key)),te=m(Jn,te,bt),Qt===null?Je=Jn:Qt.sibling=Jn,Qt=Jn);return t&&lt.forEach(function(vi){return r(ae,vi)}),Ut&&Ea(ae,bt),Je}function rt(ae,te,ue,Ee){if(ue==null)throw Error(a(151));for(var Je=null,Qt=null,lt=te,bt=te=0,Jn=null,nn=ue.next();lt!==null&&!nn.done;bt++,nn=ue.next()){lt.index>bt?(Jn=lt,lt=null):Jn=lt.sibling;var vi=oe(ae,lt,nn.value,Ee);if(vi===null){lt===null&&(lt=Jn);break}t&&lt&&vi.alternate===null&&r(ae,lt),te=m(vi,te,bt),Qt===null?Je=vi:Qt.sibling=vi,Qt=vi,lt=Jn}if(nn.done)return i(ae,lt),Ut&&Ea(ae,bt),Je;if(lt===null){for(;!nn.done;bt++,nn=ue.next())nn=Ce(ae,nn.value,Ee),nn!==null&&(te=m(nn,te,bt),Qt===null?Je=nn:Qt.sibling=nn,Qt=nn);return Ut&&Ea(ae,bt),Je}for(lt=l(lt);!nn.done;bt++,nn=ue.next())nn=fe(lt,ae,bt,nn.value,Ee),nn!==null&&(t&&(Jn=nn.alternate,Jn!==null&&lt.delete(Jn.key===null?bt:Jn.key)),te=m(nn,te,bt),Qt===null?Je=nn:Qt.sibling=nn,Qt=nn);return t&&lt.forEach(function(PN){return r(ae,PN)}),Ut&&Ea(ae,bt),Je}function It(ae,te,ue,Ee){if(typeof ue=="object"&&ue!==null&&ue.type===G&&ue.key===null&&ue.props.ref===void 0&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case z:e:{for(var Je=ue.key;te!==null;){if(te.key===Je){if(Je=ue.type,Je===G){if(te.tag===7){i(ae,te.sibling),Ee=f(te,ue.props.children),Wa(Ee,ue),Ee.return=ae,ae=Ee;break e}}else if(te.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===X&&Xi(Je)===te.type){i(ae,te.sibling),Ee=f(te,ue.props),Wa(Ee,ue),Ee.return=ae,ae=Ee;break e}i(ae,te);break}else r(ae,te);te=te.sibling}ue.type===G?(Ee=Bi(ue.props.children,ae.mode,Ee,ue.key),Wa(Ee,ue),Ee.return=ae,ae=Ee):(Ee=sd(ue.type,ue.key,ue.props,null,ae.mode,Ee),Wa(Ee,ue),Ee.return=ae,ae=Ee)}return E(ae);case F:e:{for(Je=ue.key;te!==null;){if(te.key===Je)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){i(ae,te.sibling),Ee=f(te,ue.children||[]),Ee.return=ae,ae=Ee;break e}else{i(ae,te);break}else r(ae,te);te=te.sibling}Ee=sg(ue,ae.mode,Ee),Ee.return=ae,ae=Ee}return E(ae);case X:return ue=Xi(ue),It(ae,te,ue,Ee)}if(me(ue))return Ye(ae,te,ue,Ee);if(re(ue)){if(Je=re(ue),typeof Je!="function")throw Error(a(150));return ue=Je.call(ue),rt(ae,te,ue,Ee)}if(typeof ue.then=="function")return It(ae,te,yd(ue),Ee);if(ue.$$typeof===H)return It(ae,te,hd(ae,ue),Ee);vd(ae,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(i(ae,te.sibling),Ee=f(te,ue),Ee.return=ae,ae=Ee):(i(ae,te),Ee=ig(ue,ae.mode,Ee),Ee.return=ae,ae=Ee),E(ae)):i(ae,te)}return function(ae,te,ue,Ee){try{pu=0;var Je=It(ae,te,ue,Ee);return Fs=null,Je}catch(lt){if(lt===Us||lt===gd)throw lt;var Qt=Br(29,lt,null,ae.mode);return Qt.lanes=Ee,Qt.return=ae,Qt}}}var Zi=Qb(!0),Zb=Qb(!1),ei=!1;function yg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vg(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ti(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ni(t,r,i){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(ln&2)!==0){var f=l.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),l.pending=r,r=id(t),Pb(t,null,i),r}return ad(t,l,r,i),id(t)}function gu(t,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194048)!==0)){var l=r.lanes;l&=t.pendingLanes,i|=l,r.lanes=i,On(t,i)}}function bg(t,r){var i=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var f=null,m=null;if(i=i.firstBaseUpdate,i!==null){do{var E={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};m===null?f=m=E:m=m.next=E,i=i.next}while(i!==null);m===null?f=m=r:m=m.next=r}else f=m=r;i={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:l.shared,callbacks:l.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=r:t.next=r,i.lastBaseUpdate=r}var xg=!1;function mu(){if(xg){var t=Hs;if(t!==null)throw t}}function yu(t,r,i,l){xg=!1;var f=t.updateQueue;ei=!1;var m=f.firstBaseUpdate,E=f.lastBaseUpdate,P=f.shared.pending;if(P!==null){f.shared.pending=null;var Q=P,ie=Q.next;Q.next=null,E===null?m=ie:E.next=ie,E=Q;var pe=t.alternate;pe!==null&&(pe=pe.updateQueue,P=pe.lastBaseUpdate,P!==E&&(P===null?pe.firstBaseUpdate=ie:P.next=ie,pe.lastBaseUpdate=Q))}if(m!==null){var Ce=f.baseState;E=0,pe=ie=Q=null,P=m;do{var oe=P.lane&-536870913,fe=oe!==P.lane;if(fe?(Xt&oe)===oe:(l&oe)===oe){oe!==0&&oe===Gi&&(xg=!0),pe!==null&&(pe=pe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ye=t,rt=P;oe=r;var It=i;switch(rt.tag){case 1:if(Ye=rt.payload,typeof Ye=="function"){Ce=Ye.call(It,Ce,oe);break e}Ce=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=rt.payload,oe=typeof Ye=="function"?Ye.call(It,Ce,oe):Ye,oe==null)break e;Ce=j({},Ce,oe);break e;case 2:ei=!0}}oe=P.callback,oe!==null&&(t.flags|=64,fe&&(t.flags|=8192),fe=f.callbacks,fe===null?f.callbacks=[oe]:fe.push(oe))}else fe={lane:oe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},pe===null?(ie=pe=fe,Q=Ce):pe=pe.next=fe,E|=oe;if(P=P.next,P===null){if(P=f.shared.pending,P===null)break;fe=P,P=fe.next,fe.next=null,f.lastBaseUpdate=fe,f.shared.pending=null}}while(!0);pe===null&&(Q=Ce),f.baseState=Q,f.firstBaseUpdate=ie,f.lastBaseUpdate=pe,m===null&&(f.shared.lanes=0),ui|=E,t.lanes=E,t.memoizedState=Ce}}function Jb(t,r){if(typeof t!="function")throw Error(a(191,t));t.call(r)}function Wb(t,r){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)Jb(i[t],r)}var ri=Me(null),bd=Me(0);function ex(t,r){t=Na,Fe(bd,t),Fe(ri,r),Na=t|r.baseLanes}function Sg(){Fe(bd,Na),Fe(ri,ri.current)}function wg(){Na=bd.current,Le(ri),Le(bd)}var mr=Me(null),Rr=null;function oi(t){var r=t.alternate;Fe(yr,yr.current&1),Fe(mr,t),Rr===null&&(r===null||ri.current!==null||r.memoizedState!==null)&&(Rr=t)}function Rg(t){Fe(yr,yr.current),Fe(mr,t),Rr===null&&(Rr=t)}function tx(t){t.tag===22?(Fe(yr,yr.current),Fe(mr,t),Rr===null&&(Rr=t)):ai()}function ai(){Fe(yr,yr.current),Fe(mr,mr.current)}function ro(t){Le(mr),Rr===t&&(Rr=null),Le(yr)}var yr=Me(0);function vu(t,r){Fe(mr,mr.current),Fe(yr,r)}function Eg(t){Le(yr),Le(mr),Rr===t&&(Rr=null)}function xd(t){for(var r=t;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Km(i)||Gm(i)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!=="independent"){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Oa=0,Nt=null,bn=null,Qn=null,Sd=!1,Bs=!1,Ji=!1,wd=0,bu=0,Vs=null,tD=0;function Bn(){throw Error(a(321))}function Cg(t,r){if(r===null)return!1;for(var i=0;i<r.length&&i<t.length;i++)if(!no(t[i],r[i]))return!1;return!0}function Tg(t,r,i,l,f,m){return Oa=m,Nt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,ge.H=t===null||t.memoizedState===null?_x:Hx,Ji=!1,m=i(l,f),Ji=!1,Bs&&(m=rx(r,i,l,f)),nx(t),m}function nx(t){ge.H=Ad;var r=bn!==null&&bn.next!==null;if(Oa=0,Qn=bn=Nt=null,Sd=!1,bu=0,Vs=null,r)throw Error(a(300));t===null||Zn||(t=t.dependencies,t!==null&&fd(t)&&(Zn=!0))}function rx(t,r,i,l){Nt=t;var f=0;do{if(Bs&&(Vs=null),bu=0,Bs=!1,25<=f)throw Error(a(301));if(f+=1,Qn=bn=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}ge.H=uD,m=r(i,l)}while(Bs);return m}function nD(){var t=ge.H,r=t.useState()[0];return r=typeof r.then=="function"?xu(r):r,t=t.useState()[0],(bn!==null?bn.memoizedState:null)!==t&&(Nt.flags|=1024),r}function Og(){var t=wd!==0;return wd=0,t}function Mg(t,r,i){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~i}function Ag(t){if(Sd){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Sd=!1}Oa=0,Qn=bn=Nt=null,Bs=!1,bu=wd=0,Vs=null}function Nr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qn===null?Nt.memoizedState=Qn=t:Qn=Qn.next=t,Qn}function Kn(){if(bn===null){var t=Nt.alternate;t=t!==null?t.memoizedState:null}else t=bn.next;var r=Qn===null?Nt.memoizedState:Qn.next;if(r!==null)Qn=r,bn=t;else{if(t===null)throw Nt.alternate===null?Error(a(467)):Error(a(310));bn=t,t={memoizedState:bn.memoizedState,baseState:bn.baseState,baseQueue:bn.baseQueue,queue:bn.queue,next:null},Qn===null?Nt.memoizedState=Qn=t:Qn=Qn.next=t}return Qn}function Rd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xu(t){var r=bu;return bu+=1,Vs===null&&(Vs=[]),t=Gb(Vs,t,r),r=Nt,(Qn===null?r.memoizedState:Qn.next)===null&&(r=r.alternate,ge.H=r===null||r.memoizedState===null?_x:Hx),t}function Ed(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return xu(t);if(t.$$typeof===B)return;if(t.$$typeof===H)return gr(t)}throw Error(a(438,String(t)))}function Dg(t){var r=null,i=Nt.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var l=Nt.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(f){return f.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),i===null&&(i=Rd(),Nt.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(t),l=0;l<t;l++)i[l]=se;return r.index++,i}function Ma(t,r){return typeof r=="function"?r(t):r}function Cd(t){var r=Kn();return Ng(r,bn,t)}function Ng(t,r,i){var l=t.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=i;var f=t.baseQueue,m=l.pending;if(m!==null){if(f!==null){var E=f.next;f.next=m.next,m.next=E}r.baseQueue=f=m,l.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{r=f.next;var P=E=null,Q=null,ie=r,pe=!1;do{var Ce=ie.lane&-536870913;if(Ce!==ie.lane?(Xt&Ce)===Ce:(Oa&Ce)===Ce){var oe=ie.revertLane;if(oe===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),Ce===Gi&&(pe=!0);else if((Oa&oe)===oe){ie=ie.next,oe===Gi&&(pe=!0);continue}else Ce={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Q===null?(P=Q=Ce,E=m):Q=Q.next=Ce,Nt.lanes|=oe,ui|=oe;Ce=ie.action,Ji&&i(m,Ce),m=ie.hasEagerState?ie.eagerState:i(m,Ce)}else oe={lane:Ce,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Q===null?(P=Q=oe,E=m):Q=Q.next=oe,Nt.lanes|=Ce,ui|=Ce;ie=ie.next}while(ie!==null&&ie!==r);if(Q===null?E=m:Q.next=P,!no(m,t.memoizedState)&&(Zn=!0,pe&&(i=Hs,i!==null)))throw i;t.memoizedState=m,t.baseState=E,t.baseQueue=Q,l.lastRenderedState=m}return f===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function Ig(t){var r=Kn(),i=r.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=t;var l=i.dispatch,f=i.pending,m=r.memoizedState;if(f!==null){i.pending=null;var E=f=f.next;do m=t(m,E.action),E=E.next;while(E!==f);no(m,r.memoizedState)||(Zn=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),i.lastRenderedState=m}return[m,l]}function ox(t,r,i){var l=Nt,f=Kn(),m=Ut;if(m){if(i===void 0)throw Error(a(407));i=i()}else i=r();var E=!no((bn||f).memoizedState,i);if(E&&(f.memoizedState=i,Zn=!0),f=f.queue,kg(sx.bind(null,l,f,t),[t]),t=f.getSnapshot!==r||E||Qn!==null&&(Qn.memoizedState.tag&1)!==0,qs(t?9:8,{destroy:void 0},ix.bind(null,l,f,i,r),null),t){if(l.flags|=2048,Tn===null)throw Error(a(349));m||(Oa&127)!==0||ax(l,r,i)}return i}function ax(t,r,i){t.flags|=16384,t={getSnapshot:r,value:i},r=Nt.updateQueue,r===null?(r=Rd(),Nt.updateQueue=r,r.stores=[t]):(i=r.stores,i===null?r.stores=[t]:i.push(t))}function ix(t,r,i,l){r.value=i,r.getSnapshot=l,lx(r)&&ux(t)}function sx(t,r,i){return i(function(){lx(r)&&ux(t)})}function lx(t){var r=t.getSnapshot;t=t.value;try{var i=r();return!no(t,i)}catch{return!0}}function ux(t){var r=Fi(t,2);r!==null&&Kr(r,t,2)}function jg(t){var r=Nr();if(typeof t=="function"){var i=t;if(t=i(),Ji){Ge(!0);try{i()}finally{Ge(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:t},r}function cx(t,r,i,l){return t.baseState=i,Ng(t,bn,typeof l=="function"?l:Ma)}function rD(t,r,i,l,f){if(Md(t))throw Error(a(485));if(t=r.action,t!==null){var m={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){m.listeners.push(E)}};ge.T!==null?i(!0):m.isTransition=!1,l(m),i=r.pending,i===null?(m.next=r.pending=m,dx(r,m)):(m.next=i.next,r.pending=i.next=m)}}function dx(t,r){var i=r.action,l=r.payload,f=t.state;if(r.isTransition){var m=ge.T,E={};E.types=m!==null?m.types:null,ge.T=E;try{var P=i(f,l),Q=ge.S;Q!==null&&Q(E,P),fx(t,r,P)}catch(ie){Pg(t,r,ie)}finally{m!==null&&E.types!==null&&(m.types=E.types),ge.T=m}}else try{m=i(f,l),fx(t,r,m)}catch(ie){Pg(t,r,ie)}}function fx(t,r,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){hx(t,r,l)},function(l){return Pg(t,r,l)}):hx(t,r,i)}function hx(t,r,i){r.status="fulfilled",r.value=i,px(r),t.state=i,r=t.pending,r!==null&&(i=r.next,i===r?t.pending=null:(i=i.next,r.next=i,dx(t,i)))}function Pg(t,r,i){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=i,px(r),r=r.next;while(r!==l)}t.action=null}function px(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function gx(t,r){return r}function mx(t,r){if(Ut){var i=Tn.formState;if(i!==null){e:{var l=Nt;if(Ut){if(An){t:{for(var f=An,m=So;f.nodeType!==8;){if(!m){f=null;break t}if(f=Ro(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){An=Ro(f.nextSibling),l=f.data==="F!";break e}}Za(l)}l=!1}l&&(r=i[0])}}return i=Nr(),i.memoizedState=i.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gx,lastRenderedState:r},i.queue=l,i=kx.bind(null,Nt,l),l.dispatch=i,l=jg(!1),m=Ug.bind(null,Nt,!1,l.queue),l=Nr(),f={state:r,dispatch:null,action:t,pending:null},l.queue=f,i=rD.bind(null,Nt,f,m,i),f.dispatch=i,l.memoizedState=t,[r,i,!1]}function yx(t){var r=Kn();return vx(r,bn,t)}function vx(t,r,i){if(r=Ng(t,r,gx)[0],t=Cd(Ma)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var l=xu(r)}catch(E){throw E===Us?gd:E}else l=r;r=Kn();var f=r.queue,m=f.dispatch;return i!==r.memoizedState&&(Nt.flags|=2048,qs(9,{destroy:void 0},oD.bind(null,f,i),null)),[l,m,t]}function oD(t,r){t.action=r}function bx(t){var r=Kn(),i=bn;if(i!==null)return vx(r,i,t);Kn(),r=r.memoizedState,i=Kn();var l=i.queue.dispatch;return i.memoizedState=t,[r,l,!1]}function qs(t,r,i,l){return t={tag:t,create:i,deps:l,inst:r,next:null},r=Nt.updateQueue,r===null&&(r=Rd(),Nt.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=t.next=t:(l=i.next,i.next=t,t.next=l,r.lastEffect=t),t}function xx(){return Kn().memoizedState}function Td(t,r,i,l){var f=Nr();Nt.flags|=t,f.memoizedState=qs(1|r,{destroy:void 0},i,l===void 0?null:l)}function Od(t,r,i,l){var f=Kn();l=l===void 0?null:l;var m=f.memoizedState.inst;bn!==null&&l!==null&&Cg(l,bn.memoizedState.deps)?f.memoizedState=qs(r,m,i,l):(Nt.flags|=t,f.memoizedState=qs(1|r,m,i,l))}function Sx(t,r){Td(8390656,8,t,r)}function kg(t,r){Od(2048,8,t,r)}function aD(t){Nt.flags|=4;var r=Nt.updateQueue;if(r===null)r=Rd(),Nt.updateQueue=r,r.events=[t];else{var i=r.events;i===null?r.events=[t]:i.push(t)}}function wx(t){var r=Kn().memoizedState;return aD({ref:r,nextImpl:t}),function(){if((ln&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function Rx(t,r){return Od(4,2,t,r)}function Ex(t,r){return Od(4,4,t,r)}function Cx(t,r){if(typeof r=="function"){t=t();var i=r(t);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Tx(t,r,i){i=i!=null?i.concat([t]):null,Od(4,4,Cx.bind(null,r,t),i)}function Lg(){}function Ox(t,r){var i=Kn();r=r===void 0?null:r;var l=i.memoizedState;return r!==null&&Cg(r,l[1])?l[0]:(i.memoizedState=[t,r],t)}function Mx(t,r){var i=Kn();r=r===void 0?null:r;var l=i.memoizedState;if(r!==null&&Cg(r,l[1]))return l[0];if(l=t(),Ji){Ge(!0);try{t()}finally{Ge(!1)}}return i.memoizedState=[l,r],l}function zg(t,r,i){return i===void 0||(Oa&1073741824)!==0&&(Xt&261930)===0?t.memoizedState=r:(t.memoizedState=i,t=_2(),Nt.lanes|=t,ui|=t,i)}function Ax(t,r,i,l){return no(i,r)?i:ri.current!==null?(t=zg(t,i,l),no(t,r)||(Zn=!0),t):(Oa&106)===0||(Oa&1073741824)!==0&&(Xt&261930)===0?(Zn=!0,t.memoizedState=i):(t=_2(),Nt.lanes|=t,ui|=t,r)}function Dx(t,r,i,l,f){var m=ce.p;ce.p=m!==0&&8>m?m:8;var E=ge.T,P={};P.types=E!==null?E.types:null,ge.T=P,Ug(t,!1,r,i);try{var Q=f(),ie=ge.S;if(ie!==null&&ie(P,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var pe=eD(Q,l);Su(t,r,pe,so(t))}else Su(t,r,l,so(t))}catch(Ce){Su(t,r,{then:function(){},status:"rejected",reason:Ce},so())}finally{ce.p=m,E!==null&&P.types!==null&&(E.types=P.types),ge.T=E}}function iD(){}function _g(t,r,i,l){if(t.tag!==5)throw Error(a(476));var f=Nx(t).queue;Dx(t,f,r,Te,i===null?iD:function(){return Ix(t),i(l)})}function Nx(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Te,baseState:Te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:Te},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:i},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Ix(t){var r=Nx(t);r.next===null&&(r=t.alternate.memoizedState),Su(t,r.next.queue,{},so())}function Hg(){return gr(ul)}function jx(){return Kn().memoizedState}function Px(){return Kn().memoizedState}function sD(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var i=so();t=ti(i);var l=ni(r,t,i);l!==null&&(Kr(l,r,i),gu(l,r,i)),r={cache:hg()},t.payload=r;return}r=r.return}}function lD(t,r,i){var l=so();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Md(t)?Lx(r,i):(i=og(t,r,i,l),i!==null&&(Kr(i,t,l),zx(i,r,l)))}function kx(t,r,i){var l=so();Su(t,r,i,l)}function Su(t,r,i,l){var f={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Md(t))Lx(r,f);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var E=r.lastRenderedState,P=m(E,i);if(f.hasEagerState=!0,f.eagerState=P,no(P,E))return ad(t,r,f,0),Tn===null&&od(),!1}catch{}if(i=og(t,r,f,l),i!==null)return Kr(i,t,l),zx(i,r,l),!0}return!1}function Ug(t,r,i,l){if(l={lane:2,revertLane:Dm(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Md(t)){if(r)throw Error(a(479))}else r=og(t,i,l,2),r!==null&&Kr(r,t,2)}function Md(t){var r=t.alternate;return t===Nt||r!==null&&r===Nt}function Lx(t,r){Bs=Sd=!0;var i=t.pending;i===null?r.next=r:(r.next=i.next,i.next=r),t.pending=r}function zx(t,r,i){if((i&4194048)!==0){var l=r.lanes;l&=t.pendingLanes,i|=l,r.lanes=i,On(t,i)}}var Ad={readContext:gr,use:Ed,useCallback:Bn,useContext:Bn,useEffect:Bn,useImperativeHandle:Bn,useLayoutEffect:Bn,useInsertionEffect:Bn,useMemo:Bn,useReducer:Bn,useRef:Bn,useState:Bn,useDebugValue:Bn,useDeferredValue:Bn,useTransition:Bn,useSyncExternalStore:Bn,useId:Bn,useHostTransitionStatus:Bn,useFormState:Bn,useActionState:Bn,useOptimistic:Bn,useMemoCache:Bn,useCacheRefresh:Bn,useEffectEvent:Bn},_x={readContext:gr,use:Ed,useCallback:function(t,r){return Nr().memoizedState=[t,r===void 0?null:r],t},useContext:gr,useEffect:Sx,useImperativeHandle:function(t,r,i){i=i!=null?i.concat([t]):null,Td(4194308,4,Cx.bind(null,r,t),i)},useLayoutEffect:function(t,r){return Td(4194308,4,t,r)},useInsertionEffect:function(t,r){Td(4,2,t,r)},useMemo:function(t,r){var i=Nr();r=r===void 0?null:r;var l=t();if(Ji){Ge(!0);try{t()}finally{Ge(!1)}}return i.memoizedState=[l,r],l},useReducer:function(t,r,i){var l=Nr();if(i!==void 0){var f=i(r);if(Ji){Ge(!0);try{i(r)}finally{Ge(!1)}}}else f=r;return l.memoizedState=l.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},l.queue=t,t=t.dispatch=lD.bind(null,Nt,t),[l.memoizedState,t]},useRef:function(t){var r=Nr();return t={current:t},r.memoizedState=t},useState:function(t){t=jg(t);var r=t.queue,i=kx.bind(null,Nt,r);return r.dispatch=i,[t.memoizedState,i]},useDebugValue:Lg,useDeferredValue:function(t,r){var i=Nr();return zg(i,t,r)},useTransition:function(){var t=jg(!1);return t=Dx.bind(null,Nt,t.queue,!0,!1),Nr().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,i){var l=Nt,f=Nr();if(Ut){if(i===void 0)throw Error(a(407));i=i()}else{if(i=r(),Tn===null)throw Error(a(349));(Xt&127)!==0||ax(l,r,i)}f.memoizedState=i;var m={value:i,getSnapshot:r};return f.queue=m,Sx(sx.bind(null,l,m,t),[t]),l.flags|=2048,qs(9,{destroy:void 0},ix.bind(null,l,m,i,r),null),i},useId:function(){var t=Nr(),r=Tn.identifierPrefix;if(Ut){var i=Qo,l=Xo;i=(l&~(1<<32-et(l)-1)).toString(32)+i,r="_"+r+"R_"+i,i=wd++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=tD++,r="_"+r+"r_"+i.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Hg,useFormState:mx,useActionState:mx,useOptimistic:function(t){var r=Nr();r.memoizedState=r.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=Ug.bind(null,Nt,!0,i),i.dispatch=r,[t,r]},useMemoCache:Dg,useCacheRefresh:function(){return Nr().memoizedState=sD.bind(null,Nt)},useEffectEvent:function(t){var r=Nr(),i={impl:t};return r.memoizedState=i,function(){if((ln&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}},Hx={readContext:gr,use:Ed,useCallback:Ox,useContext:gr,useEffect:kg,useImperativeHandle:Tx,useInsertionEffect:Rx,useLayoutEffect:Ex,useMemo:Mx,useReducer:Cd,useRef:xx,useState:function(){return Cd(Ma)},useDebugValue:Lg,useDeferredValue:function(t,r){var i=Kn();return Ax(i,bn.memoizedState,t,r)},useTransition:function(){var t=Cd(Ma)[0],r=Kn().memoizedState;return[typeof t=="boolean"?t:xu(t),r]},useSyncExternalStore:ox,useId:jx,useHostTransitionStatus:Hg,useFormState:yx,useActionState:yx,useOptimistic:function(t,r){var i=Kn();return cx(i,bn,t,r)},useMemoCache:Dg,useCacheRefresh:Px,useEffectEvent:wx},uD={readContext:gr,use:Ed,useCallback:Ox,useContext:gr,useEffect:kg,useImperativeHandle:Tx,useInsertionEffect:Rx,useLayoutEffect:Ex,useMemo:Mx,useReducer:Ig,useRef:xx,useState:function(){return Ig(Ma)},useDebugValue:Lg,useDeferredValue:function(t,r){var i=Kn();return bn===null?zg(i,t,r):Ax(i,bn.memoizedState,t,r)},useTransition:function(){var t=Ig(Ma)[0],r=Kn().memoizedState;return[typeof t=="boolean"?t:xu(t),r]},useSyncExternalStore:ox,useId:jx,useHostTransitionStatus:Hg,useFormState:bx,useActionState:bx,useOptimistic:function(t,r){var i=Kn();return bn!==null?cx(i,bn,t,r):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:Dg,useCacheRefresh:Px,useEffectEvent:wx};function Fg(t,r,i,l){r=t.memoizedState,i=i(l,r),i=i==null?r:j({},r,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var Bg={enqueueSetState:function(t,r,i){t=t._reactInternals;var l=so(),f=ti(l);f.payload=r,i!=null&&(f.callback=i),r=ni(t,f,l),r!==null&&(Kr(r,t,l),gu(r,t,l))},enqueueReplaceState:function(t,r,i){t=t._reactInternals;var l=so(),f=ti(l);f.tag=1,f.payload=r,i!=null&&(f.callback=i),r=ni(t,f,l),r!==null&&(Kr(r,t,l),gu(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var i=so(),l=ti(i);l.tag=2,r!=null&&(l.callback=r),r=ni(t,l,i),r!==null&&(Kr(r,t,i),gu(r,t,i))}};function Ux(t,r,i,l,f,m,E){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,m,E):r.prototype&&r.prototype.isPureReactComponent?!su(i,l)||!su(f,m):!0}function Fx(t,r,i,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,l),r.state!==t&&Bg.enqueueReplaceState(r,r.state,null)}function Wi(t,r){var i=r;if("ref"in r){i={};for(var l in r)l!=="ref"&&(i[l]=r[l])}if(t=t.defaultProps){i===r&&(i=j({},i));for(var f in t)i[f]===void 0&&(i[f]=t[f])}return i}function Bx(t){rd(t)}function Vx(t){console.error(t)}function qx(t){rd(t)}function Dd(t,r){try{var i=t.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function Yx(t,r,i){try{var l=t.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Vg(t,r,i){return i=ti(i),i.tag=3,i.payload={element:null},i.callback=function(){Dd(t,r)},i}function Kx(t){return t=ti(t),t.tag=3,t}function Gx(t,r,i,l){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var m=l.value;t.payload=function(){return f(m)},t.callback=function(){Yx(r,i,l)}}var E=i.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(t.callback=function(){Yx(r,i,l),typeof f!="function"&&(ci===null?ci=new Set([this]):ci.add(this));var P=l.stack;this.componentDidCatch(l.value,{componentStack:P!==null?P:""})})}function cD(t,r,i,l,f){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(r=i.alternate,r!==null&&Yi(r,i,f,!0),i=mr.current,i!==null){switch(i.tag){case 31:case 13:case 19:return Rr===null?Zd():i.alternate===null&&Vn===0&&(Vn=3),i.flags&=-257,i.flags|=65536,i.lanes=f,l===md?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([l]):r.add(l),Om(t,l,f)),!1;case 22:return i.flags|=65536,l===md?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([l]):i.add(l)),Om(t,l,f)),!1}throw Error(a(435,i.tag))}return Om(t,l,f),Zd(),!1}if(Ut)return r=mr.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=f,l!==ug&&(t=Error(a(422),{cause:l}),cu(vo(t,i)))):(l!==ug&&(r=Error(a(423),{cause:l}),cu(vo(r,i))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,l=vo(l,i),f=Vg(t.stateNode,l,f),bg(t,f),Vn!==4&&(Vn=2)),!1;var m=Error(a(520),{cause:l});if(m=vo(m,i),Au===null?Au=[m]:Au.push(m),Vn!==4&&(Vn=2),r===null)return!0;l=vo(l,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,t=f&-f,i.lanes|=t,t=Vg(i.stateNode,l,t),bg(i,t),!1;case 1:if(r=i.type,m=i.stateNode,(i.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(ci===null||!ci.has(m))))return i.flags|=65536,f&=-f,i.lanes|=f,f=Kx(f),Gx(f,t,i,l),bg(i,f),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var qg=Error(a(461)),Zn=!1;function rr(t,r,i,l){r.child=t===null?Zb(r,null,i,l):Zi(r,t.child,i,l)}function $x(t,r,i,l,f){i=i.render;var m=r.ref;if("ref"in l){var E={};for(var P in l)P!=="ref"&&(E[P]=l[P])}else E=l;return Ki(r),l=Tg(t,r,i,E,m,f),P=Og(),t!==null&&!Zn?(Mg(t,r,f),Aa(t,r,f)):(Ut&&P&&ud(r),r.flags|=1,rr(t,r,l,f),r.child)}function Xx(t,r,i,l,f){if(t===null){var m=i.type;return typeof m=="function"&&!ag(m)&&m.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=m,Qx(t,r,m,l,f)):(t=sd(i.type,null,l,r,r.mode,f),t.ref=r.ref,t.return=r,r.child=t)}if(m=t.child,!Jg(t,f)){var E=m.memoizedProps;if(i=i.compare,i=i!==null?i:su,i(E,l)&&t.ref===r.ref)return Aa(t,r,f)}return r.flags|=1,t=Ra(m,l),t.ref=r.ref,t.return=r,r.child=t}function Qx(t,r,i,l,f){if(t!==null){var m=t.memoizedProps;if(su(m,l)&&t.ref===r.ref)if(Zn=!1,r.pendingProps=l=m,Jg(t,f))(t.flags&131072)!==0&&(Zn=!0);else return r.lanes=t.lanes,Aa(t,r,f)}return Yg(t,r,i,l,f)}function Zx(t,r,i,l){var f=l.children,m=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((r.flags&128)!==0){if(m=m!==null?m.baseLanes|i:i,t!==null){for(l=r.child=t.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~m}else l=0,r.child=null;return Jx(t,r,m,i,l)}if((i&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&pd(r,m!==null?m.cachePool:null),m!==null?ex(r,m):Sg(),tx(r);else return l=r.lanes=536870912,Jx(t,r,m!==null?m.baseLanes|i:i,i,l)}else m!==null?(pd(r,m.cachePool),ex(r,m),ai(),r.memoizedState=null):(t!==null&&pd(r,null),Sg(),ai());return rr(t,r,f,i),r.child}function wu(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Jx(t,r,i,l,f){var m=gg();return m=m===null?null:{parent:Xn._currentValue,pool:m},r.memoizedState={baseLanes:i,cachePool:m},t!==null&&pd(r,null),Sg(),tx(r),t!==null&&Yi(t,r,l,!0),r.childLanes=f,null}function Nd(t,r){return r=Id({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Wx(t,r,i){return Zi(r,t.child,null,i),t=Nd(r,r.pendingProps),t.flags|=2,ro(r),r.memoizedState=null,t}function dD(t,r,i){var l=r.pendingProps,f=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(Ut){if(l.mode==="hidden")return t=Nd(r,l),r.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},wu(null,t);if(Rg(r),(t=An)?(t=C1(t,So),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Xa!==null?{id:Xo,overflow:Qo}:null,retryLane:536870912,hydrationErrors:null},i=Lb(t),i.return=r,r.child=i,ir=r,An=null)):t=null,t===null)throw Za(r);return r.lanes=536870912,null}return Nd(r,l)}var m=t.memoizedState;if(m!==null){var E=m.dehydrated;if(Rg(r),f)if(r.flags&256)r.flags&=-257,r=Wx(t,r,i);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(a(558));else if(Zn||Yi(t,r,i,!1),f=(i&t.childLanes)!==0,Zn||f){if(ri.current===null){if(l=Tn,l!==null&&(E=Vt(l,i),E!==0&&E!==m.retryLane))throw m.retryLane=E,Fi(t,E),Kr(l,t,E),qg;Zd()}r=Wx(t,r,i)}else t=m.treeContext,An=Ro(E.nextSibling),ir=r,Ut=!0,Qa=null,So=!1,t!==null&&Hb(r,t),r=Nd(r,l),r.flags|=134221824;return r}return t=Ra(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Ys(t,r){var i=r.ref;if(i===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(a(284));(t===null||t.ref!==i)&&(r.flags|=4194816)}}function Yg(t,r,i,l,f){return Ki(r),i=Tg(t,r,i,l,void 0,f),l=Og(),t!==null&&!Zn?(Mg(t,r,f),Aa(t,r,f)):(Ut&&l&&ud(r),r.flags|=1,rr(t,r,i,f),r.child)}function e2(t,r,i,l,f,m){return Ki(r),r.updateQueue=null,i=rx(r,l,i,f),nx(t),l=Og(),t!==null&&!Zn?(Mg(t,r,m),Aa(t,r,m)):(Ut&&l&&ud(r),r.flags|=1,rr(t,r,i,m),r.child)}function t2(t,r,i,l,f){if(Ki(r),r.stateNode===null){var m=ks,E=i.contextType;typeof E=="object"&&E!==null&&(m=gr(E)),m=new i(l,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Bg,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=l,m.state=r.memoizedState,m.refs={},yg(r),E=i.contextType,m.context=typeof E=="object"&&E!==null?gr(E):ks,m.state=r.memoizedState,E=i.getDerivedStateFromProps,typeof E=="function"&&(Fg(r,i,E,l),m.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(E=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),E!==m.state&&Bg.enqueueReplaceState(m,m.state,null),yu(r,l,m,f),mu(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){m=r.stateNode;var P=r.memoizedProps,Q=Wi(i,P);m.props=Q;var ie=m.context,pe=i.contextType;E=ks,typeof pe=="object"&&pe!==null&&(E=gr(pe));var Ce=i.getDerivedStateFromProps;pe=typeof Ce=="function"||typeof m.getSnapshotBeforeUpdate=="function",P=r.pendingProps!==P,pe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(P||ie!==E)&&Fx(r,m,l,E),ei=!1;var oe=r.memoizedState;m.state=oe,yu(r,l,m,f),mu(),ie=r.memoizedState,P||oe!==ie||ei?(typeof Ce=="function"&&(Fg(r,i,Ce,l),ie=r.memoizedState),(Q=ei||Ux(r,i,Q,l,oe,ie,E))?(pe||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=ie),m.props=l,m.state=ie,m.context=E,l=Q):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{m=r.stateNode,vg(t,r),E=r.memoizedProps,pe=Wi(i,E),m.props=pe,Ce=r.pendingProps,oe=m.context,ie=i.contextType,Q=ks,typeof ie=="object"&&ie!==null&&(Q=gr(ie)),P=i.getDerivedStateFromProps,(ie=typeof P=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(E!==Ce||oe!==Q)&&Fx(r,m,l,Q),ei=!1,oe=r.memoizedState,m.state=oe,yu(r,l,m,f),mu();var fe=r.memoizedState;E!==Ce||oe!==fe||ei||t!==null&&t.dependencies!==null&&fd(t.dependencies)?(typeof P=="function"&&(Fg(r,i,P,l),fe=r.memoizedState),(pe=ei||Ux(r,i,pe,l,oe,fe,Q)||t!==null&&t.dependencies!==null&&fd(t.dependencies))?(ie||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,fe,Q),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,fe,Q)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||E===t.memoizedProps&&oe===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||E===t.memoizedProps&&oe===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=fe),m.props=l,m.state=fe,m.context=Q,l=pe):(typeof m.componentDidUpdate!="function"||E===t.memoizedProps&&oe===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||E===t.memoizedProps&&oe===t.memoizedState||(r.flags|=1024),l=!1)}return m=l,Ys(t,r),l=(r.flags&128)!==0,m||l?(m=r.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,t!==null&&l?(r.child=Zi(r,t.child,null,f),r.child=Zi(r,null,i,f)):rr(t,r,i,f),r.memoizedState=m.state,t=r.child):t=Aa(t,r,f),t}function n2(t,r,i,l){return Vi(),r.flags|=256,rr(t,r,i,l),r.child}var Kg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gg(t){return{baseLanes:t,cachePool:Yb()}}function $g(t,r,i){return t=t!==null?t.childLanes&~i:0,r&&(t|=io),t}function r2(t,r,i){var l=r.pendingProps,f=!1,m=(r.flags&128)!==0,E;if((E=m)||(E=t!==null&&t.memoizedState===null?!1:(yr.current&2)!==0),E&&(f=!0,r.flags&=-129),E=(r.flags&32)!==0,r.flags&=-33,t===null){if(Ut){if(f?oi(r):ai(),(t=An)?(t=C1(t,So),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Xa!==null?{id:Xo,overflow:Qo}:null,retryLane:536870912,hydrationErrors:null},i=Lb(t),i.return=r,r.child=i,ir=r,An=null)):t=null,t===null)throw Za(r);return Gm(t)?r.lanes=32:r.lanes=536870912,null}return m=l.children,l=l.fallback,f?(ai(),f=r.mode,m=Id({mode:"hidden",children:m},f),l=Bi(l,f,i,null),m.return=r,l.return=r,m.sibling=l,r.child=m,l=r.child,l.memoizedState=Gg(i),l.childLanes=$g(t,E,i),r.memoizedState=Kg,wu(null,l)):(oi(r),Xg(r,m))}var P=t.memoizedState;if(P!==null){var Q=P.dehydrated;if(Q!==null)return fD(t,r,m,E,l,Q,P,i)}return f?(ai(),f=l.fallback,m=r.mode,P=t.child,Q=P.sibling,l=Ra(P,{mode:"hidden",children:l.children}),l.subtreeFlags=P.subtreeFlags&1206910976,Q!==null?f=Ra(Q,f):(f=Bi(f,m,i,null),f.flags|=2),f.return=r,l.return=r,l.sibling=f,r.child=l,wu(null,l),l=r.child,f=t.child.memoizedState,f===null?f=Gg(i):(m=f.cachePool,m!==null?(P=Xn._currentValue,m=m.parent!==P?{parent:P,pool:P}:m):m=Yb(),f={baseLanes:f.baseLanes|i,cachePool:m}),l.memoizedState=f,l.childLanes=$g(t,E,i),r.memoizedState=Kg,wu(t.child,l)):(oi(r),i=t.child,t=i.sibling,i=Ra(i,{mode:"visible",children:l.children}),i.return=r,i.sibling=null,t!==null&&(E=r.deletions,E===null?(r.deletions=[t],r.flags|=16):E.push(t)),r.child=i,r.memoizedState=null,i)}function Xg(t,r){return r=Id({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Id(t,r){return t=Br(22,t,null,r),t.lanes=0,t}function jd(t,r,i){return Zi(r,t.child,null,i),t=Xg(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function fD(t,r,i,l,f,m,E,P){if(i)return r.flags&256?(oi(r),r.flags&=-257,jd(t,r,P)):r.memoizedState!==null?(ai(),r.child=t.child,r.flags|=128,null):(ai(),m=f.fallback,E=r.mode,f=Id({mode:"visible",children:f.children},E),m=Bi(m,E,P,null),m.flags|=2,f.return=r,m.return=r,f.sibling=m,r.child=f,Zi(r,t.child,null,P),f=r.child,f.memoizedState=Gg(P),f.childLanes=$g(t,l,P),r.memoizedState=Kg,wu(null,f));if(oi(r),Gm(m)){if(l=m.nextSibling&&m.nextSibling.dataset,l)var Q=l.dgst;return l=Q,l!==""&&(f=Error(a(419)),f.stack="",f.digest=l,cu({value:f,source:null,stack:null})),jd(t,r,P)}if(Zn||Yi(t,r,P,!1),l=(P&t.childLanes)!==0,Zn||l){if(ri.current!==null)return jd(t,r,P);if(l=Tn,l!==null&&(f=Vt(l,P),f!==0&&f!==E.retryLane))throw E.retryLane=f,Fi(t,f),Kr(l,t,f),qg;return Km(m)||Zd(),jd(t,r,P)}return Km(m)?(r.flags|=192,r.child=t.child,null):(t=E.treeContext,An=Ro(m.nextSibling),ir=r,Ut=!0,Qa=null,So=!1,t!==null&&Hb(r,t),r=Xg(r,f.children),r.flags|=134221824,r)}function o2(t,r,i){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),dd(t.return,r,i)}function a2(t){for(var r=null;t!==null;){var i=t.alternate;i!==null&&xd(i)===null&&(r=t),t=t.sibling}return r}function Pd(t,r,i,l,f,m){var E=t.memoizedState;E===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:f,treeForkCount:m}:(E.isBackwards=r,E.rendering=null,E.renderingStartTime=0,E.last=l,E.tail=i,E.tailMode=f,E.treeForkCount=m)}function Qg(t){var r=t.child;for(t.child=null;r!==null;){var i=r.sibling;r.sibling=t.child,t.child=r,r=i}}function Zg(t,r,i){var l=r.pendingProps,f=l.revealOrder,m=l.tail;l=l.children;var E=yr.current;if(r.flags&128)return vu(r,E),null;var P=(E&2)!==0;if(P?(E=E&1|2,r.flags|=128):E&=1,vu(r,E),f==="backwards"&&t!==null?(Qg(t),rr(t,r,l,i),Qg(t)):rr(t,r,l,i),l=Ut?uu:0,!P&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&o2(t,i,r);else if(t.tag===19)o2(t,i,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"backwards":i=a2(r.child),i===null?(f=r.child,r.child=null):(f=i.sibling,i.sibling=null,Qg(r)),Pd(r,!0,f,null,m,l);break;case"unstable_legacy-backwards":for(i=null,f=r.child,r.child=null;f!==null;){if(t=f.alternate,t!==null&&xd(t)===null){r.child=f;break}t=f.sibling,f.sibling=i,i=f,f=t}Pd(r,!0,i,null,m,l);break;case"together":Pd(r,!1,null,null,void 0,l);break;case"independent":r.memoizedState=null;break;default:i=a2(r.child),i===null?(f=r.child,r.child=null):(f=i.sibling,i.sibling=null),Pd(r,!1,f,i,m,l)}return r.child}function i2(t,r,i){var l=r.pendingProps;return Ja(r,r.type,l.value),rr(t,r,l.children,i),r.child}function Aa(t,r,i){if(t!==null&&(r.dependencies=t.dependencies),ui|=r.lanes,(i&r.childLanes)===0)if(t!==null){if(Yi(t,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(a(153));if(r.child!==null){for(t=r.child,i=Ra(t,t.pendingProps),r.child=i,i.return=r;t.sibling!==null;)t=t.sibling,i=i.sibling=Ra(t,t.pendingProps),i.return=r;i.sibling=null}return r.child}function Jg(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&fd(t)))}function hD(t,r,i){switch(r.tag){case 3:Qe(r,r.stateNode.containerInfo),Ja(r,Xn,t.memoizedState.cache),Vi();break;case 27:case 5:de(r);break;case 4:Qe(r,r.stateNode.containerInfo);break;case 10:Ja(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Rg(r),null;break;case 13:var l=r.memoizedState;if(l!==null){if(l.dehydrated!==null)return oi(r),r.flags|=128,null;l=Yi(t,r,i,!1);var f=r.child.childLanes;return l||(i&f)!==0?r2(t,r,i):(oi(r),t=Aa(t,r,i),t!==null?t.sibling:null)}oi(r);break;case 19:if(r.flags&128)return Zg(t,r,i);if(f=(t.flags&128)!==0,l=(i&r.childLanes)!==0,l||(Yi(t,r,i,!1),l=(i&r.childLanes)!==0),f){if(l)return Zg(t,r,i);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),vu(r,yr.current),l)break;return null;case 22:return r.lanes=0,Zx(t,r,i,r.pendingProps);case 24:Ja(r,Xn,t.memoizedState.cache)}return Aa(t,r,i)}function s2(t,r,i){if(t!==null)if(t.memoizedProps!==r.pendingProps)Zn=!0;else{if(!Jg(t,i)&&(r.flags&128)===0)return Zn=!1,hD(t,r,i);Zn=(t.flags&131072)!==0}else Zn=!1,Ut&&(r.flags&1048576)!==0&&_b(r,uu,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(t=Xi(r.elementType),r.type=t,typeof t=="function")ag(t)?(l=Wi(t,l),r.tag=1,r=t2(null,r,t,l,i)):(r.tag=0,r=Yg(null,r,t,l,i));else{if(t!=null){var f=t.$$typeof;if(f===L){r.tag=11,r=$x(null,r,t,l,i);break e}else if(f===V){r.tag=14,r=Xx(null,r,t,l,i);break e}else if(f===H){r.tag=10,r.type=t,r=i2(null,r,i);break e}}throw r=le(t)||t,Error(a(306,r,""))}}return r;case 0:return Yg(t,r,r.type,r.pendingProps,i);case 1:return l=r.type,f=Wi(l,r.pendingProps),t2(t,r,l,f,i);case 3:e:{if(Qe(r,r.stateNode.containerInfo),t===null)throw Error(a(387));l=r.pendingProps;var m=r.memoizedState;f=m.element,vg(t,r),yu(r,l,null,i);var E=r.memoizedState;if(l=E.cache,Ja(r,Xn,l),l!==m.cache&&fg(r,[Xn],i,!0),mu(),l=E.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:E.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=n2(t,r,l,i);break e}else if(l!==f){f=vo(Error(a(424)),r),cu(f),r=n2(t,r,l,i);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,An=Ro(t.firstChild),ir=r,Ut=!0,Qa=null,So=!0,i=Zb(r,null,l,i),r.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling;else{if(Vi(),l===f){r=Aa(t,r,i);break e}rr(t,r,l,i)}r=r.child}return r;case 26:return Ys(t,r),t===null?(i=I1(r.type,null,r.pendingProps,null))?r.memoizedState=i:Ut||(r.stateNode=d1(r.type,r.pendingProps,be.current,r)):r.memoizedState=I1(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return de(r),t===null&&Ut&&(l=r.stateNode=M1(r.type,r.pendingProps,be.current),ir=r,So=!0,f=An,hi(r.type)?($m=f,An=Ro(l.firstChild)):An=f),rr(t,r,r.pendingProps.children,i),Ys(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&Ut&&((f=l=An)&&(l=sN(l,r.type,r.pendingProps,So),l!==null?(r.stateNode=l,ir=r,An=Ro(l.firstChild),So=!1,f=!0):f=!1),f||Za(r)),de(r),f=r.type,m=r.pendingProps,E=t!==null?t.memoizedProps:null,l=m.children,Hm(f,m)?l=null:E!==null&&Hm(f,E)&&(r.flags|=32),r.memoizedState!==null&&(f=Tg(t,r,nD,null,null,i),ul._currentValue=f),Ys(t,r),rr(t,r,l,i),r.child;case 6:return t===null&&Ut&&((t=i=An)&&(i=lN(i,r.pendingProps,So),i!==null?(r.stateNode=i,ir=r,An=null,t=!0):t=!1),t||Za(r)),null;case 13:return r2(t,r,i);case 4:return Qe(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=Zi(r,null,l,i):rr(t,r,l,i),r.child;case 11:return $x(t,r,r.type,r.pendingProps,i);case 7:return l=r.pendingProps,Ys(t,r),rr(t,r,l,i),r.child;case 8:return rr(t,r,r.pendingProps.children,i),r.child;case 12:return rr(t,r,r.pendingProps.children,i),r.child;case 10:return i2(t,r,i);case 9:return f=r.type._context,l=r.pendingProps.children,Ki(r),f=gr(f),l=l(f),r.flags|=1,rr(t,r,l,i),r.child;case 14:return Xx(t,r,r.type,r.pendingProps,i);case 15:return Qx(t,r,r.type,r.pendingProps,i);case 19:return Zg(t,r,i);case 31:return dD(t,r,i);case 22:return Zx(t,r,i,r.pendingProps);case 24:return Ki(r),l=gr(Xn),t===null?(f=gg(),f===null&&(f=Tn,m=hg(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=i),f=m),r.memoizedState={parent:l,cache:f},yg(r),Ja(r,Xn,f)):((t.lanes&i)!==0&&(vg(t,r),yu(r,null,null,i),mu()),f=t.memoizedState,m=r.memoizedState,f.parent!==l?(f={parent:l,cache:l},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),Ja(r,Xn,l)):(l=m.cache,Ja(r,Xn,l),l!==f.cache&&fg(r,[Xn],i,!0))),rr(t,r,r.pendingProps.children,i),r.child;case 30:return r.stateNode===null&&(r.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=r.pendingProps,l.name!=null&&l.name!=="auto"?r.flags|=t===null?18882560:18874368:Ut&&ud(r),t!==null&&t.memoizedProps.name!==l.name?r.flags|=4194816:Ys(t,r),rr(t,r,l.children,i),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function Da(t){t.flags|=4}function Wg(t,r,i,l,f){var m;if((m=(t.mode&32)!==0)&&(m=i===null?L1(r,l):L1(r,l)&&(l.src!==i.src||l.srcSet!==i.srcSet)),m){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(B2())t.flags|=8192;else throw Qi=md,mg}else t.flags&=-16777217}function l2(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!z1(r))if(B2())t.flags|=8192;else throw Qi=md,mg}function kd(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?tt():536870912,t.lanes|=r,Qs|=r)}function Ru(t,r){if(!Ut)switch(t.tailMode){case"visible":break;case"collapsed":for(var i=t.tail,l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null;break;default:for(r=t.tail,i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t.tail=null:i.sibling=null}}function Dn(t){var r=t.alternate!==null&&t.alternate.child===t.child,i=0,l=0;if(r)for(var f=t.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags&1206910976,l|=f.flags&1206910976,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=l,t.childLanes=i,r}function pD(t,r,i){var l=r.pendingProps;switch(lg(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dn(r),null;case 1:return Dn(r),null;case 3:return i=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Ta(Xn),it(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(_s(r)?Da(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,cg())),Dn(r),null;case 26:var f=r.type,m=r.memoizedState;return t===null?(Da(r),m!==null?(Dn(r),l2(r,m)):(Dn(r),Wg(r,f,null,l,i))):m?m!==t.memoizedState?(Da(r),Dn(r),l2(r,m)):(Dn(r),r.flags&=-16777217):(t=t.memoizedProps,t!==l&&Da(r),Dn(r),Wg(r,f,t,l,i)),null;case 27:if(we(r),i=be.current,f=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Da(r);else{if(!l){if(r.stateNode===null)throw Error(a(166));return Dn(r),r.subtreeFlags&=-33554433,null}t=Oe.current,_s(r)?Ub(r):(t=M1(f,l,i),r.stateNode=t,Da(r))}return Dn(r),r.subtreeFlags&=-33554433,null;case 5:if(we(r),f=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Da(r);else{if(!l){if(r.stateNode===null)throw Error(a(166));return Dn(r),r.subtreeFlags&=-33554433,null}if(m=Oe.current,_s(r))Ub(r);else{var E=Pu(be.current);switch(m){case 1:m=E.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=E.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=E.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=E.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=E.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof l.is=="string"?E.createElement("select",{is:l.is}):E.createElement("select"),l.multiple?m.multiple=!0:l.size&&(m.size=l.size);break;default:m=typeof l.is=="string"?E.createElement(f,{is:l.is}):E.createElement(f)}}m[dn]=r,m[Mn]=l;e:for(E=r.child;E!==null;){if(E.tag===5||E.tag===6)m.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===r)break e;for(;E.sibling===null;){if(E.return===null||E.return===r)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}r.stateNode=m;e:switch(br(m,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Da(r)}}return Dn(r),r.subtreeFlags&=-33554433,Wg(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,i),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Da(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(a(166));if(t=be.current,_s(r)){if(t=r.stateNode,i=r.memoizedProps,l=null,f=ir,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}t[dn]=r,t=!!(t.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||s1(t.nodeValue,i)),t||Za(r,!0)}else t=Pu(t).createTextNode(l),t[dn]=r,r.stateNode=t}return Dn(r),null;case 31:if(i=r.memoizedState,t===null||t.memoizedState!==null){if(l=_s(r),i!==null){if(t===null){if(!l)throw Error(a(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[dn]=r}else Vi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Dn(r),t=!1}else i=cg(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return r.flags&256?(ro(r),r):(ro(r),null);if((r.flags&128)!==0)throw Error(a(558))}return Dn(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=_s(r),l!==null&&l.dehydrated!==null){if(t===null){if(!f)throw Error(a(318));if(f=r.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[dn]=r}else Vi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Dn(r),f=!1}else f=cg(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(ro(r),r):(ro(r),null)}return ro(r),(r.flags&128)!==0?(r.lanes=i,r):(i=l!==null,t=t!==null&&t.memoizedState!==null,i&&(l=r.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),m=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==f&&(l.flags|=2048)),i!==t&&i&&(r.child.flags|=8192),kd(r,r.updateQueue),Dn(r),null);case 4:return it(),t===null&&Pm(r.stateNode.containerInfo),r.flags|=67108864,Dn(r),null;case 10:return Ta(r.type),Dn(r),null;case 19:if(Eg(r),l=r.memoizedState,l===null)return Dn(r),null;if(f=(r.flags&128)!==0,m=l.rendering,m===null)if(f)Ru(l,!1);else{if(Vn!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(m=xd(t),m!==null){for(r.flags|=128,Ru(l,!1),t=m.updateQueue,r.updateQueue=t,kd(r,t),r.subtreeFlags=0,t=i,i=r.child;i!==null;)kb(i,t),i=i.sibling;return vu(r,yr.current&1|2),Ut&&Ea(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&xt()>Gd&&(r.flags|=128,f=!0,Ru(l,!1),r.lanes=4194304)}else{if(!f)if(t=xd(m),t!==null){if(r.flags|=128,f=!0,t=t.updateQueue,r.updateQueue=t,kd(r,t),Ru(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!m.alternate&&!Ut)return Dn(r),null}else 2*xt()-l.renderingStartTime>Gd&&i!==536870912&&(r.flags|=128,f=!0,Ru(l,!1),r.lanes=4194304);l.isBackwards?(m.sibling=r.child,r.child=m):(t=l.last,t!==null?t.sibling=m:r.child=m,l.last=m)}if(l.tail!==null){t=l.tail;e:{for(i=t;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return l.rendering=t,l.tail=t.sibling,l.renderingStartTime=xt(),t.sibling=null,m=yr.current,m=f?m&1|2:m&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!i||Ut?vu(r,m):(i=m,Fe(mr,r),Fe(yr,i),Rr===null&&(Rr=r)),Ut&&Ea(r,l.treeForkCount),t}return Dn(r),null;case 22:case 23:return ro(r),wg(),l=r.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(i&536870912)!==0&&(r.flags&128)===0&&(Dn(r),r.subtreeFlags&6&&(r.flags|=8192)):Dn(r),i=r.updateQueue,i!==null&&kd(r,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==i&&(r.flags|=2048),t!==null&&Le($i),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),Ta(Xn),Dn(r),null;case 25:return null;case 30:return r.flags|=33554432,Dn(r),null}throw Error(a(156,r.tag))}function gD(t,r){switch(lg(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Ta(Xn),it(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return we(r),null;case 31:if(r.memoizedState!==null){if(ro(r),r.alternate===null)throw Error(a(340));Vi()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(ro(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(a(340));Vi()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return Eg(r),t=r.flags,t&65536?(r.flags=t&-65537|128,t=r.memoizedState,t!==null&&(t.rendering=null,t.tail=null),r.flags|=4,r):null;case 4:return it(),null;case 10:return Ta(r.type),null;case 22:case 23:return ro(r),wg(),t!==null&&Le($i),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Ta(Xn),null;case 25:return null;default:return null}}function u2(t,r){switch(lg(r),r.tag){case 3:Ta(Xn),it();break;case 26:case 27:case 5:we(r);break;case 4:it();break;case 31:r.memoizedState!==null&&ro(r);break;case 13:ro(r);break;case 19:Eg(r);break;case 10:Ta(r.type);break;case 22:case 23:ro(r),wg(),t!==null&&Le($i);break;case 24:Ta(Xn)}}function Eu(t,r){try{var i=r.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var f=l.next;i=f;do{if((i.tag&t)===t){l=void 0;var m=i.create,E=i.inst;l=m(),E.destroy=l}i=i.next}while(i!==f)}}catch(P){gn(r,r.return,P)}}function ii(t,r,i){try{var l=r.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var m=f.next;l=m;do{if((l.tag&t)===t){var E=l.inst,P=E.destroy;if(P!==void 0){E.destroy=void 0,f=r;var Q=i,ie=P;try{ie()}catch(pe){gn(f,Q,pe)}}}l=l.next}while(l!==m)}}catch(pe){gn(r,r.return,pe)}}function c2(t){var r=t.updateQueue;if(r!==null){var i=t.stateNode;try{Wb(r,i)}catch(l){gn(t,t.return,l)}}}function d2(t,r,i){i.props=Wi(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(l){gn(t,r,l)}}function Zo(t,r){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:var f=t.stateNode,m=Sa(t.memoizedProps,f);(f.ref===null||f.ref.name!==m)&&(f.ref=v1(m)),l=f.ref;break;case 7:if(t.stateNode===null){var E=new lo(t);h(t.child,!1,aN,E,void 0,void 0),t.stateNode=E}l=t.stateNode;break;default:l=t.stateNode}typeof i=="function"?t.refCleanup=i(l):i.current=l}}catch(P){gn(t,r,P)}}function vr(t,r){var i=t.ref,l=t.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(f){gn(t,r,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){gn(t,r,f)}else i.current=null}function Ld(t,r){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&r!==null)for(var i=0;i<r.length;i++)E1(t.stateNode,r[i])}function f2(t){for(var r=t.return;r!==null&&(tm(r)&&E1(t.stateNode,r.stateNode),!em(r));)r=r.return}function Cu(t){for(var r=t.return;r!==null&&(tm(r)&&iN(t.stateNode,r.stateNode),!em(r));)r=r.return}function em(t){return t.tag===5||t.tag===3||t.tag===27}function tm(t){return t&&t.tag===7&&t.stateNode!==null}function nm(t){var r=t.type,i=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(f){gn(t,t.return,f)}}function rm(t,r,i){try{var l=t.stateNode;FD(l,t.type,i,r),l[Mn]=r}catch(f){gn(t,t.return,f)}}function h2(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&hi(t.type)||t.tag===4}function om(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||h2(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&hi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function am(t,r,i,l){var f=t.tag;if(f===5||f===6)f=t.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(f,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(f),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=Ar)),Ld(t,l),pt=!0;else if(f!==4&&(f===27&&(Ld(t,l),l=null,hi(t.type)&&(i=t.stateNode,r=null)),t=t.child,t!==null))for(am(t,r,i,l),t=t.sibling;t!==null;)am(t,r,i,l),t=t.sibling}function zd(t,r,i,l){var f=t.tag;if(f===5||f===6)f=t.stateNode,r?i.insertBefore(f,r):i.appendChild(f),Ld(t,l),pt=!0;else if(f!==4&&(f===27&&(Ld(t,l),l=null,hi(t.type)&&(i=t.stateNode)),t=t.child,t!==null))for(zd(t,r,i,l),t=t.sibling;t!==null;)zd(t,r,i,l),t=t.sibling}function p2(t){var r=t.stateNode,i=t.memoizedProps;try{for(var l=t.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);br(r,l,i),r[dn]=t,r[Mn]=i}catch(m){gn(t,t.return,m)}}var _d=!1,oo=null;function g2(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(_d=!0)}var Jo=null;function m2(){var t=Jo;return Jo=null,t}var Vr=0;function Ks(t,r,i,l,f){return Vr=0,y2(t.child,r,i,l,f)}function y2(t,r,i,l,f){for(var m=!1;t!==null;){if(t.tag===5){var E=t.stateNode;if(l!==null){var P=Bm(E);l.push(P),P.view&&(m=!0)}else m||Bm(E).view&&(m=!0);_d=!0,m1(E,Vr===0?r:r+"_"+Vr,i),Vr++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&f||y2(t.child,r,i,l,f)&&(m=!0));t=t.sibling}return m}function Wo(t,r){for(;t!==null;)t.tag===5?y1(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&r||Wo(t.child,r)),t=t.sibling}function Hd(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(Hd(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var r=t.memoizedProps;if(r.name==null||r.name==="auto")throw Error(a(544));var i=r.name;r=wa(r.default,r.share),r!=="none"&&(Ks(t,i,r,null,!1)||Wo(t.child,!1))}t=t.sibling}}function im(t,r){if(t.tag===30){var i=t.stateNode,l=t.memoizedProps,f=Sa(l,i),m=wa(l.default,i.paired?l.share:l.enter);m!=="none"?Ks(t,f,m,null,!1)?(Hd(t),i.paired||r||el(t,l.onEnter)):Wo(t.child,!1):Hd(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)im(t,r),t=t.sibling;else Hd(t)}function sm(t){if(oo!==null&&oo.size!==0){var r=oo;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var i=t.memoizedProps,l=i.name;if(l!=null&&l!=="auto"){var f=r.get(l);if(f!==void 0){var m=wa(i.default,i.share);if(m!=="none"&&(Ks(t,l,m,null,!1)?(m=t.stateNode,f.paired=m,m.paired=f,el(t,i.onShare)):Wo(t.child,!1)),r.delete(l),r.size===0)break}}}sm(t)}t=t.sibling}}}function lm(t){if(t.tag===30){var r=t.memoizedProps,i=Sa(r,t.stateNode),l=oo!==null?oo.get(i):void 0,f=wa(r.default,l!==void 0?r.share:r.exit);f!=="none"&&(Ks(t,i,f,null,!1)?l!==void 0?(f=t.stateNode,l.paired=f,f.paired=l,oo.delete(i),el(t,r.onShare)):el(t,r.onExit):Wo(t.child,!1)),oo!==null&&sm(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)lm(t),t=t.sibling;else oo!==null&&sm(t)}function v2(t){for(t=t.child;t!==null;){if(t.tag===30){var r=t.memoizedProps,i=Sa(r,t.stateNode);r=wa(r.default,r.update),t.flags&=-5,r!=="none"&&Ks(t,i,r,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&v2(t);t=t.sibling}}function um(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var r=t.stateNode;r.paired!==null&&(r.paired=null,Wo(t.child,!1))}um(t)}t=t.sibling}}function Ud(t){if(t.tag===30)t.stateNode.paired=null,Wo(t.child,!1),um(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Ud(t),t=t.sibling;else um(t)}function b2(t){for(t=t.child;t!==null;)t.tag===30?Wo(t.child,!1):(t.subtreeFlags&33554432)!==0&&b2(t),t=t.sibling}function cm(t,r,i,l,f,m,E){for(var P=!1;r!==null;){if(r.tag===5){var Q=r.stateNode;if(m!==null&&Vr<m.length){var ie=m[Vr],pe=Bm(Q);(ie.view||pe.view)&&(P=!0);var Ce;if(Ce=(t.flags&4)===0)if(pe.clip)Ce=!0;else{Ce=ie.rect;var oe=pe.rect;Ce=Ce.y!==oe.y||Ce.x!==oe.x||Ce.height!==oe.height||Ce.width!==oe.width}Ce&&(t.flags|=4),pe.abs?pe=!ie.abs:(ie=ie.rect,pe=pe.rect,pe=ie.height!==pe.height||ie.width!==pe.width),pe&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&m1(Q,Vr===0?i:i+"_"+Vr,f),P&&(t.flags&4)!==0||(Jo===null&&(Jo=[]),Jo.push(Q,Vr===0?l:l+"_"+Vr,r.memoizedProps)),Vr++}else(r.tag!==22||r.memoizedState===null)&&(r.tag===30&&E?t.flags|=r.flags&32:cm(t,r.child,i,l,f,m,E)&&(P=!0));r=r.sibling}return P}function x2(t,r){for(t=t.child;t!==null;){if(t.tag===30){var i=t.memoizedProps,l=t.stateNode,f=Sa(i,l),m=wa(i.default,i.update),E;E=t.memoizedState,t.memoizedState=null,l=t;var P=t.child;Vr=0,f=cm(l,P,f,f,m,E,!1),(t.flags&4)!==0&&f&&el(t,i.onUpdate)}else(t.subtreeFlags&33554432)!==0&&x2(t);t=t.sibling}}var sr=!1,hn=!1,ea=!1,dm=!1,S2=typeof WeakSet=="function"?WeakSet:Set,lr=null,ta=!1,Tu=!1,Fd=!1,fm=!1;function mD(t,r,i){if(t=t.containerInfo,zm=cl,t=Cb(t),Jp(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var m=f.anchorOffset,E=f.focusNode;f=f.focusOffset;try{l.nodeType,E.nodeType}catch{l=null;break e}var P=0,Q=-1,ie=-1,pe=0,Ce=0,oe=t,fe=null;t:for(;;){for(var Ye;oe!==l||m!==0&&oe.nodeType!==3||(Q=P+m),oe!==E||f!==0&&oe.nodeType!==3||(ie=P+f),oe.nodeType===3&&(P+=oe.nodeValue.length),(Ye=oe.firstChild)!==null;)fe=oe,oe=Ye;for(;;){if(oe===t)break t;if(fe===l&&++pe===m&&(Q=P),fe===E&&++Ce===f&&(ie=P),(Ye=oe.nextSibling)!==null)break;oe=fe,fe=oe.parentNode}oe=Ye}l=Q===-1||ie===-1?null:{start:Q,end:ie}}else l=null}l=l||{start:0,end:0}}else l=null;for(_m={focusedElem:t,selectionRange:l},cl=!1,i=(i&335544064)===i,lr=r,r=i?9270:1024;lr!==null;){if(t=lr,i&&(l=t.deletions,l!==null))for(m=0;m<l.length;m++)i&&lm(l[m]);if(t.alternate===null&&(t.flags&2)!==0)i&&g2(t),Bd(i);else{if(t.tag===22){if(l=t.alternate,t.memoizedState!==null){l!==null&&l.memoizedState===null&&i&&lm(l),Bd(i);continue}else if(l!==null&&l.memoizedState!==null){i&&g2(t),Bd(i);continue}}l=t.child,(t.subtreeFlags&r)!==0&&l!==null?(l.return=t,lr=l):(i&&v2(t),Bd(i))}}oo=null}function Bd(t){for(;lr!==null;){var r=lr,i=t,l=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 15:break;case 1:if((f&1024)!==0&&l!==null){i=void 0,f=l.memoizedProps,l=l.memoizedState;var m=r.stateNode;try{var E=Wi(r.type,f);i=m.getSnapshotBeforeUpdate(E,l),m.__reactInternalSnapshotBeforeUpdate=i}catch(P){gn(r,r.return,P)}}break;case 3:if((f&1024)!==0){if(l=r.stateNode.containerInfo,i=l.nodeType,i===9)Ym(l);else if(i===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Ym(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&l!==null&&(i=Sa(l.memoizedProps,l.stateNode),f=r.memoizedProps,f=wa(f.default,f.update),f!=="none"&&Ks(l,i,f,l.memoizedState=[],!0));break;default:if((f&1024)!==0)throw Error(a(163))}if(l=r.sibling,l!==null){l.return=r.return,lr=l;break}lr=r.return}}function w2(t,r,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:na(t,i),l&4&&Eu(5,i);break;case 1:if(na(t,i),l&4)if(t=i.stateNode,r===null)try{t.componentDidMount()}catch(E){gn(i,i.return,E)}else{var f=Wi(i.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(f,r,t.__reactInternalSnapshotBeforeUpdate)}catch(E){gn(i,i.return,E)}}l&64&&c2(i),l&512&&Zo(i,i.return);break;case 3:if(na(t,i),l&64&&(t=i.updateQueue,t!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{Wb(t,r)}catch(E){gn(i,i.return,E)}}break;case 27:r===null&&l&4&&p2(i);case 26:case 5:na(t,i),r===null&&l&4&&nm(i),l&512&&Zo(i,i.return);break;case 12:na(t,i);break;case 31:na(t,i),l&4&&T2(t,i);break;case 13:na(t,i),l&4&&O2(t,i),l&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=MD.bind(null,i),uN(t,i))));break;case 22:if(l=i.memoizedState!==null||sr,!l){var m=r!==null&&r.memoizedState!==null||hn;r=sr,f=hn,sr=l,(hn=m)&&!f?(l=2,(i.subtreeFlags&8772)!==0&&(l|=1),_o(t,i,l)):na(t,i),sr=r,hn=f}break;case 30:na(t,i),l&512&&Zo(i,i.return);break;case 7:l&512&&Zo(i,i.return);default:na(t,i)}}function hm(t,r){for(t=t.child;t!==null;)R2(t,r),t=t.sibling}function R2(t,r){switch(t.tag){case 5:case 26:try{var i=t.stateNode;if(r){var l=i.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var f=t.stateNode,m=t.memoizedProps.style,E=m!=null&&m.hasOwnProperty("display")?m.display:null;f.style.display=E==null||typeof E=="boolean"?"":(""+E).trim()}}catch(Q){gn(t,t.return,Q)}pm(t,r);break;case 6:try{t.stateNode.nodeValue=r?"":t.memoizedProps,pt=!0}catch(Q){gn(t,t.return,Q)}break;case 18:try{var P=t.stateNode;r?g1(P,!0):g1(t.stateNode,!1)}catch(Q){gn(t,t.return,Q)}break;case 22:case 23:t.memoizedState===null&&hm(t,r);break;default:hm(t,r)}}function pm(t,r){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var i=t,l=r;switch(i.tag){case 4:R2(i,l);break e;case 22:i.memoizedState===null&&pm(i,l);break e;default:pm(i,l)}}t=t.sibling}}function E2(t){var r=t.alternate;r!==null&&(t.alternate=null,E2(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&Yn(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var jn=null,qr=!1;function Lo(t,r,i){for(i=i.child;i!==null;)C2(t,r,i),i=i.sibling}function C2(t,r,i){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(Pe,i)}catch{}switch(i.tag){case 26:hn||vr(i,r),Lo(t,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!hn&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:hn||vr(i,r),Cu(i);var l=jn,f=qr;hi(i.type)&&(jn=i.stateNode,qr=!1),Lo(t,r,i),A1(i.stateNode,i.type,i.memoizedProps),jn=l,qr=f;break;case 5:hn||vr(i,r),Cu(i);case 6:if(i.tag===6&&Cu(i),l=jn,f=qr,jn=null,Lo(t,r,i),jn=l,qr=f,jn!==null)if(qr)try{(jn.nodeType===9?jn.body:jn.nodeName==="HTML"?jn.ownerDocument.body:jn).removeChild(i.stateNode),pt=!0}catch(m){gn(i,r,m)}else try{jn.removeChild(i.stateNode),pt=!0}catch(m){gn(i,r,m)}break;case 18:jn!==null&&(qr?(t=jn,p1(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),dl(t)):p1(jn,i.stateNode));break;case 4:l=jn,f=qr,jn=i.stateNode.containerInfo,qr=!0,Lo(t,r,i),jn=l,qr=f;break;case 0:case 11:case 14:case 15:ii(2,i,r),hn||ii(4,i,r),Lo(t,r,i);break;case 1:hn||(vr(i,r),l=i.stateNode,typeof l.componentWillUnmount=="function"&&d2(i,r,l)),Lo(t,r,i);break;case 21:Lo(t,r,i);break;case 22:hn=(l=hn)||i.memoizedState!==null,Lo(t,r,i),hn=l;break;case 30:vr(i,r),Lo(t,r,i);break;case 7:hn||vr(i,r),Lo(t,r,i);break;default:Lo(t,r,i)}}function T2(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{dl(t)}catch(i){gn(r,r.return,i)}}}function O2(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{dl(t)}catch(i){gn(r,r.return,i)}}function yD(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new S2),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new S2),r;default:throw Error(a(435,t.tag))}}function Vd(t,r){var i=yD(t);r.forEach(function(l){if(!i.has(l)){i.add(l);var f=AD.bind(null,t,l);l.then(f,f)}})}function Ir(t,r,i){var l=r.deletions;if(l!==null)for(var f=0;f<l.length;f++){var m=l[f],E=t,P=r,Q=P;e:for(;Q!==null;){switch(Q.tag){case 27:if(hi(Q.type)){jn=Q.stateNode,qr=!1;break e}break;case 5:jn=Q.stateNode,qr=!1;break e;case 3:case 4:jn=Q.stateNode.containerInfo,qr=!0;break e}Q=Q.return}if(jn===null)throw Error(a(160));C2(E,P,m),jn=null,qr=!1,E=m.alternate,E!==null&&(E.return=null),m.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)M2(r,t,i),r=r.sibling}var zo=null;function M2(t,r,i){var l=t.alternate,f=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(f&4&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(var m=0;m<l.length;m++){var E=l[m];E.ref.impl=E.nextImpl}Ir(r,t,i),jr(t),f&4&&(ii(3,t,t.return),Eu(3,t),ii(5,t,t.return));break;case 1:Ir(r,t,i),jr(t),f&512&&(hn||l===null||vr(l,l.return)),f&64&&sr&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?r:i.concat(r))));break;case 26:if(m=zo,Ir(r,t,i),jr(t),f&512&&(hn||l===null||vr(l,l.return)),f&4)if(f=l!==null?l.memoizedState:null,i=t.memoizedState,l===null)if(i===null)if(t.stateNode===null)if(sr)t.stateNode=d1(t.type,t.memoizedProps,r.containerInfo,t);else{e:{r=t.type,i=t.memoizedProps,f=m.ownerDocument||m;t:switch(r){case"title":l=f.getElementsByTagName("title")[0],(!l||l[go]||l[dn]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=f.createElement(r),f.head.insertBefore(l,f.querySelector("head > title"))),br(l,r,i),l[dn]=t,Se(l),r=l;break e;case"link":if(m=k1("link","href",f).get(r+(i.href||""))){for(E=0;E<m.length;E++)if(l=m[E],l.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&l.getAttribute("rel")===(i.rel==null?null:i.rel)&&l.getAttribute("title")===(i.title==null?null:i.title)&&l.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){m.splice(E,1);break t}}l=f.createElement(r),br(l,r,i),f.head.appendChild(l);break;case"meta":if(m=k1("meta","content",f).get(r+(i.content||""))){for(E=0;E<m.length;E++)if(l=m[E],l.getAttribute("content")===(i.content==null?null:""+i.content)&&l.getAttribute("name")===(i.name==null?null:i.name)&&l.getAttribute("property")===(i.property==null?null:i.property)&&l.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&l.getAttribute("charset")===(i.charSet==null?null:i.charSet)){m.splice(E,1);break t}}l=f.createElement(r),br(l,r,i),f.head.appendChild(l);break;default:throw Error(a(468,r))}l[dn]=t,Se(l),r=l}t.stateNode=r}else sr||Jm(m,t.type,t.stateNode);else t.stateNode=P1(m,i,t.memoizedProps);else f!==i?(f===null?(r=l.stateNode,r===null||hn||r.parentNode.removeChild(r)):f.count--,i===null?sr||Jm(m,t.type,t.stateNode):P1(m,i,t.memoizedProps)):i===null&&t.stateNode!==null&&rm(t,t.memoizedProps,l.memoizedProps);break;case 27:Ir(r,t,i),jr(t),f&512&&(hn||l===null||vr(l,l.return)),l!==null&&f&4&&rm(t,t.memoizedProps,l.memoizedProps);break;case 5:if(m=ea,ea=!1,Ir(r,t,i),ea=m,jr(t),f&512&&(hn||l===null||vr(l,l.return)),t.flags&32){r=t.stateNode;try{Mr(r,""),pt=!0}catch(pe){gn(t,t.return,pe)}}f&4&&t.stateNode!=null&&(r=t.memoizedProps,rm(t,r,l!==null?l.memoizedProps:r)),f&1024&&(dm=!0);break;case 6:if(Ir(r,t,i),jr(t),f&4){if(t.stateNode===null)throw Error(a(162));r=t.memoizedProps,i=t.stateNode;try{i.nodeValue=r,pt=!0}catch(pe){gn(t,t.return,pe)}}break;case 3:if(pt=!1,of=null,m=zo,zo=ku(r.containerInfo),Ir(r,t,i),zo=m,jr(t),f&4&&l!==null&&l.memoizedState.isDehydrated)try{dl(r.containerInfo)}catch(pe){gn(t,t.return,pe)}dm&&(dm=!1,A2(t)),pt=!1;break;case 4:f=ea,ea=sr,l=nr(),m=zo,zo=ku(t.stateNode.containerInfo),Ir(r,t,i),jr(t),zo=m,pt&&Tu&&(Fd=!0),pt=l,ea=f;break;case 12:Ir(r,t,i),jr(t);break;case 31:Ir(r,t,i),jr(t),f&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Vd(t,r)));break;case 13:Ir(r,t,i),jr(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Kd=xt()),f&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Vd(t,r)));break;case 22:m=t.memoizedState!==null,E=l!==null&&l.memoizedState!==null;var P=sr,Q=hn,ie=ea;sr=P||m,ea=ie||m,hn=Q||E,Ir(r,t,i),hn=Q,ea=ie,sr=P,jr(t),f&8192&&(r=t.stateNode,r._visibility=m?r._visibility&-2:r._visibility|1,!m||l===null||E||sr||hn||(r=E||hn,i=sr,l=hn,sr=m||sr,hn=r,si(t,2),sr=i,hn=l),!m&&ea||hm(t,m)),f&4&&(r=t.updateQueue,r!==null&&(i=r.retryQueue,i!==null&&(r.retryQueue=null,Vd(t,i))));break;case 19:Ir(r,t,i),jr(t),f&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Vd(t,r)));break;case 30:f&512&&(hn||l===null||vr(l,l.return)),f=nr(),m=Tu,E=(i&335544064)===i,P=t.memoizedProps,Tu=E&&wa(P.default,P.update)!=="none",Ir(r,t,i),jr(t),E&&l!==null&&pt&&(t.flags|=4),Tu=m,pt=f;break;case 21:break;case 7:f&512&&(hn||l===null||vr(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=t);default:Ir(r,t,i),jr(t)}}function jr(t){var r=t.flags;if(r&2){try{for(var i,l=t.return;l!==null;){if(h2(l)){i=l;break}l=l.return}l=null;for(var f=t.return;f!==null;){if(tm(f)){var m=f.stateNode;l===null?l=[m]:l.push(m)}if(em(f))break;f=f.return}var E=l;if(i==null)throw Error(a(160));switch(i.tag){case 27:var P=i.stateNode,Q=om(t);zd(t,Q,P,E);break;case 5:var ie=i.stateNode;i.flags&32&&(Mr(ie,""),i.flags&=-33);var pe=om(t);zd(t,pe,ie,E);break;case 3:case 4:var Ce=i.stateNode.containerInfo,oe=om(t);am(t,oe,Ce,E);break;default:throw Error(a(161))}}catch(fe){gn(t,t.return,fe)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function A2(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;A2(r),r.tag===5&&r.flags&1024&&(r=r.stateNode,cl=!0,r.reset(),cl=!1),t=t.sibling}}function Gs(t,r){if(r.subtreeFlags&9270)for(r=r.child;r!==null;)D2(r,t),r=r.sibling;else x2(r)}function D2(t,r){var i=t.alternate;if(i===null)im(t,!1);else switch(t.tag){case 3:if(fm=ta=!1,m2(),Gs(r,t),!ta&&!Fd){if(t=Jo,t!==null)for(var l=0;l<t.length;l+=3){i=t[l];var f=t[l+1];y1(i,t[l+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+f+")"})}t=r.containerInfo,t=t.nodeType===9?t.documentElement:t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName===""&&(t.style.viewTransitionName="none",t.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),t.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),fm=!0}Jo=null;break;case 5:Gs(r,t);break;case 4:l=ta,ta=!1,Gs(r,t),ta&&(Fd=!0),ta=l;break;case 22:t.memoizedState===null&&(i.memoizedState!==null?im(t,!1):Gs(r,t));break;case 30:l=ta,f=m2(),ta=!1,Gs(r,t),ta&&(t.flags|=4);var m=t.memoizedProps,E=t.stateNode;r=Sa(m,E),E=Sa(i.memoizedProps,E);var P=wa(m.default,m.update);P==="none"?r=!1:(m=i.memoizedState,i.memoizedState=null,i=t.child,Vr=0,r=cm(t,i,r,E,P,m,!0),Vr!==(m===null?0:m.length)&&(t.flags|=32)),(t.flags&4)!==0&&r?(el(t,t.memoizedProps.onUpdate),Jo=f):f!==null&&(f.push.apply(f,Jo),Jo=f),ta=(t.flags&32)!==0?!0:l;break;default:Gs(r,t)}}function na(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)w2(t,r.alternate,r),r=r.sibling}function si(t,r){for(t=t.child;t!==null;){var i=t,l=r;switch(i.tag){case 0:case 11:case 14:case 15:ii(4,i,i.return),si(i,l);break;case 1:vr(i,i.return);var f=i.stateNode;typeof f.componentWillUnmount=="function"&&d2(i,i.return,f),si(i,l);break;case 27:(l&2)!==0&&A1(i.stateNode,i.type,i.memoizedProps);case 5:vr(i,i.return),i.tag!==5&&i.tag!==27||Cu(i),si(i,l);break;case 6:Cu(i);break;case 26:vr(i,i.return),f=i.stateNode,i.memoizedState!==null||f===null||hn||f.parentNode.removeChild(f),si(i,l);break;case 22:i.memoizedState===null&&si(i,l);break;case 30:vr(i,i.return),si(i,l);break;case 7:vr(i,i.return);default:si(i,l)}t=t.sibling}}function _o(t,r,i){for(i=(r.subtreeFlags&8772)!==0?i:i&-2,r=r.child;r!==null;){var l=r.alternate,f=t,m=r,E=m.flags,P=(i&1)!==0;switch(m.tag){case 0:case 11:case 15:_o(f,m,i),Eu(4,m);break;case 1:if(_o(f,m,i),l=m,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(pe){gn(l,l.return,pe)}if(l=m,f=l.updateQueue,f!==null){var Q=l.stateNode;try{var ie=f.shared.hiddenCallbacks;if(ie!==null)for(f.shared.hiddenCallbacks=null,f=0;f<ie.length;f++)Jb(ie[f],Q)}catch(pe){gn(l,l.return,pe)}}P&&E&64&&c2(m),Zo(m,m.return);break;case 27:(i&2)!==0&&p2(m);case 5:m.tag!==5&&m.tag!==27||f2(m),_o(f,m,i),P&&l===null&&E&4&&nm(m),Zo(m,m.return);break;case 6:f2(m);break;case 26:Q=m.stateNode,m.memoizedState!==null||Q===null||sr||Jm(ku(Q.ownerDocument),m.type,Q),_o(f,m,i),P&&l===null&&E&4&&nm(m),Zo(m,m.return);break;case 12:_o(f,m,i);break;case 31:_o(f,m,i),P&&E&4&&T2(f,m);break;case 13:_o(f,m,i),P&&E&4&&O2(f,m);break;case 22:m.memoizedState===null&&_o(f,m,i),Zo(m,m.return);break;case 30:_o(f,m,i),Zo(m,m.return);break;case 7:Zo(m,m.return);default:_o(f,m,i)}r=r.sibling}}function gm(t,r){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&du(i))}function mm(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&du(t))}function wo(t,r,i,l){var f=(i&335544064)===i;if(r.subtreeFlags&(f?10262:10256))for(r=r.child;r!==null;)N2(t,r,i,l),r=r.sibling;else f&&b2(r)}function N2(t,r,i,l){var f=(i&335544064)===i;f&&r.alternate===null&&r.return!==null&&r.return.alternate!==null&&Ud(r);var m=r.flags;switch(r.tag){case 0:case 11:case 15:wo(t,r,i,l),m&2048&&Eu(9,r);break;case 1:wo(t,r,i,l);break;case 3:wo(t,r,i,l),f&&fm&&(t=t.containerInfo,t=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,t.style.viewTransitionName==="root"&&(t.style.viewTransitionName=""),t=t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName==="none"&&(t.style.viewTransitionName="")),m&2048&&(m=null,r.alternate!==null&&(m=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==m&&(r.refCount++,m!=null&&du(m)));break;case 12:if(m&2048){wo(t,r,i,l),m=r.stateNode;try{var E=r.memoizedProps,P=E.id,Q=E.onPostCommit;typeof Q=="function"&&Q(P,r.alternate===null?"mount":"update",m.passiveEffectDuration,-0)}catch(ie){gn(r,r.return,ie)}}else wo(t,r,i,l);break;case 31:wo(t,r,i,l);break;case 13:wo(t,r,i,l);break;case 23:break;case 22:E=r.stateNode,P=r.alternate,r.memoizedState!==null?(f&&P!==null&&P.memoizedState===null&&Ud(P),E._visibility&2?wo(t,r,i,l):Ou(t,r)):(f&&P!==null&&P.memoizedState!==null&&Ud(r),E._visibility&2?wo(t,r,i,l):(E._visibility|=2,$s(t,r,i,l,(r.subtreeFlags&10256)!==0||!1))),m&2048&&gm(P,r);break;case 24:wo(t,r,i,l),m&2048&&mm(r.alternate,r);break;case 30:f&&(m=r.alternate,m!==null&&(Wo(m.child,!0),Wo(r.child,!0))),wo(t,r,i,l);break;default:wo(t,r,i,l)}}function $s(t,r,i,l,f){for(f=f&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var m=t,E=r,P=i,Q=l,ie=E.flags;switch(E.tag){case 0:case 11:case 15:$s(m,E,P,Q,f),Eu(8,E);break;case 23:break;case 22:var pe=E.stateNode;E.memoizedState!==null?pe._visibility&2?$s(m,E,P,Q,f):Ou(m,E):(pe._visibility|=2,$s(m,E,P,Q,f)),f&&ie&2048&&gm(E.alternate,E);break;case 24:$s(m,E,P,Q,f),f&&ie&2048&&mm(E.alternate,E);break;default:$s(m,E,P,Q,f)}r=r.sibling}}function Ou(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=t,l=r,f=l.flags;switch(l.tag){case 22:Ou(i,l),f&2048&&gm(l.alternate,l);break;case 24:Ou(i,l),f&2048&&mm(l.alternate,l);break;default:Ou(i,l)}r=r.sibling}}var es=8192;function ts(t,r,i){if(t.subtreeFlags&es)for(t=t.child;t!==null;)I2(t,r,i),t=t.sibling}function I2(t,r,i){switch(t.tag){case 26:ts(t,r,i),t.flags&es&&(t.memoizedState!==null?RN(i,zo,t.memoizedState,t.memoizedProps):(t=t.stateNode,(r&335544128)===r&&H1(i,t)));break;case 5:ts(t,r,i),t.flags&es&&(t=t.stateNode,(r&335544128)===r&&H1(i,t));break;case 3:case 4:var l=zo;zo=ku(t.stateNode.containerInfo),ts(t,r,i),zo=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=es,es=16777216,ts(t,r,i),es=l):ts(t,r,i));break;case 30:if((t.flags&es)!==0&&(l=t.memoizedProps.name,l!=null&&l!=="auto")){var f=t.stateNode;f.paired=null,oo===null&&(oo=new Map),oo.set(l,f)}ts(t,r,i);break;default:ts(t,r,i)}}function j2(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function Mu(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];lr=l,k2(l,t)}j2(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)P2(t),t=t.sibling}function P2(t){switch(t.tag){case 0:case 11:case 15:Mu(t),t.flags&2048&&ii(9,t,t.return);break;case 3:Mu(t);break;case 12:Mu(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,qd(t)):Mu(t);break;default:Mu(t)}}function qd(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];lr=l,k2(l,t)}j2(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:ii(8,r,r.return),qd(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,qd(r));break;default:qd(r)}t=t.sibling}}function k2(t,r){for(;lr!==null;){var i=lr;switch(i.tag){case 0:case 11:case 15:ii(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:du(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,lr=l;else e:for(i=t;lr!==null;){l=lr;var f=l.sibling,m=l.return;if(E2(l),l===i){lr=null;break e}if(f!==null){f.return=m,lr=f;break e}lr=m}}}var vD={getCacheForType:function(t){var r=gr(Xn),i=r.data.get(t);return i===void 0&&(i=t(),r.data.set(t,i)),i},cacheSignal:function(){return gr(Xn).controller.signal}},bD=typeof WeakMap=="function"?WeakMap:Map,ln=0,Tn=null,qt=null,Xt=0,pn=0,ao=null,li=!1,Xs=!1,ym=!1,Na=0,Vn=0,ui=0,ns=0,Yd=0,io=0,Qs=0,Au=null,Yr=null,vm=!1,Kd=0,L2=0,Gd=1/0,$d=null,ci=null,zn=0,Ho=null,rs=null,ra=0,bm=0,xm=null,z2=null,Zs=null,Js=null,Ws=null,Du=0,Xd=null;function so(){return(ln&2)!==0&&Xt!==0?Xt&-Xt:ge.T!==null?Dm():Cn()}function _2(){if(io===0)if((Xt&536870912)===0||Ut){var t=ye;ye<<=1,(ye&3932160)===0&&(ye=262144),io=t}else io=536870912;return t=mr.current,t!==null&&(t.flags|=32),io}function el(t,r){if(r!=null){var i=t.stateNode,l=i.ref;l===null&&(l=i.ref=v1(Sa(t.memoizedProps,i))),Js===null&&(Js=[]),Js.push(r.bind(null,l))}}function Kr(t,r,i){(t===Tn&&(pn===2||pn===9)||t.cancelPendingCommit!==null)&&(tl(t,0),di(t,Xt,io,!1)),ct(t,i),((ln&2)===0||t!==Tn)&&(t===Tn&&((ln&2)===0&&(ns|=i),Vn===4&&di(t,Xt,io,!1)),oa(t))}function H2(t,r,i){if((ln&6)!==0)throw Error(a(327));var l=!i&&(r&127)===0&&(r&t.expiredLanes)===0||Xe(t,r),f=l?wD(t,r):wm(t,r,!0),m=l;do{if(f===0){Xs&&!l&&di(t,r,0,!1);break}else{if(i=t.current.alternate,m&&!xD(i)){f=wm(t,r,!1),m=!1;continue}if(f===2){if(m=r,t.errorRecoveryDisabledLanes&m)var E=0;else E=t.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){r=E;e:{var P=t;f=Au;var Q=P.current.memoizedState.isDehydrated;if(Q&&(tl(P,E).flags|=256),E=wm(P,E,!1),E!==2&&E!==6){if(ym&&!Q){P.errorRecoveryDisabledLanes|=m,ns|=m,f=4;break e}m=Yr,Yr=f,m!==null&&(Yr===null?Yr=m:Yr.push.apply(Yr,m))}f=E}if(m=!1,f!==2)continue}}if(f===1){tl(t,0),di(t,r,0,!0);break}e:{switch(l=t,m=f,m){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r&&(r&62914560)!==r)break;case 6:di(l,r,io,!li);break e;case 2:Yr=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(f=Kd+300-xt(),10<f)){if(di(l,r,io,!li),Ve(l,0,!0)!==0)break e;ra=r,l.timeoutHandle=Fm(U2.bind(null,l,i,Yr,$d,vm,r,io,ns,Qs,li,m,"Throttled",-0,0),f);break e}U2(l,i,Yr,$d,vm,r,io,ns,Qs,li,m,null,-0,0)}}break}while(!0);oa(t)}function U2(t,r,i,l,f,m,E,P,Q,ie,pe,Ce,oe,fe){t.timeoutHandle=-1;var Ye=r.subtreeFlags,rt=(m&335544064)===m;if(Ce=null,(rt||Ye&8192||(Ye&16785408)===16785408)&&(Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ar},oo=null,I2(r,m,Ce),rt&&(Ye=Ce,rt=t.containerInfo,rt=(rt.nodeType===9?rt:rt.ownerDocument).__reactViewTransition,rt!=null&&(Ye.count++,Ye.waitingForViewTransition=!0,Ye=_u.bind(Ye),rt.finished.then(Ye,Ye))),Ye=(m&62914560)===m?Kd-xt():(m&4194048)===m?L2-xt():0,Ye=EN(Ce,Ye),Ye!==null)){ra=m,t.cancelPendingCommit=Ye($2.bind(null,t,r,m,i,l,f,E,P,Q,ie,pe,Ce,null,oe,fe)),di(t,m,E,!ie);return}$2(t,r,m,i,l,f,E,P,Q,ie,pe,Ce)}function xD(t){for(var r=t;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var f=i[l],m=f.getSnapshot;f=f.value;try{if(!no(m(),f))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function di(t,r,i,l){r=$e(t,r),r&=~Yd,r&=~ns,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var f=r;0<f;){var m=31-et(f),E=1<<m;l[m]=-1,f&=~E}i!==0&&_t(t,i,r)}function Qd(){return(ln&6)===0?(Nu(0),!1):!0}function Sm(){if(qt!==null){if(pn===0)var t=qt.return;else t=qt,Ca=qi=null,Ag(t),Fs=null,pu=0,t=qt;for(;t!==null;)u2(t.alternate,t),t=t.return;qt=null}}function tl(t,r){var i=t.timeoutHandle;return i!==-1&&(t.timeoutHandle=-1,qD(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),ra=0,Sm(),Tn=t,qt=i=Ra(t.current,null),Xt=r,pn=0,ao=null,li=!1,Xs=Xe(t,r),ym=!1,Qs=io=Yd=ns=ui=Vn=0,Yr=Au=null,vm=!1,Na=$e(t,r),od(),i}function F2(t,r){Nt=null,ge.H=Ad,r===Us||r===gd?(r=$b(),pn=3):r===mg?(r=$b(),pn=4):pn=r===qg?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ao=r,qt===null&&(Vn=1,Dd(t,vo(r,t.current)))}function B2(){var t=mr.current;return t===null?!0:(Xt&4194048)===Xt?Rr===null:(Xt&62914560)===Xt||(Xt&536870912)!==0?t===Rr:!1}function V2(){var t=ge.H;return ge.H=Ad,t===null?Ad:t}function q2(){var t=ge.A;return ge.A=vD,t}function Zd(){Vn=4,li||(Xt&4194048)!==Xt&&mr.current!==null||(Xs=!0),(ui&134217727)===0&&(ns&134217727)===0||Tn===null||di(Tn,Xt,io,!1)}function wm(t,r,i){var l=ln;ln|=2;var f=V2(),m=q2();(Tn!==t||Xt!==r)&&($d=null,tl(t,r)),r=!1;var E=Vn;e:do try{if(pn!==0&&qt!==null){var P=qt,Q=ao;switch(pn){case 8:Sm(),E=6;break e;case 3:case 2:case 9:case 6:mr.current===null&&(r=!0);var ie=pn;if(pn=0,ao=null,nl(t,P,Q,ie),i&&Xs){E=0;break e}break;default:ie=pn,pn=0,ao=null,nl(t,P,Q,ie)}}SD(),E=Vn;break}catch(pe){F2(t,pe)}while(!0);return r&&t.shellSuspendCounter++,Ca=qi=null,ln=l,ge.H=f,ge.A=m,qt===null&&(Tn=null,Xt=0,od()),E}function SD(){for(;qt!==null;)Y2(qt)}function wD(t,r){var i=ln;ln|=2;var l=V2(),f=q2();Tn!==t||Xt!==r?($d=null,Gd=xt()+500,tl(t,r)):Xs=Xe(t,r);e:do try{if(pn!==0&&qt!==null){r=qt;var m=ao;t:switch(pn){case 1:pn=0,ao=null,nl(t,r,m,1);break;case 2:case 9:if(Kb(m)){pn=0,ao=null,K2(r);break}r=function(){pn!==2&&pn!==9||Tn!==t||(pn=7),oa(t)},m.then(r,r);break e;case 3:pn=7;break e;case 4:pn=5;break e;case 7:Kb(m)?(pn=0,ao=null,K2(r)):(pn=0,ao=null,nl(t,r,m,7));break;case 5:var E=null;switch(qt.tag){case 26:E=qt.memoizedState;case 5:case 27:var P=qt;if(E?z1(E):P.stateNode.complete){pn=0,ao=null;var Q=P.sibling;if(Q!==null)qt=Q;else{var ie=P.return;ie!==null?(qt=ie,Jd(ie)):qt=null}break t}}pn=0,ao=null,nl(t,r,m,5);break;case 6:pn=0,ao=null,nl(t,r,m,6);break;case 8:Sm(),Vn=6;break e;default:throw Error(a(462))}}RD();break}catch(pe){F2(t,pe)}while(!0);return Ca=qi=null,ge.H=l,ge.A=f,ln=i,qt!==null?0:(Tn=null,Xt=0,od(),Vn)}function RD(){for(;qt!==null&&!en();)Y2(qt)}function Y2(t){var r=s2(t.alternate,t,Na);t.memoizedProps=t.pendingProps,r===null?Jd(t):qt=r}function K2(t){var r=t,i=r.alternate;switch(r.tag){case 15:case 0:r=e2(i,r,r.pendingProps,r.type,void 0,Xt);break;case 11:r=e2(i,r,r.pendingProps,r.type.render,r.ref,Xt);break;case 5:Ag(r);var l=r;l===ir&&(Ut?(cd(l),l.tag===5&&l.stateNode!=null&&(An=l.stateNode)):(cd(l),Ut=!0));default:u2(i,r),r=qt=kb(r,Na),r=s2(i,r,Na)}t.memoizedProps=t.pendingProps,r===null?Jd(t):qt=r}function nl(t,r,i,l){Ca=qi=null,Ag(r),Fs=null,pu=0;var f=r.return;try{if(cD(t,f,r,i,Xt)){Vn=1,Dd(t,vo(i,t.current)),qt=null;return}}catch(m){if(f!==null)throw qt=f,m;Vn=1,Dd(t,vo(i,t.current)),qt=null;return}r.flags&32768?(Ut||l===1?t=!0:Xs||(Xt&536870912)!==0?t=!1:(li=t=!0,(l===2||l===9||l===3||l===6)&&(l=mr.current,l!==null&&l.tag===13&&(l.flags|=16384))),G2(r,t)):Jd(r)}function Jd(t){var r=t;do{if((r.flags&32768)!==0){G2(r,li);return}t=r.return;var i=pD(r.alternate,r,Na);if(i!==null){qt=i;return}if(r=r.sibling,r!==null){qt=r;return}qt=r=t}while(r!==null);Vn===0&&(Vn=5)}function G2(t,r){do{var i=gD(t.alternate,t);if(i!==null){i.flags&=32767,qt=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(t=t.sibling,t!==null)){qt=t;return}qt=t=i}while(t!==null);Vn=6,qt=null}function $2(t,r,i,l,f,m,E,P,Q,ie,pe,Ce){t.cancelPendingCommit=null;do Wd();while(zn!==0);if((ln&6)!==0)throw Error(a(327));if(r!==null){if(r===t.current)throw Error(a(177));t===Tn&&(qt=Tn=null,Xt=0),rs=r,Ho=t,ra=i,xm=f,z2=l,ED(t,r,i,E,P,Q,Ce)}}function ED(t,r,i,l,f,m,E){var P=r.lanes|r.childLanes;if(bm=P,P|=rg,Bt(t,i,P,l,f,m),Js=null,(i&335544064)===i?(Ws=JA(t),l=10262):(Ws=null,l=10256),(r.subtreeFlags&l)!==0||(r.flags&l)!==0?(t.callbackNode=null,t.callbackPriority=0,DD(gt,function(){return Tm(),null})):(t.callbackNode=null,t.callbackPriority=0),_d=!1,l=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||l){l=ge.T,ge.T=null,f=ce.p,ce.p=2,m=ln,ln|=4;try{mD(t,r,i)}finally{ln=m,ce.p=f,ge.T=l}}zn=1,_d?Zs=QD(E,t.containerInfo,Ws,Rm,Em,TD,Cm,Tm,CD):(Rm(),Em(),Cm())}function CD(t){if(zn!==0){var r=Ho.onRecoverableError;r(t,{componentStack:null})}}function TD(){zn===3&&(zn=0,D2(rs,Ho),zn=4)}function Rm(){if(zn===1){zn=0;var t=Ho,r=rs,i=ra,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=ge.T,ge.T=null;var f=ce.p;ce.p=2;var m=ln;ln|=4;try{Tu=Fd=!1,M2(r,t,i),i=_m;var E=Cb(t.containerInfo),P=i.focusedElem,Q=i.selectionRange;if(E!==P&&P&&P.ownerDocument&&Eb(P.ownerDocument.documentElement,P)){if(Q!==null&&Jp(P)){var ie=Q.start,pe=Q.end;if(pe===void 0&&(pe=ie),"selectionStart"in P)P.selectionStart=ie,P.selectionEnd=Math.min(pe,P.value.length);else{var Ce=P.ownerDocument||document,oe=Ce&&Ce.defaultView||window;if(oe.getSelection){var fe=oe.getSelection(),Ye=P.textContent.length,rt=Math.min(Q.start,Ye),It=Q.end===void 0?rt:Math.min(Q.end,Ye);!fe.extend&&rt>It&&(E=It,It=rt,rt=E);var ae=Rb(P,rt),te=Rb(P,It);if(ae&&te&&(fe.rangeCount!==1||fe.anchorNode!==ae.node||fe.anchorOffset!==ae.offset||fe.focusNode!==te.node||fe.focusOffset!==te.offset)){var ue=Ce.createRange();ue.setStart(ae.node,ae.offset),fe.removeAllRanges(),rt>It?(fe.addRange(ue),fe.extend(te.node,te.offset)):(ue.setEnd(te.node,te.offset),fe.addRange(ue))}}}}for(Ce=[],fe=P;fe=fe.parentNode;)fe.nodeType===1&&Ce.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<Ce.length;P++){var Ee=Ce[P];Ee.element.scrollLeft=Ee.left,Ee.element.scrollTop=Ee.top}}cl=!!zm,_m=zm=null}finally{ln=m,ce.p=f,ge.T=l}}t.current=r,zn=2}}function Em(){if(zn===2){zn=0;var t=Ho,r=rs,i=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||i){i=ge.T,ge.T=null;var l=ce.p;ce.p=2;var f=ln;ln|=4;try{w2(t,r.alternate,r)}finally{ln=f,ce.p=l,ge.T=i}}zn=3}}function Cm(){if(zn===4||zn===3){zn=0;var t=Zs;Zs=null,We();var r=Ho,i=rs,l=ra,f=z2,m=(l&335544064)===l?10262:10256;if((i.subtreeFlags&m)!==0||(i.flags&m)!==0?zn=5:(zn=0,rs=Ho=null,X2(r,r.pendingLanes)),m=r.pendingLanes,m===0&&(ci=null),En(l),i=i.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(Pe,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=ge.T,m=ce.p,ce.p=2,ge.T=null;try{for(var E=r.onRecoverableError,P=0;P<f.length;P++){var Q=f[P];E(Q.value,{componentStack:Q.stack})}}finally{ge.T=i,ce.p=m}}if(f=Js,E=Ws,Ws=null,f!==null&&(Js=null,E===null&&(E=[]),t!==null))for(Q=0;Q<f.length;Q++)i=(0,f[Q])(E),i!==void 0&&t.finished.finally(i);(ra&3)!==0&&Wd(),oa(r),m=r.pendingLanes,(l&261930)!==0&&(m&42)!==0?r===Xd?Du++:(Du=0,Xd=r):(Du=0,Xd=null),Nu(0)}}function X2(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,du(r)))}function Wd(){return Zs!==null&&(Zs.skipTransition(),Zs=null),Rm(),Em(),Cm(),Tm()}function Tm(){if(zn!==5)return!1;var t=Ho,r=bm;bm=0;var i=En(ra),l=ge.T,f=ce.p;try{ce.p=32>i?32:i,ge.T=null,i=xm,xm=null;var m=Ho,E=ra;if(zn=0,rs=Ho=null,ra=0,(ln&6)!==0)throw Error(a(331));var P=ln;if(ln|=4,P2(m.current),N2(m,m.current,E,i),ln=P,Nu(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(Pe,m)}catch{}return!0}finally{ce.p=f,ge.T=l,X2(t,r)}}function Q2(t,r,i){r=vo(i,r),r=Vg(t.stateNode,r,2),t=ni(t,r,2),t!==null&&(ct(t,2),oa(t))}function gn(t,r,i){if(t.tag===3)Q2(t,t,i);else for(;r!==null;){if(r.tag===3){Q2(r,t,i);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ci===null||!ci.has(l))){t=vo(i,t),i=Kx(2),l=ni(r,i,2),l!==null&&(Gx(i,l,r,t),ct(l,2),oa(l));break}}r=r.return}}function Om(t,r,i){var l=t.pingCache;if(l===null){l=t.pingCache=new bD;var f=new Set;l.set(r,f)}else f=l.get(r),f===void 0&&(f=new Set,l.set(r,f));f.has(i)||(ym=!0,f.add(i),t=OD.bind(null,t,r,i),r.then(t,t))}function OD(t,r,i){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,Tn===t&&(Xt&i)===i&&((Vn===4||Vn===3&&(Xt&62914560)===Xt&&300>xt()-Kd)&&(ln&2)===0?tl(t,0):Yd|=i,Qs===Xt&&(Qs=0)),oa(t)}function Z2(t,r){r===0&&(r=tt()),t=Fi(t,r),t!==null&&(ct(t,r),oa(t))}function MD(t){var r=t.memoizedState,i=0;r!==null&&(i=r.retryLane),Z2(t,i)}function AD(t,r){var i=0;switch(t.tag){case 31:case 13:var l=t.stateNode,f=t.memoizedState;f!==null&&(i=f.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(r),Z2(t,i)}function DD(t,r){return Wt(t,r)}var rl=null,ol=null,Mm=!1,ef=!1,Am=!1,fi=0;function oa(t){t!==ol&&t.next===null&&(ol===null?rl=ol=t:ol=ol.next=t),ef=!0,Mm||(Mm=!0,ID())}function Nu(t,r){if(!Am&&ef){Am=!0;do for(var i=!1,l=rl;l!==null;){if(t!==0){var f=l.pendingLanes;if(f===0)var m=0;else{var E=l.suspendedLanes,P=l.pingedLanes;m=(1<<31-et(42|t)+1)-1,m&=f&~(E&~P),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(i=!0,t1(l,m))}else m=Xt,m=Ve(l,l===Tn?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(m&3)===0||Xe(l,m)||(i=!0,t1(l,m));l=l.next}while(i);Am=!1}}function ND(){J2()}function J2(){ef=Mm=!1;var t=0;fi!==0&&VD()&&(t=fi);for(var r=xt(),i=null,l=rl;l!==null;){var f=l.next,m=W2(l,r);m===0?(l.next=null,i===null?rl=f:i.next=f,f===null&&(ol=i)):(i=l,(t!==0||(m&3)!==0)&&(ef=!0)),l=f}zn!==0&&zn!==5||Nu(t),fi!==0&&(fi=0)}function W2(t,r){for(var i=t.suspendedLanes,l=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var E=31-et(m),P=1<<E,Q=f[E];Q===-1?((P&i)===0||(P&l)!==0)&&(f[E]=st(P,r)):Q<=r&&(t.expiredLanes|=P),m&=~P}if(r=Tn,i=Xt,i=Ve(t,t===r?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,i===0||t===r&&(pn===2||pn===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&rn(l),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||Xe(t,i)){if(r=i&-i,r===t.callbackPriority)return r;switch(l!==null&&rn(l),En(i)){case 2:case 8:i=vt;break;case 32:i=gt;break;case 268435456:i=un;break;default:i=gt}return l=e1.bind(null,t),i=Wt(i,l),t.callbackPriority=r,t.callbackNode=i,r}return l!==null&&l!==null&&rn(l),t.callbackPriority=2,t.callbackNode=null,2}function e1(t,r){if(zn!==0&&zn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(Wd()&&t.callbackNode!==i)return null;var l=Xt;return l=Ve(t,t===Tn?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(H2(t,l,r),W2(t,xt()),t.callbackNode!=null&&t.callbackNode===i?e1.bind(null,t):null)}function t1(t,r){if(Wd())return null;H2(t,r,!0)}function ID(){YD(function(){(ln&6)!==0?Wt(ft,ND):J2()})}function Dm(){if(fi===0){var t=Gi;t===0&&(t=ne,ne<<=1,(ne&261888)===0&&(ne=256)),fi=t}return fi}function n1(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:hr(t)}function jD(t,r,i,l,f){if(r==="submit"&&i&&i.stateNode===f){var m=n1((f[Mn]||null).action),E=l.submitter;E&&(r=(r=E[Mn]||null)?n1(r.formAction):E.getAttribute("formAction"),r!==null&&(m=r,E=null));var P=new ed("action","action",null,l,f);t.push({event:P,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(fi!==0){var Q=new FormData(f,E);_g(i,{pending:!0,data:Q,method:f.method,action:m},null,Q)}}else typeof m=="function"&&(P.preventDefault(),Q=new FormData(f,E),_g(i,{pending:!0,data:Q,method:f.method,action:m},m,Q))},currentTarget:f}]})}}for(var Nm=0;Nm<ng.length;Nm++){var Im=ng[Nm],PD=Im.toLowerCase(),kD=Im[0].toUpperCase()+Im.slice(1);ko(PD,"on"+kD)}ko(Mb,"onAnimationEnd"),ko(Ab,"onAnimationIteration"),ko(Db,"onAnimationStart"),ko("dblclick","onDoubleClick"),ko("focusin","onFocus"),ko("focusout","onBlur"),ko(qA,"onTransitionRun"),ko(YA,"onTransitionStart"),ko(KA,"onTransitionCancel"),ko(Nb,"onTransitionEnd"),vn("onMouseEnter",["mouseout","mouseover"]),vn("onMouseLeave",["mouseout","mouseover"]),vn("onPointerEnter",["pointerout","pointerover"]),vn("onPointerLeave",["pointerout","pointerover"]),Lt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Lt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Lt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Lt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Lt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Lt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Iu="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(" "),LD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Iu));function r1(t,r){r=(r&4)!==0;for(var i=0;i<t.length;i++){var l=t[i],f=l.event;l=l.listeners;e:{var m=void 0;if(r)for(var E=l.length-1;0<=E;E--){var P=l[E],Q=P.instance,ie=P.currentTarget;if(P=P.listener,Q!==m&&f.isPropagationStopped())break e;m=P,f.currentTarget=ie;try{m(f)}catch(pe){rd(pe)}f.currentTarget=null,m=Q}else for(E=0;E<l.length;E++){if(P=l[E],Q=P.instance,ie=P.currentTarget,P=P.listener,Q!==m&&f.isPropagationStopped())break e;m=P,f.currentTarget=ie;try{m(f)}catch(pe){rd(pe)}f.currentTarget=null,m=Q}}}}function Yt(t,r){var i=r[va];i===void 0&&(i=r[va]=new Set);var l=t+"__bubble";i.has(l)||(o1(r,t,2,!1),i.add(l))}function jm(t,r,i){var l=0;r&&(l|=4),o1(i,t,l,r)}var tf="_reactListening"+Math.random().toString(36).slice(2);function Pm(t){if(!t[tf]){t[tf]=!0,Ct.forEach(function(i){i!=="selectionchange"&&(LD.has(i)||jm(i,!1,t),jm(i,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[tf]||(r[tf]=!0,jm("selectionchange",!1,r))}}function o1(t,r,i,l){switch(G1(r)){case 2:var f=MN;break;case 8:f=AN;break;default:f=e0}i=f.bind(null,r,i,t),f=void 0,!_i||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),l?f!==void 0?t.addEventListener(r,i,{capture:!0,passive:f}):t.addEventListener(r,i,!0):f!==void 0?t.addEventListener(r,i,{passive:f}):t.addEventListener(r,i,!1)}function km(t,r,i,l,f){var m=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var E=l.tag;if(E===3||E===4){var P=l.stateNode.containerInfo;if(P===f)break;if(E===4)for(E=l.return;E!==null;){var Q=E.tag;if((Q===3||Q===4)&&E.stateNode.containerInfo===f)return;E=E.return}for(;P!==null;){if(E=Fn(P),E===null)return;if(Q=E.tag,Q===5||Q===6||Q===26||Q===27){l=m=E;continue e}P=P.parentNode}}l=l.return}zi(function(){var ie=m,pe=Li(i),Ce=[];e:{var oe=Ib.get(t);if(oe!==void 0){var fe=ed,Ye=t;switch(t){case"keypress":if(Jc(i)===0)break e;case"keydown":case"keyup":fe=xA;break;case"focusin":Ye="focus",fe=Kp;break;case"focusout":Ye="blur",fe=Kp;break;case"beforeblur":case"afterblur":fe=Kp;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=sb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=lA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=CA;break;case Mb:case Ab:case Db:fe=dA;break;case Nb:fe=OA;break;case"scroll":case"scrollend":fe=iA;break;case"wheel":fe=AA;break;case"copy":case"cut":case"paste":fe=hA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=ub;break;case"submit":fe=RA;break;case"toggle":case"beforetoggle":fe=NA}var rt=(r&4)!==0,It=!rt&&(t==="scroll"||t==="scrollend"),ae=rt?oe!==null?oe+"Capture":null:oe;rt=[];for(var te=ie,ue;te!==null;){var Ee=te;if(ue=Ee.stateNode,Ee=Ee.tag,Ee!==5&&Ee!==26&&Ee!==27||ue===null||ae===null||(Ee=xa(te,ae),Ee!=null&&rt.push(ju(te,Ee,ue))),It)break;te=te.return}0<rt.length&&(oe=new fe(oe,Ye,null,i,pe),Ce.push({event:oe,listeners:rt}))}}if((r&7)===0){e:{if(fe=t==="mouseover"||t==="pointerover",oe=t==="mouseout"||t==="pointerout",fe&&i!==ki&&(Ye=i.relatedTarget||i.fromElement)&&(Fn(Ye)||Ye[In]))break e;(oe||fe)&&(Ye=pe.window===pe?pe:(fe=pe.ownerDocument)?fe.defaultView||fe.parentWindow:window,oe?(fe=i.relatedTarget||i.toElement,oe=ie,fe=fe?Fn(fe):null,fe!==null&&(It=u(fe),rt=fe.tag,fe!==It||rt!==5&&rt!==27&&rt!==6)&&(fe=null)):(oe=null,fe=ie),oe!==fe&&(rt=sb,Ee="onMouseLeave",ae="onMouseEnter",te="mouse",(t==="pointerout"||t==="pointerover")&&(rt=ub,Ee="onPointerLeave",ae="onPointerEnter",te="pointer"),It=oe==null?Ye:he(oe),ue=fe==null?Ye:he(fe),Ye=new rt(Ee,te+"leave",oe,i,pe),Ye.target=It,Ye.relatedTarget=ue,Ee=null,Fn(pe)===ie&&(rt=new rt(ae,te+"enter",fe,i,pe),rt.target=ue,rt.relatedTarget=It,Ee=rt),It=Ee,rt=oe&&fe?k(oe,fe,zD):null,oe!==null&&a1(Ce,Ye,oe,rt,!1),fe!==null&&It!==null&&a1(Ce,It,fe,rt,!0)))}e:{if(oe=ie?he(ie):window,fe=oe.nodeName&&oe.nodeName.toLowerCase(),fe==="select"||fe==="input"&&oe.type==="file")var Je=yb;else if(gb(oe))if(vb)Je=FA;else{Je=HA;var Qt=_A}else fe=oe.nodeName,!fe||fe.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ie&&Pi(ie.elementType)&&(Je=yb):Je=UA;if(Je&&(Je=Je(t,ie))){mb(Ce,Je,i,pe);break e}Qt&&Qt(t,oe,ie)}switch(Qt=ie?he(ie):window,t){case"focusin":(gb(Qt)||Qt.contentEditable==="true")&&(Is=Qt,Wp=ie,lu=null);break;case"focusout":lu=Wp=Is=null;break;case"mousedown":eg=!0;break;case"contextmenu":case"mouseup":case"dragend":eg=!1,Tb(Ce,i,pe);break;case"selectionchange":if(VA)break;case"keydown":case"keyup":Tb(Ce,i,pe)}var lt;if($p)e:{switch(t){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Ns?hb(t,i)&&(bt="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(bt="onCompositionStart");bt&&(cb&&i.locale!=="ko"&&(Ns||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Ns&&(lt=ab()):(Ga=pe,Vp="value"in Ga?Ga.value:Ga.textContent,Ns=!0)),Qt=nf(ie,bt),0<Qt.length&&(bt=new lb(bt,t,null,i,pe),Ce.push({event:bt,listeners:Qt}),lt?bt.data=lt:(lt=pb(i),lt!==null&&(bt.data=lt)))),(lt=jA?PA(t,i):kA(t,i))&&(bt=nf(ie,"onBeforeInput"),0<bt.length&&(Qt=new lb("onBeforeInput","beforeinput",null,i,pe),Ce.push({event:Qt,listeners:bt}),Qt.data=lt)),jD(Ce,t,ie,i,pe)}r1(Ce,r)})}function ju(t,r,i){return{instance:t,listener:r,currentTarget:i}}function nf(t,r){for(var i=r+"Capture",l=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=xa(t,i),f!=null&&l.unshift(ju(t,f,m)),f=xa(t,r),f!=null&&l.push(ju(t,f,m))),t.tag===3)return l;t=t.return}return[]}function zD(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function a1(t,r,i,l,f){for(var m=r._reactName,E=[];i!==null&&i!==l;){var P=i,Q=P.alternate,ie=P.stateNode;if(P=P.tag,Q!==null&&Q===l)break;P!==5&&P!==26&&P!==27||ie===null||(Q=ie,f?(ie=xa(i,m),ie!=null&&E.unshift(ju(i,ie,Q))):f||(ie=xa(i,m),ie!=null&&E.push(ju(i,ie,Q)))),i=i.return}E.length!==0&&t.push({event:r,listeners:E})}var _D=/\r\n?/g,HD=/\u0000|\uFFFD/g;function i1(t){return(typeof t=="string"?t:""+t).replace(_D,`
10
- `).replace(HD,"")}function s1(t,r){return r=i1(r),i1(t)===r}function mn(t,r,i,l,f,m){switch(i){case"children":if(typeof l=="string")r==="body"||r==="textarea"&&l===""||Mr(t,l);else if(typeof l=="number"||typeof l=="bigint")r!=="body"&&Mr(t,""+l);else return;break;case"className":Jr(t,"class",l);break;case"tabIndex":Jr(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Jr(t,i,l);break;case"style":eo(t,l,m);return;case"data":if(r!=="object"){Jr(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||i!=="href")){t.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(i);break}l=hr(l),t.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(i,"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 m=="function"&&(i==="formAction"?(r!=="input"&&mn(t,r,"name",f.name,f,null),mn(t,r,"formEncType",f.formEncType,f,null),mn(t,r,"formMethod",f.formMethod,f,null),mn(t,r,"formTarget",f.formTarget,f,null)):(mn(t,r,"encType",f.encType,f,null),mn(t,r,"method",f.method,f,null),mn(t,r,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(i);break}l=hr(l),t.setAttribute(i,l);break;case"onClick":l!=null&&(t.onclick=Ar);return;case"onScroll":l!=null&&Yt("scroll",t);return;case"onScrollEnd":l!=null&&Yt("scrollend",t);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(a(60));m?.__html!==i&&(t.innerHTML=i)}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}i=hr(l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,l):t.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":l===!0?t.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,l):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(i,l):t.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(i):t.setAttribute(i,l);break;case"popover":Yt("beforetoggle",t),Yt("toggle",t),Ln(t,"popover",l);break;case"xlinkActuate":Gn(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Gn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Gn(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Gn(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Gn(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Gn(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Gn(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Gn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Gn(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ln(t,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=Wl.get(i)||i,Ln(t,i,l);else return}pt=!0}function Lm(t,r,i,l,f,m){switch(i){case"style":eo(t,l,m);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(a(60));m?.__html!==i&&(t.innerHTML=i)}}break;case"children":if(typeof l=="string")Mr(t,l);else if(typeof l=="number"||typeof l=="bigint")Mr(t,""+l);else return;break;case"onScroll":l!=null&&Yt("scroll",t);return;case"onScrollEnd":l!=null&&Yt("scrollend",t);return;case"onClick":l!=null&&(t.onclick=Ar);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!wt.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),m=i.slice(2,f?i.length-7:void 0),r=t[Mn]||null,r=r!=null?r[i]:null,typeof r=="function"&&t.removeEventListener(m,r,f),typeof l=="function")){typeof r!="function"&&r!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(m,l,f);break e}pt=!0,i in t?t[i]=l:l===!0?t.setAttribute(i,""):Ln(t,i,l)}return}pt=!0}function br(t,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Yt("error",t),Yt("load",t);var l=!1,f=!1,m;for(m in i)if(i.hasOwnProperty(m)){var E=i[m];if(E!=null)switch(m){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:mn(t,r,m,E,i,null)}}f&&mn(t,r,"srcSet",i.srcSet,i,null),l&&mn(t,r,"src",i.src,i,null);return;case"input":Yt("invalid",t);var P=m=E=f=null,Q=null,ie=null;for(l in i)if(i.hasOwnProperty(l)){var pe=i[l];if(pe!=null)switch(l){case"name":f=pe;break;case"type":E=pe;break;case"checked":Q=pe;break;case"defaultChecked":ie=pe;break;case"value":m=pe;break;case"defaultValue":P=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(a(137,r));break;default:mn(t,r,l,pe,i,null)}}Ya(t,m,P,Q,ie,E,f,!1);return;case"select":Yt("invalid",t),l=E=m=null;for(f in i)if(i.hasOwnProperty(f)&&(P=i[f],P!=null))switch(f){case"value":m=P;break;case"defaultValue":E=P;break;case"multiple":l=P;default:mn(t,r,f,P,i,null)}r=m,i=E,t.multiple=!!l,r!=null?Fr(t,!!l,r,!1):i!=null&&Fr(t,!!l,i,!0);return;case"textarea":Yt("invalid",t),m=f=l=null;for(E in i)if(i.hasOwnProperty(E)&&(P=i[E],P!=null))switch(E){case"value":l=P;break;case"defaultValue":f=P;break;case"children":m=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(91));break;default:mn(t,r,E,P,i,null)}Wr(t,l,f,m);return;case"option":for(Q in i)i.hasOwnProperty(Q)&&(l=i[Q],l!=null)&&(Q==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":mn(t,r,Q,l,i,null));return;case"dialog":Yt("beforetoggle",t),Yt("toggle",t),Yt("cancel",t),Yt("close",t);break;case"iframe":case"object":Yt("load",t);break;case"video":case"audio":for(l=0;l<Iu.length;l++)Yt(Iu[l],t);break;case"image":Yt("error",t),Yt("load",t);break;case"details":Yt("toggle",t);break;case"embed":case"source":case"link":Yt("error",t),Yt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in i)if(i.hasOwnProperty(ie)&&(l=i[ie],l!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:mn(t,r,ie,l,i,null)}return;default:if(Pi(r)){for(pe in i)i.hasOwnProperty(pe)&&(l=i[pe],l!==void 0&&Lm(t,r,pe,l,i,void 0));return}}for(P in i)i.hasOwnProperty(P)&&(l=i[P],l!=null&&mn(t,r,P,l,i,null))}var UD={};function FD(t,r,i,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,E=null,P=null,Q=null,ie=null,pe=null;for(fe in i){var Ce=i[fe];if(i.hasOwnProperty(fe)&&Ce!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":Q=Ce;default:l.hasOwnProperty(fe)||mn(t,r,fe,null,l,Ce)}}for(var oe in l){var fe=l[oe];if(Ce=i[oe],l.hasOwnProperty(oe)&&(fe!=null||Ce!=null))switch(oe){case"type":fe!==Ce&&(pt=!0),m=fe;break;case"name":fe!==Ce&&(pt=!0),f=fe;break;case"checked":fe!==Ce&&(pt=!0),ie=fe;break;case"defaultChecked":fe!==Ce&&(pt=!0),pe=fe;break;case"value":fe!==Ce&&(pt=!0),E=fe;break;case"defaultValue":fe!==Ce&&(pt=!0),P=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(a(137,r));break;default:fe!==Ce&&mn(t,r,oe,fe,l,Ce)}}wr(t,E,P,Q,ie,pe,m,f);return;case"select":fe=E=P=oe=null;for(m in i)if(Q=i[m],i.hasOwnProperty(m)&&Q!=null)switch(m){case"value":break;case"multiple":fe=Q;default:l.hasOwnProperty(m)||mn(t,r,m,null,l,Q)}for(f in l)if(m=l[f],Q=i[f],l.hasOwnProperty(f)&&(m!=null||Q!=null))switch(f){case"value":m!==Q&&(pt=!0),oe=m;break;case"defaultValue":m!==Q&&(pt=!0),P=m;break;case"multiple":m!==Q&&(pt=!0),E=m;default:m!==Q&&mn(t,r,f,m,l,Q)}r=P,i=E,l=fe,oe!=null?Fr(t,!!i,oe,!1):!!l!=!!i&&(r!=null?Fr(t,!!i,r,!0):Fr(t,!!i,i?[]:"",!1));return;case"textarea":fe=oe=null;for(P in i)if(f=i[P],i.hasOwnProperty(P)&&f!=null&&!l.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:mn(t,r,P,null,l,f)}for(E in l)if(f=l[E],m=i[E],l.hasOwnProperty(E)&&(f!=null||m!=null))switch(E){case"value":f!==m&&(pt=!0),oe=f;break;case"defaultValue":f!==m&&(pt=!0),fe=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==m&&mn(t,r,E,f,l,m)}Ds(t,oe,fe);return;case"option":for(var Ye in i)oe=i[Ye],i.hasOwnProperty(Ye)&&oe!=null&&!l.hasOwnProperty(Ye)&&(Ye==="selected"?t.selected=!1:mn(t,r,Ye,null,l,oe));for(Q in l)oe=l[Q],fe=i[Q],l.hasOwnProperty(Q)&&oe!==fe&&(oe!=null||fe!=null)&&(Q==="selected"?(oe!==fe&&(pt=!0),t.selected=oe&&typeof oe!="function"&&typeof oe!="symbol"):mn(t,r,Q,oe,l,fe));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 rt in i)oe=i[rt],i.hasOwnProperty(rt)&&oe!=null&&!l.hasOwnProperty(rt)&&mn(t,r,rt,null,l,oe);for(ie in l)if(oe=l[ie],fe=i[ie],l.hasOwnProperty(ie)&&oe!==fe&&(oe!=null||fe!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,r));break;default:mn(t,r,ie,oe,l,fe)}return;default:if(Pi(r)){for(var It in i)oe=i[It],i.hasOwnProperty(It)&&oe!==void 0&&!l.hasOwnProperty(It)&&Lm(t,r,It,void 0,l,oe);for(pe in l)oe=l[pe],fe=i[pe],!l.hasOwnProperty(pe)||oe===fe||oe===void 0&&fe===void 0||Lm(t,r,pe,oe,l,fe);return}}for(var ae in i)oe=i[ae],i.hasOwnProperty(ae)&&oe!=null&&!l.hasOwnProperty(ae)&&mn(t,r,ae,null,l,oe);for(Ce in l)oe=l[Ce],fe=i[Ce],!l.hasOwnProperty(Ce)||oe===fe||oe==null&&fe==null||mn(t,r,Ce,oe,l,fe)}function l1(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function BD(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var f=i[l],m=f.transferSize,E=f.initiatorType,P=f.duration;if(m&&P&&l1(E)){for(E=0,P=f.responseEnd,l+=1;l<i.length;l++){var Q=i[l],ie=Q.startTime;if(ie>P)break;var pe=Q.transferSize,Ce=Q.initiatorType;pe&&l1(Ce)&&(Q=Q.responseEnd,E+=pe*(Q<P?1:(P-ie)/(Q-ie)))}if(--l,r+=8*(m+E)/(f.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var zm=null,_m=null;function Pu(t){return t.nodeType===9?t:t.ownerDocument}function u1(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function c1(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function d1(t,r,i,l){return i=Pu(i).createElement(t),i[dn]=l,i[Mn]=r,br(i,t,r),Se(i),i}function Hm(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Um=null;function VD(){var t=window.event;return t&&t.type==="popstate"?t===Um?!1:(Um=t,!0):(Um=null,!1)}var Fm=typeof setTimeout=="function"?setTimeout:void 0,qD=typeof clearTimeout=="function"?clearTimeout:void 0,f1=typeof Promise=="function"?Promise:void 0,h1=typeof requestAnimationFrame=="function"?requestAnimationFrame:Fm,YD=typeof queueMicrotask=="function"?queueMicrotask:typeof f1<"u"?function(t){return f1.resolve(null).then(t).catch(KD)}:Fm;function KD(t){setTimeout(function(){throw t})}function hi(t){return t==="head"}function p1(t,r){var i=r,l=0;do{var f=i.nextSibling;if(t.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(l===0){t.removeChild(f),dl(r);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")Xm(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,Xm(i);for(var m=i.firstChild;m;){var E=m.nextSibling,P=m.nodeName;m[go]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&m.rel.toLowerCase()==="stylesheet"||i.removeChild(m),m=E}}else i==="body"&&Xm(t.ownerDocument.body);i=f}while(i);dl(r)}function g1(t,r){var i=t;t=0;do{var l=i.nextSibling;if(i.nodeType===1?r?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(r?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=l}while(i)}function m1(t,r,i){if(r=CSS.escape(r)!==r?"r-"+btoa(r).replace(/=/g,""):r,t.style.viewTransitionName=r,i!=null&&(t.style.viewTransitionClass=i),i=getComputedStyle(t),i.display==="inline"){if(r=t.getClientRects(),r.length===1)var l=1;else for(var f=l=0;f<r.length;f++){var m=r[f];0<m.width&&0<m.height&&l++}l===1&&(t=t.style,t.display=r.length===1?"inline-block":"block",t.marginTop="-"+i.paddingTop,t.marginBottom="-"+i.paddingBottom)}}function y1(t,r){t=t.style,r=r.style;var i=r!=null?r.hasOwnProperty("viewTransitionName")?r.viewTransitionName:r.hasOwnProperty("view-transition-name")?r["view-transition-name"]:null:null;t.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=r!=null?r.hasOwnProperty("viewTransitionClass")?r.viewTransitionClass:r.hasOwnProperty("view-transition-class")?r["view-transition-class"]:null:null,t.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),t.display==="inline-block"&&(r==null?t.display=t.margin="":(i=r.display,t.display=i==null||typeof i=="boolean"?"":i,i=r.margin,i!=null?t.margin=i:(i=r.hasOwnProperty("marginTop")?r.marginTop:r["margin-top"],t.marginTop=i==null||typeof i=="boolean"?"":i,r=r.hasOwnProperty("marginBottom")?r.marginBottom:r["margin-bottom"],t.marginBottom=r==null||typeof r=="boolean"?"":r)))}function GD(t,r,i){return i=i.ownerDocument.defaultView,{rect:t,abs:r.position==="absolute"||r.position==="fixed",clip:r.clipPath!=="none"||r.overflow!=="visible"||r.filter!=="none"||r.mask!=="none"||r.mask!=="none"||r.borderRadius!=="0px",view:0<=t.bottom&&0<=t.right&&t.top<=i.innerHeight&&t.left<=i.innerWidth}}function Bm(t){var r=t.getBoundingClientRect(),i=getComputedStyle(t);return GD(r,i,t)}function $D(t){return t.documentElement.clientHeight}function XD(t){this.addEventListener("load",t),this.addEventListener("error",t)}function QD(t,r,i,l,f,m,E,P,Q){var ie=r.nodeType===9?r:r.ownerDocument;try{var pe=ie.startViewTransition({update:function(){var oe=ie.defaultView,fe=oe.navigation&&oe.navigation.transition,Ye=ie.fonts.status;l();var rt=[];if(Ye==="loaded"&&($D(ie),ie.fonts.status==="loading"&&rt.push(ie.fonts.ready)),Ye=rt.length,t!==null)for(var It=t.suspenseyImages,ae=0,te=0;te<It.length;te++){var ue=It[te];if(!ue.complete){var Ee=ue.getBoundingClientRect();if(0<Ee.bottom&&0<Ee.right&&Ee.top<oe.innerHeight&&Ee.left<oe.innerWidth){if(ae+=_1(ue),ae>af){rt.length=Ye;break}ue=new Promise(XD.bind(ue)),rt.push(ue)}}}if(0<rt.length)return oe=Promise.race([Promise.all(rt),new Promise(function(Je){return setTimeout(Je,500)})]).then(f,f),(fe?Promise.allSettled([fe.finished,oe]):oe).then(m,m);if(f(),fe)return fe.finished.then(m,m);m()},types:i});ie.__reactViewTransition=pe;var Ce=[];return pe.ready.then(function(){for(var oe=ie.documentElement.getAnimations({subtree:!0}),fe=0;fe<oe.length;fe++){var Ye=oe[fe],rt=Ye.effect,It=rt.pseudoElement;if(It!=null&&It.startsWith("::view-transition")){Ce.push(Ye),Ye=rt.getKeyframes();for(var ae=It=void 0,te=!0,ue=0;ue<Ye.length;ue++){var Ee=Ye[ue],Je=Ee.width;if(It===void 0)It=Je;else if(It!==Je){te=!1;break}if(Je=Ee.height,ae===void 0)ae=Je;else if(ae!==Je){te=!1;break}delete Ee.width,delete Ee.height,Ee.transform==="none"&&delete Ee.transform}te&&It!==void 0&&ae!==void 0&&(rt.setKeyframes(Ye),te=getComputedStyle(rt.target,rt.pseudoElement),te.width!==It||te.height!==ae)&&(te=Ye[0],te.width=It,te.height=ae,te=Ye[Ye.length-1],te.width=It,te.height=ae,rt.setKeyframes(Ye))}}E()},function(oe){ie.__reactViewTransition===pe&&(ie.__reactViewTransition=null);try{typeof oe=="object"&&oe!==null&&oe.name==="InvalidStateError"&&(oe.message==="View transition was skipped because document visibility state is hidden."||oe.message==="Skipping view transition because document visibility state has become hidden."||oe.message==="Skipping view transition because viewport size changed."||oe.message==="Transition was aborted because of invalid state")&&(oe=null),oe!==null&&Q(oe)}finally{l(),f(),E()}}),pe.finished.finally(function(){for(var oe=0;oe<Ce.length;oe++)Ce[oe].cancel();ie.__reactViewTransition===pe&&(ie.__reactViewTransition=null),P()}),pe}catch{return l(),f(),E(),null}}function os(t,r){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+r+")"}os.prototype.animate=function(t,r){return r=typeof r=="number"?{duration:r}:j({},r),r.pseudoElement=this._selector,this._scope.animate(t,r)},os.prototype.getAnimations=function(){for(var t=this._scope,r=this._selector,i=t.getAnimations({subtree:!0}),l=[],f=0;f<i.length;f++){var m=i[f].effect;m!==null&&m.target===t&&m.pseudoElement===r&&l.push(i[f])}return l},os.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function v1(t){return{name:t,group:new os("group",t),imagePair:new os("image-pair",t),old:new os("old",t),new:new os("new",t)}}function lo(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}lo.prototype.addEventListener=function(t,r,i){var l=null,f=null;if(!(i!=null&&typeof i!="boolean"&&(l=i.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var m=this._eventListeners;if(x1(m,t,r,i)===-1){var E=this,P=r;i!=null&&typeof i!="boolean"&&i.once===!0&&(P=function(Q){E.removeEventListener(t,r,i),typeof r=="function"?r.call(this,Q):r.handleEvent(Q)}),l!==null&&(f=E.removeEventListener.bind(E,t,r,i),l.addEventListener("abort",f,{once:!0}),f=l.removeEventListener.bind(l,"abort",f)),l=al(i),m.push({type:t,listener:r,optionsOrUseCapture:i,attachedListener:P,cleanup:f}),h(this._fragmentFiber.child,!1,ZD,t,P,l)}this._eventListeners=m}};function ZD(t,r,i,l){return R(t).addEventListener(r,i,l),!1}lo.prototype.removeEventListener=function(t,r,i){var l=this._eventListeners;if(l!==null&&(r=x1(l,t,r,i),r!==-1)){var f=l[r];i=f.attachedListener;var m=f.cleanup;f=al(f.optionsOrUseCapture),h(this._fragmentFiber.child,!1,JD,t,i,f),l.splice(r,1),m!==null&&m()}};function JD(t,r,i,l){return R(t).removeEventListener(r,i,l),!1}function al(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function b1(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function x1(t,r,i,l){if(t.length===0)return-1;l=b1(l);for(var f=0;f<t.length;f++){var m=t[f];if(m.type===r&&m.listener===i&&b1(m.optionsOrUseCapture)===l)return f}return-1}lo.prototype.dispatchEvent=function(t){var r=b(this._fragmentFiber);if(r===null)return!0;r=R(r);var i=this._eventListeners;if(i!==null&&0<i.length||!t.bubbles){var l=r.nodeType===9?r.createComment(""):document.createTextNode("");if(i)for(var f=0;f<i.length;f++){var m=i[f];l.addEventListener(m.type,m.attachedListener,al(m.optionsOrUseCapture))}if(r.appendChild(l),t=l.dispatchEvent(t),i)for(f=0;f<i.length;f++)m=i[f],l.removeEventListener(m.type,m.attachedListener,al(m.optionsOrUseCapture));return r.removeChild(l),t}return r.dispatchEvent(t)},lo.prototype.focus=function(t){h(this._fragmentFiber.child,!0,S1,t,void 0,void 0)};function S1(t,r){return t.tag===6?!1:(t=R(t),cN(t,r))}lo.prototype.focusLast=function(t){var r=[];h(this._fragmentFiber.child,!0,Vm,r,void 0,void 0);for(var i=r.length-1;0<=i&&!S1(r[i],t);i--);};function Vm(t,r){return r.push(t),!1}lo.prototype.blur=function(){var t=b(this._fragmentFiber);t!==null&&(t=R(t),t=Pu(t).activeElement,t!==null&&h(this._fragmentFiber.child,!1,WD,t,void 0,void 0))};function WD(t,r){return t.tag===6?!1:(t=R(t),t===r||t.contains(r)?(r.blur(),!0):!1)}lo.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),h(this._fragmentFiber.child,!1,eN,t,void 0,void 0)};function eN(t,r){return t.tag===6||(t=R(t),r.observe(t)),!1}lo.prototype.unobserveUsing=function(t){var r=this._observers;if(r!==null&&r.has(t)){r.delete(t),h(this._fragmentFiber.child,!1,tN,t,void 0,void 0);for(var i=r=0;i<Uo.length;i++){var l=Uo[i];l.fragmentInstance===this&&l.observer===t?t.unobserve(l.instance):Uo[r++]=l}Uo.length=r}};function tN(t,r){return t.tag===6||(t=R(t),r.unobserve(t)),!1}var Uo=[],qm=!1;function nN(t,r,i){Uo.push({fragmentInstance:t,observer:r,instance:i}),qm||(qm=!0,dN(function(){qm=!1;var l=Uo;Uo=[];for(var f=0;f<l.length;f++){var m=l[f];m.observer.unobserve(m.instance)}}))}lo.prototype.getClientRects=function(){var t=[];return h(this._fragmentFiber.child,!1,rN,t,void 0,void 0),t};function rN(t,r){if(t.tag===6){t=t.stateNode;var i=t.ownerDocument.createRange();i.selectNodeContents(t),r.push.apply(r,i.getClientRects())}else t=R(t),r.push.apply(r,t.getClientRects());return!1}lo.prototype.getRootNode=function(t){var r=b(this._fragmentFiber);return r===null?this:R(r).getRootNode(t)},lo.prototype.compareDocumentPosition=function(t){var r=b(this._fragmentFiber);if(r===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];h(this._fragmentFiber.child,!1,Vm,i,void 0,void 0);var l=R(r);if(i.length===0){if(i=l,x(this._fragmentFiber)){e:{for(r=this._fragmentFiber.return;r!==null;){if(r.tag===4){r=r.stateNode.containerInfo;break e}if(r.tag===3||r.tag===5||r.tag===27)break;r=r.return}r=null}r!=null&&(i=r)}r=this._fragmentFiber;var f=l=i.compareDocumentPosition(t);return i===t?f=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=w(r)[1],i===null?f=Node.DOCUMENT_POSITION_PRECEDING:(t=R(i).compareDocumentPosition(t),f=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),f|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}r=R(i[0]),f=R(i[i.length-1]);var m=x(this._fragmentFiber)?r.parentElement:l;if(m==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=m.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY,m=m.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY;var E=r.compareDocumentPosition(t),P=f.compareDocumentPosition(t),Q=E&Node.DOCUMENT_POSITION_CONTAINED_BY||P&Node.DOCUMENT_POSITION_CONTAINED_BY;return P=l&&m&&E&Node.DOCUMENT_POSITION_FOLLOWING&&P&Node.DOCUMENT_POSITION_PRECEDING,r=l&&r===t||m&&f===t||Q||P?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&r===t||!m&&f===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:E,r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||oN(r,this._fragmentFiber,i[0],i[i.length-1],t)?r:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function oN(t,r,i,l,f){var m=Fn(f);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!m)e:{for(;m!==null;){if(m.tag===7&&(m===r||m.alternate===r)){i=!0;break e}m=m.return}i=!1}return i}if(t&Node.DOCUMENT_POSITION_CONTAINS){if(m===null)return m=f.ownerDocument,f===m||f===m.documentElement||f===m.body;e:{for(m=r,r=b(r);m!==null;){if(!(m.tag!==5&&m.tag!==3&&m.tag!==27||m!==r&&m.alternate!==r)){m=!0;break e}m=m.return}m=!1}return m}return t&Node.DOCUMENT_POSITION_PRECEDING?((r=!!m)&&!(r=m===i)&&(r=k(i,m,N),r===null?r=!1:(h(r,!0,M,m,i),m=T,T=null,r=m!==null)),r):t&Node.DOCUMENT_POSITION_FOLLOWING?((r=!!m)&&!(r=m===l)&&(r=k(l,m,N),r===null?r=!1:(h(r,!0,A,m,l),m=T,O=T=null,r=m!==null)),r):!1}function w1(t,r){var i=t.ownerDocument.createRange();i.selectNodeContents(t),t=i.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,r?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}lo.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(a(566));var r=[];h(this._fragmentFiber.child,!1,Vm,r,void 0,void 0);var i=t!==!1;if(r.length===0){var l=w(this._fragmentFiber);if(l=i?l[1]||l[0]||b(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){t=R(l),w1(t,i);return}if(l=R(l),l.nodeType!==9){if(l.nodeType===11){i="host"in l?l.host:null,i!==null&&i.scrollIntoView(t);return}l.scrollIntoView(t)}}for(l=i?r.length-1:0;l!==(i?-1:r.length);){var f=r[l];f.tag===6?(f=R(f),w1(f,i)):R(f).scrollIntoView(t),l+=i?-1:1}};function aN(t,r){return t=R(t),R1(t,r),!1}function R1(t,r){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(r)}function E1(t,r){var i=r._eventListeners;if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];t.addEventListener(f.type,f.attachedListener,al(f.optionsOrUseCapture))}t.nodeType!==3&&(i=r._observers,i!==null&&i.forEach(function(m){for(var E=0,P=0;P<Uo.length;P++){var Q=Uo[P];(Q.fragmentInstance!==r||Q.observer!==m||Q.instance!==t)&&(Uo[E++]=Q)}Uo.length=E,m.observe(t)}),R1(t,r))}function iN(t,r){var i=r._eventListeners;if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];t.removeEventListener(f.type,f.attachedListener,al(f.optionsOrUseCapture))}t.nodeType!==3&&(i=r._observers,i!==null&&i.forEach(function(m){typeof m.rootMargin=="string"?nN(r,m,t):m.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(r))}function Ym(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Ym(i),Yn(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function sN(t,r,i,l){for(;t.nodeType===1;){var f=i;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[go])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=Ro(t.nextSibling),t===null)break}return null}function lN(t,r,i){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Ro(t.nextSibling),t===null))return null;return t}function C1(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Ro(t.nextSibling),t===null))return null;return t}function Km(t){return t.data==="$?"||t.data==="$~"}function Gm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function uN(t,r){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||i.readyState!=="loading")r();else{var l=function(){r(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Ro(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var $m=null;function T1(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(r===0)return Ro(t.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}t=t.nextSibling}return null}function O1(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return t;r--}else i!=="/$"&&i!=="/&"||r++}t=t.previousSibling}return null}function cN(t,r){function i(){l=!0}if(t.ownerDocument.activeElement===t)return!0;var l=!1;try{t.ownerDocument.addEventListener("focus",i,!0),(t.focus||HTMLElement.prototype.focus).call(t,r)}finally{t.ownerDocument.removeEventListener("focus",i,!0)}return l}function dN(t){h1(function(){h1(function(r){return t(r)})})}function M1(t,r,i){switch(r=Pu(i),t){case"html":if(t=r.documentElement,!t)throw Error(a(452));return t;case"head":if(t=r.head,!t)throw Error(a(453));return t;case"body":if(t=r.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function A1(t,r,i){for(var l in i){var f=i[l];i.hasOwnProperty(l)&&f!=null&&mn(t,r,l,null,UD,f)}i.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===Ar&&(t.onclick=null),Yn(t)}function Xm(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Yn(t)}var Eo=new Map,D1=new Set;function ku(t){if(typeof t.getRootNode=="function"){var r=t.getRootNode();if(r.nodeType===9||r.nodeType===11)return r}return t.nodeType===9?t:t.ownerDocument}var Ia=ce.d;ce.d={f:fN,r:hN,D:pN,C:gN,L:mN,m:yN,X:bN,S:vN,M:xN};function fN(){var t=Ia.f(),r=Qd();return t||r}function hN(t){var r=fr(t);r!==null&&r.tag===5&&r.type==="form"?Ix(r):Ia.r(t)}var il=typeof document>"u"?null:document;function N1(t,r,i){var l=il;if(l&&typeof r=="string"&&r){var f=Nn(r);f='link[rel="'+t+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),D1.has(f)||(D1.add(f),t={rel:t,crossOrigin:i,href:r},l.querySelector(f)===null&&(r=l.createElement("link"),br(r,"link",t),Se(r),l.head.appendChild(r)))}}function pN(t){Ia.D(t),N1("dns-prefetch",t,null)}function gN(t,r){Ia.C(t,r),N1("preconnect",t,r)}function mN(t,r,i){Ia.L(t,r,i);var l=il;if(l&&t&&r){var f='link[rel="preload"][as="'+Nn(r)+'"]';r==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+Nn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+Nn(i.imageSizes)+'"]')):f+='[href="'+Nn(t)+'"]';var m=f;switch(r){case"style":m=sl(t);break;case"script":m=ll(t)}if(!(Eo.has(m)||(t=j({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:t,as:r},i),Eo.set(m,t),l.querySelector(f)!==null||r==="style"&&l.querySelector(Lu(m))||r==="script"&&l.querySelector(zu(m))))){var E=l.createElement("link");br(E,"link",t),r==="style"&&(E[Pt]=!0,E.onload=E.onerror=function(){nt(E)}),Se(E),l.head.appendChild(E)}}}function yN(t,r){Ia.m(t,r);var i=il;if(i&&t){var l=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+Nn(l)+'"][href="'+Nn(t)+'"]',m=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=ll(t)}if(!Eo.has(m)&&(t=j({rel:"modulepreload",href:t},r),Eo.set(m,t),i.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(zu(m)))return}l=i.createElement("link"),br(l,"link",t),Se(l),i.head.appendChild(l)}}}function vN(t,r,i){Ia.S(t,r,i);var l=il;if(l&&t){var f=Ae(l).hoistableStyles,m=sl(t);r=r||"default";var E=f.get(m);if(!E){var P={loading:0,preload:null};if(E=l.querySelector(Lu(m)))P.loading=5;else{t=j({rel:"stylesheet",href:t,"data-precedence":r},i),(i=Eo.get(m))&&Qm(t,i);var Q=E=l.createElement("link");Se(Q),br(Q,"link",t),Q._p=new Promise(function(ie,pe){Q.onload=ie,Q.onerror=pe}),Q.addEventListener("load",function(){P.loading|=1}),Q.addEventListener("error",function(){P.loading|=2}),P.loading|=4,rf(E,r,l)}E={type:"stylesheet",instance:E,count:1,state:P},f.set(m,E)}}}function bN(t,r){Ia.X(t,r);var i=il;if(i&&t){var l=Ae(i).hoistableScripts,f=ll(t),m=l.get(f);m||(m=i.querySelector(zu(f)),m||(t=j({src:t,async:!0},r),(r=Eo.get(f))&&Zm(t,r),m=i.createElement("script"),Se(m),br(m,"link",t),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function xN(t,r){Ia.M(t,r);var i=il;if(i&&t){var l=Ae(i).hoistableScripts,f=ll(t),m=l.get(f);m||(m=i.querySelector(zu(f)),m||(t=j({src:t,async:!0,type:"module"},r),(r=Eo.get(f))&&Zm(t,r),m=i.createElement("script"),Se(m),br(m,"link",t),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function I1(t,r,i,l){var f=(f=be.current)?ku(f):null;if(!f)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=sl(i.href),r=Ae(f).hoistableStyles,l=r.get(i),l||(l={type:"style",instance:null,count:0,state:null},r.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=sl(i.href);var m=Ae(f).hoistableStyles,E=m.get(t);if(E||(f=f.ownerDocument||f,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,E),(m=f.querySelector(Lu(t)))?m._p||(E.instance=m,E.state.loading=5):(m=Eo.get(t),m||(m={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Eo.set(t,m)),SN(f,t,m,E.state))),r&&l===null)throw Error(a(528,""));return E}if(r&&l!==null)throw Error(a(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(i=ll(i),r=Ae(f).hoistableScripts,l=r.get(i),l||(l={type:"script",instance:null,count:0,state:null},r.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function sl(t){return'href="'+Nn(t)+'"'}function Lu(t){return'link[rel="stylesheet"]['+t+"]"}function j1(t){return j({},t,{"data-precedence":t.precedence,precedence:null})}function SN(t,r,i,l){if(r=t.querySelector('link[rel="preload"][as="style"]['+r+"]")){if(r[Pt]!==!0){l.loading=1;return}}else r=t.createElement("link"),r[Pt]=!0,r.onload=r.onerror=nt.bind(null,r),br(r,"link",i),Se(r),t.head.appendChild(r);l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2})}function ll(t){return'[src="'+Nn(t)+'"]'}function zu(t){return"script[async]"+t}function P1(t,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+Nn(i.href)+'"]');if(l)return r.instance=l,Se(l),l;var f=j({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Se(l),br(l,"style",f),rf(l,i.precedence,t),r.instance=l;case"stylesheet":f=sl(i.href);var m=t.querySelector(Lu(f));if(m)return r.state.loading|=4,r.instance=m,Se(m),m;l=j1(i),(f=Eo.get(f))&&Qm(l,f),m=(t.ownerDocument||t).createElement("link"),Se(m);var E=m;return E._p=new Promise(function(P,Q){E.onload=P,E.onerror=Q}),br(m,"link",l),r.state.loading|=4,rf(m,i.precedence,t),r.instance=m;case"script":return m=ll(i.src),(f=t.querySelector(zu(m)))?(r.instance=f,Se(f),f):(l=i,(f=Eo.get(m))&&(l=j({},i),Zm(l,f)),t=t.ownerDocument||t,f=t.createElement("script"),Se(f),br(f,"link",l),t.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,rf(l,i.precedence,t));return r.instance}function rf(t,r,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,m=f,E=0;E<l.length;E++){var P=l[E];if(P.dataset.precedence===r)m=P;else if(m!==f)break}m?m.parentNode.insertBefore(t,m.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(t,r.firstChild))}function Qm(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Zm(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var of=null;function k1(t,r,i){if(of===null){var l=new Map,f=of=new Map;f.set(i,l)}else f=of,l=f.get(i),l||(l=new Map,f.set(i,l));if(l.has(t))return l;for(l.set(t,null),i=i.getElementsByTagName(t),f=0;f<i.length;f++){var m=i[f];if(!(m[go]||m[dn]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var E=m.getAttribute(r)||"";E=t+E;var P=l.get(E);P?P.push(m):l.set(E,[m])}}return l}function Jm(t,r,i){t=t.ownerDocument||t,t.head.insertBefore(i,r==="title"?t.querySelector("head > title"):null)}function wN(t,r,i){if(i===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function L1(t,r){return t==="img"&&r.src!=null&&r.src!==""&&r.onLoad==null&&r.loading!=="lazy"}function z1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function _1(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function H1(t,r){typeof r.decode=="function"&&(t.imgCount++,r.complete||(t.imgBytes+=_1(r),t.suspenseyImages.push(r)),t=CN.bind(t),r.decode().then(t,t))}function RN(t,r,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=sl(l.href),m=r.querySelector(Lu(f));if(m){r=m._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=_u.bind(t),r.then(t,t)),i.state.loading|=4,i.instance=m,Se(m);return}m=r.ownerDocument||r,l=j1(l),(f=Eo.get(f))&&Qm(l,f),m=m.createElement("link"),Se(m);var E=m;E._p=new Promise(function(P,Q){E.onload=P,E.onerror=Q}),br(m,"link",l),i.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,r),(r=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=_u.bind(t),r.addEventListener("load",i),r.addEventListener("error",i))}}var af=0;function EN(t,r){return t.stylesheets&&t.count===0&&lf(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var l=setTimeout(function(){if(t.stylesheets&&lf(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+r);0<t.imgBytes&&af===0&&(af=62500*BD());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&lf(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>af?50:800)+r);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function U1(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)lf(t,t.stylesheets);else if(t.unsuspend){var r=t.unsuspend;t.unsuspend=null,r()}}}function _u(){this.count--,U1(this)}function CN(){this.imgCount--,U1(this)}var sf=null;function lf(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,sf=new Map,r.forEach(TN,t),sf=null,_u.call(t))}function TN(t,r){if(!(r.state.loading&4)){var i=sf.get(t);if(i)var l=i.get(null);else{i=new Map,sf.set(t,i);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var E=f[m];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(i.set(E.dataset.precedence,E),l=E)}l&&i.set(null,l)}f=r.instance,E=f.getAttribute("data-precedence"),m=i.get(E)||l,m===l&&i.set(null,f),i.set(E,f),this.count++,l=_u.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),m?m.parentNode.insertBefore(f,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),r.state.loading|=4}}var ul={$$typeof:H,Provider:null,Consumer:null,_currentValue:Te,_currentValue2:Te,_threadCount:0};function ON(t,r,i,l,f,m,E,P,Q){this.tag=1,this.containerInfo=t,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=St(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=St(0),this.hiddenUpdates=St(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.transitionTypes=null,this.incompleteTransitions=new Map}function F1(t,r,i,l,f,m,E,P,Q,ie,pe,Ce){return t=new ON(t,r,i,E,Q,ie,pe,Ce,P),r=1,m===!0&&(r|=24),m=Br(3,null,null,r),t.current=m,m.stateNode=t,r=hg(),r.refCount++,t.pooledCache=r,r.refCount++,m.memoizedState={element:l,isDehydrated:i,cache:r},yg(m),t}function B1(t){return t?(t=ks,t):ks}function V1(t,r,i,l,f,m){f=B1(f),l.context===null?l.context=f:l.pendingContext=f,l=ti(r),l.payload={element:i},m=m===void 0?null:m,m!==null&&(l.callback=m),i=ni(t,l,r),i!==null&&(Kr(i,t,r),gu(i,t,r))}function q1(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<r?i:r}}function Wm(t,r){q1(t,r),(t=t.alternate)&&q1(t,r)}function Y1(t){if(t.tag===13||t.tag===31){var r=Fi(t,67108864);r!==null&&Kr(r,t,67108864),Wm(t,67108864)}}function K1(t){if(t.tag===13||t.tag===31){var r=so();r=Ht(r);var i=Fi(t,r);i!==null&&Kr(i,t,r),Wm(t,r)}}var cl=!0;function MN(t,r,i,l){var f=ge.T;ge.T=null;var m=ce.p;try{ce.p=2,e0(t,r,i,l)}finally{ce.p=m,ge.T=f}}function AN(t,r,i,l){var f=ge.T;ge.T=null;var m=ce.p;try{ce.p=8,e0(t,r,i,l)}finally{ce.p=m,ge.T=f}}function e0(t,r,i,l){if(cl){var f=t0(l);if(f===null)km(t,r,l,uf,i),$1(t,l);else if(NN(f,t,r,i,l))l.stopPropagation();else if($1(t,l),r&4&&-1<DN.indexOf(t)){for(;f!==null;){var m=fr(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var E=qe(m.pendingLanes);if(E!==0){var P=m;for(P.pendingLanes|=2,P.entangledLanes|=2;E;){var Q=1<<31-et(E);P.entanglements[1]|=Q,E&=~Q}oa(m),(ln&6)===0&&(Gd=xt()+500,Nu(0))}}break;case 31:case 13:P=Fi(m,2),P!==null&&Kr(P,m,2),Qd(),Wm(m,2)}if(m=t0(l),m===null&&km(t,r,l,uf,i),m===f)break;f=m}f!==null&&l.stopPropagation()}else km(t,r,l,null,i)}}function t0(t){return t=Li(t),n0(t)}var uf=null;function n0(t){if(uf=null,t=Fn(t),t!==null){var r=u(t);if(r===null)t=null;else{var i=r.tag;if(i===13){if(t=c(r),t!==null)return t;t=null}else if(i===31){if(t=d(r),t!==null)return t;t=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return uf=t,null}function G1(t){switch(t){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch($t()){case ft:return 2;case vt:return 8;case gt:case kt:return 32;case un:return 268435456;default:return 32}default:return 32}}var r0=!1,pi=null,gi=null,mi=null,Hu=new Map,Uu=new Map,yi=[],DN="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 $1(t,r){switch(t){case"focusin":case"focusout":pi=null;break;case"dragenter":case"dragleave":gi=null;break;case"mouseover":case"mouseout":mi=null;break;case"pointerover":case"pointerout":Hu.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uu.delete(r.pointerId)}}function Fu(t,r,i,l,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:r,domEventName:i,eventSystemFlags:l,nativeEvent:m,targetContainers:[f]},r!==null&&(r=fr(r),r!==null&&Y1(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),t)}function NN(t,r,i,l,f){switch(r){case"focusin":return pi=Fu(pi,t,r,i,l,f),!0;case"dragenter":return gi=Fu(gi,t,r,i,l,f),!0;case"mouseover":return mi=Fu(mi,t,r,i,l,f),!0;case"pointerover":var m=f.pointerId;return Hu.set(m,Fu(Hu.get(m)||null,t,r,i,l,f)),!0;case"gotpointercapture":return m=f.pointerId,Uu.set(m,Fu(Uu.get(m)||null,t,r,i,l,f)),!0}return!1}function X1(t){var r=Fn(t.target);if(r!==null){var i=u(r);if(i!==null){if(r=i.tag,r===13){if(r=c(i),r!==null){t.blockedOn=r,Qr(t.priority,function(){K1(i)});return}}else if(r===31){if(r=d(i),r!==null){t.blockedOn=r,Qr(t.priority,function(){K1(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function cf(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var i=t0(t.nativeEvent);if(i===null){i=t.nativeEvent;var l=new i.constructor(i.type,i);ki=l,i.target.dispatchEvent(l),ki=null}else return r=fr(i),r!==null&&Y1(r),t.blockedOn=i,!1;r.shift()}return!0}function Q1(t,r,i){cf(t)&&i.delete(r)}function IN(){r0=!1,pi!==null&&cf(pi)&&(pi=null),gi!==null&&cf(gi)&&(gi=null),mi!==null&&cf(mi)&&(mi=null),Hu.forEach(Q1),Uu.forEach(Q1)}function df(t,r){t.blockedOn===r&&(t.blockedOn=null,r0||(r0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,IN)))}var ff=null;function Z1(t){ff!==t&&(ff=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ff===t&&(ff=null);for(var r=0;r<t.length;r+=3){var i=t[r],l=t[r+1],f=t[r+2];if(typeof l!="function"){if(n0(l||i)===null)continue;break}var m=fr(i);m!==null&&(t.splice(r,3),r-=3,_g(m,{pending:!0,data:f,method:i.method,action:l},l,f))}}))}function dl(t){function r(Q){return df(Q,t)}pi!==null&&df(pi,t),gi!==null&&df(gi,t),mi!==null&&df(mi,t),Hu.forEach(r),Uu.forEach(r);for(var i=0;i<yi.length;i++){var l=yi[i];l.blockedOn===t&&(l.blockedOn=null)}for(;0<yi.length&&(i=yi[0],i.blockedOn===null);)X1(i),i.blockedOn===null&&yi.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var f=i[l],m=i[l+1],E=f[Mn]||null;if(typeof m=="function")E||Z1(i);else if(E){var P=null;if(m&&m.hasAttribute("formAction")){if(f=m,E=m[Mn]||null)P=E.formAction;else if(n0(f)!==null)continue}else P=E.action;typeof P=="function"?i[l+1]=P:(i.splice(l,3),l-=3),Z1(i)}}}function J1(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(E){return f=E})},focusReset:"manual",scroll:"manual"})}function r(){f!==null&&(f(),f=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),f!==null&&(f(),f=null)}}}function o0(t){this._internalRoot=t}hf.prototype.render=o0.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));var i=r.current,l=so();V1(i,l,t,r,null,null)},hf.prototype.unmount=o0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;V1(t.current,2,null,t,null,null),Qd(),r[In]=null}};function hf(t){this._internalRoot=t}hf.prototype.unstable_scheduleHydration=function(t){if(t){var r=Cn();t={blockedOn:null,target:t,priority:r};for(var i=0;i<yi.length&&r!==0&&r<yi[i].priority;i++);yi.splice(i,0,t),i===0&&X1(t)}};var W1=n.version;if(W1!=="19.3.1")throw Error(a(527,W1,"19.3.1"));ce.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=g(r),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var jN={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ge,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pf.isDisabled&&pf.supportsFiber)try{Pe=pf.inject(jN),ze=pf}catch{}}return Vu.createRoot=function(t,r){if(!s(t))throw Error(a(299));var i=!1,l="",f=Bx,m=Vx,E=qx;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(E=r.onRecoverableError)),r=F1(t,1,!1,null,null,i,l,null,f,m,E,J1),t[In]=r.current,Pm(t),new o0(r)},Vu.hydrateRoot=function(t,r,i){if(!s(t))throw Error(a(299));var l=!1,f="",m=Bx,E=Vx,P=qx,Q=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(m=i.onUncaughtError),i.onCaughtError!==void 0&&(E=i.onCaughtError),i.onRecoverableError!==void 0&&(P=i.onRecoverableError),i.formState!==void 0&&(Q=i.formState)),r=F1(t,1,!0,r,i??null,l,f,Q,m,E,P,J1),r.context=B1(null),i=r.current,l=so(),l=Ht(l),f=ti(l),f.callback=null,ni(i,f,l),i=l,r.current.lanes=i,ct(r,i),oa(r),t[In]=r.current,Pm(t),new hf(r)},Vu.version="19.3.1",Vu}var uS;function VN(){if(uS)return s0.exports;uS=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(n){console.error(n)}}return e(),s0.exports=BN(),s0.exports}var qN=VN();const cS={};function er(e,n){const o=v.useRef(cS);return o.current===cS&&(o.current=e(n)),o}const V0=[];let q0;function YN(){return q0}function KN(e){V0.push(e)}function Rc(e){const n=(o,a)=>{const s=er(GN).current;let u;try{q0=s;for(const c of V0)c.before(s);u=e(o,a);for(const c of V0)c.after(s);s.didInitialize=!0}finally{q0=void 0}return u};return n.displayName=e.displayName||e.name,n}function HR(e){return v.forwardRef(Rc(e))}function GN(){return{didInitialize:!1}}function Sn(){}const fa=Object.freeze([]),Gt=Object.freeze({}),$N=()=>{},_e=typeof document<"u"?v.useLayoutEffect:$N;function XN(e,n){return function(a,...s){const u=new URL(e);return u.searchParams.set("code",a.toString()),s.forEach(c=>u.searchParams.append("args[]",c)),`${n} error #${a}; visit ${u} for the full message.`}}const Rn=XN("https://base-ui.com/production-error","Base UI"),UR=v.createContext(void 0);function Ec(e){const n=v.useContext(UR);if(n===void 0&&!e)throw new Error(Rn(72));return n}function Ny(e){v.useEffect(e,fa)}const qu=0;class No{static create(){return new No}currentId=qu;start(n,o){this.clear(),this.currentId=setTimeout(()=>{this.currentId=qu,o()},n)}isStarted(){return this.currentId!==qu}clear=()=>{this.currentId!==qu&&(clearTimeout(this.currentId),this.currentId=qu)};disposeEffect=()=>this.clear}function Hn(){const e=er(No.create).current;return Ny(e.disposeEffect),e}function QN(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:ZN,platform:JN,maxTouchPoints:WN}=QN(),jh=ZN.toLowerCase(),dc=JN.toLowerCase(),Ph=/^i(os$|p)/.test(dc)||dc==="macintel"&&WN>1,dS="android",Y0=dc===dS||jh.includes(dS),Iy=!Ph&&dc.startsWith("mac");dc.startsWith("win");const e4=Iy||Ph,ha=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!ha&&jh.includes("firefox");!ha&&jh.includes("chrom");const t4=e4,jy=/jsdom|happydom/.test(jh);function Bo(e){e.preventDefault(),e.stopPropagation()}function n4(e){return"nativeEvent"in e}function Nl(e){return e.pointerType===""&&e.isTrusted?!0:Y0&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Py(e){return jy?!1:!Y0&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(Y0||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Ci(e,n){const o=["mouse","pen"];return n||o.push("",void 0),o.includes(e)}function r4(e){const n=e.type;return n==="click"||n==="mousedown"||n==="keydown"||n==="keyup"}function kh(){return typeof window<"u"}function Sr(e){return ky(e)?(e.nodeName||"").toLowerCase():"#document"}function wn(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Fa(e){var n;return(n=(ky(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function ky(e){return kh()?e instanceof Node||e instanceof wn(e).Node:!1}function an(e){return kh()?e instanceof Element||e instanceof wn(e).Element:!1}function yn(e){return kh()?e instanceof HTMLElement||e instanceof wn(e).HTMLElement:!1}function gs(e){return!kh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wn(e).ShadowRoot}function Cc(e){const{overflow:n,overflowX:o,overflowY:a,display:s}=ho(e);return/auto|scroll|overlay|hidden|clip/.test(n+a+o)&&s!=="inline"&&s!=="contents"}function o4(e){return/^(table|td|th)$/.test(Sr(e))}function Lh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const a4=/transform|translate|scale|rotate|perspective|filter/,i4=/paint|layout|strict|content/,as=e=>!!e&&e!=="none";let d0;function Ly(e){const n=an(e)?ho(e):e;return as(n.transform)||as(n.translate)||as(n.scale)||as(n.rotate)||as(n.perspective)||!zy()&&(as(n.backdropFilter)||as(n.filter))||a4.test(n.willChange||"")||i4.test(n.contain||"")}function s4(e){let n=Ua(e);for(;yn(n)&&!za(n);){if(Ly(n))return n;if(Lh(n))return null;n=Ua(n)}return null}function zy(){return d0==null&&(d0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),d0}function za(e){return/^(html|body|#document)$/.test(Sr(e))}function ho(e){return wn(e).getComputedStyle(e)}function zh(e){return an(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ua(e){if(Sr(e)==="html")return e;const n=e.assignedSlot||e.parentNode||gs(e)&&e.host||Fa(e);return gs(n)?n.host:n}function FR(e){const n=Ua(e);return za(n)?(e.ownerDocument||e).body:yn(n)&&Cc(n)?n:FR(n)}function fc(e,n,o){var a;n===void 0&&(n=[]),o===void 0&&(o=!0);const s=FR(e),u=s===((a=e.ownerDocument)==null?void 0:a.body),c=wn(s);if(u){const d=K0(c);return n.concat(c,c.visualViewport||[],Cc(s)?s:[],d&&o?fc(d):[])}else return n.concat(s,fc(s,[],o))}function K0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $r(e){let n=e.activeElement;for(;n?.shadowRoot?.activeElement!=null;)n=n.shadowRoot.activeElement;return n}function ot(e,n){if(!e||!n)return!1;const o=n.getRootNode?.();if(e.contains(n))return!0;if(o&&gs(o)){let a=n;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function hc(e,n){let o=e;for(;o;){if(an(o)&&o.matches(n))return o;o=o.assignedSlot??o.parentNode??(gs(o)?o.host:null)}return null}function tr(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const G0="data-base-ui-focusable",BR="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",_h="ArrowLeft",Hh="ArrowRight",VR="ArrowUp",_y="ArrowDown",Hy="data-starting-style",l4="data-ending-style",u4={[Hy]:""},c4={[l4]:""},pa={transitionStatus(e){return e==="starting"?u4:e==="ending"?c4:null}},d4="data-open",f4="data-closed",h4="data-anchor-hidden",qR="data-popup-open",p4="data-pressed",g4={[qR]:""},m4={[qR]:"",[p4]:""},y4={[d4]:""},v4={[f4]:""},b4={[h4]:""},YR={open(e){return e?g4:null}},rh={open(e){return e?m4:null}},Tc={open(e){return e?y4:v4},anchorHidden(e){return e?b4:null}},Uh={...Tc,...pa},$0="data-trigger-disabled";function oh(e,n){if(!an(e))return!1;const o=e;if(n.hasElement(o))return!o.hasAttribute($0);for(const[,a]of n.entries())if(ot(a,o))return!a.hasAttribute($0);return!1}function f0(e,n){if(n==null)return!1;if("composedPath"in e)return e.composedPath().includes(n);const o=e;return o.target!=null&&n.contains(o.target)}function x4(e){return e.matches("html,body")}function Oc(e){return yn(e)&&e.matches(BR)}function S4(e){return hc(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${BR}`)!=null}function X0(e){return e?e.getAttribute("role")==="combobox"&&Oc(e):!1}function w4(e){if(!e||jy)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function ah(e){return e?e.hasAttribute(G0)?e:e.querySelector(`[${G0}]`)||e:null}function R4(e,n){return n!=null&&!Ci(n)?0:typeof e=="function"?e():e}function ms(e,n,o){const a=R4(e,o);return typeof a=="number"?a:a?.[n]}function fS(e){return typeof e=="function"?e():e}function KR(e,n){return n||e==="click"||e==="mousedown"}function E4(e){return e?.includes("mouse")&&e!=="mousedown"}function dt(e,n,o,a){let s=!1,u=!1;const c=a??Gt;return{reason:e,event:n??new Event("base-ui"),cancel(){s=!0},allowPropagation(){u=!0},get isCanceled(){return s},get isPropagationAllowed(){return u},trigger:o,...c}}function C4(e,n,o){const a=o??Gt;return{reason:e,event:n??new Event("base-ui"),...a}}const _r="none",qo="trigger-press",qn="trigger-hover",xl="trigger-focus",Fh="outside-press",fs="item-press",GR="close-press",Ti="focus-out",Mc="escape-key",ih="list-navigation",$R="keyboard",T4="pointer",Uy="cancel-open",Zu="sibling-open",O4="disabled",Ac="imperative-action",M4="window-resize",XR=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new No,currentIdRef:{current:null},currentContextRef:{current:null}});function A4(e,n){e.current=n.current}function D4(e){const{children:n,delay:o,timeoutMs:a=0}=e,s=v.useRef(o),u=v.useRef(o),c=v.useRef(null),d=v.useRef(null),p=Hn();return _e(()=>{if(u.current=o,!c.current){s.current=o;return}s.current={open:ms(s.current,"open"),close:ms(o,"close")}},[o,c,s,u]),S.jsx(XR.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:u,currentIdRef:c,timeoutMs:a,currentContextRef:d,timeout:p}),[a,p]),children:n})}function N4(e,n={open:!1}){const{open:o}=n,a=e.useState("floatingId"),s=v.useContext(XR),{currentIdRef:u,delayRef:c,timeoutMs:d,initialDelayRef:p,currentContextRef:g,hasProvider:y,timeout:h}=s,[b,x]=v.useState(!1),w=v.useRef(o);return _e(()=>{w.current=o},[o]),_e(()=>{function C(){g.current?.setIsInstantPhase(!1),u.current=null,g.current=null,c.current=p.current,h.clear()}if(u.current&&!o&&u.current===a){if(x(!1),d){const R=a;return h.start(d,()=>{e.select("open")||u.current&&u.current!==R||C()}),()=>{(w.current||u.current!==R)&&h.clear()}}C()}},[o,a,u,c,d,p,g,h,e]),_e(()=>{if(!o)return;const C=g.current,R=u.current;h.clear(),g.current={onOpenChange:e.setOpen,setIsInstantPhase:x},u.current=a,c.current={open:0,close:ms(p.current,"close")},R!==null&&R!==a?(x(!0),C?.setIsInstantPhase(!0),C?.onOpenChange(!1,dt(_r))):(x(!1),C?.setIsInstantPhase(!1))},[o,a,e,u,c,p,g,h]),_e(()=>()=>{if(u.current===a){if(g.current=null,!w.current)return;u.current=null,A4(c,p),h.clear()}},[g,u,c,a,p,h]),v.useMemo(()=>({activeIdRef:u,hasProvider:y,delayRef:c,isInstantPhase:b}),[u,y,c,b])}function jt(e,n,o,a){return e.addEventListener(n,o,a),()=>{e.removeEventListener(n,o,a)}}function ca(...e){return()=>{for(let n=0;n<e.length;n+=1){const o=e[n];o&&o()}}}function Xr(e,n,o,a){const s=er(QR).current;return j4(s,e,n,o,a)&&ZR(s,[e,n,o,a]),s.callback}function I4(e){const n=er(QR).current;return P4(n,e)&&ZR(n,e),n.callback}function QR(){return{callback:null,cleanup:null,refs:[]}}function j4(e,n,o,a,s){return e.refs[0]!==n||e.refs[1]!==o||e.refs[2]!==a||e.refs[3]!==s}function P4(e,n){return e.refs.length!==n.length||e.refs.some((o,a)=>o!==n[a])}function ZR(e,n){if(e.refs=n,n.every(o=>o==null)){e.callback=null;return}e.callback=o=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),o!=null){const a=Array(n.length).fill(null);for(let s=0;s<n.length;s+=1){const u=n[s];if(u!=null)switch(typeof u){case"function":{const c=u(o);typeof c=="function"&&(a[s]=c);break}case"object":{u.current=o;break}}}e.cleanup=()=>{for(let s=0;s<n.length;s+=1){const u=n[s];if(u!=null)switch(typeof u){case"function":{const c=a[s];typeof c=="function"?c():u(null);break}case"object":{u.current=null;break}}}}}}}function kn(e){const n=er(k4,e).current;return n.next=e,_e(n.effect),n}function k4(e){const n={current:e,next:e,effect:()=>{n.current=n.next}};return n}const Fy={...zR},h0=Fy.useInsertionEffect,L4=h0&&h0!==Fy.useLayoutEffect?h0:e=>e();function Be(e){const n=er(z4).current;return n.next=e,L4(n.effect),n.trampoline}function z4(){const e={next:void 0,callback:_4,trampoline:(...n)=>e.callback?.(...n),effect:()=>{e.callback=e.next}};return e}function _4(){}const gf=null;class H4{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=n=>{this.isScheduled=!1;const o=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let s=0;s<o.length;s+=1)o[s]?.(n)};request(n){const o=this.nextId;return this.nextId+=1,this.callbacks.push(n),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),o}cancel(n){const o=n-this.startId;o<0||o>=this.callbacks.length||this.callbacks[o]!==null&&(this.callbacks[o]=null,this.callbacksCount-=1)}}let mf=new H4;class Cr{static create(){return new Cr}static request(n){return mf.request(n)}static cancel(n){return mf.cancel(n)}currentId=gf;request(n){this.cancel(),this.currentId=mf.request(()=>{this.currentId=gf,n()})}cancel=()=>{this.currentId!==gf&&(mf.cancel(this.currentId),this.currentId=gf)};disposeEffect=()=>this.cancel}function Il(){const e=er(Cr.create).current;return Ny(e.disposeEffect),e}function Kt(e){return e?.ownerDocument||document}const JR={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Dc={...JR,position:"fixed",margin:0,top:0,left:0},Bh={...JR,position:"absolute"},jl=v.forwardRef(function(n,o){const[a,s]=v.useState();_e(()=>{t4&&ha&&s("button")},[]);const u={tabIndex:0,role:a};return S.jsx("span",{...n,ref:o,style:Dc,"aria-hidden":a?void 0:!0,...u,"data-base-ui-focus-guard":""})}),Pl=Math.min,_a=Math.max,sh=Math.round,yf=Math.floor,Ha=e=>({x:e,y:e}),U4={left:"right",right:"left",bottom:"top",top:"bottom"};function WR(e,n,o){return _a(e,Pl(n,o))}function Oi(e,n){return typeof e=="function"?e(n):e}function fo(e){return e.split("-")[0]}function da(e){return e.split("-")[1]}function By(e){return e==="x"?"y":"x"}function Vy(e){return e==="y"?"height":"width"}function Mo(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function qy(e){return By(Mo(e))}function F4(e,n,o){o===void 0&&(o=!1);const a=da(e),s=qy(e),u=Vy(s);let c=s==="x"?a===(o?"end":"start")?"right":"left":a==="start"?"bottom":"top";return n.reference[u]>n.floating[u]&&(c=lh(c)),[c,lh(c)]}function B4(e){const n=lh(e);return[Q0(e),n,Q0(n)]}function Q0(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const hS=["left","right"],pS=["right","left"],V4=["top","bottom"],q4=["bottom","top"];function Y4(e,n,o){switch(e){case"top":case"bottom":return o?n?pS:hS:n?hS:pS;case"left":case"right":return n?V4:q4;default:return[]}}function K4(e,n,o,a){const s=da(e);let u=Y4(fo(e),o==="start",a);return s&&(u=u.map(c=>c+"-"+s),n&&(u=u.concat(u.map(Q0)))),u}function lh(e){const n=fo(e);return U4[n]+e.slice(n.length)}function G4(e){var n,o,a,s;return{top:(n=e.top)!=null?n:0,right:(o=e.right)!=null?o:0,bottom:(a=e.bottom)!=null?a:0,left:(s=e.left)!=null?s:0}}function eE(e){return typeof e!="number"?G4(e):{top:e,right:e,bottom:e,left:e}}function pc(e){const{x:n,y:o,width:a,height:s}=e;return{width:a,height:s,top:o,left:n,right:n+a,bottom:o+s,x:n,y:o}}function Sl(e,n){return n<0||n>=e.length}function Bf(e,n){return wl(e.current,{disabledIndices:n})}function Z0(e,n){return wl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function $4(e,n,o){const{decrement:a,loopFocus:s,allowEscape:u,disabledIndices:c,minIndex:d,maxIndex:p}=o,g=()=>wl(e,{startingIndex:n,decrement:a,disabledIndices:c});let y,h=!1;if(!s)y=a?Math.max(d,g()):Math.min(p,g());else if(a?n<=d:n>=p){const b=a?-1:e.length;u&&n!==b?y=-1:(y=a?p:d,h=!0)}else y=g();return{index:Sl(e,y)?-1:y,wrapped:h}}function wl(e,{startingIndex:n=-1,decrement:o=!1,disabledIndices:a,amount:s=1}={}){let u=n;do u+=o?-s:s;while(u>=0&&u<=e.length-1&&Rl(e,u,a));return u}function Rl(e,n,o){if(typeof o=="function"?o(n):o?.includes(n)??!1)return!0;const s=e[n];return s?!Vh(s)||s.matches(":disabled")?!0:!o&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function X4(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Vh(e,n=e?ho(e):null){return!e||!e.isConnected||!n||X4(n)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():n.display!=="none"&&n.display!=="contents"}const Q4='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Z4(e){const n=e.assignedSlot;if(n)return n;if(e.parentElement)return e.parentElement;const o=e.getRootNode();return gs(o)?o.host:null}function J0(e){for(const n of Array.from(e.children))if(Sr(n)==="summary")return n;return null}function J4(e,n){const o=J0(n);return!!o&&(e===o||ot(o,e))}function tE(e){const n=e?Sr(e):"";return e!=null&&e.matches(Q4)&&(n!=="summary"||e.parentElement!=null&&Sr(e.parentElement)==="details"&&J0(e.parentElement)===e)&&(n!=="details"||J0(e)==null)&&(n!=="input"||e.type!=="hidden")}function Yy(e){if(!tE(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let n=e;n;n=Z4(n)){const o=n!==e,a=Sr(n)==="slot";if(n.hasAttribute("inert")||o&&Sr(n)==="details"&&!n.open&&!J4(e,n)||n.hasAttribute("hidden")||!a&&!W4(n,o))return!1}return!0}function W4(e,n){const o=ho(e);return n?o.display!=="none":Vh(e,o)}function nE(e){const n=e.tabIndex;if(n<0){const o=Sr(e);if(o==="details"||o==="audio"||o==="video"||yn(e)&&e.isContentEditable)return 0}return n}function p0(e){if(Sr(e)!=="input")return null;const n=e;return n.type==="radio"&&n.name!==""?n:null}function rE(e,n){const o=p0(e);if(!o)return!0;const a=n.find(s=>{const u=p0(s);return u?.name===o.name&&u.form===o.form&&u.checked});return a?a===o:n.find(s=>{const u=p0(s);return u?.name===o.name&&u.form===o.form})===o}function oE(e){if(yn(e)&&Sr(e)==="slot"){const n=e.assignedElements({flatten:!0});if(n.length>0)return n}return yn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Ky(e,n){oE(e).forEach(o=>{tE(o)&&n.push(o),Ky(o,n)})}function aE(e,n,o){oE(e).forEach(a=>{yn(a)&&a.matches(n)&&o.push(a),aE(a,n,o)})}function qh(e){return Yy(e)&&nE(e)>=0}function iE(e){const n=[];return Ky(e,n),n.filter(Yy)}function Yh(e){const n=iE(e);return n.filter(o=>nE(o)>=0&&rE(o,n))}function sE(e,n){const o=Yh(e),a=o.length;if(a===0)return;const s=$r(Kt(e)),u=o.indexOf(s),c=u===-1?n===1?0:a-1:u+n;return o[c]}function lE(e){return sE(Kt(e).body,1)||e}function uE(e){return sE(Kt(e).body,-1)||e}function e3(e,n,o){if(!e)return null;const a=[];Ky(Kt(e).body,a);const s=a.indexOf(e);if(s===-1)return null;const u=a.filter(Yy);for(let c=1;c<a.length;c+=1){const d=a[(s+n*c+a.length)%a.length];if(!ot(o,d)&&qh(d)&&rE(d,u))return d}return a[s]}function El(e,n){const o=n||e.currentTarget,a=e.relatedTarget;return!a||!ot(o,a)}function t3(e){Yh(e).forEach(o=>{o.dataset.tabindex=o.getAttribute("tabindex")||"",o.setAttribute("tabindex","-1")})}function gS(e){const n=[];aE(e,"[data-tabindex]",n),n.forEach(o=>{const a=o.dataset.tabindex;delete o.dataset.tabindex,a?o.setAttribute("tabindex",a):o.removeAttribute("tabindex")})}function Mi(e,n,o=!0){return e.filter(s=>s.parentId===n).flatMap(s=>[...!o||s.context?.open?[s]:[],...Mi(e,s.id,o)])}function mS(e,n){let o=[],a=e.find(s=>s.id===n)?.parentId;for(;a;){const s=e.find(u=>u.id===a);a=s?.parentId,s&&(o=o.concat(s))}return o}function Cl(e){return`data-base-ui-${e}`}let vf=0;function Vf(e,n={}){const{preventScroll:o=!1,sync:a=!1,shouldFocus:s}=n;cancelAnimationFrame(vf);function u(){s&&!s()||e?.focus({preventScroll:o})}if(a)return u(),Sn;const c=requestAnimationFrame(u);return vf=c,()=>{vf===c&&(cancelAnimationFrame(c),vf=0)}}const yS="data-base-ui-inert";let Yu=new WeakMap,bf=new WeakSet,Ku=new WeakMap,g0=0;function cE(e){return e?gs(e)?e.host:cE(e.parentNode):null}const vS=(e,n)=>n.map(o=>{if(e.contains(o))return o;const a=cE(o);return e.contains(a)?a:null}).filter(o=>o!=null),bS=e=>{const n=new Set;return e.forEach(o=>{let a=o;for(;a&&!n.has(a);)n.add(a),a=a.parentNode}),n},xS=(e,n,o)=>{const a=[],s=u=>{!u||o.has(u)||Array.from(u.children).forEach(c=>{Sr(c)!=="script"&&(n.has(c)?s(c):a.push(c))})};return s(e),a};function n3(e,n,o,{mark:a=!0}){const s=vS(n,e),u=a?xS(n,bS(s),new Set(s)):[],c=[],d=[];if(o){const p=vS(n,Array.from(n.querySelectorAll("[aria-live]"))),g=s.concat(p);xS(n,bS(g),new Set(g)).forEach(h=>{const b=h.getAttribute("aria-hidden"),x=b!==null&&b!=="false",w=(Yu.get(h)||0)+1;Yu.set(h,w),c.push(h),w===1&&x&&bf.add(h),x||h.setAttribute("aria-hidden","true")})}return a&&u.forEach(p=>{const g=(Ku.get(p)||0)+1;Ku.set(p,g),d.push(p),g===1&&p.setAttribute(yS,"")}),g0+=1,()=>{c.forEach(p=>{const g=(Yu.get(p)||0)-1;Yu.set(p,g),g||(bf.has(p)||p.removeAttribute("aria-hidden"),bf.delete(p))}),a&&d.forEach(p=>{const g=(Ku.get(p)||0)-1;Ku.set(p,g),g||p.removeAttribute(yS)}),g0-=1,g0||(Yu=new WeakMap,bf=new WeakSet,Ku=new WeakMap)}}function SS(e,n={}){const{ariaHidden:o=!1,mark:a=!0}=n,s=Kt(e[0]).body;return n3(e,s,o,{mark:a})}var cr=_R();const r3=LR(cr);function dE(){const[,e]=v.useState({});return v.useCallback(()=>{e({})},[])}let wS=0;function o3(e,n="mui"){const o=v.useRef(void 0),a=dE(),s=e??o.current;return v.useEffect(()=>{o.current==null&&(wS+=1,o.current=`${n}-${wS}`,e==null&&a())},[e,n,a]),s}const RS=Fy.useId;function Hl(e,n){if(RS!==void 0){const o=RS();return e??(n?`${n}-${o}`:o)}return o3(e,n)}const a3=parseInt(v.version,10);function Gy(e){return a3>=e}function ES(e){if(!v.isValidElement(e))return null;const n=e,o=n.props;return(Gy(19)?o?.ref:n.ref)??null}function W0(e,n){if(e&&!n)return e;if(!e&&n)return n;if(e||n)return{...e,...n}}function i3(e,n){const o={};for(const a in e){const s=e[a];if(n?.hasOwnProperty(a)){const u=n[a](s);u!=null&&Object.assign(o,u);continue}s===!0?o[`data-${a.toLowerCase()}`]="":s&&(o[`data-${a.toLowerCase()}`]=s.toString())}return o}function s3(e,n){return typeof e=="function"?e(n):e}function fE(e,n){return typeof e=="function"?e(n):e}const hE={};function Lr(e,n,o,a,s){if(!o&&!a&&!s&&!e)return uh(n);let u=uh(e);return n&&(u=Ju(u,n)),o&&(u=Ju(u,o)),a&&(u=Ju(u,a)),s&&(u=Ju(u,s)),u}function l3(e){if(e.length===0)return hE;if(e.length===1)return uh(e[0]);let n=uh(e[0]);for(let o=1;o<e.length;o+=1)n=Ju(n,e[o]);return n}function uh(e){return gE(e)?{...e(hE)}:u3(e)}function Ju(e,n){return gE(n)?n(e):c3(e,n)}function u3(e){const n={...e};for(const o in n){const a=n[o];pE(o,a)&&(n[o]=mE(a))}return n}function c3(e,n){if(!n)return e;for(const o in n){const a=n[o];switch(o){case"style":{e[o]=W0(e.style,a);break}case"className":{e[o]=yE(e.className,a);break}default:pE(o,a)?e[o]=d3(e[o],a):e[o]=a}}return e}function pE(e,n){const o=e.charCodeAt(0),a=e.charCodeAt(1),s=e.charCodeAt(2);return o===111&&a===110&&s>=65&&s<=90&&(typeof n=="function"||typeof n>"u")}function gE(e){return typeof e=="function"}function d3(e,n){return n?e?(...o)=>{const a=o[0];if(vE(a)){const u=a;ch(u);const c=n(...o);return u.baseUIHandlerPrevented||e?.(...o),c}const s=n(...o);return e?.(...o),s}:mE(n):e}function mE(e){return e&&((...n)=>{const o=n[0];return vE(o)&&ch(o),e(...n)})}function ch(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function yE(e,n){return n?e?n+" "+e:n:e}function vE(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Mt(e,n,o={}){let a=n.render;o.enabled!==!1&&(a=$y(a));const s=f3(n,o,a);if(o.enabled===!1)return null;const u=o.state??Gt;return g3(e,a,s,u)}function f3(e,n,o){const{className:a,style:s}=e,{state:u=Gt,ref:c,props:d,stateAttributesMapping:p,enabled:g=!0}=n,y=g?s3(a,u):void 0,h=g?fE(s,u):void 0,b=g?i3(u,p):Gt,x=g&&d?h3(d):void 0,w=g?W0(b,x)??{}:Gt;return typeof document<"u"&&(g?Array.isArray(c)?w.ref=I4([w.ref,ES(o),...c]):w.ref=Xr(w.ref,ES(o),c):Xr(null,null)),g?(y!==void 0&&(w.className=yE(w.className,y)),h!==void 0&&(w.style=W0(w.style,h)),w):Gt}function h3(e){return Array.isArray(e)?l3(e):Lr(void 0,e)}const p3=Symbol.for("react.lazy");function $y(e){if(e?.$$typeof!==p3)return e;const n=v.Children.toArray(e)[0];return v.isValidElement(n)?n:e}function g3(e,n,o,a){if(n){if(typeof n=="function")return n(o,a);const s=Lr(o,n.props);return s.ref=o.ref,v.cloneElement(n,s)}return m3(e,o)}function m3(e,n){return e==="button"?v.createElement("button",{type:"button",...n,key:n.key}):e==="img"?v.createElement("img",{alt:"",...n,key:n.key}):v.createElement(e,n)}const y3=500,bE=500,v3={style:{transition:"none"}},b3="data-base-ui-click-trigger",xE={fallbackAxisSide:"none"},Xy={fallbackAxisSide:"end"},x3={clipPath:"inset(50%)",position:"fixed",top:0,left:0},SE=v.createContext(null),wE=()=>v.useContext(SE),S3=Cl("portal");function RE(e={}){const{ref:n,container:o,componentProps:a=Gt,elementProps:s}=e,u=Hl(),d=wE()?.portalNode,[p,g]=v.useState(null),[y,h]=v.useState(null),b=Be(R=>{R!==null&&h(R)}),x=v.useRef(null);_e(()=>{if(o===null){x.current&&(x.current=null,h(null),g(null));return}const R=(o&&(ky(o)?o:o.current))??d??document.body;if(R==null){x.current&&(x.current=null,h(null),g(null));return}x.current!==R&&(x.current=R,h(null),g(R))},[o,d]);const w=Mt("div",a,{ref:[n,b],props:[{id:u,[S3]:""},s]}),C=p&&w?cr.createPortal(w,p):null;return{node:y,nodeId:v.isValidElement(w)?w.props.id:void 0,subtree:C}}const Kh=v.forwardRef(function(n,o){const{render:a,className:s,style:u,children:c,container:d,portalOwnerRole:p,...g}=n,{node:y,nodeId:h,subtree:b}=RE({container:d,ref:o,componentProps:n,elementProps:g}),x=v.useRef(null),w=v.useRef(null),C=v.useRef(null),R=v.useRef(null),[T,O]=v.useState(null),M=v.useRef(!1),A=T?.modal,N=T?.open,k=!!T&&!T.modal&&T.open&&!!y;v.useEffect(()=>{if(!y||A)return;function D(z){y&&z.relatedTarget&&El(z)&&(z.type==="focusin"?M.current&&(gS(y),M.current=!1):(t3(y),M.current=!0))}return ca(jt(y,"focusin",D,!0),jt(y,"focusout",D,!0))},[y,A]),_e(()=>{!y||N!==!0||!M.current||(gS(y),M.current=!1)},[N,y]);const j=v.useMemo(()=>({beforeOutsideRef:x,afterOutsideRef:w,beforeInsideRef:C,afterInsideRef:R,portalNode:y,setFocusManagerState:O}),[y]);return S.jsxs(v.Fragment,{children:[b,S.jsxs(SE.Provider,{value:j,children:[k&&y&&S.jsx(jl,{"data-type":"outside",ref:x,onFocus:D=>{if(El(D,y))C.current?.focus();else{const z=T?T.domReference:null;uE(z)?.focus()}}}),k&&y&&S.jsx("span",{role:p,"aria-owns":h,style:x3}),y&&cr.createPortal(c,y),k&&y&&S.jsx(jl,{"data-type":"outside",ref:w,onFocus:D=>{if(El(D,y))R.current?.focus();else{const z=T?T.domReference:null;lE(z)?.focus(),T?.closeOnFocusOut&&T?.onOpenChange(!1,dt(Ti,D.nativeEvent))}}})]})]})});function EE(){const e=new Map;return{emit(n,o){e.get(n)?.forEach(a=>a(o))},on(n,o){e.has(n)||e.set(n,new Set),e.get(n).add(o)},off(n,o){e.get(n)?.delete(o)}}}class Qy{nodesRef={current:[]};events=EE();addNode(n){this.nodesRef.current.push(n)}removeNode(n){const o=this.nodesRef.current.findIndex(a=>a===n);o!==-1&&this.nodesRef.current.splice(o,1)}}const CE=v.createContext(null),TE=v.createContext(null),Ni=()=>v.useContext(CE)?.id||null,Ii=e=>{const n=v.useContext(TE);return e??n};function Zy(e){const n=Hl(),o=Ii(e),a=Ni();return _e(()=>{if(!n)return;const s={id:n,parentId:a};return o?.addNode(s),()=>{o?.removeNode(s)}},[o,n,a]),n}function OE(e){const{children:n,id:o}=e,a=Ni();return S.jsx(CE.Provider,{value:v.useMemo(()=>({id:o,parentId:a}),[o,a]),children:n})}function ME(e){const{children:n,externalTree:o}=e,a=er(()=>o??new Qy).current;return S.jsx(TE.Provider,{value:a,children:n})}function Pa(e){return e==null?e:"current"in e?e.current:e}function w3(e,n){const o=wn(tr(e));return e instanceof o.KeyboardEvent?"keyboard":e instanceof o.FocusEvent?n||"keyboard":"pointerType"in e?e.pointerType||(Nl(e)?"keyboard":n||"mouse"):"touches"in e?"touch":e instanceof o.MouseEvent?n||(e.detail===0?"keyboard":"mouse"):""}const CS=20;let Ri=[];function Jy(){Ri=Ri.filter(e=>e.deref()?.isConnected)}function TS(e){Jy(),e&&Sr(e)!=="body"&&(Ri.push(new WeakRef(e)),Ri.length>CS&&(Ri=Ri.slice(-CS)))}function OS(){return Jy(),Ri[Ri.length-1]?.deref()}function R3(e){return e?qh(e)?e:Yh(e)[0]||e:null}function MS(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const o=iE(e).filter(s=>{const u=s.getAttribute("data-tabindex")||"";return qh(s)||s.hasAttribute("data-tabindex")&&!u.startsWith("-")}),a=e.getAttribute("tabindex");o.length===0?a!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(a!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Gh(e){const{context:n,children:o,disabled:a=!1,initialFocus:s=!0,returnFocus:u=!0,explicitReturnFocus:c,restoreFocus:d=!1,modal:p=!0,closeOnFocusOut:g=!0,openInteractionType:y="",nextFocusableElement:h,previousFocusableElement:b,beforeContentFocusGuardRef:x,externalTree:w,getInsideElements:C}=e,R=n.useState("open"),T=n.useState("domReferenceElement"),O=n.useState("floatingElement"),{events:M,dataRef:A}=n.context,N=Be(()=>A.current.floatingContext?.nodeId),k=s===!1,j=X0(T)&&k,D=kn(s),z=kn(u),F=kn(c),G=kn(y),J=kn(R),Y=Ii(w),U=wE(),H=v.useRef(!1),L=v.useRef(!1),$=v.useRef(!1),K=v.useRef(null),V=v.useRef(""),X=v.useRef(""),ee=v.useRef(null),q=v.useRef(null),se=Xr(ee,x,U?.beforeInsideRef),I=Xr(q,U?.afterInsideRef),B=Hn(),W=Hn(),re=Il(),Re=U!=null,le=ah(O),me=Be((ve=le)=>ve?Yh(ve):[]),ge=Be(()=>C?.().filter(ve=>ve!=null)??[]);v.useEffect(()=>{if(a||!p)return;function ve(Me){Me.key==="Tab"&&ot(le,$r(Kt(le)))&&me().length===0&&!j&&Bo(Me)}const ke=Kt(le);return jt(ke,"keydown",ve)},[a,le,p,j,me]),v.useEffect(()=>{if(a||!R)return;const ve=Kt(le);function ke(){$.current=!1}function Me(Fe){const Oe=tr(Fe),He=ge(),be=ot(O,Oe)||ot(T,Oe)||ot(U?.portalNode,Oe)||He.some(Ue=>Ue===Oe||ot(Ue,Oe));$.current=!be,X.current=Fe.pointerType||"keyboard",hc(Oe,`[${b3}]`)&&(L.current=!0,W.start(0,()=>{L.current=!1}))}function Le(){X.current="keyboard"}return ca(jt(ve,"pointerdown",Me,!0),jt(ve,"pointerup",ke,!0),jt(ve,"pointercancel",ke,!0),jt(ve,"keydown",Le,!0),ke)},[a,O,T,le,R,U,W,ge]),v.useEffect(()=>{if(a||!g)return;const ve=Kt(le);function ke(){L.current=!0,W.start(0,()=>{L.current=!1})}function Me(He){const be=tr(He);qh(be)&&(K.current=be)}function Le(He){const be=He.relatedTarget,Ue=He.currentTarget,Qe=tr(He);p&&be==null&&Qe!=null&&ot(O,Qe)&&TS(Qe),queueMicrotask(()=>{const it=N(),de=n.context.triggerElements,we=ge(),Ke=be?.hasAttribute(Cl("focus-guard"))&&[ee.current,q.current,U?.beforeInsideRef.current,U?.afterInsideRef.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,Pa(b),Pa(h)].includes(be),De=!(ot(T,be)||ot(O,be)||ot(be,O)||ot(U?.portalNode,be)||we.some(Ie=>Ie===be||ot(Ie,be))||de.hasMatchingElement(Ie=>ot(Ie,be))||Ke||Y&&(Mi(Y.nodesRef.current,it).find(Ie=>ot(Ie.context?.elements.floating,be)||ot(Ie.context?.elements.domReference,be))||mS(Y.nodesRef.current,it).find(Ie=>[Ie.context?.elements.floating,ah(Ie.context?.elements.floating)].includes(be)||Ie.context?.elements.domReference===be)));if(Ue===T&&le&&MS(le),d&&Ue!==T&&!Vh(Qe)&&$r(ve)===ve.body){if(yn(le)&&(le.focus(),d==="popup")){re.request(()=>{le.focus()});return}const Ie=me(),yt=K.current,ut=(yt&&Ie.includes(yt)?yt:null)||Ie[Ie.length-1]||le;yn(ut)&&ut.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(j||!p)&&be&&De&&!L.current&&(j||be!==OS())&&(H.current=!0,n.setOpen(!1,dt(Ti,He)))})}function Fe(){$.current||(A.current.insideReactTree=!0,B.start(0,()=>{A.current.insideReactTree=!1}))}const Oe=yn(T)?T:null;if(!(!O&&!Oe))return ca(Oe&&jt(Oe,"focusout",Le),Oe&&jt(Oe,"pointerdown",ke),O&&jt(O,"focusin",Me),O&&jt(O,"focusout",Le),O&&U&&jt(O,"focusout",Fe,!0))},[a,T,O,le,p,Y,U,n,g,d,me,j,N,A,B,W,re,h,b,ge]),v.useEffect(()=>{if(a||!O||!R)return;const ve=Array.from(U?.portalNode?.querySelectorAll(`[${Cl("portal")}]`)||[]),Me=(Y?mS(Y.nodesRef.current,N()):[]).find(Ue=>X0(Ue.context?.elements.domReference||null))?.context?.elements.domReference,Fe=[...[O,...ve,ee.current,q.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,...ge()],Me,Pa(b),Pa(h),j?T:null].filter(Ue=>Ue!=null),Oe=SS(Fe,{ariaHidden:p||j,mark:!1}),He=[O,...ve].filter(Ue=>Ue!=null),be=SS(He);return()=>{be(),Oe()}},[R,a,T,O,p,U,j,Y,N,h,b,ge]),_e(()=>{if(!R||a||!yn(le))return;V.current="",X.current="";const ve=Kt(le),ke=$r(ve);queueMicrotask(()=>{const Me=D.current,Le=typeof Me=="function"?Me(G.current||""):Me;if(Le===void 0||Le===!1||ot(le,ke))return;let Oe=null;const He=()=>(Oe==null&&(Oe=me(le)),Oe[0]||le);let be;Le===!0||Le===null?be=He():be=Pa(Le),be=be||He();const Ue=ot(le,$r(ve)),Qe=A.current.openEvent,it=Qe?.type==="mousedown"&&Nl(Qe);Vf(be,{sync:it,preventScroll:be===le,shouldFocus(){if(!J.current)return!1;if(Ue)return!0;const de=$r(ve);return!(de!==be&&ot(le,de))}})})},[a,R,le,me,D,G,J,A]);const ce=v.useRef(null);_e(()=>{if(a||!le){ce.current=null;return}ce.current&&(ce.current.cancelled=!0,ce.current=null);const ve=Kt(le),ke=$r(ve),Me=G.current==null;TS(ke);function Le(Oe){if(Oe.open||(V.current=w3(Oe.nativeEvent,X.current)),(Oe.reason===Ti&&Oe.triggerElement?.hasAttribute(Cl("focus-guard"))||Oe.reason===qn&&Oe.nativeEvent.type==="mouseleave")&&(H.current=!0),Oe.reason===Fh)if(Oe.nested)H.current=!1;else if(Nl(Oe.nativeEvent)||Py(Oe.nativeEvent))H.current=!1;else{let He=!1;Kt(le).createElement("div").focus({get preventScroll(){return He=!0,!1}}),He?H.current=!1:H.current=!0}}M.on("openchange",Le);function Fe(Oe){const He=z.current;let be=typeof He=="function"?He(Oe):He;if(be===void 0||be===!1)return null;be===null&&(be=!0);const Ue=T?.isConnected?T:null,Qe=ke?.isConnected&&Sr(ke)!=="body"?ke:null;let it=Me?Qe||Ue:Ue||Qe;return it||(it=OS()||null),typeof be=="boolean"?it:Pa(be)||it||null}return()=>{M.off("openchange",Le);const Oe=$r(ve),He=ge(),be=ot(O,Oe)||He.some(we=>we===Oe||ot(we,Oe))||Y&&Mi(Y.nodesRef.current,N(),!1).some(we=>ot(we.context?.elements.floating,Oe)),Ue=z.current,Qe=V.current,it=Fe(Qe),de={cancelled:!1};ce.current=de,queueMicrotask(()=>{ce.current===de&&(ce.current=null);const we=R3(it),Ke=F.current??typeof Ue!="boolean";if(!de.cancelled&&Ue&&!H.current&&yn(we)&&(!(!Ke&&we!==Oe&&Oe!==ve.body)||be)){const De={preventScroll:!0};Qe==="keyboard"&&(De.focusVisible=!0),we.focus(De)}H.current=!1})}},[a,O,le,z,F,G,M,Y,T,N,ge]),_e(()=>{if(!ha||R||!O)return;const ve=$r(Kt(O));!yn(ve)||!Oc(ve)||ot(O,ve)&&ve.blur()},[R,O]),_e(()=>{if(!(a||!U))return U.setFocusManagerState({modal:p,closeOnFocusOut:g,open:R,onOpenChange:n.setOpen,domReference:T}),()=>{U.setFocusManagerState(null)}},[a,U,p,R,n,g,T]),_e(()=>{if(!(a||!le))return MS(le),()=>{queueMicrotask(Jy)}},[a,le]);const Te=!a&&(p?!j:!0)&&(Re||p);return S.jsxs(v.Fragment,{children:[Te&&S.jsx(jl,{"data-type":"inside",ref:se,onFocus:ve=>{if(p){const ke=me();Vf(ke[ke.length-1])}else U?.portalNode&&(H.current=!1,El(ve,U.portalNode)?lE(T)?.focus():Pa(b??U.beforeOutsideRef)?.focus())}}),o,Te&&S.jsx(jl,{"data-type":"inside",ref:I,onFocus:ve=>{p?Vf(me()[0]):U?.portalNode&&(g&&(H.current=!0),El(ve,U.portalNode)?uE(T)?.focus():Pa(h??U.afterOutsideRef)?.focus())}})]})}function AE(e,n={}){const{enabled:o=!0,event:a="click",toggle:s=!0,ignoreMouse:u=!1,stickIfOpen:c=!0,touchOpenDelay:d=0,reason:p=qo}=n,g=e.context.dataRef,y=v.useRef(void 0),h=Il(),b=Hn(),x=v.useMemo(()=>{function w(R,T,O,M){const A=dt(p,T,O);R&&M==="touch"&&d>0?b.start(d,()=>{e.setOpen(!0,A)}):e.setOpen(R,A)}function C(R,T,O){const M=g.current.openEvent,A=e.select("domReferenceElement")!==T;return R&&A||!R||!s?!0:M&&(typeof c=="function"?c():c)?!O(M.type):!1}return{onPointerDown(R){y.current=Ci(R.pointerType,!0)&&Py(R.nativeEvent)?"virtual":R.pointerType},onMouseDown(R){const T=y.current,O=R.nativeEvent,M=e.select("open");if(R.button!==0||a==="click"||Ci(T,!0)&&u)return;const A=C(M,R.currentTarget,D=>D==="click"||D==="mousedown"),N=tr(O),k=Oc(N);if(k||T==="virtual"){w(A,O,k?N:R.currentTarget,T);return}const j=R.currentTarget;h.request(()=>{w(A,O,j,T)})},onClick(R){if(a==="mousedown-only")return;const T=y.current;if(a==="mousedown"&&T){y.current=void 0;return}if(Ci(T,!0)&&u)return;const O=e.select("open"),M=C(O,R.currentTarget,A=>A==="click"||A==="mousedown"||A==="keydown"||A==="keyup");w(M,R.nativeEvent,R.currentTarget,T)},onKeyDown(){y.current=void 0}}},[g,a,u,p,e,c,s,h,b,d]);return v.useMemo(()=>o?{reference:x}:Gt,[o,x])}function E3(e,n){let o=null,a=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){const u=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},c=n.axis==="x"||n.axis==="both",d=n.axis==="y"||n.axis==="both",p=["mouseenter","mousemove"].includes(n.dataRef.current.openEvent?.type||"")&&n.pointerType!=="touch",g=n.axis==="y"?u.width:0,y=n.axis==="x"?u.height:0;let h=u.x,b=u.y;return o==null&&n.x&&c&&(o=u.x-n.x),a==null&&n.y&&d&&(a=u.y-n.y),h-=o||0,b-=a||0,(!s||p)&&(h=c&&n.x!=null?n.x:h,b=d&&n.y!=null?n.y:b),s=!0,{width:g,height:y,x:h,y:b,top:b,right:h+g,bottom:b+y,left:h}}}}function AS(e){return e!=null&&e.clientX!=null}function C3(e,n={}){const{enabled:o=!0,axis:a="both"}=n,s=e.useState("open"),u=e.useState("floatingElement"),c=e.useState("domReferenceElement"),d=e.context.dataRef,p=v.useRef(!1),g=v.useRef(null),[y,h]=v.useState(),[b,x]=v.useState([]),w=Be(M=>{e.set("positionReference",M)}),C=Be((M,A,N)=>{p.current||d.current.openEvent&&!AS(d.current.openEvent)||e.set("positionReference",E3(N??c,{x:M,y:A,axis:a,dataRef:d,pointerType:y}))}),R=Be(M=>{s?g.current||(C(M.clientX,M.clientY,M.currentTarget),x([])):C(M.clientX,M.clientY,M.currentTarget)}),T=Ci(y)?u:s;v.useEffect(()=>{if(!o){w(c);return}if(!T)return;function M(){g.current?.(),g.current=null}const A=wn(u);function N(k){const j=tr(k);ot(u,j)?M():C(k.clientX,k.clientY)}return!d.current.openEvent||AS(d.current.openEvent)?g.current=jt(A,"mousemove",N):w(c),M},[T,o,u,d,c,e,C,w,b]),v.useEffect(()=>()=>{e.set("positionReference",null)},[e]),v.useEffect(()=>{o&&!u&&(p.current=!1)},[o,u]),v.useEffect(()=>{!o&&s&&(p.current=!0)},[o,s]);const O=v.useMemo(()=>{function M(A){h(A.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:R,onMouseEnter:R}},[R]);return v.useMemo(()=>o?{reference:O,trigger:O}:{},[o,O])}function T3(){return!1}function O3(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Nc(e,n={}){const{enabled:o=!0,escapeKey:a=!0,outsidePress:s=!0,outsidePressEvent:u="sloppy",referencePress:c=T3,bubbles:d,externalTree:p}=n,g=e.useState("open"),y=e.useState("floatingElement"),{dataRef:h,events:b}=e.context,x=Ii(p),w=Be(typeof s=="function"?s:()=>!1),C=typeof s=="function"?w:s,R=C!==!1,T=Be(()=>u),{escapeKey:O,outsidePress:M}=O3(d),A=v.useRef(!1),N=v.useRef(!1),k=v.useRef(!1),j=v.useRef(!1),D=v.useRef(!1),z=v.useRef(""),F=v.useRef(null),G=Hn(),J=Hn(),Y=Hn(),U=Be(()=>{J.clear(),h.current.insideReactTree=!1}),H=Be(I=>{const B=h.current.floatingContext?.nodeId;return(x?Mi(x.nodesRef.current,B):[]).some(re=>re.context?.open&&!re.context.dataRef.current[I])}),L=Be(I=>f0(I,e.select("floatingElement"))||f0(I,e.select("domReferenceElement"))),$=Be(I=>{c()&&e.setOpen(!1,dt(qo,I.nativeEvent))}),K=Be(I=>{if(!g||!o||!a||I.key!=="Escape")return;const B=n4(I)?I.nativeEvent:I;if(D.current||B.isComposing||!O&&H("__escapeKeyBubbles"))return;const W=dt(Mc,B);e.setOpen(!1,W),W.isCanceled||I.preventDefault(),!O&&!W.isPropagationAllowed&&I.stopPropagation()}),V=Be(()=>{h.current.insideReactTree=!0,J.start(0,U)}),X=Be(I=>{if(!g||!o||I.button!==0)return;const B=tr(I.nativeEvent);ot(e.select("floatingElement"),B)&&(A.current||(A.current=!0,N.current=!1))}),ee=Be(I=>{!g||!o||(I.defaultPrevented||I.nativeEvent.defaultPrevented)&&A.current&&(N.current=!0)});v.useEffect(()=>{function I(B){B.open||(j.current=!1)}return b.on("openchange",I),()=>{b.off("openchange",I)}},[b]),v.useEffect(()=>U,[U]),v.useEffect(()=>{if(!g||!o)return g||(j.current=!1,D.current=!1,z.current="",F.current=null),U;h.current.__escapeKeyBubbles=O,h.current.__outsidePressBubbles=M;const I=new No,B=Kt(y);function W(){Y.clear(),D.current=!0}function re(){D.current=!0,Y.start(ha?5:0,()=>{D.current=!1})}function Re(){k.current=!0,I.start(0,()=>{k.current=!1})}function le(){A.current=!1,N.current=!1}function me(){const de=z.current,we=de==="pen"||!de?"mouse":de,Ke=T(),De=typeof Ke=="function"?Ke():Ke;return typeof De=="string"?De:De[we]}function ge(de){const we=me();return we==="intentional"&&de.type!=="click"||we==="sloppy"&&de.type==="click"}function ce(de){const we=h.current.floatingContext?.nodeId,Ke=x&&Mi(x.nodesRef.current,we).some(De=>f0(de,De.context?.elements.floating));return L(de)||Ke}function Te(de){if(ge(de)){de.type!=="click"&&!L(de)&&(I.clear(),k.current=!1),U();return}if(h.current.insideReactTree){U();return}const we=tr(de),Ke=`[${Cl("inert")}]`,De=an(we)?we.getRootNode():null,Ie=Array.from((gs(De)?De:Kt(e.select("floatingElement"))).querySelectorAll(Ke)),yt=e.context.triggerElements;if(we&&(yt.hasElement(we)||yt.hasMatchingElement(ht=>ot(ht,we))))return;let ut=an(we)?we:null;for(;ut&&!za(ut);){const ht=Ua(ut);if(za(ht)||!an(ht))break;ut=ht}if(!(Ie.length&&an(we)&&!x4(we)&&!ot(we,e.select("floatingElement"))&&Ie.every(ht=>!ot(ut,ht)))){if(yn(we)&&!("touches"in de)){const ht=za(we),Ot=ho(we),Dt=/auto|scroll/,Wt=ht||Dt.test(Ot.overflowX),rn=ht||Dt.test(Ot.overflowY),en=Wt&&we.clientWidth>0&&we.scrollWidth>we.clientWidth,We=rn&&we.clientHeight>0&&we.scrollHeight>we.clientHeight,xt=Ot.direction==="rtl",$t=We&&(xt?de.offsetX<=we.offsetWidth-we.clientWidth:de.offsetX>we.clientWidth),ft=en&&de.offsetY>we.clientHeight;if($t||ft)return}if(!ce(de)){if(me()==="intentional"){if(de.detail!==0&&!Nl(de)&&!j.current)return;if(k.current){I.clear(),k.current=!1;return}}typeof C=="function"&&!C(de)||H("__outsidePressBubbles")||(e.setOpen(!1,dt(Fh,de)),U())}}}function ve(de){me()!=="sloppy"||de.pointerType==="touch"||!e.select("open")||!o||L(de)||Te(de)}function ke(de){if(me()!=="sloppy"||!e.select("open")||!o||L(de))return;const we=de.touches[0];we&&(F.current={startTime:Date.now(),startX:we.clientX,startY:we.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},G.start(1e3,()=>{F.current&&(F.current.dismissOnTouchEnd=!1,F.current.dismissOnMouseDown=!1)}))}function Me(de,we){const Ke=tr(de);if(!Ke)return;const De=jt(Ke,de.type,()=>{we(de),De()})}function Le(de){z.current="touch",Me(de,ke)}function Fe(de){G.clear(),de.type==="pointerdown"&&(de.button===0&&(j.current=!0),z.current=de.pointerType),!(de.type==="mousedown"&&F.current&&!F.current.dismissOnMouseDown)&&Me(de,we=>{we.type==="pointerdown"?ve(we):Te(we)})}function Oe(de){if(de.type==="pointercancel"&&(j.current=!1),!A.current)return;const we=N.current;if(le(),me()==="intentional"){if(de.type==="pointercancel"){we&&Re();return}if(!ce(de)){if(we){Re();return}typeof C=="function"&&!C(de)||(I.clear(),k.current=!0,U())}}}function He(de){if(me()!=="sloppy"||!F.current||L(de))return;const we=de.touches[0];if(!we)return;const Ke=Math.abs(we.clientX-F.current.startX),De=Math.abs(we.clientY-F.current.startY),Ie=Math.sqrt(Ke*Ke+De*De);Ie>5&&(F.current.dismissOnTouchEnd=!0),Ie>10&&(Te(de),G.clear(),F.current=null)}function be(de){Me(de,He)}function Ue(de){me()!=="sloppy"||!F.current||L(de)||(F.current.dismissOnTouchEnd&&Te(de),G.clear(),F.current=null)}function Qe(de){Me(de,Ue)}const it=ca(a&&ca(jt(B,"keydown",K),jt(B,"compositionstart",W),jt(B,"compositionend",re)),R&&ca(jt(B,"click",Fe,!0),jt(B,"pointerdown",Fe,!0),jt(B,"pointerup",Oe,!0),jt(B,"pointercancel",Oe,!0),jt(B,"mousedown",Fe,!0),jt(B,"mouseup",Oe,!0),jt(B,"touchstart",Le,{capture:!0,passive:!0}),jt(B,"touchmove",be,{capture:!0,passive:!0}),jt(B,"touchend",Qe,{capture:!0,passive:!0})));return()=>{it(),I.clear(),le(),k.current=!1}},[h,y,a,R,C,g,o,O,M,K,U,T,H,L,x,e,G,Y]);const q=v.useMemo(()=>({onKeyDown:K,onPointerDown:$,onClick:$}),[K,$]),se=v.useMemo(()=>({onKeyDown:K,onPointerDown:ee,onMouseDown:ee,onClickCapture:V,onMouseDownCapture(I){V(),X(I)},onPointerDownCapture(I){V(),X(I)},onMouseUpCapture:V,onTouchEndCapture:V,onTouchMoveCapture:V}),[K,V,X,ee]);return v.useMemo(()=>o?{reference:q,floating:se,trigger:q}:{},[o,q,se])}function DE(e){const{popupStore:n,treatPopupAsFloatingElement:o=!1,floatingRootContext:a,floatingId:s,nested:u,onOpenChange:c}=e,d=n.useState("open"),p=n.useState("activeTriggerElement"),g=n.useState(o?"popupElement":"positionerElement"),y=c;return n.useSyncedValue("floatingId",s),_e(()=>{const h={open:d,floatingId:s,referenceElement:p,floatingElement:g};an(p)&&(h.domReferenceElement=p),a.state.positionReference===a.state.referenceElement&&(h.positionReference=p),a.update(h)},[d,s,p,g,a]),a.context.onOpenChange=y,a.context.nested=u,a}function ws(e,n=!1,o=!1,a=!1){const[s,u]=v.useState(e&&n?"idle":void 0),[c,d]=v.useState(e&&!a);return e&&!c&&(d(!0),u("starting")),!e&&c&&s!=="ending"&&!o&&u("ending"),!e&&!c&&s==="ending"&&u(void 0),_e(()=>{if(!e&&c&&s!=="ending"&&o){const p=Cr.request(()=>{u("ending")});return()=>{Cr.cancel(p)}}},[e,c,s,o]),_e(()=>{if(!e||n||s===void 0)return;const p=Cr.request(()=>{u(void 0)});return()=>{Cr.cancel(p)}},[n,e,s]),_e(()=>{if(!e||!n)return;e&&c&&s!=="idle"&&u("starting");const p=Cr.request(()=>{u("idle")});return()=>{Cr.cancel(p)}},[n,e,c,s]),{mounted:c,setMounted:d,transitionStatus:s}}function DS(e,n){return e.getAnimations(n).filter(o=>{const a=o.effect?.getTiming();return a?.duration!==1/0&&a?.iterations!==1/0})}let xf=null;function M3(e){if(!xf){const n=[];xf=n,queueMicrotask(()=>{xf=null,cr.flushSync(()=>{for(const o of n)o()})})}xf.push(e)}function $h(e,n=!1,o=!1){const a=Il();return Be((s,u=null)=>{a.cancel();const c=Pa(e);if(c==null)return;const d=c,p=()=>{if(!o){cr.flushSync(s);return}M3(()=>{u?.aborted||s()})};if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function g(){Promise.all(DS(d).map(y=>y.finished.then(Sn))).then(()=>{u?.aborted||p()},()=>{if(u?.aborted)return;if(DS(d).some(h=>h.pending||h.playState!=="finished")){g();return}p()})}if(n){const y=Hy;if(!d.hasAttribute(y)){a.request(g);return}const h=new MutationObserver(()=>{d.hasAttribute(y)||(h.disconnect(),g())});h.observe(d,{attributes:!0,attributeFilter:[y]}),u?.addEventListener("abort",()=>h.disconnect(),{once:!0});return}a.request(g)})}function jo(e){const{enabled:n=!0,open:o,ref:a,batch:s=!1,onComplete:u}=e,c=Be(u),d=$h(a,o,s);v.useEffect(()=>{if(!n)return;const p=new AbortController;return d(c,p.signal),()=>{p.abort()}},[n,o,c,d])}function NE(e){const{open:n,ref:o,preventUnmountOnClose:a,setPreventUnmountOnClose:s,onUnmount:u,animateInitialOpen:c}=e,d=Be(s),{mounted:p,setMounted:g,transitionStatus:y}=ws(n,!1,!1,c),h=n?!1:a;_e(()=>{n&&d(!1)},[n,d]);const b=v.useRef(p),x=v.useRef(!1),w=dE(),C=()=>{b.current=!1,g(!1),u()};_e(()=>{b.current=p,x.current&&(x.current=!1,!n&&p&&C())});const R=Be(()=>{if(b.current){if(n){x.current=!0,w();return}C()}});return jo({enabled:p&&!n&&!h,open:n,ref:o,onComplete(){n||R()}}),{mounted:p,transitionStatus:y,preventUnmountingOnClose:h,forceUnmount:R}}const Ic={tabIndex:-1,[G0]:""};function IE(e){return n=>n==="touch"?e.current:!0}function Wy(e,n=!1){const o=Hl(),a=Ni()!=null,s=er(()=>e(o,a)).current;return DE({popupStore:s,treatPopupAsFloatingElement:n,floatingRootContext:s.state.floatingRootContext,floatingId:o,nested:a,onOpenChange:s.setOpen}),s}function Xh({handle:e,store:n}){return _e(()=>e.attachStore(n),[e,n]),null}function NS(e){const n=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==n&&e.set("triggerCount",n)}function A3(e,n){const o=v.useRef(null);return Be(a=>{const s=o.current;if(s!==null){if(s.element===a&&s.store===n&&s.id===e)return;o.current=null;const u=s.store;u.context.triggerElements.getById(s.id)===s.element&&(u.context.triggerElements.delete(s.id),NS(u))}a!==null&&e!==void 0&&(o.current={store:n,id:e,element:a},n.context.triggerElements.add(e,a),NS(n))})}function Qh(e,n,o,a=!1){let s=e.preventUnmountingOnClose;n?s=!1:a&&(s=!0);const u=o?.id??null;let c=e.activeTriggerId,d=e.activeTriggerElement;return(u||n)&&(c=u,d=o??null),{open:n,preventUnmountingOnClose:s,activeTriggerId:c,activeTriggerElement:d,openedWithoutTrigger:n?o==null:e.openedWithoutTrigger}}function Zh(e){let n=!1;return e.preventUnmountOnClose=()=>{n=!0},()=>n}function D3(e,n,o,a={}){const s=o.reason,u=s===qn,c=n&&s===xl,d=!n&&(s===qo||s===Mc),p=Zh(o);if(e.context.onOpenChange?.(n,o),o.isCanceled)return;a.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(n,o);const g=()=>{const y=Qh(e.state,n,o.trigger,p()),h={...a.extraState,...y};c?h.instantType="focus":d?h.instantType="dismiss":u&&(h.instantType=void 0),e.update(h)};u?cr.flushSync(g):g()}function jE(e,n,o,a){const s=o.useState("isMountedByTrigger",e),u=A3(e,o),c=Be(p=>{const g=o.select("open"),y=o.select("activeTriggerId");if(y===e){const h={activeTriggerElement:p,...g?a:null};o.update(h);return}if(y==null&&g&&!o.state.openedWithoutTrigger){const h={activeTriggerId:e??null,activeTriggerElement:p,...a};o.update(h)}}),d=Be(p=>{u(p),p&&c(p)});return _e(()=>(d(n.current),()=>d(null)),[d,n,o,e]),_e(()=>{if(s){const p={activeTriggerElement:n.current,...a};o.update(p)}},[s,o,n,...Object.values(a)]),{registerTrigger:d,isMountedByThisTrigger:s}}function Jh(e,n={}){const{closeOnActiveTriggerUnmount:o=!1}=n,a=v.useRef(null),s=e.useState("open"),u=e.useState("triggerCount"),c=e.useState("activeTriggerId"),d=e.useState("activeTriggerElement");_e(()=>{if(!s){a.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0),e.state.openedWithoutTrigger&&e.set("openedWithoutTrigger",!1);return}const p=e.context.triggerElements.size,g={};e.state.triggerCount!==p&&(g.triggerCount=p);const y=e.select("activeTriggerId");let h=null;if(y){const b=e.context.triggerElements.getById(y);if(b)a.current=y,b!==e.state.activeTriggerElement&&(g.activeTriggerElement=b);else{for(const[x,w]of e.context.triggerElements.entries())if(w===e.state.activeTriggerElement){g.activeTriggerId=x,g.activeTriggerElement=w,a.current=x;break}g.activeTriggerId===void 0&&(a.current===y?h=y:a.current=null)}}else a.current=null;if(!h&&!y&&!e.state.openedWithoutTrigger&&p===1){const b=e.context.triggerElements.entries().next();if(!b.done){const[x,w]=b.value;g.activeTriggerId=x,g.activeTriggerElement=w,a.current=x}}(g.triggerCount!==void 0||g.activeTriggerId!==void 0||g.activeTriggerElement!==void 0)&&e.update(g),h&&o&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===h&&!e.context.triggerElements.getById(h)){const b=dt(_r);e.setOpen(!1,b),b.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,u,c,d,o])}function Wh(e,n,o,a){const{mounted:s,transitionStatus:u,forceUnmount:c}=NE({open:e,ref:n.context.popupRef,preventUnmountOnClose:n.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:d=>n.set("preventUnmountingOnClose",d),animateInitialOpen:a,onUnmount(){n.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),o?.(),n.context.onOpenChangeComplete?.(!1)}});return er(()=>(n.set("mounted",s),null)),n.useSyncedValues({mounted:s,transitionStatus:u}),{forceUnmount:c,transitionStatus:u}}function ep(e,n){e.useSyncedValues(n),_e(()=>()=>{e.update({activeTriggerProps:Gt,inactiveTriggerProps:Gt,popupProps:Gt})},[e])}function PE(e,n){_e(()=>{!n&&e.state.openMethod!==null&&e.set("openMethod",null)},[n,e]),_e(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class jc{idMap=new Map;add(n,o){this.idMap.set(n,o)}delete(n){this.idMap.delete(n)}hasElement(n){for(const o of this.idMap.values())if(o===n)return!0;return!1}hasMatchingElement(n){for(const o of this.idMap.values())if(n(o))return!0;return!1}getById(n){return this.idMap.get(n)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var m0={exports:{}},y0={};var IS;function N3(){if(IS)return y0;IS=1;var e=wc();function n(h,b){return h===b&&(h!==0||1/h===1/b)||h!==h&&b!==b}var o=typeof Object.is=="function"?Object.is:n,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,c=e.useDebugValue;function d(h,b){var x=b(),w=a({inst:{value:x,getSnapshot:b}}),C=w[0].inst,R=w[1];return u(function(){C.value=x,C.getSnapshot=b,p(C)&&R({inst:C})},[h,x,b]),s(function(){return p(C)&&R({inst:C}),h(function(){p(C)&&R({inst:C})})},[h]),c(x),x}function p(h){var b=h.getSnapshot;h=h.value;try{var x=b();return!o(h,x)}catch{return!0}}function g(h,b){return b()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:d;return y0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,y0}var jS;function kE(){return jS||(jS=1,m0.exports=N3()),m0.exports}var tp=kE(),v0={exports:{}},b0={};var PS;function I3(){if(PS)return b0;PS=1;var e=wc(),n=kE();function o(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var a=typeof Object.is=="function"?Object.is:o,s=n.useSyncExternalStore,u=e.useRef,c=e.useEffect,d=e.useMemo,p=e.useDebugValue;return b0.useSyncExternalStoreWithSelector=function(g,y,h,b,x){var w=u(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=d(function(){function T(k){if(!O){if(O=!0,M=k,k=b(k),x!==void 0&&C.hasValue){var j=C.value;if(x(j,k))return A=j}return A=k}if(j=A,a(M,k))return j;var D=b(k);return x!==void 0&&x(j,D)?(M=k,j):(M=k,A=D)}var O=!1,M,A,N=h===void 0?null:h;return[function(){return T(y())},N===null?void 0:function(){return T(N())}]},[y,h,b,x]);var R=s(g,w[0],w[1]);return c(function(){C.hasValue=!0,C.value=R},[R]),p(R),R},b0}var kS;function j3(){return kS||(kS=1,v0.exports=I3()),v0.exports}var P3=j3();const k3=Gy(19),L3=k3?_3:H3;function LE(e,n,o,a,s){return L3(e,n,o,a,s)}function z3(e,n,o,a,s){const u=v.useCallback(()=>n(e.getSnapshot(),o,a,s),[e,n,o,a,s]);return tp.useSyncExternalStore(e.subscribe,u,u)}KN({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let n=!1;for(let o=0;o<e.syncHooks.length;o+=1){const a=e.syncHooks[o],s=a.selector(a.store.state,a.a1,a.a2,a.a3);Object.is(a.value,s)||(n=!0,a.value=s)}return n&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=n=>{const o=new Set;for(const s of e.syncHooks)o.add(s.store);const a=[];for(const s of o)a.push(s.subscribe(n));return()=>{for(const s of a)s()}}),tp.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function _3(e,n,o,a,s){const u=YN();if(!u)return z3(e,n,o,a,s);const c=u.syncIndex;u.syncIndex+=1;let d;return u.didInitialize?(d=u.syncHooks[c],(d.store!==e||d.selector!==n||!Object.is(d.a1,o)||!Object.is(d.a2,a)||!Object.is(d.a3,s))&&(d.store!==e&&(u.didChangeStore=!0),d.store=e,d.selector=n,d.a1=o,d.a2=a,d.a3=s,d.value=n(e.getSnapshot(),o,a,s))):(d={store:e,selector:n,a1:o,a2:a,a3:s,value:n(e.getSnapshot(),o,a,s)},u.syncHooks.push(d)),d.value}function H3(e,n,o,a,s){return P3.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,u=>n(u,o,a,s))}class U3{static create(n){return new this(n)}constructor(n){this.state=n,this.listeners=new Set,this.updateTick=0}subscribe=n=>(this.listeners.add(n),()=>{this.listeners.delete(n)});getSnapshot=()=>this.state;setState(n){if(this.state===n)return;this.state=n,this.updateTick+=1;const o=this.updateTick;for(const a of this.listeners){if(o!==this.updateTick)return;a(n)}}update(n){for(const o in n)if(!Object.is(this.state[o],n[o])){this.setState({...this.state,...n});return}}set(n,o){Object.is(this.state[n],o)||this.setState({...this.state,[n]:o})}notifyAll(){const n={...this.state};this.setState(n)}use(n,o,a,s){return LE(this,n,o,a,s)}}class Ul extends U3{constructor(n,o={},a){super(n),this.context=o,this.selectors=a}useSyncedValue(n,o){v.useDebugValue(n);const a=this;_e(()=>{a.state[n]!==o&&a.set(n,o)},[a,n,o])}useSyncedValueWithCleanup(n,o){const a=this;_e(()=>(a.state[n]!==o&&a.set(n,o),()=>{a.set(n,void 0)}),[a,n,o])}useSyncedValues(n){const o=this,a=Object.values(n);_e(()=>{o.update(n)},[o,...a])}useControlledProp(n,o){v.useDebugValue(n);const a=this,s=o!==void 0;_e(()=>{s&&!Object.is(a.state[n],o)&&a.setState({...a.state,[n]:o})},[a,n,o,s])}select(n,o,a,s){const u=this.selectors[n];return u(this.state,o,a,s)}useState(n,o,a,s){return v.useDebugValue(n),LE(this,this.selectors[n],o,a,s)}useContextCallback(n,o){v.useDebugValue(n);const a=Be(o??Sn);this.context[n]=a}useStateSetter(n){const o=v.useRef(void 0);return o.current===void 0&&(o.current=a=>{this.set(n,a)}),o.current}observe(n,o){let a;typeof n=="function"?a=n:a=this.selectors[n];let s=a(this.state);return o(s,s,this),this.subscribe(u=>{const c=a(u);if(!Object.is(s,c)){const d=s;s=c,o(c,d,this)}})}}const F3={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class zE extends Ul{constructor(n){const{syncOnly:o,nested:a,onOpenChange:s,triggerElements:u,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:EE(),nested:a,triggerElements:u},F3),this.syncOnly=o}syncOpenEvent=(n,o)=>{(!n||!this.state.open||o!=null&&r4(o))&&(this.context.dataRef.current.openEvent=n?o:void 0)};dispatchOpenChange=(n,o)=>{this.syncOpenEvent(n,o.event);const a={open:n,reason:o.reason,nativeEvent:o.event,nested:this.context.nested,triggerElement:o.trigger};this.context.events.emit("openchange",a)};setOpen=(n,o)=>{if(this.syncOnly){this.context.onOpenChange?.(n,o);return}this.dispatchOpenChange(n,o),this.context.onOpenChange?.(n,o)}}function np(e,n,o=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new zE({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:n,syncOnly:!0,nested:o,onOpenChange:void 0}),floatingId:n,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Gt,inactiveTriggerProps:Gt,popupProps:Gt}}const rc=e=>e.triggerIdProp??e.activeTriggerId,dh=e=>e.openProp??e.open,LS=e=>(e.popupElement?.id??e.floatingId)||void 0;function _E(e,n){return n!==void 0&&dh(e)&&rc(e)===n}function B3(e,n){return _E(e,n)?!0:n!==void 0&&dh(e)&&rc(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}const ka={open:dh,mounted:e=>e.mounted,transitionStatus:e=>dh(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:rc,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:LS,isTriggerActive:(e,n)=>n!==void 0&&rc(e)===n,isOpenedByTrigger:(e,n)=>_E(e,n),isMountedByTrigger:(e,n)=>n!==void 0&&rc(e)===n&&e.mounted,triggerProps:(e,n)=>n?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,n)=>B3(e,n)?LS(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function HE(e){const n=v.useCallback(a=>e===void 0?Sn:e.subscribeStore(a),[e]),o=v.useCallback(()=>e===void 0?void 0:e.store,[e]);return tp.useSyncExternalStore(n,o,()=>e?.serverStore)}function V3(e){const{open:n=!1,onOpenChange:o,elements:a={}}=e,s=Hl(),u=Ni()!=null,c=er(()=>new zE({open:n,transitionStatus:void 0,onOpenChange:o,referenceElement:a.reference??null,floatingElement:a.floating??null,triggerElements:new jc,floatingId:s,syncOnly:!1,nested:u})).current;return _e(()=>{const d={open:n,floatingId:s};a.reference!==void 0&&(d.referenceElement=a.reference,d.domReferenceElement=an(a.reference)?a.reference:null),a.floating!==void 0&&(d.floatingElement=a.floating),c.update(d)},[n,s,a.reference,a.floating,c]),c.context.onOpenChange=o,c.context.nested=u,c}const x0=Iy&&ha;function UE(e,n={}){const{enabled:o=!0,delay:a}=n,{events:s,dataRef:u}=e.context,c=v.useRef(!1),d=v.useRef(null),p=v.useRef(!0),g=Hn();v.useEffect(()=>{const h=e.select("domReferenceElement");if(!o)return;const b=wn(h);function x(){const R=e.select("domReferenceElement");!e.select("open")&&yn(R)&&R===$r(Kt(R))&&(c.current=!0,d.current=R)}function w(){p.current=!0}function C(){p.current=!1}return ca(jt(b,"blur",x),x0&&jt(b,"keydown",w,!0),x0&&jt(b,"pointerdown",C,!0))},[e,o]),v.useEffect(()=>{if(!o)return;function h(b){if(b.reason===qo||b.reason===Mc){const x=e.select("domReferenceElement");an(x)&&(d.current=x,c.current=!0)}}return s.on("openchange",h),()=>{s.off("openchange",h)}},[s,o,e]);const y=v.useMemo(()=>{function h(){c.current=!1,d.current=null}return{onMouseLeave(){h()},onFocus(b){const x=b.currentTarget;if(c.current){if(d.current===x)return;h()}const w=tr(b.nativeEvent);if(an(w)){if(x0&&!b.relatedTarget){if(!p.current&&!Oc(w))return}else if(!w4(w))return}const C=oh(b.relatedTarget,e.context.triggerElements),{nativeEvent:R,currentTarget:T}=b;if(e.select("open")&&C||!a){e.setOpen(!0,dt(xl,R,T));return}g.start(a,()=>{c.current||e.setOpen(!0,dt(xl,R,T))})},onBlur(b){h();const x=b.relatedTarget,w=b.nativeEvent,C=an(x)&&x.hasAttribute(Cl("focus-guard"))&&x.getAttribute("data-type")==="outside";g.start(0,()=>{const R=e.select("domReferenceElement"),T=$r(Kt(R));!x&&T===R||ot(u.current.floatingContext?.refs.floating.current,T)||ot(R,T)||C||oh(x??T,e.context.triggerElements)||e.setOpen(!1,dt(xl,w))})}}},[u,a,e,g]);return v.useMemo(()=>o?{reference:y,trigger:y}:{},[o,y])}class ev{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new No;restTimeout=new No;handleCloseOptions=void 0;static create(){return new ev}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const fh=new WeakMap;function hh(e){if(!e.performedPointerEventsMutation)return;const n=e.pointerEventsScopeElement;n&&fh.get(n)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),fh.delete(n)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function FE(e,n){const{scopeElement:o,referenceElement:a,floatingElement:s}=n,u=fh.get(o);u&&u!==e&&hh(u),hh(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=o,e.pointerEventsReferenceElement=a,e.pointerEventsFloatingElement=s,fh.set(o,e),o.style.pointerEvents="none",a.style.pointerEvents="auto",s.style.pointerEvents="auto"}function tv(e){const n=e.context.dataRef.current,o=er(()=>n.hoverInteractionState??ev.create()).current;return n.hoverInteractionState||(n.hoverInteractionState=o),Ny(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function nv(e,n={}){const{enabled:o=!0,closeDelay:a=0,nodeId:s}=n,u=e.useState("open"),c=e.useState("floatingElement"),d=e.useState("domReferenceElement"),{dataRef:p}=e.context,g=Ii(),y=Ni(),h=tv(e),b=Hn(),x=Be(()=>KR(p.current.openEvent?.type,h.interactedInside)),w=Be(()=>E4(p.current.openEvent?.type)),C=Be(()=>{hh(h)});_e(()=>{u||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,C())},[u,h,C]),v.useEffect(()=>C,[C]),_e(()=>{if(o&&u&&h.handleCloseOptions?.blockPointerEvents&&w()&&an(d)&&c){const R=d,T=c,O=Kt(c),M=g?.nodesRef.current.find(j=>j.id===y)?.context?.elements.floating;M&&(M.style.pointerEvents="");const A=h.pointerEventsScopeElement!==T?h.pointerEventsScopeElement:null,N=M!==T?M:null,k=h.handleCloseOptions?.getScope?.()??A??N??hc(R,"[data-rootownerid]")??O.body;return FE(h,{scopeElement:k,referenceElement:R,floatingElement:T}),()=>{C()}}},[o,u,d,c,h,w,g,y,C]),v.useEffect(()=>{if(!o)return;function R(){return!!(g&&y&&Mi(g.nodesRef.current,y).length>0)}function T(j){const D=ms(a,"close",h.pointerType),z=()=>{e.setOpen(!1,dt(qn,j)),g?.events.emit("floating.closed",j)};D?h.openChangeTimeout.start(D,z):(h.openChangeTimeout.clear(),z())}function O(j){const D=tr(j);if(!S4(D)){h.interactedInside=!1;return}h.interactedInside=hc(D,"[aria-haspopup]")!=null}function M(){h.openChangeTimeout.clear(),b.clear(),g?.events.off("floating.closed",N),C()}function A(j){if(R()&&g){g.events.on("floating.closed",N);return}if(oh(j.relatedTarget,e.context.triggerElements))return;const D=p.current.floatingContext?.nodeId??s,z=j.relatedTarget;if(!(g&&D&&an(z)&&Mi(g.nodesRef.current,D,!1).some(G=>ot(G.context?.elements.floating,z)))){if(h.handler){h.handler(j);return}C(),w()&&!x()&&T(j)}}function N(j){!g||!y||R()||b.start(0,()=>{g.events.off("floating.closed",N),e.setOpen(!1,dt(qn,j)),g.events.emit("floating.closed",j)})}const k=c;return ca(k&&jt(k,"mouseenter",M),k&&jt(k,"mouseleave",A),k&&jt(k,"pointerdown",O,!0),()=>{g?.events.off("floating.closed",N)})},[o,c,e,p,a,s,w,x,C,h,g,y,b])}const q3={current:null};function BE(e,n={}){const{enabled:o=!0,delay:a=0,handleClose:s=null,mouseOnly:u=!1,restMs:c=0,move:d=!0,triggerElementRef:p=q3,externalTree:g,isActiveTrigger:y=!0,getHandleCloseContext:h,isClosing:b,shouldOpen:x,guardStaleOpen:w=!1}=n,{dataRef:C,events:R}=e.context,T=Ii(g),O=tv(e),M=v.useRef(!1),A=kn(s),N=kn(a),k=kn(c),j=kn(o),D=kn(x),z=kn(b),F=Be(()=>KR(C.current.openEvent?.type,O.interactedInside)),G=Be(()=>D.current?.()!==!1),J=Be((H,L,$)=>{const K=e.context.triggerElements;if(K.hasElement(L))return!H||!ot(H,L);if(!an($))return!1;const V=$;return K.hasMatchingElement(X=>ot(X,V))&&(!H||!ot(H,V))}),Y=Be(()=>{if(!O.handler)return;Kt(e.select("domReferenceElement")).removeEventListener("mousemove",O.handler),O.handler=void 0}),U=Be(()=>{hh(O)});return y&&(O.handleCloseOptions=s?.__options),v.useEffect(()=>Y,[Y]),v.useEffect(()=>{if(!o)return;function H(L){L.open?M.current=!1:(M.current=L.reason===qn,Y(),O.openChangeTimeout.clear(),O.restTimeout.clear(),O.blockMouseMove=!0,O.restTimeoutPending=!1)}return R.on("openchange",H),()=>{R.off("openchange",H)}},[o,R,O,Y]),v.useEffect(()=>{if(!o)return;function H(ee,q=!0){const se=ms(N.current,"close",O.pointerType);se?O.openChangeTimeout.start(se,()=>{e.setOpen(!1,dt(qn,ee)),T?.events.emit("floating.closed",ee)}):q&&(O.openChangeTimeout.clear(),e.setOpen(!1,dt(qn,ee)),T?.events.emit("floating.closed",ee))}const L=p.current??(y?e.select("domReferenceElement"):null);if(!an(L))return;function $(ee){if(O.openChangeTimeout.clear(),O.blockMouseMove=!1,u&&!Ci(O.pointerType))return;const q=fS(k.current),se=ms(N.current,"open",O.pointerType),I=tr(ee),B=ee.currentTarget??null,W=e.select("domReferenceElement");let re=B;if(an(I)&&!e.context.triggerElements.hasElement(I)){for(const Me of e.context.triggerElements.elements())if(ot(Me,I)){re=Me;break}}an(B)&&an(W)&&!e.context.triggerElements.hasElement(B)&&ot(B,W)&&(re=W);const Re=re==null?!1:J(W,re,I),le=e.select("open"),me=z.current?.()??e.select("transitionStatus")==="ending",ge=!le&&me&&M.current,ce=!Re&&an(re)&&an(W)&&ot(W,re)&&ge,Te=q>0&&!se,ve=Re&&(le||ge)||ce,ke=!le||Re;if(ve){G()&&e.setOpen(!0,dt(qn,ee,re));return}Te||(se?O.openChangeTimeout.start(se,()=>{ke&&G()&&e.setOpen(!0,dt(qn,ee,re))}):ke&&G()&&e.setOpen(!0,dt(qn,ee,re)))}function K(ee){if(F()){U();return}Y();const q=e.select("domReferenceElement"),se=Kt(q);O.restTimeout.clear(),O.restTimeoutPending=!1;const I=C.current.floatingContext??h?.();if(oh(ee.relatedTarget,e.context.triggerElements))return;if(A.current&&I){e.select("open")||O.openChangeTimeout.clear();const W=p.current;O.handler=A.current({...I,tree:T,x:ee.clientX,y:ee.clientY,onClose(){U(),Y(),j.current&&!F()&&W===e.select("domReferenceElement")&&H(ee,!0)}}),se.addEventListener("mousemove",O.handler),O.handler(ee);return}(O.pointerType!=="touch"||!ot(e.select("floatingElement"),ee.relatedTarget))&&H(ee)}function V(ee){ot(L,ee.relatedTarget)||(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1)}const X=w?jt(L,"mouseout",V):void 0;return d?ca(jt(L,"mousemove",$,{once:!0}),jt(L,"mouseenter",$),jt(L,"mouseleave",K),X):ca(jt(L,"mouseenter",$),jt(L,"mouseleave",K),X)},[Y,U,C,N,e,o,A,O,y,J,F,u,d,k,p,T,j,h,z,G,w]),v.useMemo(()=>{if(!o)return;function H(L){O.pointerType=L.pointerType}return{onPointerDown:H,onPointerEnter:H,onMouseMove(L){const{nativeEvent:$}=L,K=L.currentTarget,V=e.select("domReferenceElement"),X=e.select("open"),ee=J(V,K,L.target);if(u&&!Ci(O.pointerType))return;if(X&&ee&&O.handleCloseOptions?.blockPointerEvents){const I=e.select("floatingElement");if(I){const B=O.handleCloseOptions?.getScope?.()??K.ownerDocument.body;FE(O,{scopeElement:B,referenceElement:K,floatingElement:I})}}const q=fS(k.current);if(X&&!ee||q===0||!ee&&O.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;O.restTimeout.clear();function se(){if(O.restTimeoutPending=!1,F())return;const I=e.select("open");!O.blockMouseMove&&(!I||ee)&&G()&&e.setOpen(!0,dt(qn,$,K))}O.pointerType==="touch"?cr.flushSync(()=>{se()}):ee&&X?se():(O.restTimeoutPending=!0,O.restTimeout.start(q,se))}}},[o,O,F,J,u,e,k,G])}function zS(e){return ha&&e.movementX===0&&e.movementY===0}function rp(e,n,o){switch(e){case"vertical":return n;case"horizontal":return o;default:return n||o}}function Sf(e,n){return rp(n,e===VR||e===_y,e===_h||e===Hh)}function S0(e,n,o){return rp(n,e===_y,o?e===_h:e===Hh)||e==="Enter"||e===" "||e===""}function Y3(e,n,o){return rp(n,o?e===_h:e===Hh,e===_y)}function K3(e,n,o,a){const s=o?e===Hh:e===_h,u=e===VR;return n==="both"||n==="horizontal"&&a?e==="Escape":rp(n,s,u)}function VE(e,n){const{listRef:o,activeIndex:a,onNavigate:s=()=>{},enabled:u=!0,selectedIndex:c=null,allowEscape:d=!1,loopFocus:p=!1,nested:g=!1,rtl:y=!1,virtual:h=!1,focusItemOnOpen:b="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:R="vertical",triggerOrientation:T=R,parentOrientation:O,id:M,resetOnPointerLeave:A=!0,externalTree:N,nestedReturnFocusRef:k,grid:j}=n,D=j!=null,z=e.useState("open"),F=e.useState("floatingElement"),G=e.useState("domReferenceElement"),J=e.context.dataRef,Y=ah(F),U=X0(G),H=kn(Y),L=Ni(),$=Ii(N),K=v.useRef(b),V=v.useRef(c??-1),X=v.useRef(null),ee=v.useRef(!0),q=Be(de=>{s(V.current===-1?null:V.current,de)}),se=v.useRef(!!F),I=v.useRef(z),B=v.useRef(!1),W=v.useRef(!1),re=v.useRef(null),Re=kn(C),le=kn(z),me=kn(c),ge=kn(A),ce=Il(),Te=Il(),ve=Be(()=>{ce.cancel();function de(Ie){h||(re.current=Vf(Ie,{sync:B.current,preventScroll:!0}))}const we=o.current[V.current],Ke=W.current;we&&de(we),(B.current?Ie=>Ie():Ie=>ce.request(Ie))(()=>{const Ie=o.current[V.current]||we;if(!Ie)return;we||de(Ie),He&&(Ke||!ee.current)&&Ie.scrollIntoView?.({block:"nearest",inline:"nearest"})})});_e(()=>{J.current.orientation=R},[J,R]),_e(()=>{z||(X.current=null),(!z||b!=="auto")&&(K.current=b)},[z,b]),_e(()=>{u&&(z&&F?(V.current=c??-1,K.current&&c!=null&&(W.current=!0,q())):se.current&&(V.current=-1,q()))},[u,z,F,c,q]),_e(()=>{if(u){if(!z){B.current=!1;return}if(F)if(a==null){if(B.current=!1,me.current!=null)return;if(se.current&&(V.current=-1,ve()),(!I.current||!se.current)&&K.current&&(X.current!=null||K.current===!0&&X.current==null)){let de=0;const we=()=>{o.current[0]==null?(de<2&&(de?De=>Te.request(De):queueMicrotask)(we),de+=1):(V.current=X.current==null||S0(X.current,T,y)||g?Bf(o):Z0(o),X.current=null,q())};we()}}else Sl(o.current,a)||(V.current=a,ve(),W.current=!1)}},[u,z,F,a,me,g,o,T,y,q,ve,Te]),_e(()=>{if(!u||F||!$||h||!se.current)return;const de=$.nodesRef.current,we=de.find(Ie=>Ie.id===L)?.context?.elements.floating,Ke=$r(Kt(G??we??null)),De=de.some(Ie=>Ie.context&&ot(Ie.context.elements.floating,Ke));we&&!De&&ee.current&&we.focus({preventScroll:!0})},[u,F,G,$,L,h]),_e(()=>{I.current=z,se.current=!!F});const ke=a!=null,Me=Be(de=>{if(!le.current)return;const we=o.current.indexOf(de.currentTarget);we!==-1&&(V.current!==we||a!==we)&&(V.current=we,q(de))}),Le=Be(()=>O??$?.nodesRef.current.find(de=>de.id===L)?.context?.dataRef?.current.orientation),Fe=Be(()=>Bf(o,Re.current)),Oe=Be(de=>{if(ee.current=!1,B.current=!0,de.which===229||!le.current&&de.currentTarget===H.current)return;if(g&&K3(de.key,R,y,D)){Sf(de.key,Le())||Bo(de),e.setOpen(!1,dt(ih,de.nativeEvent));const Ie=k?.current??G;yn(Ie)&&Ie.focus();return}a!=null&&a!==V.current&&!Sl(o.current,a)&&(V.current=a);const we=V.current,Ke=Bf(o,C),De=Z0(o,C);if(U||(de.key==="Home"&&(Bo(de),V.current=Ke,q(de)),de.key==="End"&&(Bo(de),V.current=De,q(de))),j!=null){const Ie=j(de,V.current,o,R,p,y,C,Ke,De);if(Ie!=null&&Ie!==V.current&&(V.current=Ie,q(de)),R==="both")return}if(Sf(de.key,R)){Bo(de);const Ie=$r(de.currentTarget.ownerDocument);if(z&&!h&&ot(de.currentTarget,Ie)&&!o.current.some(ht=>ht!=null&&ot(ht,Ie))){V.current=S0(de.key,R,y)?Ke:De,q(de),a===V.current&&ve();return}const{index:yt,wrapped:ut}=$4(o.current,we,{decrement:!S0(de.key,R,y),loopFocus:p,allowEscape:d,disabledIndices:C,minIndex:Ke,maxIndex:De});ut&&(B.current=!1),V.current=yt,q(de)}}),He=v.useMemo(()=>({onFocus(we){B.current=!0,Me(we)},onClick({currentTarget:we}){h||we.focus({preventScroll:!0})},onMouseMove(we){zS(we)||(B.current=!0,W.current=!1,x&&Me(we))},onPointerLeave(we){if(!le.current||!ee.current||we.pointerType==="touch")return;B.current=!0;const Ke=we.relatedTarget;if(!(!x||o.current.includes(Ke))&&ge.current&&(re.current?.(),re.current=null,V.current=-1,q(we),!h)){const De=H.current,Ie=$r(Kt(De));De&&ot(De,Ie)&&De.focus({preventScroll:!0})}}}),[Me,le,H,x,o,q,ge,h]),be=v.useMemo(()=>h&&z&&ke&&{"aria-activedescendant":`${M}-${a}`},[h,z,ke,M,a]),Ue=v.useMemo(()=>({...U?{}:be,onKeyDown(de){if(de.key==="Tab"&&de.shiftKey&&z&&!h){const we=tr(de.nativeEvent);if(we&&!ot(H.current,we))return;Bo(de);const Ke=dt(Ti,de.nativeEvent);e.setOpen(!1,Ke);const De=k?.current??G;!Ke.isCanceled&&yn(De)&&De.focus();return}Oe(de)},onPointerMove(de){zS(de)||(ee.current=!0)}}),[be,Oe,H,U,e,z,h,G,k]),Qe=v.useMemo(()=>{function de(De){e.setOpen(!0,dt(ih,De.nativeEvent,De.currentTarget))}function we(De){b==="auto"&&Nl(De.nativeEvent)&&(K.current=!h)}function Ke(De){K.current=b,b==="auto"&&Py(De.nativeEvent)&&(K.current=!0)}return{onKeyDown(De){const Ie=e.select("open");ee.current=!1;const yt=De.key.startsWith("Arrow"),ut=Y3(De.key,Le(),y),ht=Sf(De.key,Ie?R:T),Ot=(g?ut:ht)||De.key==="Enter"||De.key.trim()==="";if(h&&Ie&&(!g||Oc(De.currentTarget)))return Oe(De);if(!(!Ie&&!w&&yt)){if(Ot){const Dt=Sf(De.key,Le());X.current=g&&Dt?null:De.key}if(g){ut&&(Bo(De),Ie?(V.current=Fe(),q(De),h&&H.current?.focus()):de(De));return}ht&&(me.current!=null&&(V.current=me.current),Bo(De),!Ie&&w?de(De):Oe(De),Ie&&q(De))}},onFocus(De){De.target===De.currentTarget&&e.select("open")&&!h&&(V.current=-1,q(De))},onPointerDown:Ke,onPointerEnter:Ke,onMouseDown:we,onClick:we}},[Oe,b,Fe,g,q,e,w,R,T,Le,y,me,h,H]),it=v.useMemo(()=>({...be,...Qe}),[be,Qe]);return v.useMemo(()=>u?{reference:it,floating:Ue,item:He,trigger:Qe}:{},[u,it,Ue,Qe,He])}function qE(e,n){const{listRef:o,elementsRef:a,activeIndex:s,onMatch:u,disabledIndices:c,onTyping:d,enabled:p=!0,resetMs:g=750,selectedIndex:y=null}=n,h=Be(d),b=e.useState("open"),x=Hn(),w=v.useRef(""),C=v.useRef(y??s??-1),R=v.useRef(null),T=Be(A=>{function N(U){return a?.current[U]}function k(U){const H=N(U);return H&&!Vh(H)||H?.matches(":disabled")?!1:c==null||!Rl(fa,U,c)}function j(U,H,L=0){if(U.length===0)return-1;const $=(L%U.length+U.length)%U.length,K=H.toLowerCase();for(let V=0;V<U.length;V+=1){const X=($+V)%U.length;if(!(!U[X]?.toLowerCase().startsWith(K)||!k(X)))return X}return-1}const D=o.current;if(w.current.length>0&&A.key===" "&&(Bo(A),h?.(!0)),w.current.length>0&&w.current[0]!==" "&&j(D,w.current)===-1&&A.key!==" "&&h?.(!1),D==null||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;b&&A.key!==" "&&(Bo(A),h?.(!0));const z=w.current==="";z&&(C.current=y??s??-1),D.every((U,H)=>U&&k(H)?U[0]?.toLowerCase()!==U[1]?.toLowerCase():!0)&&w.current===A.key&&(w.current="",C.current=R.current),w.current+=A.key,x.start(g,()=>{w.current="",C.current=R.current,h?.(!1)});const J=((z?y??s??-1:C.current)??0)+1,Y=j(D,w.current,J);Y!==-1?(u?.(Y,A),R.current=Y):A.key!==" "&&(w.current="",h?.(!1))}),O=Be(A=>{const N=A.relatedTarget,k=e.select("domReferenceElement"),j=e.select("floatingElement");ot(k,N)||ot(j,N)||(x.clear(),w.current="",C.current=R.current,h?.(!1))});_e(()=>{!b&&y!==null||(x.clear(),R.current=null,w.current!==""&&(w.current="",h?.(!1)))},[b,y,x,h]);const M=v.useMemo(()=>({onKeyDown:T,onBlur:O}),[T,O]);return v.useMemo(()=>p?{reference:M,floating:M}:{},[p,M])}const _S=.1,G3=_S*_S,xn=.5;function wf(e,n,o,a,s,u){return a>=n!=u>=n&&e<=(s-o)*(n-a)/(u-a)+o}function Rf(e,n,o,a,s,u,c,d,p,g){let y=!1;return wf(e,n,o,a,s,u)&&(y=!y),wf(e,n,s,u,c,d)&&(y=!y),wf(e,n,c,d,p,g)&&(y=!y),wf(e,n,p,g,o,a)&&(y=!y),y}function $3(e,n,o){return e>=o.x&&e<=o.x+o.width&&n>=o.y&&n<=o.y+o.height}function Ef(e,n,o,a,s,u){const c=Math.min(o,s),d=Math.max(o,s),p=Math.min(a,u),g=Math.max(a,u);return e>=c&&e<=d&&n>=p&&n<=g}function YE(e={}){const{blockPointerEvents:n=!1}=e,o=new No,a=({x:s,y:u,placement:c,elements:d,onClose:p,nodeId:g,tree:y})=>{const h=c?.split("-")[0];let b=!1,x=null,w=null,C=typeof performance<"u"?performance.now():0;function R(O,M){const A=performance.now(),N=A-C;if(x===null||w===null||N===0)return x=O,w=M,C=A,!1;const k=O-x,j=M-w,D=k*k+j*j,z=N*N*G3;return x=O,w=M,C=A,D<z}function T(){o.clear(),p()}return function(M){o.clear();const A=d.domReference,N=d.floating;if(!A||!N||h==null||s==null||u==null)return;const{clientX:k,clientY:j}=M,D=tr(M),z=M.type==="mouseleave",F=ot(N,D),G=ot(A,D);if(F&&(b=!0,!z))return;if(G&&(b=!1,!z)){b=!0;return}if(z&&an(M.relatedTarget)&&ot(N,M.relatedTarget))return;function J(){return!!(y&&Mi(y.nodesRef.current,g).length>0)}function Y(){J()||T()}if(J())return;const U=A.getBoundingClientRect(),H=N.getBoundingClientRect(),L=s>H.right-H.width/2,$=u>H.bottom-H.height/2,K=H.width>U.width,V=H.height>U.height,X=(K?U:H).left,ee=(K?U:H).right,q=(V?U:H).top,se=(V?U:H).bottom;if(h==="top"&&u>=U.bottom-1||h==="bottom"&&u<=U.top+1||h==="left"&&s>=U.right-1||h==="right"&&s<=U.left+1){Y();return}let I=!1;switch(h){case"top":I=Ef(k,j,X,U.top+1,ee,H.bottom-1);break;case"bottom":I=Ef(k,j,X,H.top+1,ee,U.bottom-1);break;case"left":I=Ef(k,j,H.right-1,se,U.left+1,q);break;case"right":I=Ef(k,j,U.right-1,se,H.left+1,q);break}if(I)return;if(b&&!$3(k,j,U)){Y();return}if(!z&&R(k,j)){Y();return}let B=!1;switch(h){case"top":{const W=K?xn/2:xn*4,re=K||L?s+W:s-W,Re=K?s-W:L?s+W:s-W,le=u+xn+1,me=L||K?H.bottom-xn:H.top,ge=L?K?H.bottom-xn:H.top:H.bottom-xn;B=Rf(k,j,re,le,Re,le,H.left,me,H.right,ge);break}case"bottom":{const W=K?xn/2:xn*4,re=K||L?s+W:s-W,Re=K?s-W:L?s+W:s-W,le=u-xn,me=L||K?H.top+xn:H.bottom,ge=L?K?H.top+xn:H.bottom:H.top+xn;B=Rf(k,j,re,le,Re,le,H.left,me,H.right,ge);break}case"left":{const W=V?xn/2:xn*4,re=V||$?u+W:u-W,Re=V?u-W:$?u+W:u-W,le=s+xn+1,me=$||V?H.right-xn:H.left,ge=$?V?H.right-xn:H.left:H.right-xn;B=Rf(k,j,me,H.top,ge,H.bottom,le,re,le,Re);break}case"right":{const W=V?xn/2:xn*4,re=V||$?u+W:u-W,Re=V?u-W:$?u+W:u-W,le=s-xn,me=$||V?H.left+xn:H.right,ge=$?V?H.left+xn:H.right:H.left+xn;B=Rf(k,j,le,re,le,Re,me,H.top,ge,H.bottom);break}}B?b||o.start(40,Y):Y()}};return a.__options={...e,blockPointerEvents:n},a}function HS(e,n,o){let{reference:a,floating:s}=e;const u=Mo(n),c=qy(n),d=Vy(c),p=fo(n),g=u==="y",y=a.x+a.width/2-s.width/2,h=a.y+a.height/2-s.height/2,b=a[d]/2-s[d]/2;let x;switch(p){case"top":x={x:y,y:a.y-s.height};break;case"bottom":x={x:y,y:a.y+a.height};break;case"right":x={x:a.x+a.width,y:h};break;case"left":x={x:a.x-s.width,y:h};break;default:x={x:a.x,y:a.y}}const w=da(n);return w&&(x[c]+=b*(w==="end"?1:-1)*(o&&g?-1:1)),x}async function X3(e,n){var o;n===void 0&&(n={});const{x:a,y:s,platform:u,rects:c,elements:d,strategy:p}=e,{boundary:g="clippingAncestors",rootBoundary:y="viewport",elementContext:h="floating",altBoundary:b=!1,padding:x=0}=Oi(n,e),w=eE(x),R=d[b?h==="floating"?"reference":"floating":h],T=pc(await u.getClippingRect({element:(o=await(u.isElement==null?void 0:u.isElement(R)))==null||o?R:R.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(d.floating)),boundary:g,rootBoundary:y,strategy:p})),O=h==="floating"?{x:a,y:s,width:c.floating.width,height:c.floating.height}:c.reference,M=await(u.getOffsetParent==null?void 0:u.getOffsetParent(d.floating)),A=await(u.isElement==null?void 0:u.isElement(M))&&await(u.getScale==null?void 0:u.getScale(M))||{x:1,y:1},N=pc(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:O,offsetParent:M,strategy:p}):O);return{top:(T.top-N.top+w.top)/A.y,bottom:(N.bottom-T.bottom+w.bottom)/A.y,left:(T.left-N.left+w.left)/A.x,right:(N.right-T.right+w.right)/A.x}}const Q3=50,Z3=async(e,n,o)=>{const{placement:a="bottom",strategy:s="absolute",middleware:u=[],platform:c}=o,d=c.detectOverflow?c:{...c,detectOverflow:X3},p=await(c.isRTL==null?void 0:c.isRTL(n));let g=await c.getElementRects({reference:e,floating:n,strategy:s}),{x:y,y:h}=HS(g,a,p),b=a,x=0;const w={};for(let C=0;C<u.length;C++){const R=u[C];if(!R)continue;const{name:T,fn:O}=R,{x:M,y:A,data:N,reset:k}=await O({x:y,y:h,initialPlacement:a,placement:b,strategy:s,middlewareData:w,rects:g,platform:d,elements:{reference:e,floating:n}});y=M??y,h=A??h,w[T]={...w[T],...N},k&&x<Q3&&(x++,typeof k=="object"&&(k.placement&&(b=k.placement),k.rects&&(g=k.rects===!0?await c.getElementRects({reference:e,floating:n,strategy:s}):k.rects),{x:y,y:h}=HS(g,b,p)),C=-1)}return{x:y,y:h,placement:b,strategy:s,middlewareData:w}},J3=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var o,a;const{placement:s,middlewareData:u,rects:c,initialPlacement:d,platform:p,elements:g}=n,{mainAxis:y=!0,crossAxis:h=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...R}=Oi(e,n);if((o=u.arrow)!=null&&o.alignmentOffset)return{};const T=fo(s),O=Mo(d),M=fo(d)===d,A=await(p.isRTL==null?void 0:p.isRTL(g.floating)),N=b||(M||!C?[lh(d)]:B4(d)),k=w!=="none";!b&&k&&N.push(...K4(d,C,w,A));const j=[d,...N],D=await p.detectOverflow(n,R),z=[];let F=((a=u.flip)==null?void 0:a.overflows)||[];if(y&&z.push(D[T]),h){const U=F4(s,c,A);z.push(D[U[0]],D[U[1]])}if(F=[...F,{placement:s,overflows:z}],!z.every(U=>U<=0)){var G,J;const U=(((G=u.flip)==null?void 0:G.index)||0)+1,H=j[U];if(H&&(!(h==="alignment"?O!==Mo(H):!1)||F.every(K=>Mo(K.placement)===O?K.overflows[0]>0:!0)))return{data:{index:U,overflows:F},reset:{placement:H}};let L=(J=F.filter($=>$.overflows[0]<=0).sort(($,K)=>$.overflows[1]-K.overflows[1])[0])==null?void 0:J.placement;if(!L)switch(x){case"bestFit":{var Y;const $=(Y=F.filter(K=>{if(k){const V=Mo(K.placement);return V===O||V==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(V=>V>0).reduce((V,X)=>V+X,0)]).sort((K,V)=>K[1]-V[1])[0])==null?void 0:Y[0];$&&(L=$);break}case"initialPlacement":L=d;break}if(s!==L)return{reset:{placement:L}}}return{}}}},KE=new Set(["left","top"]);async function W3(e,n){const{placement:o,platform:a,elements:s}=e,u=await(a.isRTL==null?void 0:a.isRTL(s.floating)),c=fo(o),d=da(o),p=Mo(o)==="y",g=KE.has(c)?-1:1,y=u&&p?-1:1,h=Oi(n,e);let{mainAxis:b,crossAxis:x,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return d&&typeof w=="number"&&(x=d==="end"?w*-1:w),p?{x:x*y,y:b*g}:{x:b*g,y:x*y}}const eI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var o,a;const{x:s,y:u,placement:c,middlewareData:d}=n,p=await W3(n,e);return c===((o=d.offset)==null?void 0:o.placement)&&(a=d.arrow)!=null&&a.alignmentOffset?{}:{x:s+p.x,y:u+p.y,data:{...p,placement:c}}}}},tI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:o,y:a,placement:s,platform:u}=n,{mainAxis:c=!0,crossAxis:d=!1,limiter:p={fn:O=>{let{x:M,y:A}=O;return{x:M,y:A}}},...g}=Oi(e,n),y={x:o,y:a},h=await u.detectOverflow(n,g),b=Mo(s),x=By(b);let w=y[x],C=y[b];const R=(O,M)=>WR(M+h[O==="y"?"top":"left"],M,M-h[O==="y"?"bottom":"right"]);c&&(w=R(x,w)),d&&(C=R(b,C));const T=p.fn({...n,[x]:w,[b]:C});return{...T,data:{x:T.x-o,y:T.y-a,enabled:{[x]:c,[b]:d}}}}}},nI=function(e){return e===void 0&&(e={}),{options:e,fn(n){var o,a;const{x:s,y:u,placement:c,rects:d,middlewareData:p}=n,{offset:g=0,mainAxis:y=!0,crossAxis:h=!0}=Oi(e,n),b={x:s,y:u},x=Mo(c),w=By(x);let C=b[w],R=b[x];const T=Oi(g,n),O=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:(o=T.mainAxis)!=null?o:0,crossAxis:(a=T.crossAxis)!=null?a:0};if(y){const N=w==="y"?"height":"width",k=d.reference[w]-d.floating[N]+O.mainAxis,j=d.reference[w]+d.reference[N]-O.mainAxis;C<k?C=k:C>j&&(C=j)}if(h){var M,A;const N=w==="y"?"width":"height",k=KE.has(fo(c)),j=d.reference[x]-d.floating[N]+(k&&((M=p.offset)==null?void 0:M[x])||0)+(k?0:O.crossAxis),D=d.reference[x]+d.reference[N]+(k?0:((A=p.offset)==null?void 0:A[x])||0)-(k?O.crossAxis:0);R<j?R=j:R>D&&(R=D)}return{[w]:C,[x]:R}}}},rI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){const{placement:o,rects:a,platform:s,elements:u}=n,{apply:c=()=>{},...d}=Oi(e,n),p=await s.detectOverflow(n,d),g=fo(o),y=da(o),h=Mo(o)==="y",{width:b,height:x}=a.floating;let w,C;g==="top"||g==="bottom"?(w=g,C=y===(await(s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(C=g,w=y==="end"?"top":"bottom");const R=x-p.top-p.bottom,T=b-p.left-p.right,O=Pl(x-p[w],R),M=Pl(b-p[C],T),A=n.middlewareData.shift,N=!A;let k=O,j=M;A!=null&&A.enabled.x&&(j=T),A!=null&&A.enabled.y&&(k=R),N&&!y&&(h?j=b-2*_a(p.left,p.right):k=x-2*_a(p.top,p.bottom)),await c({...n,availableWidth:j,availableHeight:k});const D=await s.getDimensions(u.floating);return b!==D.width||x!==D.height?{reset:{rects:!0}}:{}}}};function GE(e){const n=ho(e);let o=parseFloat(n.width)||0,a=parseFloat(n.height)||0;const s=yn(e),u=s?e.offsetWidth:o,c=s?e.offsetHeight:a,d=sh(o)!==u||sh(a)!==c;return d&&(o=u,a=c),{width:o,height:a,$:d}}function rv(e){return an(e)?e:e.contextElement}function Tl(e){const n=rv(e);if(!yn(n))return Ha(1);const o=n.getBoundingClientRect(),{width:a,height:s,$:u}=GE(n);let c=(u?sh(o.width):o.width)/a,d=(u?sh(o.height):o.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const oI=Ha(0);function $E(e){const n=wn(e);return!zy()||!n.visualViewport?oI:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function aI(e,n,o){return n===void 0&&(n=!1),!!o&&n&&o===wn(e)}function ys(e,n,o,a){n===void 0&&(n=!1),o===void 0&&(o=!1);const s=e.getBoundingClientRect(),u=rv(e);let c=Ha(1);n&&(a?an(a)&&(c=Tl(a)):c=Tl(e));const d=aI(u,o,a)?$E(u):Ha(0);let p=(s.left+d.x)/c.x,g=(s.top+d.y)/c.y,y=s.width/c.x,h=s.height/c.y;if(u&&a){const b=wn(u),x=an(a)?wn(a):a;let w=b,C=K0(w);for(;C&&x!==w;){const R=Tl(C),T=C.getBoundingClientRect(),O=ho(C),M=T.left+(C.clientLeft+parseFloat(O.paddingLeft))*R.x,A=T.top+(C.clientTop+parseFloat(O.paddingTop))*R.y;p*=R.x,g*=R.y,y*=R.x,h*=R.y,p+=M,g+=A,w=wn(C),C=K0(w)}}return pc({width:y,height:h,x:p,y:g})}function op(e,n){const o=zh(e).scrollLeft;return n?n.left+o:ys(Fa(e)).left+o}function XE(e,n){const o=e.getBoundingClientRect(),a=o.left+n.scrollLeft-op(e,o),s=o.top+n.scrollTop;return{x:a,y:s}}function iI(e){let{elements:n,rect:o,offsetParent:a,strategy:s}=e;const u=s==="fixed",c=Fa(a),d=n?Lh(n.floating):!1;if(a===c||d&&u)return o;let p={scrollLeft:0,scrollTop:0},g=Ha(1);const y=Ha(0),h=yn(a);if((h||!u)&&((Sr(a)!=="body"||Cc(c))&&(p=zh(a)),h)){const x=ys(a);g=Tl(a),y.x=x.x+a.clientLeft,y.y=x.y+a.clientTop}const b=c&&!h&&!u?XE(c,p):Ha(0);return{width:o.width*g.x,height:o.height*g.y,x:o.x*g.x-p.scrollLeft*g.x+y.x+b.x,y:o.y*g.y-p.scrollTop*g.y+y.y+b.y}}function sI(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function lI(e){const n=zh(e),o=e.ownerDocument.body,a=_a(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=_a(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let u=-n.scrollLeft+op(e);const c=-n.scrollTop;return ho(o).direction==="rtl"&&(u+=_a(e.clientWidth,o.clientWidth)-a),{width:a,height:s,x:u,y:c}}const uI=25;function cI(e,n,o){o===void 0&&(o="viewport");const a=o==="layoutViewport",s=wn(e),u=Fa(e),c=s.visualViewport;let d=u.clientWidth,p=u.clientHeight,g=0,y=0;if(c){const b=!zy()||n==="fixed";a?b||(g=-c.offsetLeft,y=-c.offsetTop):(d=c.width,p=c.height,b&&(g=c.offsetLeft,y=c.offsetTop))}if(op(u)<=0){const b=u.ownerDocument,x=b.body,w=getComputedStyle(x),C=b.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,R=Math.abs(u.clientWidth-x.clientWidth-C),T=getComputedStyle(u).scrollbarGutter==="stable both-edges"?R/2:R;T<=uI&&(d-=T)}return{width:d,height:p,x:g,y}}function dI(e,n){const o=ys(e,!0,n==="fixed"),a=o.top+e.clientTop,s=o.left+e.clientLeft,u=Tl(e),c=e.clientWidth*u.x,d=e.clientHeight*u.y,p=s*u.x,g=a*u.y;return{width:c,height:d,x:p,y:g}}function US(e,n,o){let a;if(n==="viewport"||n==="layoutViewport")a=cI(e,o,n);else if(n==="document")a=lI(Fa(e));else if(an(n))a=dI(n,o);else{const s=$E(e);a={x:n.x-s.x,y:n.y-s.y,width:n.width,height:n.height}}return pc(a)}function fI(e,n){const o=n.get(e);if(o)return o;let a=fc(e,[],!1).filter(d=>an(d)&&Sr(d)!=="body"),s=null;const u=ho(e).position==="fixed";let c=u?Ua(e):e;for(;an(c)&&!za(c);){const d=ho(c),p=Ly(c),g=s?s.position:u?"fixed":"";!p&&(g==="fixed"||g==="absolute"&&d.position==="static")?a=a.filter(h=>h!==c):s=d,c=Ua(c)}return n.set(e,a),a}function hI(e){let{element:n,boundary:o,rootBoundary:a,strategy:s}=e;const c=[...o==="clippingAncestors"?Lh(n)?[]:fI(n,this._c):[].concat(o),a],d=US(n,c[0],s);let p=d.top,g=d.right,y=d.bottom,h=d.left;for(let b=1;b<c.length;b++){const x=US(n,c[b],s);p=_a(x.top,p),g=Pl(x.right,g),y=Pl(x.bottom,y),h=_a(x.left,h)}return{width:g-h,height:y-p,x:h,y:p}}function pI(e){const{width:n,height:o}=GE(e);return{width:n,height:o}}function gI(e,n,o){const a=yn(n),s=Fa(n),u=o==="fixed",c=ys(e,!0,u,n);let d={scrollLeft:0,scrollTop:0};const p=Ha(0);if((a||!u)&&((Sr(n)!=="body"||Cc(s))&&(d=zh(n)),a)){const b=ys(n,!0,u,n);p.x=b.x+n.clientLeft,p.y=b.y+n.clientTop}!a&&s&&(p.x=op(s));const g=s&&!a&&!u?XE(s,d):Ha(0),y=c.left+d.scrollLeft-p.x-g.x,h=c.top+d.scrollTop-p.y-g.y;return{x:y,y:h,width:c.width,height:c.height}}function w0(e){return ho(e).position==="static"}function FS(e,n){if(!yn(e)||ho(e).position==="fixed")return null;if(n)return n(e);let o=e.offsetParent;return Fa(e)===o&&(o=o.ownerDocument.body),o}function QE(e,n){const o=wn(e);if(Lh(e))return o;if(!yn(e)){let s=Ua(e);for(;s&&!za(s);){if(an(s)&&!w0(s))return s;s=Ua(s)}return o}let a=FS(e,n);for(;a&&o4(a)&&w0(a);)a=FS(a,n);return a&&za(a)&&w0(a)&&!Ly(a)?o:a||s4(e)||o}const mI=async function(e){const n=this.getOffsetParent||QE,o=this.getDimensions,a=await o(e.floating);return{reference:gI(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function yI(e){return ho(e).direction==="rtl"}const ZE={convertOffsetParentRelativeRectToViewportRelativeRect:iI,getDocumentElement:Fa,getClippingRect:hI,getOffsetParent:QE,getElementRects:mI,getClientRects:sI,getDimensions:pI,getScale:Tl,isElement:an,isRTL:yI};function JE(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function vI(e,n,o){let a=null,s;const u=Fa(e);function c(){var y;clearTimeout(s),(y=a)==null||y.disconnect(),a=null}function d(y,h){y===void 0&&(y=!1),h===void 0&&(h=1),c();const b=e.getBoundingClientRect(),{left:x,top:w,width:C,height:R}=b;if(y||n(),!C||!R)return;const T=yf(w),O=yf(u.clientWidth-(x+C)),M=yf(u.clientHeight-(w+R)),A=yf(x),k={rootMargin:-T+"px "+-O+"px "+-M+"px "+-A+"px",threshold:_a(0,Pl(1,h))||1};let j=!0;function D(z){const F=z[0].intersectionRatio;if(!JE(b,e.getBoundingClientRect()))return d();if(F!==h){if(!j)return d();F?d(!1,F):s=setTimeout(()=>{d(!1,1e-7)},1e3)}j=!1}try{a=new IntersectionObserver(D,{...k,root:u.ownerDocument})}catch{a=new IntersectionObserver(D,k)}a.observe(e)}const p=wn(e),g=()=>d(o);return p.addEventListener("resize",g),d(!0),()=>{p.removeEventListener("resize",g),c()}}function BS(e,n,o,a){a===void 0&&(a={});const{ancestorScroll:s=!0,ancestorResize:u=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:p=!1}=a,g=rv(e),y=s||u?[...g?fc(g):[],...n?fc(n):[]]:[];y.forEach(T=>{s&&T.addEventListener("scroll",o),u&&T.addEventListener("resize",o)});const h=g&&d?vI(g,o,u):null;let b=-1,x=null;c&&(x=new ResizeObserver(T=>{let[O]=T;O&&O.target===g&&x&&n&&(x.unobserve(n),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var M;(M=x)==null||M.observe(n)})),o()}),g&&!p&&x.observe(g),n&&x.observe(n));let w,C=p?ys(e):null;p&&R();function R(){const T=ys(e);C&&!JE(C,T)&&o(),C=T,w=requestAnimationFrame(R)}return o(),()=>{var T;y.forEach(O=>{s&&O.removeEventListener("scroll",o),u&&O.removeEventListener("resize",o)}),h?.(),(T=x)==null||T.disconnect(),x=null,p&&cancelAnimationFrame(w)}}const bI=eI,xI=tI,SI=J3,wI=rI,RI=nI,EI=(e,n,o)=>{const a=new Map,s=o??{},u={...ZE,...s.platform,_c:a};return Z3(e,n,{...s,platform:u})};var CI=typeof document<"u",TI=function(){},qf=CI?v.useLayoutEffect:TI;function ph(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let o,a,s;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(o=e.length,o!==n.length)return!1;for(a=o;a--!==0;)if(!ph(e[a],n[a]))return!1;return!0}if(s=Object.keys(e),o=s.length,o!==Object.keys(n).length)return!1;for(a=o;a--!==0;)if(!{}.hasOwnProperty.call(n,s[a]))return!1;for(a=o;a--!==0;){const u=s[a];if(!(u==="_owner"&&e.$$typeof)&&!ph(e[u],n[u]))return!1}return!0}return e!==e&&n!==n}function WE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function VS(e,n){const o=WE(e);return Math.round(n*o)/o}function R0(e){const n=v.useRef(e);return qf(()=>{n.current=e}),n}function OI(e){e===void 0&&(e={});const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:s,elements:{reference:u,floating:c}={},transform:d=!0,whileElementsMounted:p,open:g}=e,[y,h]=v.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[b,x]=v.useState(a);ph(b,a)||x(a);const[w,C]=v.useState(null),[R,T]=v.useState(null),O=v.useCallback(K=>{K!==k.current&&(k.current=K,C(K))},[]),M=v.useCallback(K=>{K!==j.current&&(j.current=K,T(K))},[]),A=u||w,N=c||R,k=v.useRef(null),j=v.useRef(null),D=v.useRef(y),z=p!=null,F=R0(p),G=R0(s),J=R0(g),Y=v.useCallback(()=>{if(!k.current||!j.current)return;const K={placement:n,strategy:o,middleware:b};G.current&&(K.platform=G.current),EI(k.current,j.current,K).then(V=>{const X={...V,isPositioned:J.current!==!1};U.current&&!ph(D.current,X)&&(D.current=X,cr.flushSync(()=>{h(X)}))})},[b,n,o,G,J]);qf(()=>{g===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(K=>({...K,isPositioned:!1})))},[g]);const U=v.useRef(!1);qf(()=>(U.current=!0,()=>{U.current=!1}),[]),qf(()=>{if(A&&(k.current=A),N&&(j.current=N),A&&N){if(F.current)return F.current(A,N,Y);Y()}},[A,N,Y,F,z]);const H=v.useMemo(()=>({reference:k,floating:j,setReference:O,setFloating:M}),[O,M]),L=v.useMemo(()=>({reference:A,floating:N}),[A,N]),$=v.useMemo(()=>{const K={position:o,left:0,top:0};if(!L.floating)return K;const V=VS(L.floating,y.x),X=VS(L.floating,y.y);return d?{...K,transform:"translate("+V+"px, "+X+"px)",...WE(L.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:V,top:X}},[o,d,L.floating,y.x,y.y]);return v.useMemo(()=>({...y,update:Y,refs:H,elements:L,floatingStyles:$}),[y,Y,H,L,$])}const MI=(e,n)=>{const o=bI(e);return{name:o.name,fn:o.fn,options:[e,n]}},AI=(e,n)=>{const o=xI(e);return{name:o.name,fn:o.fn,options:[e,n]}},DI=(e,n)=>({fn:RI(e).fn,options:[e,n]}),NI=(e,n)=>{const o=SI(e);return{name:o.name,fn:o.fn,options:[e,n]}},II=(e,n)=>{const o=wI(e);return{name:o.name,fn:o.fn,options:[e,n]}},jI={...ka,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,n)=>n?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class PI extends Ul{constructor(n,o,a){const s=new jc;super(kI(n,s,o,a),LI(s),jI)}setOpen=(n,o)=>{D3(this,n,o,{extraState:{openChangeReason:o.reason}})};cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,dt(qo,n))}}function kI(e,n,o,a=!1){return{...np(n,o,a),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function LI(e){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const zI=Rc(function(n){const{disabled:o=!1,defaultOpen:a=!1,open:s,disableHoverablePopup:u=!1,trackCursorAxis:c="none",actionsRef:d,onOpenChange:p,onOpenChangeComplete:g,handle:y,triggerId:h,defaultTriggerId:b=null,children:x}=n,w=Wy((G,J)=>new PI({open:a,openProp:s,activeTriggerId:b,triggerIdProp:h},G,J));w.useControlledProp("openProp",s),w.useControlledProp("triggerIdProp",h),w.useContextCallback("onOpenChange",p),w.useContextCallback("onOpenChangeComplete",g);const C=w.useState("open"),R=!o&&C,T=w.useState("activeTriggerId"),O=w.useState("mounted"),M=w.useState("payload");w.useSyncedValues({trackCursorAxis:c,disableHoverablePopup:u,disabled:o}),Jh(w,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:A,transitionStatus:N}=Wh(R,w),k=w.useState("isInstantPhase"),j=w.useState("instantType"),D=w.useState("lastOpenChangeReason"),z=v.useRef(null);_e(()=>{C&&o&&w.setOpen(!1,dt(O4))},[C,o,w]),_e(()=>{N==="ending"&&D===_r||N!=="ending"&&k?(j!=="delay"&&(z.current=j),w.set("instantType","delay")):z.current!==null&&(w.set("instantType",z.current),z.current=null)},[N,k,D,j,w]),_e(()=>{R&&T==null&&w.set("payload",void 0)},[w,T,R]),v.useImperativeHandle(d,()=>({unmount:A,close:()=>w.setOpen(!1,dt(Ac))}),[A,w]);const F=R||O||!o&&c!=="none";return S.jsxs(UR.Provider,{value:w,children:[y&&S.jsx(Xh,{handle:y,store:w}),F&&S.jsx(_I,{store:w,disabled:o,trackCursorAxis:c}),typeof x=="function"?x({payload:M}):x]})});function _I({store:e,disabled:n,trackCursorAxis:o}){const a=e.useState("floatingRootContext"),s=Nc(a,{enabled:!n,referencePress:()=>e.select("closeOnClick")}),u=C3(a,{enabled:!n&&o!=="none",axis:o==="none"?void 0:o}),c=v.useMemo(()=>Lr(u.reference,s.reference),[u.reference,s.reference]);return ep(e,{activeTriggerProps:c,inactiveTriggerProps:c,popupProps:s.floating??Gt}),null}function Tr(e){return Hl(e,"base-ui")}const eC=v.createContext(void 0);function HI(){return v.useContext(eC)}const UI=600,qS="data-base-ui-tooltip-trigger";function YS(e){const n=tr(e);return an(n)?n:null}const FI=HR(function(n,o){const{render:a,className:s,style:u,handle:c,payload:d,disabled:p,delay:g,closeOnClick:y=!0,closeDelay:h,id:b,...x}=n,w=Ec(!0),R=HE(c)??w;if(!R)throw new Error(Rn(82));const T=Tr(b),O=R.useState("isTriggerActive",T),M=R.useState("isOpenedByTrigger",T),A=R.useState("floatingRootContext"),N=v.useRef(null),k=h??0,{registerTrigger:j,isMountedByThisTrigger:D}=jE(T,N,R,{payload:d,closeOnClick:y,closeDelay:k}),z=HI(),{activeIdRef:F,delayRef:G,isInstantPhase:J,hasProvider:Y}=N4(A,{open:M}),U=tv(A);R.useSyncedValue("isInstantPhase",J);const H=R.useState("disabled"),L=p??H,$=kn(L),K=R.useState("trackCursorAxis"),V=R.useState("disableHoverablePopup"),X=v.useRef(!1),ee=Hn(),q=v.useRef(void 0);function se(){return Y&&F.current!=null?0:g??z??UI}function I(ce){const Te=N.current;if(!Te||!ce)return!1;const ve=hc(ce,`[${qS}]`);return ve!==null&&ve!==Te&&ot(Te,ve)}function B(ce){const Te=I(ce);return X.current=Te,Te&&(U.openChangeTimeout.clear(),U.restTimeout.clear(),U.restTimeoutPending=!1,ee.clear()),Te}const W=BE(A,{enabled:!L,mouseOnly:!0,move:!1,handleClose:!V&&K!=="both"?YE():null,restMs:se,delay(){return h==null&&Y?{close:ms(G.current,"close")}:{close:k}},triggerElementRef:N,isActiveTrigger:O,isClosing:()=>R.select("transitionStatus")==="ending",shouldOpen(){return!X.current}}),re=UE(A,{enabled:!L}).reference,Re=ce=>{const Te=X.current,ve=YS(ce),ke=B(ve),Me=N.current,Le=Me&&ve&&ot(Me,ve);if(ke&&R.select("open")&&R.select("lastOpenChangeReason")===qn){R.setOpen(!1,dt(qn,ce));return}if(Te&&!ke&&Le&&!$.current&&!R.select("open")&&Me&&Ci(q.current)){const Fe=()=>{!X.current&&!$.current&&!R.select("open")&&R.setOpen(!0,dt(qn,ce,Me))},Oe=se();Oe===0?(ee.clear(),Fe()):ee.start(Oe,Fe)}},le=R.useState("appliedTriggerProps",D||K!=="none");return Mt("button",n,{state:{open:M},ref:[o,j,N],props:[W,re,le,{onMouseOver(ce){Re(ce.nativeEvent)},onFocus(ce){I(YS(ce.nativeEvent))&&ce.preventBaseUIHandler()},onMouseLeave(){X.current=!1,ee.clear(),q.current=void 0},onPointerEnter(ce){q.current=ce.pointerType},onPointerDown(ce){q.current=ce.pointerType,R.set("closeOnClick",y),y&&!R.select("open")&&R.cancelPendingOpen(ce.nativeEvent)},onClick(ce){y&&!R.select("open")&&R.cancelPendingOpen(ce.nativeEvent)},id:T,[$0]:L?"":void 0,[qS]:L?void 0:""},x],stateAttributesMapping:YR})}),tC=v.createContext(void 0);function BI(){const e=v.useContext(tC);if(e===void 0)throw new Error(Rn(70));return e}const VI=v.forwardRef(function(n,o){const{children:a,container:s,className:u,render:c,style:d,...p}=n,{node:g,subtree:y}=RE({container:s,ref:o,componentProps:n,elementProps:p});return!y&&!g?null:S.jsxs(v.Fragment,{children:[y,g&&cr.createPortal(a,g)]})}),qI=v.forwardRef(function(n,o){const{keepMounted:a=!1,...s}=n;return Ec().useState("mounted")||a?S.jsx(tC.Provider,{value:a,children:S.jsx(VI,{ref:o,...s})}):null}),nC=v.createContext(void 0);function rC(){const e=v.useContext(nC);if(e===void 0)throw new Error(Rn(71));return e}function YI(e){const{nodeId:n,externalTree:o,rootContext:a}=e,s=a.useState("referenceElement"),u=a.useState("floatingElement"),c=a.useState("domReferenceElement"),d=a.useState("open"),p=a.useState("floatingId"),[g,y]=v.useState(null),h=v.useRef(null),b=Ii(o),x=v.useMemo(()=>({reference:s,floating:u,domReference:c}),[s,u,c]),w=OI({...e,elements:{...x,...g&&{reference:g}}}),C=v.useCallback(M=>{const A=an(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;y(A),w.refs.setReference(A)},[w.refs]),R=v.useMemo(()=>({...w.refs,setPositionReference:C,domReference:h}),[w.refs,C]),T=v.useMemo(()=>({...w.elements,domReference:c}),[w.elements,c]),O=v.useMemo(()=>({...w,dataRef:a.context.dataRef,open:d,onOpenChange:a.setOpen,events:a.context.events,floatingId:p,refs:R,elements:T,nodeId:n,rootStore:a}),[w,R,T,n,a,d,p]);return _e(()=>{c&&(h.current=c)},[c]),_e(()=>{a.context.dataRef.current.floatingContext=O;const M=b?.nodesRef.current.find(A=>A.id===n);M&&(M.context=O)}),v.useMemo(()=>({...w,context:O,refs:R,elements:T,rootStore:a}),[w,R,T,O,a])}const KI=v.createContext(void 0);function ap(){return v.useContext(KI)?.direction??"ltr"}const GI=e=>({name:"arrow",options:e,async fn(n){const{x:o,y:a,placement:s,rects:u,platform:c,elements:d,middlewareData:p}=n,{element:g,padding:y=0}=Oi(e,n)||{};if(g==null)return{};const h=eE(y),b={x:o,y:a},x=qy(s),w=Vy(x),C=await c.getDimensions(g),R=x==="y",T=R?"top":"left",O=R?"bottom":"right",M=R?"clientHeight":"clientWidth",A=u.reference[w]+u.reference[x]-b[x]-u.floating[w],N=b[x]-u.reference[x],k=d.floating[M]||u.floating[w],j=A/2-N/2,D=k/2-C[w]/2-1,z=Math.min(h[T],D),F=Math.min(h[O],D),G=z,J=k-C[w]-F,Y=k/2-C[w]/2+j,U=WR(G,Y,J),H=!p.arrow&&da(s)!=null&&Y!==U&&u.reference[w]/2-(Y<G?z:F)-C[w]/2<0,L=H?Y<G?Y-G:Y-J:0;return{[x]:b[x]+L,data:{[x]:U,centerOffset:Y-U-L,...H&&{alignmentOffset:L}},reset:H}}}),$I=(e,n)=>{const{name:o,fn:a}=GI(e);return{name:o,fn:a,options:[e,n]}},XI={name:"hide",async fn(e){const{width:n,height:o,x:a,y:s}=e.rects.reference,u=n===0&&o===0&&a===0&&s===0,c=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:c.top-o>=0||c.right-n>=0||c.bottom-o>=0||c.left-n>=0||u}}}},QI={sideX:"left",sideY:"top"},ZI="--available-width",JI="--available-height",WI="--anchor-width",ej="--anchor-height",tj="--transform-origin",KS=ZI,GS=JI;function oC(e,n,o){const a=e==="inline-start"||e==="inline-end";return{top:"top",right:a?o?"inline-start":"inline-end":"right",bottom:"bottom",left:a?o?"inline-end":"inline-start":"left"}[n]}function $S(e,n,o){const{rects:a,placement:s}=e;return{side:oC(n,fo(s),o),align:da(s)||"center",anchor:{width:a.reference.width,height:a.reference.height},positioner:{width:a.floating.width,height:a.floating.height}}}function ip(e){return nj(e,YI)}function nj(e,n){const{anchor:o,positionMethod:a="absolute",side:s="bottom",sideOffset:u=0,align:c="center",alignOffset:d=0,collisionBoundary:p,collisionPadding:g=5,sticky:y=!1,arrowPadding:h=5,disableAnchorTracking:b=!1,inline:x,keepMounted:w=!1,floatingRootContext:C,mounted:R,collisionAvoidance:T,shift:O,nodeId:M,adaptiveOrigin:A,lazyFlip:N=!1,externalTree:k}=e,j=T.side||"flip",D=T.align||"flip",z=T.fallbackAxisSide||"end",F=O?.crossAxis??!1,G=O?.rootBoundary,J=typeof o=="function"?o:void 0,Y=Be(J),U=J?Y:o,H=kn(o),L=kn(R),K=ap()==="rtl",[V,X]=v.useState(null);!R&&V!==null&&X(null);const ee=N==="placement",q=V?fo(V):null,se=V&&ee?da(V)||"center":null,I=q||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":K?"left":"right","inline-start":K?"right":"left"}[s],B=se||c,W=B==="center"?I:`${I}-${B}`;let re=g;typeof re=="number"?re={top:re,right:re,bottom:re,left:re}:re&&(re={top:re.top||0,right:re.right||0,bottom:re.bottom||0,left:re.left||0});const Re=1,le=s==="bottom"?Re:0,me=s==="top"?Re:0,ge=s==="right"?Re:0,ce=s==="left"?Re:0,Te={boundary:p==="clipping-ancestors"?"clippingAncestors":p,padding:re},ve=v.useRef(null),ke=kn(u),Me=kn(d),Le=typeof u!="function"?u:0,Fe=typeof d!="function"?d:0,Oe=[];x&&Oe.push(x),Oe.push(MI(je=>{const at=$S(je,s,K),Pe=typeof ke.current=="function"?ke.current(at):ke.current,ze=typeof Me.current=="function"?Me.current(at):Me.current;return{mainAxis:Pe,crossAxis:ze,alignmentAxis:ze}},[Le,Fe,K,s]));const He=D==="none"&&j!=="shift",be=!He&&(y||F||j==="shift"),Ue=j==="none"?null:NI({...Te,padding:{top:re.top+Re+le,right:re.right+Re+ce,bottom:re.bottom+Re+me,left:re.left+Re+ge},mainAxis:!F&&j==="flip",crossAxis:D==="flip"?"alignment":!1,fallbackAxisSideDirection:z}),Qe=He?null:AI({...Te,rootBoundary:G,mainAxis:D!=="none",crossAxis:be,limiter:y||F?void 0:DI(je=>{if(!ve.current)return{};const{width:at,height:Pe}=ve.current.getBoundingClientRect(),ze=Mo(fo(je.placement)),Ge=ze==="y"?at:Pe,et=ze==="y"?re.left+re.right:re.top+re.bottom;return{offset:Ge/2+et/2}})},[Te,y,F,G,re,D]);j==="shift"||D==="shift"||B==="center"?Oe.push(Qe,Ue):Oe.push(Ue,Qe),Oe.push(II({...Te,apply({elements:{floating:je},availableWidth:at,availableHeight:Pe,rects:ze}){if(!L.current)return;const Ge=je.style;Ge.setProperty(KS,`${at}px`),Ge.setProperty(GS,`${Pe}px`);const et=wn(je).devicePixelRatio||1,{x:Et,y:_,width:Z,height:ne}=ze.reference,ye=(Math.round((Et+Z)*et)-Math.round(Et*et))/et,xe=(Math.round((_+ne)*et)-Math.round(_*et))/et;Ge.setProperty(WI,`${ye}px`),Ge.setProperty(ej,`${xe}px`)}}),$I(je=>({element:ve.current||Kt(je.elements.floating).createElement("div"),padding:ve.current?h:0}),[h]),{name:"transformOrigin",fn(je){const{elements:{floating:at},middlewareData:Pe,placement:ze,platform:Ge,rects:et,y:Et}=je,_=fo(ze),Z=da(ze),ne=Mo(_)==="y",ye=ve.current,xe=typeof u=="function"?u($S(je,s,K)):u;let qe;if(!ye&&Z&&Math.abs(ne?Pe.shift?.x||0:Pe.shift?.y||0)<=1)qe=Z==="start"===(ne&&Ge.isRTL?.(at)===!0)?"100%":"0%";else{const Xe=ne?Pe.arrow?.x||0:Pe.arrow?.y||0,$e=ne?ye?.clientWidth||0:ye?.clientHeight||0;qe=`${Xe+$e/2}px`}let Ve=_==="top"||_==="left"?`calc(100% + ${xe}px)`:`${-xe}px`;return be&&ne&&Math.abs(Pe.shift?.y||0)>xe&&(Ve=`${et.reference.y+et.reference.height/2-Et}px`),at.style.setProperty(tj,ne?`${qe} ${Ve}`:`${Ve} ${qe}`),{}}},XI,A),_e(()=>{!R&&C&&C.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[R,C]);const it=v.useMemo(()=>({ancestorScroll:!b,elementResize:!b&&typeof ResizeObserver<"u",layoutShift:!b&&typeof IntersectionObserver<"u"}),[b]),{refs:de,elements:we,x:Ke,y:De,middlewareData:Ie,update:yt,placement:ut,context:ht,isPositioned:Ot,floatingStyles:Dt}=n({rootContext:C,open:w?R:void 0,placement:W,middleware:Oe,strategy:a,whileElementsMounted:w?void 0:(...je)=>BS(...je,it),nodeId:M,externalTree:k}),{sideX:Wt,sideY:rn}=Ie.adaptiveOrigin||QI,en=Ot?a:"fixed",We=v.useMemo(()=>{let je;return Ot?A?je={position:en,[Wt]:Ke,[rn]:De}:je={...Dt,position:en}:je={position:en,top:0,left:0},je[KS]="100vw",je[GS]="100vh",Ot||(je.opacity=0),je},[A,en,Wt,Ke,rn,De,Dt,Ot]),xt=v.useRef(null);_e(()=>{if(!R)return;const je=H.current,at=typeof je=="function"?je():je,ze=(XS(at)?at.current:at)||null||null;ze!==xt.current&&(de.setPositionReference(ze),xt.current=ze)},[R,de,U,H]),v.useEffect(()=>{if(!R)return;const je=H.current;typeof je!="function"&&XS(je)&&je.current!==xt.current&&(de.setPositionReference(je.current),xt.current=je.current)},[R,de,U,H]),v.useEffect(()=>{if(w&&R&&we.reference&&we.floating)return BS(we.reference,we.floating,yt,it)},[w,R,we,yt,it]);const $t=fo(ut),ft=oC(s,$t,K),vt=da(ut)||"center",gt=!!Ie.hide?.referenceHidden;_e(()=>{N&&R&&Ot&&($t!==I||ee&&vt!==B)&&X(ut)},[N,ee,R,Ot,ut,$t,vt,I,B]);const kt=v.useMemo(()=>({position:"absolute",top:Ie.arrow?.y,left:Ie.arrow?.x}),[Ie.arrow]),un=Ie.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:We,arrowStyles:kt,arrowRef:ve,arrowUncentered:un,side:ft,align:vt,physicalSide:$t,anchorHidden:gt,refs:de,context:ht,isPositioned:Ot,update:yt}),[We,kt,ve,un,ft,vt,$t,gt,de,ht,Ot,yt])}function XS(e){return e!=null&&"current"in e}function Pc(e){return e==="starting"?v3:Gt}function sp(e,n,{styles:o,transitionStatus:a,props:s,refs:u,hidden:c,inert:d=!1}){const p={...o};return d&&(p.pointerEvents="none"),Mt("div",e,{state:n,ref:u,props:[{role:"presentation",hidden:c,style:p},Pc(a),s],stateAttributesMapping:Tc})}const rj=v.forwardRef(function(n,o){const{render:a,className:s,anchor:u,positionMethod:c="absolute",side:d="top",align:p="center",sideOffset:g=0,alignOffset:y=0,collisionBoundary:h="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:R=Xy,style:T,...O}=n,M=Ec(),A=BI(),N=M.useState("open"),k=M.useState("mounted"),j=M.useState("trackCursorAxis"),D=M.useState("disableHoverablePopup"),z=M.useState("floatingRootContext"),F=M.useState("instantType"),G=M.useState("transitionStatus"),J=M.useState("adaptiveOrigin"),Y=ip({anchor:u,positionMethod:c,floatingRootContext:z,mounted:k,side:d,sideOffset:g,align:p,alignOffset:y,collisionBoundary:h,collisionPadding:b,sticky:w,arrowPadding:x,disableAnchorTracking:C,keepMounted:A,collisionAvoidance:R,adaptiveOrigin:J}),U=v.useMemo(()=>({open:N,side:Y.side,align:Y.align,anchorHidden:Y.anchorHidden,instant:j!=="none"?"tracking-cursor":F}),[N,Y.side,Y.align,Y.anchorHidden,j,F]),H=sp(n,U,{styles:Y.positionerStyles,transitionStatus:G,props:O,refs:[o,M.useStateSetter("positionerElement")],hidden:!k,inert:!N||j==="both"||D});return S.jsx(nC.Provider,{value:Y,children:H})}),oj=v.forwardRef(function(n,o){const{render:a,className:s,style:u,...c}=n,d=Ec(),{side:p,align:g}=rC(),y=d.useState("open"),h=d.useState("instantType"),b=d.useState("transitionStatus"),x=d.useState("popupProps"),w=d.useState("floatingRootContext"),C=d.useState("disabled"),R=d.useState("closeDelay");jo({open:y,ref:d.context.popupRef,onComplete(){y&&d.context.onOpenChangeComplete?.(!0)}}),nv(w,{enabled:!C,closeDelay:R});const T=d.useStateSetter("popupElement");return Mt("div",n,{state:{open:y,side:p,align:g,instant:h,transitionStatus:b},ref:[o,d.context.popupRef,T],props:[Ic,x,Pc(b),c],stateAttributesMapping:Uh})}),aj=v.forwardRef(function(n,o){const{render:a,className:s,style:u,...c}=n,d=Ec(),{arrowRef:p,side:g,align:y,arrowUncentered:h,arrowStyles:b}=rC(),x=d.useState("open"),w=d.useState("instantType");return Mt("div",n,{state:{open:x,side:g,align:y,uncentered:h,instant:w},ref:[o,p],props:[{style:b,"aria-hidden":!0},c],stateAttributesMapping:Tc})}),ij=function(n){const{delay:o,closeDelay:a,timeout:s=400}=n,u=v.useMemo(()=>({open:o,close:a}),[o,a]);return S.jsx(eC.Provider,{value:o,children:S.jsx(D4,{delay:u,timeoutMs:s,children:n.children})})};function lp(e){return Gy(19)?e:e?"true":void 0}function sj(e){const[n,o]=v.useState({current:e,previous:null});return Object.is(e,n.current)||o({current:e,previous:n.current}),n.previous}const aC=48,ga=(e,n=0)=>{const o=new Int32Array(e.length);for(let a=0;a<e.length;a++)o[a]=e.charCodeAt(a)-aC-n;return o},up=e=>{const n=new Int32Array(e.length+1);for(let o=0;o<e.length;o++)n[o+1]=n[o]+e[o];return n},Ai=e=>{const n=new Int32Array(e.length);let o=0;for(let a=0;a<e.length;a++){const s=e.charCodeAt(a)-aC;o+=s>>>1^-(s&1),n[a]=o}return n},lj=384,uj=[],ss=up(ga("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),cj=up(ga(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),dj="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",fj=(()=>{const e=ss.length-1,n=new Int32Array(e);for(let s=e-1;s>=0;s--){let u=1,c=s+1;for(let d=ss[s];d<ss[s+1];d++)u+=n[c],c+=n[c];n[s]=u}const o=new Int32Array(ss[e]);let a=0;for(let s=0;s<e;s++){let u=s+1;for(let c=ss[s];c<ss[s+1];c++)o[a++]=u,u+=n[u]}return o})(),hj=ga("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),pj=up(ga("123333359346463635126536711576")),gj=ga("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),mj=ga("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),yj=Ai("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),vj=(()=>{const e=new Int32Array(319).fill(-1),n=Ai("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),o=Ai("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let a=0;a<n.length;a++)e[n[a]]=o[a];return e})(),bj="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(e=>{const n=e.split(" "),o=n.shift();for(let a=0;a<n.length;a++)n[a]=o+n[a];return n}),QS=Ai("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),xj=Ai("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),Sj=Ai("02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}€22ƒ†…:22z22222222222G000q†OVI00000{˜2™<40000Œ›@00000G¦§000ª00000000000000021K¬«00®“000000000000000000000–222›HGH_1¸222½2¾2222ÇÊ000­°2±"),iC=new Int32Array(987),sC=new Int32Array(987),lC=new Int32Array(987);let ey="";const ty=new Int32Array(1022);{const e=new Map;let n=0,o=0;for(let a=0;a<QS.length;a++)for(const s of bj[Sj[a]]){let u=e.get(s);u===void 0&&(u=n++,e.set(s,u),ty[u*2]=ey.length,ty[u*2+1]=s.length,ey+=s),iC[o]=QS[a],sC[o]=xj[a],lC[o]=u,o++}}const wj=Ai("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),Rj=up(ga("1::24444432:442:44:44>222222:44:4421322511111311111114")),Ej=Ai("2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222"),Cj=ga("ij"),Tj=ga("—"),Oj=ga("1"),Mj="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var Aj={GROUP_COUNT:lj,customValidatorNames:uj,edgeStart:ss,labelStart:cj,labelText:dj,edgeTarget:fj,nodeGroup:hj,nodeVlist:vj,vlistPat:pj,vlistOps:gj,vlistRef:mj,vlistGroup:yj,litAnchor:iC,litGroup:sC,litPool:lC,poolOffsets:ty,poolText:ey,adjGid:wj,adjStart:Rj,adjTgt:Ej,patGid:Cj,patTgt:Tj,postfixLookupGroups:Oj,orderSensitiveModifiers:Mj};const Dj="line"in new Error,aa=-1,is=-1,E0=(e,n,o)=>{let a=2166136261;for(let s=n;s<o;s++)a=Math.imul(a^e.charCodeAt(s),16777619);return a},Yf=(e,n,o)=>{const a=o-n;let s=Math.imul(a,2654435761)^e.charCodeAt(n);if(a>3){const u=a>>2,c=a>>1;s=Math.imul(s^e.charCodeAt(n+1)<<8^e.charCodeAt(n+2)<<16^e.charCodeAt(n+u),2246822507),s=Math.imul(s^e.charCodeAt(n+c)<<8^e.charCodeAt(n+c+u)<<16^e.charCodeAt(o-3),3266489909),s^=e.charCodeAt(o-2)<<8^e.charCodeAt(o-1)<<16;for(let d=n+3,p=o-4;d<n+8&&d<p;d++,p--)s=Math.imul(s^e.charCodeAt(d)^e.charCodeAt(p)<<8,16777619)}return s^s>>>15|0},Nj=(e,n,o={})=>{const{GROUP_COUNT:a,edgeStart:s,labelStart:u,labelText:c,edgeTarget:d,nodeGroup:p,nodeVlist:g,vlistPat:y,vlistOps:h,vlistRef:b,vlistGroup:x,litAnchor:w,litGroup:C,litPool:R,poolOffsets:T,poolText:O,adjGid:M,adjStart:A,adjTgt:N,patGid:k,patTgt:j,postfixLookupGroups:D,customValidatorNames:z,orderSensitiveModifiers:F}=e,G=new Int32Array(a).fill(-1);for(let he=0;he<M.length;he++)G[M[he]]=he;let J=0;for(let he=0;he+1<A.length;he++){const Ae=A[he+1]-A[he];Ae>J&&(J=Ae)}let Y=32;for(;Y<2*(1+J+k.length);)Y<<=1;const U=new Int32Array(b.length+1);for(let he=0;he<b.length;he++)U[he+1]=U[he]+y[b[he]+1]-y[b[he]];const H=new Uint8Array(a);for(let he=0;he<D.length;he++)H[D[he]]=1;const L=s.length-1,$=new Uint8Array(L);let K=0,V=!0;for(let he=0;he<w.length;he++){$[w[he]]=1;const Ae=T[R[he]*2+1];Ae>K&&(K=Ae);const Se=O.charCodeAt(T[R[he]*2]);(Se===91||Se===40)&&(V=!1)}let X=1;for(;X<w.length*2;)X<<=1;const ee=new Int32Array(X).fill(-1);for(let he=0;he<w.length;he++){const Ae=T[R[he]*2];let Se=(E0(O,Ae,Ae+T[R[he]*2+1])^Math.imul(w[he],2654435761)|0)&X-1;for(;ee[Se]!==-1;)Se=Se+1&X-1;ee[Se]=he}const q=(he,Ae,Se,nt)=>{let Ct=(E0(Ae,Se,nt)^Math.imul(he,2654435761)|0)&X-1;const wt=nt-Se;for(;;){const Lt=ee[Ct];if(Lt===-1)return-1;if(w[Lt]===he&&T[R[Lt]*2+1]===wt){const vn=T[R[Lt]*2];let fn=!0;for(let mt=0;mt<wt;mt++)if(O.charCodeAt(vn+mt)!==Ae.charCodeAt(Se+mt)){fn=!1;break}if(fn)return C[Lt]}Ct=Ct+1&X-1}},se=o.cacheSize??8192,I=o.prefix??e.prefix??"",B=I===""?"":I+":",W=B.length,re=(z??[]).map(he=>{throw new Error("cn: missing validator "+he)}),Re=/\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$/,le=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,me=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ge=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let ce=0,Te=-1,ve=-1,ke=-1,Me=-1;const Le=he=>he>=97&&he<=122||he>=65&&he<=90||he>=48&&he<=57||he===95,Fe=he=>/\s/.test(String.fromCharCode(he)),Oe=(he,Ae,Se)=>{if(ce=0,Te=-1,Se-Ae<3)return;const nt=he.charCodeAt(Ae),Ct=he.charCodeAt(Se-1);if(nt===91&&Ct===93)ce=1;else if(nt===40&&Ct===41)ce=2;else return;ke=Ae+1,Me=Se-1;let wt=Ae+1;if(Le(he.charCodeAt(wt))){for(wt++;wt<Se-1;){const Lt=he.charCodeAt(wt);if(!Le(Lt)&&Lt!==45)break;wt++}wt<Se-2&&he.charCodeAt(wt)===58&&(Te=Ae+1,ve=wt,ke=wt+1)}},He=(he,Ae,Se,nt)=>{if(Se-Ae!==nt.length)return!1;for(let Ct=0;Ct<nt.length;Ct++)if(he.charCodeAt(Ae+Ct)!==nt.charCodeAt(Ct))return!1;return!0},be=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ue=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qe=he=>!!he&&!Number.isNaN(Number(he)),it=(he,Ae,Se)=>{if(Se-Ae<11||!He(he,Ae,Ae+10,"@container"))return!1;if(he.charCodeAt(Ae+10)===47)return Se-Ae>=12;const nt=he.charCodeAt(Ae+11);return nt===115&&Se-Ae>=17&&He(he,Ae+10,Ae+16,"-size/")||nt===110&&Se-Ae>=19&&He(he,Ae+10,Ae+18,"-normal/")},de=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],we="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(he=>he.split(" ")),Ke=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],De=(he,Ae,Se,nt)=>{if(he>=10){if(he>=25)return re[he-25](Ae.slice(Se,nt));const Ct=he-10;if(ce!==de[Ct])return!1;if(Te>=0){for(const wt of we[Ct])if(He(Ae,Te,ve,wt))return!0;return!1}switch(Ke[Ct]){case 0:return!1;case 1:return!0;case 2:{const wt=Ae.slice(ke,Me);return Re.test(wt)&&!le.test(wt)}case 3:return Qe(Ae.slice(ke,Me));case 4:return ge.test(Ae.slice(ke,Me));default:return me.test(Ae.slice(ke,Me))}}switch(he){case 0:return!0;case 1:return ce===0;case 2:return ce===1;case 3:return ce===2;case 4:return be.test(Ae.slice(Se,nt));case 5:return Qe(Ae.slice(Se,nt));case 6:{const Ct=Ae.slice(Se,nt);return!!Ct&&Number.isInteger(Number(Ct))}case 7:return nt>Se&&Ae.charCodeAt(nt-1)===37&&Qe(Ae.slice(Se,nt-1));case 8:return Ue.test(Ae.slice(Se,nt));default:return it(Ae,Se,nt)}},Ie=new Set(typeof F=="string"?F.split(" "):F),yt=(he,Ae,Se,nt,Ct,wt)=>{const Lt=E0(Ae,Se,nt)^(Ct?2654435769:0)|0;let vn=he.get(Lt);if(vn!==void 0)e:for(let At=0;At<vn.length;At++){const on=vn[At];if(!(on.imp!==Ct||on.k.length!==nt-Se)){for(let pt=0;pt<on.k.length;pt++)if(on.k.charCodeAt(pt)!==Ae.charCodeAt(Se+pt))continue e;return on.id}}else he.set(Lt,vn=[]);const fn=Ae.slice(Se,nt),mt=wt(fn);return vn.push({k:fn,imp:Ct,id:mt}),mt};let ut=new Map,ht=new Map,Ot=2;const Dt=4096,Wt=(he,Ae)=>{const Se=[];let nt=0,Ct=0,wt=0;for(let mt=0;mt<he.length;mt++){const At=he.charCodeAt(mt);nt===0&&Ct===0&&At===58?(Se.push(he.slice(wt,mt)),wt=mt+1):At===91?nt++:At===93?nt--:At===40?Ct++:At===41&&Ct--}Se.push(he.slice(wt));let Lt=Se[0];if(Se.length>1){const mt=[];let At=[];for(const on of Se)on.charCodeAt(0)===91||Ie.has(on)?(At.length&&(mt.push(...At.sort()),At=[]),mt.push(on)):At.push(on);At.length&&mt.push(...At.sort()),Lt=mt.join(":")}const vn=Ae?Lt+" !":Lt;let fn=ht.get(vn);return fn===void 0&&ht.set(vn,fn=Ot++),fn};let rn=new Map,en=a;const We=a+4096,xt=()=>en++,$t=2097152,ft=8192,vt=new Int32Array(ft),gt=new Array(ft).fill(null),kt=new Int32Array(ft),un=new Int32Array(ft),je=new Uint8Array(ft);let at=0;const Pe=(he,Ae,Se,nt,Ct,wt,Lt,vn)=>{let fn=he;if(gt[he]!==null)if(gt[he|1]===null)fn=he|1;else if((at++&3)===0)fn=he|at>>2&1;else return;gt[fn]=Ae.slice(Se,nt),vt[fn]=Ct,kt[fn]=wt,un[fn]=Lt,je[fn]=vn},ze=()=>gt.fill(null);let Ge=256,et=[new Int32Array(Ge),new Int32Array(Ge),new Int32Array(Ge),new Int32Array(Ge)],[Et,_,Z,ne]=et,ye=new Uint8Array(Ge),xe=new Uint8Array(Ge);const qe=()=>{Ge*=2,et=et.map(Ae=>{const Se=new Int32Array(Ge);return Se.set(Ae),Se}),[Et,_,Z,ne]=et;const he=new Uint8Array(Ge);he.set(ye),ye=he,xe=new Uint8Array(Ge)};let Ve=64,Xe=new Int32Array(Ve),$e=new Int32Array(Ve);const st=new Int32Array(a);let tt=2048,St=21,ct=new Float64Array(tt),Bt=new Int32Array(tt),_t=0;const On=(he,Ae)=>{if(he===0&&Ae<a)return st[Ae]===_t?1:(st[Ae]=_t,0);const Se=he*2097152+Ae+1;let nt=Math.imul(Se,2654435761)>>>St;for(;Bt[nt]===_t;){if(ct[nt]===Se)return 1;nt=nt+1&tt-1}return ct[nt]=Se,Bt[nt]=_t,0},Vt=(he,Ae,Se,nt,Ct)=>{if(Se-Ae>=2&&he.charCodeAt(Ae)===91&&he.charCodeAt(Se-1)===93){let wt=-1;for(let Lt=Ae+1;Lt<Se-1;Lt++)if(he.charCodeAt(Lt)===58){wt=Lt;break}return wt===-1||wt===Ae+1?aa:yt(rn,he,Ae+1,wt,0,xt)}if(nt>=0&&p[nt]>=0)return p[nt];for(let wt=Ct-1;wt>=0;wt--){const Lt=$e[wt];if(Lt>Se)continue;const vn=Xe[wt],fn=Se-Lt;if($[vn]===1&&fn>0&&fn<=K){const Ln=he.charCodeAt(Lt);if(V===!1||Ln!==91&&Ln!==40){const Jr=q(vn,he,Lt,Se);if(Jr>=0)return Jr}}const mt=g[vn];if(mt<0)continue;const At=b[mt],on=y[At],pt=y[At+1];if(on===pt)continue;Oe(he,Lt,Se);const nr=U[mt]-on;for(let Ln=on;Ln<pt;Ln++)if(De(h[Ln],he,Lt,Se))return x[nr+Ln]}return aa},Ht=he=>{const Ae=he.length;let Se=0,nt=0,Ct=!1;(Ot>Dt||ut.size>Dt)&&(ut=new Map,ht=new Map,Ot=2,ze()),en>We&&(rn=new Map,en=a,ze());let wt=0;for(;wt<Ae;){let mt=he.charCodeAt(wt);if(mt===32||mt>=9&&mt<=13||mt>=160&&Fe(mt)){mt!==32&&(Ct=!0),wt++;continue}const At=wt;let on=0;for(;wt<Ae;){if(mt=he.charCodeAt(wt),mt<=32){if(mt===32)break;if(mt>=9&&mt<=13){Ct=!0;break}}else if(mt>=160&&Fe(mt)){Ct=!0;break}on=Math.imul(on^mt,16777619),wt++}const pt=wt,nr=pt-At;Se===Ge&&qe();const Ln=Se++;Et[Ln]=At,_[Ln]=pt,nt+=nr,on^=Math.imul(nr,2654435761);const Jr=on^on>>>15|0,Gn=Jr&8190;{let tn=-1;if(vt[Gn]===Jr&&gt[Gn]!==null&&gt[Gn].length===nr?tn=Gn:vt[Gn|1]===Jr&&gt[Gn|1]!==null&&gt[Gn|1].length===nr&&(tn=Gn|1),tn>=0){const ar=gt[tn];let mo=!0;for(let to=0;to<nr;to++)if(ar.charCodeAt(to)!==he.charCodeAt(At+to)){mo=!1;break}if(mo){Z[Ln]=kt[tn],ne[Ln]=un[tn],ye[Ln]=je[tn];continue}}}let $n=At;if(W!==0){if(pt-At<=W||!he.startsWith(B,At)){Z[Ln]=aa,Pe(Gn,he,At,pt,Jr,aa,0,0);continue}$n=At+W}let Os=0,Zl=0,ba=-1,Ms=-1;for(let tn=$n;tn<pt;tn++){const ar=he.charCodeAt(tn);if(Os===0&&Zl===0){if(ar===58){ba=tn;continue}if(ar===47){Ms=tn;continue}}ar===91?Os++:ar===93?Os--:ar===40?Zl++:ar===41&&Zl--}const Qc=ba>=$n?ba+1:$n;let Nn=Qc,wr=pt,Ya=!1,As=0;wr>Nn&&he.charCodeAt(wr-1)===33?(Ya=!0,wr--):wr>Nn&&he.charCodeAt(Nn)===33&&(Ya=!0,Nn++,As=1);let Fr=-1;Ms>Qc&&(Fr=Ms+As,Fr>=wr&&(Fr=-1));let Ds=Nn;wr-Nn>1&&he.charCodeAt(Nn)===45&&(Ds=Nn+1);let Wr=0,Mr=0,Ka=0,Jl=-1,eo=0;(g[0]>=0||$[0]===1)&&(Xe[0]=0,$e[0]=Ds,eo=1);let Pi=is,Wl=0;for(let tn=Ds;tn<wr;tn++)if(tn===Fr&&(Pi=Mr<Ka?is:Wr,Wl=eo),Wr!==is){const ar=he.charCodeAt(tn);let mo=-1;if(Mr<Ka)c.charCodeAt(Mr)===ar?(Mr++,Mr===Ka&&(mo=Wr=Jl)):Wr=is;else{const to=s[Wr],zi=s[Wr+1];let xa=is;for(let pr=to;pr<zi;pr++){const _i=u[pr];if(c.charCodeAt(_i)===ar){u[pr+1]-_i===1?mo=xa=d[pr]:(Mr=_i+1,Ka=u[pr+1],Jl=d[pr],xa=Wr);break}}Wr=xa}if(mo>=0&&(g[mo]>=0||$[mo]===1)&&tn+1<wr&&he.charCodeAt(tn+1)===45){if(eo===Ve){Ve*=2;const to=new Int32Array(Ve);to.set(Xe),Xe=to;const zi=new Int32Array(Ve);zi.set($e),$e=zi}Xe[eo]=mo,$e[eo]=tn+2,eo++}}Fr===wr&&(Pi=Mr<Ka?is:Wr,Wl=eo);const eu=Mr<Ka?is:Wr;let hr,Ar=!1;if(Fr>=0)if(Ar=!0,hr=Vt(he,Nn,Fr,Pi,Wl),hr!==aa&&hr<a&&H[hr]){const tn=Vt(he,Nn,wr,eu,eo);tn!==aa&&tn!==hr&&(hr=tn,Ar=!1)}else hr===aa&&(hr=Vt(he,Nn,wr,eu,eo),Ar=!1);else hr=Vt(he,Nn,wr,eu,eo);let ki=0,Li=0;hr===aa?Z[Ln]=aa:(Li=Ar?1:0,ki=$n>=ba?Ya?1:0:yt(ut,he,$n,ba,Ya?1:0,tn=>Wt(tn,Ya)),Z[Ln]=hr,ye[Ln]=Li,ne[Ln]=ki),Pe(Gn,he,At,pt,Jr,hr,ki,Li)}if(Se===0)return"";if(Se===1)return Et[0]===0&&_[0]===Ae?he:he.slice(Et[0],_[0]);if(Se*Y>tt){for(;Se*Y>tt;)tt<<=1,St--;ct=new Float64Array(tt),Bt=new Int32Array(tt)}if(Ot>=$t||en>=$t)throw new Error("cn: too many distinct classes in one merge");_t=_t+1|0,_t===0&&(st.fill(0),Bt.fill(0),_t=1);let Lt=!1;for(let mt=Se-1;mt>=0;mt--){const At=Z[mt];if(At===aa){xe[mt]=1;continue}const on=ne[mt];if(On(on,At)===1){xe[mt]=0,Lt=!0;continue}if(xe[mt]=1,At<a){const pt=G[At];if(pt>=0)for(let nr=A[pt];nr<A[pt+1];nr++)On(on,N[nr]);if(ye[mt]&1)for(let nr=0;nr<k.length;nr++)k[nr]===At&&On(on,j[nr])}}if(!Lt&&!Ct&&Ae===nt+Se-1)return he;let vn="",fn=0;for(;fn<Se;){if(!xe[fn]){fn++;continue}const mt=Et[fn];let At=_[fn],on=fn+1;for(;on<Se&&xe[on]&&Et[on]===At+1&&he.charCodeAt(At)===32;)At=_[on],on++;vn.length>0&&(vn+=" "),vn+=he.slice(mt,At),fn=on}return vn},En=16384,Cn=new Int32Array(En*2);let Qr=0,cn=1,dn=Object.create(null),Mn=Object.create(null),In=new Map,va=new Map,Or=0,Po=0;const Zr=()=>{Qr^=En,cn=cn+1|0,Po=0},go=he=>{let Ae=dn[he];if(Ae!==void 0)return Ae;const Se=Yf(he,0,he.length),nt=(Se&16383)+Qr,Ct=Cn[nt]===(Se^cn)||Cn[nt^En]===(Se^cn-1);return Ct&&(Ae=Mn[he],Ae!==void 0)?(dn[he]=Ae,Ae):(Ae=Ht(he),Ct?(dn[he]=Ae,++Or>se&&(Or=0,Mn=dn,dn=Object.create(null),Zr())):(Cn[nt]=Se^cn,++Po>En&&Zr()),Ae)},Pt=he=>{let Ae=In.get(he);if(Ae!==void 0)return Ae;const Se=Yf(he,0,he.length),nt=(Se&16383)+Qr,Ct=Cn[nt]===(Se^cn)||Cn[nt^En]===(Se^cn-1);return Ct&&(Ae=va.get(he),Ae!==void 0)?(In.set(he,Ae),Ae):(Ae=Ht(he),Ct?(In.set(he,Ae),++Or>se&&(Or=0,va=In,In=new Map,Zr())):(Cn[nt]=Se^cn,++Po>En&&Zr()),Ae)},Yn=he=>{const Ae=Yf(he,0,he.length),Se=(Ae&16383)+Qr;return Cn[Se]===(Ae^cn)||Cn[Se^En]===(Ae^cn-1)?!0:(Cn[Se]=Ae^cn,++Po>En&&Zr(),!1)},Fn=se===0?Ht:Dj?he=>{const Ae=In.get(he);return Ae!==void 0?Ae:Pt(he)}:go;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?Fn(arguments[0]):Fn(jj.apply(null,arguments))},mergeString:Fn,seenBefore:se===0?()=>!1:Yn,mergeUncached:Ht}},gh=(e,n)=>{if(!e)return"";if(typeof e=="string")return e;let o="";if(typeof e.length=="number"&&(!n||Array.isArray(e))){const a=e;for(let s=0;s<a.length;s++){const u=a[s];if(!u)continue;const c=typeof u=="string"?u:gh(u,n);c&&(o&&(o+=" "),o+=c)}return o}if(n){if(typeof e=="number")return""+e;if(typeof e=="object")for(const a in e)e[a]&&(o&&(o+=" "),o+=a)}return o},Ij=(e,n)=>{let o="";for(let a=0;a<e.length;a++){const s=e[a];if(!s)continue;const u=typeof s=="string"?s:gh(s,n);u&&(o&&(o+=" "),o+=u)}return o},jj=function(){return Ij(arguments,!1)},Pj=256,ZS=16,kj=1024,C0=4096,Lj=(e,n)=>{const o=n===void 0?()=>!0:n.seenBefore,a=n===void 0?e:n.mergeUncached;let s=new Map,u=new Map,c=0,d=null,p=null,g=[],y=[],h=0;const b=(T,O,M)=>{p===null&&(p=new Array(C0).fill(""),g=new Array(C0).fill(""),y=new Array(C0).fill(""));const A=Yf(T,0,T.length)&4094;if(p[A]===T&&g[A]===O)return y[A];if(p[A|1]===T&&g[A|1]===O)return y[A|1];const N=e(M?O+" "+T:T),k=p[A]===""?A:A|(p[A|1]===""?1:h++&1);return p[k]=T,g[k]=O,y[k]=N,N},x=(T,O,M,A)=>{let N=0;if(O){if(O!==T.a0)return!1;N=1}if(M){if(M!==(N===0?T.a0:T.a1))return!1;N++}if(A){if(A!==(N===0?T.a0:N===1?T.a1:T.a2))return!1;N++}return N===T.t},w=(T,O)=>{const M=T.a;let A=0;for(let N=0;N<O.length;N++){const k=O[N];if(k){if(k!==M[A])return!1;A++}}return A===T.t},C=(T,O)=>{const M=T.length,A=d===null?null:d.n;if(!O){if(A!==null&&w(A,T))return d=A,A.r;if(d!==null&&d!==A&&w(d,T))return d.r}let N="",k=-1,j=0,D=!1;for(let G=0;G<M;G++){let J=T[G];if(J){if(typeof J!="string"){if(J=T[G]=gh(J,!0),!J)continue;D=!0}k<0&&(N=J,k=G),j++}}if(j===0)return"";if(j===1)return e(N);if(D){if(A!==null&&w(A,T))return d=A,A.r;if(d!==null&&d!==A&&w(d,T))return d.r}let z=s.get(N);z===void 0&&(z=u.get(N),z!==void 0&&s.set(N,z));let F=null;if(z!==void 0){if(z.skip>0){z.skip--,d=null;let J=N;for(let Y=k+1;Y<M;Y++){const U=T[Y];U&&(J+=" "+U)}return b(J,"",!1)}const G=z.e;e:for(let J=0;J<G.length;J++){const Y=G[J];if(Y.t!==j)continue;const U=Y.a;let H=1;for(let L=k+1;L<M;L++){const $=T[L];if($&&$!==U[H++])continue e}F=Y;break}F!==null&&(z.miss=0)}if(F===null){let G=N;const J=[N];for(let U=k+1;U<M;U++){const H=T[U];H&&(G+=" "+H,J.push(H))}if(!o(G))return a(G);F={r:e(G),t:J.length,a0:J[0],a1:J[1],a2:J[2]??"",a:J,n:null},z===void 0?s.set(N,z={e:[],miss:0,skip:0,at:0}):++z.miss>ZS&&(z.miss=ZS,z.skip=kj,z.e.length=0,z.at=0);const Y=z.e;Y.length<Pj?Y.push(F):(Y[z.at]=F,z.at=z.at+1&255),++c>1e3&&(c=0,u=s,s=new Map)}return d!==null&&d!==F&&(d.n=F),d=F,F.r},R=T=>Array.isArray(T)?C(T.slice(),!1):e(gh(T,!0));return function(T,O,M){const A=arguments.length;if((A|1)===3){const j=d;if(j!==null){const D=j.n;if(D!==null&&x(D,T,O,M))return d=D,D.r;if(j!==D&&x(j,T,O,M))return j.r}if(A===2&&typeof O=="string"&&O!==""){const D=s.get(T);if(D!==void 0&&D.skip>0)return D.skip--,d=null,b(O,T,!0)}return C([T,O,M],!0)}if(A===1)return typeof T=="string"?e(T):R(T);const N=d;if(N!==null){const j=N.n;if(j!==null){const D=j.a;let z=0,F=!0;for(let G=0;G<A;G++){const J=arguments[G];if(J){if(J!==D[z]){F=!1;break}z++}}if(F&&z===j.t)return d=j,j.r}if(N!==j){const D=N.a;let z=0,F=!0;for(let G=0;G<A;G++){const J=arguments[G];if(J){if(J!==D[z]){F=!1;break}z++}}if(F&&z===N.t)return N.r}}const k=[];for(let j=0;j<A;j++)k.push(arguments[j]);return C(k,!0)}},JS=Nj(Aj),Ze=Lj(JS.mergeString,JS);function zj({delay:e=0,...n}){return S.jsx(ij,{"data-slot":"tooltip-provider",delay:e,...n})}function mh({...e}){return S.jsx(zI,{"data-slot":"tooltip",...e})}function yh({...e}){return S.jsx(FI,{"data-slot":"tooltip-trigger",...e})}function vh({className:e,side:n="top",sideOffset:o=4,align:a="center",alignOffset:s=0,children:u,...c}){return S.jsx(qI,{children:S.jsx(rj,{align:a,alignOffset:s,side:n,sideOffset:o,className:"isolate z-50",children:S.jsxs(oj,{"data-slot":"tooltip-content",className:Ze("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...c,children:[u,S.jsx(aj,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 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 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"})]})})})}var _j=(e,n,o,a,s,u,c,d)=>{let p=document.documentElement,g=["light","dark"];function y(x){(Array.isArray(e)?e:[e]).forEach(w=>{let C=w==="class",R=C&&u?s.map(T=>u[T]||T):s;C?(p.classList.remove(...R),p.classList.add(u&&u[x]?u[x]:x)):p.setAttribute(w,x)}),h(x)}function h(x){d&&g.includes(x)&&(p.style.colorScheme=x)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(a)y(a);else try{let x=localStorage.getItem(n)||o,w=c&&x==="system"?b():x;y(w)}catch{}},Hj=v.createContext(void 0),Uj={setTheme:e=>{},themes:[]},Fj=()=>{var e;return(e=v.useContext(Hj))!=null?e:Uj};v.memo(({forcedTheme:e,storageKey:n,attribute:o,enableSystem:a,enableColorScheme:s,defaultTheme:u,value:c,themes:d,nonce:p,scriptProps:g})=>{let y=JSON.stringify([o,n,u,e,d,c,a,s]).slice(1,-1);return v.createElement("script",{...g,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${_j.toString()})(${y})`}})});function Bj(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}const Vj=e=>{switch(e){case"success":return Kj;case"info":return $j;case"warning":return Gj;case"error":return Xj;default:return null}},qj=Array(12).fill(0),Yj=({visible:e,className:n})=>Ne.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Ne.createElement("div",{className:"sonner-spinner"},qj.map((o,a)=>Ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),Kj=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ne.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"})),Gj=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ne.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"})),$j=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ne.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"})),Xj=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ne.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"})),Qj=Ne.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","aria-hidden":"true"},Ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Zj=()=>{const[e,n]=Ne.useState(document.hidden);return Ne.useEffect(()=>{const o=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)},[]),e};let Jj=1;const Wj=100,WS=e=>{var n;return typeof e?.id=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:Jj++};class eP{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(o=>n(o)),()=>{const o=this.subscribers.indexOf(n);this.subscribers.splice(o,1)}),this.publish=n=>{this.subscribers.forEach(o=>o(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-Wj;n<=0||(this.toasts=this.toasts.filter(o=>n>0&&this.dismissedToasts.has(o.id)?(this.dismissedToasts.delete(o.id),n--,!1):!0))},this.create=n=>{const{message:o,...a}=n,s=WS(n),u=this.pendingDismissals.get(s);u!==void 0&&(cancelAnimationFrame(u),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const c=this.dismissedToasts.has(s),d=n.dismissible===void 0?!0:n.dismissible;return c&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(g=>g.id!==s)),(c?void 0:this.toasts.find(g=>g.id===s))?this.toasts=this.toasts.map(g=>g.id===s?(this.publish({...g,...n,id:s,title:o}),{...g,...n,id:s,dismissible:d,title:o}):g):this.addToast({title:o,...a,dismissible:d,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(a=>{this.dismissedToasts.add(a.id),this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const o=this.pendingDismissals.get(n);return o!==void 0&&cancelAnimationFrame(o),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(a=>a({id:n,dismiss:!0}))})),n},this.message=(n,o)=>this.create({...o,message:n,type:void 0}),this.error=(n,o)=>this.create({...o,message:n,type:"error"}),this.success=(n,o)=>this.create({...o,type:"success",message:n}),this.info=(n,o)=>this.create({...o,type:"info",message:n}),this.warning=(n,o)=>this.create({...o,type:"warning",message:n}),this.loading=(n,o)=>this.create({...o,type:"loading",message:n}),this.promise=(n,o)=>{if(!o)return;let a;o.loading!==void 0&&(a=this.create({...o,promise:n,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let u=a!==void 0,c;const d=s.then(async g=>{if(c=["resolve",g],Ne.isValidElement(g))u=!1,this.create({id:a,type:"default",message:g});else if(nP(g)&&!g.ok){u=!1;const h=typeof o.error=="function"?await o.error(`HTTP error! status: ${g.status}`):o.error,b=typeof o.description=="function"?await o.description(`HTTP error! status: ${g.status}`):o.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:a,type:"error",description:b,...w})}else if(g instanceof Error){u=!1;const h=typeof o.error=="function"?await o.error(g):o.error,b=typeof o.description=="function"?await o.description(g):o.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:a,type:"error",description:b,...w})}else if(o.success!==void 0){u=!1;const h=typeof o.success=="function"?await o.success(g):o.success,b=typeof o.description=="function"?await o.description(g):o.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:a,type:"success",description:b,...w})}}).catch(async g=>{if(c=["reject",g],o.error!==void 0){u=!1;const y=typeof o.error=="function"?await o.error(g):o.error,h=typeof o.description=="function"?await o.description(g):o.description,x=typeof y=="object"&&!Ne.isValidElement(y)?y:{message:y};this.create({id:a,type:"error",description:h,...x})}}).finally(()=>{u&&(this.dismiss(a),a=void 0),o.finally==null||o.finally.call(o)}),p=()=>new Promise((g,y)=>d.then(()=>c[0]==="reject"?y(c[1]):g(c[1])).catch(y));return typeof a!="string"&&typeof a!="number"?{unwrap:p}:Object.assign(a,{unwrap:p})},this.custom=(n,o)=>{const a=WS(o);return this.create({...o,jsx:n(a),id:a,type:void 0}),a},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Gr=new eP,tP=(e,n)=>Gr.message(e,n),nP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",rP=tP,oP=()=>Gr.toasts,aP=()=>Gr.getActiveToasts(),_n=Object.assign(rP,{success:Gr.success,info:Gr.info,warning:Gr.warning,error:Gr.error,custom:Gr.custom,message:Gr.message,promise:Gr.promise,dismiss:Gr.dismiss,loading:Gr.loading},{getHistory:oP,getToasts:aP});Bj("[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;flex:1;min-width:0}[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(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);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]{-webkit-user-select:none;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 Cf(e){return e.label!==void 0}const iP=3,sP="24px",lP="16px",ew=4e3,uP=356,cP=14,dP=45,fP=200;function ia(...e){return e.filter(Boolean).join(" ")}function hP(e){const[n,o]=e.split("-"),a=[];return n&&a.push(n),o&&a.push(o),a}const pP=e=>{var n,o,a,s,u,c,d,p,g;const{invert:y,toast:h,unstyled:b,interacting:x,setHeights:w,visibleToasts:C,heights:R,index:T,toasts:O,expanded:M,removeToast:A,defaultRichColors:N,closeButton:k,style:j,cancelButtonStyle:D,actionButtonStyle:z,className:F="",descriptionClassName:G="",duration:J,position:Y,gap:U,expandByDefault:H,classNames:L,icons:$,closeButtonAriaLabel:K="Close toast"}=e,[V,X]=Ne.useState(null),[ee,q]=Ne.useState(null),[se,I]=Ne.useState(!1),[B,W]=Ne.useState(!1),[re,Re]=Ne.useState(!1),[le,me]=Ne.useState(!1),[ge,ce]=Ne.useState(!1),[Te,ve]=Ne.useState(0),[ke,Me]=Ne.useState(0),Le=Ne.useRef(h.duration||J||ew),Fe=Ne.useRef(null),Oe=Ne.useRef(null),He=T===0,be=T+1<=C,Ue=h.type,Qe=Ue??"default",it=h.dismissible!==!1,de=h.className||"",we=h.descriptionClassName||"",Ke=Ne.useMemo(()=>R.findIndex(je=>je.toastId===h.id)||0,[R,h.id]),De=Ne.useMemo(()=>{var je;return(je=h.closeButton)!=null?je:k},[h.closeButton,k]),Ie=Ne.useMemo(()=>h.duration||J||ew,[h.duration,J]),yt=Ne.useRef(0),ut=Ne.useRef(0),ht=Ne.useRef(0),Ot=Ne.useRef(null),[Dt,Wt]=Y.split("-"),rn=Ne.useMemo(()=>R.reduce((je,at,Pe)=>Pe>=Ke?je:je+at.height,0),[R,Ke]),en=Zj(),We=Ne.useMemo(()=>{var je;return(je=e.swipeDirections)!=null?je:hP(Y)},[e.swipeDirections,Y]),xt=h.invert||y,$t=Ue==="loading";ut.current=Ne.useMemo(()=>Ke*U+rn,[Ke,rn]),Ne.useEffect(()=>{Le.current=Ie},[Ie]),Ne.useEffect(()=>{I(!0)},[]),Ne.useEffect(()=>{const je=Oe.current;if(je){const at=je.getBoundingClientRect().height;return Me(at),w(Pe=>[{toastId:h.id,height:at,position:h.position},...Pe]),()=>w(Pe=>Pe.filter(ze=>ze.toastId!==h.id))}},[w,h.id]),Ne.useLayoutEffect(()=>{if(!se)return;const je=Oe.current,at=je.style.height;je.style.height="auto";const Pe=je.getBoundingClientRect().height;je.style.height=at,Me(Pe),w(ze=>ze.find(et=>et.toastId===h.id)?ze.map(et=>et.toastId===h.id?{...et,height:Pe}:et):[{toastId:h.id,height:Pe,position:h.position},...ze])},[se,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const ft=Ne.useCallback(()=>{W(!0),ve(ut.current),w(je=>je.filter(at=>at.toastId!==h.id)),setTimeout(()=>{A(h)},fP)},[h,A,w,ut]);Ne.useEffect(()=>{if(h.promise&&Ue==="loading"||h.duration===1/0||h.type==="loading")return;let je;return M||x||en?(()=>{if(ht.current<yt.current){const ze=new Date().getTime()-yt.current;Le.current=Le.current-ze}ht.current=new Date().getTime()})():Le.current!==1/0&&(yt.current=new Date().getTime(),je=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),ft()},Le.current)),()=>clearTimeout(je)},[M,x,h,Ue,en,ft]),Ne.useEffect(()=>{h.delete&&(ft(),h.onDismiss==null||h.onDismiss.call(h,h))},[ft,h.delete]);function vt(){var je;if($?.loading){var at;return Ne.createElement("div",{className:ia(L?.loader,h==null||(at=h.classNames)==null?void 0:at.loader,"sonner-loader"),"data-visible":Ue==="loading"},$.loading)}return Ne.createElement(Yj,{className:ia(L?.loader,h==null||(je=h.classNames)==null?void 0:je.loader),visible:Ue==="loading"})}const gt=h.icon||$?.[Ue]||Vj(Ue);var kt,un;return Ne.createElement("li",{tabIndex:0,ref:Oe,className:ia(F,de,L?.toast,h==null||(n=h.classNames)==null?void 0:n.toast,L?.[Qe],h==null||(o=h.classNames)==null?void 0:o[Qe]),"data-sonner-toast":"","data-rich-colors":(kt=h.richColors)!=null?kt:N,"data-styled":!(h.jsx||h.unstyled||b),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":ge,"data-removed":B,"data-visible":be,"data-y-position":Dt,"data-x-position":Wt,"data-index":T,"data-front":He,"data-swiping":re,"data-dismissible":it,"data-type":Ue,"data-invert":xt,"data-swipe-out":le,"data-swipe-direction":ee,"data-expanded":!!(M||H&&se),"data-testid":h.testId,style:{"--index":T,"--toasts-before":T,"--z-index":O.length-T,"--offset":`${B?Te:ut.current}px`,"--initial-height":H?"auto":`${ke}px`,...j,...h.style},onDragEnd:()=>{Re(!1),X(null),Ot.current=null},onPointerDown:je=>{je.button!==2&&($t||!it||(Fe.current=new Date,ve(ut.current),je.target.setPointerCapture(je.pointerId),je.target.tagName!=="BUTTON"&&(Re(!0),Ot.current={x:je.clientX,y:je.clientY})))},onPointerUp:()=>{var je,at,Pe;if(le||!it)return;Ot.current=null;const ze=Number(((je=Oe.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ge=Number(((at=Oe.current)==null?void 0:at.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),et=new Date().getTime()-((Pe=Fe.current)==null?void 0:Pe.getTime()),Et=V==="x"?ze:Ge,_=Math.abs(Et)/et;if((V==="x"?We.includes(ze>0?"right":"left"):We.includes(Ge>0?"bottom":"top"))&&(Math.abs(Et)>=dP||_>.11)){ve(ut.current),h.onDismiss==null||h.onDismiss.call(h,h),q(V==="x"?ze>0?"right":"left":Ge>0?"down":"up"),ft(),me(!0);return}else{var ne,ye;(ne=Oe.current)==null||ne.style.setProperty("--swipe-amount-x","0px"),(ye=Oe.current)==null||ye.style.setProperty("--swipe-amount-y","0px")}ce(!1),Re(!1),X(null)},onPointerMove:je=>{var at,Pe,ze;if(!Ot.current||!it||((at=window.getSelection())==null?void 0:at.toString().length)>0)return;const et=je.clientY-Ot.current.y,Et=je.clientX-Ot.current.x;!V&&(Math.abs(Et)>1||Math.abs(et)>1)&&X(Math.abs(Et)>Math.abs(et)?"x":"y");let _={x:0,y:0};const Z=ne=>1/(1.5+Math.abs(ne)/20);if(V==="y"){if(We.includes("top")||We.includes("bottom"))if(We.includes("top")&&et<0||We.includes("bottom")&&et>0)_.y=et;else{const ne=et*Z(et);_.y=Math.abs(ne)<Math.abs(et)?ne:et}}else if(V==="x"&&(We.includes("left")||We.includes("right")))if(We.includes("left")&&Et<0||We.includes("right")&&Et>0)_.x=Et;else{const ne=Et*Z(Et);_.x=Math.abs(ne)<Math.abs(Et)?ne:Et}(Math.abs(_.x)>0||Math.abs(_.y)>0)&&ce(!0),(Pe=Oe.current)==null||Pe.style.setProperty("--swipe-amount-x",`${_.x}px`),(ze=Oe.current)==null||ze.style.setProperty("--swipe-amount-y",`${_.y}px`)}},De&&!h.jsx&&Ue!=="loading"?Ne.createElement("button",{"aria-label":K,"data-disabled":$t,"data-close-button":!0,onClick:$t||!it?()=>{}:()=>{ft(),h.onDismiss==null||h.onDismiss.call(h,h)},className:ia(L?.closeButton,h==null||(a=h.classNames)==null?void 0:a.closeButton)},(un=$?.close)!=null?un:Qj):null,(Ue||h.icon||h.promise)&&h.icon!==null&&($?.[Ue]!==null||h.icon)?Ne.createElement("div",{"data-icon":"",className:ia(L?.icon,h==null||(s=h.classNames)==null?void 0:s.icon)},Ue==="loading"?h.icon||vt():h.promise?vt():null,Ue!=="loading"?gt:null):null,Ne.createElement("div",{"data-content":"",className:ia(L?.content,h==null||(u=h.classNames)==null?void 0:u.content)},Ne.createElement("div",{"data-title":"",className:ia(L?.title,h==null||(c=h.classNames)==null?void 0:c.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Ne.createElement("div",{"data-description":"",className:ia(G,we,L?.description,h==null||(d=h.classNames)==null?void 0:d.description)},typeof h.description=="function"?h.description():h.description):null),Ne.isValidElement(h.cancel)?h.cancel:h.cancel&&Cf(h.cancel)?Ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||D,onClick:je=>{Cf(h.cancel)&&it&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,je),ft())},className:ia(L?.cancelButton,h==null||(p=h.classNames)==null?void 0:p.cancelButton)},h.cancel.label):null,Ne.isValidElement(h.action)?h.action:h.action&&Cf(h.action)?Ne.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||z,onClick:je=>{Cf(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,je),!je.defaultPrevented&&ft())},className:ia(L?.actionButton,h==null||(g=h.classNames)==null?void 0:g.actionButton)},h.action.label):null)};function tw(){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 gP(e,n){const o={};return[e,n].forEach((a,s)=>{const u=s===1,c=u?"--mobile-offset":"--offset",d=u?lP:sP;function p(g){["top","right","bottom","left"].forEach(y=>{o[`${c}-${y}`]=typeof g=="number"?`${g}px`:g})}typeof a=="number"||typeof a=="string"?p(a):typeof a=="object"?["top","right","bottom","left"].forEach(g=>{a[g]===void 0?o[`${c}-${g}`]=d:o[`${c}-${g}`]=typeof a[g]=="number"?`${a[g]}px`:a[g]}):p(d)}),o}const mP=Ne.forwardRef(function(n,o){const{id:a,invert:s,position:u="bottom-right",hotkey:c=["altKey","KeyT"],expand:d,closeButton:p,className:g,offset:y,mobileOffset:h,theme:b="light",richColors:x,duration:w,style:C,visibleToasts:R=iP,toastOptions:T,dir:O=tw(),gap:M=cP,icons:A,customAriaLabel:N,containerAriaLabel:k="Notifications"}=n,[j,D]=Ne.useState([]),z=Ne.useMemo(()=>a?j.filter(I=>I.toasterId===a):j.filter(I=>!I.toasterId),[j,a]),F=Ne.useMemo(()=>Array.from(new Set([u].concat(z.filter(I=>I.position).map(I=>I.position)))),[z,u]),[G,J]=Ne.useState([]),[Y,U]=Ne.useState(!1),[H,L]=Ne.useState(!1),[$,K]=Ne.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=Ne.useRef(null),X=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=Ne.useRef(null),q=Ne.useRef(!1),se=Ne.useCallback(I=>{D(B=>{var W;return(W=B.find(re=>re.id===I.id))!=null&&W.delete||Gr.dismiss(I.id),B.filter(({id:re})=>re!==I.id)})},[]);return Ne.useEffect(()=>Gr.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{D(B=>B.map(W=>W.id===I.id?{...W,delete:!0}:W))});return}setTimeout(()=>{r3.flushSync(()=>{D(B=>{const W=B.findIndex(re=>re.id===I.id);return W!==-1?[...B.slice(0,W),{...B[W],...I},...B.slice(W+1)]:[I,...B]})})})}),[]),Ne.useEffect(()=>{if(b!=="system"){K(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:B})=>{K(B?"dark":"light")})}catch{I.addListener(({matches:W})=>{try{K(W?"dark":"light")}catch(re){console.error(re)}})}},[b]),Ne.useEffect(()=>{j.length<=1&&U(!1)},[j]),Ne.useEffect(()=>{const I=B=>{var W;if(c.length>0&&c.every(le=>B[le]||B.code===le)){var Re;U(!0),(Re=V.current)==null||Re.focus()}B.code==="Escape"&&(document.activeElement===V.current||(W=V.current)!=null&&W.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[c]),Ne.useEffect(()=>{if(V.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,q.current=!1)}},[V.current]),Ne.createElement("section",{ref:o,"aria-label":N??`${k} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},F.map((I,B)=>{var W;const[re,Re]=I.split("-");return z.length?Ne.createElement("ol",{key:I,dir:O==="auto"?tw():O,tabIndex:-1,ref:V,className:g,"data-sonner-toaster":!0,"data-sonner-theme":$,"data-y-position":re,"data-x-position":Re,style:{"--front-toast-height":`${((W=G[0])==null?void 0:W.height)||0}px`,"--width":`${uP}px`,"--gap":`${M}px`,...C,...gP(y,h)},onBlur:le=>{q.current&&!le.currentTarget.contains(le.relatedTarget)&&(q.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||q.current||(q.current=!0,ee.current=le.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{H||U(!1)},onDragEnd:()=>U(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},z.filter(le=>!le.position&&B===0||le.position===I).map((le,me)=>{var ge,ce;return Ne.createElement(pP,{key:le.id,icons:A,index:me,toast:le,defaultRichColors:x,duration:(ge=T?.duration)!=null?ge:w,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:s,visibleToasts:R,closeButton:(ce=T?.closeButton)!=null?ce:p,interacting:H,position:I,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:se,toasts:z.filter(Te=>Te.position==le.position),heights:G.filter(Te=>Te.position==le.position),setHeights:J,expandByDefault:d,gap:M,expanded:Y,swipeDirections:n.swipeDirections})})):null}))}),yP=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join("-").toLowerCase();function vP(e,n,o=[]){if(n==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:yP(e),size:24,node:n,...o.length>0?{aliases:o}:{}}}const bP=e=>{let n="",o=!1;for(const a of e){if(a==="-"||a==="_"||a<=" "){o=n.length>0;continue}n.length===0?n+=a.toLowerCase():n+=o?a.toUpperCase():a,o=!1}return n},xP=e=>{const n=bP(e);return n.charAt(0).toUpperCase()+n.slice(1)},ny=(...e)=>{const n=new Set;for(const o of e)if(typeof o=="string")for(const a of o.split(/\s+/))a&&n.add(a);return[...n].join(" ")},fl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function T0(e){return e!=null}function SP(e,n={}){const o=n.attributeNames??{},a=b=>o[b]??b,s=e.size??e.width??fl.width,u=e.size??e.height??fl.height,c=e.aliases?.filter(b=>typeof b=="string"&&b.trim()!=="").map(b=>`lucide-${b}`)??[],d=[...e.name?[`lucide-${e.name}`]:[],...c],p=n.className?.split(" ").filter(Boolean)??[],g=n.includeDefaultClasses===!1?ny(...p):ny("lucide",...d,...p);let y=n.strokeWidth??fl["stroke-width"];if(n.absoluteStrokeWidth){const b=Number(y)*Number(e.size??e.width??fl.width)/Number(n.size??n.width??fl.width);Number.isFinite(b)&&(y=b)}return["svg",{...Object.entries(fl).reduce((b,[x,w])=>(b[a(x)]=w,b),{}),..."color"in n&&n.color&&{[a("stroke")]:n.color},..."size"in n&&T0(n.size)&&{[a("width")]:n.size,[a("height")]:n.size},..."width"in n&&T0(n.width)&&{[a("width")]:n.width},..."height"in n&&T0(n.height)&&{[a("height")]:n.height},[a("stroke-width")]:y,...g&&{[a("class")]:g},[a("viewBox")]:`0 0 ${s} ${u}`,...n.hasA11yProp===!1?{[a("aria-hidden")]:"true"}:{},..."attributes"in n&&n.attributes},e.node.map(b=>{const[x,w,C]=b,R=n.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...w}:w;return C?[x,R,C]:[x,R]})]}function wP(e,n={}){return SP(e,{...n,attributeNames:{...n.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const RP=e=>{if(e==null||typeof e!="object")return!1;for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&(n.startsWith("aria-")||n==="role"||n==="title")&&e[n]!=null)return!0;return!1},EP=v.createContext({}),CP=()=>v.useContext(EP),TP=v.forwardRef(({color:e,size:n,width:o,height:a,strokeWidth:s,absoluteStrokeWidth:u,nonScalingStroke:c,className:d="",children:p,iconNode:g=[],icon:y={node:g,aliases:[],size:24},...h},b)=>{const{size:x=24,strokeWidth:w=2,absoluteStrokeWidth:C=!1,nonScalingStroke:R=!1,color:T="currentColor",className:O=""}=CP()??{},M=!!p||RP(h),[A,N,k=[]]=wP(y,{color:e??T,width:o??n??x,height:a??n??x,strokeWidth:s??w,absoluteStrokeWidth:u??C,nonScalingStroke:c??R,className:ny(O,d),hasA11yProp:M,attributes:h});return v.createElement(A,{ref:b,...N},[...k.map(([j,D])=>v.createElement(j,D)),...Array.isArray(p)?p:[p]])});function Ft(e,n=[],o=[]){const a=typeof e=="string"?vP(e,n,o):e,s=v.forwardRef(({className:u,...c},d)=>v.createElement(TP,{ref:d,icon:a,className:u,...c}));return a.name&&(s.displayName=xP(a.name)),s}const uC={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};uC.node;const OP=Ft(uC),cC={name:"bot",size:24,node:[["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"}]]};cC.node;const dC=Ft(cC),fC={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};fC.node;const cp=Ft(fC),hC={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};hC.node;const pC=Ft(hC),gC={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};gC.node;const MP=Ft(gC),mC={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};mC.node;const AP=Ft(mC),yC={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};yC.node;const DP=Ft(yC),vC={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5",key:"1awbb0"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};vC.node;const NP=Ft(vC),bC={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};bC.node;const IP=Ft(bC),xC={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};xC.node;const SC=Ft(xC),wC={name:"ellipsis",size:24,node:[["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"}]],aliases:["more-horizontal"]};wC.node;const jP=Ft(wC),RC={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};RC.node;const PP=Ft(RC),EC={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};EC.node;const kP=Ft(EC),CC={name:"file-input",size:24,node:[["path",{d:"M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-1",key:"1q9hii"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]};CC.node;const TC=Ft(CC),OC={name:"file-output",size:24,node:[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]]};OC.node;const MC=Ft(OC),AC={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};AC.node;const LP=Ft(AC),DC={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};DC.node;const zP=Ft(DC),NC={name:"grip-vertical",size:24,node:[["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"}]]};NC.node;const ov=Ft(NC),IC={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};IC.node;const _P=Ft(IC),jC={name:"languages",size:24,node:[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]};jC.node;const HP=Ft(jC),PC={name:"layout-dashboard",size:24,node:[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]};PC.node;const UP=Ft(PC),kC={name:"library-big",size:24,node:[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]]};kC.node;const FP=Ft(kC),LC={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};LC.node;const Fl=Ft(LC),zC={name:"lock-keyhole",size:24,node:[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]};zC.node;const BP=Ft(zC),_C={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};_C.node;const VP=Ft(_C),HC={name:"octagon-x",size:24,node:[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-octagon"]};HC.node;const qP=Ft(HC),UC={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]};UC.node;const YP=Ft(UC),FC={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};FC.node;const KP=Ft(FC),BC={name:"pencil",size:24,node:[["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"}]]};BC.node;const GP=Ft(BC),VC={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};VC.node;const qC=Ft(VC),YC={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};YC.node;const $P=Ft(YC),KC={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};KC.node;const GC=Ft(KC),$C={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};$C.node;const XP=Ft($C),XC={name:"settings",size:24,node:[["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"}]]};XC.node;const QP=Ft(XC),QC={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};QC.node;const ZP=Ft(QC),ZC={name:"trash",size:24,node:[["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"}]],aliases:["trash-2"]};ZC.node;const JP=Ft(ZC),JC={name:"triangle-exclamation-point",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle","triangle-alert"]};JC.node;const WP=Ft(JC),WC={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};WC.node;const Rs=Ft(WC),ek=({...e})=>{const{theme:n="system"}=Fj();return S.jsx(mP,{theme:n,className:"toaster group",icons:{success:S.jsx(DP,{className:"size-4"}),info:S.jsx(_P,{className:"size-4"}),warning:S.jsx(WP,{className:"size-4"}),error:S.jsx(qP,{className:"size-4"}),loading:S.jsx(Fl,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e})},eT=v.createContext(void 0),Ba=e=>{const n=v.useContext(eT);if(e)return e;if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},tk=({client:e,children:n})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),S.jsx(eT.Provider,{value:e,children:n})),nk={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var rk=class{#e=nk;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}};const cs=new rk;function ok(e){setTimeout(e,0)}const ak=typeof window>"u"||"Deno"in globalThis;function kr(){}function ik(e,n){return typeof e=="function"?e(n):e}function tT(e){return typeof e=="number"&&e>=0&&e!==1/0}function nT(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Pn(e,n){return typeof e=="function"?e(n):e}function nw(e,n){const{type:o="all",exact:a,fetchStatus:s,predicate:u,queryKey:c,stale:d}=e;if(c){if(a){if(n.queryHash!==av(c,n.options))return!1}else if(!kl(n.queryKey,c))return!1}if(o!=="all"){const p=n.isActive();if(o==="active"&&!p||o==="inactive"&&p)return!1}return!(typeof d=="boolean"&&n.isStale()!==d||s&&s!==n.state.fetchStatus||u&&!u(n))}function rw(e,n){const{exact:o,status:a,predicate:s,mutationKey:u}=e;if(u){if(!n.options.mutationKey)return!1;if(o){if(vs(n.options.mutationKey)!==vs(u))return!1}else if(!kl(n.options.mutationKey,u))return!1}return!(a&&n.state.status!==a||s&&!s(n))}function av(e,n){return(n?.queryKeyHashFn||vs)(e)}function vs(e){return JSON.stringify(e,(n,o)=>ry(o)?Object.keys(o).sort().reduce((a,s)=>(a[s]=o[s],a),{}):o)}function kl(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){if(n.length>e.length)return!1;for(let a=0;a<n.length;a++)if(!kl(e[a],n[a]))return!1;return!0}const o=Object.keys(n);for(const a of o)if(!kl(e[a],n[a]))return!1;return!0}return!1}const sk=Object.prototype.hasOwnProperty;function iv(e,n,o=0){if(e===n)return e;if(o>500)return n;const a=ow(e)&&ow(n);if(!a&&!(ry(e)&&ry(n)))return n;const s=(a?e:Object.keys(e)).length,u=a?n:Object.keys(n),c=u.length,d=a?new Array(c):{};let p=0;for(let g=0;g<c;g++){const y=a?g:u[g],h=e[y],b=n[y];if(h===b){d[y]=h,(a?g<s:sk.call(e,y))&&p++;continue}if(h===null||b===null||typeof h!="object"||typeof b!="object"){d[y]=b;continue}const x=iv(h,b,o+1);d[y]=x,x===h&&p++}return s===c&&p===s?e:d}function Kf(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const o in e)if(e[o]!==n[o])return!1;return!0}function ow(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ry(e){if(!aw(e))return!1;const n=Object.getPrototypeOf(e),o=n?.constructor;if(o===void 0)return!0;if(typeof o!="function")return!1;const a=o.prototype;return!(!aw(a)||!a.hasOwnProperty("isPrototypeOf")||n!==Object.prototype)}function aw(e){return Object.prototype.toString.call(e)==="[object Object]"}function lk(e){return new Promise(n=>{cs.setTimeout(n,e)})}function oy(e,n,o){return typeof o.structuralSharing=="function"?o.structuralSharing(e,n):o.structuralSharing!==!1?iv(e,n):n}function uk(e,n,o=0){const a=[...e,n];return o&&a.length>o?a.slice(1):a}function ck(e,n,o=0){const a=[n,...e];return o&&a.length>o?a.slice(0,-1):a}const sv=Symbol();function rT(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===sv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function lv(e,n){return typeof e=="function"?e(...n):!!e}function dk(e,n,o){let a=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=n(),a||(a=!0,s.aborted?o():s.addEventListener("abort",o,{once:!0})),s)}),e}let fk=()=>ak;const uv=()=>fk();var Bl=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(){}},hk=class extends Bl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const cv=new hk,pk=ok;function gk(){let e=[],n=0,o=d=>{d()},a=d=>{d()},s=pk;const u=d=>{n?e.push(d):s(()=>{o(d)})},c=()=>{const d=e;e=[],d.length&&s(()=>{a(()=>{d.forEach(p=>{o(p)})})})};return{batch:d=>{let p;n++;try{p=d()}finally{n--,n||c()}return p},batchCalls:d=>(...p)=>{u(()=>{d(...p)})},schedule:u,setNotifyFunction:d=>{o=d},setBatchNotifyFunction:d=>{a=d},setScheduler:d=>{s=d}}}const Wn=gk();var mk=class extends Bl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),o=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",o)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}};const bh=new mk;function yk(e){return Math.min(1e3*2**e,3e4)}function oT(e){return(e??"online")==="online"?bh.isOnline():!0}var ay=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function aT(e){let n=!1,o=0,a,s="pending",u,c;const d=new Promise((O,M)=>{u=O,c=M});d.catch(kr);const p=()=>s!=="pending",g=O=>{if(!p()){const M=new ay(O);C(M),e.onCancel?.(M)}},y=()=>{n=!0},h=()=>{n=!1},b=()=>cv.isFocused()&&(e.networkMode==="always"||bh.isOnline())&&e.canRun(),x=()=>oT(e.networkMode)&&e.canRun(),w=O=>{p()||(a?.(),s="resolved",u(O))},C=O=>{p()||(a?.(),s="rejected",c(O))},R=O=>new Promise(M=>{a=A=>{(p()||O())&&M(A)},e.onPause?.()}).then(()=>{a=void 0,p()||e.onContinue?.()}),T=()=>{if(p())return;let O;const M=o===0?e.initialPromise:void 0;try{O=M??e.fn()}catch(A){O=Promise.reject(A)}Promise.resolve(O).then(w).catch(A=>{if(p())return;const N=e.retry??(uv()?0:3),k=e.retryDelay??yk,j=typeof k=="function"?k(o,A):k,D=N===!0||typeof N=="number"&&o<N||typeof N=="function"&&N(o,A);if(n||!D){C(A);return}o++,e.onFail?.(o,A),lk(j).then(()=>b()?void 0:R(b)).then(()=>{n?C(A):T()})})};return{promise:d,status:()=>s,cancel:g,continue:()=>(a?.(),d),cancelRetry:y,continueRetry:h,canStart:x,start:()=>(x()?T():R(x).then(T),d)}}var iT=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),tT(this.gcTime)&&(this.#e=cs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(uv()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(cs.clearTimeout(this.#e),this.#e=void 0)}};function vk(e){return{onFetch:(n,o)=>{const a=n.options,s=n.fetchOptions?.meta?.fetchMore?.direction,u=n.state.data?.pages||[],c=n.state.data?.pageParams||[];let d={pages:[],pageParams:[]},p=0;const g=async()=>{let y=!1;const h=w=>{dk(w,()=>n.signal,()=>y=!0)},b=rT(n.options,n.fetchOptions),x=async(w,C,R)=>{if(y)return Promise.reject(n.signal.reason);if(C==null&&w.pages.length)return Promise.resolve(w);const O=(()=>{const k={client:n.client,queryKey:n.queryKey,pageParam:C,direction:R?"backward":"forward",meta:n.options.meta};return h(k),k})(),M=await b(O),{maxPages:A}=n.options,N=R?ck:uk;return{pages:N(w.pages,M,A),pageParams:N(w.pageParams,C,A)}};if(s&&u.length){const w=s==="backward",C=w?bk:iw,R={pages:u,pageParams:c};d=await x(R,C(a,R),w)}else{const w=e??u.length;do{const C=p===0?c[0]===void 0?a.initialPageParam:c[0]:iw(a,d);if(p>0&&C==null)break;d=await x(d,C),p++}while(p<w)}return d};n.options.persister?n.fetchFn=()=>n.options.persister?.(g,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},o):n.fetchFn=g}}}function iw(e,{pages:n,pageParams:o}){const a=n.length-1;return n.length>0?e.getNextPageParam(n[a],n,o[a],o):void 0}function bk(e,{pages:n,pageParams:o}){return n.length>0?e.getPreviousPageParam?.(n[0],n,o[0],o):void 0}var xk=class extends iT{#e;#t;#n;#r;#a;#o;#i;#l;constructor(e){super(),this.#l=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#r=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=lw(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#o?.promise}setOptions(e){if(this.options={...this.#i,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=lw(this.options);n.data!==void 0&&(this.setState(sw(n.data,n.dataUpdatedAt)),this.#t=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,n){const o=oy(this.state.data,e,this.options);return this.#s({data:o,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),o}setState(e){this.#s({type:"setState",state:e})}cancel(e){const n=this.#o?.promise;return this.#o?.cancel(e),n?n.then(kr).catch(kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Pn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sv||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Pn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!nT(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(this.#o&&(this.#l||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#o?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(g=>g.options.queryFn);p&&this.setOptions(p.options)}const o=new AbortController,a=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(this.#l=!0,o.signal)})},s=()=>{const p=rT(this.options,n),y=(()=>{const h={client:this.#a,queryKey:this.queryKey,meta:this.meta};return a(h),h})();return this.#l=!1,this.options.persister?this.options.persister(p,y,this):p(y)},c=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:s};return a(p),p})();(this.#e==="infinite"?vk(this.options.pages):this.options.behavior)?.onFetch(c,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#s({type:"fetch",meta:c.fetchOptions?.meta});const d=this.#o=aT({initialPromise:n?.initialPromise,fn:c.fetchFn,onCancel:p=>{p instanceof ay&&p.revert&&this.setState({...this.#n,fetchStatus:"idle"}),o.abort()},onFail:(p,g)=>{this.#s({type:"failed",failureCount:p,error:g})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const p=await d.start();if(p===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(p),this.#r.config.onSuccess?.(p,this),this.#r.config.onSettled?.(p,this.state.error,this),p}catch(p){if(p instanceof ay){if(p.silent)return this.#o.promise;if(p.revert){if(this.state.data===void 0)throw p;return this.state.data}}throw this.#s({type:"error",error:p}),this.#r.config.onError?.(p,this),this.#r.config.onSettled?.(this.state.data,p,this),p}finally{this.#o===d&&(this.#o=void 0),this.scheduleGc()}}#s(e){const n=o=>{switch(e.type){case"failed":return{...o,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...sT(o.data,this.options),fetchMeta:e.meta??null};case"success":const a={...o,...sw(e.data,e.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?a:void 0,a;case"error":const s=e.error;return{...o,error:s,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...e.state}}};this.state=n(this.state),Wn.batch(()=>{this.observers.slice().forEach(o=>{o.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function sT(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oT(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function sw(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function lw(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,o=n!==void 0,a=o?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:o?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var Sk=class extends Bl{#e;#t=void 0;#n=void 0;#r=void 0;#a;#o;#i;#l;#s;#h;#c;#d;#u;#p=new Set;constructor(e,n){super(),this.options=n,this.#e=e,this.#i=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),uw(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return iy(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return iy(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const n=this.options,o=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),n._defaulted&&!Kf(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const a=this.hasListeners();a&&cw(this.#t,o,this.options,n)&&this.#f(),this.updateResult(),a&&(this.#t!==o||Pn(this.options.enabled,this.#t)!==Pn(n.enabled,this.#t)||Pn(this.options.staleTime,this.#t)!==Pn(n.staleTime,this.#t))&&this.#m();const s=this.#y();a&&(this.#t!==o||Pn(this.options.enabled,this.#t)!==Pn(n.enabled,this.#t)||s!==this.#u)&&this.#v(s)}getOptimisticResult(e){const n=this.#e.getQueryCache().build(this.#e,e),o=this.createResult(n,e);return Kf(this.getCurrentResult(),o)||(this.#r=o,this.#o=this.options,this.#a=this.#t.state),o}getCurrentResult(){return this.#r}trackResult(e,n){return new Proxy(e,{get:(o,a)=>(this.trackProp(a),n?.(a),Reflect.get(o,a))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#e.defaultQueryOptions(e),o=this.#e.getQueryCache().build(this.#e,n);let a=()=>{},s;const u=new Promise(c=>{s=c,a=this.#e.getQueryCache().subscribe(d=>{d.type==="updated"&&d.query.queryHash===o.queryHash&&o.state.data!==void 0&&(a(),c(this.createResult(o,n)))})});return Promise.race([o.fetch(n).then(()=>{const c=this.createResult(o,n);return s?.(c),c}).finally(()=>{a()}),u])}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(e){this.#w();let n=this.#t.fetch(this.options,e);return e?.throwOnError||(n=n.catch(kr)),n}#g(e){return!uv()&&Pn(this.options.enabled,this.#t)!==!1&&tT(e)}#m(){this.#x();const e=Pn(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#g(e))return;const n=nT(this.#r.dataUpdatedAt,e)+1;this.#c=cs.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#y(){return Pn(this.options.refetchInterval,this.#t)??!1}#v(e){this.#S(),this.#u=e,!(this.#u===0||!this.#g(this.#u))&&(this.#d=cs.setInterval(()=>{(this.options.refetchIntervalInBackground||cv.isFocused())&&this.#f()},this.#u))}#b(){this.#m(),this.#v(this.#y())}#x(){this.#c!==void 0&&(cs.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#d!==void 0&&(cs.clearInterval(this.#d),this.#d=void 0)}createResult(e,n){const o=this.#t,a=this.options,s=this.#r,u=this.#a,c=this.#o,d=e!==o?e.state:this.#n,{state:p}=e;let g={...p},y=!1,h;if(n._optimisticResults){const N=this.hasListeners(),k=!N&&uw(e,n),j=N&&cw(e,o,n,a);(k||j)&&(g={...g,...sT(p.data,e.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:b,errorUpdatedAt:x,status:w}=g;h=g.data;let C=!1;if(n.placeholderData!==void 0&&h===void 0&&w==="pending"){let N;s?.isPlaceholderData&&n.placeholderData===c?.placeholderData?(N=s.data,C=!0):N=typeof n.placeholderData=="function"?n.placeholderData(this.#h?.state.data,this.#h):n.placeholderData,N!==void 0&&(w="success",h=oy(s?.data,N,n),y=!0)}if(n.select&&h!==void 0&&!C)if(s&&h===u?.data&&n.select===this.#l)h=this.#s;else try{this.#l=n.select,h=n.select(h),h=oy(s?.data,h,n),this.#s=h,this.#i=null}catch(N){this.#i=N}else h===void 0&&(this.#i=null);this.#i&&(b=this.#i,h=this.#s,x=Date.now(),w="error",y=!1);const R=g.fetchStatus==="fetching",T=w==="pending",O=w==="error",M=T&&R,A=h!==void 0;return{status:w,fetchStatus:g.fetchStatus,isPending:T,isSuccess:w==="success",isError:O,isInitialLoading:M,isLoading:M,data:h,dataUpdatedAt:g.dataUpdatedAt,error:b,errorUpdatedAt:x,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:g.dataUpdateCount>d.dataUpdateCount||g.errorUpdateCount>d.errorUpdateCount,isFetching:R,isRefetching:R&&!T,isLoadingError:O&&!A,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:O&&A,isStale:dv(e,n),refetch:this.refetch,isEnabled:Pn(n.enabled,e)!==!1}}updateResult(){const e=this.#r,n=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#t),Kf(n,e))return;this.#r=n;const a=(()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,u=typeof s=="function"?s():s;if(u==="all"||!u&&!this.#p.size)return!0;const c=new Set(u??this.#p);return this.options.throwOnError&&c.add("error"),Object.keys(this.#r).some(d=>{const p=d;return this.#r[p]!==e[p]&&c.has(p)})})();Wn.batch(()=>{a&&this.listeners.forEach(s=>{s(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const n=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}};function wk(e,n){return Pn(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Pn(n.retryOnMount,e)===!1)}function uw(e,n){return wk(e,n)||e.state.data!==void 0&&iy(e,n,n.refetchOnMount)}function iy(e,n,o){if(Pn(n.enabled,e)!==!1&&Pn(n.staleTime,e)!=="static"){const a=Pn(o,e);return a==="always"||a!==!1&&dv(e,n)}return!1}function cw(e,n,o,a){return(e!==n||Pn(a.enabled,e)===!1)&&(!o.suspense||e.state.status!=="error")&&dv(e,o)}function dv(e,n){return Pn(n.enabled,e)!==!1&&e.isStaleByTime(Pn(n.staleTime,e))}var Rk=class extends iT{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||lT(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){const n=()=>{this.#a({type:"continue"})},o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},a=this.#r=aT({fn:()=>this.options.mutationFn?this.options.mutationFn(e,o):Promise.reject(new Error("No mutationFn found")),onFail:(c,d)=>{this.#a({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#a({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),s=this.state.status==="pending",u=!a.canStart();try{if(s)n();else{this.#a({type:"pending",variables:e,isPaused:u}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,o);const d=await this.options.onMutate?.(e,o);d!==this.state.context&&this.#a({type:"pending",context:d,variables:e,isPaused:u})}const c=await a.start();return await this.#n.config.onSuccess?.(c,e,this.state.context,this,o),await this.options.onSuccess?.(c,e,this.state.context,o),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,o),await this.options.onSettled?.(c,null,e,this.state.context,o),this.#a({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,e,this.state.context,this,o)}catch(d){Promise.reject(d)}try{await this.options.onError?.(c,e,this.state.context,o)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,o)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,o)}catch(d){Promise.reject(d)}throw this.#a({type:"error",error:c}),c}finally{this.#r===a&&(this.#r=void 0),this.#n.runNext(this)}}#a(e){const n=o=>{switch(e.type){case"failed":return{...o,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...o,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:e.error,failureCount:o.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Wn.batch(()=>{this.#t.forEach(o=>{o.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function lT(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ek=class extends Bl{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,n,o){const a=new Rk({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:o});return this.add(a),a}add(e){this.#e.add(e);const n=Tf(e);if(typeof n=="string"){const o=this.#t.get(n);o?o.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=Tf(e);if(typeof n=="string"){const o=this.#t.get(n);if(o)if(o.length>1){const a=o.indexOf(e);a!==-1&&o.splice(a,1)}else o[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Tf(e);if(typeof n=="string"){const o=this.#t.get(n)?.find(a=>a.state.status==="pending");return!o||o===e}else return!0}runNext(e){const n=Tf(e);return typeof n=="string"?this.#t.get(n)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Wn.batch(()=>{const e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(n=>{this.notify({type:"removed",mutation:n})})})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(o=>rw(n,o))}findAll(e={}){return this.getAll().filter(n=>rw(e,n))}notify(e){Wn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Wn.batch(()=>Promise.all(e.map(n=>n.continue().catch(kr))))}};function Tf(e){return e.options.scope?.id}var Ck=class extends Bl{#e;#t=void 0;#n;#r;constructor(n,o){super(),this.#e=n,this.setOptions(o),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){const o=this.options;this.options=this.#e.defaultMutationOptions(n),Kf(this.options,o)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),o?.mutationKey&&this.options.mutationKey&&vs(o.mutationKey)!==vs(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#a())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(n){this.#a(),this.#o(n)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#o()}mutate(n,o){return this.#r=o,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(n)}#a(){const n=this.#n?.state??lT();this.#t={...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset}}#o(n){Wn.batch(()=>{const o=this.#r;if(o&&this.hasListeners()){const a=this.#t.variables,s=this.#t.context,u={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(n?.type==="success"){try{o.onSuccess?.(n.data,a,s,u)}catch(c){Promise.reject(c)}try{o.onSettled?.(n.data,null,a,s,u)}catch(c){Promise.reject(c)}}else if(n?.type==="error"){try{o.onError?.(n.error,a,s,u)}catch(c){Promise.reject(c)}try{o.onSettled?.(void 0,n.error,a,s,u)}catch(c){Promise.reject(c)}}}this.listeners.forEach(a=>{a(this.#t)})})}},uT=class extends Bl{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,n,o){const a=n.queryKey,s=n.queryHash??av(a,n);let u=this.get(s);return u||(u=new xk({client:e,queryKey:a,queryHash:s,options:e.defaultQueryOptions(n),state:o,defaultOptions:e.getQueryDefaults(a)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Wn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(o=>nw(n,o))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(o=>nw(e,o)):n}notify(e){Wn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Wn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Tk=class{#e;#t;#n;#r;#a;#o;#i;#l;constructor(e={}){this.#e=e.queryCache||new uT,this.#t=e.mutationCache||new Ek,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#i=cv.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=bh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#i?.(),this.#i=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),o=this.#e.build(this,n),a=o.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&o.isStaleByTime(Pn(n.staleTime,o))&&this.prefetchQuery(n),Promise.resolve(a))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:o})=>[n,o.data])}setQueryData(e,n,o){const a=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(a.queryHash)?.state.data,u=ik(n,s);if(u!==void 0)return this.#e.build(this,a).setData(u,{...o,manual:!0})}setQueriesData(e,n,o){return Wn.batch(()=>this.#e.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,n,o)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Wn.batch(()=>{n.findAll(e).forEach(o=>{n.remove(o)})})}resetQueries(e,n){const o=this.#e;return Wn.batch(()=>{const a=o.findAll(e),s=new Set(a);return a.forEach(u=>{u.reset()}),this.refetchQueries({type:"active",predicate:u=>s.has(u)},n)})}cancelQueries(e,n={}){const o={revert:!0,...n},a=Wn.batch(()=>this.#e.findAll(e).map(s=>s.cancel(o)));return Promise.all(a).then(kr).catch(kr)}invalidateQueries(e,n={}){return Wn.batch(()=>(this.#e.findAll(e).forEach(o=>{o.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const o={...n,cancelRefetch:n.cancelRefetch??!0},a=Wn.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let u=s.fetch(void 0,o);return o.throwOnError||(u=u.catch(kr)),s.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(a).then(kr)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const o=this.#e.build(this,n),a=o.isStaleByTime(Pn(n.staleTime,o))?await o.fetch(n):o.state.data,s=n.select;return s?s(a):a}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const o=this.#e.build(this,n);return o.isStaleByTime(Pn(n.staleTime,o))?o.fetch(n):Promise.resolve(o.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kr).catch(kr)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kr).catch(kr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return bh.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#r.set(vs(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#r.values()],o={};return n.forEach(a=>{kl(e,a.queryKey)&&Object.assign(o,a.defaultOptions)}),o}setMutationDefaults(e,n){this.#a.set(vs(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#a.values()],o={};return n.forEach(a=>{kl(e,a.mutationKey)&&Object.assign(o,a.defaultOptions)}),o}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=av(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===sv&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const cT=v.createContext(!1),Ok=()=>v.useContext(cT);cT.Provider;function Mk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Ak=v.createContext(Mk()),Dk=()=>v.useContext(Ak),Nk=(e,n,o)=>{const a=o?.state.status==="error"&&typeof e.throwOnError=="function"?lv(e.throwOnError,[o.state.error,o]):e.throwOnError;(e.suspense||a)&&(n.isReset()||(e.retryOnMount=!1))},Ik=e=>{v.useEffect(()=>{e.clearReset()},[e])},jk=({result:e,errorResetBoundary:n,throwOnError:o,query:a,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||lv(o,[e.error,a])),Pk=e=>{if(e.suspense){const o=s=>s==="static"?s:Math.max(s??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...s)=>o(a(...s)):o(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},kk=(e,n)=>e?.suspense&&n.isPending,Lk=(e,n,o)=>n.fetchOptimistic(e).catch(()=>{o.clearReset()});function zk(e,n,o){const a=Ok(),s=Dk(),u=Ba(o),c=u.defaultQueryOptions(e),d=u.getQueryCache().get(c.queryHash),p=e.subscribed!==!1;c._optimisticResults=a?"isRestoring":p?"optimistic":void 0,Pk(c),Nk(c,s,d),Ik(s);const[g]=v.useState(()=>new n(u,c)),y=g.getOptimisticResult(c),h=!a&&p;if(v.useSyncExternalStore(v.useCallback(b=>{const x=h?g.subscribe(Wn.batchCalls(b)):kr;return g.updateResult(),x},[g,h]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),v.useEffect(()=>{g.setOptions(c)},[c,g]),kk(c,y))throw Lk(c,g,s);if(jk({result:y,errorResetBoundary:s,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw y.error;return c.notifyOnChangeProps?y:g.trackResult(y)}function dp(e,n){return zk(e,Sk,n)}function _k(e,n){const o=Ba(n);return Uk({filters:{...e,status:"pending"}},o).length}function Hk(){let e;return(n,o)=>{let a=[],s;return()=>{const u=n.findAll(o.filters),c=u.flatMap(d=>[d,d.state]);return(!s||c.length!==a.length||c.some((d,p)=>!Object.is(d,a[p])))&&(a=c,s=iv(e,u.map(d=>o.select?o.select(d):d.state)),e=s),s}}}function Uk(e={},n){const o=Ba(n).getMutationCache(),[a]=v.useState(()=>Hk()),s=a(o,e);return v.useSyncExternalStore(v.useCallback(u=>o.subscribe(Wn.batchCalls(u)),[o]),s,s)}function Ao(e,n){const o=Ba(n),[a]=v.useState(()=>new Ck(o,e));v.useEffect(()=>{a.setOptions(e)},[a,e]);const s=v.useSyncExternalStore(v.useCallback(c=>a.subscribe(Wn.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),u=v.useCallback((...c)=>{a.mutate(c[0],c[1]).catch(kr)},[a]);if(s.error&&lv(a.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:u,mutateAsync:s.mutate}}var dT=e=>{throw TypeError(e)},fT=(e,n,o)=>n.has(e)||dT("Cannot "+o),Co=(e,n,o)=>(fT(e,n,"read from private field"),o?o.call(e):n.get(e)),Wu=(e,n,o)=>n.has(e)?dT("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,o),sa=(e,n,o,a)=>(fT(e,n,"write to private field"),n.set(e,o),o),fp=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,hp=/^[\\/]{2}/;function hT(e,n){return n+e.replace(/\\/g,"/")}var dw="popstate";function fw(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Fk(e={}){function n(s,u){let{pathname:c="/",search:d="",hash:p=""}=Go(s.location.hash.substring(1));return!c.startsWith("/")&&!c.startsWith(".")&&(c="/"+c),gc("",{pathname:c,search:d,hash:p},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function o(s,u){let c=s.document.querySelector("base"),d="";if(c&&c.getAttribute("href")){let p=s.location.href,g=p.indexOf("#");d=g===-1?p:p.slice(0,g)}return d+"#"+(typeof u=="string"?u:zr(u))}function a(s,u){Un(s.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(u)})`)}return Vk(n,o,a,e)}function zt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Un(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Bk(){return Math.random().toString(36).substring(2,10)}function hw(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function gc(e,n,o=null,a,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?Go(n):n,state:o,key:n&&n.key||a||Bk(),mask:s}}function zr({pathname:e="/",search:n="",hash:o=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),o&&o!=="#"&&(e+=o.charAt(0)==="#"?o:"#"+o),e}function Go(e){let n={};if(e){let o=e.indexOf("#");o>=0&&(n.hash=e.substring(o),e=e.substring(0,o));let a=e.indexOf("?");a>=0&&(n.search=e.substring(a),e=e.substring(0,a)),e&&(n.pathname=e)}return n}function Vk(e,n,o,a={}){let{window:s=document.defaultView,v5Compat:u=!1}=a,c=s.history,d="POP",p=null,g=y();g==null&&(g=0,c.replaceState({...c.state,idx:g},""));function y(){return(c.state||{idx:null}).idx}function h(){d="POP";let R=y(),T=R==null?null:R-g;g=R,p&&p({action:d,location:C.location,delta:T})}function b(R,T){d="PUSH";let O=fw(R)?R:gc(C.location,R,T);o&&o(O,R),g=y()+1;let M=hw(O,g),A=C.createHref(O.mask||O);try{c.pushState(M,"",A)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;s.location.assign(A)}u&&p&&p({action:d,location:C.location,delta:1})}function x(R,T){d="REPLACE";let O=fw(R)?R:gc(C.location,R,T);o&&o(O,R),g=y();let M=hw(O,g),A=C.createHref(O.mask||O);c.replaceState(M,"",A),u&&p&&p({action:d,location:C.location,delta:0})}function w(R){return pT(s,R)}let C={get action(){return d},get location(){return e(s,c)},listen(R){if(p)throw new Error("A history only accepts one active listener");return s.addEventListener(dw,h),p=R,()=>{s.removeEventListener(dw,h),p=null}},createHref(R){return n(s,R)},createURL:w,encodeLocation(R){let T=w(R);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:b,replace:x,go(R){return c.go(R)}};return C}function pT(e,n,o=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),zt(a,"No window.location.(origin|href) available to create URL");let s=typeof n=="string"?n:zr(n);return s=s.replace(/ $/,"%20"),!o&&hp.test(s)&&(s=a+s),new URL(s,a)}var ec,pw=class{constructor(e){if(Wu(this,ec,new Map),e)for(let[n,o]of e)this.set(n,o)}get(e){if(Co(this,ec).has(e))return Co(this,ec).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,n){Co(this,ec).set(e,n)}};ec=new WeakMap;var qk=new Set(["lazy","caseSensitive","path","id","index","children"]);function Yk(e){return qk.has(e)}var Kk=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Gk(e){return Kk.has(e)}function $k(e){return e.index===!0}function mc(e,n,o=[],a={},s=!1){return e.map((u,c)=>{let d=[...o,String(c)],p=typeof u.id=="string"?u.id:d.join("-");if(zt(u.index!==!0||!u.children,"Cannot specify children on an index route"),zt(s||!a[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),$k(u)){let g={...u,id:p};return a[p]=gw(g,n(g)),g}else{let g={...u,id:p,children:void 0};return a[p]=gw(g,n(g)),u.children&&(g.children=mc(u.children,n,d,a,s)),g}})}function gw(e,n){return Object.assign(e,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...e.lazy,...n.lazy}}:{}})}function gT(e,n,o="/"){return Fo(e,n,o,!1)}function Fo(e,n,o,a,s){let u=typeof n=="string"?Go(n):n,c=Io(u.pathname||"/",o);if(c==null)return null;let d=s??Gf(e),p=null,g=a5(c);for(let y=0;p==null&&y<d.length;++y)p=o5(d[y],g,a);return p}function mT(e,n){let{route:o,pathname:a,params:s}=e;return{id:o.id,pathname:a,params:s,data:n[o.id],loaderData:n[o.id],handle:o.handle}}function Gf(e){let n=yT(e);return Xk(n),n}function yT(e,n=[],o=[],a="",s=!1){let u=(c,d,p=s,g)=>{let y={relativePath:g===void 0?c.path||"":g,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&p)return;zt(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let h=Do([a,y.relativePath]),b=o.concat(y);c.children&&c.children.length>0&&(zt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),yT(c.children,n,b,h,p)),!(c.path==null&&!c.index)&&n.push({path:h,score:n5(h,c.index),routesMeta:b.map((x,w)=>{let[C,R]=xT(x.relativePath,x.caseSensitive,w===b.length-1);return{...x,matcher:C,compiledParams:R}})})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))u(c,d);else for(let p of vT(c.path))u(c,d,!0,p)}),n}function vT(e){let n=e.split("/");if(n.length===0)return[];let[o,...a]=n,s=o.endsWith("?"),u=o.replace(/\?$/,"");if(a.length===0)return s?[u,""]:[u];let c=vT(a.join("/")),d=[];return d.push(...c.map(p=>p===""?u:[u,p].join("/"))),s&&d.push(...c),d.map(p=>e.startsWith("/")&&p===""?"/":p)}function Xk(e){e.sort((n,o)=>n.score!==o.score?o.score-n.score:r5(n.routesMeta.map(a=>a.childrenIndex),o.routesMeta.map(a=>a.childrenIndex)))}var Qk=/^:[\w-]+$/,Zk=3,Jk=2,Wk=1,e5=10,t5=-2,mw=e=>e==="*";function n5(e,n){let o=e.split("/"),a=o.length;return o.some(mw)&&(a+=t5),n&&(a+=Jk),o.filter(s=>!mw(s)).reduce((s,u)=>s+(Qk.test(u)?Zk:u===""?Wk:e5),a)}function r5(e,n){return e.length===n.length&&e.slice(0,-1).every((a,s)=>a===n[s])?e[e.length-1]-n[n.length-1]:0}function o5(e,n,o=!1){let{routesMeta:a}=e,s={},u="/",c=[];for(let d=0;d<a.length;++d){let p=a[d],g=d===a.length-1,y=u==="/"?n:n.slice(u.length)||"/",h={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},b=p.matcher&&p.compiledParams?bT(h,y,p.matcher,p.compiledParams):xh(h,y),x=p.route;if(!b&&g&&o&&!a[a.length-1].route.index&&(b=xh({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!b)return null;Object.assign(s,b.params),c.push({params:s,pathname:Do([u,b.pathname]),pathnameBase:l5(Do([u,b.pathnameBase])),route:x}),b.pathnameBase!=="/"&&(u=Do([u,b.pathnameBase]))}return c}function xh(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[o,a]=xT(e.path,e.caseSensitive,e.end);return bT(e,n,o,a)}function bT(e,n,o,a){let s=n.match(o);if(!s)return null;let u=s[0],c=Ll(u,1),d=s.slice(1);return{params:a.reduce((g,{paramName:y,isOptional:h},b)=>{if(y==="*"){let w=d[b]||"";c=Ll(u.slice(0,u.length-w.length),1)}const x=d[b];return h&&!x?g[y]=void 0:g[y]=(x||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:c,pattern:e}}function xT(e,n=!1,o=!0){Un(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 a=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,p,g,y)=>{if(a.push({paramName:d,isOptional:p!=null}),p){let h=y.charAt(g+c.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,n?void 0:"i"),a]}function a5(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Un(!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 (${n}).`),e}}function Io(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let o=n.endsWith("/")?n.length-1:n.length,a=e.charAt(o);return a&&a!=="/"?null:e.slice(o)||"/"}function i5({basename:e,pathname:n}){return n==="/"?e:Do([e,n])}var fv=e=>fp.test(e);function s5(e,n="/"){let{pathname:o,search:a="",hash:s=""}=typeof e=="string"?Go(e):e,u;return o?(o=hv(o),o.startsWith("/")||o.startsWith("\\")?u=yw(o.substring(1),"/"):u=yw(o,n)):u=n,{pathname:u,search:u5(a),hash:c5(s)}}function yw(e,n){let o=Ll(n).split("/");return e.split("/").forEach(s=>{s===".."?o.length>1&&o.pop():s!=="."&&o.push(s)}),o.length>1?o.join("/"):"/"}function O0(e,n,o,a){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ST(e){return e.filter((n,o)=>o===0||n.route.path&&n.route.path.length>0)}function pp(e){let n=ST(e);return n.map((o,a)=>a===n.length-1?o.pathname:o.pathnameBase)}function kc(e,n,o,a=!1){let s;typeof e=="string"?s=Go(e):(s={...e},zt(!s.pathname||!s.pathname.includes("?"),O0("?","pathname","search",s)),zt(!s.pathname||!s.pathname.includes("#"),O0("#","pathname","hash",s)),zt(!s.search||!s.search.includes("#"),O0("#","search","hash",s)));let u=e===""||s.pathname==="",c=u?"/":s.pathname,d;if(c==null)d=o;else{let h=n.length-1;if(!a&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),h-=1;s.pathname=b.join("/")}d=h>=0?n[h]:"/"}let p=s5(s,d),g=c&&c!=="/"&&c.endsWith("/"),y=(u||c===".")&&o.endsWith("/");return!p.pathname.endsWith("/")&&(g||y)&&(p.pathname+="/"),p}var hv=e=>e.replace(/[\\/]{2,}/g,"/"),Do=e=>hv(e.join("/"));function Ll(e,n=0){let o=e.length;for(;o>n&&e.charCodeAt(o-1)===47;)o--;return o===e.length?e:e.slice(0,o)}var l5=e=>Ll(e).replace(/^\/*/,"/"),u5=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,c5=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,d5=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Lc=class{constructor(e,n,o,a=!1){this.status=e,this.statusText=n||"",this.internal=a,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function yc(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function zc(e){let n=e.map(o=>o.route.path).filter(Boolean);return Do(n)||"/"}var wT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function RT(e,n){let o=e;if(typeof o!="string"||!fp.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let a=o,s=!1;if(wT)try{let u=new URL(window.location.href),c=hp.test(o)?new URL(hT(o,u.protocol)):new URL(o),d=Io(c.pathname,n);c.origin===u.origin&&d!=null?o=d+c.search+c.hash:s=!0}catch{Un(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:o}}var Ei=Symbol("Uninstrumented");function f5(e,n){let o={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:n.id,index:n.index,path:n.path,instrument(u){let c=Object.keys(o);for(let d of c)u[d]&&o[d].push(u[d])}}));let a={};if(typeof n.lazy=="function"&&o.lazy.length>0){let s=bl(o.lazy,n.lazy,()=>{});s&&(a.lazy=s)}if(typeof n.lazy=="object"){let s=n.lazy;["middleware","loader","action"].forEach(u=>{let c=s[u],d=o[`lazy.${u}`];if(typeof c=="function"&&d.length>0){let p=bl(d,c,()=>{});p&&(a.lazy=Object.assign(a.lazy||{},{[u]:p}))}})}return["loader","action"].forEach(s=>{let u=n[s];if(typeof u=="function"&&o[s].length>0){let c=u[Ei]??u,d=bl(o[s],c,(...p)=>vw(p[0]));d&&(s==="loader"&&c.hydrate===!0&&(d.hydrate=!0),d[Ei]=c,a[s]=d)}}),n.middleware&&n.middleware.length>0&&o.middleware.length>0&&(a.middleware=n.middleware.map(s=>{let u=s[Ei]??s,c=bl(o.middleware,u,(...d)=>vw(d[0]));return c?(c[Ei]=u,c):s})),a}function h5(e,n){let o={navigate:[],fetch:[]};if(n.forEach(a=>a({instrument(s){let u=Object.keys(s);for(let c of u)s[c]&&o[c].push(s[c])}})),o.navigate.length>0){let a=e.navigate[Ei]??e.navigate,s=bl(o.navigate,a,(...u)=>{let[c,d]=u;return{to:typeof c=="number"||typeof c=="string"?c:c?zr(c):".",...bw(e,d??{})}});s&&(s[Ei]=a,e.navigate=s)}if(o.fetch.length>0){let a=e.fetch[Ei]??e.fetch,s=bl(o.fetch,a,(...u)=>{let[c,,d,p]=u;return{href:d??".",fetcherKey:c,...bw(e,p??{})}});s&&(s[Ei]=a,e.fetch=s)}return e}function bl(e,n,o){return e.length===0?null:async(...a)=>{let s=await ET(e,o(...a),()=>n(...a),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function ET(e,n,o,a){let s=e[a],u;if(s){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=ET(e,n,o,a-1),u=await c,zt(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await s(d,n)}catch(p){console.error("An instrumentation function threw an error:",p)}c||await d(),await c}else try{u={type:"success",value:await o()}}catch(c){u={type:"error",value:c}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function vw(e){let{request:n,context:o,params:a,pattern:s}=e;return{request:p5(n),params:{...a},pattern:s,context:g5(o)}}function bw(e,n){return{currentUrl:zr(e.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function p5(e){return{method:e.method,url:e.url,headers:{get:(...n)=>e.headers.get(...n)}}}function g5(e){if(y5(e)){let n={...e};return Object.freeze(n),n}else return{get:n=>e.get(n)}}var m5=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function y5(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===m5}var xw=new URL("http://localhost");function pv(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),xw)}catch{return xw}}function M0(e,n){return e.origin===n.origin&&(e.origin!=="null"||e.protocol===n.protocol&&e.host===n.host)}function v5(e,n){if(e.startsWith("//"))return!0;let o=n.protocol.toLowerCase();return e.toLowerCase().startsWith(o)?n.host===""||e.slice(o.length).startsWith("//"):!1}function Ol(e,n,o,a){let s=null;try{s=e==null?null:new URL(e,o)}catch{}let u=new URL(n,o),c=s!=null&&!M0(s,o),d=!M0(u,o);if(a==="reject"){if(c||d)throw new Error("External navigation is not allowed")}else if(d&&(s==null||!v5(e,s)||!M0(s,u)))throw new Error("External navigation is not allowed")}var CT=["POST","PUT","PATCH","DELETE"],b5=new Set(CT),x5=["GET",...CT],S5=new Set(x5),TT=new Set([301,302,303,307,308]),w5=new Set([307,308]),A0={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},R5={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Gu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},E5=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),OT="remix-router-transitions",MT=Symbol("ResetLoaderData"),ls,gl,bi,ml,C5=class{constructor(e){Wu(this,ls),Wu(this,gl),Wu(this,bi),Wu(this,ml),sa(this,ls,e),sa(this,gl,Gf(e))}get stableRoutes(){return Co(this,ls)}get activeRoutes(){return Co(this,bi)??Co(this,ls)}get branches(){return Co(this,ml)??Co(this,gl)}get hasHMRRoutes(){return Co(this,bi)!=null}setRoutes(e){sa(this,ls,e),sa(this,gl,Gf(e))}setHmrRoutes(e){sa(this,bi,e),sa(this,ml,Gf(e))}commitHmrRoutes(){Co(this,bi)&&(sa(this,ls,Co(this,bi)),sa(this,gl,Co(this,ml)),sa(this,bi,void 0),sa(this,ml,void 0))}};ls=new WeakMap;gl=new WeakMap;bi=new WeakMap;ml=new WeakMap;function T5(e){const n=e.window?e.window:typeof window<"u"?window:void 0,o=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";zt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],s=e.mapRouteProperties||E5,u=s;if(e.instrumentations){let _=e.instrumentations;u=Z=>({...s(Z),...f5(_.map(ne=>ne.route).filter(Boolean),Z)})}let c={},d=new C5(mc(e.routes,u,void 0,c)),p=e.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=e.dataStrategy||N5,y={...e.future},h=null,b=new Set,x=null,w=null,C=null,R=null,T=e.hydrationData!=null,O=Fo(d.activeRoutes,e.history.location,p,!1,d.branches),M=!1,A=null,N,k;if(O==null&&!e.patchRoutesOnNavigation){let _=To(404,{pathname:e.history.location.pathname}),{matches:Z,route:ne}=Of(d.activeRoutes);N=!0,k=!N,O=Z,A={[ne.id]:_}}else if(O&&!e.hydrationData&&Pe(O,d.activeRoutes,e.history.location.pathname).active&&(O=null),O)if(O.some(_=>_.route.lazy))N=!1,k=!N;else if(!O.some(_=>gv(_.route)))N=!0,k=!N;else{let _=e.hydrationData?e.hydrationData.loaderData:null,Z=e.hydrationData?e.hydrationData.errors:null,ne=O;if(Z){let ye=O.findIndex(xe=>Z[xe.route.id]!==void 0);ne=ne.slice(0,ye+1)}k=!1,N=!0,ne.forEach(ye=>{let xe=AT(ye.route,_,Z);k=k||xe.renderFallback,N=N&&!xe.shouldLoad})}else{N=!1,k=!N,O=[];let _=Pe(null,d.activeRoutes,e.history.location.pathname);_.active&&_.matches&&(M=!0,O=_.matches)}let j,D={historyAction:e.history.action,location:e.history.location,matches:O,initialized:N,renderFallback:k,navigation:A0,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||A,fetchers:new Map,blockers:new Map},z="POP",F=null,G=!1,J,Y=!1,U=new Map,H=null,L=!1,$=!1,K=new Set,V=new Map,X=0,ee=-1,q=new Map,se=new Set,I=new Map,B=new Map,W=new Set,re=new Map,Re,le=null;function me(){if(h=e.history.listen(({action:_,location:Z,delta:ne})=>{if(Re){Re(),Re=void 0;return}Un(re.size===0||ne!=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 ye=vt({currentLocation:D.location,nextLocation:Z,historyAction:_});if(ye&&ne!=null){let xe=new Promise(qe=>{Re=qe});e.history.go(ne*-1),ft(ye,{state:"blocked",location:Z,proceed(){ft(ye,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),xe.then(()=>e.history.go(ne))},reset(){let qe=new Map(D.blockers);qe.set(ye,Gu),Te({blockers:qe})}}),F?.resolve(),F=null;return}return Le(_,Z)}),o){Q5(n,U);let _=()=>Z5(n,U);n.addEventListener("pagehide",_),H=()=>n.removeEventListener("pagehide",_)}return D.initialized||Le("POP",D.location,{initialHydration:!0}),j}function ge(){h&&h(),H&&H(),b.clear(),J&&J.abort(),D.fetchers.forEach((_,Z)=>Ot(D.fetchers,Z)),D.blockers.forEach((_,Z)=>$t(Z))}function ce(_){if(b.add(_),x){let{newErrors:Z}=x;x=null,_(D,{deletedFetchers:[],newErrors:Z,viewTransitionOpts:void 0,flushSync:!1})}return()=>b.delete(_)}function Te(_,Z={}){_.matches&&(_.matches=_.matches.map(xe=>{let qe=c[xe.route.id],Ve=xe.route;return Ve.element!==qe.element||Ve.errorElement!==qe.errorElement||Ve.hydrateFallbackElement!==qe.hydrateFallbackElement?{...xe,route:qe}:xe})),D={...D,..._};let ne=[],ye=[];D.fetchers.forEach((xe,qe)=>{xe.state==="idle"&&(W.has(qe)?ne.push(qe):ye.push(qe))}),W.forEach(xe=>{!D.fetchers.has(xe)&&!V.has(xe)&&ne.push(xe)}),b.size===0&&(x={newErrors:_.errors??null}),[...b].forEach(xe=>xe(D,{deletedFetchers:ne,newErrors:_.errors??null,viewTransitionOpts:Z.viewTransitionOpts,flushSync:Z.flushSync===!0})),ne.forEach(xe=>Ot(D.fetchers,xe)),ye.forEach(xe=>D.fetchers.delete(xe))}function ve(_,Z,{flushSync:ne}={}){let ye=D.actionData!=null&&D.navigation.formMethod!=null&&Er(D.navigation.formMethod)&&D.navigation.state==="loading"&&_.state?._isRedirect!==!0,xe;Z.actionData?Object.keys(Z.actionData).length>0?xe=Z.actionData:xe=null:ye?xe=D.actionData:xe=null;let qe=Z.loaderData?Dw(D.loaderData,Z.loaderData,Z.matches||[],Z.errors):D.loaderData,Ve=D.blockers;Ve.size>0&&(Ve=new Map(Ve),Ve.forEach((tt,St)=>Ve.set(St,Gu)));let Xe=L?!1:at(_,Z.matches||D.matches),$e=G===!0||D.navigation.formMethod!=null&&Er(D.navigation.formMethod)&&_.state?._isRedirect!==!0;d.commitHmrRoutes(),L||z==="POP"||(z==="PUSH"?e.history.push(_,_.state):z==="REPLACE"&&e.history.replace(_,_.state));let st;if(z==="POP"&&!L&&_!==D.location){let tt=U.get(D.location.pathname);tt&&tt.has(_.pathname)?st={currentLocation:D.location,nextLocation:_}:U.has(_.pathname)&&(st={currentLocation:_,nextLocation:D.location})}else if(Y){let tt=U.get(D.location.pathname);tt?tt.add(_.pathname):(tt=new Set([_.pathname]),U.set(D.location.pathname,tt)),st={currentLocation:D.location,nextLocation:_}}Te({...Z,actionData:xe,loaderData:qe,historyAction:z,location:_,initialized:!0,renderFallback:!1,navigation:A0,revalidation:"idle",restoreScrollPosition:Xe,preventScrollReset:$e,blockers:Ve},{viewTransitionOpts:st,flushSync:ne===!0}),z="POP",G=!1,Y=!1,L=!1,$=!1,F?.resolve(),F=null,le?.resolve(),le=null}async function ke(_,Z){if(F?.resolve(),F=null,typeof _=="number"){F||(F=Pw());let _t=F.promise;return e.history.go(_),_t}let ne=sy(D.location,D.matches,p,_,Z?.fromRouteId,Z?.relative),{path:ye,submission:xe,error:qe}=Sw(!1,ne,Z),Ve;if(Z?.mask){let _t=typeof Z.mask=="string"?Go(Z.mask):{...D.location.mask,...Z.mask};if(Ve={pathname:_t.pathname??"",search:_t.search??"",hash:_t.hash??""},hp.test(Ve.pathname))throw new Error("External navigation is not allowed");Ve.pathname.startsWith("\\")&&(Ve.pathname=Ve.pathname.replace(/^\\+/,"/")),Ol(typeof Z.mask=="string"?Z.mask:zr(Z.mask),zr(Ve),e.history.createURL("/"),"reject")}let Xe=D.location,$e=gc(Xe,ye,Z&&Z.state,void 0,Ve);$e={...$e,...e.history.encodeLocation($e)},Ol(_==null?e.history.createHref(D.location):typeof _=="string"?_:zr(_),e.history.createHref($e.mask||$e),e.history.createURL("/"),"reject");let st=Z&&Z.replace!=null?Z.replace:void 0,tt="PUSH";st===!0?tt="REPLACE":st===!1||xe!=null&&Er(xe.formMethod)&&xe.formAction===D.location.pathname+D.location.search&&(tt="REPLACE");let St=Z&&"preventScrollReset"in Z?Z.preventScrollReset===!0:void 0,ct=(Z&&Z.flushSync)===!0,Bt=vt({currentLocation:Xe,nextLocation:$e,historyAction:tt});if(Bt){ft(Bt,{state:"blocked",location:$e,proceed(){ft(Bt,{state:"proceeding",proceed:void 0,reset:void 0,location:$e}),ke(_,Z)},reset(){let _t=new Map(D.blockers);_t.set(Bt,Gu),Te({blockers:_t})}});return}await Le(tt,$e,{submission:xe,pendingError:qe,preventScrollReset:St,replace:Z&&Z.replace,enableViewTransition:Z&&Z.viewTransition,flushSync:ct,callSiteDefaultShouldRevalidate:Z&&Z.defaultShouldRevalidate})}function Me(){le||(le=Pw()),De(),Te({revalidation:"loading"});let _=le.promise;return D.navigation.state==="submitting"?_:D.navigation.state==="idle"?(Le(D.historyAction,D.location,{startUninterruptedRevalidation:!0}),_):(Le(z||D.historyAction,D.navigation.location,{overrideNavigation:D.navigation,enableViewTransition:Y===!0}),_)}async function Le(_,Z,ne){J&&J.abort(),J=null,z=_,L=(ne&&ne.startUninterruptedRevalidation)===!0,je(D.location,D.matches),G=(ne&&ne.preventScrollReset)===!0,Y=(ne&&ne.enableViewTransition)===!0;let ye=d.activeRoutes,xe=ne?.initialHydration&&D.matches&&D.matches.length>0&&!M?D.matches:Fo(ye,Z,p,!1,d.branches),qe=(ne&&ne.flushSync)===!0;if(xe&&D.initialized&&!$&&U5(D.location,Z)&&!(ne&&ne.submission&&Er(ne.submission.formMethod))){ve(Z,{matches:xe},{flushSync:qe});return}let Ve=Pe(xe,ye,Z.pathname);if(Ve.active&&Ve.matches&&(xe=Ve.matches),!xe){let{error:Vt,notFoundMatches:Ht,route:En}=gt(Z.pathname);ve(Z,{matches:Ht,loaderData:{},errors:{[En.id]:Vt}},{flushSync:qe});return}let Xe=ne&&ne.overrideNavigation?{...ne.overrideNavigation,matches:xe,historyAction:_}:void 0;J=new AbortController;let $e=yl(e.history,Z,J.signal,ne&&ne.submission),st=e.getContext?await e.getContext():new pw,tt;if(ne&&ne.pendingError)tt=[wi(xe).route.id,{type:"error",error:ne.pendingError}];else if(ne&&ne.submission&&Er(ne.submission.formMethod)){let Vt=await Fe($e,Z,ne.submission,xe,_,st,Ve.active,ne&&ne.initialHydration===!0,{replace:ne.replace,flushSync:qe});if(Vt.shortCircuited)return;if(Vt.pendingActionResult){let[Ht,En]=Vt.pendingActionResult;if(uo(En)&&yc(En.error)&&En.error.status===404){J=null,ve(Z,{matches:Vt.matches,loaderData:{},errors:{[Ht]:En.error}});return}}xe=Vt.matches||xe,tt=Vt.pendingActionResult,Xe=D0(Z,xe,_,ne.submission),qe=!1,Ve.active=!1,$e=yl(e.history,$e.url,$e.signal)}let{shortCircuited:St,matches:ct,loaderData:Bt,errors:_t,workingFetchers:On}=await Oe($e,Z,xe,_,st,Ve.active,Xe,ne&&ne.submission,ne&&ne.fetcherSubmission,ne&&ne.replace,ne&&ne.initialHydration===!0,qe,tt,ne&&ne.callSiteDefaultShouldRevalidate);St||(J=null,ve(Z,{matches:ct||xe,...Nw(tt),loaderData:Bt,errors:_t,...On?{fetchers:On}:{}}))}async function Fe(_,Z,ne,ye,xe,qe,Ve,Xe,$e={}){De();let st=$5(Z,ye,xe,ne);if(Te({navigation:st},{flushSync:$e.flushSync===!0}),Ve){let ct=await ze(ye,Z.pathname,_.signal);if(ct.type==="aborted")return{shortCircuited:!0};if(ct.type==="error"){if(ct.partialMatches.length===0){let{matches:_t,route:On}=Of(d.activeRoutes);return{matches:_t,pendingActionResult:[On.id,{type:"error",error:ct.error}]}}let Bt=wi(ct.partialMatches).route.id;return{matches:ct.partialMatches,pendingActionResult:[Bt,{type:"error",error:ct.error}]}}else if(ct.matches)ye=ct.matches;else{let{notFoundMatches:Bt,error:_t,route:On}=gt(Z.pathname);return{matches:Bt,pendingActionResult:[On.id,{type:"error",error:_t}]}}}let tt,St=$f(ye,Z);if(!St.route.action&&!St.route.lazy)tt={type:"error",error:To(405,{method:_.method,pathname:Z.pathname,routeId:St.route.id})};else{let ct=Ml(u,c,_,Z,ye,St,Xe?[]:a,qe),Bt=await we(_,Z,ct,qe,null);if(tt=Bt[St.route.id],!tt){for(let _t of ye)if(Bt[_t.route.id]){tt=Bt[_t.route.id];break}}if(_.signal.aborted)return{shortCircuited:!0}}if(ds(tt)){let ct;return $e&&$e.replace!=null?ct=$e.replace:ct=Ow(tt.response.headers.get("Location"),new URL(_.url),p,e.history)===D.location.pathname+D.location.search,await de(_,tt,!0,{submission:ne,replace:ct}),{shortCircuited:!0}}if(uo(tt)){let ct=wi(ye,St.route.id);return($e&&$e.replace)!==!0&&(z="PUSH"),{matches:ye,pendingActionResult:[ct.route.id,tt,St.route.id]}}return{matches:ye,pendingActionResult:[St.route.id,tt]}}async function Oe(_,Z,ne,ye,xe,qe,Ve,Xe,$e,st,tt,St,ct,Bt){let _t=Ve||D0(Z,ne,ye,Xe),On=Xe||$e||jw(_t),Vt=!L&&!tt;if(qe){if(Vt){let Yn=He(ct);Te({navigation:_t,...Yn!==void 0?{actionData:Yn}:{}},{flushSync:St})}let Pt=await ze(ne,Z.pathname,_.signal);if(Pt.type==="aborted")return{shortCircuited:!0};if(Pt.type==="error"){if(Pt.partialMatches.length===0){let{matches:Fn,route:fr}=Of(d.activeRoutes);return{matches:Fn,loaderData:{},errors:{[fr.id]:Pt.error}}}let Yn=wi(Pt.partialMatches).route.id;return{matches:Pt.partialMatches,loaderData:{},errors:{[Yn]:Pt.error}}}else if(Pt.matches)ne=Pt.matches;else{let{error:Yn,notFoundMatches:Fn,route:fr}=gt(Z.pathname);return{matches:Fn,loaderData:{},errors:{[fr.id]:Yn}}}}let Ht=d.activeRoutes,{dsMatches:En,revalidatingFetchers:Cn}=ww(_,xe,u,c,e.history,D,ne,On,Z,tt?[]:a,tt===!0,$,K,W,I,se,Ht,p,e.patchRoutesOnNavigation!=null,d.branches,ct,Bt);if(ee=++X,!e.dataStrategy&&!En.some(Pt=>Pt.shouldLoad)&&!En.some(Pt=>Pt.route.middleware&&Pt.route.middleware.length>0)&&Cn.length===0){let Pt=new Map(D.fetchers),Yn=en(Pt);return ve(Z,{matches:ne,loaderData:{},errors:ct&&uo(ct[1])?{[ct[0]]:ct[1].error}:null,...Nw(ct),...Yn?{fetchers:Pt}:{}},{flushSync:St}),{shortCircuited:!0}}if(Vt){let Pt={};if(!qe){Pt.navigation=_t;let Yn=He(ct);Yn!==void 0&&(Pt.actionData=Yn)}Cn.length>0&&(Pt.fetchers=be(Cn)),Te(Pt,{flushSync:St})}Cn.forEach(Pt=>{Wt(Pt.key),Pt.controller&&V.set(Pt.key,Pt.controller)});let Qr=()=>Cn.forEach(Pt=>Wt(Pt.key));J&&J.signal.addEventListener("abort",Qr);let{loaderResults:cn,fetcherResults:dn}=await Ke(En,Cn,_,Z,xe);if(_.signal.aborted)return{shortCircuited:!0};J&&J.signal.removeEventListener("abort",Qr),Cn.forEach(Pt=>V.delete(Pt.key));let Mn=Mf(cn);if(Mn)return await de(_,Mn.result,!0,{replace:st}),{shortCircuited:!0};if(Mn=Mf(dn),Mn)return se.add(Mn.key),await de(_,Mn.result,!0,{replace:st}),{shortCircuited:!0};let In=new Map(D.fetchers),{loaderData:va,errors:Or}=Aw(D,ne,cn,ct,Cn,dn,In);tt&&D.errors&&(Or={...D.errors,...Or});let Po=en(In),Zr=We(ee,In),go=Po||Zr||Cn.length>0;return{matches:ne,loaderData:va,errors:Or,...go?{workingFetchers:In}:{}}}function He(_){if(_&&!uo(_[1]))return{[_[0]]:_[1].data};if(D.actionData)return Object.keys(D.actionData).length===0?null:D.actionData}function be(_){let Z=new Map(D.fetchers);return _.forEach(ne=>{let ye=Z.get(ne.key),xe=$u(void 0,ye?ye.data:void 0);Z.set(ne.key,xe)}),Z}async function Ue(_,Z,ne,ye){Wt(_);let xe=(ye&&ye.flushSync)===!0,qe=d.activeRoutes,Ve=sy(D.location,D.matches,p,ne,Z,ye?.relative),Xe=Fo(qe,Ve,p,!1,d.branches),$e=Pe(Xe,qe,Ve);if($e.active&&$e.matches&&(Xe=$e.matches),!Xe){yt(_,Z,To(404,{pathname:Ve}),{flushSync:xe});return}let{path:st,submission:tt,error:St}=Sw(!0,Ve,ye);if(St){yt(_,Z,St,{flushSync:xe});return}let ct=e.getContext?await e.getContext():new pw,Bt=(ye&&ye.preventScrollReset)===!0;if(tt&&Er(tt.formMethod)){await Qe(_,Z,st,Xe,ct,$e.active,xe,Bt,tt,ye&&ye.defaultShouldRevalidate);return}I.set(_,{routeId:Z,path:st}),await it(_,Z,st,Xe,ct,$e.active,xe,Bt,tt)}async function Qe(_,Z,ne,ye,xe,qe,Ve,Xe,$e,st){De(),I.delete(_);let tt=D.fetchers.get(_);Ie(_,X5($e,tt),{flushSync:Ve});let St=new AbortController,ct=yl(e.history,ne,St.signal,$e);if(qe){let Se=await ze(ye,new URL(ct.url).pathname,ct.signal,_);if(Se.type==="aborted")return;if(Se.type==="error"){yt(_,Z,Se.error,{flushSync:Ve});return}else if(Se.matches)ye=Se.matches;else{yt(_,Z,To(404,{pathname:ne}),{flushSync:Ve});return}}let Bt=$f(ye,ne);if(!Bt.route.action&&!Bt.route.lazy){let Se=To(405,{method:$e.formMethod,pathname:ne,routeId:Z});yt(_,Z,Se,{flushSync:Ve});return}V.set(_,St);let _t=X,On=Ml(u,c,ct,ne,ye,Bt,a,xe),Vt=await we(ct,ne,On,xe,_),Ht=Vt[Bt.route.id];if(!Ht){for(let Se of On)if(Vt[Se.route.id]){Ht=Vt[Se.route.id];break}}if(ct.signal.aborted){V.get(_)===St&&V.delete(_);return}if(W.has(_)){if(ds(Ht)||uo(Ht)){Ie(_,la(void 0));return}}else{if(ds(Ht))if(V.delete(_),ee>_t){Ie(_,la(void 0));return}else return se.add(_),Ie(_,$u($e)),de(ct,Ht,!1,{fetcherSubmission:$e,preventScrollReset:Xe});if(uo(Ht)){yt(_,Z,Ht.error);return}}let En=D.navigation.location||D.location,Cn=yl(e.history,En,St.signal),Qr=d.activeRoutes,cn=D.navigation.state!=="idle"?Fo(Qr,D.navigation.location,p,!1,d.branches):D.matches;zt(cn,"Didn't find any matches after fetcher action");let dn=++X;q.set(_,dn);let{dsMatches:Mn,revalidatingFetchers:In}=ww(Cn,xe,u,c,e.history,D,cn,$e,En,a,!1,$,K,W,I,se,Qr,p,e.patchRoutesOnNavigation!=null,d.branches,[Bt.route.id,Ht],st),va=$u($e,Ht.data),Or=new Map(D.fetchers);Or.set(_,va),In.filter(Se=>Se.key!==_).forEach(Se=>{let nt=Se.key,Ct=Or.get(nt),wt=$u(void 0,Ct?Ct.data:void 0);Or.set(nt,wt),Wt(nt),Se.controller&&V.set(nt,Se.controller)}),Te({fetchers:Or});let Po=()=>In.forEach(Se=>Wt(Se.key));St.signal.addEventListener("abort",Po);let{loaderResults:Zr,fetcherResults:go}=await Ke(Mn,In,Cn,En,xe);if(St.signal.aborted)return;St.signal.removeEventListener("abort",Po),q.delete(_),V.delete(_),In.forEach(Se=>V.delete(Se.key));let Pt=D.fetchers.has(_),Yn=Se=>{if(!Pt)return Se;let nt=new Map(Se.fetchers);return nt.set(_,la(Ht.data)),{...Se,fetchers:nt}},Fn=Mf(Zr);if(Fn)return D=Yn(D),de(Cn,Fn.result,!1,{preventScrollReset:Xe});if(Fn=Mf(go),Fn)return se.add(Fn.key),D=Yn(D),de(Cn,Fn.result,!1,{preventScrollReset:Xe});let fr=new Map(D.fetchers);Pt&&fr.set(_,la(Ht.data));let{loaderData:he,errors:Ae}=Aw(D,cn,Zr,void 0,In,go,fr);We(dn,fr),D.navigation.state==="loading"&&dn>ee?(zt(z,"Expected pending action"),J&&J.abort(),ve(D.navigation.location,{matches:cn,loaderData:he,errors:Ae,fetchers:fr})):(Te({errors:Ae,loaderData:Dw(D.loaderData,he,cn,Ae),fetchers:fr}),$=!1)}async function it(_,Z,ne,ye,xe,qe,Ve,Xe,$e){let st=D.fetchers.get(_);Ie(_,$u($e,st?st.data:void 0),{flushSync:Ve});let tt=new AbortController,St=yl(e.history,ne,tt.signal);if(qe){let Ht=await ze(ye,new URL(St.url).pathname,St.signal,_);if(Ht.type==="aborted")return;if(Ht.type==="error"){yt(_,Z,Ht.error,{flushSync:Ve});return}else if(Ht.matches)ye=Ht.matches;else{yt(_,Z,To(404,{pathname:ne}),{flushSync:Ve});return}}let ct=$f(ye,ne);V.set(_,tt);let Bt=X,_t=Ml(u,c,St,ne,ye,ct,a,xe),On=await we(St,ne,_t,xe,_),Vt=On[ct.route.id];if(!Vt){for(let Ht of ye)if(On[Ht.route.id]){Vt=On[Ht.route.id];break}}if(V.get(_)===tt&&V.delete(_),!St.signal.aborted){if(W.has(_)){Ie(_,la(void 0));return}if(ds(Vt))if(ee>Bt){Ie(_,la(void 0));return}else{se.add(_),await de(St,Vt,!1,{preventScrollReset:Xe});return}if(uo(Vt)){yt(_,Z,Vt.error);return}Ie(_,la(Vt.data))}}async function de(_,Z,ne,{submission:ye,fetcherSubmission:xe,preventScrollReset:qe,replace:Ve}={}){ne||(F?.resolve(),F=null),Z.response.headers.has("X-Remix-Revalidate")&&($=!0);let Xe=Z.response.headers.get("Location");zt(Xe,"Expected a Location header on the redirect Response");let $e=Xe,st=new URL(_.url);Xe=Ow(Xe,st,p,e.history),Ol($e,Xe,st,"allow-explicit");let tt=gc(D.location,Xe,{_isRedirect:!0});if(o){let Vt=!1;if(Z.response.headers.has("X-Remix-Reload-Document"))Vt=!0;else if(fv(Xe)){const Ht=pT(n,Xe,!0);Vt=Ht.origin!==n.location.origin||Io(Ht.pathname,p)==null}if(Vt){Ve?n.location.replace(Xe):n.location.assign(Xe);return}}J=null;let St=Ve===!0||Z.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ct,formAction:Bt,formEncType:_t}=D.navigation;!ye&&!xe&&ct&&Bt&&_t&&(ye=jw(D.navigation));let On=ye||xe;if(w5.has(Z.response.status)&&On&&Er(On.formMethod))await Le(St,tt,{submission:{...On,formAction:Xe},preventScrollReset:qe||G,enableViewTransition:ne?Y:void 0});else{let Vt=D0(tt,[],St,ye);await Le(St,tt,{overrideNavigation:Vt,fetcherSubmission:xe,preventScrollReset:qe||G,enableViewTransition:ne?Y:void 0})}}async function we(_,Z,ne,ye,xe){let qe,Ve={};try{qe=await j5(g,_,Z,ne,xe,ye,!1)}catch(Xe){return ne.filter($e=>$e.shouldLoad).forEach($e=>{Ve[$e.route.id]={type:"error",error:Xe}}),Ve}if(_.signal.aborted)return Ve;if(!Er(_.method))for(let Xe of ne){if(qe[Xe.route.id]?.type==="error")break;!qe.hasOwnProperty(Xe.route.id)&&!D.loaderData.hasOwnProperty(Xe.route.id)&&(!D.errors||!D.errors.hasOwnProperty(Xe.route.id))&&Xe.shouldCallHandler()&&(qe[Xe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Xe.route.id}`)})}for(let[Xe,$e]of Object.entries(qe))if(q5($e)){let st=$e.result;Ve[Xe]={type:"redirect",response:z5(st,_,Xe,ne,p)}}else Ve[Xe]=await L5($e);return Ve}async function Ke(_,Z,ne,ye,xe){let qe=we(ne,ye,_,xe,null),Ve=Promise.all(Z.map(async st=>{if(st.matches&&st.match&&st.request&&st.controller){let St=(await we(st.request,st.path,st.matches,xe,st.key))[st.match.route.id];return{[st.key]:St}}else return Promise.resolve({[st.key]:{type:"error",error:To(404,{pathname:st.path})}})})),Xe=await qe,$e=(await Ve).reduce((st,tt)=>Object.assign(st,tt),{});return{loaderResults:Xe,fetcherResults:$e}}function De(){$=!0,I.forEach((_,Z)=>{V.has(Z)&&K.add(Z),Wt(Z)})}function Ie(_,Z,ne={}){let ye=new Map(D.fetchers);ye.set(_,Z),Te({fetchers:ye},{flushSync:(ne&&ne.flushSync)===!0})}function yt(_,Z,ne,ye={}){let xe=wi(D.matches,Z),qe=new Map(D.fetchers);Ot(qe,_),Te({errors:{[xe.route.id]:ne},fetchers:qe},{flushSync:(ye&&ye.flushSync)===!0})}function ut(_){return B.set(_,(B.get(_)||0)+1),W.has(_)&&W.delete(_),D.fetchers.get(_)||R5}function ht(_,Z){Wt(_,Z?.reason),Ie(_,la(null))}function Ot(_,Z){let ne=D.fetchers.get(Z);V.has(Z)&&!(ne&&ne.state==="loading"&&q.has(Z))&&Wt(Z),I.delete(Z),q.delete(Z),se.delete(Z),W.delete(Z),K.delete(Z),_.delete(Z)}function Dt(_){let Z=(B.get(_)||0)-1;Z<=0?(B.delete(_),W.add(_)):B.set(_,Z),Te({fetchers:new Map(D.fetchers)})}function Wt(_,Z){let ne=V.get(_);ne&&(ne.abort(Z),V.delete(_))}function rn(_,Z){for(let ne of _){let ye=Z.get(ne);zt(ye,`Expected fetcher: ${ne}`);let xe=la(ye.data);Z.set(ne,xe)}}function en(_){let Z=[],ne=!1;for(let ye of se){let xe=_.get(ye);zt(xe,`Expected fetcher: ${ye}`),xe.state==="loading"&&(se.delete(ye),Z.push(ye),ne=!0)}return rn(Z,_),ne}function We(_,Z){let ne=[];for(let[ye,xe]of q)if(xe<_){let qe=Z.get(ye);zt(qe,`Expected fetcher: ${ye}`),qe.state==="loading"&&(Wt(ye),q.delete(ye),ne.push(ye))}return rn(ne,Z),ne.length>0}function xt(_,Z){let ne=D.blockers.get(_)||Gu;return re.get(_)!==Z&&re.set(_,Z),ne}function $t(_){D.blockers.delete(_),re.delete(_)}function ft(_,Z){let ne=D.blockers.get(_)||Gu;zt(ne.state==="unblocked"&&Z.state==="blocked"||ne.state==="blocked"&&Z.state==="blocked"||ne.state==="blocked"&&Z.state==="proceeding"||ne.state==="blocked"&&Z.state==="unblocked"||ne.state==="proceeding"&&Z.state==="unblocked",`Invalid blocker state transition: ${ne.state} -> ${Z.state}`);let ye=new Map(D.blockers);ye.set(_,Z),Te({blockers:ye})}function vt({currentLocation:_,nextLocation:Z,historyAction:ne}){if(re.size===0)return;re.size>1&&Un(!1,"A router only supports one blocker at a time");let ye=Array.from(re.entries()),[xe,qe]=ye[ye.length-1],Ve=D.blockers.get(xe);if(!(Ve&&Ve.state==="proceeding")&&qe({currentLocation:_,nextLocation:Z,historyAction:ne}))return xe}function gt(_){let Z=To(404,{pathname:_}),ne=d.activeRoutes,{matches:ye,route:xe}=Of(ne);return{notFoundMatches:ye,route:xe,error:Z}}function kt(_,Z,ne){if(w=_,R=Z,C=ne||null,!T&&D.navigation===A0){T=!0;let ye=at(D.location,D.matches);ye!=null&&Te({restoreScrollPosition:ye})}return()=>{w=null,R=null,C=null}}function un(_,Z){return C&&C(_,Z.map(ye=>mT(ye,D.loaderData)))||_.key}function je(_,Z){if(w&&R){let ne=un(_,Z);w[ne]=R()}}function at(_,Z){if(w){let ne=un(_,Z),ye=w[ne];if(typeof ye=="number")return ye}return null}function Pe(_,Z,ne){if(e.patchRoutesOnNavigation){let ye=d.branches;if(_){if(Object.keys(_[0].params).length>0)return{active:!0,matches:Fo(Z,ne,p,!0,ye)}}else return{active:!0,matches:Fo(Z,ne,p,!0,ye)||[]}}return{active:!1,matches:null}}async function ze(_,Z,ne,ye){if(!e.patchRoutesOnNavigation)return{type:"success",matches:_};let xe=_;for(;;){let qe=c;try{await e.patchRoutesOnNavigation({signal:ne,path:Z,matches:xe,fetcherKey:ye,patch:(st,tt)=>{ne.aborted||Rw(st,tt,d,qe,u,!1)}})}catch(st){return{type:"error",error:st,partialMatches:xe}}if(ne.aborted)return{type:"aborted"};let Ve=d.branches,Xe=Fo(d.activeRoutes,Z,p,!1,Ve),$e=null;if(Xe){if(Object.keys(Xe[0].params).length===0)return{type:"success",matches:Xe};if($e=Fo(d.activeRoutes,Z,p,!0,Ve),!($e&&xe.length<$e.length&&Ge(xe,$e.slice(0,xe.length))))return{type:"success",matches:Xe}}if($e||($e=Fo(d.activeRoutes,Z,p,!0,Ve)),!$e||Ge(xe,$e))return{type:"success",matches:null};xe=$e}}function Ge(_,Z){return _.length===Z.length&&_.every((ne,ye)=>ne.route.id===Z[ye].route.id)}function et(_){c={},d.setHmrRoutes(mc(_,u,void 0,c))}function Et(_,Z,ne=!1){Rw(_,Z,d,c,u,ne),d.hasHMRRoutes||Te({})}return j={get basename(){return p},get future(){return y},get state(){return D},get routes(){return d.stableRoutes},get branches(){return d.branches},get manifest(){return c},get window(){return n},initialize:me,subscribe:ce,enableScrollRestoration:kt,navigate:ke,fetch:Ue,revalidate:Me,createHref:_=>e.history.createHref(_),createURL:_=>e.history.createURL(_),encodeLocation:_=>e.history.encodeLocation(_),getFetcher:ut,resetFetcher:ht,deleteFetcher:Dt,dispose:ge,getBlocker:xt,deleteBlocker:$t,patchRoutes:Et,_internalFetchControllers:V,_internalSetRoutes:et,_internalSetStateDoNotUseOrYouWillBreakYourApp(_){Te(_)}},e.instrumentations&&(j=h5(j,e.instrumentations.map(_=>_.router).filter(Boolean))),j}function O5(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function sy(e,n,o,a,s,u){let c,d;if(s){c=[];for(let g of n)if(c.push(g),g.route.id===s){d=g;break}}else c=n,d=n[n.length-1];let p=kc(a||".",pp(c),Io(e.pathname,o)||e.pathname,u==="path");if(a==null&&(p.search=e.search,p.hash=e.hash),(a==null||a===""||a===".")&&d){let g=yv(p.search);if(d.route.index&&!g)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&g){let y=new URLSearchParams(p.search),h=y.getAll("index");y.delete("index"),h.filter(x=>x).forEach(x=>y.append("index",x));let b=y.toString();p.search=b?`?${b}`:""}}return o!=="/"&&(p.pathname=i5({basename:o,pathname:p.pathname})),zr(p)}function Sw(e,n,o){if(!o||!O5(o))return{path:n};if(o.formMethod&&!G5(o.formMethod))return{path:n,error:To(405,{method:o.formMethod})};let a=()=>({path:n,error:To(400,{type:"invalid-body"})}),u=(o.formMethod||"get").toUpperCase(),c=LT(n);if(o.body!==void 0){if(o.formEncType==="text/plain"){if(!Er(u))return a();let h=typeof o.body=="string"?o.body:o.body instanceof FormData||o.body instanceof URLSearchParams?Array.from(o.body.entries()).reduce((b,[x,w])=>`${b}${x}=${w}
11
- `,""):String(o.body);return{path:n,submission:{formMethod:u,formAction:c,formEncType:o.formEncType,formData:void 0,json:void 0,text:h}}}else if(o.formEncType==="application/json"){if(!Er(u))return a();try{let h=typeof o.body=="string"?JSON.parse(o.body):o.body;return{path:n,submission:{formMethod:u,formAction:c,formEncType:o.formEncType,formData:void 0,json:h,text:void 0}}}catch{return a()}}}zt(typeof FormData=="function","FormData is not available in this environment");let d,p;if(o.formData)d=cy(o.formData),p=o.formData;else if(o.body instanceof FormData)d=cy(o.body),p=o.body;else if(o.body instanceof URLSearchParams)d=o.body,p=Mw(d);else if(o.body==null)d=new URLSearchParams,p=new FormData;else try{d=new URLSearchParams(o.body),p=Mw(d)}catch{return a()}let g={formMethod:u,formAction:c,formEncType:o&&o.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(Er(g.formMethod))return{path:n,submission:g};let y=Go(n);return e&&y.search&&yv(y.search)&&d.append("index",""),y.search=`?${d}`,{path:zr(y),submission:g}}function ww(e,n,o,a,s,u,c,d,p,g,y,h,b,x,w,C,R,T,O,M,A,N){let k=A?uo(A[1])?A[1].error:A[1].data:void 0,j=s.createURL(u.location),D=s.createURL(p),z;if(y&&u.errors){let L=Object.keys(u.errors)[0];z=c.findIndex($=>$.route.id===L)}else if(A&&uo(A[1])){let L=A[0];z=c.findIndex($=>$.route.id===L)-1}let F=A?A[1].statusCode:void 0,G=F&&F>=400,J={currentUrl:j,currentParams:u.matches[0]?.params||{},nextUrl:D,nextParams:c[0].params,...d,actionResult:k,actionStatus:F},Y=zc(c),U=c.map((L,$)=>{let{route:K}=L,V=null;if(z!=null&&$>z)V=!1;else if(K.lazy)V=!0;else if(!gv(K))V=!1;else if(y){let{shouldLoad:se}=AT(K,u.loaderData,u.errors);V=se}else M5(u.loaderData,u.matches[$],L)&&(V=!0);if(V!==null)return ly(o,a,e,p,Y,L,g,n,V);let X=!1;typeof N=="boolean"?X=N:G?X=!1:(h||j.pathname+j.search===D.pathname+D.search||j.search!==D.search||A5(u.matches[$],L))&&(X=!0);let ee={...J,defaultShouldRevalidate:X},q=oc(L,ee);return ly(o,a,e,p,Y,L,g,n,q,ee,N)}),H=[];return w.forEach((L,$)=>{if(y||!c.some(B=>B.route.id===L.routeId)||x.has($))return;let K=u.fetchers.get($),V=K&&K.state!=="idle"&&K.data===void 0,X=Fo(R,L.path,T??"/",!1,M);if(!X){if(O&&V)return;H.push({key:$,routeId:L.routeId,path:L.path,matches:null,match:null,request:null,controller:null});return}if(C.has($))return;let ee=$f(X,L.path),q=new AbortController,se=yl(s,L.path,q.signal),I=null;if(b.has($))b.delete($),I=Ml(o,a,se,L.path,X,ee,g,n);else if(V)h&&(I=Ml(o,a,se,L.path,X,ee,g,n));else{let B;typeof N=="boolean"?B=N:G?B=!1:B=h;let W={...J,defaultShouldRevalidate:B};oc(ee,W)&&(I=Ml(o,a,se,L.path,X,ee,g,n,W))}I&&H.push({key:$,routeId:L.routeId,path:L.path,matches:I,match:ee,request:se,controller:q})}),{dsMatches:U,revalidatingFetchers:H}}function gv(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function AT(e,n,o){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!gv(e))return{shouldLoad:!1,renderFallback:!1};let a=n!=null&&e.id in n,s=o!=null&&o[e.id]!==void 0;if(!a&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let u=!a&&!s;return{shouldLoad:u,renderFallback:u}}function M5(e,n,o){let a=!n||o.route.id!==n.route.id,s=!e.hasOwnProperty(o.route.id);return a||s}function A5(e,n){let o=e.route.path;return e.pathname!==n.pathname||o!=null&&o.endsWith("*")&&e.params["*"]!==n.params["*"]}function oc(e,n){if(e.route.shouldRevalidate){let o=e.route.shouldRevalidate(n);if(typeof o=="boolean")return o}return n.defaultShouldRevalidate}function Rw(e,n,o,a,s,u){let c;if(e){let g=a[e];zt(g,`No route found to patch children into: routeId = ${e}`),g.children||(g.children=[]),c=g.children}else c=o.activeRoutes;let d=[],p=[];if(n.forEach(g=>{let y=c.find(h=>DT(g,h));y?p.push({existingRoute:y,newRoute:g}):d.push(g)}),d.length>0){let g=mc(d,s,[e||"_","patch",String(c?.length||"0")],a);c.push(...g)}if(u&&p.length>0)for(let g=0;g<p.length;g++){let{existingRoute:y,newRoute:h}=p[g],b=y,[x]=mc([h],s,[],{},!0);Object.assign(b,{element:x.element?x.element:b.element,errorElement:x.errorElement?x.errorElement:b.errorElement,hydrateFallbackElement:x.hydrateFallbackElement?x.hydrateFallbackElement:b.hydrateFallbackElement})}o.hasHMRRoutes||o.setRoutes([...o.activeRoutes])}function DT(e,n){return"id"in e&&"id"in n&&e.id===n.id?!0:e.index===n.index&&e.path===n.path&&e.caseSensitive===n.caseSensitive?(!e.children||e.children.length===0)&&(!n.children||n.children.length===0)?!0:e.children?.every((o,a)=>n.children?.some(s=>DT(o,s)))??!1:!1}var Ew=new WeakMap,NT=({key:e,route:n,manifest:o,mapRouteProperties:a})=>{let s=o[n.id];if(zt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let u=s.lazy[e];if(!u)return;let c=Ew.get(s);c||(c={},Ew.set(s,c));let d=c[e];if(d)return d;let p=(async()=>{let g=Yk(e),h=s[e]!==void 0&&e!=="hasErrorBoundary";if(g)Un(!g,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(h)Un(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let b=await u();b!=null&&(Object.assign(s,{[e]:b}),Object.assign(s,a(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(b=>b===void 0)&&(s.lazy=void 0))})();return c[e]=p,p},Cw=new WeakMap;function D5(e,n,o,a,s){let u=o[e.id];if(zt(u,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let y=Cw.get(u);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let h=(async()=>{zt(typeof e.lazy=="function","No lazy route function found");let b=await e.lazy(),x={};for(let w in b){let C=b[w];if(C===void 0)continue;let R=Gk(w),O=u[w]!==void 0&&w!=="hasErrorBoundary";R?Un(!R,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):O?Un(!O,`Route "${u.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.`):x[w]=C}Object.assign(u,x),Object.assign(u,{...a(u),lazy:void 0})})();return Cw.set(u,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let c=Object.keys(e.lazy),d=[],p;for(let y of c){if(s&&s.includes(y))continue;let h=NT({key:y,route:e,manifest:o,mapRouteProperties:a});h&&(d.push(h),y===n&&(p=h))}let g=d.length>0?Promise.all(d).then(()=>{}):void 0;return g?.catch(()=>{}),p?.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:p}}async function Tw(e){let n=e.matches.filter(s=>s.shouldLoad),o={};return(await Promise.all(n.map(s=>s.resolve()))).forEach((s,u)=>{o[n[u].route.id]=s}),o}async function N5(e){return e.matches.some(n=>n.route.middleware)?IT(e,()=>Tw(e)):Tw(e)}function IT(e,n){return I5(e,n,a=>{if(K5(a))throw a;return a},B5,o);function o(a,s,u){if(u)return Promise.resolve(Object.assign(u.value,{[s]:{type:"error",result:a}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(g=>g.route.id===s),0),Math.max(c.findIndex(g=>g.shouldCallHandler()),0)),p=wi(c,c[d].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:a}})}}}async function I5(e,n,o,a,s){let{matches:u,...c}=e,d=u.flatMap(g=>g.route.middleware?g.route.middleware.map(y=>[g.route.id,y]):[]);return await jT(c,d,n,o,a,s)}async function jT(e,n,o,a,s,u,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let p=n[c];if(!p)return await o();let[g,y]=p,h,b=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");try{return h={value:await jT(e,n,o,a,s,u,c+1)},h.value}catch(x){return h={value:await u(x,g,h)},h.value}};try{let x=await y(e,b),w=x!=null?a(x):void 0;return s(w)?w:h?w??h.value:(h={value:await b()},h.value)}catch(x){return await u(x,g,h)}}function PT(e,n,o,a,s){let u=NT({key:"middleware",route:a.route,manifest:n,mapRouteProperties:e}),c=D5(a.route,Er(o.method)?"action":"loader",n,e,s);return{middleware:u,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function ly(e,n,o,a,s,u,c,d,p,g=null,y){let h=!1,b=PT(e,n,o,u,c);return{...u,_lazyPromises:b,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(x){return h=!0,g?typeof y=="boolean"?oc(u,{...g,defaultShouldRevalidate:y}):typeof x=="boolean"?oc(u,{...g,defaultShouldRevalidate:x}):oc(u,g):p},resolve(x){let{lazy:w,loader:C,middleware:R}=u.route,T=h||p||x&&!Er(o.method)&&(w||C),O=R&&R.length>0&&!C&&!w;return T&&(Er(o.method)||!O)?P5({request:o,path:a,pattern:s,match:u,lazyHandlerPromise:b?.handler,lazyRoutePromise:b?.route,handlerOverride:x,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function Ml(e,n,o,a,s,u,c,d,p=null){return s.map(g=>g.route.id!==u.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:PT(e,n,o,g,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ly(e,n,o,a,zc(s),g,c,d,!0,p))}async function j5(e,n,o,a,s,u,c){a.some(y=>y._lazyPromises?.middleware)&&await Promise.all(a.map(y=>y._lazyPromises?.middleware));let d={request:n,url:kT(n,o),pattern:zc(a),params:a[0].params,context:u,matches:a},g=await e({...d,fetcherKey:s,runClientMiddleware:y=>{let h=d;return IT(h,()=>y({...h,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(a.flatMap(y=>[y._lazyPromises?.handler,y._lazyPromises?.route]))}catch{}return g}async function P5({request:e,path:n,pattern:o,match:a,lazyHandlerPromise:s,lazyRoutePromise:u,handlerOverride:c,scopedContext:d}){let p,g,y=Er(e.method),h=y?"action":"loader",b=x=>{let w,C=new Promise((O,M)=>w=M);g=()=>w(),e.signal.addEventListener("abort",g);let R=O=>typeof x!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${a.route.id}]`)):x({request:e,url:kT(e,n),pattern:o,params:a.params,context:d},...O!==void 0?[O]:[]),T=(async()=>{try{return{type:"data",result:await(c?c(M=>R(M)):R())}}catch(O){return{type:"error",result:O}}})();return Promise.race([T,C])};try{let x=y?a.route.action:a.route.loader;if(s||u)if(x){let w,[C]=await Promise.all([b(x).catch(R=>{w=R}),s,u]);if(w!==void 0)throw w;p=C}else{await s;let w=y?a.route.action:a.route.loader;if(w)[p]=await Promise.all([b(w),u]);else if(h==="action"){let C=new URL(e.url),R=C.pathname+C.search;throw To(405,{method:e.method,pathname:R,routeId:a.route.id})}else return{type:"data",result:void 0}}else if(x)p=await b(x);else{let w=new URL(e.url),C=w.pathname+w.search;throw To(404,{pathname:C})}}catch(x){return{type:"error",result:x}}finally{g&&e.signal.removeEventListener("abort",g)}return p}async function k5(e){let n=e.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?e.body==null?null:e.json():e.text()}async function L5(e){let{result:n,type:o}=e;if(mv(n)){let a;try{a=await k5(n)}catch(s){return{type:"error",error:s}}return o==="error"?{type:"error",error:new Lc(n.status,n.statusText,a),statusCode:n.status,headers:n.headers}:{type:"data",data:a,statusCode:n.status,headers:n.headers}}return o==="error"?Iw(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:F5(n),statusCode:yc(n)?n.status:void 0,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:yc(n)?n.status:void 0}:Iw(n)?{type:"data",data:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function z5(e,n,o,a,s){let u=e.headers.get("Location");if(zt(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!fv(u)){let c=a.slice(0,a.findIndex(d=>d.route.id===o)+1);u=sy(new URL(n.url),c,s,u),e.headers.set("Location",u)}return e}var _5=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function uy(e){try{return _5.includes(new URL(e).protocol)}catch{return!1}}function Ow(e,n,o,a){if(fv(e)){let s=e,u=hp.test(s)?new URL(hT(s,n.protocol)):new URL(s);if(uy(u.toString()))throw new Error("Invalid redirect location");let c=Io(u.pathname,o)!=null;if(u.origin===n.origin&&c)return hv(u.pathname)+u.search+u.hash}try{let s=a.createURL(e);if(uy(s.toString()))throw new Error("Invalid redirect location")}catch{}return e}function yl(e,n,o,a){let s=e.createURL(LT(n)).toString(),u={signal:o};if(a&&Er(a.formMethod)){let{formMethod:c,formEncType:d}=a;u.method=c.toUpperCase(),d==="application/json"?(u.headers=new Headers({"Content-Type":d}),u.body=JSON.stringify(a.json)):d==="text/plain"?u.body=a.text:d==="application/x-www-form-urlencoded"&&a.formData?u.body=cy(a.formData):u.body=a.formData}return new Request(s,u)}function kT(e,n){let o=new URL(e.url),a=typeof n=="string"?Go(n):n;if(o.pathname=a.pathname||"/",a.search){let s=new URLSearchParams(a.search),u=s.getAll("index");s.delete("index");for(let c of u.filter(Boolean))s.append("index",c);o.search=s.size?`?${s.toString()}`:""}else o.search="";return o.hash=a.hash||"",o}function cy(e){let n=new URLSearchParams;for(let[o,a]of e.entries())n.append(o,typeof a=="string"?a:a.name);return n}function Mw(e){let n=new FormData;for(let[o,a]of e.entries())n.append(o,a);return n}function H5(e,n,o,a=!1,s=!1){let u={},c=null,d,p=!1,g={},y=o&&uo(o[1])?o[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in n))return;let b=h.route.id,x=n[b];if(zt(!ds(x),"Cannot handle redirect results in processLoaderData"),uo(x)){let w=x.error;if(y!==void 0&&(w=y,y=void 0),c=c||{},s)c[b]=w;else{let C=wi(e,b);c[C.route.id]==null&&(c[C.route.id]=w)}a||(u[b]=MT),p||(p=!0,d=yc(x.error)?x.error.status:500),x.headers&&(g[b]=x.headers)}else u[b]=x.data,x.statusCode&&x.statusCode!==200&&!p&&(d=x.statusCode),x.headers&&(g[b]=x.headers)}),y!==void 0&&o&&(c={[o[0]]:y},o[2]&&(u[o[2]]=void 0)),{loaderData:u,errors:c,statusCode:d||200,loaderHeaders:g}}function Aw(e,n,o,a,s,u,c){let{loaderData:d,errors:p}=H5(n,o,a);return s.filter(g=>!g.matches||g.matches.some(y=>y.shouldLoad)).forEach(g=>{let{key:y,match:h,controller:b}=g;if(b&&b.signal.aborted)return;let x=u[y];if(zt(x,"Did not find corresponding fetcher result"),uo(x)){let w=wi(e.matches,h?.route.id);p&&p[w.route.id]||(p={...p,[w.route.id]:x.error}),c.delete(y)}else if(ds(x))zt(!1,"Unhandled fetcher revalidation redirect");else{let w=la(x.data);c.set(y,w)}}),{loaderData:d,errors:p}}function Dw(e,n,o,a){let s=Object.entries(n).filter(([,u])=>u!==MT).reduce((u,[c,d])=>(u[c]=d,u),{});for(let u of o){let c=u.route.id;if(!n.hasOwnProperty(c)&&e.hasOwnProperty(c)&&u.route.loader&&(s[c]=e[c]),a&&a.hasOwnProperty(c))break}return s}function Nw(e){return e?uo(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function wi(e,n){return(n?e.slice(0,e.findIndex(a=>a.route.id===n)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function Of(e){let n=e.length===1?e[0]:e.find(o=>o.index||!o.path||o.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function To(e,{pathname:n,routeId:o,method:a,type:s,message:u}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",a&&n&&o?d=`You made a ${a} request to "${n}" but did not provide a \`loader\` for route "${o}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${o}" does not match URL "${n}"`):e===404?(c="Not Found",d=`No route matches URL "${n}"`):e===405&&(c="Method Not Allowed",a&&n&&o?d=`You made a ${a.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${o}", so there is no way to handle the request.`:a&&(d=`Invalid request method "${a.toUpperCase()}"`)),new Lc(e||500,c,new Error(d),!0)}function Mf(e){let n=Object.entries(e);for(let o=n.length-1;o>=0;o--){let[a,s]=n[o];if(ds(s))return{key:a,result:s}}}function LT(e){let n=typeof e=="string"?Go(e):e;return zr({...n,hash:""})}function U5(e,n){return e.pathname!==n.pathname||e.search!==n.search?!1:e.hash===""?n.hash!=="":e.hash===n.hash?!0:n.hash!==""}function F5(e){return new Lc(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function B5(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([n,o])=>typeof n=="string"&&V5(o))}function V5(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function q5(e){return mv(e.result)&&TT.has(e.result.status)}function uo(e){return e.type==="error"}function ds(e){return(e&&e.type)==="redirect"}function Iw(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function mv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Y5(e){return TT.has(e)}function K5(e){return mv(e)&&Y5(e.status)&&e.headers.has("Location")}function G5(e){return S5.has(e.toUpperCase())}function Er(e){return b5.has(e.toUpperCase())}function yv(e){return new URLSearchParams(e).getAll("index").some(n=>n==="")}function $f(e,n){let o=typeof n=="string"?Go(n).search:n.search;if(e[e.length-1].route.index&&yv(o||""))return e[e.length-1];let a=ST(e);return a[a.length-1]}function jw(e){let{formMethod:n,formAction:o,formEncType:a,text:s,formData:u,json:c}=e;if(!(!n||!o||!a)){if(s!=null)return{formMethod:n,formAction:o,formEncType:a,formData:void 0,json:void 0,text:s};if(u!=null)return{formMethod:n,formAction:o,formEncType:a,formData:u,json:void 0,text:void 0};if(c!==void 0)return{formMethod:n,formAction:o,formEncType:a,formData:void 0,json:c,text:void 0}}}function D0(e,n,o,a){return a?{state:"loading",location:e,matches:n,historyAction:o,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}:{state:"loading",location:e,matches:n,historyAction:o,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function $5(e,n,o,a){return{state:"submitting",location:e,matches:n,historyAction:o,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}}function $u(e,n){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function X5(e,n){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n?n.data:void 0}}function la(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 Q5(e,n){try{let o=e.sessionStorage.getItem(OT);if(o){let a=JSON.parse(o);for(let[s,u]of Object.entries(a||{}))u&&Array.isArray(u)&&n.set(s,new Set(u||[]))}}catch{}}function Z5(e,n){if(n.size>0){let o={};for(let[a,s]of n)o[a]=[...s];try{e.sessionStorage.setItem(OT,JSON.stringify(o))}catch(a){Un(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function Pw(){let e,n,o=new Promise((a,s)=>{e=async u=>{a(u);try{await o}catch{}},n=async u=>{s(u);try{await o}catch{}}});return{promise:o,resolve:e,reject:n}}var Es=v.createContext(null);Es.displayName="DataRouter";var _c=v.createContext(null);_c.displayName="DataRouterState";var zT=v.createContext(!1);function _T(){return v.useContext(zT)}var vv=v.createContext({isTransitioning:!1});vv.displayName="ViewTransition";var HT=v.createContext(new Map);HT.displayName="Fetchers";var J5=v.createContext(null);J5.displayName="Await";var po=v.createContext(null);po.displayName="Navigation";var gp=v.createContext(null);gp.displayName="Location";var $o=v.createContext({outlet:null,matches:[],isDataRoute:!1});$o.displayName="Route";var bv=v.createContext(null);bv.displayName="RouteError";var UT="REACT_ROUTER_ERROR",W5="REDIRECT",eL="ROUTE_ERROR_RESPONSE";function tL(e){if(e.startsWith(`${UT}:${W5}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function nL(e){if(e.startsWith(`${UT}:${eL}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Lc(n.status,n.statusText,n.data)}catch{}}function rL(e,{relative:n}={}){zt(Vl(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:a}=v.useContext(po),{hash:s,pathname:u,search:c}=Hc(e,{relative:n}),d=u;return o!=="/"&&(d=u==="/"?o:Do([o,u])),a.createHref({pathname:d,search:c,hash:s})}function Vl(){return v.useContext(gp)!=null}function Hr(){return zt(Vl(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(gp).location}var FT="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function BT(e){v.useContext(po).static||v.useLayoutEffect(e)}function mp(){let{isDataRoute:e}=v.useContext($o);return e?vL():oL()}function oL(){zt(Vl(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Es),{basename:n,navigator:o}=v.useContext(po),{matches:a}=v.useContext($o),{pathname:s}=Hr(),u=JSON.stringify(pp(a)),c=v.useRef(!1);return BT(()=>{c.current=!0}),v.useCallback((p,g={})=>{if(Un(c.current,FT),!c.current)return;if(typeof p=="number"){o.go(p);return}let y=kc(p,JSON.parse(u),s,g.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Do([n,y.pathname])),Ol(typeof p=="string"?p:zr(p),o.createHref(y),pv(o),"reject"),(g.replace?o.replace:o.push)(y,g.state,g)},[n,o,u,s,e])}var aL=v.createContext(null);function iL(e){let n=v.useContext($o).outlet;return v.useMemo(()=>n&&v.createElement(aL.Provider,{value:e},n),[n,e])}function Hc(e,{relative:n}={}){let{matches:o}=v.useContext($o),{pathname:a}=Hr(),s=JSON.stringify(pp(o));return v.useMemo(()=>kc(e,JSON.parse(s),a,n==="path"),[e,s,a,n])}function sL(e,n,o){zt(Vl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=v.useContext(po),{matches:s}=v.useContext($o),u=s[s.length-1],c=u?u.params:{},d=u?u.pathname:"/",p=u?u.pathnameBase:"/",g=u&&u.route;{let R=g&&g.path||"";YT(d,!g||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.
12
-
13
- Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let y=Hr(),h;h=y;let b=h.pathname||"/",x=b;if(p!=="/"){let R=p.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(R.length).join("/")}let w=o&&o.state.matches.length?o.state.matches.map(R=>Object.assign(R,{route:o.manifest[R.route.id]||R.route})):gT(e,{pathname:x});return Un(g||w!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Un(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.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.`),fL(w&&w.map(R=>Object.assign({},R,{params:Object.assign({},c,R.params),pathname:Do([p,a.encodeLocation?a.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?p:Do([p,a.encodeLocation?a.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),s,o)}function lL(){let e=yL(),n=yc(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),o=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},u={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=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:u},"ErrorBoundary")," or"," ",v.createElement("code",{style:u},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},n),o?v.createElement("pre",{style:s},o):null,c)}var uL=v.createElement(lL,null),VT=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,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):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 o=nL(e.digest);o&&(e=o)}let n=e!==void 0?v.createElement($o.Provider,{value:this.props.routeContext},v.createElement(bv.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(cL,{error:e},n):n}};VT.contextType=zT;var N0=new WeakMap;function cL({children:e,error:n}){let{basename:o,navigator:a}=v.useContext(po);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=tL(n.digest);if(s){let u=N0.get(n);if(u)throw u;let c=RT(s.location,o),d=c.absoluteURL||c.to;if(Ol(s.location,d,pv(a),"allow-explicit"),uy(d))throw new Error("Invalid redirect location");if(wT&&!N0.get(n))if(c.isExternal||s.reloadDocument)window.location.href=d;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:s.replace}));throw N0.set(n,p),p}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return e}function dL({routeContext:e,match:n,children:o}){let a=v.useContext(Es);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement($o.Provider,{value:e},o)}function fL(e,n=[],o){let a=o?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let s=e,u=a?.errors;if(u!=null){let y=s.findIndex(h=>h.route.id&&u?.[h.route.id]!==void 0);zt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),s=s.slice(0,Math.min(s.length,y+1))}let c=!1,d=-1;if(o&&a){c=a.renderFallback;for(let y=0;y<s.length;y++){let h=s[y];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(d=y),h.route.id){let{loaderData:b,errors:x}=a,w=h.route.loader&&!b.hasOwnProperty(h.route.id)&&(!x||x[h.route.id]===void 0);if(h.route.lazy||w){o.isStatic&&(c=!0),d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}}let p=o?.onError,g=a&&p?(y,h)=>{p(y,{location:a.location,params:a.matches?.[0]?.params??{},pattern:zc(a.matches),errorInfo:h})}:void 0;return s.reduceRight((y,h,b)=>{let x,w=!1,C=null,R=null;a&&(x=u&&h.route.id?u[h.route.id]:void 0,C=h.route.errorElement||uL,c&&(d<0&&b===0?(YT("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,R=null):d===b&&(w=!0,R=h.route.hydrateFallbackElement||null)));let T=n.concat(s.slice(0,b+1)),O=()=>{let M;return x?M=C:w?M=R:h.route.Component?M=v.createElement(h.route.Component,null):h.route.element?M=h.route.element:M=y,v.createElement(dL,{match:h,routeContext:{outlet:y,matches:T,isDataRoute:a!=null},children:M})};return a&&(h.route.ErrorBoundary||h.route.errorElement||b===0)?v.createElement(VT,{location:a.location,revalidation:a.revalidation,component:C,error:x,children:O(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:g}):O()},null)}function xv(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hL(e){let n=v.useContext(Es);return zt(n,xv(e)),n}function qT(e){let n=v.useContext(_c);return zt(n,xv(e)),n}function pL(e){let n=v.useContext($o);return zt(n,xv(e)),n}function Sv(e){let n=pL(e),o=n.matches[n.matches.length-1];return zt(o.route.id,`${e} can only be used on routes that contain a unique "id"`),o.route.id}function gL(){return Sv("useRouteId")}function mL(){let{matches:e,loaderData:n}=qT("useMatches");return v.useMemo(()=>e.map(o=>mT(o,n)),[e,n])}function yL(){let e=v.useContext(bv),n=qT("useRouteError"),o=Sv("useRouteError");return e!==void 0?e:n.errors?.[o]}function vL(){let{router:e}=hL("useNavigate"),n=Sv("useNavigate"),o=v.useRef(!1);return BT(()=>{o.current=!0}),v.useCallback(async(s,u={})=>{Un(o.current,FT),o.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:n,...u}))},[e,n])}var kw={};function YT(e,n,o){!n&&!kw[e]&&(kw[e]=!0,Un(!1,o))}var Lw={};function zw(e,n){!e&&!Lw[n]&&(Lw[n]=!0,console.warn(n))}var bL="useOptimistic",_w=zR[bL],xL=()=>{};function SL(e){return _w?_w(e):[e,xL]}function wL(e){let n={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Un(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Un(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Un(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),n}var RL=["HydrateFallback","hydrateFallbackElement"],EL=class{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=o=>{this.status==="pending"&&(this.status="resolved",e(o))},this.reject=o=>{this.status==="pending"&&(this.status="rejected",n(o))}})}};function CL({router:e,flushSync:n,onError:o,useTransitions:a}){a=_T()||a;let[u,c]=v.useState(e.state),[d,p]=SL(u),[g,y]=v.useState(),[h,b]=v.useState({isTransitioning:!1}),[x,w]=v.useState(),[C,R]=v.useState(),[T,O]=v.useState(),M=v.useRef(new Map),A=v.useCallback((D,{deletedFetchers:z,newErrors:F,flushSync:G,viewTransitionOpts:J})=>{F&&o&&Object.values(F).forEach(U=>o(U,{location:D.location,params:D.matches[0]?.params??{},pattern:zc(D.matches)})),D.fetchers.forEach((U,H)=>{U.data!==void 0&&M.current.set(H,U.data)}),z.forEach(U=>M.current.delete(U)),zw(G===!1||n!=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 Y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(zw(J==null||Y,"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||!Y){n&&G?n(()=>c(D)):a===!1?c(D):v.startTransition(()=>{a===!0&&p(U=>Hw(U,D)),c(D)});return}if(n&&G){n(()=>{C&&(x?.resolve(),C.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:J.currentLocation,nextLocation:J.nextLocation})});let U=e.window.document.startViewTransition(()=>{n(()=>c(D))});U.finished.finally(()=>{n(()=>{w(void 0),R(void 0),y(void 0),b({isTransitioning:!1})})}),n(()=>R(U));return}C?(x?.resolve(),C.skipTransition(),O({state:D,currentLocation:J.currentLocation,nextLocation:J.nextLocation})):(y(D),b({isTransitioning:!0,flushSync:!1,currentLocation:J.currentLocation,nextLocation:J.nextLocation}))},[e.window,n,C,x,a,p,o]);v.useLayoutEffect(()=>e.subscribe(A),[e,A]),v.useEffect(()=>{h.isTransitioning&&!h.flushSync&&w(new EL)},[h]),v.useEffect(()=>{if(x&&g&&e.window){let D=g,z=x.promise,F=e.window.document.startViewTransition(async()=>{a===!1?c(D):v.startTransition(()=>{a===!0&&p(G=>Hw(G,D)),c(D)}),await z});F.finished.finally(()=>{w(void 0),R(void 0),y(void 0),b({isTransitioning:!1})}),R(F)}},[g,x,e.window,a,p]),v.useEffect(()=>{x&&g&&d.location.key===g.location.key&&x.resolve()},[x,C,d.location,g]),v.useEffect(()=>{!h.isTransitioning&&T&&(y(T.state),b({isTransitioning:!0,flushSync:!1,currentLocation:T.currentLocation,nextLocation:T.nextLocation}),O(void 0))},[h.isTransitioning,T]);let N=v.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:D=>e.navigate(D),push:(D,z,F)=>e.navigate(D,{state:z,preventScrollReset:F?.preventScrollReset}),replace:(D,z,F)=>e.navigate(D,{replace:!0,state:z,preventScrollReset:F?.preventScrollReset})}),[e]),k=e.basename||"/",j=v.useMemo(()=>({router:e,navigator:N,static:!1,basename:k,onError:o}),[e,N,k,o]);return v.createElement(v.Fragment,null,v.createElement(Es.Provider,{value:j},v.createElement(_c.Provider,{value:d},v.createElement(HT.Provider,{value:M.current},v.createElement(vv.Provider,{value:h},v.createElement(AL,{basename:k,location:d.location,navigationType:d.historyAction,navigator:N,useTransitions:a},v.createElement(TL,{routes:e.routes,manifest:e.manifest,future:e.future,state:d,isStatic:!1,onError:o})))))),null)}function Hw(e,n){return{...e,navigation:n.navigation.state!=="idle"?n.navigation:e.navigation,revalidation:n.revalidation!=="idle"?n.revalidation:e.revalidation,actionData:n.navigation.state!=="submitting"?n.actionData:e.actionData,fetchers:n.fetchers}}var TL=v.memo(OL);function OL({routes:e,manifest:n,future:o,state:a,isStatic:s,onError:u}){return sL(e,void 0,{manifest:n,state:a,isStatic:s,onError:u})}function ML({to:e,replace:n,state:o,relative:a}){zt(Vl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s,navigator:u}=v.useContext(po);Un(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:c}=v.useContext($o),{pathname:d}=Hr(),p=mp(),g=kc(e,pp(c),d,a==="path");Ol(typeof e=="string"?e:zr(e),u.createHref(g),pv(u),"reject");let y=JSON.stringify(g);return v.useEffect(()=>{p(JSON.parse(y),{replace:n,state:o,relative:a})},[p,y,a,n,o]),null}function KT(e){return iL(e.context)}function AL({basename:e="/",children:n=null,location:o,navigationType:a="POP",navigator:s,static:u=!1,useTransitions:c}){zt(!Vl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),p=v.useMemo(()=>({basename:d,navigator:s,static:u,useTransitions:c,future:{}}),[d,s,u,c]);typeof o=="string"&&(o=Go(o));let{pathname:g="/",search:y="",hash:h="",state:b=null,key:x="default",mask:w}=o,C=v.useMemo(()=>{let R=Io(g,d);return R==null?null:{location:{pathname:R,search:y,hash:h,state:b,key:x,mask:w},navigationType:a}},[d,g,y,h,b,x,a,w]);return Un(C!=null,`<Router basename="${d}"> is not able to match the URL "${g}${y}${h}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:v.createElement(po.Provider,{value:p},v.createElement(gp.Provider,{children:n,value:C}))}var Xf="get",Qf="application/x-www-form-urlencoded";function yp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function DL(e){return yp(e)&&e.tagName.toLowerCase()==="button"}function NL(e){return yp(e)&&e.tagName.toLowerCase()==="form"}function IL(e){return yp(e)&&e.tagName.toLowerCase()==="input"}function jL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function PL(e,n){return e.button===0&&(!n||n==="_self")&&!jL(e)}function dy(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,o)=>{let a=e[o];return n.concat(Array.isArray(a)?a.map(s=>[o,s]):[[o,a]])},[]))}function kL(e,n){let o=dy(e);return n&&n.forEach((a,s)=>{o.has(s)||n.getAll(s).forEach(u=>{o.append(s,u)})}),o}var Af=null;function LL(){if(Af===null)try{new FormData(document.createElement("form"),0),Af=!1}catch{Af=!0}return Af}var zL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function I0(e){return e!=null&&!zL.has(e)?(Un(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qf}"`),null):e}function _L(e,n){let o,a,s,u,c;if(NL(e)){let d=e.getAttribute("action");a=d?Io(d,n):null,o=e.getAttribute("method")||Xf,s=I0(e.getAttribute("enctype"))||Qf,u=new FormData(e)}else if(DL(e)||IL(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||d.getAttribute("action");if(a=p?Io(p,n):null,o=e.getAttribute("formmethod")||d.getAttribute("method")||Xf,s=I0(e.getAttribute("formenctype"))||I0(d.getAttribute("enctype"))||Qf,u=new FormData(d,e),!LL()){let{name:g,type:y,value:h}=e;if(y==="image"){let b=g?`${g}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else g&&u.append(g,h)}}else{if(yp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Xf,a=null,s=Qf,c=e}return u&&s==="text/plain"&&(c=u,u=void 0),{action:a,method:o.toLowerCase(),encType:s,formData:u,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function wv(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function GT(e,n,o,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return o?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:n&&Io(s.pathname,n)==="/"?s.pathname=`${Ll(n)}/_root.${a}`:s.pathname=`${Ll(s.pathname)}.${a}`,s}async function HL(e,n){if(e.id in n)return n[e.id];try{let o=await import(e.module);return n[e.id]=o,o}catch(o){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function UL(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 FL(e,n,o){let a=await Promise.all(e.map(async s=>{let u=n.routes[s.route.id];if(u){let c=await HL(u,o);return c.links?c.links():[]}return[]}));return YL(a.flat(1).filter(UL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Uw(e,n,o,a,s,u){let c=(p,g)=>o[g]?p.route.id!==o[g].route.id:!0,d=(p,g)=>o[g].pathname!==p.pathname||o[g].route.path?.endsWith("*")&&o[g].params["*"]!==p.params["*"];return u==="assets"?n.filter((p,g)=>c(p,g)||d(p,g)):u==="data"?n.filter((p,g)=>{let y=a.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(c(p,g)||d(p,g))return!0;if(p.route.shouldRevalidate){let h=p.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:o[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function BL(e,n,{includeHydrateFallback:o}={}){return VL(e.map(a=>{let s=n.routes[a.route.id];if(!s)return[];let u=[s.module];return s.clientActionModule&&(u=u.concat(s.clientActionModule)),s.clientLoaderModule&&(u=u.concat(s.clientLoaderModule)),o&&s.hydrateFallbackModule&&(u=u.concat(s.hydrateFallbackModule)),s.imports&&(u=u.concat(s.imports)),u}).flat(1))}function VL(e){return[...new Set(e)]}function qL(e){let n={},o=Object.keys(e).sort();for(let a of o)n[a]=e[a];return n}function YL(e,n){let o=new Set;return new Set(n),e.reduce((a,s)=>{let u=JSON.stringify(qL(s));return o.has(u)||(o.add(u),a.push({key:u,link:s})),a},[])}function Rv(){let e=v.useContext(Es);return wv(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function KL(){let e=v.useContext(_c);return wv(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ev=v.createContext(void 0);Ev.displayName="FrameworkContext";function vp(){let e=v.useContext(Ev);return wv(e,"You must render this element inside a <HydratedRouter> element"),e}function GL(e,n){let o=v.useContext(Ev),[a,s]=v.useState(!1),[u,c]=v.useState(!1),{onFocus:d,onBlur:p,onMouseEnter:g,onMouseLeave:y,onTouchStart:h}=n,b=v.useRef(null);v.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=T=>{T.forEach(O=>{c(O.isIntersecting)})},R=new IntersectionObserver(C,{threshold:.5});return b.current&&R.observe(b.current),()=>{R.disconnect()}}},[e]),v.useEffect(()=>{if(a){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[a]);let x=()=>{s(!0)},w=()=>{s(!1),c(!1)};return o?e!=="intent"?[u,b,{}]:[u,b,{onFocus:Xu(d,x),onBlur:Xu(p,w),onMouseEnter:Xu(g,x),onMouseLeave:Xu(y,w),onTouchStart:Xu(h,x)}]:[!1,b,{}]}function Xu(e,n){return o=>{e&&e(o),o.defaultPrevented||n(o)}}function $L({page:e,...n}){let o=_T(),{nonce:a}=vp(),{router:s}=Rv(),u=v.useMemo(()=>gT(s.routes,e,s.basename),[s.routes,e,s.basename]);return u?(n.nonce==null&&a&&(n={...n,nonce:a}),o?v.createElement(QL,{page:e,matches:u,...n}):v.createElement(ZL,{page:e,matches:u,...n})):null}function XL(e){let{manifest:n,routeModules:o}=vp(),[a,s]=v.useState([]);return v.useEffect(()=>{let u=!1;return FL(e,n,o).then(c=>{u||s(c)}),()=>{u=!0}},[e,n,o]),a}function QL({page:e,matches:n,...o}){let a=Hr(),{future:s}=vp(),{basename:u}=Rv(),c=v.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let d=GT(e,u,s.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,g=[];for(let y of n)typeof y.route.shouldRevalidate=="function"?p=!0:g.push(y.route.id);return p&&g.length>0&&d.searchParams.set("_routes",g.join(",")),[d.pathname+d.search]},[u,s.v8_trailingSlashAwareDataRequests,e,a,n]);return v.createElement(v.Fragment,null,c.map(d=>v.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...o})))}function ZL({page:e,matches:n,...o}){let a=Hr(),{future:s,manifest:u,routeModules:c}=vp(),{basename:d}=Rv(),{loaderData:p,matches:g}=KL(),y=v.useMemo(()=>Uw(e,n,g,u,a,"data"),[e,n,g,u,a]),h=v.useMemo(()=>Uw(e,n,g,u,a,"assets"),[e,n,g,u,a]),b=v.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let C=new Set,R=!1;if(n.forEach(O=>{let M=u.routes[O.route.id];!M||!M.hasLoader||(!y.some(A=>A.route.id===O.route.id)&&O.route.id in p&&c[O.route.id]?.shouldRevalidate||M.hasClientLoader?R=!0:C.add(O.route.id))}),C.size===0)return[];let T=GT(e,d,s.v8_trailingSlashAwareDataRequests,"data");return R&&C.size>0&&T.searchParams.set("_routes",n.filter(O=>C.has(O.route.id)).map(O=>O.route.id).join(",")),[T.pathname+T.search]},[d,s.v8_trailingSlashAwareDataRequests,p,a,u,y,n,e,c]),x=v.useMemo(()=>BL(h,u),[h,u]),w=XL(h);return v.createElement(v.Fragment,null,b.map(C=>v.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...o})),x.map(C=>v.createElement("link",{key:C,rel:"modulepreload",href:C,...o})),w.map(({key:C,link:R})=>v.createElement("link",{key:C,nonce:o.nonce,...R,crossOrigin:R.crossOrigin??o.crossOrigin})))}function JL(...e){return n=>{e.forEach(o=>{typeof o=="function"?o(n):o!=null&&(o.current=n)})}}var WL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{WL&&(window.__reactRouterVersion="7.18.5")}catch{}function ez(e,n){return T5({basename:n?.basename,getContext:n?.getContext,future:n?.future,history:Fk({window:n?.window}),hydrationData:tz(),routes:e,mapRouteProperties:wL,hydrationRouteProperties:RL,dataStrategy:n?.dataStrategy,patchRoutesOnNavigation:n?.patchRoutesOnNavigation,window:n?.window,instrumentations:n?.instrumentations}).initialize()}function tz(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:nz(e.errors)}),e}function nz(e){if(!e)return null;let n=Object.entries(e),o={};for(let[a,s]of n)if(s&&s.__type==="RouteErrorResponse")o[a]=new Lc(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(typeof s.__subType=="string"&&d5.includes(s.__subType)){let u=window[s.__subType];if(typeof u=="function")try{let c=new u(s.message);c.stack="",o[a]=c}catch{}}if(o[a]==null){let u=new Error(s.message);u.stack="",o[a]=u}}else o[a]=s;return o}var $T=v.forwardRef(function({onClick:n,discover:o="render",prefetch:a="none",relative:s,reloadDocument:u,replace:c,mask:d,state:p,target:g,to:y,preventScrollReset:h,viewTransition:b,defaultShouldRevalidate:x,...w},C){let{basename:R,navigator:T,useTransitions:O}=v.useContext(po),M=typeof y=="string"&&fp.test(y),A=RT(y,R);y=A.to;let N=rL(y,{relative:s}),k=Hr(),j=null;if(d){let H=kc(d,[],k.mask?k.mask.pathname:"/",!0);R!=="/"&&(H.pathname=H.pathname==="/"?R:Do([R,H.pathname])),j=T.createHref(H)}let[D,z,F]=GL(a,w),G=az(y,{replace:c,mask:d,state:p,target:g,preventScrollReset:h,relative:s,viewTransition:b,defaultShouldRevalidate:x,useTransitions:O});function J(H){n&&n(H),H.defaultPrevented||G(H)}let Y=!(A.isExternal||u),U=v.createElement("a",{...w,...F,href:(Y?j:void 0)||A.absoluteURL||N,onClick:Y?J:n,ref:JL(C,z),target:g,"data-discover":!M&&o==="render"?"true":void 0});return D&&!M?v.createElement(v.Fragment,null,U,v.createElement($L,{page:N})):U});$T.displayName="Link";var ac=v.forwardRef(function({"aria-current":n="page",caseSensitive:o=!1,className:a="",end:s=!1,style:u,to:c,viewTransition:d,children:p,...g},y){let h=Hc(c,{relative:g.relative}),b=Hr(),x=v.useContext(_c),{navigator:w,basename:C}=v.useContext(po),R=x!=null&&dz(h)&&d===!0,T=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,O=b.pathname,M=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;o||(O=O.toLowerCase(),M=M?M.toLowerCase():null,T=T.toLowerCase()),M&&C&&(M=Io(M,C)||M);const A=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let N=O===T||!s&&O.startsWith(T)&&O.charAt(A)==="/",k=M!=null&&(M===T||!s&&M.startsWith(T)&&M.charAt(T.length)==="/"),j={isActive:N,isPending:k,isTransitioning:R},D=N?n:void 0,z;typeof a=="function"?z=a(j):z=[a,N?"active":null,k?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let F=typeof u=="function"?u(j):u;return v.createElement($T,{...g,"aria-current":D,className:z,ref:y,style:F,to:c,viewTransition:d},typeof p=="function"?p(j):p)});ac.displayName="NavLink";var rz=v.forwardRef(({discover:e="render",fetcherKey:n,navigate:o,reloadDocument:a,replace:s,state:u,method:c=Xf,action:d,onSubmit:p,relative:g,preventScrollReset:y,viewTransition:h,defaultShouldRevalidate:b,...x},w)=>{let{useTransitions:C}=v.useContext(po),R=uz(),T=cz(d,{relative:g}),O=c.toLowerCase()==="get"?"get":"post",M=typeof d=="string"&&fp.test(d),A=N=>{if(p&&p(N),N.defaultPrevented)return;N.preventDefault();let k=N.nativeEvent.submitter,j=k?.getAttribute("formmethod")||c,D=()=>R(k||N.currentTarget,{fetcherKey:n,method:j,navigate:o,replace:s,state:u,relative:g,preventScrollReset:y,viewTransition:h,defaultShouldRevalidate:b});C&&o!==!1?v.startTransition(()=>D()):D()};return v.createElement("form",{ref:w,method:O,action:T,onSubmit:a?p:A,...x,"data-discover":!M&&e==="render"?"true":void 0})});rz.displayName="Form";function oz(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function XT(e){let n=v.useContext(Es);return zt(n,oz(e)),n}function az(e,{target:n,replace:o,mask:a,state:s,preventScrollReset:u,relative:c,viewTransition:d,defaultShouldRevalidate:p,useTransitions:g}={}){let y=mp(),h=Hr(),b=Hc(e,{relative:c});return v.useCallback(x=>{if(PL(x,n)){x.preventDefault();let w=o!==void 0?o:zr(h)===zr(b),C=()=>y(e,{replace:w,mask:a,state:s,preventScrollReset:u,relative:c,viewTransition:d,defaultShouldRevalidate:p});g?v.startTransition(()=>C()):C()}},[h,y,b,o,a,s,n,e,u,c,d,p,g])}function iz(e){Un(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=v.useRef(dy(e)),o=v.useRef(!1),a=Hr(),s=v.useMemo(()=>kL(a.search,o.current?null:n.current),[a.search]),u=mp(),c=v.useCallback((d,p)=>{const g=dy(typeof d=="function"?d(new URLSearchParams(s)):d);o.current=!0,u("?"+g,p)},[u,s]);return[s,c]}var sz=0,lz=()=>`__${String(++sz)}__`;function uz(){let{router:e}=XT("useSubmit"),{basename:n}=v.useContext(po),o=gL(),a=e.fetch,s=e.navigate;return v.useCallback(async(u,c={})=>{let{action:d,method:p,encType:g,formData:y,body:h}=_L(u,n);if(c.navigate===!1){let b=c.fetcherKey||lz();await a(b,o,c.action||d,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:h,formMethod:c.method||p,formEncType:c.encType||g,flushSync:c.flushSync})}else await s(c.action||d,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:h,formMethod:c.method||p,formEncType:c.encType||g,replace:c.replace,state:c.state,fromRouteId:o,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,s,n,o])}function cz(e,{relative:n}={}){let{basename:o}=v.useContext(po),a=v.useContext($o);zt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),u={...Hc(e||".",{relative:n})},c=Hr();if(e==null){u.search=c.search;let d=new URLSearchParams(u.search),p=d.getAll("index");if(p.some(y=>y==="")){d.delete("index"),p.filter(h=>h).forEach(h=>d.append("index",h));let y=d.toString();u.search=y?`?${y}`:""}}return(!e||e===".")&&s.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(u.pathname=u.pathname==="/"?o:Do([o,u.pathname])),zr(u)}function dz(e,{relative:n}={}){let o=v.useContext(vv);zt(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=XT("useViewTransitionState"),s=Hc(e,{relative:n});if(!o.isTransitioning)return!1;let u=Io(o.currentLocation.pathname,a)||o.currentLocation.pathname,c=Io(o.nextLocation.pathname,a)||o.nextLocation.pathname;return xh(s.pathname,c)!=null||xh(s.pathname,u)!=null}function fz(e){return v.createElement(CL,{flushSync:cr.flushSync,...e})}function bs({controlled:e,default:n,name:o,state:a="value"}){const{current:s}=v.useRef(e!==void 0),[u,c]=v.useState(()=>n),d=s&&e!==void 0?e:u,p=v.useCallback(g=>{s||c(g)},[]);return[d,p]}function hz(e){const{open:n,defaultOpen:o=!1,onOpenChange:a,disabled:s}=e,[u,c]=bs({controlled:n,default:o,name:"Collapsible",state:"open"}),{mounted:d,setMounted:p,transitionStatus:g}=ws(u,!0,!0),y=Tr(),[h,b]=v.useState(),x=h===null?void 0:h??y,w=Be(C=>{const R=!u,T=dt(qo,C.nativeEvent);a(R,T),!T.isCanceled&&c(R)});return v.useMemo(()=>({defaultPanelId:y,disabled:s,handleTrigger:w,mounted:d,open:u,panelId:x,setMounted:p,setOpen:c,setPanelIdState:b,transitionStatus:g}),[y,s,w,d,u,x,p,c,b,g])}const QT=v.createContext(void 0);function ZT(){const e=v.useContext(QT);if(e===void 0)throw new Error(Rn(15));return e}const pz="data-open",gz="data-closed",Df=Hy,mz="data-panel-open",yz={[pz]:""},vz={[gz]:""},bz={open(e){return e?{[mz]:""}:null}},xz={open(e){return e?yz:vz}},JT={...xz,...pa},Sz=v.forwardRef(function(n,o){const{render:a,className:s,defaultOpen:u=!1,disabled:c=!1,onOpenChange:d,open:p,style:g,...y}=n,h=Be(d),b=hz({open:p,defaultOpen:u,onOpenChange:h,disabled:c}),x=v.useMemo(()=>({open:b.open,disabled:b.disabled,transitionStatus:b.transitionStatus}),[b.open,b.disabled,b.transitionStatus]),w=v.useMemo(()=>({...b,onOpenChange:h,state:x}),[b,h,x]),C=Mt("div",n,{state:x,ref:o,props:y,stateAttributesMapping:JT});return S.jsx(QT.Provider,{value:w,children:C})}),WT=v.createContext(void 0);function Cv(e=!1){const n=v.useContext(WT);if(n===void 0&&!e)throw new Error(Rn(16));return n}function wz(e){const{focusableWhenDisabled:n,disabled:o,composite:a=!1,tabIndex:s=0,isNativeButton:u}=e,c=a&&n!==!1,d=a&&n===!1;return{props:v.useMemo(()=>{const g={onKeyDown(y){o&&n&&y.key!=="Tab"&&y.preventDefault()}};return a||(g.tabIndex=s,!u&&o&&(g.tabIndex=n?s:-1)),(u&&(n||c)||!u&&o)&&(g["aria-disabled"]=o),u&&(!n||d)&&(g.disabled=o),g},[a,o,n,c,d,u,s])}}function hs(e,n,{detail:o=0,pointerType:a=""}={}){e.dispatchEvent(new(wn(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:o,pointerType:a,shiftKey:n.shiftKey,ctrlKey:n.ctrlKey,altKey:n.altKey,metaKey:n.metaKey}))}function ma(e={}){const{disabled:n=!1,focusableWhenDisabled:o,tabIndex:a=0,native:s=!0,composite:u}=e,c=v.useRef(null),d=Cv(!0),p=u??d!==void 0,{props:g}=wz({focusableWhenDisabled:o,disabled:n,composite:p,tabIndex:a,isNativeButton:s}),y=v.useCallback(()=>{const x=c.current;j0(x)&&p&&n&&g.disabled===void 0&&x.disabled&&(x.disabled=!1)},[n,g.disabled,p]);_e(y,[y]);const h=v.useCallback((x={})=>{const{onClick:w,onMouseDown:C,onKeyUp:R,onKeyDown:T,onPointerDown:O,...M}=x;return Lr({onClick(A){if(n){A.preventDefault();return}w?.(A)},onMouseDown(A){n||C?.(A)},onKeyDown(A){if(n||(ch(A),T?.(A),A.baseUIHandlerPrevented))return;const N=A.target===A.currentTarget,k=A.currentTarget,j=j0(k),D=!s&&Rz(k),z=N&&(s?j:!D),F=A.key==="Enter",G=A.key===" ",J=k.getAttribute("role"),Y=J?.startsWith("menuitem")||J==="option"||J==="gridcell";if(N&&p&&G){if(A.defaultPrevented&&Y)return;A.preventDefault(),(!s||j)&&(A.preventBaseUIHandler(),hs(k,A));return}if(!z||s||!G&&!F){N&&D&&G&&A.preventDefault();return}A.defaultPrevented||(A.preventDefault(),F&&(A.preventBaseUIHandler(),hs(k,A)))},onKeyUp(A){if(!n){if(ch(A),R?.(A),A.target===A.currentTarget&&s&&p&&j0(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!s&&!p&&!A.defaultPrevented&&A.key===" "&&(A.preventBaseUIHandler(),hs(A.currentTarget,A))}},onPointerDown(A){if(n){A.preventDefault();return}O?.(A)}},s?{type:"button"}:{role:"button"},g,M)},[n,g,p,s]),b=Be(x=>{c.current=x,y()});return{getButtonProps:h,buttonRef:b}}function j0(e){return yn(e)&&e.tagName==="BUTTON"}function Rz(e){return yn(e)&&e.tagName==="A"&&!!e.href}const Ez={...bz,...pa},Cz=v.forwardRef(function(n,o){const{panelId:a,open:s,handleTrigger:u,state:c,disabled:d}=ZT(),{className:p,disabled:g=d,render:y,nativeButton:h=!0,style:b,...x}=n,{getButtonProps:w,buttonRef:C}=ma({disabled:g,native:h});return Mt("button",n,{state:c,ref:[o,C],props:[{"aria-controls":s?a:void 0,"aria-expanded":s,onClick:u},x,w],stateAttributesMapping:Ez})}),hl={height:void 0,width:void 0};function Tz(e){const{externalRef:n,hiddenUntilFound:o,id:a,keepMounted:s,mounted:u,onOpenChange:c,open:d,setMounted:p,setOpen:g,transitionStatus:y}=e,h=v.useRef(null),b=v.useRef(null),[x,w]=v.useState(hl),C=v.useRef(hl),R=v.useRef(!1),T=v.useRef(d),O=v.useRef(!1),[M,A]=v.useState(!1),N=v.useRef(null),k=Xr(n,h),j=kn(d),D=$h(h),z=!d&&!u,F=M?"idle":y,G=d&&(T.current||O.current),J=!d&&u&&b.current==="css-animation"&&x.height===void 0&&x.width===void 0?C.current:x,Y=o&&z&&b.current!=="css-animation",U=Be((V,X=!0)=>{X&&(C.current=V),w(V)}),H=Be(()=>{N.current?.(),N.current=null}),L=Be(V=>{H(),N.current=()=>{N.current=null,V()}}),$=Be(()=>{d&&u&&b.current==="css-animation"&&(O.current=!0)});_e(()=>{!M||y==="starting"||A(!1)},[M,y]),v.useEffect(()=>()=>{$(),H()},[$,H]),_e(()=>{d||(T.current=!1,O.current=!1);const V=h.current;if(!V)return;!d&&N.current&&H();const X=Oz(V,G);if(b.current=X,d&&y==="idle"&&T.current&&X==="css-animation"){C.current=pl(V);return}if(d&&y==="starting"){const se=R.current;if(R.current=!1,X==="none"){U(pl(V)),A(!0);return}if(X==="css-transition"){const W=Mz(V);if(U(pl(V)),!se)return W;const re=Nf(V,"transition-duration","0s");return L(re),A(!0),W}U(pl(V));const I=Nf(V,"animation-name","none");if(!se){I();return}const B=Nf(V,"animation-duration","0s");I(),L(B),A(!0);return}if(!d&&u&&(y==="idle"||y==="starting")){if(X==="none"){U(hl,!1),p(!1);return}U(pl(V));return}if(y!=="ending")return;if(X==="none"){p(!1);return}const ee=pl(V);if(!(ee.height>0||ee.width>0)){p(!1);return}U(ee),X==="css-animation"&&Nf(V,"animation-name","none")()},[u,d,H,U,p,L,G,y]),jo({enabled:d&&u&&F==="idle",open:!0,ref:h,onComplete(){d&&U(hl,!1)}}),v.useEffect(()=>{if(d||!u||F!=="ending")return;if(!h.current){p(!1),U(hl,!1);return}const X=new AbortController;let ee=-1;function q(){j.current||(p(!1),U(hl,!1))}return ee=Cr.request(()=>{D(q,X.signal)}),()=>{Cr.cancel(ee),X.abort()}},[j,u,d,F,D,U,p]),_e(()=>{const V=h.current;!V||!o||!z||V.setAttribute("hidden","until-found")},[z,o]),v.useEffect(function(){const X=h.current;if(!X)return;const ee=No.create();let q=-1;const se=(W,re)=>{ee.start(0,()=>{j.current||(q=Cr.request(()=>{j.current||(W&&(R.current=!1),re&&X.setAttribute(Df,""),X.setAttribute("hidden","until-found"))}))})},B=jt(X,"beforematch",W=>{const re=dt(_r,W);if(c(!0,re),re.isCanceled){se(!1,!1);return}R.current=!0;const Re=X.hasAttribute(Df);X.removeAttribute(Df),g(!0),se(!0,Re)});return()=>{ee.clear(),Cr.cancel(q),B()}},[j,c,g]);const K=s||o||u||d;return{height:J.height,props:{...Y?{[Df]:""}:void 0,hidden:z,id:a},ref:k,shouldPreventOpenAnimation:G,shouldRender:K,transitionStatus:F,width:J.width}}function pl(e){return{height:e.scrollHeight,width:e.scrollWidth}}function Oz(e,n){const o=wn(e).getComputedStyle(e),a=(o.animationName.split(",").map(u=>u.trim()).some(u=>u!==""&&u!=="none")||n)&&Fw(o.animationDuration),s=Fw(o.transitionDuration);return a&&s||s?"css-transition":a?"css-animation":"none"}function Fw(e){return e.split(",").map(n=>n.trim()).some(n=>n!==""&&Number.parseFloat(n)>0)}function Nf(e,n,o){const a=e.style.getPropertyValue(n),s=e.style.getPropertyPriority(n);return e.style.setProperty(n,o),()=>{if(a===""){e.style.removeProperty(n);return}e.style.setProperty(n,a,s)}}function Mz(e){const n={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(n).forEach(s=>{e.style.setProperty(s,"initial","important")});function o(){Object.entries(n).forEach(([s,u])=>{if(u===""){e.style.removeProperty(s);return}e.style.setProperty(s,u)})}const a=Cr.request(o);return()=>{Cr.cancel(a),o()}}const Az="--collapsible-panel-height",Dz="--collapsible-panel-width",Nz=v.forwardRef(function(n,o){const{className:a,hiddenUntilFound:s,keepMounted:u,render:c,id:d,style:p,...g}=n,{defaultPanelId:y,mounted:h,onOpenChange:b,open:x,setMounted:w,setPanelIdState:C,setOpen:R,state:T,transitionStatus:O}=ZT(),M=s??!1,A=u??!1,N=d||void 0,k=N??y;_e(()=>(C($=>N??($===null?void 0:$)),()=>{C($=>$===N?null:$)}),[N,C]);const{height:j,props:D,ref:z,shouldPreventOpenAnimation:F,shouldRender:G,transitionStatus:J,width:Y}=Tz({externalRef:o,hiddenUntilFound:M,id:k,keepMounted:A,mounted:h,onOpenChange:b,open:x,setMounted:w,setOpen:R,transitionStatus:O}),U={...T,transitionStatus:J},H=fE(p,U),L=Mt("div",{...n,style:void 0},{state:U,ref:z,props:[D,{style:{[Az]:j===void 0?"auto":`${j}px`,[Dz]:Y===void 0?"auto":`${Y}px`}},g,H?{style:H}:void 0,F?{style:{animationName:"none"}}:void 0],stateAttributesMapping:JT});return G?L:null});function Iz({...e}){return S.jsx(Sz,{"data-slot":"collapsible",...e})}function jz({...e}){return S.jsx(Cz,{"data-slot":"collapsible-trigger",...e})}function Pz({...e}){return S.jsx(Nz,{"data-slot":"collapsible-content",...e})}const eO=v.createContext(void 0);function kz(e){const n=v.useContext(eO);if(n===void 0)throw new Error(Rn(33));return n}const bp=v.createContext(void 0);function Va(e){const n=v.useContext(bp);if(n===void 0&&!e)throw new Error(Rn(36));return n}const tO=v.createContext(void 0);function xp(e=!0){const n=v.useContext(tO);if(n===void 0&&!e)throw new Error(Rn(25));return n}const nO=v.createContext(null);function Sp(e="root"){const n=v.useContext(nO),o=v.useContext(bp);return n===null||o===void 0?null:(e==="submenu-trigger"?o.virtualFocus||o.parentVirtualFocus:o.virtualFocus)?n:null}const Lz={visible:!0,ref:null};function zz(){return Lz}function rO(e,n,o="root"){const a=Sp(o),u=((o==="submenu-trigger"?a?.useSubmenuTrigger:a?.useItem)??zz)({label:e.label,children:e.children,render:e.render}),c=Xr(n,u.ref);return{visible:u.visible,ref:c,props:u.props}}function _z(e){e.preventDefault()}function Hz(e){const{closeOnClick:n,highlighted:o,id:a,nodeId:s,store:u,typingRef:c,itemRef:d,itemMetadata:p}=e,g=Va(),y=xp(!0),h=p.type==="submenu-trigger",b=h?g.parentVirtualFocus:g.virtualFocus,w=(h&&g.parent.type==="menu"?g.parent.store:g.store).useState("webkitAriaSelected",o),{events:C}=u.useState("floatingTreeRoot"),R=u.useState("open"),T=y!==void 0,O=!b&&R&&o?0:-1;return v.useMemo(()=>({id:a,role:"menuitem",tabIndex:O,"aria-selected":w,onMouseDown:b?_z:void 0,onKeyDown(M){M.key===" "&&c?.current&&M.preventDefault()},onMouseMove(M){s&&C.emit("itemhover",{nodeId:s,target:M.currentTarget})},onClick(M){n&&C.emit("close",{domEvent:M.nativeEvent,reason:fs})},onMouseUp(M){if(y){const A=y.initialCursorPointRef.current;if(y.initialCursorPointRef.current=null,T&&A&&Math.abs(M.clientX-A.x)<=1&&Math.abs(M.clientY-A.y)<=1||T&&!Iy&&M.button===2)return}d.current&&u.context.allowMouseUpTriggerRef.current&&(!T||M.button===2)&&p.type==="regular-item"&&hs(d.current,M,{detail:1,pointerType:"mouse"})}}),[n,O,a,C,s,u.context.allowMouseUpTriggerRef,c,d,y,T,p.type,w,b])}const oO={type:"regular-item"};function aO(e){const{closeOnClick:n,disabled:o,highlighted:a,id:s,store:u,typingRef:c=u.context.typingRef,nativeButton:d,itemMetadata:p,nodeId:g}=e,y=v.useRef(null),{getButtonProps:h,buttonRef:b}=ma({disabled:o,focusableWhenDisabled:!0,native:d,composite:!0}),x=Hz({closeOnClick:n,highlighted:a,id:s,nodeId:g,store:u,typingRef:c,itemRef:y,itemMetadata:p}),w=v.useCallback(R=>Lr(x,{onMouseEnter(T){p.type==="submenu-trigger"&&p.setActive(T.nativeEvent)}},R,h),[x,h,p]),C=Xr(y,b);return v.useMemo(()=>({getItemProps:w,itemRef:C}),[w,C])}const iO=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Uz(){return v.useContext(iO)}function wp(e={}){const{guess:n,label:o,metadata:a,textRef:s,index:u}=e,{register:c,unregister:d,subscribeMapChange:p,nextIndexRef:g}=Uz(),y=v.useRef(-1),[h,b]=v.useState(u==null&&n?()=>{if(y.current===-1){const R=g.current;g.current+=1,y.current=R}return y.current}:-1),x=u??h,w=v.useRef(null),C=v.useCallback(R=>{const T=w.current;T&&d(T),w.current=R,R&&c(R,{metadata:a??null,index:u??null,label:o,textRef:s})},[u,c,d,a,o,s]);return _e(()=>{if(u==null)return p(R=>{const T=w.current?R.get(w.current)?.index:null;T!=null&&b(T)})},[u,p]),{ref:C,index:x}}const Fz="data-checked",Bz="data-unchecked",sO={checked(e){return e?{[Fz]:""}:{[Bz]:""}},...pa},Tv=v.createContext(void 0);function Vz(){const e=v.useContext(Tv);if(e===void 0)throw new Error(Rn(31));return e}const qz=v.forwardRef(function(n,o){const{render:a,className:s,style:u,...c}=n,[d,p]=v.useState(void 0),g=Mt("div",n,{ref:o,props:{role:"group","aria-labelledby":d,...c}});return S.jsx(Tv.Provider,{value:p,children:g})}),Yz=v.forwardRef(function(n,o){const a=Sp()?.Group??qz;return S.jsx(a,{...n,ref:o})}),Kz=v.forwardRef(function(n,o){const{render:a,className:s,style:u,id:c,...d}=n,p=Tr(c),g=Vz();return _e(()=>(g(p),()=>{g(y=>y===p?void 0:y)}),[g,p]),Mt("div",n,{ref:o,props:{id:p,"aria-hidden":!0,...d}})}),Gz=v.forwardRef(function(n,o){const{render:a,className:s,id:u,label:c,nativeButton:d=!1,disabled:p=!1,closeOnClick:g=!0,style:y,...h}=n,{store:b}=Va(),x=wp({guess:!0,label:c}),w=Tr(u),C=b.useState("disabled"),R=b.useState("isActive",x.index),T=b.useState("floatingNodeId"),O=b.useState("itemProps"),M=p||C,{getItemProps:A,itemRef:N}=aO({closeOnClick:g,disabled:M,highlighted:R,id:w,store:b,nativeButton:d,nodeId:T,itemMetadata:oO});return Mt("div",n,{state:{disabled:M,highlighted:R},props:[O,h,A],ref:[N,o,x.ref]})}),lO=v.forwardRef(function(n,o){const a=rO(n,o);return a.visible?S.jsx(Gz,{...n,ref:a.ref}):null}),$z=v.createContext(void 0);function Ov(e){return v.useContext($z)}const fy="ArrowUp",hy="ArrowDown",py="ArrowLeft",gy="ArrowRight",my="Home",yy="End",Uc=new Set([fy,hy,py,gy,my,yy]),uO="Shift",Xz=[uO,"Control","Alt","Meta"];function Qz(e){return yn(e)&&e.tagName==="INPUT"}function Bw(e){return!!(Qz(e)&&e.selectionStart!=null||yn(e)&&e.tagName==="TEXTAREA")}function Vw(e,n,o,a){if(!e||!n||!n.scrollTo)return;let s=e.scrollLeft,u=e.scrollTop;const c=e.clientWidth<e.scrollWidth,d=e.clientHeight<e.scrollHeight;if(c&&a!=="vertical"){const p=qw(e,n,"left"),g=If(e),y=If(n);o==="ltr"&&(p+n.offsetWidth+y.scrollMarginRight>e.scrollLeft+e.clientWidth-g.scrollPaddingRight?s=p+n.offsetWidth+y.scrollMarginRight-e.clientWidth+g.scrollPaddingRight:p-y.scrollMarginLeft<e.scrollLeft+g.scrollPaddingLeft&&(s=p-y.scrollMarginLeft-g.scrollPaddingLeft)),o==="rtl"&&(p-y.scrollMarginLeft<e.scrollLeft+g.scrollPaddingLeft?s=p-y.scrollMarginLeft-g.scrollPaddingLeft:p+n.offsetWidth+y.scrollMarginRight>e.scrollLeft+e.clientWidth-g.scrollPaddingRight&&(s=p+n.offsetWidth+y.scrollMarginRight-e.clientWidth+g.scrollPaddingRight))}if(d&&a!=="horizontal"){const p=qw(e,n,"top"),g=If(e),y=If(n);p-y.scrollMarginTop<e.scrollTop+g.scrollPaddingTop?u=p-y.scrollMarginTop-g.scrollPaddingTop:p+n.offsetHeight+y.scrollMarginBottom>e.scrollTop+e.clientHeight-g.scrollPaddingBottom&&(u=p+n.offsetHeight+y.scrollMarginBottom-e.clientHeight+g.scrollPaddingBottom)}e.scrollTo({left:s,top:u,behavior:"auto"})}function qw(e,n,o){const a=o==="left"?"offsetLeft":"offsetTop";let s=0;for(;n.offsetParent&&(s+=n[a],n.offsetParent!==e);)n=n.offsetParent;return s}function If(e){const n=getComputedStyle(e);return{scrollMarginTop:parseFloat(n.scrollMarginTop)||0,scrollMarginRight:parseFloat(n.scrollMarginRight)||0,scrollMarginBottom:parseFloat(n.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(n.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(n.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(n.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(n.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(n.scrollPaddingLeft)||0}}const Zz=v.createContext(void 0);function Jz(){return v.useContext(Zz)}function Wz(e,n){const o=$y(e.render);if(v.isValidElement(o)){const a=o.props;if(Object.hasOwn(a,"id"))return a.id??""}return e.id??n}function e_(e,n,o){const a=Wz(e,n),s=a===n?void 0:a,u=v.useCallback(c=>o?.(c?s:void 0),[s,o]);return[a,u]}function t_(e,n,o){const a=$y(e.render),s=v.isValidElement(a)?a.props:void 0,u=e["aria-label"]??s?.["aria-label"];let c=e["aria-labelledby"]??s?.["aria-labelledby"];return c==null&&!u&&(c=n?n.id||void 0:o||void 0),c}const n_=v.forwardRef(function(n,o){const{render:a,className:s,style:u,finalFocus:c,id:d,initialFocus:p,...g}=n,{store:y,defaultFloatingId:h,setRenderedFloatingId:b,virtualFocus:x,orientation:w}=Va(),C=Jz(),{side:R,align:T}=kz(),O=Ov()!=null,M=y.useState("open"),A=y.useState("transitionStatus"),N=y.useState("popupProps"),k=y.useState("mounted"),j=y.useState("instantType"),D=y.useState("activeTriggerElement"),z=y.useState("parent"),F=y.useState("lastOpenChangeReason"),G=y.useState("rootId"),J=y.useState("floatingRootContext"),Y=y.useState("floatingTreeRoot"),U=y.useState("closeDelay"),H=y.useState("hoverEnabled"),L=y.useState("disabled"),$=y.useState("openMethod"),K=y.useState("activeTriggerId"),V=y.useState("listElement"),[X,ee]=e_(n,h,b),q=t_(n,D,K),se=z.type==="menu"?C:void 0,I=z.type==="context-menu";let B=p??z.type!=="menu";p===void 0&&V&&z.type!=="menu"&&(B=()=>y.state.activeIndex!==null?!1:V),jo({open:M,ref:y.context.popupRef,onComplete(){M&&y.context.onOpenChangeComplete?.(!0)}}),v.useEffect(()=>{function ve(ke){y.setOpen(!1,dt(ke.reason,ke.domEvent))}return Y.events.on("close",ve),()=>{Y.events.off("close",ve)}},[Y.events,y]),nv(J,{enabled:H&&!L&&!I&&z.type!=="menubar",closeDelay:U});const W=y.useStateSetter("popupElement"),re=v.useContext(nO)?.useParentHandoff??o_,{parentVirtualFocusRef:Re,handleFocus:le}=re(y,z,M,x),me={transitionStatus:A,side:R,align:T,open:M,nested:z.type==="menu",instant:j},ge=Mt("div",n,{state:me,ref:[o,y.context.popupRef,W,ee],stateAttributesMapping:Uh,props:[N,{id:X,...V?{role:"presentation"}:{role:"menu","aria-orientation":w==="horizontal"?"horizontal":void 0,"aria-labelledby":q},onKeyDown(ve){se?.onPopupKeyDown?.(ve),O&&Uc.has(ve.key)&&ve.stopPropagation()},onFocus:le},Pc(A),g,{"data-rootownerid":G}]});let ce=z.type===void 0||I;(D||z.type==="menubar"&&F!==Fh)&&(ce=!0);const Te=se?.getReturnElement??Re;return S.jsx(Gh,{context:J,openInteractionType:$,modal:I,disabled:!k,returnFocus:c??Te??ce,explicitReturnFocus:c===void 0&&Te?!1:void 0,initialFocus:B,restoreFocus:!0,getInsideElements:z.type===void 0?()=>[y.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:z.type!=="menubar"?Y:void 0,previousFocusableElement:D,nextFocusableElement:z.type===void 0?y.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:y.context.beforeContentFocusGuardRef,children:ge})}),r_={parentVirtualFocusRef:void 0,handleFocus:void 0};function o_(){return r_}const cO=v.forwardRef(function(n,o){const a=Sp()?.Popup??n_;return S.jsx(a,{...n,ref:o})}),dO=v.createContext(void 0);function a_(){const e=v.useContext(dO);if(e===void 0)throw new Error(Rn(32));return e}const fO=v.forwardRef(function(n,o){const{keepMounted:a=!1,...s}=n,{store:u,parent:c}=Va();if(!(u.useState("mounted")||a))return null;const g=c.type==="menu"||c.type==="menubar"?"group":void 0;return S.jsx(dO.Provider,{value:a,children:S.jsx(Kh,{ref:o,...s,portalOwnerRole:g})})});function Mv(e){const{children:n,elementsRef:o,labelsRef:a,onMapChange:s}=e,u=Be(s),[,c]=v.useState(0),d=er(s_).current,p=er(i_).current,g=v.useRef(0),y=v.useRef(!0),h=v.useRef(null),b=v.useRef(null),x=Be(()=>{y.current||(y.current=!0,c(N=>N+1))}),w=Be((N,k)=>{p.set(N,k),x()}),C=Be(N=>{p.delete(N),x()}),R=Be(N=>{const k=new Map;return o.current.length=0,a&&(a.current.length=0),N.forEach(j=>{k.set(j.element,{...j.registration.metadata??{},index:j.index}),o.current[j.index]=j.element,a&&(a.current[j.index]=j.registration.label!==void 0?j.registration.label:j.registration.textRef?.current?.textContent??j.element.textContent)}),g.current=o.current.length,k});function T(N){if(b.current?.disconnect(),b.current=null,typeof MutationObserver!="function"||N.length<2)return;const k=new MutationObserver(D=>{if(!c_(D))return;let z=null;for(const F of N)if(F.isConnected){if(z&&hO(z,F)>0){k.disconnect(),x();return}z=F}});b.current=k;const j=new Set;for(let D=1;D<N.length;D+=1){const z=u_(N[D-1],N[D]);z&&j.add(z)}j.forEach(D=>k.observe(D,{childList:!0}))}const O=Be(()=>{const[N,k]=l_(p),j=R(N),D=h.current,z=!D||D.length!==N.length||N.some((F,G)=>{const J=D[G];return F.index!==J.index||F.element!==J.element||F.registration.index!==J.registration.index||F.registration.metadata!==J.registration.metadata});T(k),h.current=N,y.current=!1,z&&(d.forEach(F=>F(j)),u(j))});_e(()=>(!y.current&&h.current&&R(h.current),()=>{o.current=[],a&&(a.current=[])}),[o,a,R]),_e(()=>{y.current&&O()}),_e(()=>()=>{b.current?.disconnect(),y.current=!0},[]);const M=Be(N=>(d.add(N),()=>{d.delete(N)})),A=v.useMemo(()=>({register:w,unregister:C,subscribeMapChange:M,nextIndexRef:g}),[w,C,M,g]);return S.jsx(iO.Provider,{value:A,children:n})}function i_(){return new Map}function s_(){return new Set}function l_(e){const n=new Set,o=[],a=[];e.forEach((u,c)=>{if(!c.isConnected)return;const d=u.index,p={index:d??-1,element:c,registration:u};d===null?a.push(p):d>=0&&(n.add(d),o.push(p))});let s=0;return a.sort((u,c)=>hO(u.element,c.element)),a.forEach(u=>{for(;n.has(s);)s+=1;u.index=s,o.push(u),s+=1}),n.size>0&&o.sort((u,c)=>u.index-c.index),[o,a.map(u=>u.element)]}function u_(e,n){let o=e.parentElement;for(;o&&!o.contains(n);)o=o.parentElement;return o}function c_(e){for(const n of e)for(let o=0;o<n.removedNodes.length;o+=1)if(n.removedNodes[o].isConnected)return!0;return!1}function hO(e,n){return e.nextElementSibling===n?-1:n.nextElementSibling===e?1:e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const Rp=v.forwardRef(function(n,o){const{cutout:a,...s}=n;let u;if(a){const c=a.getBoundingClientRect();u=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${c.left}px ${c.top}px,${c.left}px ${c.bottom}px,${c.right}px ${c.bottom}px,${c.right}px ${c.top}px,${c.left}px ${c.top}px)`}return S.jsx("div",{ref:o,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:u}})});function pO(e){const{store:n,domReference:o,positionerElement:a,open:s}=e,u=v.useRef(null),c=v.useRef(null),d=$h(a);_e(()=>{s||(c.current?.abort(),c.current=null,n.state.instantType==="trigger-change"&&n.set("instantType",void 0))},[s,n]),_e(()=>{const p=o,g=u.current;if(p&&(u.current=p),!g||!p||p===g||!n.select("open"))return;n.set("instantType",void 0);const y=new AbortController;return c.current=y,d(()=>{n.select("open")&&n.set("instantType","trigger-change")},y.signal),()=>{y.abort()}},[o,d,n])}let Yw={},Kw={},Gw="";function Ep(e,n){return Cc(e)?e:n}function $w(e,n,o){return/hidden|clip/.test(e.getComputedStyle(Ep(n,o)).overflowY)}function d_(e){if(typeof document>"u")return!1;const n=Kt(e);return wn(n).innerWidth-n.documentElement.clientWidth>0}function f_(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const o=Kt(e),a=o.documentElement,s=o.body,u=Ep(a,s),c=u.style.overflowY,d=a.style.scrollbarGutter;a.style.scrollbarGutter="stable",u.style.overflowY="scroll";const p=u.offsetWidth;u.style.overflowY="hidden";const g=u.offsetWidth;return u.style.overflowY=c,a.style.scrollbarGutter=d,p===g}function h_(e){const n=Kt(e),o=n.documentElement,a=n.body,s=Ep(o,a),u={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,u)}}function p_(e){const n=Kt(e),o=n.documentElement,a=n.body,s=wn(o);let u=0,c=0,d=!1;const p=Cr.create();if(ha&&(s.visualViewport?.scale??1)!==1)return()=>{};function g(){const x=s.getComputedStyle(o),w=s.getComputedStyle(a),T=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";u=o.scrollTop,c=o.scrollLeft,Yw={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY,overflowX:o.style.overflowX},Gw=o.style.scrollBehavior,Kw={position:a.style.position,height:a.style.height,width:a.style.width,boxSizing:a.style.boxSizing,overflowY:a.style.overflowY,overflowX:a.style.overflowX,scrollBehavior:a.style.scrollBehavior};const O=o.scrollHeight>o.clientHeight,M=o.scrollWidth>o.clientWidth,A=x.overflowY==="scroll"||w.overflowY==="scroll",N=x.overflowX==="scroll"||w.overflowX==="scroll",k=Math.max(0,s.innerWidth-a.clientWidth),j=Math.max(0,s.innerHeight-a.clientHeight),D=parseFloat(w.marginTop)+parseFloat(w.marginBottom),z=parseFloat(w.marginLeft)+parseFloat(w.marginRight),F=Ep(o,a);if(d=f_(e),d){o.style.scrollbarGutter=T,F.style.overflowY="hidden",F.style.overflowX="hidden";return}Object.assign(o.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(O||A)&&(o.style.overflowY="scroll"),(M||N)&&(o.style.overflowX="scroll"),Object.assign(a.style,{position:"relative",height:D||j?`calc(100dvh - ${D+j}px)`:"100dvh",width:z||k?`calc(100vw - ${z+k}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),a.scrollTop=u,a.scrollLeft=c,o.setAttribute("data-base-ui-scroll-locked",""),o.style.scrollBehavior="unset"}function y(){Object.assign(o.style,Yw),Object.assign(a.style,Kw),d||(o.scrollTop=u,o.scrollLeft=c,o.removeAttribute("data-base-ui-scroll-locked"),o.style.scrollBehavior=Gw)}function h(){y(),p.request(g)}g();const b=jt(s,"resize",h);return()=>{p.cancel(),y(),typeof s.removeEventListener=="function"&&b()}}class g_{lockCount=0;restore=null;timeoutLock=No.create();timeoutUnlock=No.create();acquire(n){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(n)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(n){if(this.lockCount===0||this.restore!==null)return;const o=Kt(n),a=o.documentElement,s=o.body,u=wn(a);if($w(u,a,s)){const d=new u.MutationObserver(()=>{$w(u,a,s)||(d.disconnect(),this.restore=null,this.lock(n))}),p={attributes:!0};d.observe(a,p),d.observe(s,p),this.restore=()=>d.disconnect();return}const c=Ph||!d_(n);this.restore=c?h_(n):p_(n)}}const m_=new g_;function gO(e=!0,n=null){_e(()=>{if(e)return m_.acquire(n)},[e,n])}const y_=20;function Av(e,n,o,a){const[s,u]=v.useState(!1);_e(()=>{if(!e||!n||o==null){u(!1);return}const c=Kt(o).documentElement.clientWidth,d=o.offsetWidth;u(c>0&&d>0&&d>=c-y_)},[e,n,o]),gO(e&&(!n||s),a)}const mO=v.forwardRef(function(n,o){const{anchor:a,positionMethod:s="absolute",className:u,render:c,side:d,align:p,sideOffset:g=0,alignOffset:y=0,collisionBoundary:h="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:R=xE,style:T,...O}=n,{store:M,virtualFocus:A,syncHighlightedItem:N}=Va(),k=a_(),j=xp(!0),D=M.useState("parent"),z=M.useState("floatingRootContext"),F=M.useState("floatingTreeRoot"),G=M.useState("mounted"),J=M.useState("open"),Y=M.useState("modal"),U=M.useState("openMethod"),H=M.useState("activeTriggerElement"),L=M.useState("transitionStatus"),$=M.useState("positionerElement"),K=M.useState("instantType"),V=M.useState("adaptiveOrigin"),X=M.useState("lastOpenChangeReason"),ee=M.useState("floatingNodeId"),q=M.useState("floatingParentNodeId"),se=z.useState("domReferenceElement");let I=a,B=g,W=y,re=p,Re=R;D.type==="context-menu"&&(I=a??D.context?.anchor,re=re??"start",!d&&re!=="center"&&(W=n.alignOffset??2,B=n.sideOffset??-5));let le=d,me=re;D.type==="menu"?(le=le??"inline-end",me=me??"start",Re=n.collisionAvoidance??Xy):D.type==="menubar"&&(le=le??(D.context.orientation==="vertical"?"inline-end":"bottom"),me=me??"start");const ge=D.type==="context-menu",ce=ip({anchor:I,floatingRootContext:z,positionMethod:j?"fixed":s,mounted:G,side:le,sideOffset:B,align:me,alignOffset:W,arrowPadding:ge?0:x,collisionBoundary:h,collisionPadding:b,sticky:w,nodeId:ee,keepMounted:k,disableAnchorTracking:C,collisionAvoidance:Re,shift:ge?{crossAxis:!("side"in Re&&Re.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:F,adaptiveOrigin:V,lazyFlip:A?"placement":!1});v.useEffect(()=>{function He(be){be.open&&(be.parentNodeId===ee&&M.set("hoverEnabled",!1),be.nodeId!==ee&&be.parentNodeId===M.select("floatingParentNodeId")&&M.setOpen(!1,dt(Zu)))}return F.events.on("menuopenchange",He),()=>{F.events.off("menuopenchange",He)}},[M,F.events,ee]),v.useEffect(()=>{if(M.select("floatingParentNodeId")==null)return;function He(be){if(be.open||be.nodeId!==M.select("floatingParentNodeId"))return;const Ue=be.reason??Zu;M.setOpen(!1,dt(Ue))}return F.events.on("menuopenchange",He),()=>{F.events.off("menuopenchange",He)}},[F.events,M]);const Te=Hn();v.useEffect(()=>{J||Te.clear()},[J,Te]),v.useEffect(()=>{function He(be){if(!(!J||be.nodeId!==M.select("floatingParentNodeId")))if(be.target&&H&&H!==be.target){const Ue=M.select("closeDelay");Ue>0?Te.isStarted()||Te.start(Ue,()=>{M.setOpen(!1,dt(Zu))}):M.setOpen(!1,dt(Zu))}else Te.clear()}return F.events.on("itemhover",He),()=>{F.events.off("itemhover",He)}},[F.events,J,H,M,Te]),v.useEffect(()=>{const He={open:J,nodeId:ee,parentNodeId:q,reason:M.select("lastOpenChangeReason")};F.events.emit("menuopenchange",He)},[F.events,J,M,ee,q]),pO({store:M,domReference:se,positionerElement:$,open:J});const ve={open:J,side:ce.side,align:ce.align,anchorHidden:ce.anchorHidden,nested:D.type==="menu",instant:K},ke=D.type==="menubar"&&D.context.modal;Av(J&&(ke||Y&&X!==qn),U==="touch",$,H);const Le=sp(n,ve,{styles:ce.positionerStyles,transitionStatus:L,props:O,refs:[o,M.useStateSetter("positionerElement")],hidden:!G,inert:!J}),Fe=G&&D.type!=="menu"&&(D.type!=="menubar"&&Y&&X!==qn||D.type==="menubar"&&D.context.modal);let Oe=null;return D.type==="menubar"?Oe=D.context.contentElement:D.type===void 0&&(Oe=H),S.jsxs(eO.Provider,{value:ce,children:[Fe&&S.jsx(Rp,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:lp(!J),cutout:Oe}),S.jsx(OE,{id:ee,children:S.jsx(Mv,{elementsRef:M.context.itemDomElements,labelsRef:M.context.itemLabels,onMapChange:N,children:Le})})]})}),yO=v.createContext(void 0);function v_(){const e=v.useContext(yO);if(e===void 0)throw new Error(Rn(34));return e}const b_=v.forwardRef(function(n,o){const{render:a,className:s,value:u,defaultValue:c,onValueChange:d,disabled:p=!1,style:g,"aria-labelledby":y,...h}=n,[b,x]=v.useState(void 0),[w,C]=bs({controlled:u,default:c,name:"MenuRadioGroup"}),R=Be((A,N)=>{d?.(A,N),!N.isCanceled&&C(A)}),O=Mt("div",n,{state:{disabled:p},ref:o,props:{role:"group","aria-labelledby":y??b,"aria-disabled":p||void 0,...h}}),M=v.useMemo(()=>({value:w,setValue:R,disabled:p}),[w,R,p]);return S.jsx(Tv.Provider,{value:x,children:S.jsx(yO.Provider,{value:M,children:O})})}),x_=v.memo(v.forwardRef(function(n,o){const a=Sp()?.RadioGroup??b_;return S.jsx(a,{...n,ref:o})})),vO=v.createContext(void 0);function S_(){const e=v.useContext(vO);if(e===void 0)throw new Error(Rn(35));return e}const w_=v.forwardRef(function(n,o){const{render:a,className:s,id:u,label:c,nativeButton:d=!1,disabled:p=!1,closeOnClick:g=!1,value:y,style:h,...b}=n,{store:x}=Va(),{value:w,setValue:C,disabled:R}=v_(),T=wp({guess:!0,label:c}),O=Tr(u),M=x.useState("isActive",T.index),A=x.useState("floatingNodeId"),N=x.useState("itemProps"),k=x.useState("disabled"),j=p||R||k,D=w===y,{getItemProps:z,itemRef:F}=aO({closeOnClick:g,disabled:j,highlighted:M,id:O,store:x,nativeButton:d,nodeId:A,itemMetadata:oO}),G=v.useMemo(()=>({disabled:j,highlighted:M,checked:D}),[j,M,D]);function J(U){const H=dt(fs,U.nativeEvent,void 0,{preventUnmountOnClose:Sn});C(y,H)}const Y=Mt("div",n,{state:G,stateAttributesMapping:sO,props:[N,{role:"menuitemradio","aria-checked":D,onClick:J},b,z],ref:[F,o,T.ref]});return S.jsx(vO.Provider,{value:G,children:Y})}),R_=v.forwardRef(function(n,o){const a=rO(n,o);return a.visible?S.jsx(w_,{...n,ref:a.ref}):null}),E_=v.forwardRef(function(n,o){const{render:a,className:s,style:u,keepMounted:c=!1,...d}=n,p=S_(),g=v.useRef(null),{transitionStatus:y,mounted:h,setMounted:b}=ws(p.checked);jo({batch:!0,enabled:!p.checked,open:p.checked,ref:g,onComplete(){p.checked||b(!1)}});const x={checked:p.checked,disabled:p.disabled,highlighted:p.highlighted,transitionStatus:y};return Mt("span",n,{state:x,stateAttributesMapping:sO,ref:[o,g],props:{"aria-hidden":!0,...d},enabled:c||h})}),C_=v.createContext(null);function bO(e){return v.useContext(C_)}function T_(e){const n=v.useRef(""),o=v.useCallback(s=>{s.defaultPrevented||(n.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:v.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,n.current),n.current=""},[e]),onPointerDown:o}}function ql(e,n){const o=v.useRef(e),a=Be(n);_e(()=>{o.current!==e&&a(o.current),o.current=e},[e,a])}function O_(e,n){const o=Be((u,c)=>{(typeof e=="function"?e():e)||n(c||(Ph?"touch":""))}),{onClick:a,onPointerDown:s}=T_(o);return v.useMemo(()=>({onClick:a,onPointerDown:s}),[a,s])}function xO(e){const[n,o]=v.useState(null),a=O_(e,o);return ql(e,s=>{s&&!e&&o(null)}),v.useMemo(()=>({openMethod:n,triggerProps:a}),[n,a])}function M_(e){return e==null?_r:e.type.startsWith("key")?$R:e.type.startsWith("mouse")||e.type.startsWith("pointer")?T4:_r}const A_={...ka,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,n)=>{const o=ka.triggerPopupId(e,n);return o?e.listElement?.id||o:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,n)=>ha&&e.inputFocused&&n?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,n)=>e.activeIndex===n,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType==="trigger-change"&&!ka.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class D_ extends Ul{constructor(n,o,a=!1){const s=new jc,u=I_(s,o,a,n);super(u,N_(s),A_),this.observe("parent",c=>{c.type==="menu"?this.context.allowMouseUpTriggerRef=c.store.context.allowMouseUpTriggerRef:c.type!==void 0&&(this.context.allowMouseUpTriggerRef=c.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){const n=this.state.parent;if(n.type!=="menu")return;let o=n.store.select("rootId"),a=n.store.select("floatingTreeRoot"),s=n.store.select("keyboardEventRelay");return n.store.subscribe(()=>{const u=n.store.select("rootId"),c=n.store.select("floatingTreeRoot"),d=n.store.select("keyboardEventRelay");o===u&&a===c&&s===d||(o=u,a=c,s=d,this.notifyAll())})}setOpen(n,o){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:o})}setActiveIndex(n,o,a){if(this.state.activeIndex!==n){const u=(n===null?void 0:this.context.itemDomElements.current[n])===this.context.reportedItem;this.context.highlightReason=u?"none":o,this.context.highlightEvent=u?void 0:a}this.set("activeIndex",n)}highlightItem(n,o,a){const s=this.context.itemDomElements.current.indexOf(n);s>-1&&this.setActiveIndex(s,o,a)}}function N_(e){return{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:v.createRef(),beforeTriggerFocusGuardRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function I_(e,n,o=!1,a){return{...np(e,n,o),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Gt,inputProps:Gt,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Qy,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Gt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...a}}const Xw=v.createContext(null);function SO(e,n){return(e===qo||e===fs)&&n?.detail===0}function j_(e,n){return e===ih||SO(e,n)}const P_=Rc(function(n){const{children:o,open:a,onOpenChange:s,onOpenChangeComplete:u,onItemHighlighted:c,defaultOpen:d=!1,disabled:p=!1,modal:g,loopFocus:y=!0,orientation:h="vertical",actionsRef:b,closeParentOnEsc:x=!1,handle:w,triggerId:C,defaultTriggerId:R=null,highlightItemOnHover:T=!0,isSubmenu:O=!1,virtualFocus:M=!1,virtualFocusRef:A,allowEscape:N=!0,resetOnPointerLeave:k=!0}=n,j=xp(!0),D=Va(!0),z=bO(!0),F=D?.store,G=D?.virtualFocus??!1,J=v.useMemo(()=>O&&F?{type:"menu",store:F}:z?{type:"menubar",context:z}:j&&!F?{type:"context-menu",context:j}:{type:void 0},[j,F,z,O]),Y=Tr(),U=Tr(),[H,L]=v.useState(void 0),$=(H??U)||void 0,K=Ni(),V=J.type==="menu"?J.store:void 0,X=(a??d)&&V?.state.transitionStatus==="starting",ee=er(()=>X?V?.state.instantType:void 0).current,q=er(()=>{const Pe=new D_({open:d,openProp:a,activeTriggerId:R,triggerIdProp:C,parent:J,disabled:p,highlightItemOnHover:T,modal:J.type===void 0?g:void 0,rootId:Y,instantType:ee},$,K!=null);return Pe.context.virtualFocusRef=A,Pe}).current;q.useControlledProp("openProp",a),q.useControlledProp("triggerIdProp",C),q.useContextCallback("onOpenChangeComplete",u);const se=q.useState("floatingTreeRoot"),I=Zy(se),B=q.useState("open"),W=q.useState("activeTriggerElement"),re=q.useState("positionerElement"),Re=q.useState("hoverEnabled"),le=q.useState("disabled"),me=q.useState("lastOpenChangeReason"),ge=q.useState("parent"),ce=q.useState("activeIndex"),Te=q.useState("keyboardOpen"),ve=q.useState("payload"),ke=q.useState("floatingParentNodeId"),Me=v.useRef(null),Le=v.useRef(ge.type!=="context-menu"),Fe=Hn(),Oe=v.useRef(!0),He=Hn(),be=ke!=null,{openMethod:Ue,triggerProps:Qe}=xO(B);q.useSyncedValues({disabled:p,highlightItemOnHover:T,modal:ge.type===void 0?g:void 0,openMethod:Ue,rootId:Y}),Jh(q);const{forceUnmount:it,transitionStatus:de}=Wh(B,q,()=>{q.set("allowMouseEnter",!1)},X),we=$h(q.context.popupRef);v.useEffect(()=>{if(ee===void 0)return;const Pe=()=>{q.state.instantType===ee&&q.set("instantType",void 0)};if(!B){Pe();return}if(de!==void 0)return;if(q.context.popupRef.current==null){Pe();return}const ze=new AbortController;return we(Pe,ze.signal),()=>{ze.abort()}},[ee,B,de,we,q]),_e(()=>{j&&!D?q.update({parent:{type:"context-menu",context:j},floatingNodeId:I,floatingParentNodeId:K}):(D||!q.select("activeTriggerElement"))&&q.update({floatingNodeId:I,floatingParentNodeId:K})},[j,D,I,K,W,q]),v.useEffect(()=>{if(B||(Me.current=null),ge.type==="context-menu"){if(!B){Fe.clear(),Le.current=!1;return}Fe.start(500,()=>{Le.current=!0})}},[Fe,B,ge.type]),_e(()=>{!B&&!Re&&q.set("hoverEnabled",!0)},[B,Re,q]);const Ke=Be((Pe,ze)=>{const Ge=ze.reason;if(!Pe&&!q.select("open")||B===Pe&&ze.trigger===W&&me===Ge)return;const et=Zh(ze);if(!Pe&&ze.trigger==null&&(ze.trigger=W??void 0),s?.(Pe,ze),ze.isCanceled)return;q.state.floatingRootContext.dispatchOpenChange(Pe,ze);const Et=ze.event;if(Pe===!1&&Ge!==fs&&Et?.type==="click"&&Et.pointerType==="touch"&&!Oe.current)return;Pe&&Ge===xl?(Oe.current=!1,He.start(300,()=>{Oe.current=!0})):(Oe.current=!0,He.clear());const _=!Pe&&(Ge===Mc||Ge==null);Me.current=ze.event;const Z=Qh(q.state,Pe,ze.trigger,et());Z.openChangeReason=Ge,Z.keyboardOpen=Pe&&j_(Ge,Et),ge.type==="menubar"&&(Ge===xl||Ge===Ti||Ge===qn||Ge===ih||Ge===Zu)?Z.instantType="group":SO(Ge,Et)?Z.instantType="click":_?Z.instantType="dismiss":Z.instantType=void 0,q.update(Z)}),De=DE({popupStore:q,floatingRootContext:q.state.floatingRootContext,floatingId:$,nested:K!=null,onOpenChange:Ke}),Ie=De.context.events;_e(()=>{const Pe=({open:ze,eventDetails:Ge})=>Ke(ze,Ge);return Ie.on("setOpen",Pe),()=>{Ie?.off("setOpen",Pe)}},[Ie,Ke]),_e(()=>q.subscribeToParentMenu(),[q]);const yt=v.useCallback(()=>{q.setOpen(!1,dt(Ac))},[q]);v.useImperativeHandle(b,()=>({unmount:it,close:yt}),[it,yt]);let ut;ge.type==="context-menu"&&(ut=ge.context),v.useImperativeHandle(ut?.positionerRef,()=>re,[re]),v.useImperativeHandle(ut?.actionsRef,()=>({setOpen:Ke}),[Ke]);const ht=Nc(De,{enabled:!le,bubbles:{escapeKey:x&&ge.type==="menu"},outsidePress(){return ge.type!=="context-menu"||Me.current?.type==="contextmenu"?!0:Le.current},externalTree:be?se:void 0}),Ot=ap(),Dt=VE(De,{enabled:!le,listRef:q.context.itemDomElements,activeIndex:ce,virtual:M,nested:ge.type==="menubar"||!M&&ge.type!==void 0,parentOrientation:ge.type==="menubar"?ge.context.orientation:void 0,loopFocus:y,focusItemOnOpen:M?Te:void 0,allowEscape:M&&y&&N,orientation:h,triggerOrientation:M?"vertical":h,rtl:Ot==="rtl",disabledIndices:fa,onNavigate(Pe,ze){q.setActiveIndex(Pe,M_(ze),ze?.nativeEvent)},openOnArrowKeyDown:ge.type!=="context-menu"&&!(M&&O),externalTree:!M&&be?se:void 0,nestedReturnFocusRef:V?.context.virtualFocusRef,focusItemOnHover:T,resetOnPointerLeave:k}),Wt=v.useCallback(Pe=>{q.context.typingRef.current=Pe},[q]),rn=qE(De,{enabled:!le&&!M,listRef:q.context.itemLabels,elementsRef:q.context.itemDomElements,activeIndex:ce,resetMs:y3,onMatch:(Pe,ze)=>{B&&Pe!==ce&&q.setActiveIndex(Pe,$R,ze.nativeEvent)},onTyping:Wt}),en=Be(c),We=v.useRef(-1),xt=Be(()=>{const Pe=q.state.activeIndex,ze=Pe===null?void 0:q.context.itemDomElements.current[Pe]??void 0;if(ze?.isConnected===!1)return;const Ge=ze===void 0?-1:Pe;if(We.current===Ge&&q.context.reportedItem===ze)return;We.current=Ge,q.context.reportedItem=ze,M&&q.set("highlightedItem",ze);const{highlightReason:et,highlightEvent:Et}=q.context;q.context.highlightReason=_r,q.context.highlightEvent=void 0,c&&en(ze,C4(et,Et,{label:ze===void 0?void 0:q.context.itemLabels.current[Ge]??void 0}))});_e(()=>{xt()},[ce,xt]);const $t=v.useMemo(()=>{if(!M)return Dt.reference;if(!Dt.trigger)return Gt;const{onFocus:Pe,...ze}=Dt.trigger;return ze},[M,Dt.reference,Dt.trigger]);q.useSyncedValue("inputProps",M?Dt.reference??Gt:Gt);const ft=v.useMemo(()=>{const Pe=Lr(rn.reference,$t,ht.reference,{onMouseMove(){q.set("allowMouseEnter",!0)}},Qe);return Pe["aria-haspopup"]="menu",Pe["aria-expanded"]=B,Pe},[q,rn.reference,$t,ht.reference,Qe,B]),vt=v.useMemo(()=>{const Pe=Lr(Dt.trigger,ht.trigger,Qe);return Pe["aria-haspopup"]="menu",Pe["aria-expanded"]=!1,Pe},[Dt.trigger,ht.trigger,Qe]);er(()=>(q.update({inactiveTriggerProps:vt}),null));const gt=v.useMemo(()=>Lr(Ic,{onMouseMove(){q.set("allowMouseEnter",!0),ge.type==="menu"&&q.set("hoverEnabled",!1)},onClick(){q.select("hoverEnabled")&&q.set("hoverEnabled",!1)},onKeyDown(Pe){const ze=q.select("keyboardEventRelay");ze&&!Pe.isPropagationStopped()&&ze(Pe)}},rn.floating,Dt.floating,ht.floating),[ge.type,q,rn.floating,Dt.floating,ht.floating]),kt=Dt.item??Gt;ep(q,{floatingRootContext:De,activeTriggerProps:ft,inactiveTriggerProps:vt,popupProps:gt,itemProps:kt});const un=v.useMemo(()=>({store:q,parent:J,orientation:h,loopFocus:y,allowEscape:N,defaultFloatingId:U,setRenderedFloatingId:L,virtualFocus:M,parentVirtualFocus:G,syncHighlightedItem:xt}),[q,J,h,y,N,U,M,G,xt]),je=typeof o=="function"?o({payload:ve}):o;let at=S.jsxs(bp.Provider,{value:un,children:[w&&S.jsx(Xh,{handle:w,store:q}),je]});return(ge.type===void 0||ge.type==="context-menu")&&(at=S.jsx(ME,{externalTree:se,children:at})),at});function wO(e){const n=v.useContext(Xw);if(n===null)return S.jsx(P_,{...e});const o=n.Root;return S.jsx(Xw.Provider,{value:null,children:S.jsx(o,{...n.options,...e})})}const jf=5;function RO(e,n){const o=k_(n);return e.clientX>=o.left-jf&&e.clientX<=o.right+jf&&e.clientY>=o.top-jf&&e.clientY<=o.bottom+jf}function k_(e){const n=e.getBoundingClientRect(),o=wn(e);if(jy)return n;const a=o.getComputedStyle(e,"::before"),s=o.getComputedStyle(e,"::after");if(!(a.content!=="none"||s.content!=="none"))return n;const c=parseFloat(a.width)||0,d=parseFloat(a.height)||0,p=parseFloat(s.width)||0,g=parseFloat(s.height)||0,y=Math.max(n.width,c,p),h=Math.max(n.height,d,g),b=y-n.width,x=h-n.height;return{left:n.left-b/2,right:n.right+b/2,top:n.top-x/2,bottom:n.bottom+x/2}}function L_(e={}){const{highlightItemOnHover:n,highlightedIndex:o,onHighlightedIndexChange:a}=Cv(),{ref:s,index:u}=wp(e),c=o===u,d=v.useRef(null),p=Xr(s,d);return{compositeProps:{tabIndex:c?0:-1,onFocus(){a(u)},onMouseMove(){const y=d.current;if(!n||!y)return;const h=y.hasAttribute("disabled")||y.ariaDisabled==="true";!c&&!h&&y.focus()}},compositeRef:p,index:u}}function EO(e){const{render:n,className:o,style:a,state:s=Gt,props:u=fa,refs:c=fa,metadata:d,stateAttributesMapping:p,tag:g="div",...y}=e,{compositeProps:h,compositeRef:b}=L_({metadata:d});return Mt(g,e,{state:s,ref:[b,...c],props:[h,...u,y],stateAttributesMapping:p})}function Dv(e){if(yn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!za(e))return Dv(Ua(e))}function z_(e,n){function o(u,c,d){const p=u.currentTarget;cr.flushSync(()=>{e.setOpen(!1,dt(Ti,u.nativeEvent,p))}),e3(p.isConnected?p:n.current,c,d)?.focus()}function a(u){o(u,-1,e.select("positionerElement"))}function s(u){const c=e.select("positionerElement");c&&El(u,c)?e.context.beforeContentFocusGuardRef.current?.focus():o(u,1,c)}return{handlePreFocusGuardFocus:a,handleFocusTargetFocus:s}}function __(e){const{enabled:n=!0,mouseDownAction:o,open:a}=e,s=v.useRef(!1);return v.useMemo(()=>n?{onMouseDown:u=>{(o==="open"&&!a||o==="close"&&a)&&(s.current=!0,Kt(u.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:u=>{s.current&&(s.current=!1,u.preventBaseUIHandler())}}:Gt,[n,o,a])}const H_=HR(function(n,o){const{render:a,className:s,style:u,disabled:c=!1,nativeButton:d=!0,id:p,openOnHover:g,delay:y=100,closeDelay:h=0,handle:b,payload:x,...w}=n,C=Va(!0),T=HE(b)??C?.store;if(!T)throw new Error(Rn(85));const O=Tr(p),M=T.useState("isTriggerActive",O),A=T.useState("floatingRootContext"),N=T.useState("isOpenedByTrigger",O),k=T.useState("triggerControlsId",O),j=v.useRef(null),D=F_(),z=Cv(!0),F=Ii(),G=v.useMemo(()=>F??new Qy,[F]),J=Zy(G),Y=Ni(),{registerTrigger:U,isMountedByThisTrigger:H}=jE(O,j,T,{payload:x,closeDelay:h,parent:D,floatingTreeRoot:G,floatingNodeId:J,floatingParentNodeId:Y,keyboardEventRelay:z?.relayKeyboardEvent}),L=D.type==="menubar",$=T.useState("disabled"),K=c||$||L&&D.context.disabled,{getButtonProps:V,buttonRef:X}=ma({disabled:K,native:d});v.useEffect(()=>{!N&&D.type===void 0&&(T.context.allowMouseUpTriggerRef.current=!1)},[T,N,D.type]);const ee=v.useRef(null),q=Hn(),se=Be(He=>{if(!ee.current)return;q.clear(),T.context.allowMouseUpTriggerRef.current=!1;const be=He.target;ot(ee.current,be)||ot(T.select("positionerElement"),be)||be===ee.current||be!=null&&Dv(be)===T.select("rootId")||RO(He,ee.current)||G.events.emit("close",{domEvent:He,reason:Uy})});v.useEffect(()=>{const He=Kt(ee.current);if(N&&T.select("lastOpenChangeReason")===qn)return He.addEventListener("mouseup",se,{once:!0}),()=>{He.removeEventListener("mouseup",se)}},[N,se,T]);const I=L&&D.context.hasSubmenuOpen,W=BE(A,{enabled:(g??I)&&!K&&(!L||I&&!H),handleClose:YE({blockPointerEvents:!L}),mouseOnly:!0,move:!1,restMs:D.type===void 0?y:void 0,delay:{close:h},triggerElementRef:j,externalTree:G,isActiveTrigger:M,isClosing:()=>T.select("transitionStatus")==="ending"}),re=U_(N,T.select("lastOpenChangeReason")),Re=AE(A,{enabled:!K,event:N&&L?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?re:!1}),le=UE(A,{enabled:!K&&I}),me=__({open:N,enabled:L,mouseDownAction:"open"}),ge=v.useMemo(()=>Lr(le.reference,Re.reference),[le.reference,Re.reference]),ce=T.useState("triggerProps",H),Te=T.useState("filterTriggerProps"),{handlePreFocusGuardFocus:ve,handleFocusTargetFocus:ke}=z_(T,j),Me={disabled:K,open:N},Le=[ee,o,X,U,j],Fe=[ge,W??Gt,ce,{"aria-haspopup":"menu","aria-controls":k,id:O,onMouseDown:He=>{if(T.select("open"))return;q.start(200,()=>{T.context.allowMouseUpTriggerRef.current=!0}),Kt(He.currentTarget).addEventListener("mouseup",se,{once:!0})}},Te,L?{role:"menuitem"}:{},me,w,V],Oe=Mt("button",n,{enabled:!L,stateAttributesMapping:rh,state:Me,ref:Le,props:Fe});return L?S.jsx(EO,{tag:"button",render:a,className:s,style:u,state:Me,refs:Le,props:Fe,stateAttributesMapping:rh}):N?S.jsxs(v.Fragment,{children:[S.jsx(jl,{ref:T.context.beforeTriggerFocusGuardRef,onFocus:ve},`${O}-pre-focus-guard`),S.jsx(v.Fragment,{children:Oe},O),S.jsx(jl,{ref:T.context.triggerFocusTargetRef,onFocus:ke},`${O}-post-focus-guard`)]}):S.jsx(v.Fragment,{children:Oe},O)});function U_(e,n){const o=Hn(),[a,s]=v.useState(!1);return _e(()=>{e&&n===qn?(s(!0),o.start(bE,()=>{s(!1)})):e||(o.clear(),s(!1))},[e,n,o]),a}function F_(){const e=bO();return v.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}const B_=v.forwardRef(function(n,o){const{className:a,render:s,orientation:u="horizontal",style:c,...d}=n;return Mt("div",n,{state:{orientation:u},ref:o,props:[{role:"separator","aria-orientation":u},d]})});function CO(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function Sh(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function V_(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}function TO(e){return V_(e?.[0])}function q_(e){return TO(e)?e.flatMap(n=>n.items):e}function Y_(e){if(!Array.isArray(e))return e!=null&&"null"in e;const n=e;if(TO(n)){for(const o of n)for(const a of o.items)if(a&&a.value==null&&a.label!=null)return!0;return!1}for(const o of n)if(o&&o.value==null&&o.label!=null)return!0;return!1}function OO(e,n){if(n&&e!=null)return n(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 Sh(e)}function vl(e,n){return n&&e!=null?n(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Sh(e.value):Sh(e)}function MO(e,n,o){function a(){return OO(e,o)}if(o&&e!=null)return o(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(n&&!Array.isArray(n))return(Object.hasOwn(n,e)?n[e]:void 0)??a();if(Array.isArray(n)){const u=q_(n);if(e==null||typeof e!="object"){const c=u.find(d=>d.value===e);return c&&c.label!=null?c.label:a()}if("value"in e){const c=u.find(d=>d&&d.value===e.value);if(c&&c.label!=null)return c.label}}return a()}function K_(e,n,o){return e.reduce((a,s,u)=>(u>0&&a.push(", "),a.push(S.jsx(v.Fragment,{children:MO(s,n,o)},u)),a),[])}function Nv({...e}){return S.jsx(wO,{"data-slot":"dropdown-menu",...e})}function Iv({...e}){return S.jsx(H_,{"data-slot":"dropdown-menu-trigger",...e})}function jv({align:e="start",alignOffset:n=0,side:o="bottom",sideOffset:a=4,className:s,...u}){return S.jsx(fO,{children:S.jsx(mO,{className:"isolate z-50 outline-none",align:e,alignOffset:n,side:o,sideOffset:a,children:S.jsx(cO,{"data-slot":"dropdown-menu-content",className:Ze("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",s),...u})})})}function AO({...e}){return S.jsx(Yz,{"data-slot":"dropdown-menu-group",...e})}function DO({className:e,inset:n,...o}){return S.jsx(Kz,{"data-slot":"dropdown-menu-label","data-inset":n,className:Ze("px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5",e),...o})}function NO({className:e,inset:n,variant:o="default",...a}){return S.jsx(lO,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":o,className:Ze("group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive",e),...a})}function G_({...e}){return S.jsx(x_,{"data-slot":"dropdown-menu-radio-group",...e})}function $_({className:e,children:n,inset:o,...a}){return S.jsxs(R_,{"data-slot":"dropdown-menu-radio-item","data-inset":o,className:Ze("relative flex min-h-7 cursor-default items-center gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",e),...a,children:[S.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:S.jsx(E_,{children:S.jsx(cp,{})})}),n]})}function IO(e){return Mt(e.defaultTagName??"div",e,e)}function jO(e){var n,o,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(n=0;n<s;n++)e[n]&&(o=jO(e[n]))&&(a&&(a+=" "),a+=o)}else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function X_(){for(var e,n,o=0,a="",s=arguments.length;o<s;o++)(e=arguments[o])&&(n=jO(e))&&(a&&(a+=" "),a+=n);return a}const Qw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zw=X_,Cp=(e,n)=>o=>{var a;if(n?.variants==null)return Zw(e,o?.class,o?.className);const{variants:s,defaultVariants:u}=n,c=Object.keys(s).map(g=>{const y=o?.[g],h=u?.[g];if(y===null)return null;const b=Qw(y)||Qw(h);return s[g][b]}),d=o&&Object.entries(o).reduce((g,y)=>{let[h,b]=y;return b===void 0||(g[h]=b),g},{}),p=n==null||(a=n.compoundVariants)===null||a===void 0?void 0:a.reduce((g,y)=>{let{class:h,className:b,...x}=y;return Object.entries(x).every(w=>{let[C,R]=w;return Array.isArray(R)?R.includes({...u,...d}[C]):{...u,...d}[C]===R})?[...g,h,b]:g},[]);return Zw(e,c,p,o?.class,o?.className)},P0=768;function Q_(){const[e,n]=v.useState(void 0);return v.useEffect(()=>{const o=window.matchMedia(`(max-width: ${P0-1}px)`),a=()=>{n(window.innerWidth<P0)};return o.addEventListener("change",a),n(window.innerWidth<P0),()=>o.removeEventListener("change",a)},[]),!!e}const Z_=v.forwardRef(function(n,o){const{render:a,className:s,disabled:u=!1,focusableWhenDisabled:c=!1,nativeButton:d=!0,style:p,...g}=n,{getButtonProps:y,buttonRef:h}=ma({disabled:u,focusableWhenDisabled:c,native:d});return Mt("button",n,{state:{disabled:u},ref:[o,h],props:[g,y]})}),J_=Cp("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",sm:"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",icon:"size-7 [&_svg:not([class*='size-'])]:size-3.5","icon-xs":"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5","icon-sm":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-lg":"size-8 [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default",size:"default"}});function Jt({className:e,variant:n="default",size:o="default",...a}){return S.jsx(Z_,{"data-slot":"button",className:Ze(J_({variant:n,size:o,className:e})),...a})}const W_="data-valid",e6="data-invalid",t6={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},n6={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},r6={disabled:!1,...n6},Yl={valid(e){return e===null?null:e?{[W_]:""}:{[e6]:""}}},o6={invalid:void 0,name:void 0,validityData:{state:t6,errors:[],error:"",value:"",initialValue:null},setValidityData:Sn,disabled:void 0,setTouched:Sn,setDirty:Sn,setFilled:Sn,setFocused:Sn,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:r6,registerFieldControl:Sn,validation:{getValidationProps:(e,n=Gt)=>n,inputRef:{current:null},registeredInputs:new Map,registerInput:Sn,getInputControl:()=>null,commit:async()=>{},change:Sn}},a6=v.createContext(o6);function qa(e=!0){const n=v.useContext(a6);if(n.setValidityData===Sn&&!e)throw new Error(Rn(28));return n}const i6=v.createContext(void 0);function s6(e=!1){const n=v.useContext(i6);if(!n&&!e)throw new Error(Rn(86));return n}const l6=v.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Sn,validationMode:"onSubmit",submitCountRef:{current:0}});function Fc(){return v.useContext(l6)}const u6=v.createContext({controlId:void 0,registerControlId:Sn,resetControlId:Sn,labelId:void 0,setLabelId:Sn,messageIds:[],setMessageIds:Sn,getDescriptionProps:e=>e});function Cs(){return v.useContext(u6)}function Pv(e,n,o,a=!0,s,u){const[c,d]=v.useState(),p=Tr(s?`${s}-label`:void 0),g=!!u?.trim(),h=e??(g?void 0:n)??c;return _e(()=>{const b=e||n||g||!a?void 0:c6(o.current,p);c!==b&&d(b)}),h}function c6(e,n){const o=d6(e);if(o)return!o.id&&n&&(o.id=n),o.id||void 0}function d6(e){if(!e)return;const n=e.parentElement;if(n&&n.tagName==="LABEL")return n;const o=e.id;if(o){const s=e.nextElementSibling;if(s&&s.htmlFor===o)return s}const a=e.labels;return a&&a[0]}function Kl(e={}){const{id:n,enabled:o=!0}=e,{controlId:a,registerControlId:s,resetControlId:u}=Cs(),c=Tr(),d=er(()=>Symbol()),p=v.useRef(!1),g=v.useRef(!1),y=Be(()=>{!p.current||s===Sn||(p.current=!1,s(d.current,void 0))});return _e(()=>{if(!o||s===Sn){y();return}let h;if(n!==void 0)g.current=!0,h=n;else if(g.current)h=c;else{u();return}if(h===void 0){y();return}p.current=!0,s(d.current,h)},[n,o,s,u,c,d,y]),_e(()=>y,[y]),(o?a:void 0)??n??c}function f6(e,n){return e.matches(":disabled")?!1:!n||e.form===n?!0:e.form===null&&!e.hasAttribute("form")}const h6=v.createContext({disabled:!1});function PO(){return v.useContext(h6)}function Bc(e,n,o){const{setFocused:a,focusOwnerRef:s}=qa(),u=Be(c=>{(c?!e:s.current===u)&&(s.current=c&&u,a(c))});return _e(()=>{const c=n.current;return c?.getRootNode()?.activeElement===c&&u(!0),()=>u(!1)},[e,n,u]),u}function Vc(e,n,o,a,s=!0,u){const{registerFieldControl:c}=qa(),d=er(()=>Symbol());_e(()=>{const p=d.current;if(!s){c(p,void 0);return}c(p,{controlRef:e,getValue:a,id:n,name:u,value:o})},[e,s,a,n,u,c,d,o]),_e(()=>{const p=d.current;return()=>{c(p,void 0)}},[c,d])}const p6=v.forwardRef(function(n,o){const{render:a,className:s,id:u,name:c,value:d,disabled:p=!1,onValueChange:g,defaultValue:y,autoFocus:h=!1,style:b,...x}=n,{state:w,name:C,disabled:R,setTouched:T,setDirty:O,validityData:M,setFilled:A,validationMode:N,validation:k}=qa(),{clearErrors:j,elementRef:D,submitCountRef:z}=Fc(),F=R||p,G=C??c,J={...w,disabled:F},{labelId:Y}=Cs(),U=Kl({id:u}),H=d!==void 0,L=d==null?void 0:String(d),$=Be(()=>k.inputRef.current?.value);Vc(k.inputRef,U,L,$,!F,c),_e(()=>{const q=L??k.inputRef.current?.value;q!==void 0&&A(q!=="")},[L,y,k.inputRef,A]),ql(L,()=>{L!==void 0&&(j(G),O(L!==(M.initialValue??"")),k.change(L))});const K=v.useRef(null),V=Bc(F,K),X=Hn();return Mt("input",n,{ref:[o,K],state:J,props:[{id:U,disabled:F,name:G,ref:k.inputRef,"aria-labelledby":Y,autoFocus:h,...H?{value:d}:{defaultValue:y},onChange(q){const se=q.currentTarget.value,I=dt(_r,q.nativeEvent);g?.(se,I),!H&&(O(se!==(M.initialValue??"")),A(se!==""),!q.nativeEvent.defaultPrevented&&!I.isCanceled&&(j(G),k.change(se)))},onFocus(){V(!0)},onBlur(q){if(T(!0),V(!1),N==="onBlur"){const se=q.currentTarget.value;k.commit(se),H&&queueMicrotask(()=>{const I=k.inputRef.current?.value;I!==void 0&&I!==se&&I!==(M.initialValue??"")&&k.commit(I)})}},onKeyDown(q){if(q.currentTarget.tagName==="INPUT"&&q.key==="Enter"){T(!0);const se=q.currentTarget.value,I=q.currentTarget.form;if(I&&I===D.current&&!q.defaultPrevented){const B=q.currentTarget,W=z.current;X.start(0,()=>{z.current===W&&k.commit(B.value)})}else k.commit(se)}}},x,q=>k.getValidationProps(F,q)],stateAttributesMapping:Yl})}),g6=v.forwardRef(function(n,o){return S.jsx(p6,{ref:o,...n})});function kO({className:e,type:n,...o}){return S.jsx(g6,{type:n,"data-slot":"input",className:Ze("h-7 w-full min-w-0 rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs/relaxed file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...o})}function LO({className:e,orientation:n="horizontal",...o}){return S.jsx(B_,{"data-slot":"separator",orientation:n,className:Ze("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...o})}const zO=v.createContext(void 0);function Ts(e){const n=v.useContext(zO);if(!e&&n===void 0)throw new Error(Rn(27));return n}const _O=v.forwardRef(function(n,o){const{render:a,className:s,style:u,forceRender:c=!1,...d}=n,p=Ts(),g=p.useState("open"),y=p.useState("nested"),h=p.useState("mounted"),b=p.useState("transitionStatus");return Mt("div",n,{state:{open:g,transitionStatus:b},ref:[p.context.backdropRef,o],stateAttributesMapping:Uh,props:[{role:"presentation",hidden:!h,style:{userSelect:"none",WebkitUserSelect:"none"}},d],enabled:c||!y})}),Tp=v.forwardRef(function(n,o){const{render:a,className:s,style:u,disabled:c=!1,nativeButton:d=!0,...p}=n,g=Ts(),y=g.useState("open"),{getButtonProps:h,buttonRef:b}=ma({disabled:c,native:d}),x={disabled:c};function w(C){y&&g.setOpen(!1,dt(GR,C.nativeEvent))}return Mt("button",n,{state:x,ref:[o,b],props:[{onClick:w},p,h]})}),HO=v.forwardRef(function(n,o){const{render:a,className:s,style:u,id:c,...d}=n,p=Ts(),g=Tr(c);return p.useSyncedValueWithCleanup("descriptionElementId",g),Mt("p",n,{ref:o,props:[{id:g},d]})}),UO=v.createContext(void 0);function m6(){const e=v.useContext(UO);if(e===void 0)throw new Error(Rn(26));return e}const y6="--nested-dialogs",v6="data-nested-dialog-open",b6={...Tc,...pa,nestedDialogOpen(e){return e?{[v6]:""}:null}},FO=v.forwardRef(function(n,o){const{render:a,className:s,style:u,finalFocus:c,initialFocus:d,...p}=n,g=Ts(),y=g.useState("descriptionElementId"),h=g.useState("disablePointerDismissal"),b=g.useState("floatingRootContext"),x=g.useState("popupProps"),w=g.useState("modal"),C=g.useState("mounted"),R=g.useState("nested"),T=g.useState("nestedOpenDialogCount"),O=g.useState("open"),M=g.useState("openMethod"),A=g.useState("titleElementId"),N=g.useState("transitionStatus"),k=g.useState("role"),j=b.useState("floatingId");m6(),jo({open:O,ref:g.context.popupRef,onComplete(){O&&g.context.onOpenChangeComplete?.(!0)}});const D=d===void 0?IE(g.context.popupRef):d,z=T>0,F=g.useStateSetter("popupElement"),J=Mt("div",n,{state:{open:O,nested:R,transitionStatus:N,nestedDialogOpen:z},props:[x,{id:j,"aria-labelledby":A,"aria-describedby":y,role:k,...Ic,hidden:!C,onKeyDown(Y){Uc.has(Y.key)&&Y.stopPropagation()},style:{[y6]:T}},p],ref:[o,g.context.popupRef,F],stateAttributesMapping:b6});return S.jsx(Gh,{context:b,openInteractionType:M,disabled:!C,closeOnFocusOut:!h,initialFocus:D,returnFocus:c,modal:w!==!1,restoreFocus:"popup",children:J})}),BO=v.forwardRef(function(n,o){const{keepMounted:a=!1,...s}=n,u=Ts(),c=u.useState("mounted"),d=u.useState("modal"),p=u.useState("open");return c||a?S.jsx(UO.Provider,{value:a,children:S.jsxs(Kh,{ref:o,...s,children:[c&&d===!0&&S.jsx(Rp,{ref:u.context.internalBackdropRef,inert:lp(!p)}),n.children]})}):null});function x6({store:e,parentContext:n,isDrawer:o}){const a=e.useState("open"),s=e.useState("mounted"),u=e.useState("disablePointerDismissal"),c=e.useState("modal"),d=e.useState("popupElement"),p=e.useState("floatingRootContext"),[g,y]=v.useState(0),[h,b]=v.useState(0),x=g===0,w=Nc(p,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:c==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(C){if(!e.context.outsidePressEnabledRef.current||"button"in C&&C.button!==0)return!1;if("touches"in C){if(C.type==="touchend"){if(C.changedTouches.length!==1||C.touches.length!==0)return!1}else if(C.touches.length!==1)return!1}const R=tr(C);if(x&&!u){if(c){const T=e.context.internalBackdropRef.current,O=e.context.backdropRef.current;return T||O?T===R||O===R||ot(R,d)&&!R?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:x});return gO(a&&c===!0,d),e.useContextCallback("onNestedDialogOpen",(C,R)=>{!e.select("open")&&!e.select("mounted")||(y(C),b(R))}),_e(()=>{!a&&!s&&(y(0),b(0))},[a,s]),_e(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(g+1,h+(o?1:0)),()=>{n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(0,0)}),[o,a,g,h,n]),ep(e,{activeTriggerProps:w.reference,inactiveTriggerProps:w.trigger,popupProps:w.floating,nestedOpenDialogCount:g,nestedOpenDrawerCount:h}),null}const S6={...ka,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class w6 extends Ul{constructor(n,o,a){const s=new jc,u=R6(n,s,o,a);super(u,E6(s),S6)}setOpen=(n,o)=>{o.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&o.trigger==null&&this.state.activeTriggerId!=null&&(o.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(n,o),!o.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(n,o),this.update(Qh(this.state,n,o.trigger)))}}function R6(e,n,o,a=!1){return{...np(n,o,a),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function E6(e){return{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function C6(e,n){const{children:o,open:a,defaultOpen:s=!1,onOpenChange:u,onOpenChangeComplete:c,disablePointerDismissal:d=!1,modal:p=!0,actionsRef:g,handle:y,triggerId:h,defaultTriggerId:b=null}=n,x=e==="drawer",w=p,C=d,R="dialog",T=Ts(!0),O=T!=null,M={modal:w,disablePointerDismissal:C,nested:O,role:R},A=Wy((F,G)=>new w6({open:s,openProp:a,activeTriggerId:b,triggerIdProp:h,...M},F,G),!0);A.useControlledProp("openProp",a),A.useControlledProp("triggerIdProp",h),A.useSyncedValues(M),A.useContextCallback("onOpenChange",u),A.useContextCallback("onOpenChangeComplete",c);const N=A.useState("open"),k=A.useState("mounted"),j=A.useState("payload");PE(A,N),Jh(A);const{forceUnmount:D}=Wh(N,A);v.useImperativeHandle(g,()=>({unmount:D,close:()=>A.setOpen(!1,dt(Ac))}),[D,A]);const z=N||k||y!=null;return S.jsxs(zO.Provider,{value:A,children:[y&&S.jsx(Xh,{handle:y,store:A}),z&&S.jsx(x6,{store:A,parentContext:T?.context,isDrawer:x}),typeof o=="function"?o({payload:j}):o]})}const VO=Rc(function(n){return C6("dialog",n)}),qO=v.forwardRef(function(n,o){const{render:a,className:s,style:u,id:c,...d}=n,p=Ts(),g=Tr(c);return p.useSyncedValueWithCleanup("titleElementId",g),Mt("h2",n,{ref:o,props:[{id:g},d]})}),Rt=e=>typeof e=="string",Qu=()=>{let e,n;const o=new Promise((a,s)=>{e=a,n=s});return o.resolve=e,o.reject=n,o},Pf=e=>e==null?"":String(e),T6=(e,n,o)=>{e.forEach(a=>{n[a]&&(o[a]=n[a])})},O6=/###/g,Jw=e=>e&&e.includes("###")?e.replace(O6,"."):e,Ww=e=>!e||Rt(e),ic=(e,n,o)=>{const a=Rt(n)?n.split("."):n;let s=0;for(;s<a.length-1;){if(Ww(e))return{};const u=Jw(a[s]);!e[u]&&o&&(e[u]=new o),Object.prototype.hasOwnProperty.call(e,u)?e=e[u]:e={},++s}return Ww(e)?{}:{obj:e,k:Jw(a[s])}},eR=(e,n,o)=>{const{obj:a,k:s}=ic(e,n,Object);if(a!==void 0||n.length===1){a[s]=o;return}let u=n[n.length-1],c=n.slice(0,n.length-1),d=ic(e,c,Object);for(;d.obj===void 0&&c.length;)u=`${c[c.length-1]}.${u}`,c=c.slice(0,c.length-1),d=ic(e,c,Object),d?.obj&&typeof d.obj[`${d.k}.${u}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${u}`]=o},M6=(e,n,o,a)=>{const{obj:s,k:u}=ic(e,n,Object);s[u]=s[u]||[],s[u].push(o)},wh=(e,n)=>{const{obj:o,k:a}=ic(e,n);if(o&&Object.prototype.hasOwnProperty.call(o,a))return o[a]},A6=(e,n,o)=>{const a=wh(e,o);return a!==void 0?a:wh(n,o)},YO=(e,n,o)=>{for(const a in n)a!=="__proto__"&&a!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,a)?Rt(e[a])||e[a]instanceof String||Rt(n[a])||n[a]instanceof String?o&&(e[a]=n[a]):YO(e[a],n[a],o):e[a]=n[a]);return e},ja=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),D6={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},N6=e=>Rt(e)?e.replace(/[&<>"'\/]/g,n=>D6[n]):e;class I6{constructor(n){this.capacity=n,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(n){const o=this.regExpMap.get(n);if(o!==void 0)return o;const a=new RegExp(n);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(n,a),this.regExpQueue.push(n),a}}const j6=[" ",",","?","!",";"],P6=new I6(20),k6=(e,n,o)=>{n=n||"",o=o||"";const a=j6.filter(c=>!n.includes(c)&&!o.includes(c));if(a.length===0)return!0;const s=P6.getRegExp(`(${a.map(c=>c==="?"?"\\?":c).join("|")})`);let u=!s.test(e);if(!u){const c=e.indexOf(o);c>0&&!s.test(e.substring(0,c))&&(u=!0)}return u},vy=(e,n,o=".")=>{if(!e)return;if(e[n])return Object.prototype.hasOwnProperty.call(e,n)?e[n]:void 0;const a=n.split(o);let s=e;for(let u=0;u<a.length;){if(!s||typeof s!="object")return;let c,d="";for(let p=u;p<a.length;++p)if(p!==u&&(d+=o),d+=a[p],c=s[d],(typeof c=="function"||d==="__proto__")&&!Object.prototype.hasOwnProperty.call(s,d)&&(c=void 0),c!==void 0){if(["string","number","boolean"].includes(typeof c)&&p<a.length-1)continue;u+=p-u+1;break}s=c}return s},zl=e=>e?.replace(/_/g,"-"),L6={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,n){console?.[e]?.apply?.(console,n)}};class Rh{constructor(n,o={}){this.init(n,o)}init(n,o={}){this.prefix=o.prefix||"i18next:",this.logger=n||L6,this.options=o,this.debug=o.debug}log(...n){return this.forward(n,"log","",!0)}warn(...n){return this.forward(n,"warn","",!0)}error(...n){return this.forward(n,"error","")}deprecate(...n){return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(n,o,a,s){return s&&!this.debug?null:(n=n.map(u=>Rt(u)?u.replace(/[\r\n\x00-\x1F\x7F]/g," "):u),Rt(n[0])&&(n[0]=`${a}${this.prefix} ${n[0]}`),this.logger[o](n))}create(n){return new Rh(this.logger,{prefix:`${this.prefix}:${n}:`,...this.options})}clone(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new Rh(this.logger,n)}}var ua=new Rh;class Op{constructor(){this.observers={}}on(n,o){return n.split(" ").forEach(a=>{this.observers[a]||(this.observers[a]=new Map);const s=this.observers[a].get(o)||0;this.observers[a].set(o,s+1)}),this}off(n,o){if(this.observers[n]){if(!o){delete this.observers[n];return}this.observers[n].delete(o)}}once(n,o){const a=(...s)=>{o(...s),this.off(n,a)};return this.on(n,a),this}emit(n,...o){this.observers[n]&&Array.from(this.observers[n].entries()).forEach(([s,u])=>{for(let c=0;c<u;c++)s(...o)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,u])=>{for(let c=0;c<u;c++)s(n,...o)})}}const tR=new WeakSet;class nR extends Op{constructor(n,o={ns:["translation"],defaultNS:"translation"}){super(),this.data=n||{},this.options=o,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(n){this.options.ns.includes(n)||this.options.ns.push(n)}removeNamespaces(n){const o=this.options.ns.indexOf(n);o>-1&&this.options.ns.splice(o,1)}getResource(n,o,a,s={}){const u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,c=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;n.includes(".")?d=n.split("."):(d=[n,o],a&&(Array.isArray(a)?d.push(...a):Rt(a)&&u?d.push(...a.split(u)):d.push(a)));const p=wh(this.data,d);return p==null&&!o&&!a&&n.includes(".")&&(n=d[0],o=d[1],a=d.slice(2).join(".")),p!=null||!c||!Rt(a)?p:vy(this.data?.[n]?.[o],a,u)}addResource(n,o,a,s,u={silent:!1}){const c=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let d=[n,o];a&&(d=d.concat(c?a.split(c):a)),n.includes(".")&&(d=n.split("."),s=o,o=d[1]),this.addNamespaces(o),eR(this.data,d,s),u.silent||this.emit("added",n,o,a,s)}addResources(n,o,a,s={silent:!1}){for(const u in a)(Rt(a[u])||Array.isArray(a[u]))&&this.addResource(n,o,u,a[u],{silent:!0});s.silent||this.emit("added",n,o,a)}addResourceBundle(n,o,a,s,u,c={silent:!1,skipCopy:!1}){let d=[n,o];n.includes(".")&&(d=n.split("."),s=a,a=o,o=d[1]),this.addNamespaces(o);let p=wh(this.data,d)||{};c.skipCopy||(a=JSON.parse(JSON.stringify(a))),s?YO(p,a,u):p={...p,...a},eR(this.data,d,p),c.silent||this.emit("added",n,o,a)}removeResourceBundle(n,o){this.hasResourceBundle(n,o)&&delete this.data[n][o],this.removeNamespaces(o),this.emit("removed",n,o)}hasResourceBundle(n,o){return this.getResource(n,o)!==void 0}getResourceBundle(n,o){return o||(o=this.options.defaultNS),this.getResource(n,o)}getDataByLanguage(n){return this.data[n]}hasLanguageSomeTranslations(n){const o=this.getDataByLanguage(n);return!!(o&&Object.keys(o)||[]).find(s=>{const u=o[s];return tR.has(u)?!0:!u||Object.keys(u).length===0?!1:(typeof u=="object"&&tR.add(u),!0)})}toJSON(){return this.data}}var KO={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,n,o,a,s){return e.forEach(u=>{n=this.processors[u]?.process(n,o,a,s)??n}),n}};const GO=Symbol("i18next/PATH_KEY");function z6(){const e=[],n=Object.create(null);let o;return n.get=(a,s)=>(o?.revoke?.(),s===GO?e:(e.push(s),o=Proxy.revocable(a,n),o.proxy)),Proxy.revocable(Object.create(null),n).proxy}function ps(e,n){const{[GO]:o}=e(z6()),a=n?.keySeparator??".",s=n?.nsSeparator??":",u=n?.enableSelector==="strict";if(o.length>1&&s){const c=n?.ns,d=u?Array.isArray(c)?c:c?[c]:null:Array.isArray(c)?c:null;if(d&&(u?d:d.length>1?d.slice(1):[]).includes(o[0]))return`${o[0]}${s}${o.slice(1).join(a)}`}return o.join(a)}const k0=e=>!Rt(e)&&typeof e!="boolean"&&typeof e!="number";class Eh extends Op{constructor(n,o={}){super(),T6(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,this),this.options=o,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ua.create("translator"),this.checkedLoadedFor={}}changeLanguage(n){n&&(this.language=n)}exists(n,o={interpolation:{}}){const a={...o};if(n==null)return!1;const s=this.resolve(n,a);if(s?.res===void 0)return!1;const u=k0(s.res);return!(a.returnObjects===!1&&u)}extractFromKey(n,o){let a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let u=o.ns||this.options.defaultNS||[];const c=a&&n.includes(a),d=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!k6(n,a,s);if(c&&!d){const p=n.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:n,namespaces:Rt(u)?[u]:u};const g=n.split(a);(a!==s||a===s&&this.options.ns.includes(g[0]))&&(u=g.shift()),n=g.join(s)}return{key:n,namespaces:Rt(u)?[u]:u}}translate(n,o,a){let s=typeof o=="object"?{...o}:o;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),n==null)return"";typeof n=="function"&&(n=ps(n,{...this.options,...s})),Array.isArray(n)||(n=[String(n)]),n=n.map(Y=>typeof Y=="function"?ps(Y,{...this.options,...s}):String(Y));const u=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:d,namespaces:p}=this.extractFromKey(n[n.length-1],s),g=p[p.length-1];let y=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;y===void 0&&(y=":");const h=s.lng||this.language,b=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h?.toLowerCase()==="cimode")return b?u?{res:`${g}${y}${d}`,usedKey:d,exactUsedKey:d,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(s)}:`${g}${y}${d}`:u?{res:d,usedKey:d,exactUsedKey:d,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(s)}:d;const x=this.resolve(n,s);let w=x?.res;const C=x?.usedKey||d,R=x?.exactUsedKey||d,T=["[object Number]","[object Function]","[object RegExp]"],O=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject,A=s.count!==void 0&&!Rt(s.count),N=Eh.hasDefaultValue(s),k=A?this.pluralResolver.getSuffix(h,s.count,s):"",j=s.ordinal&&A?this.pluralResolver.getSuffix(h,s.count,{ordinal:!1}):"",D=A&&!s.ordinal&&s.count===0,z=D&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${k}`]||s[`defaultValue${j}`]||s.defaultValue;let F=w;M&&!w&&N&&(F=z);const G=k0(F),J=Object.prototype.toString.apply(F);if(M&&F&&G&&!T.includes(J)&&!(Rt(O)&&Array.isArray(F))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Y=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,F,{...s,ns:p}):`key '${d} (${this.language})' returned an object instead of string.`;return u?(x.res=Y,x.usedParams=this.getUsedParamsDetails(s),x):Y}if(c){const Y=Array.isArray(F),U=Y?[]:{},H=Y?R:C;for(const L in F)if(Object.prototype.hasOwnProperty.call(F,L)){const $=`${H}${c}${L}`;N&&!w?U[L]=this.translate($,{...s,defaultValue:k0(z)?z[L]:void 0,joinArrays:!1,ns:p}):U[L]=this.translate($,{...s,joinArrays:!1,ns:p}),U[L]===$&&(U[L]=F[L])}w=U}}else if(M&&Rt(O)&&Array.isArray(w))w=w.join(O),w&&(w=this.extendTranslation(w,n,s,x,a));else{let Y=!1,U=!1;!this.isValidLookup(w)&&N&&(Y=!0,w=z),this.isValidLookup(w)||(U=!0,w=d);const L=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&U?void 0:w,$=N&&z!==w&&this.options.updateMissing;if(U||Y||$){if(this.logger.log($?"updateKey":"missingKey",h,g,A&&!$?`${d}${this.pluralResolver.getSuffix(h,s.count,s)}`:d,$?z:w),c){const ee=this.resolve(d,{...s,keySeparator:!1});ee&&ee.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 K=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let ee=0;ee<V.length;ee++)K.push(V[ee]);else this.options.saveMissingTo==="all"?K=this.languageUtils.toResolveHierarchy(s.lng||this.language):K.push(s.lng||this.language);const X=(ee,q,se)=>{const I=N&&se!==w?se:L;this.options.missingKeyHandler?this.options.missingKeyHandler(ee,g,q,I,$,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ee,g,q,I,$,s),this.emit("missingKey",ee,g,q,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?K.forEach(ee=>{const q=this.pluralResolver.getSuffixes(ee,s);D&&s[`defaultValue${this.options.pluralSeparator}zero`]&&!q.includes(`${this.options.pluralSeparator}zero`)&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(se=>{X([ee],d+se,s[`defaultValue${se}`]||z)})}):X(K,d,z))}w=this.extendTranslation(w,n,s,x,a),U&&w===d&&this.options.appendNamespaceToMissingKey&&(w=`${g}${y}${d}`),(U||Y)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}${y}${d}`:d,Y?w:void 0,s))}return u?(x.res=w,x.usedParams=this.getUsedParamsDetails(s),x):w}extendTranslation(n,o,a,s,u){if(this.i18nFormat?.parse)n=this.i18nFormat.parse(n,{...this.options.interpolation.defaultVariables,...a},a.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init({...a,interpolation:{...this.options.interpolation,...a.interpolation}});const p=Rt(n)&&(a?.interpolation?.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let g;if(p){const h=n.match(this.interpolator.nestingRegexp);g=h&&h.length}let y=a.replace&&!Rt(a.replace)?a.replace:a;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),n=this.interpolator.interpolate(n,y,a.lng||this.language||s.usedLng,a),p){const h=n.match(this.interpolator.nestingRegexp),b=h&&h.length;g<b&&(a.nest=!1)}!a.lng&&s&&s.res&&(a.lng=this.language||s.usedLng),a.nest!==!1&&(n=this.interpolator.nest(n,(...h)=>u?.[0]===h[0]&&!a.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${o[0]}`),null):this.translate(...h,o),a)),a.interpolation&&this.interpolator.reset()}const c=a.postProcess||this.options.postProcess,d=Rt(c)?[c]:c;return n!=null&&d?.length&&a.applyPostProcessor!==!1&&(n=KO.handle(d,n,o,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(a)},...a}:a,this)),n}resolve(n,o={}){let a,s,u,c,d;return Rt(n)&&(n=[n]),Array.isArray(n)&&(n=n.map(p=>typeof p=="function"?ps(p,{...this.options,...o}):p)),n.forEach(p=>{if(this.isValidLookup(a))return;const g=this.extractFromKey(p,o),y=g.key;s=y;let h=g.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const b=o.count!==void 0&&!Rt(o.count),x=b&&!o.ordinal&&o.count===0,w=o.context!==void 0&&(Rt(o.context)||typeof o.context=="number")&&o.context!=="",C=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);h.forEach(R=>{this.isValidLookup(a)||(d=R,!this.checkedLoadedFor[`${C[0]}-${R}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(d)&&(this.checkedLoadedFor[`${C[0]}-${R}`]=!0,this.logger.warn(`key "${s}" for languages "${C.join(", ")}" won't get resolved as namespace "${d}" 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(T=>{if(this.isValidLookup(a))return;c=T;const O=[y];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(O,y,T,R,o);else{let A;b&&(A=this.pluralResolver.getSuffix(T,o.count,o));const N=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(o.ordinal&&A.startsWith(k)&&O.push(y+A.replace(k,this.options.pluralSeparator)),O.push(y+A),x&&O.push(y+N)),w){const j=`${y}${this.options.contextSeparator||"_"}${o.context}`;O.push(j),b&&(o.ordinal&&A.startsWith(k)&&O.push(j+A.replace(k,this.options.pluralSeparator)),O.push(j+A),x&&O.push(j+N))}}let M;for(;M=O.pop();)this.isValidLookup(a)||(u=M,a=this.getResource(T,R,M,o))}))})}),{res:a,usedKey:s,exactUsedKey:u,usedLng:c,usedNS:d}}isValidLookup(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}getResource(n,o,a,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(n,o,a,s):this.resourceStore.getResource(n,o,a,s)}getUsedParamsDetails(n={}){const o=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],a=n.replace&&!Rt(n.replace);let s=a?n.replace:n;if(a&&typeof n.count<"u"&&(s={...s,count:n.count}),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!a){s={...s};for(const u of o)delete s[u]}return s}static hasDefaultValue(n){const o="defaultValue";for(const a in n)if(Object.prototype.hasOwnProperty.call(n,a)&&a.startsWith(o)&&n[a]!==void 0)return!0;return!1}}class rR{constructor(n){this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ua.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(n){if(n=zl(n),!n||!n.includes("-"))return null;const o=n.split("-");return o.length===2||(o.pop(),o[o.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(o.join("-"))}getLanguagePartFromCode(n){if(n=zl(n),!n||!n.includes("-"))return n;const o=n.split("-");return this.formatLanguageCode(o[0])}formatLanguageCode(n){if(Rt(n)&&n.includes("-")){let o;try{o=Intl.getCanonicalLocales(n)[0]}catch{}return o&&this.options.lowerCaseLng&&(o=o.toLowerCase()),o||(this.options.lowerCaseLng?n.toLowerCase():n)}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}isSupportedCode(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(n)}getBestMatchFromCodes(n){if(!n)return null;let o;return n.forEach(a=>{if(o)return;const s=this.formatLanguageCode(a);(!this.options.supportedLngs||this.isSupportedCode(s))&&(o=s)}),!o&&this.options.supportedLngs&&n.forEach(a=>{if(o)return;const s=this.getScriptPartFromCode(a);if(this.isSupportedCode(s))return o=s;const u=this.getLanguagePartFromCode(a);if(this.isSupportedCode(u))return o=u;o=this.options.supportedLngs.find(c=>c===u?!0:!c.includes("-")&&!u.includes("-")?!1:!!(c.includes("-")&&!u.includes("-")&&c.slice(0,c.indexOf("-"))===u))}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}getFallbackCodes(n,o){if(!n)return[];if(typeof n=="function"&&(n=n(o)),Rt(n)&&(n=[n]),Array.isArray(n))return n;if(!o)return n.default||[];let a=n[o];return a||(a=n[this.getScriptPartFromCode(o)]),a||(a=n[this.formatLanguageCode(o)]),a||(a=n[this.getLanguagePartFromCode(o)]),a||(a=n.default),a||[]}toResolveHierarchy(n,o){const a=this.options.fallbackLng,s=Array.isArray(a)?a.join("|"):a;s!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=s);const u=o===void 0||o===!1||Rt(o),c=o===void 0&&typeof this.options.fallbackLng=="function",d=Rt(n)&&u&&!c;let p=null;if(d){let b;o===void 0?b="undefined":o===!1?b="boolean:false":b=`string:${o}`,p=`${n.length}:${n}|${b}`}if(p!==null){const b=this.resolveHierarchyCache[p];if(b!==void 0)return b.slice()}const g=this.getFallbackCodes((o===!1?[]:o)||this.options.fallbackLng||[],n),y=[],h=b=>{b&&(this.isSupportedCode(b)?y.push(b):this.logger.warn(`rejecting language code not found in supportedLngs: ${b}`))};return Rt(n)&&(n.includes("-")||n.includes("_"))?(this.options.load!=="languageOnly"&&h(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&h(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&h(this.getLanguagePartFromCode(n))):Rt(n)&&h(this.formatLanguageCode(n)),g.forEach(b=>{const x=this.formatLanguageCode(b);y.includes(x)||h(x)}),p!==null?(this.resolveHierarchyCache[p]=y,y.slice()):y}}const oR={zero:0,one:1,two:2,few:3,many:4,other:5},aR={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class _6{constructor(n,o={}){this.languageUtils=n,this.options=o,this.logger=ua.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(n,o={}){const a=zl(n==="dev"?"en":n),s=o.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:a,type:s});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let c;try{c=new Intl.PluralRules(a,{type:s})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),aR;if(!n.match(/-|_/))return aR;const p=this.languageUtils.getLanguagePartFromCode(n);c=this.getRule(p,o)}return this.pluralRulesCache[u]=c,c}needsPlural(n,o={}){let a=this.getRule(n,o);return a||(a=this.getRule("dev",o)),a?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(n,o,a={}){return this.getSuffixes(n,a).map(s=>`${o}${s}`)}getSuffixes(n,o={}){let a=this.getRule(n,o);return a||(a=this.getRule("dev",o)),a?a.resolvedOptions().pluralCategories.sort((s,u)=>oR[s]-oR[u]).map(s=>`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(n,o,a={}){const s=this.getRule(n,a);return s?`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${s.select(o)}`:(this.logger.warn(`no plural rule found for: ${n}`),this.getSuffix("dev",o,a))}}const iR=(e,n,o,a=".",s=!0)=>{let u=A6(e,n,o);return!u&&s&&Rt(o)&&(u=vy(e,o,a),u===void 0&&(u=vy(n,o,a))),u};class sR{constructor(n={}){this.logger=ua.create("interpolator"),this.options=n,this.format=n?.interpolation?.format||(o=>o),this.init(n)}init(n={}){n.interpolation||(n.interpolation={escapeValue:!0});const{escape:o,escapeValue:a,useRawValueToEscape:s,prefix:u,prefixEscaped:c,suffix:d,suffixEscaped:p,formatSeparator:g,unescapeSuffix:y,unescapePrefix:h,nestingPrefix:b,nestingPrefixEscaped:x,nestingSuffix:w,nestingSuffixEscaped:C,nestingOptionsSeparator:R,maxReplaces:T,alwaysFormat:O}=n.interpolation;this.escape=o!==void 0?o:N6,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=u?ja(u):c||"{{",this.suffix=d?ja(d):p||"}}",this.formatSeparator=g||",",this.unescapePrefix=y?"":h?ja(h):"-",this.unescapeSuffix=this.unescapePrefix?"":y?ja(y):"",this.nestingPrefix=b?ja(b):x||ja("$t("),this.nestingSuffix=w?ja(w):C||ja(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=T||1e3,this.alwaysFormat=O!==void 0?O:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const n=(o,a)=>o?.source===a?(o.lastIndex=0,o):new RegExp(a,"g");this.regexp=n(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=n(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=n(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(n,o,a,s){let u,c,d;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},g=C=>{if(!C.includes(this.formatSeparator)){const M=iR(o,p,C,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(M,void 0,a,{...s,...o,interpolationkey:C}):M}const R=C.split(this.formatSeparator),T=R.shift().trim(),O=R.join(this.formatSeparator).trim();return this.format(iR(o,p,T,this.options.keySeparator,this.options.ignoreJSONStructure),O,a,{...s,...o,interpolationkey:T})};this.resetRegExp(),!this.escapeValue&&typeof n=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(n)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const y=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,b=[{regex:this.regexpUnescape,safeValue:C=>C},{regex:this.regexp,safeValue:C=>this.escapeValue?this.escape(C):C}],x=[];let w=0;return b.forEach(C=>{for(d=0;u=C.regex.exec(n);){const R=u.index-w,T=x.find(([A,N])=>R>=A&&R<N);if(T){C.regex.lastIndex=T[1]+w;continue}const O=u[1].trim();if(c=g(O),c===void 0)if(typeof y=="function"){const A=y(n,u,s);c=Rt(A)?A:""}else if(s&&Object.prototype.hasOwnProperty.call(s,O))c="";else if(h){c=u[0];continue}else this.logger.warn(`missed to pass in variable ${O} for interpolating ${n}`),c="";else!Rt(c)&&!this.useRawValueToEscape&&(c=Pf(c));const M=Pf(C.safeValue(c));if(n=n.slice(0,u.index)+M+n.slice(u.index+u[0].length),h?(C.regex===this.regexpUnescape?x.push([u.index,u.index+M.length]):w+=M.length-u[0].length,C.regex.lastIndex+=M.length,C.regex.lastIndex-=u[0].length):C.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),n}nest(n,o,a={}){let s,u,c;const d=(h,b)=>{const x=this.nestingOptionsSeparator;if(!h.includes(x))return h;const w=h.split(new RegExp(`${ja(x)}[ ]*{`));let C=`{${w[1]}`;h=w[0],C=this.interpolate(C,c);const R=C.match(/'/g),T=C.match(/"/g);((R?.length??0)%2===0&&!T||(T?.length??0)%2!==0)&&(C=C.replace(/'/g,'"'));try{c=JSON.parse(C),b&&(c={...b,...c})}catch(O){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,O),`${h}${x}${C}`}return c.defaultValue&&c.defaultValue.includes(this.prefix)&&delete c.defaultValue,h},p=new RegExp(this.nestingRegexp);let g="",y=0;for(;s=p.exec(n);){let h=[];c={...a},c=c.replace&&!Rt(c.replace)?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;const b=/{.*}/s.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(b!==-1&&(h=s[1].slice(b).split(this.formatSeparator).map(x=>x.trim()).filter(Boolean),s[1]=s[1].slice(0,b)),u=o(d.call(this,s[1].trim(),c),c),u&&s[0]===n&&!Rt(u))return u;Rt(u)||(u=Pf(u)),u||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${n}`),u=""),h.length&&(u=h.reduce((x,w)=>this.format(x,w,a.lng,{...a,interpolationkey:s[1].trim()}),u.trim())),g+=n.slice(y,s.index)+Pf(u),y=p.lastIndex,this.regexp.lastIndex=0}return y?g+n.slice(y):n}}const H6=e=>{let n=e.toLowerCase().trim();const o={};if(e.includes("(")){const a=e.split("(");n=a[0].toLowerCase().trim();const s=a[1].slice(0,-1);n==="currency"&&!s.includes(":")?o.currency||(o.currency=s.trim()):n==="relativetime"&&!s.includes(":")?o.range||(o.range=s.trim()):s.split(";").forEach(c=>{if(c){const[d,...p]=c.split(":"),g=p.join(":").trim().replace(/^'+|'+$/g,""),y=d.trim();o[y]||(o[y]=g),g==="false"&&(o[y]=!1),g==="true"&&(o[y]=!0),isNaN(g)||(o[y]=parseInt(g,10))}})}return{formatName:n,formatOptions:o}},lR=e=>{const n={};return(o,a,s)=>{let u=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(u={...u,[s.interpolationkey]:void 0});let c;try{c=a+JSON.stringify(u)}catch{return e(zl(a),s)(o)}let d=n[c];return d||(d=e(zl(a),s),n[c]=d),d(o)}},U6=e=>(n,o,a)=>e(zl(o),a)(n);class F6{constructor(n={}){this.logger=ua.create("formatter"),this.options=n,this.init(n)}init(n,o={interpolation:{}}){this.formatSeparator=o.interpolation.formatSeparator||",";const a=o.cacheInBuiltFormats?lR:U6;this.formats={number:a((s,u)=>{const c=new Intl.NumberFormat(s,{...u});return d=>c.format(d)}),currency:a((s,u)=>{const c=new Intl.NumberFormat(s,{...u,style:"currency"});return d=>c.format(d)}),datetime:a((s,u)=>{const c=new Intl.DateTimeFormat(s,{...u});return d=>c.format(d)}),relativetime:a((s,u)=>{const c=new Intl.RelativeTimeFormat(s,{...u});return d=>c.format(d,u.range||"day")}),list:a((s,u)=>{const c=new Intl.ListFormat(s,{...u});return d=>c.format(d)})}}add(n,o){this.formats[n.toLowerCase().trim()]=o}addCached(n,o){this.formats[n.toLowerCase().trim()]=lR(o)}format(n,o,a,s={}){if(!o||n==null)return n;const u=o.split(this.formatSeparator),c=[];for(let p=0;p<u.length;p++){let g=u[p];for(;g.indexOf("(")>-1&&!g.includes(")")&&p+1<u.length;)g=`${g}${this.formatSeparator}${u[++p]}`;c.push(g)}return c.reduce((p,g)=>{const{formatName:y,formatOptions:h}=H6(g);if(this.formats[y]){let b=p;try{const x=s?.formatParams?.[s.interpolationkey]||{},w=x.locale||x.lng||s.locale||s.lng||a;b=this.formats[y](p,w,{...h,...s,...x})}catch(x){this.logger.warn(x)}return b}else this.logger.warn(`there was no format function for ${y}`);return p},n)}}const B6=(e,n)=>{e.pending[n]!==void 0&&(delete e.pending[n],e.pendingCount--)};class V6 extends Op{constructor(n,o,a,s={}){super(),this.backend=n,this.store=o,this.services=a,this.languageUtils=a.languageUtils,this.options=s,this.logger=ua.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(a,s.backend,s)}queueLoad(n,o,a,s){const u={},c={},d={},p={};return n.forEach(g=>{let y=!0;o.forEach(h=>{const b=`${g}|${h}`;!a.reload&&this.store.hasResourceBundle(g,h)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?c[b]===void 0&&(c[b]=!0):(this.state[b]=1,y=!1,c[b]===void 0&&(c[b]=!0),u[b]===void 0&&(u[b]=!0),p[h]===void 0&&(p[h]=!0)))}),y||(d[g]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(p)}}loaded(n,o,a){const s=n.split("|"),u=s[0],c=s[1];o&&this.emit("failedLoading",u,c,o),!o&&a&&this.store.addResourceBundle(u,c,a,void 0,void 0,{skipCopy:!0}),this.state[n]=o?-1:2,o&&a&&(this.state[n]=0);const d={};this.queue.forEach(p=>{M6(p.loaded,[u],c),B6(p,n),o&&p.errors.push(o),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(g=>{d[g]||(d[g]={});const y=p.loaded[g];y.length&&y.forEach(h=>{d[g][h]===void 0&&(d[g][h]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(p=>!p.done)}read(n,o,a,s=0,u=this.retryTimeout,c){if(!n.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:n,ns:o,fcName:a,tried:s,wait:u,callback:c});return}this.readingCalls++;const d=(g,y)=>{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(g&&y&&s<this.maxRetries){setTimeout(()=>{this.read(n,o,a,s+1,u*2,c)},u);return}c(g,y)},p=this.backend[a].bind(this.backend);if(p.length===2){try{const g=p(n,o);g&&typeof g.then=="function"?g.then(y=>d(null,y)).catch(d):d(null,g)}catch(g){d(g)}return}return p(n,o,d)}prepareLoading(n,o,a={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Rt(n)&&(n=this.languageUtils.toResolveHierarchy(n)),Rt(o)&&(o=[o]);const u=this.queueLoad(n,o,a,s);if(!u.toLoad.length)return u.pending.length||s(),null;u.toLoad.forEach(c=>{this.loadOne(c)})}load(n,o,a){this.prepareLoading(n,o,{},a)}reload(n,o,a){this.prepareLoading(n,o,{reload:!0},a)}loadOne(n,o=""){const a=n.split("|"),s=a[0],u=a[1];this.read(s,u,"read",void 0,void 0,(c,d)=>{c&&this.logger.warn(`${o}loading namespace ${u} for language ${s} failed`,c),!c&&d&&this.logger.log(`${o}loaded namespace ${u} for language ${s}`,d),this.loaded(n,c,d)})}saveMissing(n,o,a,s,u,c={},d=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(o)){this.logger.warn(`did not save key "${a}" as the namespace "${o}" 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(!(a==null||a==="")){if(this.backend?.create){const p={...c,isUpdate:u},g=this.backend.create.bind(this.backend);if(g.length<6)try{let y;g.length===5?y=g(n,o,a,s,p):y=g(n,o,a,s),y&&typeof y.then=="function"?y.then(h=>d(null,h)).catch(d):d(null,y)}catch(y){d(y)}else g(n,o,a,s,d,p)}!n||!n[0]||this.store.addResource(n[0],o,a,s)}}}const L0=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,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 n={};if(typeof e[1]=="object"&&(n=e[1]),Rt(e[1])&&(n.defaultValue=e[1]),Rt(e[2])&&(n.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const o=e[3]||e[2];Object.keys(o).forEach(a=>{n[a]=o[a]})}return n},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),uR=e=>(Rt(e.ns)&&(e.ns=[e.ns]),Rt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Rt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),kf=()=>{},q6=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(o=>{typeof e[o]=="function"&&(e[o]=e[o].bind(e))})};class sc extends Op{constructor(n={},o){if(super(),this.options=uR(n),this.services={},this.logger=ua,this.modules={external:[]},q6(this),o&&!this.isInitialized&&!n.isClone){if(!this.options.initAsync)return this.init(n,o),this;setTimeout(()=>{this.init(n,o)},0)}}init(n={},o){this.isInitializing=!0,typeof n=="function"&&(o=n,n={}),n.defaultNS==null&&n.ns&&(Rt(n.ns)?n.defaultNS=n.ns:n.ns.includes("translation")||(n.defaultNS=n.ns[0]));const a=L0();this.options={...a,...this.options,...uR(n)},this.options.interpolation={...a.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=a.overloadTranslationOptionHandler);const s=g=>g?typeof g=="function"?new g:g:null;if(!this.options.isClone){this.modules.logger?ua.init(s(this.modules.logger),this.options):ua.init(null,this.options);let g;this.modules.formatter?g=this.modules.formatter:g=F6;const y=new rR(this.options);this.store=new nR(this.options.resources,this.options);const h=this.services;h.logger=ua,h.resourceStore=this.store,h.languageUtils=y,h.pluralResolver=new _6(y,{prepend:this.options.pluralSeparator}),g&&(h.formatter=s(g),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new sR(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new V6(s(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(b,...x)=>{this.emit(b,...x)}),this.modules.languageDetector&&(h.languageDetector=s(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=s(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new Eh(this.services,this.options),this.translator.on("*",(b,...x)=>{this.emit(b,...x)}),this.modules.external.forEach(b=>{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,o||(o=kf),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const g=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);g.length>0&&g[0]!=="dev"&&(this.options.lng=g[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(g=>{this[g]=(...y)=>this.store[g](...y)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(g=>{this[g]=(...y)=>(this.store[g](...y),this)});const d=Qu(),p=()=>{const g=(y,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),d.resolve(h),o(y,h)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return g(null,this.t.bind(this));this.changeLanguage(this.options.lng,g)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),d}loadResources(n,o=kf){let a=o;const s=Rt(n)?n:this.language;if(typeof n=="function"&&(a=n),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return a();const u=[],c=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(g=>{g!=="cimode"&&(u.includes(g)||u.push(g))})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>c(p)),this.options.preload?.forEach?.(d=>c(d)),this.services.backendConnector.load(u,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),a(d)})}else a(null)}reloadResources(n,o,a){const s=Qu();return typeof n=="function"&&(a=n,n=void 0),typeof o=="function"&&(a=o,o=void 0),n||(n=this.languages),o||(o=this.options.ns),a||(a=kf),this.services.backendConnector.reload(n,o,u=>{s.resolve(),a(u)}),s}use(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&KO.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}setResolvedLanguage(n){if(!(!n||!this.languages)&&!["cimode","dev"].includes(n)){for(let o=0;o<this.languages.length;o++){const a=this.languages[o];if(!["cimode","dev"].includes(a)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}!this.resolvedLanguage&&!this.languages.includes(n)&&this.store.hasLanguageSomeTranslations(n)&&(this.resolvedLanguage=n,this.languages.unshift(n))}}changeLanguage(n,o){this.isLanguageChangingTo=n;const a=Qu();this.emit("languageChanging",n);const s=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},u=(d,p)=>{p?this.isLanguageChangingTo===n&&(s(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,a.resolve((...g)=>this.t(...g)),o&&o(d,(...g)=>this.t(...g))},c=d=>{!n&&!d&&this.services.languageDetector&&(d=[]);const p=Rt(d)?d:d&&d[0],g=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(Rt(d)?[d]:d);g&&(this.language||s(g),this.translator.language||this.translator.changeLanguage(g),this.services.languageDetector?.cacheUserLanguage?.(g)),this.loadResources(g,y=>{u(y,g)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(n),a}getFixedT(n,o,a,s){const u=s?.scopeNs,c=(d,p,...g)=>{let y;typeof p!="object"?y=this.options.overloadTranslationOptionHandler([d,p].concat(g)):y={...p},y.lng=y.lng||c.lng,y.lngs=y.lngs||c.lngs;const h=y.ns!==void 0&&y.ns!==null;y.ns=y.ns||c.ns,y.keyPrefix!==""&&(y.keyPrefix=y.keyPrefix||a||c.keyPrefix);const b={...this.options,...y};Array.isArray(u)&&!h&&(b.ns=u),typeof y.keyPrefix=="function"&&(y.keyPrefix=ps(y.keyPrefix,b));const x=this.options.keySeparator||".";let w;return y.keyPrefix&&Array.isArray(d)?w=d.map(C=>(typeof C=="function"&&(C=ps(C,b)),`${y.keyPrefix}${x}${C}`)):(typeof d=="function"&&(d=ps(d,b)),w=y.keyPrefix?`${y.keyPrefix}${x}${d}`:d),this.t(w,y)};return Rt(n)?c.lng=n:c.lngs=n,c.ns=o,c.keyPrefix=a,c}t(...n){return this.translator?.translate(...n)}exists(...n){return this.translator?.exists(...n)}setDefaultNamespace(n){this.options.defaultNS=n}hasLoadedNamespace(n,o={}){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 a=o.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const c=(g,y)=>{const h=this.services.backendConnector.state[`${g}|${y}`];return h===-1||h===0||h===2};if(o.precheck){const g=o.precheck(this,c);if(g!==void 0)return g}if(this.hasResourceBundle(a,n)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;const{languageUtils:d}=this.services,p=o.lng?d.isSupportedCode(a)&&d.toResolveHierarchy(a,!1)[0]:a;return!!((!p||c(p,n))&&(!s||c(u,n)))}loadNamespaces(n,o){const a=Qu();return this.options.ns?(Rt(n)&&(n=[n]),n.forEach(s=>{this.options.ns.includes(s)||this.options.ns.push(s)}),this.loadResources(s=>{a.resolve(),o&&o(s)}),a):(o&&o(),Promise.resolve())}loadLanguages(n,o){const a=Qu();Rt(n)&&(n=[n]);const s=this.options.preload||[],u=n.filter(c=>!s.includes(c)&&this.services.languageUtils.isSupportedCode(c));return u.length?(this.options.preload=s.concat(u),this.loadResources(c=>{a.resolve(),o&&o(c)}),a):(o&&o(),Promise.resolve())}dir(n){if(n||(n=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!n)return"rtl";try{const s=new Intl.Locale(n);if(s&&s.getTextInfo){const u=s.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const o=["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"],a=this.services?.languageUtils||new rR(L0());return n.toLowerCase().indexOf("-latn")>1?"ltr":o.includes(a.getLanguagePartFromCode(n))||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(n={},o){const a=new sc(n,o);return a.createInstance=sc.createInstance,a}cloneInstance(n={},o=kf){const a=n.forkResourceStore;a&&delete n.forkResourceStore;const s={...this.options,preload:!1,...n,isClone:!0},u=new sc(s);if((n.debug!==void 0||n.prefix!==void 0)&&(u.logger=u.logger.clone(n)),["store","services","language"].forEach(d=>{u[d]=this[d]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},a){const d=g=>{const y=Array.isArray(g)?[...g]:{...g};return Object.keys(y).forEach(h=>{y[h]&&typeof y[h]=="object"&&(y[h]=d(y[h]))}),y},p=d(this.store.data);u.store=new nR(p,s),u.services.resourceStore=u.store}if(n.interpolation){const p={...L0().interpolation,...this.options.interpolation,...n.interpolation},g={...s,interpolation:p};u.services.interpolator=new sR(g)}return u.translator=new Eh(u.services,s),u.translator.on("*",(d,...p)=>{u.emit(d,...p)}),u.init(s,o),u.translator.options=s,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const dr=sc.createInstance();dr.createInstance;dr.dir;dr.init;dr.loadResources;dr.reloadResources;dr.use;dr.changeLanguage;dr.getFixedT;dr.t;dr.exists;dr.setDefaultNamespace;dr.hasLoadedNamespace;dr.loadNamespaces;dr.loadLanguages;const Y6=(e,n,o,a)=>{const s=[o,{code:n,...a||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);xs(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...s):console?.warn&&console.warn(...s)},cR={},Zf=(e,n,o,a)=>{xs(o)&&cR[o]||(xs(o)&&(cR[o]=new Date),Y6(e,n,o,a))},$O=(e,n)=>()=>{if(e.isInitialized)n();else{const o=()=>{setTimeout(()=>{e.off("initialized",o)},0),n()};e.on("initialized",o)}},by=(e,n,o)=>{e.loadNamespaces(n,$O(e,o))},dR=(e,n,o,a)=>{if(xs(o)&&(o=[o]),e.options.preload&&e.options.preload.indexOf(n)>-1)return by(e,o,a);o.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(n,$O(e,a))},K6=(e,n,o={})=>!n.languages||!n.languages.length?(Zf(n,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:n.languages}),!0):n.hasLoadedNamespace(e,{lng:o.lng,precheck:(a,s)=>{if(o.bindI18n&&o.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!s(a.isLanguageChangingTo,e))return!1}}),xs=e=>typeof e=="string",G6=e=>typeof e=="object"&&e!==null,$6=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,X6={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Q6=e=>X6[e],Z6=e=>e.replace($6,Q6);let xy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Z6,transDefaultProps:void 0};const J6=(e={})=>{xy={...xy,...e}},W6=()=>xy;let XO;const e8=e=>{XO=e},t8=()=>XO,n8={type:"3rdParty",init(e){J6(e.options.react),e8(e)}},r8=v.createContext();class o8{constructor(){this.usedNamespaces={}}addUsedNamespaces(n){n.forEach(o=>{this.usedNamespaces[o]||(this.usedNamespaces[o]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const a8=(e,n)=>{if(xs(n))return n;if(G6(n)&&xs(n.defaultValue))return n.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const o=e[e.length-1];return typeof o=="function"?"":o}return e},i8={t:a8,ready:!1},s8=()=>()=>{},sn=(e,n={})=>{const{i18n:o}=n,{i18n:a,defaultNS:s}=v.useContext(r8)||{},u=o||a||t8();u&&!u.reportNamespaces&&(u.reportNamespaces=new o8),u||Zf(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const c=v.useMemo(()=>({...W6(),...u?.options?.react,...n}),[u,n]),{useSuspense:d,keyPrefix:p,bindI18n:g,bindI18nStore:y}=c,h=s||u?.options?.defaultNS,b=xs(h)?[h]:h||["translation"],x=JSON.stringify(b),w=v.useMemo(()=>b,[x]);u?.reportNamespaces?.addUsedNamespaces?.(w);const C=v.useRef(0),R=v.useCallback(U=>{if(!u)return s8;const H=()=>{C.current+=1,U()};return g&&u.on(g,H),y&&u.store.on(y,H),()=>{g&&g.split(" ").forEach(L=>u.off(L,H)),y&&y.split(" ").forEach(L=>u.store.off(L,H))}},[u,g,y]),T=v.useRef(),O=v.useCallback(()=>{if(!u)return i8;const U=!!(u.isInitialized||u.initializedStoreOnce)&&w.every(ee=>K6(ee,u,c)),H=n.lng||u.language,L=C.current,$=typeof p=="function"?ps(p,{...u.options,ns:w}):p,K=T.current;if(K&&K.i18n===u&&K.ready===U&&K.lng===H&&K.namespaces===w&&K.keyPrefix===$&&K.revision===L)return K;const X={t:u.getFixedT(H,c.nsMode==="fallback"?w:w[0],p,{scopeNs:w}),i18n:u,ready:U,lng:H,namespaces:w,keyPrefix:$,revision:L};return T.current=X,X},[u,w,p,c,n.lng]),[M,A]=v.useState(0);let{t:N,ready:k}=tp.useSyncExternalStore(R,O,O),j;u&&d&&!k&&(j=new Promise(U=>{const H=()=>U();n.lng?dR(u,n.lng,w,H):by(u,w,H)}),{t:N,ready:k}=O()),v.useEffect(()=>{if(u&&!k&&!d){const U=()=>A(H=>H+1);n.lng?dR(u,n.lng,w,U):by(u,w,U)}},[u,n.lng,w,k,d,M]);const D=u||{},z=v.useRef(null),F=v.useRef(),G=U=>`${U.language}|${U.resolvedLanguage}|${U.languages?.join(",")}`,J=U=>{const H=Object.getOwnPropertyDescriptors(U);H.__original&&delete H.__original;const L=Object.create(Object.getPrototypeOf(U),H);if(!Object.prototype.hasOwnProperty.call(L,"__original"))try{Object.defineProperty(L,"__original",{value:U,writable:!1,enumerable:!1,configurable:!1})}catch{}return L},Y=v.useMemo(()=>{const U=D,H=U&&G(U);let L=U;U&&(z.current&&z.current.__original===U?F.current!==H?(L=J(U),z.current=L,F.current=H):L=z.current:(L=J(U),z.current=L,F.current=H));const $=!k&&!d?(...V)=>(Zf(u,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),N(...V)):N,K=[$,L,k];return K.t=$,K.i18n=L,K.ready=k,K},[N,D,k,D.resolvedLanguage,D.language,D.languages]);if(u&&d&&!k){let U=!1;try{U=!1}catch{}throw U&&Zf(u,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),j}return Y};function l8({...e}){return S.jsx(VO,{"data-slot":"sheet",...e})}function u8({...e}){return S.jsx(BO,{"data-slot":"sheet-portal",...e})}function c8({className:e,...n}){return S.jsx(_O,{"data-slot":"sheet-overlay",className:Ze("fixed inset-0 z-50 bg-black/80 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...n})}function d8({className:e,children:n,side:o="right",showCloseButton:a=!0,...s}){const{t:u}=sn();return S.jsxs(u8,{children:[S.jsx(c8,{}),S.jsxs(FO,{"data-slot":"sheet-content","data-side":o,className:Ze("fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-10 data-[side=bottom]:data-starting-style:translate-y-10 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=left]:data-ending-style:-translate-x-10 data-[side=left]:data-starting-style:-translate-x-10 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=right]:data-ending-style:translate-x-10 data-[side=right]:data-starting-style:translate-x-10 data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:-translate-y-10 data-[side=top]:data-starting-style:-translate-y-10 data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...s,children:[n,a&&S.jsxs(Tp,{"data-slot":"sheet-close",render:S.jsx(Jt,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[S.jsx(Rs,{}),S.jsx("span",{className:"sr-only",children:u("a11y.close")})]})]})]})}function f8({className:e,...n}){return S.jsx("div",{"data-slot":"sheet-header",className:Ze("flex flex-col gap-1.5 p-6",e),...n})}function h8({className:e,...n}){return S.jsx(qO,{"data-slot":"sheet-title",className:Ze("font-heading text-sm font-medium text-foreground",e),...n})}function p8({className:e,...n}){return S.jsx(HO,{"data-slot":"sheet-description",className:Ze("text-xs/relaxed text-muted-foreground",e),...n})}function co({className:e,...n}){return S.jsx("div",{"data-slot":"skeleton",className:Ze("animate-pulse rounded-md bg-muted",e),...n})}const g8="sidebar_state",m8=3600*24*7,y8="16rem",v8="18rem",b8="3rem",x8="b",QO=v.createContext(null);function Gl(){const e=v.useContext(QO);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function S8({defaultOpen:e=!0,open:n,onOpenChange:o,className:a,style:s,children:u,...c}){const d=Q_(),[p,g]=v.useState(!1),[y,h]=v.useState(e),b=n??y,x=v.useCallback(T=>{const O=typeof T=="function"?T(b):T;o?o(O):h(O),document.cookie=`${g8}=${O}; path=/; max-age=${m8}`},[o,b]),w=v.useCallback(()=>d?g(T=>!T):x(T=>!T),[d,x,g]);v.useEffect(()=>{const T=O=>{O.key===x8&&(O.metaKey||O.ctrlKey)&&(O.preventDefault(),w())};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[w]);const C=b?"expanded":"collapsed",R=v.useMemo(()=>({state:C,open:b,setOpen:x,isMobile:d,openMobile:p,setOpenMobile:g,toggleSidebar:w}),[C,b,x,d,p,g,w]);return S.jsx(QO.Provider,{value:R,children:S.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":y8,"--sidebar-width-icon":b8,...s},className:Ze("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...c,children:u})})}function w8({side:e="left",variant:n="sidebar",collapsible:o="offcanvas",className:a,children:s,dir:u,...c}){const{t:d}=sn(),{isMobile:p,state:g,openMobile:y,setOpenMobile:h}=Gl();return o==="none"?S.jsx("div",{"data-slot":"sidebar",className:Ze("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...c,children:s}):p?S.jsx(l8,{open:y,onOpenChange:h,...c,children:S.jsxs(d8,{dir:u,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":v8},side:e,children:[S.jsxs(f8,{className:"sr-only",children:[S.jsx(h8,{children:d("a11y.sidebar")}),S.jsx(p8,{children:d("a11y.sidebarDescription")})]}),S.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):S.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":g,"data-collapsible":g==="collapsed"?o:"","data-variant":n,"data-side":e,"data-slot":"sidebar",children:[S.jsx("div",{"data-slot":"sidebar-gap",className:Ze("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),S.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:Ze("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:-left-(--sidebar-width) data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:-right-(--sidebar-width) md:flex",n==="floating"||n==="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",a),...c,children:S.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:s})})]})}function R8({className:e,onClick:n,...o}){const{t:a}=sn(),{toggleSidebar:s}=Gl();return S.jsxs(Jt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Ze(e),onClick:u=>{n?.(u),s()},...o,children:[S.jsx(KP,{}),S.jsx("span",{className:"sr-only",children:a("a11y.toggleSidebar")})]})}function E8({className:e,...n}){const{t:o}=sn(),{toggleSidebar:a}=Gl();return S.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":o("a11y.toggleSidebar"),tabIndex:-1,onClick:a,title:o("a11y.toggleSidebar"),className:Ze("absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:inset-s-1/2 after:w-0.5 hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...n})}function C8({className:e,...n}){return S.jsx("main",{"data-slot":"sidebar-inset",className:Ze("relative flex w-full flex-1 flex-col 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",e),...n})}function T8({className:e,...n}){return S.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Ze("flex flex-col gap-2 p-2",e),...n})}function O8({className:e,...n}){return S.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Ze("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...n})}function M8({className:e,...n}){return S.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Ze("relative flex w-full min-w-0 flex-col px-2 py-1",e),...n})}function ZO({className:e,...n}){return S.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Ze("flex w-full min-w-0 flex-col gap-px",e),...n})}function Jf({className:e,...n}){return S.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Ze("group/menu-item relative",e),...n})}const A8=Cp("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs ring-sidebar-ring outline-hidden 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! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Wf({render:e,isActive:n=!1,variant:o="default",size:a="default",tooltip:s,className:u,...c}){const{isMobile:d,state:p}=Gl(),g=IO({defaultTagName:"button",props:Lr({className:Ze(A8({variant:o,size:a}),u)},c),render:s?S.jsx(yh,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:n}});return s?(typeof s=="string"&&(s={children:s}),S.jsxs(mh,{children:[g,S.jsx(vh,{side:"right",align:"center",hidden:p!=="collapsed"||d,...s})]})):g}function D8({className:e,...n}){return S.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:Ze("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",e),...n})}function N8({className:e,...n}){return S.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Ze("group/menu-sub-item relative",e),...n})}function I8({render:e,size:n="md",isActive:o=!1,className:a,...s}){return IO({defaultTagName:"a",props:Lr({className:Ze("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-xs data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",a)},s),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:n,active:o}})}function j8({items:e}){const{t:n}=sn(),{pathname:o}=Hr(),{isMobile:a,state:s}=Gl(),u=s==="collapsed"&&!a;return S.jsx(M8,{children:S.jsx(ZO,{children:e.map(c=>{const d=c.icon,p=c.items?.some(g=>g.url===o)??!1;return c.items?u?S.jsx(Jf,{children:S.jsxs(Nv,{children:[S.jsxs(Iv,{render:S.jsx(Wf,{tooltip:n(c.titleKey),isActive:p}),children:[S.jsx(d,{}),S.jsx("span",{children:n(c.titleKey)})]}),S.jsx(jv,{className:"w-40",side:"right",align:"start",sideOffset:4,children:S.jsxs(AO,{children:[S.jsx(DO,{children:n(c.titleKey)}),c.items.map(g=>S.jsx(NO,{className:"cursor-pointer",render:S.jsx(ac,{to:g.url}),children:S.jsx("span",{children:n(g.titleKey)})},g.titleKey))]})})]})},c.titleKey):S.jsxs(Iz,{defaultOpen:p,className:"group/collapsible",render:S.jsx(Jf,{}),children:[S.jsxs(jz,{render:S.jsx(Wf,{tooltip:n(c.titleKey),isActive:p}),children:[S.jsx(d,{}),S.jsx("span",{children:n(c.titleKey)}),S.jsx(MP,{className:`
14
- ml-auto transition-transform duration-200
15
- group-data-open/collapsible:rotate-90
16
- `})]}),S.jsx(Pz,{children:S.jsx(D8,{children:c.items.map(g=>S.jsx(N8,{children:S.jsx(I8,{isActive:o===g.url,render:S.jsx(ac,{to:g.url}),children:S.jsx("span",{children:n(g.titleKey)})})},g.titleKey))})})]},`${c.titleKey}-${p?"active":"inactive"}`):S.jsx(Jf,{children:S.jsxs(Wf,{tooltip:n(c.titleKey),isActive:o===c.url,render:S.jsx(ac,{to:c.url??"/dashboard"}),children:[S.jsx(d,{}),S.jsx("span",{children:n(c.titleKey)})]})},c.titleKey)})})})}const kv=[{titleKey:"nav.dashboard",url:"/dashboard",icon:UP},{titleKey:"nav.library",icon:FP,items:[{titleKey:"nav.instructions",url:"/library/instructions"},{titleKey:"nav.skills",url:"/library/skills"}]},{titleKey:"nav.models",icon:dC,items:[{titleKey:"nav.genesis",url:"/models/genesis"},{titleKey:"nav.explorer",url:"/models/explorer"},{titleKey:"nav.quantum",url:"/models/quantum"}]}],P8=new Map([["/settings","nav.settings"],...kv.flatMap(e=>[...e.url?[[e.url,e.titleKey]]:[],...e.items?.map(n=>[n.url,n.titleKey])??[]])]);function JO(e){return P8.get(e)??"nav.dashboard"}const k8=kv.flatMap(e=>[...e.url?[e.url]:[],...e.items?.map(n=>n.url)??[]]),L8=k8;function z8({...e}){const{t:n}=sn(),{pathname:o}=Hr(),{isMobile:a,setOpenMobile:s}=Gl();return v.useEffect(()=>{a&&s(!1)},[a,o,s]),S.jsxs(w8,{collapsible:"icon",...e,children:[S.jsx(O8,{children:S.jsx(j8,{items:kv})}),S.jsx(T8,{children:S.jsx(ZO,{children:S.jsx(Jf,{children:S.jsxs(Wf,{tooltip:n("nav.settings"),render:S.jsx(ac,{to:"/settings"}),children:[S.jsx(QP,{}),S.jsx("span",{children:n("nav.settings")})]})})})}),S.jsx(E8,{})]})}const Mp=v.createContext(null);Mp.displayName="PageHeaderActionsContext";function _8({children:e}){const[n,o]=v.useState(null);return S.jsx(Mp,{value:{container:n,setContainer:o},children:e})}function H8(){const e=v.use(Mp);if(!e)throw new Error("PageHeaderActionsSlot must be used within PageHeaderActionsProvider");const n=e.setContainer,o=v.useCallback(a=>{n(a)},[n]);return S.jsx("div",{ref:o,className:"ml-auto flex shrink-0 items-center gap-2 px-4"})}function U8({children:e}){const n=v.use(Mp);return n?.container?cr.createPortal(e,n.container):null}function F8(){const{t:e}=sn(),{pathname:n}=Hr();return S.jsx(_8,{children:S.jsxs(S8,{children:[S.jsx(z8,{}),S.jsxs(C8,{children:[S.jsxs("header",{className:`
17
- flex h-16 shrink-0 items-center gap-2 transition-[width,height]
18
- ease-linear
19
- group-has-data-[collapsible=icon]/sidebar-wrapper:h-12
20
- `,children:[S.jsxs("div",{className:"flex min-w-0 items-center gap-2 px-4",children:[S.jsx(R8,{size:"icon",className:"-ml-1"}),S.jsx(LO,{orientation:"vertical",className:`
21
- mr-2
22
- data-vertical:h-4 data-vertical:self-auto
23
- `}),S.jsx("span",{className:"truncate text-sm font-medium",children:e(JO(n))})]}),S.jsx(H8,{})]}),S.jsx(KT,{})]})]})})}function B8(){const{t:e}=sn(),{pathname:n}=Hr(),o=mL(),a=mp();let s;for(const c of o.toReversed())if(V8(c.handle)){s=c.handle.backTo;break}const u=()=>{if(s===void 0){a(-1);return}a(s)};return S.jsxs("div",{className:"flex h-dvh flex-col overflow-hidden bg-background",children:[S.jsx("header",{className:`
24
- flex h-16 shrink-0 items-center gap-2 transition-[width,height]
25
- ease-linear
26
- `,children:S.jsxs("div",{className:"flex items-center gap-2 px-4",children:[S.jsxs(Jt,{variant:"ghost",size:"icon",className:"-ml-1",onClick:u,children:[S.jsx(OP,{}),S.jsx("span",{className:"sr-only",children:e("a11y.goBack")})]}),S.jsx(LO,{orientation:"vertical",className:`
27
- mr-2
28
- data-vertical:h-4 data-vertical:self-auto
29
- `}),S.jsx("span",{className:"text-sm font-medium",children:e(JO(n))})]})}),S.jsx("main",{className:"min-h-0 flex-1 overflow-hidden",children:S.jsx(KT,{})})]})}function V8(e){return typeof e=="object"&&e!==null&&"backTo"in e&&typeof e.backTo=="string"}function q8(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return v.useMemo(()=>a=>{n.forEach(s=>s(a))},n)}const Ap=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $l(e){const n=Object.prototype.toString.call(e);return n==="[object Window]"||n==="[object global]"}function Lv(e){return"nodeType"in e}function Ur(e){var n,o;return e?$l(e)?e:Lv(e)&&(n=(o=e.ownerDocument)==null?void 0:o.defaultView)!=null?n:window:window}function zv(e){const{Document:n}=Ur(e);return e instanceof n}function qc(e){return $l(e)?!1:e instanceof Ur(e).HTMLElement}function WO(e){return e instanceof Ur(e).SVGElement}function Xl(e){return e?$l(e)?e.document:Lv(e)?zv(e)?e:qc(e)||WO(e)?e.ownerDocument:document:document:document}const Yo=Ap?v.useLayoutEffect:v.useEffect;function Dp(e){const n=v.useRef(e);return Yo(()=>{n.current=e}),v.useCallback(function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return n.current==null?void 0:n.current(...a)},[])}function Y8(){const e=v.useRef(null),n=v.useCallback((a,s)=>{e.current=setInterval(a,s)},[]),o=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[n,o]}function vc(e,n){n===void 0&&(n=[e]);const o=v.useRef(e);return Yo(()=>{o.current!==e&&(o.current=e)},n),o}function Yc(e,n){const o=v.useRef();return v.useMemo(()=>{const a=e(o.current);return o.current=a,a},[...n])}function Ch(e){const n=Dp(e),o=v.useRef(null),a=v.useCallback(s=>{s!==o.current&&n?.(s,o.current),o.current=s},[]);return[o,a]}function Th(e){const n=v.useRef();return v.useEffect(()=>{n.current=e},[e]),n.current}let z0={};function Kc(e,n){return v.useMemo(()=>{if(n)return n;const o=z0[e]==null?0:z0[e]+1;return z0[e]=o,e+"-"+o},[e,n])}function eM(e){return function(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];return a.reduce((u,c)=>{const d=Object.entries(c);for(const[p,g]of d){const y=u[p];y!=null&&(u[p]=y+e*g)}return u},{...n})}}const Al=eM(1),bc=eM(-1);function K8(e){return"clientX"in e&&"clientY"in e}function Np(e){if(!e)return!1;const{KeyboardEvent:n}=Ur(e.target);return n&&e instanceof n}function G8(e){if(!e)return!1;const{TouchEvent:n}=Ur(e.target);return n&&e instanceof n}function Oh(e){if(G8(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:o}=e.touches[0];return{x:n,y:o}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:o}=e.changedTouches[0];return{x:n,y:o}}}return K8(e)?{x:e.clientX,y:e.clientY}:null}const Di=Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:o}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:o}=e;return"scaleX("+n+") scaleY("+o+")"}},Transform:{toString(e){if(e)return[Di.Translate.toString(e),Di.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:o,easing:a}=e;return n+" "+o+"ms "+a}}}),fR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function $8(e){return e.matches(fR)?e:e.querySelector(fR)}const X8={display:"none"};function Q8(e){let{id:n,value:o}=e;return Ne.createElement("div",{id:n,style:X8},o)}function Z8(e){let{id:n,announcement:o,ariaLiveType:a="assertive"}=e;const s={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 Ne.createElement("div",{id:n,style:s,role:"status","aria-live":a,"aria-atomic":!0},o)}function J8(){const[e,n]=v.useState("");return{announce:v.useCallback(a=>{a!=null&&n(a)},[]),announcement:e}}const tM=v.createContext(null);function W8(e){const n=v.useContext(tM);v.useEffect(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)},[e,n])}function eH(){const[e]=v.useState(()=>new Set),n=v.useCallback(a=>(e.add(a),()=>e.delete(a)),[e]);return[v.useCallback(a=>{let{type:s,event:u}=a;e.forEach(c=>{var d;return(d=c[s])==null?void 0:d.call(c,u)})},[e]),n]}const tH={draggable:`
30
- To pick up a draggable item, press the space bar.
31
- While dragging, use the arrow keys to move the item.
32
- Press space again to drop the item in its new position, or press escape to cancel.
33
- `},nH={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:o}=e;return o?"Draggable item "+n.id+" was moved over droppable area "+o.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:o}=e;return o?"Draggable item "+n.id+" was dropped over droppable area "+o.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function rH(e){let{announcements:n=nH,container:o,hiddenTextDescribedById:a,screenReaderInstructions:s=tH}=e;const{announce:u,announcement:c}=J8(),d=Kc("DndLiveRegion"),[p,g]=v.useState(!1);if(v.useEffect(()=>{g(!0)},[]),W8(v.useMemo(()=>({onDragStart(h){let{active:b}=h;u(n.onDragStart({active:b}))},onDragMove(h){let{active:b,over:x}=h;n.onDragMove&&u(n.onDragMove({active:b,over:x}))},onDragOver(h){let{active:b,over:x}=h;u(n.onDragOver({active:b,over:x}))},onDragEnd(h){let{active:b,over:x}=h;u(n.onDragEnd({active:b,over:x}))},onDragCancel(h){let{active:b,over:x}=h;u(n.onDragCancel({active:b,over:x}))}}),[u,n])),!p)return null;const y=Ne.createElement(Ne.Fragment,null,Ne.createElement(Q8,{id:a,value:s.draggable}),Ne.createElement(Z8,{id:d,announcement:c}));return o?cr.createPortal(y,o):y}var or;(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"})(or||(or={}));function Mh(){}function _0(e,n){return v.useMemo(()=>({sensor:e,options:n??{}}),[e,n])}function oH(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return v.useMemo(()=>[...n].filter(a=>a!=null),[...n])}const Ko=Object.freeze({x:0,y:0});function _v(e,n){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function aH(e,n){const o=Oh(e);if(!o)return"0 0";const a={x:(o.x-n.left)/n.width*100,y:(o.y-n.top)/n.height*100};return a.x+"% "+a.y+"%"}function Hv(e,n){let{data:{value:o}}=e,{data:{value:a}}=n;return o-a}function iH(e,n){let{data:{value:o}}=e,{data:{value:a}}=n;return a-o}function Sy(e){let{left:n,top:o,height:a,width:s}=e;return[{x:n,y:o},{x:n+s,y:o},{x:n,y:o+a},{x:n+s,y:o+a}]}function nM(e,n){if(!e||e.length===0)return null;const[o]=e;return o[n]}function hR(e,n,o){return n===void 0&&(n=e.left),o===void 0&&(o=e.top),{x:n+e.width*.5,y:o+e.height*.5}}const sH=e=>{let{collisionRect:n,droppableRects:o,droppableContainers:a}=e;const s=hR(n,n.left,n.top),u=[];for(const c of a){const{id:d}=c,p=o.get(d);if(p){const g=_v(hR(p),s);u.push({id:d,data:{droppableContainer:c,value:g}})}}return u.sort(Hv)},lH=e=>{let{collisionRect:n,droppableRects:o,droppableContainers:a}=e;const s=Sy(n),u=[];for(const c of a){const{id:d}=c,p=o.get(d);if(p){const g=Sy(p),y=s.reduce((b,x,w)=>b+_v(g[w],x),0),h=Number((y/4).toFixed(4));u.push({id:d,data:{droppableContainer:c,value:h}})}}return u.sort(Hv)};function uH(e,n){const o=Math.max(n.top,e.top),a=Math.max(n.left,e.left),s=Math.min(n.left+n.width,e.left+e.width),u=Math.min(n.top+n.height,e.top+e.height),c=s-a,d=u-o;if(a<s&&o<u){const p=n.width*n.height,g=e.width*e.height,y=c*d,h=y/(p+g-y);return Number(h.toFixed(4))}return 0}const cH=e=>{let{collisionRect:n,droppableRects:o,droppableContainers:a}=e;const s=[];for(const u of a){const{id:c}=u,d=o.get(c);if(d){const p=uH(d,n);p>0&&s.push({id:c,data:{droppableContainer:u,value:p}})}}return s.sort(iH)};function dH(e,n){const{top:o,left:a,bottom:s,right:u}=n;return o<=e.y&&e.y<=s&&a<=e.x&&e.x<=u}const fH=e=>{let{droppableContainers:n,droppableRects:o,pointerCoordinates:a}=e;if(!a)return[];const s=[];for(const u of n){const{id:c}=u,d=o.get(c);if(d&&dH(a,d)){const g=Sy(d).reduce((h,b)=>h+_v(a,b),0),y=Number((g/4).toFixed(4));s.push({id:c,data:{droppableContainer:u,value:y}})}}return s.sort(Hv)};function hH(e,n,o){return{...e,scaleX:n&&o?n.width/o.width:1,scaleY:n&&o?n.height/o.height:1}}function rM(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:Ko}function pH(e){return function(o){for(var a=arguments.length,s=new Array(a>1?a-1:0),u=1;u<a;u++)s[u-1]=arguments[u];return s.reduce((c,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...o})}}const gH=pH(1);function oM(e){if(e.startsWith("matrix3d(")){const n=e.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(e.startsWith("matrix(")){const n=e.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function mH(e,n,o){const a=oM(n);if(!a)return e;const{scaleX:s,scaleY:u,x:c,y:d}=a,p=e.left-c-(1-s)*parseFloat(o),g=e.top-d-(1-u)*parseFloat(o.slice(o.indexOf(" ")+1)),y=s?e.width/s:e.width,h=u?e.height/u:e.height;return{width:y,height:h,top:g,right:p+y,bottom:g+h,left:p}}const yH={ignoreTransform:!1};function Ql(e,n){n===void 0&&(n=yH);let o=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:g,transformOrigin:y}=Ur(e).getComputedStyle(e);g&&(o=mH(o,g,y))}const{top:a,left:s,width:u,height:c,bottom:d,right:p}=o;return{top:a,left:s,width:u,height:c,bottom:d,right:p}}function pR(e){return Ql(e,{ignoreTransform:!0})}function vH(e){const n=e.innerWidth,o=e.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}function bH(e,n){return n===void 0&&(n=Ur(e).getComputedStyle(e)),n.position==="fixed"}function xH(e,n){n===void 0&&(n=Ur(e).getComputedStyle(e));const o=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const u=n[s];return typeof u=="string"?o.test(u):!1})}function Ip(e,n){const o=[];function a(s){if(n!=null&&o.length>=n||!s)return o;if(zv(s)&&s.scrollingElement!=null&&!o.includes(s.scrollingElement))return o.push(s.scrollingElement),o;if(!qc(s)||WO(s)||o.includes(s))return o;const u=Ur(e).getComputedStyle(s);return s!==e&&xH(s,u)&&o.push(s),bH(s,u)?o:a(s.parentNode)}return e?a(e):o}function aM(e){const[n]=Ip(e,1);return n??null}function H0(e){return!Ap||!e?null:$l(e)?e:Lv(e)?zv(e)||e===Xl(e).scrollingElement?window:qc(e)?e:null:null}function iM(e){return $l(e)?e.scrollX:e.scrollLeft}function sM(e){return $l(e)?e.scrollY:e.scrollTop}function wy(e){return{x:iM(e),y:sM(e)}}var ur;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ur||(ur={}));function lM(e){return!Ap||!e?!1:e===document.scrollingElement}function uM(e){const n={x:0,y:0},o=lM(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={x:e.scrollWidth-o.width,y:e.scrollHeight-o.height},s=e.scrollTop<=n.y,u=e.scrollLeft<=n.x,c=e.scrollTop>=a.y,d=e.scrollLeft>=a.x;return{isTop:s,isLeft:u,isBottom:c,isRight:d,maxScroll:a,minScroll:n}}const SH={x:.2,y:.2};function wH(e,n,o,a,s){let{top:u,left:c,right:d,bottom:p}=o;a===void 0&&(a=10),s===void 0&&(s=SH);const{isTop:g,isBottom:y,isLeft:h,isRight:b}=uM(e),x={x:0,y:0},w={x:0,y:0},C={height:n.height*s.y,width:n.width*s.x};return!g&&u<=n.top+C.height?(x.y=ur.Backward,w.y=a*Math.abs((n.top+C.height-u)/C.height)):!y&&p>=n.bottom-C.height&&(x.y=ur.Forward,w.y=a*Math.abs((n.bottom-C.height-p)/C.height)),!b&&d>=n.right-C.width?(x.x=ur.Forward,w.x=a*Math.abs((n.right-C.width-d)/C.width)):!h&&c<=n.left+C.width&&(x.x=ur.Backward,w.x=a*Math.abs((n.left+C.width-c)/C.width)),{direction:x,speed:w}}function RH(e){if(e===document.scrollingElement){const{innerWidth:u,innerHeight:c}=window;return{top:0,left:0,right:u,bottom:c,width:u,height:c}}const{top:n,left:o,right:a,bottom:s}=e.getBoundingClientRect();return{top:n,left:o,right:a,bottom:s,width:e.clientWidth,height:e.clientHeight}}function cM(e){return e.reduce((n,o)=>Al(n,wy(o)),Ko)}function EH(e){return e.reduce((n,o)=>n+iM(o),0)}function CH(e){return e.reduce((n,o)=>n+sM(o),0)}function dM(e,n){if(n===void 0&&(n=Ql),!e)return;const{top:o,left:a,bottom:s,right:u}=n(e);aM(e)&&(s<=0||u<=0||o>=window.innerHeight||a>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const TH=[["x",["left","right"],EH],["y",["top","bottom"],CH]];class Uv{constructor(n,o){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 a=Ip(o),s=cM(a);this.rect={...n},this.width=n.width,this.height=n.height;for(const[u,c,d]of TH)for(const p of c)Object.defineProperty(this,p,{get:()=>{const g=d(a),y=s[u]-g;return this.rect[p]+y},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class lc{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(o=>{var a;return(a=this.target)==null?void 0:a.removeEventListener(...o)})},this.target=n}add(n,o,a){var s;(s=this.target)==null||s.addEventListener(n,o,a),this.listeners.push([n,o,a])}}function OH(e){const{EventTarget:n}=Ur(e);return e instanceof n?e:Xl(e)}function U0(e,n){const o=Math.abs(e.x),a=Math.abs(e.y);return typeof n=="number"?Math.sqrt(o**2+a**2)>n:"x"in n&&"y"in n?o>n.x&&a>n.y:"x"in n?o>n.x:"y"in n?a>n.y:!1}var Oo;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Oo||(Oo={}));function gR(e){e.preventDefault()}function MH(e){e.stopPropagation()}var Zt;(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"})(Zt||(Zt={}));const fM={start:[Zt.Space,Zt.Enter],cancel:[Zt.Esc],end:[Zt.Space,Zt.Enter,Zt.Tab]},AH=(e,n)=>{let{currentCoordinates:o}=n;switch(e.code){case Zt.Right:return{...o,x:o.x+25};case Zt.Left:return{...o,x:o.x-25};case Zt.Down:return{...o,y:o.y+25};case Zt.Up:return{...o,y:o.y-25}}};class Fv{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:o}}=n;this.props=n,this.listeners=new lc(Xl(o)),this.windowListeners=new lc(Ur(o)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Oo.Resize,this.handleCancel),this.windowListeners.add(Oo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Oo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:o}=this.props,a=n.node.current;a&&dM(a),o(Ko)}handleKeyDown(n){if(Np(n)){const{active:o,context:a,options:s}=this.props,{keyboardCodes:u=fM,coordinateGetter:c=AH,scrollBehavior:d="smooth"}=s,{code:p}=n;if(u.end.includes(p)){this.handleEnd(n);return}if(u.cancel.includes(p)){this.handleCancel(n);return}const{collisionRect:g}=a.current,y=g?{x:g.left,y:g.top}:Ko;this.referenceCoordinates||(this.referenceCoordinates=y);const h=c(n,{active:o,context:a.current,currentCoordinates:y});if(h){const b=bc(h,y),x={x:0,y:0},{scrollableAncestors:w}=a.current;for(const C of w){const R=n.code,{isTop:T,isRight:O,isLeft:M,isBottom:A,maxScroll:N,minScroll:k}=uM(C),j=RH(C),D={x:Math.min(R===Zt.Right?j.right-j.width/2:j.right,Math.max(R===Zt.Right?j.left:j.left+j.width/2,h.x)),y:Math.min(R===Zt.Down?j.bottom-j.height/2:j.bottom,Math.max(R===Zt.Down?j.top:j.top+j.height/2,h.y))},z=R===Zt.Right&&!O||R===Zt.Left&&!M,F=R===Zt.Down&&!A||R===Zt.Up&&!T;if(z&&D.x!==h.x){const G=C.scrollLeft+b.x,J=R===Zt.Right&&G<=N.x||R===Zt.Left&&G>=k.x;if(J&&!b.y){C.scrollTo({left:G,behavior:d});return}J?x.x=C.scrollLeft-G:x.x=R===Zt.Right?C.scrollLeft-N.x:C.scrollLeft-k.x,x.x&&C.scrollBy({left:-x.x,behavior:d});break}else if(F&&D.y!==h.y){const G=C.scrollTop+b.y,J=R===Zt.Down&&G<=N.y||R===Zt.Up&&G>=k.y;if(J&&!b.x){C.scrollTo({top:G,behavior:d});return}J?x.y=C.scrollTop-G:x.y=R===Zt.Down?C.scrollTop-N.y:C.scrollTop-k.y,x.y&&C.scrollBy({top:-x.y,behavior:d});break}}this.handleMove(n,Al(bc(h,this.referenceCoordinates),x))}}}handleMove(n,o){const{onMove:a}=this.props;n.preventDefault(),a(o)}handleEnd(n){const{onEnd:o}=this.props;n.preventDefault(),this.detach(),o()}handleCancel(n){const{onCancel:o}=this.props;n.preventDefault(),this.detach(),o()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Fv.activators=[{eventName:"onKeyDown",handler:(e,n,o)=>{let{keyboardCodes:a=fM,onActivation:s}=n,{active:u}=o;const{code:c}=e.nativeEvent;if(a.start.includes(c)){const d=u.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),s?.({event:e.nativeEvent}),!0)}return!1}}];function mR(e){return!!(e&&"distance"in e)}function yR(e){return!!(e&&"delay"in e)}class Bv{constructor(n,o,a){var s;a===void 0&&(a=OH(n.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=n,this.events=o;const{event:u}=n,{target:c}=u;this.props=n,this.events=o,this.document=Xl(c),this.documentListeners=new lc(this.document),this.listeners=new lc(a),this.windowListeners=new lc(Ur(c)),this.initialCoordinates=(s=Oh(u))!=null?s:Ko,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:n,props:{options:{activationConstraint:o,bypassActivationConstraint:a}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(Oo.Resize,this.handleCancel),this.windowListeners.add(Oo.DragStart,gR),this.windowListeners.add(Oo.VisibilityChange,this.handleCancel),this.windowListeners.add(Oo.ContextMenu,gR),this.documentListeners.add(Oo.Keydown,this.handleKeydown),o){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(yR(o)){this.timeoutId=setTimeout(this.handleStart,o.delay),this.handlePending(o);return}if(mR(o)){this.handlePending(o);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(n,o){const{active:a,onPending:s}=this.props;s(a,n,this.initialCoordinates,o)}handleStart(){const{initialCoordinates:n}=this,{onStart:o}=this.props;n&&(this.activated=!0,this.documentListeners.add(Oo.Click,MH,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Oo.SelectionChange,this.removeTextSelection),o(n))}handleMove(n){var o;const{activated:a,initialCoordinates:s,props:u}=this,{onMove:c,options:{activationConstraint:d}}=u;if(!s)return;const p=(o=Oh(n))!=null?o:Ko,g=bc(s,p);if(!a&&d){if(mR(d)){if(d.tolerance!=null&&U0(g,d.tolerance))return this.handleCancel();if(U0(g,d.distance))return this.handleStart()}if(yR(d)&&U0(g,d.tolerance))return this.handleCancel();this.handlePending(d,g);return}n.cancelable&&n.preventDefault(),c(p)}handleEnd(){const{onAbort:n,onEnd:o}=this.props;this.detach(),this.activated||n(this.props.active),o()}handleCancel(){const{onAbort:n,onCancel:o}=this.props;this.detach(),this.activated||n(this.props.active),o()}handleKeydown(n){n.code===Zt.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const DH={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class hM extends Bv{constructor(n){const{event:o}=n,a=Xl(o.target);super(n,DH,a)}}hM.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:o}=e,{onActivation:a}=n;return!o.isPrimary||o.button!==0?!1:(a?.({event:o}),!0)}}];const NH={move:{name:"mousemove"},end:{name:"mouseup"}};var Ry;(function(e){e[e.RightClick=2]="RightClick"})(Ry||(Ry={}));class pM extends Bv{constructor(n){super(n,NH,Xl(n.event.target))}}pM.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:o}=e,{onActivation:a}=n;return o.button===Ry.RightClick?!1:(a?.({event:o}),!0)}}];const F0={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class gM extends Bv{constructor(n){super(n,F0)}static setup(){return window.addEventListener(F0.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(F0.move.name,n)};function n(){}}}gM.activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:o}=e,{onActivation:a}=n;const{touches:s}=o;return s.length>1?!1:(a?.({event:o}),!0)}}];var uc;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(uc||(uc={}));var Ah;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ah||(Ah={}));function IH(e){let{acceleration:n,activator:o=uc.Pointer,canScroll:a,draggingRect:s,enabled:u,interval:c=5,order:d=Ah.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:y,delta:h,threshold:b}=e;const x=PH({delta:h,disabled:!u}),[w,C]=Y8(),R=v.useRef({x:0,y:0}),T=v.useRef({x:0,y:0}),O=v.useMemo(()=>{switch(o){case uc.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case uc.DraggableRect:return s}},[o,s,p]),M=v.useRef(null),A=v.useCallback(()=>{const k=M.current;if(!k)return;const j=R.current.x*T.current.x,D=R.current.y*T.current.y;k.scrollBy(j,D)},[]),N=v.useMemo(()=>d===Ah.TreeOrder?[...g].reverse():g,[d,g]);v.useEffect(()=>{if(!u||!g.length||!O){C();return}for(const k of N){if(a?.(k)===!1)continue;const j=g.indexOf(k),D=y[j];if(!D)continue;const{direction:z,speed:F}=wH(k,D,O,n,b);for(const G of["x","y"])x[G][z[G]]||(F[G]=0,z[G]=0);if(F.x>0||F.y>0){C(),M.current=k,w(A,c),R.current=F,T.current=z;return}}R.current={x:0,y:0},T.current={x:0,y:0},C()},[n,A,a,C,u,c,JSON.stringify(O),JSON.stringify(x),w,g,N,y,JSON.stringify(b)])}const jH={x:{[ur.Backward]:!1,[ur.Forward]:!1},y:{[ur.Backward]:!1,[ur.Forward]:!1}};function PH(e){let{delta:n,disabled:o}=e;const a=Th(n);return Yc(s=>{if(o||!a||!s)return jH;const u={x:Math.sign(n.x-a.x),y:Math.sign(n.y-a.y)};return{x:{[ur.Backward]:s.x[ur.Backward]||u.x===-1,[ur.Forward]:s.x[ur.Forward]||u.x===1},y:{[ur.Backward]:s.y[ur.Backward]||u.y===-1,[ur.Forward]:s.y[ur.Forward]||u.y===1}}},[o,n,a])}function kH(e,n){const o=n!=null?e.get(n):void 0,a=o?o.node.current:null;return Yc(s=>{var u;return n==null?null:(u=a??s)!=null?u:null},[a,n])}function LH(e,n){return v.useMemo(()=>e.reduce((o,a)=>{const{sensor:s}=a,u=s.activators.map(c=>({eventName:c.eventName,handler:n(c.handler,a)}));return[...o,...u]},[]),[e,n])}var xc;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(xc||(xc={}));var Ey;(function(e){e.Optimized="optimized"})(Ey||(Ey={}));const vR=new Map;function zH(e,n){let{dragging:o,dependencies:a,config:s}=n;const[u,c]=v.useState(null),{frequency:d,measure:p,strategy:g}=s,y=v.useRef(e),h=R(),b=vc(h),x=v.useCallback(function(T){T===void 0&&(T=[]),!b.current&&c(O=>O===null?T:O.concat(T.filter(M=>!O.includes(M))))},[b]),w=v.useRef(null),C=Yc(T=>{if(h&&!o)return vR;if(!T||T===vR||y.current!==e||u!=null){const O=new Map;for(let M of e){if(!M)continue;if(u&&u.length>0&&!u.includes(M.id)&&M.rect.current){O.set(M.id,M.rect.current);continue}const A=M.node.current,N=A?new Uv(p(A),A):null;M.rect.current=N,N&&O.set(M.id,N)}return O}return T},[e,u,o,h,p]);return v.useEffect(()=>{y.current=e},[e]),v.useEffect(()=>{h||x()},[o,h]),v.useEffect(()=>{u&&u.length>0&&c(null)},[JSON.stringify(u)]),v.useEffect(()=>{h||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{x(),w.current=null},d))},[d,h,x,...a]),{droppableRects:C,measureDroppableContainers:x,measuringScheduled:u!=null};function R(){switch(g){case xc.Always:return!1;case xc.BeforeDragging:return o;default:return!o}}}function Vv(e,n){return Yc(o=>e?o||(typeof n=="function"?n(e):e):null,[n,e])}function _H(e,n){return Vv(e,n)}function HH(e){let{callback:n,disabled:o}=e;const a=Dp(n),s=v.useMemo(()=>{if(o||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(a)},[a,o]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function jp(e){let{callback:n,disabled:o}=e;const a=Dp(n),s=v.useMemo(()=>{if(o||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(a)},[o]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function UH(e){return new Uv(Ql(e),e)}function bR(e,n,o){n===void 0&&(n=UH);const[a,s]=v.useState(null);function u(){s(p=>{if(!e)return null;if(e.isConnected===!1){var g;return(g=p??o)!=null?g:null}const y=n(e);return JSON.stringify(p)===JSON.stringify(y)?p:y})}const c=HH({callback(p){if(e)for(const g of p){const{type:y,target:h}=g;if(y==="childList"&&h instanceof HTMLElement&&h.contains(e)){u();break}}}}),d=jp({callback:u});return Yo(()=>{u(),e?(d?.observe(e),c?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),c?.disconnect())},[e]),a}function FH(e){const n=Vv(e);return rM(e,n)}const xR=[];function BH(e){const n=v.useRef(e),o=Yc(a=>e?a&&a!==xR&&e&&n.current&&e.parentNode===n.current.parentNode?a:Ip(e):xR,[e]);return v.useEffect(()=>{n.current=e},[e]),o}function VH(e){const[n,o]=v.useState(null),a=v.useRef(e),s=v.useCallback(u=>{const c=H0(u.target);c&&o(d=>d?(d.set(c,wy(c)),new Map(d)):null)},[]);return v.useEffect(()=>{const u=a.current;if(e!==u){c(u);const d=e.map(p=>{const g=H0(p);return g?(g.addEventListener("scroll",s,{passive:!0}),[g,wy(g)]):null}).filter(p=>p!=null);o(d.length?new Map(d):null),a.current=e}return()=>{c(e),c(u)};function c(d){d.forEach(p=>{const g=H0(p);g?.removeEventListener("scroll",s)})}},[s,e]),v.useMemo(()=>e.length?n?Array.from(n.values()).reduce((u,c)=>Al(u,c),Ko):cM(e):Ko,[e,n])}function SR(e,n){n===void 0&&(n=[]);const o=v.useRef(null);return v.useEffect(()=>{o.current=null},n),v.useEffect(()=>{const a=e!==Ko;a&&!o.current&&(o.current=e),!a&&o.current&&(o.current=null)},[e]),o.current?bc(e,o.current):Ko}function qH(e){v.useEffect(()=>{if(!Ap)return;const n=e.map(o=>{let{sensor:a}=o;return a.setup==null?void 0:a.setup()});return()=>{for(const o of n)o?.()}},e.map(n=>{let{sensor:o}=n;return o}))}function YH(e,n){return v.useMemo(()=>e.reduce((o,a)=>{let{eventName:s,handler:u}=a;return o[s]=c=>{u(c,n)},o},{}),[e,n])}function mM(e){return v.useMemo(()=>e?vH(e):null,[e])}const wR=[];function KH(e,n){n===void 0&&(n=Ql);const[o]=e,a=mM(o?Ur(o):null),[s,u]=v.useState(wR);function c(){u(()=>e.length?e.map(p=>lM(p)?a:new Uv(n(p),p)):wR)}const d=jp({callback:c});return Yo(()=>{d?.disconnect(),c(),e.forEach(p=>d?.observe(p))},[e]),s}function yM(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return qc(n)?n:e}function GH(e){let{measure:n}=e;const[o,a]=v.useState(null),s=v.useCallback(g=>{for(const{target:y}of g)if(qc(y)){a(h=>{const b=n(y);return h?{...h,width:b.width,height:b.height}:b});break}},[n]),u=jp({callback:s}),c=v.useCallback(g=>{const y=yM(g);u?.disconnect(),y&&u?.observe(y),a(y?n(y):null)},[n,u]),[d,p]=Ch(c);return v.useMemo(()=>({nodeRef:d,rect:o,setRef:p}),[o,d,p])}const $H=[{sensor:hM,options:{}},{sensor:Fv,options:{}}],XH={current:{}},eh={draggable:{measure:pR},droppable:{measure:pR,strategy:xc.WhileDragging,frequency:Ey.Optimized},dragOverlay:{measure:Ql}};class cc extends Map{get(n){var o;return n!=null&&(o=super.get(n))!=null?o:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:o}=n;return!o})}getNodeFor(n){var o,a;return(o=(a=this.get(n))==null?void 0:a.node.current)!=null?o:void 0}}const QH={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new cc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Mh},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eh,measureDroppableContainers:Mh,windowRect:null,measuringScheduled:!1},vM={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Mh,draggableNodes:new Map,over:null,measureDroppableContainers:Mh},Gc=v.createContext(vM),bM=v.createContext(QH);function ZH(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new cc}}}function JH(e,n){switch(n.type){case or.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case or.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case or.DragEnd:case or.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case or.RegisterDroppable:{const{element:o}=n,{id:a}=o,s=new cc(e.droppable.containers);return s.set(a,o),{...e,droppable:{...e.droppable,containers:s}}}case or.SetDroppableDisabled:{const{id:o,key:a,disabled:s}=n,u=e.droppable.containers.get(o);if(!u||a!==u.key)return e;const c=new cc(e.droppable.containers);return c.set(o,{...u,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case or.UnregisterDroppable:{const{id:o,key:a}=n,s=e.droppable.containers.get(o);if(!s||a!==s.key)return e;const u=new cc(e.droppable.containers);return u.delete(o),{...e,droppable:{...e.droppable,containers:u}}}default:return e}}function WH(e){let{disabled:n}=e;const{active:o,activatorEvent:a,draggableNodes:s}=v.useContext(Gc),u=Th(a),c=Th(o?.id);return v.useEffect(()=>{if(!n&&!a&&u&&c!=null){if(!Np(u)||document.activeElement===u.target)return;const d=s.get(c);if(!d)return;const{activatorNode:p,node:g}=d;if(!p.current&&!g.current)return;requestAnimationFrame(()=>{for(const y of[p.current,g.current]){if(!y)continue;const h=$8(y);if(h){h.focus();break}}})}},[a,n,s,c,u]),null}function xM(e,n){let{transform:o,...a}=n;return e!=null&&e.length?e.reduce((s,u)=>u({transform:s,...a}),o):o}function eU(e){return v.useMemo(()=>({draggable:{...eh.draggable,...e?.draggable},droppable:{...eh.droppable,...e?.droppable},dragOverlay:{...eh.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function tU(e){let{activeNode:n,measure:o,initialRect:a,config:s=!0}=e;const u=v.useRef(!1),{x:c,y:d}=typeof s=="boolean"?{x:s,y:s}:s;Yo(()=>{if(!c&&!d||!n){u.current=!1;return}if(u.current||!a)return;const g=n?.node.current;if(!g||g.isConnected===!1)return;const y=o(g),h=rM(y,a);if(c||(h.x=0),d||(h.y=0),u.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const b=aM(g);b&&b.scrollBy({top:h.y,left:h.x})}},[n,c,d,a,o])}const Pp=v.createContext({...Ko,scaleX:1,scaleY:1});var Si;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Si||(Si={}));const nU=v.memo(function(n){var o,a,s,u;let{id:c,accessibility:d,autoScroll:p=!0,children:g,sensors:y=$H,collisionDetection:h=cH,measuring:b,modifiers:x,...w}=n;const C=v.useReducer(JH,void 0,ZH),[R,T]=C,[O,M]=eH(),[A,N]=v.useState(Si.Uninitialized),k=A===Si.Initialized,{draggable:{active:j,nodes:D,translate:z},droppable:{containers:F}}=R,G=j!=null?D.get(j):null,J=v.useRef({initial:null,translated:null}),Y=v.useMemo(()=>{var vt;return j!=null?{id:j,data:(vt=G?.data)!=null?vt:XH,rect:J}:null},[j,G]),U=v.useRef(null),[H,L]=v.useState(null),[$,K]=v.useState(null),V=vc(w,Object.values(w)),X=Kc("DndDescribedBy",c),ee=v.useMemo(()=>F.getEnabled(),[F]),q=eU(b),{droppableRects:se,measureDroppableContainers:I,measuringScheduled:B}=zH(ee,{dragging:k,dependencies:[z.x,z.y],config:q.droppable}),W=kH(D,j),re=v.useMemo(()=>$?Oh($):null,[$]),Re=ft(),le=_H(W,q.draggable.measure);tU({activeNode:j!=null?D.get(j):null,config:Re.layoutShiftCompensation,initialRect:le,measure:q.draggable.measure});const me=bR(W,q.draggable.measure,le),ge=bR(W?W.parentElement:null),ce=v.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:se,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Te=F.getNodeFor((o=ce.current.over)==null?void 0:o.id),ve=GH({measure:q.dragOverlay.measure}),ke=(a=ve.nodeRef.current)!=null?a:W,Me=k?(s=ve.rect)!=null?s:me:null,Le=!!(ve.nodeRef.current&&ve.rect),Fe=FH(Le?null:me),Oe=mM(ke?Ur(ke):null),He=BH(k?Te??W:null),be=KH(He),Ue=xM(x,{transform:{x:z.x-Fe.x,y:z.y-Fe.y,scaleX:1,scaleY:1},activatorEvent:$,active:Y,activeNodeRect:me,containerNodeRect:ge,draggingNodeRect:Me,over:ce.current.over,overlayNodeRect:ve.rect,scrollableAncestors:He,scrollableAncestorRects:be,windowRect:Oe}),Qe=re?Al(re,z):null,it=VH(He),de=SR(it),we=SR(it,[me]),Ke=Al(Ue,de),De=Me?gH(Me,Ue):null,Ie=Y&&De?h({active:Y,collisionRect:De,droppableRects:se,droppableContainers:ee,pointerCoordinates:Qe}):null,yt=nM(Ie,"id"),[ut,ht]=v.useState(null),Ot=Le?Ue:Al(Ue,we),Dt=hH(Ot,(u=ut?.rect)!=null?u:null,me),Wt=v.useRef(null),rn=v.useCallback((vt,gt)=>{let{sensor:kt,options:un}=gt;if(U.current==null)return;const je=D.get(U.current);if(!je)return;const at=vt.nativeEvent,Pe=new kt({active:U.current,activeNode:je,event:at,options:un,context:ce,onAbort(Ge){if(!D.get(Ge))return;const{onDragAbort:Et}=V.current,_={id:Ge};Et?.(_),O({type:"onDragAbort",event:_})},onPending(Ge,et,Et,_){if(!D.get(Ge))return;const{onDragPending:ne}=V.current,ye={id:Ge,constraint:et,initialCoordinates:Et,offset:_};ne?.(ye),O({type:"onDragPending",event:ye})},onStart(Ge){const et=U.current;if(et==null)return;const Et=D.get(et);if(!Et)return;const{onDragStart:_}=V.current,Z={activatorEvent:at,active:{id:et,data:Et.data,rect:J}};cr.unstable_batchedUpdates(()=>{_?.(Z),N(Si.Initializing),T({type:or.DragStart,initialCoordinates:Ge,active:et}),O({type:"onDragStart",event:Z}),L(Wt.current),K(at)})},onMove(Ge){T({type:or.DragMove,coordinates:Ge})},onEnd:ze(or.DragEnd),onCancel:ze(or.DragCancel)});Wt.current=Pe;function ze(Ge){return async function(){const{active:Et,collisions:_,over:Z,scrollAdjustedTranslate:ne}=ce.current;let ye=null;if(Et&&ne){const{cancelDrop:xe}=V.current;ye={activatorEvent:at,active:Et,collisions:_,delta:ne,over:Z},Ge===or.DragEnd&&typeof xe=="function"&&await Promise.resolve(xe(ye))&&(Ge=or.DragCancel)}U.current=null,cr.unstable_batchedUpdates(()=>{T({type:Ge}),N(Si.Uninitialized),ht(null),L(null),K(null),Wt.current=null;const xe=Ge===or.DragEnd?"onDragEnd":"onDragCancel";if(ye){const qe=V.current[xe];qe?.(ye),O({type:xe,event:ye})}})}}},[D]),en=v.useCallback((vt,gt)=>(kt,un)=>{const je=kt.nativeEvent,at=D.get(un);if(U.current!==null||!at||je.dndKit||je.defaultPrevented)return;const Pe={active:at};vt(kt,gt.options,Pe)===!0&&(je.dndKit={capturedBy:gt.sensor},U.current=un,rn(kt,gt))},[D,rn]),We=LH(y,en);qH(y),Yo(()=>{me&&A===Si.Initializing&&N(Si.Initialized)},[me,A]),v.useEffect(()=>{const{onDragMove:vt}=V.current,{active:gt,activatorEvent:kt,collisions:un,over:je}=ce.current;if(!gt||!kt)return;const at={active:gt,activatorEvent:kt,collisions:un,delta:{x:Ke.x,y:Ke.y},over:je};cr.unstable_batchedUpdates(()=>{vt?.(at),O({type:"onDragMove",event:at})})},[Ke.x,Ke.y]),v.useEffect(()=>{const{active:vt,activatorEvent:gt,collisions:kt,droppableContainers:un,scrollAdjustedTranslate:je}=ce.current;if(!vt||U.current==null||!gt||!je)return;const{onDragOver:at}=V.current,Pe=un.get(yt),ze=Pe&&Pe.rect.current?{id:Pe.id,rect:Pe.rect.current,data:Pe.data,disabled:Pe.disabled}:null,Ge={active:vt,activatorEvent:gt,collisions:kt,delta:{x:je.x,y:je.y},over:ze};cr.unstable_batchedUpdates(()=>{ht(ze),at?.(Ge),O({type:"onDragOver",event:Ge})})},[yt]),Yo(()=>{ce.current={activatorEvent:$,active:Y,activeNode:W,collisionRect:De,collisions:Ie,droppableRects:se,draggableNodes:D,draggingNode:ke,draggingNodeRect:Me,droppableContainers:F,over:ut,scrollableAncestors:He,scrollAdjustedTranslate:Ke},J.current={initial:Me,translated:De}},[Y,W,Ie,De,D,ke,Me,se,F,ut,He,Ke]),IH({...Re,delta:z,draggingRect:De,pointerCoordinates:Qe,scrollableAncestors:He,scrollableAncestorRects:be});const xt=v.useMemo(()=>({active:Y,activeNode:W,activeNodeRect:me,activatorEvent:$,collisions:Ie,containerNodeRect:ge,dragOverlay:ve,draggableNodes:D,droppableContainers:F,droppableRects:se,over:ut,measureDroppableContainers:I,scrollableAncestors:He,scrollableAncestorRects:be,measuringConfiguration:q,measuringScheduled:B,windowRect:Oe}),[Y,W,me,$,Ie,ge,ve,D,F,se,ut,I,He,be,q,B,Oe]),$t=v.useMemo(()=>({activatorEvent:$,activators:We,active:Y,activeNodeRect:me,ariaDescribedById:{draggable:X},dispatch:T,draggableNodes:D,over:ut,measureDroppableContainers:I}),[$,We,Y,me,T,X,D,ut,I]);return Ne.createElement(tM.Provider,{value:M},Ne.createElement(Gc.Provider,{value:$t},Ne.createElement(bM.Provider,{value:xt},Ne.createElement(Pp.Provider,{value:Dt},g)),Ne.createElement(WH,{disabled:d?.restoreFocus===!1})),Ne.createElement(rH,{...d,hiddenTextDescribedById:X}));function ft(){const vt=H?.autoScrollEnabled===!1,gt=typeof p=="object"?p.enabled===!1:p===!1,kt=k&&!vt&&!gt;return typeof p=="object"?{...p,enabled:kt}:{enabled:kt}}}),rU=v.createContext(null),RR="button",oU="Draggable";function SM(e){let{id:n,data:o,disabled:a=!1,attributes:s}=e;const u=Kc(oU),{activators:c,activatorEvent:d,active:p,activeNodeRect:g,ariaDescribedById:y,draggableNodes:h,over:b}=v.useContext(Gc),{role:x=RR,roleDescription:w="draggable",tabIndex:C=0}=s??{},R=p?.id===n,T=v.useContext(R?Pp:rU),[O,M]=Ch(),[A,N]=Ch(),k=YH(c,n),j=vc(o);Yo(()=>(h.set(n,{id:n,key:u,node:O,activatorNode:A,data:j}),()=>{const z=h.get(n);z&&z.key===u&&h.delete(n)}),[h,n]);const D=v.useMemo(()=>({role:x,tabIndex:C,"aria-disabled":a,"aria-pressed":R&&x===RR?!0:void 0,"aria-roledescription":w,"aria-describedby":y.draggable}),[a,x,C,R,w,y.draggable]);return{active:p,activatorEvent:d,activeNodeRect:g,attributes:D,isDragging:R,listeners:a?void 0:k,node:O,over:b,setNodeRef:M,setActivatorNodeRef:N,transform:T}}function wM(){return v.useContext(bM)}const aU="Droppable",iU={timeout:25};function RM(e){let{data:n,disabled:o=!1,id:a,resizeObserverConfig:s}=e;const u=Kc(aU),{active:c,dispatch:d,over:p,measureDroppableContainers:g}=v.useContext(Gc),y=v.useRef({disabled:o}),h=v.useRef(!1),b=v.useRef(null),x=v.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:R}={...iU,...s},T=vc(C??a),O=v.useCallback(()=>{if(!h.current){h.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{g(Array.isArray(T.current)?T.current:[T.current]),x.current=null},R)},[R]),M=jp({callback:O,disabled:w||!c}),A=v.useCallback((D,z)=>{M&&(z&&(M.unobserve(z),h.current=!1),D&&M.observe(D))},[M]),[N,k]=Ch(A),j=vc(n);return v.useEffect(()=>{!M||!N.current||(M.disconnect(),h.current=!1,M.observe(N.current))},[N,M]),v.useEffect(()=>(d({type:or.RegisterDroppable,element:{id:a,key:u,disabled:o,node:N,rect:b,data:j}}),()=>d({type:or.UnregisterDroppable,key:u,id:a})),[a]),v.useEffect(()=>{o!==y.current.disabled&&(d({type:or.SetDroppableDisabled,id:a,key:u,disabled:o}),y.current.disabled=o)},[a,u,o,d]),{active:c,rect:b,isOver:p?.id===a,node:N,over:p,setNodeRef:k}}function sU(e){let{animation:n,children:o}=e;const[a,s]=v.useState(null),[u,c]=v.useState(null),d=Th(o);return!o&&!a&&d&&s(d),Yo(()=>{if(!u)return;const p=a?.key,g=a?.props.id;if(p==null||g==null){s(null);return}Promise.resolve(n(g,u)).then(()=>{s(null)})},[n,a,u]),Ne.createElement(Ne.Fragment,null,o,a?v.cloneElement(a,{ref:c}):null)}const lU={x:0,y:0,scaleX:1,scaleY:1};function uU(e){let{children:n}=e;return Ne.createElement(Gc.Provider,{value:vM},Ne.createElement(Pp.Provider,{value:lU},n))}const cU={position:"fixed",touchAction:"none"},dU=e=>Np(e)?"transform 250ms ease":void 0,fU=v.forwardRef((e,n)=>{let{as:o,activatorEvent:a,adjustScale:s,children:u,className:c,rect:d,style:p,transform:g,transition:y=dU}=e;if(!d)return null;const h=s?g:{...g,scaleX:1,scaleY:1},b={...cU,width:d.width,height:d.height,top:d.top,left:d.left,transform:Di.Transform.toString(h),transformOrigin:s&&a?aH(a,d):void 0,transition:typeof y=="function"?y(a):y,...p};return Ne.createElement(o,{className:c,style:b,ref:n},u)}),hU=e=>n=>{let{active:o,dragOverlay:a}=n;const s={},{styles:u,className:c}=e;if(u!=null&&u.active)for(const[d,p]of Object.entries(u.active))p!==void 0&&(s[d]=o.node.style.getPropertyValue(d),o.node.style.setProperty(d,p));if(u!=null&&u.dragOverlay)for(const[d,p]of Object.entries(u.dragOverlay))p!==void 0&&a.node.style.setProperty(d,p);return c!=null&&c.active&&o.node.classList.add(c.active),c!=null&&c.dragOverlay&&a.node.classList.add(c.dragOverlay),function(){for(const[p,g]of Object.entries(s))o.node.style.setProperty(p,g);c!=null&&c.active&&o.node.classList.remove(c.active)}},pU=e=>{let{transform:{initial:n,final:o}}=e;return[{transform:Di.Transform.toString(n)},{transform:Di.Transform.toString(o)}]},gU={duration:250,easing:"ease",keyframes:pU,sideEffects:hU({styles:{active:{opacity:"0"}}})};function mU(e){let{config:n,draggableNodes:o,droppableContainers:a,measuringConfiguration:s}=e;return Dp((u,c)=>{if(n===null)return;const d=o.get(u);if(!d)return;const p=d.node.current;if(!p)return;const g=yM(c);if(!g)return;const{transform:y}=Ur(c).getComputedStyle(c),h=oM(y);if(!h)return;const b=typeof n=="function"?n:yU(n);return dM(p,s.draggable.measure),b({active:{id:u,data:d.data,node:p,rect:s.draggable.measure(p)},draggableNodes:o,dragOverlay:{node:c,rect:s.dragOverlay.measure(g)},droppableContainers:a,measuringConfiguration:s,transform:h})})}function yU(e){const{duration:n,easing:o,sideEffects:a,keyframes:s}={...gU,...e};return u=>{let{active:c,dragOverlay:d,transform:p,...g}=u;if(!n)return;const y={x:d.rect.left-c.rect.left,y:d.rect.top-c.rect.top},h={scaleX:p.scaleX!==1?c.rect.width*p.scaleX/d.rect.width:1,scaleY:p.scaleY!==1?c.rect.height*p.scaleY/d.rect.height:1},b={x:p.x-y.x,y:p.y-y.y,...h},x=s({...g,active:c,dragOverlay:d,transform:{initial:p,final:b}}),[w]=x,C=x[x.length-1];if(JSON.stringify(w)===JSON.stringify(C))return;const R=a?.({active:c,dragOverlay:d,...g}),T=d.node.animate(x,{duration:n,easing:o,fill:"forwards"});return new Promise(O=>{T.onfinish=()=>{R?.(),O()}})}}let ER=0;function vU(e){return v.useMemo(()=>{if(e!=null)return ER++,ER},[e])}const bU=Ne.memo(e=>{let{adjustScale:n=!1,children:o,dropAnimation:a,style:s,transition:u,modifiers:c,wrapperElement:d="div",className:p,zIndex:g=999}=e;const{activatorEvent:y,active:h,activeNodeRect:b,containerNodeRect:x,draggableNodes:w,droppableContainers:C,dragOverlay:R,over:T,measuringConfiguration:O,scrollableAncestors:M,scrollableAncestorRects:A,windowRect:N}=wM(),k=v.useContext(Pp),j=vU(h?.id),D=xM(c,{activatorEvent:y,active:h,activeNodeRect:b,containerNodeRect:x,draggingNodeRect:R.rect,over:T,overlayNodeRect:R.rect,scrollableAncestors:M,scrollableAncestorRects:A,transform:k,windowRect:N}),z=Vv(b),F=mU({config:a,draggableNodes:w,droppableContainers:C,measuringConfiguration:O}),G=z?R.setRef:void 0;return Ne.createElement(uU,null,Ne.createElement(sU,{animation:F},h&&j?Ne.createElement(fU,{key:j,id:h.id,ref:G,as:d,activatorEvent:y,adjustScale:n,className:p,transition:u,rect:z,style:{zIndex:g,...s},transform:D},o):null))});function qv(e,n,o){const a=e.slice();return a.splice(o<0?a.length+o:o,0,a.splice(n,1)[0]),a}function xU(e,n){return e.reduce((o,a,s)=>{const u=n.get(a);return u&&(o[s]=u),o},Array(e.length))}function Lf(e){return e!==null&&e>=0}function SU(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==n[o])return!1;return!0}function wU(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const EM=e=>{let{rects:n,activeIndex:o,overIndex:a,index:s}=e;const u=qv(n,a,o),c=n[s],d=u[s];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},zf={scaleX:1,scaleY:1},RU=e=>{var n;let{activeIndex:o,activeNodeRect:a,index:s,rects:u,overIndex:c}=e;const d=(n=u[o])!=null?n:a;if(!d)return null;if(s===o){const g=u[c];return g?{x:0,y:o<c?g.top+g.height-(d.top+d.height):g.top-d.top,...zf}:null}const p=EU(u,s,o);return s>o&&s<=c?{x:0,y:-d.height-p,...zf}:s<o&&s>=c?{x:0,y:d.height+p,...zf}:{x:0,y:0,...zf}};function EU(e,n,o){const a=e[n],s=e[n-1],u=e[n+1];return a?o<n?s?a.top-(s.top+s.height):u?u.top-(a.top+a.height):0:u?u.top-(a.top+a.height):s?a.top-(s.top+s.height):0:0}const CM="Sortable",TM=Ne.createContext({activeIndex:-1,containerId:CM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:EM,disabled:{draggable:!1,droppable:!1}});function CU(e){let{children:n,id:o,items:a,strategy:s=EM,disabled:u=!1}=e;const{active:c,dragOverlay:d,droppableRects:p,over:g,measureDroppableContainers:y}=wM(),h=Kc(CM,o),b=d.rect!==null,x=v.useMemo(()=>a.map(k=>typeof k=="object"&&"id"in k?k.id:k),[a]),w=c!=null,C=c?x.indexOf(c.id):-1,R=g?x.indexOf(g.id):-1,T=v.useRef(x),O=!SU(x,T.current),M=R!==-1&&C===-1||O,A=wU(u);Yo(()=>{O&&w&&y(x)},[O,x,w,y]),v.useEffect(()=>{T.current=x},[x]);const N=v.useMemo(()=>({activeIndex:C,containerId:h,disabled:A,disableTransforms:M,items:x,overIndex:R,useDragOverlay:b,sortedRects:xU(x,p),strategy:s}),[C,h,A.draggable,A.droppable,M,x,R,p,b,s]);return Ne.createElement(TM.Provider,{value:N},n)}const TU=e=>{let{id:n,items:o,activeIndex:a,overIndex:s}=e;return qv(o,a,s).indexOf(n)},OU=e=>{let{containerId:n,isSorting:o,wasDragging:a,index:s,items:u,newIndex:c,previousItems:d,previousContainerId:p,transition:g}=e;return!g||!a||d!==u&&s===c?!1:o?!0:c!==s&&n===p},MU={duration:200,easing:"ease"},OM="transform",AU=Di.Transition.toString({property:OM,duration:0,easing:"linear"}),DU={roleDescription:"sortable"};function NU(e){let{disabled:n,index:o,node:a,rect:s}=e;const[u,c]=v.useState(null),d=v.useRef(o);return Yo(()=>{if(!n&&o!==d.current&&a.current){const p=s.current;if(p){const g=Ql(a.current,{ignoreTransform:!0}),y={x:p.left-g.left,y:p.top-g.top,scaleX:p.width/g.width,scaleY:p.height/g.height};(y.x||y.y)&&c(y)}}o!==d.current&&(d.current=o)},[n,o,a,s]),v.useEffect(()=>{u&&c(null)},[u]),u}function IU(e){let{animateLayoutChanges:n=OU,attributes:o,disabled:a,data:s,getNewIndex:u=TU,id:c,strategy:d,resizeObserverConfig:p,transition:g=MU}=e;const{items:y,containerId:h,activeIndex:b,disabled:x,disableTransforms:w,sortedRects:C,overIndex:R,useDragOverlay:T,strategy:O}=v.useContext(TM),M=jU(a,x),A=y.indexOf(c),N=v.useMemo(()=>({sortable:{containerId:h,index:A,items:y},...s}),[h,s,A,y]),k=v.useMemo(()=>y.slice(y.indexOf(c)),[y,c]),{rect:j,node:D,isOver:z,setNodeRef:F}=RM({id:c,data:N,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...p}}),{active:G,activatorEvent:J,activeNodeRect:Y,attributes:U,setNodeRef:H,listeners:L,isDragging:$,over:K,setActivatorNodeRef:V,transform:X}=SM({id:c,data:N,attributes:{...DU,...o},disabled:M.draggable}),ee=q8(F,H),q=!!G,se=q&&!w&&Lf(b)&&Lf(R),I=!T&&$,B=I&&se?X:null,re=se?B??(d??O)({rects:C,activeNodeRect:Y,activeIndex:b,overIndex:R,index:A}):null,Re=Lf(b)&&Lf(R)?u({id:c,items:y,activeIndex:b,overIndex:R}):A,le=G?.id,me=v.useRef({activeId:le,items:y,newIndex:Re,containerId:h}),ge=y!==me.current.items,ce=n({active:G,containerId:h,isDragging:$,isSorting:q,id:c,index:A,items:y,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:g,wasDragging:me.current.activeId!=null}),Te=NU({disabled:!ce,index:A,node:D,rect:j});return v.useEffect(()=>{q&&me.current.newIndex!==Re&&(me.current.newIndex=Re),h!==me.current.containerId&&(me.current.containerId=h),y!==me.current.items&&(me.current.items=y)},[q,Re,h,y]),v.useEffect(()=>{if(le===me.current.activeId)return;if(le!=null&&me.current.activeId==null){me.current.activeId=le;return}const ke=setTimeout(()=>{me.current.activeId=le},50);return()=>clearTimeout(ke)},[le]),{active:G,activeIndex:b,attributes:U,data:N,rect:j,index:A,newIndex:Re,items:y,isOver:z,isSorting:q,isDragging:$,listeners:L,node:D,overIndex:R,over:K,setNodeRef:ee,setActivatorNodeRef:V,setDroppableNodeRef:F,setDraggableNodeRef:H,transform:Te??re,transition:ve()};function ve(){if(Te||ge&&me.current.newIndex===A)return AU;if(!(I&&!Np(J)||!g)&&(q||ce))return Di.Transition.toString({...g,property:OM})}}function jU(e,n){var o,a;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(o=e?.draggable)!=null?o:n.draggable,droppable:(a=e?.droppable)!=null?a:n.droppable}}function Dh(e){if(!e)return!1;const n=e.data.current;return!!(n&&"sortable"in n&&typeof n.sortable=="object"&&"containerId"in n.sortable&&"items"in n.sortable&&"index"in n.sortable)}const PU=[Zt.Down,Zt.Right,Zt.Up,Zt.Left],kU=(e,n)=>{let{context:{active:o,collisionRect:a,droppableRects:s,droppableContainers:u,over:c,scrollableAncestors:d}}=n;if(PU.includes(e.code)){if(e.preventDefault(),!o||!a)return;const p=[];u.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const b=s.get(h.id);if(b)switch(e.code){case Zt.Down:a.top<b.top&&p.push(h);break;case Zt.Up:a.top>b.top&&p.push(h);break;case Zt.Left:a.left>b.left&&p.push(h);break;case Zt.Right:a.left<b.left&&p.push(h);break}});const g=lH({collisionRect:a,droppableRects:s,droppableContainers:p});let y=nM(g,"id");if(y===c?.id&&g.length>1&&(y=g[1].id),y!=null){const h=u.get(o.id),b=u.get(y),x=b?s.get(b.id):null,w=b?.node.current;if(w&&x&&h&&b){const R=Ip(w).some((k,j)=>d[j]!==k),T=MM(h,b),O=LU(h,b),M=R||!T?{x:0,y:0}:{x:O?a.width-x.width:0,y:O?a.height-x.height:0},A={x:x.left,y:x.top};return M.x&&M.y?A:bc(A,M)}}}};function MM(e,n){return!Dh(e)||!Dh(n)?!1:e.data.current.sortable.containerId===n.data.current.sortable.containerId}function LU(e,n){return!Dh(e)||!Dh(n)||!MM(e,n)?!1:e.data.current.sortable.index<n.data.current.sortable.index}function La({className:e,size:n="default",...o}){return S.jsx("div",{"data-slot":"card","data-size":n,className:Ze("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-xs/relaxed text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg",e),...o})}function zU({className:e,...n}){return S.jsx("div",{"data-slot":"card-header",className:Ze("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...n})}function _U({className:e,...n}){return S.jsx("div",{"data-slot":"card-content",className:Ze("px-(--card-spacing)",e),...n})}const AM=v.createContext(void 0);function HU(){const e=v.useContext(AM);if(e===void 0)throw new Error(Rn(63));return e}const UU="data-checked",FU="data-unchecked",DM={...Yl,checked(e){return e?{[UU]:""}:{[FU]:""}}},BU=v.forwardRef(function(n,o){const{checked:a,className:s,defaultChecked:u,"aria-labelledby":c,form:d,id:p,inputRef:g,name:y,nativeButton:h=!1,onCheckedChange:b,readOnly:x=!1,required:w=!1,disabled:C=!1,render:R,uncheckedValue:T,value:O,style:M,...A}=n,{clearErrors:N}=Fc(),{state:k,setTouched:j,setDirty:D,validityData:z,setFilled:F,validationMode:G,disabled:J,name:Y,validation:U}=qa(),{labelId:H}=Cs(),L=J||C,$=Y??y,K=v.useRef(null),V=Xr(K,g,U.inputRef),X=v.useRef(null),ee=Bc(L,X),q=Tr(),se=Kl({id:p}),I=h?void 0:se,[B,W]=bs({controlled:a,default:!!u,name:"Switch",state:"checked"});Vc(X,q,B,void 0,!L,y),_e(()=>{F(B)},[B,F]),ql(B,()=>{N($),D(B!==z.initialValue),U.change(B)});const{getButtonProps:re,buttonRef:Re}=ma({disabled:L,native:h}),le=Pv(c,H,K,!h,I,A["aria-label"]),me={id:h?se:q,role:"switch","aria-checked":B,"aria-readonly":x||void 0,"aria-required":w||void 0,"aria-labelledby":le,onFocus(){ee(!0)},onBlur(){const ve=K.current;!ve||L||(j(!0),ee(!1),G==="onBlur"&&U.commit(ve.checked))},onClick(ve){if(x||L)return;ve.preventDefault();const ke=K.current;ke&&hs(ke,ve)}},ge={...U.getValidationProps(L),checked:B,disabled:L,form:d,id:I,name:$,required:w,style:$?Bh:Dc,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(ve){if(ve.nativeEvent.defaultPrevented)return;if(x){ve.preventDefault();return}const ke=ve.currentTarget.checked,Me=dt(_r,ve.nativeEvent);b?.(ke,Me),!Me.isCanceled&&W(ke)},onClick(ve){ve.stopPropagation()},onFocus(){X.current?.focus()},...O!==void 0?{value:O}:Gt},ce=v.useMemo(()=>({...k,checked:B,disabled:L,readOnly:x,required:w}),[k,B,L,x,w]),Te=Mt("span",n,{state:ce,ref:[o,X,Re],props:[me,A,re,ve=>U.getValidationProps(L,ve)],stateAttributesMapping:DM});return S.jsxs(AM.Provider,{value:ce,children:[Te,!B&&$&&T!==void 0&&S.jsx("input",{type:"hidden",form:d,name:$,value:T,disabled:L}),S.jsx("input",{...ge,suppressHydrationWarning:!0})]})}),VU=v.forwardRef(function(n,o){const{render:a,className:s,style:u,...c}=n,d=HU();return Mt("span",n,{state:d,ref:o,stateAttributesMapping:DM,props:c})});function qU({className:e,...n}){return S.jsx(BU,{"data-slot":"switch",className:Ze(`
34
- peer relative inline-flex h-4 w-7 shrink-0 items-center rounded-full
35
- border border-transparent bg-input p-0.5 transition-colors outline-none
36
- focus-visible:border-ring focus-visible:ring-2
37
- focus-visible:ring-ring/30 disabled:cursor-not-allowed
38
- disabled:opacity-50 data-checked:bg-primary
39
- `,e),...n,children:S.jsx(VU,{"data-slot":"switch-thumb",className:`
40
- pointer-events-none block size-3 rounded-full bg-background shadow-sm
41
- transition-transform data-checked:translate-x-3
42
- `})})}function YU(e){return`library:${e}`}function NM(e,n){return`assigned:${e}:${n}`}function IM(e){return`agent:${e}`}function KU(e){return String(e).startsWith("assigned:")}function Cy(e){return Yv(e)&&e.type==="library-instruction"&&typeof e.instructionId=="string"}function Dl(e){return Yv(e)&&e.type==="assigned-instruction"&&typeof e.agentId=="string"&&typeof e.instructionId=="string"}function CR(e){return Yv(e)&&e.type==="agent"&&typeof e.agentId=="string"}function Yv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const GU="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M9.205%208.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357%201.356-.523%202.117-.523%202.854%200%204.662%202.212%204.662%204.566%200%20.167%200%20.357-.024.547l-4.71-2.759a.797.797%200%2000-.856%200l-5.97%203.473zm10.609%208.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473%201.95-1.118a.433.433%200%2001.476%200l4.543%202.617c1.309.76%202.189%202.378%202.189%203.948%200%201.808-1.07%203.473-2.76%204.163zM7.802%2012.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545%201.95-4.472%204.591-4.472%201%200%201.927.333%202.712.928L8.23%205.067c-.285.166-.428.404-.428.737v6.898zM12%2015.128l-2.795-1.57v-3.33L12%208.658l2.795%201.57v3.33L12%2015.128zm1.796%207.23c-1%200-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974%201.142c.167.095.238.238.238.428v5.233c0%202.545-1.974%204.472-4.614%204.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482%204.482%200%20014.21%206.327v5.423c0%20.333.143.571.428.738l5.947%203.449-1.95%201.118a.432.432%200%2001-.476%200zm-.262%203.9c-2.688%200-4.662-2.021-4.662-4.519%200-.19.024-.38.047-.57l4.686%202.71c.286.167.571.167.856%200l5.97-3.448v2.26c0%20.19-.07.333-.237.428l-4.543%202.616c-.619.357-1.356.523-2.117.523zm5.899%202.83a5.947%205.947%200%20005.827-4.756C22.287%2018.339%2024%2015.84%2024%2013.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498%200-3.401-2.759-5.947-5.946-5.947-.642%200-1.26.095-1.88.31A5.962%205.962%200%200010.205%200a5.947%205.947%200%2000-5.827%204.757C1.713%205.447%200%207.945%200%2010.49c0%201.666.713%203.283%201.998%204.448-.119.5-.19%201-.19%201.499%200%203.401%202.759%205.946%205.946%205.946.642%200%201.26-.095%201.88-.309a5.96%205.96%200%20004.162%201.713z'%3e%3c/path%3e%3c/svg%3e",$U="data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%20Code%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M20.998%2010.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6%2010.949h1.488V8.102H6v2.847zm10.51%200H18V8.102h-1.49v2.847z'%20fill='%23D97757'%20fill-rule='evenodd'%3e%3c/path%3e%3c/svg%3e",XU=new Map([["openai",{src:GU,className:"dark:invert"}],["claudecode",{src:$U}]]);function QU({icon:e,className:n}){const o=XU.get(e);return S.jsx("div",{"aria-hidden":"true",className:Ze(`
43
- flex size-8 shrink-0 items-center justify-center rounded-md bg-muted
44
- text-foreground
45
- `,n),children:o?S.jsx("img",{src:o.src,alt:"",draggable:!1,className:Ze("size-4",o.className)}):S.jsx(dC,{className:"size-4"})})}function ZU({agent:e,instructionsById:n,isInstructionsLoading:o,isPending:a,isReapplying:s,onRemoveInstruction:u,onToggle:c,onReapply:d,onOpenFile:p}){const{t:g}=sn(),{isOver:y,setNodeRef:h}=RM({id:IM(e.id),data:{type:"agent",agentId:e.id},disabled:a}),b=e.enabled||e.instructionIds.length>0,x=e.enabled?g("agents.reapplyHint"):g("agents.reapplyDisabledHint"),w=g(b?e.enabled?"agents.toggleOnHint":"agents.toggleOffHint":"agents.enableRequiresInstruction");return S.jsxs(La,{"data-agent-id":e.id,ref:h,className:Ze("gap-0 py-0 transition-shadow",y&&"ring-2 ring-ring/40"),children:[S.jsxs("div",{className:"flex items-center gap-3 p-3",children:[S.jsx(QU,{icon:e.icon}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),S.jsx("button",{type:"button",className:`
46
- block max-w-full truncate font-mono text-[11px]
47
- text-muted-foreground
48
- hover:text-foreground hover:underline
49
- `,"aria-label":g("agents.openFileAria",{name:e.name}),onClick:()=>{p(e.id)},children:e.instructionFile})]}),S.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[S.jsxs(mh,{children:[S.jsx(yh,{render:S.jsx("span",{className:"inline-flex"}),children:S.jsx(Jt,{type:"button",variant:"ghost",size:"icon","aria-label":g("agents.reapplyAria",{name:e.name}),disabled:a||!e.enabled,onClick:()=>{d(e.id)},children:S.jsx($P,{className:Ze(s&&"animate-spin")})})}),S.jsx(vh,{children:x})]}),S.jsxs(mh,{children:[S.jsx(yh,{render:S.jsx("span",{className:"inline-flex"}),children:S.jsx(qU,{checked:e.enabled,disabled:a||!b,"aria-label":g("agents.toggleAria",{name:e.name}),onCheckedChange:C=>{c(e.id,C)}})}),S.jsx(vh,{children:w})]})]})]}),S.jsx("div",{className:"border-t border-border/60 p-3",children:e.instructionIds.length===0?S.jsx("div",{className:`
50
- flex min-h-20 items-center justify-center rounded-md border
51
- border-dashed border-border px-4 text-center text-xs
52
- text-muted-foreground
53
- `,children:g("agents.emptyAssigned")}):S.jsx(CU,{items:e.instructionIds.map(C=>NM(e.id,C)),strategy:RU,children:S.jsx("ol",{className:"flex flex-col gap-1",children:e.instructionIds.map((C,R)=>{const T=n.get(C),O=T?.name??C;return S.jsx(JU,{agentId:e.id,index:R,instructionId:C,instructionName:o&&!T?g("agents.loadingInstruction"):O,isPending:a,onRemove:u},C)})})})})]})}function JU({agentId:e,index:n,instructionId:o,instructionName:a,isPending:s,onRemove:u}){const{t:c}=sn(),{attributes:d,isDragging:p,isOver:g,listeners:y,setNodeRef:h,transform:b,transition:x}=IU({id:NM(e,o),animateLayoutChanges:()=>!1,data:{type:"assigned-instruction",agentId:e,instructionId:o},disabled:s});return S.jsxs("li",{...d,...y,ref:h,"data-instruction-id":o,style:{transform:Di.Transform.toString(b),transition:x},className:Ze(`
54
- group flex items-center gap-2 rounded-md border border-transparent
55
- bg-muted/40 px-2 py-1.5
56
- `,g&&"border-ring bg-muted",p&&"z-10",s?"cursor-default":`
57
- cursor-grab
58
- active:cursor-grabbing
59
- `),children:[S.jsx(ov,{"aria-hidden":"true",className:`
60
- size-3.5 shrink-0 text-muted-foreground
61
- group-active:cursor-grabbing
62
- `}),S.jsx("span",{className:`
63
- w-4 shrink-0 text-center font-mono text-[10px] text-muted-foreground
64
- `,children:n+1}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:a}),S.jsx(Jt,{type:"button",variant:"ghost",size:"icon","aria-label":c("agents.removeInstructionAria",{name:a}),disabled:s,onClick:()=>{u(e,o)},onKeyDown:w=>{w.stopPropagation()},onPointerDown:w=>{w.stopPropagation()},children:S.jsx(Rs,{})})]})}const jM="/api/agents";class PM extends Error{constructor(n,o){super(o),this.code=n,this.name="AgentApiError"}code}function WU(e){return $c(jM,{signal:e})}function eF(e,n){return $c(kp(e,"instructions"),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({instructionIds:n})})}function tF(e,n){return $c(kp(e,"enabled"),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:n})})}function nF(e){return $c(kp(e,"reapply"),{method:"POST"})}function rF(e){return $c(kp(e,"open-file"),{method:"POST"})}function kp(e,n){return`${jM}/${encodeURIComponent(e)}/${n}`}async function $c(e,n){const o=await fetch(e,n);if(!o.ok){const a=await oF(o);throw new PM(a.code,a.message)}return o.json()}async function oF(e){try{const n=await e.json();return{code:n.error?.code??"AGENT_REQUEST_FAILED",message:n.error?.message??`Request failed with status ${e.status}`}}catch{return{code:"AGENT_REQUEST_FAILED",message:`Request failed with status ${e.status}`}}}const Pr=["agents"],_f=["agents","update"];function aF(){const{t:e}=sn(),n=Ba(),o=dp({queryKey:Pr,queryFn:({signal:h})=>WU(h),retry:!1});function a(h){n.setQueryData(Pr,b=>b?.map(x=>x.id===h.id?h:x))}const s=Ao({mutationKey:_f,mutationFn:({agentId:h,instructionIds:b})=>eF(h,b),onMutate:async({previous:h})=>(await n.cancelQueries({queryKey:Pr}),{previous:h}),onError:(h,b,x)=>{x?.previous&&n.setQueryData(Pr,x.previous),_n.error(e("agents.updateError"))},onSuccess:a,onSettled:()=>n.invalidateQueries({queryKey:Pr})}),u=Ao({mutationKey:_f,mutationFn:({agentId:h,enabled:b})=>tF(h,b),onMutate:async({agentId:h,enabled:b})=>{await n.cancelQueries({queryKey:Pr});const x=n.getQueryData(Pr);return n.setQueryData(Pr,w=>w?.map(C=>C.id===h?{...C,enabled:b}:C)),{previous:x}},onError:(h,b,x)=>{x?.previous&&n.setQueryData(Pr,x.previous),_n.error(e("agents.enableError"))},onSuccess:h=>{a(h),_n.success(e(h.enabled?"agents.applied":"agents.removed"))},onSettled:()=>n.invalidateQueries({queryKey:Pr})}),c=Ao({mutationKey:_f,mutationFn:h=>nF(h),onSuccess:h=>{a(h),_n.success(e("agents.reapplied"))},onError:()=>{_n.error(e("agents.reapplyError"))},onSettled:()=>n.invalidateQueries({queryKey:Pr})}),d=Ao({mutationKey:_f,mutationFn:h=>rF(h),onError:h=>{_n.error(e(h instanceof PM&&h.code==="AGENT_FILE_NOT_FOUND"?"agents.fileMissing":"agents.openFileError"))}}),p=[s,u,c,d],g=new Set;for(const h of p){if(!h.isPending)continue;const b=iF(h.variables);b&&g.add(b)}const y=new Set(c.isPending&&typeof c.variables=="string"?[c.variables]:[]);return{agents:o.data??[],isLoading:o.isPending,isError:o.isError&&o.data===void 0,retry:o.refetch,pendingAgentIds:g,reapplyingAgentIds:y,updateInstructions:(h,b)=>{const x=n.getQueryData(Pr);n.setQueryData(Pr,w=>w?.map(C=>C.id===h?{...C,instructionIds:b,enabled:b.length>0&&C.enabled}:C)),s.mutate({agentId:h,instructionIds:b,previous:x})},setEnabled:(h,b)=>{u.mutate({agentId:h,enabled:b})},reapply:h=>{c.mutate(h)},openFile:h=>{d.mutate(h)}}}function iF(e){if(typeof e=="string")return e;if(e&&typeof e=="object"&&"agentId"in e){const n=e.agentId;return typeof n=="string"?n:void 0}}const Kv="/api/instructions";class kM extends Error{constructor(n,o){super(o),this.code=n,this.name="InstructionApiError"}code}function sF(e){return Gv(Kv,{signal:e})}function lF(e){return Gv(Kv,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function uF(e,n){return Gv(LM(e),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)})}async function cF(e){const n=await fetch(LM(e),{method:"DELETE"});if(n.ok)return;const o=await zM(n);throw new kM(o.code,o.message)}async function Gv(e,n){const o=await fetch(e,n);if(!o.ok){const a=await zM(o);throw new kM(a.code,a.message)}return o.json()}function LM(e){return`${Kv}/${encodeURIComponent(e)}`}async function zM(e){try{const n=await e.json();return{code:n.error?.code??"INSTRUCTION_REQUEST_FAILED",message:n.error?.message??`Request failed with status ${e.status}`}}catch{return{code:"INSTRUCTION_REQUEST_FAILED",message:`Request failed with status ${e.status}`}}}function dF({className:e,description:n,icon:o,title:a}){let s=null;return n!=null&&(s=S.jsx("p",{className:"max-w-64 text-xs/relaxed text-muted-foreground",children:n})),S.jsxs("div",{"data-slot":"empty",className:Ze("flex flex-col items-center gap-2 px-4 py-10 text-center",e),children:[o&&S.jsx("div",{className:`
65
- flex size-8 items-center justify-center rounded-md bg-muted
66
- text-muted-foreground
67
- `,children:S.jsx(o,{"aria-hidden":"true",className:"size-4"})}),S.jsx("div",{className:"text-sm font-medium",children:a}),s]})}function fF(e){const[n,o]=v.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),a=v.useRef(null),s=v.useRef(null),u=v.useRef(null),c=v.useRef(null),d=v.useRef(!0),p=v.useRef(null),g=Hl(),y=v.useMemo(()=>({anchor:n,setAnchor:o,actionsRef:u,backdropRef:a,internalBackdropRef:s,positionerRef:c,allowMouseUpTriggerRef:d,initialCursorPointRef:p,rootId:g}),[n,g]);return S.jsx(tO.Provider,{value:y,children:S.jsx(bp.Provider,{value:void 0,children:S.jsx(wO,{...e})})})}const TR=500,hF=v.forwardRef(function(n,o){const{render:a,className:s,style:u,...c}=n,{setAnchor:d,actionsRef:p,internalBackdropRef:g,backdropRef:y,positionerRef:h,allowMouseUpTriggerRef:b,initialCursorPointRef:x,rootId:w}=xp(!1),{store:C}=Va(!1),R=C.useState("open"),T=C.useState("disabled"),O=v.useRef(null),M=v.useRef(null),A=Hn(),N=Hn(),k=v.useRef(!1),j=v.useRef(null);function D(H,L,$){const K=$.type.startsWith("touch");x.current={x:H,y:L},d({getBoundingClientRect(){return DOMRect.fromRect({width:K?10:0,height:K?10:0,x:H,y:L})}}),k.current=!1,p.current?.setOpen(!0,dt(qo,$)),N.start(TR,()=>{k.current=!0})}function z(H){if(T)return;b.current=!0,Bo(H),D(H.clientX,H.clientY,H.nativeEvent);const L=Kt(O.current);j.current?.abort();const $=new AbortController;j.current=$,L.addEventListener("mouseup",K=>{if(b.current=!1,!k.current)return;N.clear(),k.current=!1;const V=tr(K);ot(h.current,V)||w&&V&&Dv(V)===w||p.current?.setOpen(!1,dt(Uy,K))},{once:!0,signal:$.signal})}function F(){A.clear(),M.current=null}function G(H){if(T){F();return}if(b.current=!1,H.touches.length!==1){F();return}H.stopPropagation();const L=H.touches[0],$={x:L.clientX,y:L.clientY};M.current=$,A.start(TR,()=>{D($.x,$.y,H.nativeEvent)})}function J(H){if(H.touches.length!==1){F();return}if(A.isStarted()&&M.current){const L=H.touches[0],$=10,K=Math.abs(L.clientX-M.current.x),V=Math.abs(L.clientY-M.current.y);(K>$||V>$)&&F()}}return v.useEffect(()=>()=>{j.current?.abort()},[]),v.useEffect(()=>{function H($){if(T)return;const V=tr($);(ot(O.current,V)||ot(g.current,V)||ot(y.current,V))&&$.preventDefault()}const L=Kt(O.current);return jt(L,"contextmenu",H)},[y,T,g]),Mt("div",n,{state:{open:R},ref:[O,o],props:[{onContextMenu:z,onTouchStart:G,onTouchMove:J,onTouchEnd:F,onTouchCancel:F,style:{WebkitTouchCallout:"none"}},c],stateAttributesMapping:rh})}),pF=mO;function gF({...e}){return S.jsx(fF,{"data-slot":"context-menu",...e})}function mF({className:e,...n}){return S.jsx(hF,{"data-slot":"context-menu-trigger",className:Ze("select-none",e),...n})}function yF({className:e,align:n="start",alignOffset:o=4,side:a="right",sideOffset:s=0,...u}){return S.jsx(fO,{children:S.jsx(pF,{className:"isolate z-50 outline-none",align:n,alignOffset:o,side:a,sideOffset:s,children:S.jsx(cO,{"data-slot":"context-menu-content",className:Ze("z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...u})})})}function vF({className:e,inset:n,variant:o="default",...a}){return S.jsx(lO,{"data-slot":"context-menu-item","data-inset":n,"data-variant":o,className:Ze("group/context-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive",e),...a})}const _M=v.createContext(void 0);function Lp(e){const n=v.useContext(_M);if(n===void 0&&!e)throw new Error(Rn(47));return n}const bF={...ka,disabled:e=>e.disabled,instantType:e=>e.instantType==="trigger-change"&&!ka.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,n)=>e.openChangeReason===qo&&ka.isOpenedByTrigger(e,n),isTouchPressOpen:(e,n)=>n&&e.openMethod==="touch"&&e.openChangeReason===qo,hasTriggerFocusGuards:(e,n)=>ka.isOpenedByTrigger(e,n)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class xF extends Ul{constructor(n,o,a){const s=new jc;super(SF(n,s,o,a),wF(s),bF)}setOpen=(n,o)=>{const a=o.reason===qn,s=o.reason===qo&&o.event.detail===0,u=!n&&(o.reason===Mc||o.reason==null),c=Zh(o),d=this.select("activeTriggerId");if(!n&&o.reason===GR&&o.trigger==null&&d!=null&&(o.trigger=this.context.triggerElements.getById(d)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(n,o),o.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,o);const p=()=>{const y=Qh(this.state,n,o.trigger,c());y.openChangeReason=o.reason,this.update(y)};a?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(bE,()=>{this.context.stickIfOpen=!1}),cr.flushSync(p)):p();let g;s?g="click":u?g="dismiss":o.reason===Ti&&(g="focus"),this.set("instantType",g)}}function SF(e,n,o,a=!1){const s={...np(n,o,a),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return s.open&&e?.mounted===void 0&&(s.mounted=!0),s}function wF(e){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:v.createRef(),beforeTriggerFocusGuardRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),stickIfOpenTimeout:new No,stickIfOpen:!0,triggerElements:e}}const OR=Rc(function({props:n}){const{children:o,open:a,defaultOpen:s=!1,onOpenChange:u,onOpenChangeComplete:c,modal:d=!1,handle:p,triggerId:g,defaultTriggerId:y=null}=n,h=EF(p,{modal:d,open:s,openProp:a,activeTriggerId:y,triggerIdProp:g});h.useControlledProp("openProp",a),h.useControlledProp("triggerIdProp",g);const b=h.useState("open"),x=h.useState("mounted"),w=h.useState("payload");h.useContextCallback("onOpenChange",u),h.useContextCallback("onOpenChangeComplete",c),PE(h,b),Jh(h);const{forceUnmount:C}=Wh(b,h,()=>{h.context.stickIfOpen=!0,h.set("openChangeReason",null)});h.useSyncedValues({modal:d}),v.useEffect(()=>{b||h.context.stickIfOpenTimeout.clear()},[h,b]),v.useImperativeHandle(n.actionsRef,()=>({unmount:C,close:()=>h.setOpen(!1,dt(Ac))}),[C,h]);const R=b||x||p!=null;return S.jsxs(_M.Provider,{value:h,children:[p&&S.jsx(Xh,{handle:p,store:h}),R&&S.jsx(CF,{store:h,modal:d}),typeof o=="function"?o({payload:w}):o]})});function RF(e){return Lp(!0)?S.jsx(OR,{props:e}):S.jsx(ME,{children:S.jsx(OR,{props:e})})}function EF(e,n){const o=Wy((a,s)=>new xF(n,a,s));return v.useEffect(()=>o.context.stickIfOpenTimeout.disposeEffect(),[o]),o}function CF({store:e,modal:n}){const o=e.useState("floatingRootContext"),a=Nc(o,{outsidePressEvent:{mouse:n==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=a.reference,u=a.floating;return ep(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:u}),null}const HM=v.createContext(void 0);function TF(){const e=v.useContext(HM);if(e===void 0)throw new Error(Rn(45));return e}const OF=v.forwardRef(function(n,o){const{keepMounted:a=!1,...s}=n;return Lp().useState("mounted")||a?S.jsx(HM.Provider,{value:a,children:S.jsx(Kh,{ref:o,...s})}):null}),UM=v.createContext(void 0);function MF(){const e=v.useContext(UM);if(!e)throw new Error(Rn(46));return e}const AF=v.forwardRef(function(n,o){const{render:a,className:s,style:u,anchor:c,positionMethod:d,side:p,align:g,sideOffset:y,alignOffset:h,collisionBoundary:b="clipping-ancestors",collisionPadding:x,arrowPadding:w,sticky:C,disableAnchorTracking:R=!1,collisionAvoidance:T=Xy,...O}=n,M=Lp(),A=TF(),N=Zy(),k=M.useState("floatingRootContext"),j=M.useState("mounted"),D=M.useState("open"),z=M.useState("openChangeReason"),F=M.useState("activeTriggerElement"),G=M.useState("modal"),J=M.useState("openMethod"),Y=M.useState("positionerElement"),U=M.useState("instantType"),H=M.useState("transitionStatus"),L=M.useState("adaptiveOrigin"),$=ip({anchor:c,floatingRootContext:k,positionMethod:d,mounted:j,side:p,sideOffset:y,align:g,alignOffset:h,arrowPadding:w,collisionBoundary:b,collisionPadding:x,sticky:C,disableAnchorTracking:R,keepMounted:A,nodeId:N,collisionAvoidance:T,adaptiveOrigin:L}),K=k.useState("domReferenceElement");pO({store:M,domReference:K,positionerElement:Y,open:D});const V=G===!0&&z!==qn;Av(D&&V,J==="touch",Y,F);const X=M.useStateSetter("positionerElement"),ee={open:D,side:$.side,align:$.align,anchorHidden:$.anchorHidden,instant:U},q=sp(n,ee,{styles:$.positionerStyles,transitionStatus:H,props:O,refs:[o,X],hidden:!j,inert:!D});return S.jsxs(UM.Provider,{value:$,children:[j&&V&&S.jsx(Rp,{inert:lp(!D),cutout:F}),S.jsx(OE,{id:N,children:q})]})}),DF=v.createContext(void 0);function NF(){const[e,n]=v.useState(0),o=Be(()=>(n(s=>s+1),()=>{n(s=>Math.max(0,s-1))}));return{context:v.useMemo(()=>({register:o}),[o]),hasClosePart:e>0}}const IF=v.forwardRef(function(n,o){const{render:a,className:s,style:u,initialFocus:c,finalFocus:d,...p}=n,g=Lp(),y=MF(),h=Ov()!=null,{context:b,hasClosePart:x}=NF(),w=g.useState("open"),C=g.useState("openMethod"),R=g.useState("instantType"),T=g.useState("transitionStatus"),O=g.useState("popupProps"),M=g.useState("titleElementId"),A=g.useState("descriptionElementId"),N=g.useState("modal"),k=g.useState("mounted"),j=g.useState("openChangeReason"),D=g.useState("activeTriggerElement"),z=g.useState("floatingRootContext"),F=z.useState("floatingId"),G=g.useState("disabled"),J=g.useState("openOnHover"),Y=g.useState("closeDelay");jo({open:w,ref:g.context.popupRef,onComplete(){w&&g.context.onOpenChangeComplete?.(!0)}}),nv(z,{enabled:J&&!G,closeDelay:Y});const U=c===void 0?IE(g.context.popupRef):c,H=N!==!1&&x;g.useSyncedValue("focusManagerModal",H);const L=g.useStateSetter("popupElement"),$={open:w,side:y.side,align:y.align,instant:R,transitionStatus:T},K=Mt("div",n,{state:$,ref:[o,g.context.popupRef,L],props:[O,{id:F,role:"dialog",...Ic,"aria-labelledby":M,"aria-describedby":A,onKeyDown(V){h&&Uc.has(V.key)&&V.stopPropagation()}},Pc(T),p],stateAttributesMapping:Uh});return S.jsx(Gh,{context:z,openInteractionType:C,modal:H,disabled:!k||j===qn,initialFocus:U,returnFocus:d,restoreFocus:"popup",getInsideElements:()=>[g.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:yn(D)?D:void 0,nextFocusableElement:g.context.triggerFocusTargetRef,beforeContentFocusGuardRef:g.context.beforeContentFocusGuardRef,children:S.jsx(DF.Provider,{value:b,children:K})})});function jF({...e}){return S.jsx(RF,{"data-slot":"popover",...e})}function PF({anchor:e,align:n="center",alignOffset:o=0,side:a="bottom",sideOffset:s=4,className:u,...c}){return S.jsx(OF,{children:S.jsx(AF,{anchor:e,className:"isolate z-50 outline-none",align:n,alignOffset:o,side:a,sideOffset:s,children:S.jsx(IF,{"data-slot":"popover-content",className:Ze("z-50 w-72 origin-(--transform-origin) rounded-lg bg-popover p-4 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",u),...c})})})}function kF({instructions:e,isLoading:n,isError:o,onRetry:a,onEdit:s,onDelete:u,onPreload:c}){const{t:d}=sn(),[p,g]=v.useState(null);return n?S.jsx(La,{className:"gap-0 py-0",children:S.jsx("div",{className:"divide-y",children:[0,1,2].map(y=>S.jsxs("div",{className:"flex items-center gap-2 p-3",children:[S.jsx(co,{className:"size-3.5 rounded-sm"}),S.jsx(co,{className:"h-4 w-2/3"})]},y))})}):o?S.jsxs(La,{className:"items-start gap-3 p-4",children:[S.jsx("p",{className:"text-xs text-muted-foreground",children:d("instructions.loadError")}),S.jsxs(Jt,{type:"button",variant:"outline",onClick:a,children:[S.jsx(GC,{}),S.jsx("span",{children:d("common.retry")})]})]}):e.length===0?S.jsx(La,{className:"gap-0 py-0",children:S.jsx(dF,{icon:LP,title:d("instructions.emptyTitle"),description:d("instructions.emptyDescription")})}):S.jsxs(La,{className:"gap-0 py-0",children:[S.jsx("ul",{"aria-label":d("instructions.listAria"),className:"divide-y",children:e.map(y=>S.jsx(LF,{instruction:y,onRequestDelete:h=>{g({anchor:h,instruction:y})},onEdit:()=>{s(y)},onPreload:c},y.id))}),S.jsx(jF,{open:p!==null,onOpenChange:y=>{y||g(null)},children:S.jsxs(PF,{anchor:p?.anchor,side:"bottom",align:"start",sideOffset:6,className:"w-64 p-3",children:[S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsx("div",{className:"text-xs font-medium",children:d("instructions.deleteConfirmTitle")}),S.jsx("p",{className:"text-xs/relaxed text-muted-foreground",children:d("instructions.deleteConfirmDescription",{name:p?.instruction.name??""})})]}),S.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[S.jsx(Jt,{type:"button",variant:"ghost",onClick:()=>{g(null)},children:d("common.cancel")}),S.jsx(Jt,{type:"button",variant:"destructive",onClick:()=>{if(!p)return;const{instruction:y}=p;g(null),u(y)},children:d("instructions.delete")})]})]})})]})}function LF({instruction:e,onEdit:n,onPreload:o,onRequestDelete:a}){const{t:s}=sn(),u=v.useRef(null),{attributes:c,isDragging:d,listeners:p,setNodeRef:g}=SM({id:YU(e.id),data:{type:"library-instruction",instructionId:e.id}});function y(){const h=u.current;h&&a(h)}return S.jsxs(gF,{children:[S.jsxs(mF,{ref:h=>{u.current=h,g(h)},render:S.jsx("li",{...p,"data-instruction-id":e.id,className:Ze(`
68
- group flex cursor-grab items-center gap-2 py-2.5 pr-1 pl-3
69
- hover:bg-muted/40
70
- active:cursor-grabbing
71
- `,d&&"opacity-40")}),children:[S.jsx(ov,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),S.jsx("button",{...c,type:"button",className:`
72
- flex min-w-0 flex-1 cursor-grab items-center gap-2 text-left text-xs
73
- outline-none
74
- focus-visible:underline focus-visible:underline-offset-3
75
- active:cursor-grabbing
76
- `,onClick:n,onFocus:o,onPointerEnter:o,children:S.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.name})}),S.jsxs(Nv,{children:[S.jsx(Iv,{render:S.jsx(Jt,{type:"button",variant:"ghost",size:"icon","aria-label":s("instructions.actionsAria",{name:e.name}),className:`
77
- -my-1.5 shrink-0 text-muted-foreground opacity-0
78
- transition-opacity
79
- group-hover:opacity-100
80
- focus-visible:opacity-100
81
- data-popup-open:opacity-100
82
- [@media(hover:none)]:opacity-100
83
- `,onKeyDown:h=>{h.stopPropagation()},onMouseDown:h=>{h.stopPropagation()},onPointerDown:h=>{h.stopPropagation()},onTouchStart:h=>{h.stopPropagation()}}),children:S.jsx(jP,{})}),S.jsx(jv,{align:"end",className:"w-40",children:S.jsx(MR,{Item:NO,onDelete:y,onEdit:n})})]})]}),S.jsx(yF,{children:S.jsx(MR,{Item:vF,onDelete:y,onEdit:n})})]})}function MR({Item:e,onEdit:n,onDelete:o}){const{t:a}=sn();return S.jsxs(S.Fragment,{children:[S.jsxs(e,{onClick:n,children:[S.jsx(GP,{}),S.jsx("span",{children:a("instructions.edit")})]}),S.jsxs(e,{variant:"destructive",onClick:o,children:[S.jsx(JP,{}),S.jsx("span",{children:a("instructions.delete")})]})]})}function FM({className:e,...n}){return S.jsx("label",{"data-slot":"label",className:Ze("flex items-center gap-2 text-xs/relaxed leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}function _l({children:e,className:n,...o}){return S.jsxs(FM,{className:Ze("gap-1",n),...o,children:[e,S.jsx("span",{"aria-hidden":"true",className:"text-destructive",children:"*"})]})}function zp({...e}){return S.jsx(VO,{"data-slot":"dialog",...e})}function zF({...e}){return S.jsx(BO,{"data-slot":"dialog-portal",...e})}function $v({...e}){return S.jsx(Tp,{"data-slot":"dialog-close",...e})}function _F({className:e,...n}){return S.jsx(_O,{"data-slot":"dialog-overlay",className:Ze("fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...n})}function _p({className:e,children:n,showCloseButton:o=!0,...a}){return S.jsxs(zF,{children:[S.jsx(_F,{}),S.jsxs(FO,{"data-slot":"dialog-content",className:Ze("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a,children:[n,o&&S.jsxs(Tp,{"data-slot":"dialog-close",render:S.jsx(Jt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[S.jsx(Rs,{}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Hp({className:e,...n}){return S.jsx("div",{"data-slot":"dialog-header",className:Ze("flex flex-col gap-1",e),...n})}function Up({className:e,showCloseButton:n=!1,children:o,...a}){return S.jsxs("div",{"data-slot":"dialog-footer",className:Ze("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...a,children:[o,n&&S.jsx(Tp,{render:S.jsx(Jt,{variant:"outline"}),children:"Close"})]})}function Fp({className:e,...n}){return S.jsx(qO,{"data-slot":"dialog-title",className:Ze("font-heading text-sm font-medium",e),...n})}function Xv({className:e,...n}){return S.jsx(HO,{"data-slot":"dialog-description",className:Ze("text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...n})}const Sc=["instructions"];function HF(){const e=dp({queryKey:Sc,queryFn:({signal:n})=>sF(n),retry:!1});return{instructions:e.data??[],isLoading:e.isPending,isError:e.isError&&e.data===void 0,retry:e.refetch}}const UF="modulepreload",FF=function(e){return"/"+e},AR={},BF=function(n,o,a){let s=Promise.resolve();if(o&&o.length>0){let p=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");s=p(o.map(g=>{if(g=FF(g),g in AR)return;AR[g]=!0;const y=g.endsWith(".css"),h=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${h}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":UF,y||(b.as="script"),b.crossOrigin="",b.href=g,d&&b.setAttribute("nonce",d),document.head.appendChild(b),y)return new Promise((x,w)=>{b.addEventListener("load",x),b.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${g}`)))})}))}function u(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return s.then(c=>{for(const d of c||[])d.status==="rejected"&&u(d.reason);return n().catch(u)})},BM=()=>BF(()=>import("./markdown-editor-BUDoC1Cq.js"),__vite__mapDeps([0,1]));function B0(){BM()}const VF=v.lazy(async()=>({default:(await BM()).MarkdownEditor}));function qF(e){const{t:n}=sn();return S.jsx(v.Suspense,{fallback:S.jsx("div",{style:{height:e.height??"16rem"},className:`
84
- flex items-center justify-center text-xs text-muted-foreground
85
- `,children:n("instructions.editorLoading")}),children:S.jsx(VF,{...e})})}const YF="16rem";function DR({instruction:e,onClose:n}){const{t:o}=sn(),a=Ba(),s=v.useId(),u=v.useId(),c=e!==void 0,[d,p]=v.useState(e?.name??""),[g,y]=v.useState(e?.content??""),h=Ao({mutationFn:M=>e?uF(e.id,M):lF(M),onSuccess:M=>{a.setQueryData(Sc,A=>[...(A??[]).filter(N=>N.id!==M.id),M].toSorted((N,k)=>k.updatedAt-N.updatedAt)),a.invalidateQueries({queryKey:Sc}),_n.success(o(c?"instructions.updated":"instructions.created")),n()},onError:()=>{_n.error(o(c?"instructions.updateError":"instructions.error"))}}),b=h.isPending,x=!!(d.trim()&&g.trim())&&!b,w=c?"instructions.editTitle":"instructions.createTitle",C=c?"instructions.updating":"instructions.creating",R=c?"instructions.updateSave":"instructions.save",T=c?XP:qC;function O(){b||n()}return S.jsx(zp,{open:!0,onOpenChange:M=>{M||O()},children:S.jsxs(_p,{showCloseButton:!1,className:`
86
- grid max-h-[calc(100vh-2rem)] grid-rows-[auto_minmax(0,1fr)_auto]
87
- overflow-hidden
88
- sm:max-w-3xl
89
- `,children:[S.jsxs("form",{className:"contents","aria-busy":b,onSubmit:M=>{M.preventDefault(),x&&h.mutate({name:d.trim(),content:g})},children:[S.jsx(Hp,{className:"pr-8",children:S.jsx(Fp,{children:o(w)})}),S.jsxs("div",{className:"flex min-h-0 flex-col gap-3 overflow-y-auto pr-1",children:[S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(_l,{htmlFor:s,children:o("instructions.name")}),S.jsx(kO,{id:s,autoFocus:!0,required:!0,maxLength:200,value:d,disabled:b,placeholder:o("instructions.namePlaceholder"),onChange:M=>{p(M.target.value)}})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(_l,{id:u,children:o("instructions.content")}),S.jsx("div",{role:"group","aria-labelledby":u,"aria-required":"true",className:`
90
- overflow-hidden rounded-md border border-input bg-input/20
91
- focus-within:border-ring focus-within:ring-2
92
- focus-within:ring-ring/30
93
- `,children:S.jsx(qF,{height:YF,value:g,ariaLabel:o("instructions.content"),placeholder:o("instructions.contentPlaceholder"),readOnly:b,onChange:y})})]})]}),S.jsxs(Up,{children:[S.jsx(Jt,{type:"button",variant:"ghost",disabled:b,onClick:O,children:o("common.cancel")}),S.jsxs(Jt,{type:"submit",disabled:!x,children:[b?S.jsx(Fl,{className:"animate-spin"}):S.jsx(T,{}),S.jsx("span",{children:o(b?C:R)})]})]})]}),S.jsxs($v,{disabled:b,render:S.jsx(Jt,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[S.jsx(Rs,{}),S.jsx("span",{className:"sr-only",children:o("a11y.close")})]})]})})}const KF=e=>{const n=e.active.data.current;if(Dl(n))return GF(e,n.agentId);const o=e.pointerCoordinates?fH(e):sH(e),a=o.filter(({id:s})=>KU(s));return a.length>0?a:o};function GF(e,n){const o=e.collisionRect.left+e.collisionRect.width/2,a=e.collisionRect.top+e.collisionRect.height/2,s=e.droppableRects.get(IM(n));if(s&&(o<s.left||o>s.left+s.width||a<s.top||a>s.top+s.height))return[];let u;for(const c of e.droppableContainers){const d=c.data.current;if(!Dl(d)||d.agentId!==n)continue;const p=e.droppableRects.get(c.id);if(!p)continue;const g=(p.left+p.width/2-o)**2+(p.top+p.height/2-a)**2;(!u||g<u.distance)&&(u={id:c.id,distance:g})}return u?[{id:u.id}]:[]}function $F(){const{t:e}=sn(),n=Ba(),[o,a]=v.useState(null),[s,u]=v.useState(!1),[c,d]=v.useState(null),p=HF(),g=aF(),y=oH(_0(pM,{activationConstraint:{distance:4}}),_0(gM,{activationConstraint:{delay:200,tolerance:8}}),_0(Fv,{coordinateGetter:kU})),h=v.useMemo(()=>new Map(p.instructions.map(N=>[N.id,N])),[p.instructions]),b=c?p.instructions.find(({id:N})=>N===c):void 0,x=o?.data.current,w=XF(x),C=w?h.get(w)?.name??w:"",R=o?.rect.current.initial?.width,T=Ao({mutationFn:N=>cF(N.id),onSuccess:(N,k)=>{n.setQueryData(Sc,j=>j?.filter(({id:D})=>D!==k.id)),n.setQueryData(Pr,j=>j?.map(D=>{const z=D.instructionIds.filter(F=>F!==k.id);return{...D,instructionIds:z,enabled:z.length>0&&D.enabled}})),n.invalidateQueries({queryKey:Sc}),n.invalidateQueries({queryKey:Pr}),_n.success(e("instructions.deleted"))},onError:()=>{_n.error(e("instructions.deleteError"))}});function O(N,k,j){const D=g.agents.find(({id:G})=>G===N);if(!D||g.pendingAgentIds.has(N))return;if(D.instructionIds.includes(k)){_n.error(e("agents.duplicateError"));return}const z=[...D.instructionIds],F=j?z.indexOf(j):-1;z.splice(F<0?z.length:F,0,k),g.updateInstructions(N,z)}function M(N,k){const j=g.agents.find(({id:D})=>D===N);!j||g.pendingAgentIds.has(N)||g.updateInstructions(N,j.instructionIds.filter(D=>D!==k))}function A({active:N,over:k}){if(a(null),!k)return;const j=N.data.current,D=k.data.current;if(Cy(j)){if(CR(D)){O(D.agentId,j.instructionId);return}Dl(D)&&O(D.agentId,j.instructionId,D.instructionId);return}if(!Dl(j))return;const z=g.agents.find(({id:U})=>U===j.agentId);if(!z||g.pendingAgentIds.has(z.id))return;const F=z.instructionIds,G=F.indexOf(j.instructionId),J=Dl(D)&&D.agentId===j.agentId?F.indexOf(D.instructionId):CR(D)&&D.agentId===j.agentId?F.length-1:-1;if(G===J||G===-1||J===-1)return;const Y=qv([...F],G,J);Y.length===F.length&&Y.every((U,H)=>U===F[H])||g.updateInstructions(z.id,Y)}return S.jsxs(nU,{sensors:y,collisionDetection:KF,onDragStart:({active:N})=>{a(N)},onDragCancel:()=>{a(null)},onDragEnd:A,children:[S.jsxs("div",{className:`
94
- grid min-h-0 flex-1 gap-4 overflow-hidden p-4
95
- max-md:overflow-y-auto
96
- md:grid-cols-[minmax(220px,0.8fr)_minmax(0,1.2fr)]
97
- `,children:[S.jsx(U8,{children:S.jsxs(Jt,{type:"button",onFocus:B0,onPointerEnter:B0,onClick:()=>{u(!0)},children:[S.jsx(qC,{}),S.jsx("span",{children:e("instructions.create")})]})}),S.jsxs("section",{className:"flex min-h-0 flex-col gap-2",children:[S.jsxs("div",{className:"flex items-baseline justify-between gap-3 px-1",children:[S.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:e("nav.instructions")}),S.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:e("instructions.dragHint")})]}),S.jsx("div",{className:`
98
- min-h-0 flex-1 overflow-y-auto p-1
99
- max-md:max-h-64
100
- `,children:S.jsx(kF,{instructions:p.instructions,isLoading:p.isLoading,isError:p.isError,onRetry:()=>{p.retry()},onEdit:N=>{d(N.id)},onDelete:N=>{T.mutate(N)},onPreload:B0})})]}),S.jsxs("section",{className:"flex min-h-0 flex-col gap-2",children:[S.jsxs("div",{className:"flex items-baseline justify-between gap-3 px-1",children:[S.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:e("agents.title")}),S.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:e("agents.orderHint")})]}),S.jsxs("div",{className:`
101
- flex min-h-0 flex-1 flex-col gap-3 p-1
102
- max-md:pb-2
103
- md:overflow-y-auto
104
- `,children:[g.isLoading&&S.jsx(QF,{}),!g.isLoading&&g.isError&&S.jsxs(La,{className:"items-start gap-3 p-4",children:[S.jsx("p",{className:"text-xs text-muted-foreground",children:e("agents.loadError")}),S.jsxs(Jt,{type:"button",variant:"outline",onClick:()=>{g.retry()},children:[S.jsx(GC,{}),S.jsx("span",{children:e("common.retry")})]})]}),!g.isLoading&&!g.isError&&g.agents.map(N=>S.jsx(ZU,{agent:N,instructionsById:h,isInstructionsLoading:p.isLoading,isPending:g.pendingAgentIds.has(N.id),isReapplying:g.reapplyingAgentIds.has(N.id),onRemoveInstruction:M,onToggle:(k,j)=>{g.setEnabled(k,j)},onReapply:k=>{g.reapply(k)},onOpenFile:k=>{g.openFile(k)}},N.id))]})]}),s&&S.jsx(DR,{onClose:()=>{u(!1)}}),b&&S.jsx(DR,{instruction:b,onClose:()=>{d(null)}})]}),Cy(x)&&S.jsx(bU,{dropAnimation:null,children:C&&S.jsxs("div",{style:{width:R},className:"flex items-center gap-2 bg-card px-3 py-2.5 text-xs",children:[S.jsx(ov,{className:"size-3.5 text-muted-foreground"}),S.jsx("span",{className:"truncate",children:C})]})})]})}function XF(e){if(Cy(e)||Dl(e))return e.instructionId}function QF(){return S.jsx(S.Fragment,{children:[0,1].map(e=>S.jsxs(La,{className:"gap-0 py-0",children:[S.jsxs("div",{className:"flex items-center gap-3 p-3",children:[S.jsx(co,{className:"size-8 rounded-md"}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx(co,{className:"h-4 w-24"}),S.jsx(co,{className:"mt-2 h-3 w-40"})]}),S.jsx(co,{className:"h-4 w-7 rounded-full"})]}),S.jsx("div",{className:"border-t border-border/60 p-3",children:S.jsx(co,{className:"h-20 w-full"})})]},e))})}const Bp="/api/settings";function ZF(e){return Xc({signal:e})}function JF(e){return Xc({method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function WF(){return Xc({method:"POST"},`${Bp}/config-folder/open`)}function e7(e){return Xc({signal:e},`${Bp}/skill-copy`)}function t7(e){return Xc({method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)},`${Bp}/skill-copy`)}async function Xc(e,n=Bp){const o=await fetch(n,e);if(!o.ok)throw new Error(await n7(o));return o.json()}async function n7(e){try{return(await e.json()).error?.message??`Request failed with status ${e.status}`}catch{return`Request failed with status ${e.status}`}}function ji({label:e,description:n,children:o,className:a,controlClassName:s}){return S.jsxs("div",{className:Ze(`
105
- flex flex-col items-start gap-3 p-4
106
- min-[680px]:min-h-16 min-[680px]:flex-row min-[680px]:items-center
107
- min-[680px]:justify-between min-[680px]:gap-8
108
- `,a),children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-sm font-medium",children:e}),n&&S.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n})]}),S.jsx("div",{className:Ze(`
109
- min-w-0
110
- max-[680px]:w-full
111
- min-[680px]:shrink-0
112
- `,s),children:o})]})}function r7({configFolder:e}){const{t:n}=sn(),o=v.useRef(null),a=Ao({mutationFn:async p=>{await navigator.clipboard.writeText(p)},onSuccess:()=>{_n.success(n("settings.configFolderCopied"))},onError:()=>{_n.error(n("settings.errors.copyConfigFolder"))}}),s=Ao({mutationFn:WF,onError:()=>{_n.error(n("settings.errors.openConfigFolder"))}}),u=a.isSuccess&&a.variables===e,c=!e||a.isPending||s.isPending,d=n(u?"settings.configFolderCopied":"settings.copyConfigFolder");return S.jsx(ji,{label:n("settings.configFolder"),controlClassName:"min-[680px]:shrink",children:S.jsxs("div",{className:`
113
- flex min-w-0 items-center justify-end gap-2
114
- max-[680px]:justify-start
115
- `,children:[e&&S.jsx("span",{className:`
116
- min-w-0 font-mono text-xs break-all text-muted-foreground
117
- select-text
118
- `,children:e}),S.jsx(Jt,{type:"button",variant:"ghost",size:"icon","aria-label":d,title:d,disabled:c,"aria-busy":a.isPending,onClick:()=>{!e||c||(o.current&&clearTimeout(o.current),a.mutate(e,{onSuccess:()=>{o.current=setTimeout(()=>a.reset(),2e3)}}))},children:u?S.jsx(cp,{}):S.jsx(IP,{})}),S.jsxs(Jt,{type:"button",variant:"outline",disabled:c,"aria-busy":s.isPending,onClick:()=>{c||s.mutate()},children:[s.isPending?S.jsx(Fl,{className:"animate-spin"}):S.jsx(zP,{}),S.jsx("span",{children:n("settings.openFolder")})]})]})})}function o7(e){if(!e)return null;for(const n of e.elements){const o=n.tagName;if(o==="BUTTON"||o==="INPUT"){const a=n;if(a.type==="submit")return a}}return null}const a7="data-checked",i7="data-unchecked";function VM(e){return{checked(n){return e.indeterminate?{}:n?{[a7]:""}:{[i7]:""}},...Yl}}const s7=v.createContext(void 0);function l7(){return v.useContext(s7)}const qM=v.createContext(void 0);function u7(){const e=v.useContext(qM);if(e===void 0)throw new Error(Rn(14));return e}const c7="data-parent",d7=v.forwardRef(function(n,o){const{checked:a,className:s,defaultChecked:u=!1,"aria-labelledby":c,disabled:d=!1,form:p,id:g,indeterminate:y=!1,inputRef:h,name:b,onCheckedChange:x,parent:w=!1,readOnly:C=!1,render:R,required:T=!1,uncheckedValue:O,value:M,nativeButton:A=!1,style:N,...k}=n,{clearErrors:j}=Fc(),{disabled:D,name:z,setDirty:F,setFilled:G,setTouched:J,state:Y,validationMode:U,validityData:H,validation:L}=qa(),$=PO(),{labelId:K,registerControlId:V,getDescriptionProps:X}=Cs(),ee=l7(),q=ee?.allValues===void 0?void 0:ee.parent,se=q!==void 0,I=D||$.disabled||ee?.disabled||d,B=z??b,W=M??B,re=Tr(),Re=ee?.registerControlId!==V,le=Kl({id:g||void 0,enabled:Re}),me=A?le:re;let ge={};se&&(w?ge=q.getParentProps():W!==void 0&&(ge=q.getChildProps(W)));const{checked:ce=a,indeterminate:Te=y,onCheckedChange:ve,...ke}=ge,Me=ee?.value,Le=v.useRef(null),Fe=Bc(I,Le),{getButtonProps:Oe,buttonRef:He}=ma({disabled:I,native:A}),be=ee?.validation??L,[Ue,Qe]=bs({controlled:W!==void 0&&Me!==void 0&&!w?Me.includes(W):ce,default:u,name:"Checkbox",state:"checked"}),it=se?!!ce:Ue,de=se&&Te||y;Vc(Le,re,Ue,void 0,!ee&&!I,b);const we=q?.registerChildId,Ke=v.useRef(null),De=be.registerInput,Ie=ee?W:void 0,yt=v.useCallback(We=>De(We,{controlRef:Le,value:Ie}),[De,Ie]),ut=Xr(h,Ke,w?void 0:yt),ht=Pv(c,K,Ke,!A,le,k["aria-label"]);_e(()=>{Ke.current&&(Ke.current.indeterminate=de),ee||G(Ue)},[Ue,de,ee,G]),ql(Ue,()=>{ee||(j(B),F(Ue!==H.initialValue),be.change(Ue))});const Ot=Lr({checked:Ue,disabled:I,form:p,name:w?void 0:B,id:A?void 0:le,required:T,ref:ut,style:B?Bh:Dc,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(We){if(We.nativeEvent.defaultPrevented)return;if(C){We.preventDefault();return}const xt=We.currentTarget.checked,$t=dt(_r,We.nativeEvent);if(x?.(xt,$t),!$t.isCanceled&&(ve?.(xt,$t),!$t.isCanceled&&(Qe(xt),W!==void 0&&ee!==void 0&&!w&&!se))){const ft=xt?[...ee.value,W]:ee.value.filter(vt=>vt!==W);ee.setValue(ft,$t)}},onClick(We){We.stopPropagation()},onFocus(){Le.current?.focus()}},M!==void 0?{value:(ee?Ue&&M:M)||""}:Gt,X,We=>be.getValidationProps(I,We));v.useEffect(()=>{if(!q||W===void 0)return;const We=q.disabledStatesRef.current;return We.set(W,I),()=>{We.delete(W)}},[q,I,W]);const Dt=v.useMemo(()=>({...Y,checked:it,disabled:I,readOnly:C,required:T,indeterminate:de}),[Y,it,I,C,T,de]),Wt=VM(Dt),rn=Mt("span",n,{state:Dt,ref:[He,Le,o],props:[{id:me,role:"checkbox","aria-checked":de?"mixed":it,"aria-readonly":C||void 0,"aria-required":T||void 0,"aria-labelledby":ht,[c7]:w?"":void 0,onFocus(){Fe(!0)},onBlur(){const We=Ke.current;We&&(J(!0),Fe(!1),U==="onBlur"&&be.commit(ee?Me:We.checked))},onKeyDown(We){if(We.key!=="Enter"||(We.preventBaseUIHandler(),We.defaultPrevented))return;const xt=Ke.current?.form??null,$t=We.currentTarget,ft=We.nativeEvent,vt=We.preventDefault,gt=ft.preventDefault;let kt=!1;We.preventDefault=()=>{kt=!0,vt.call(We)},ft.preventDefault=()=>{kt=!0,gt.call(ft)},gt.call(ft),wn($t).queueMicrotask(()=>{We.preventDefault=vt,ft.preventDefault=gt,kt||o7(xt)?.click()})},onClick(We){if(C||I)return;We.preventDefault();const xt=Ke.current;xt&&hs(xt,We)}},k,ke,Oe,X,We=>be.getValidationProps(I,We)],stateAttributesMapping:Wt}),en=rn.props.id;return _e(()=>{if(!(!we||w||W===void 0||en===void 0))return we(W,en)},[we,w,W,en]),S.jsxs(qM.Provider,{value:Dt,children:[rn,!Ue&&!ee&&B&&!w&&O!==void 0&&S.jsx("input",{type:"hidden",form:p,name:B,value:O,disabled:I}),S.jsx("input",{...Ot,suppressHydrationWarning:!0})]})}),f7=v.forwardRef(function(n,o){const{render:a,className:s,style:u,keepMounted:c=!1,...d}=n,p=u7(),g=p.checked||p.indeterminate,{mounted:y,transitionStatus:h,setMounted:b}=ws(g),x=v.useRef(null),w={...p,transitionStatus:h};jo({batch:!0,enabled:!g,open:g,ref:x,onComplete(){g||b(!1)}});const R={...VM(p),...pa},T=c||y,O=Mt("span",n,{ref:[o,x],state:w,stateAttributesMapping:R,props:d});return T?O:null});function h7({className:e,...n}){return S.jsx(d7,{"data-slot":"checkbox",className:Ze("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",e),...n,children:S.jsx(f7,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:S.jsx(cp,{})})})}function p7({onClose:e}){const{t:n}=sn(),o=v.useId(),[a,s]=v.useState(["agents"]),u=dp({queryKey:["skill-targets"],queryFn:({signal:d})=>e7(d),retry:!1}),c=Ao({mutationFn:t7,onSuccess:()=>{_n.success(n("settings.skillDownloaded")),e()},onError:()=>_n.error(n("settings.errors.downloadSkill"))});return S.jsx(zp,{open:!0,onOpenChange:d=>{!d&&!c.isPending&&e()},children:S.jsxs(_p,{showCloseButton:!1,children:[S.jsxs("form",{className:"flex flex-col gap-4","aria-busy":c.isPending,onSubmit:d=>{d.preventDefault(),a.length>0&&u.isSuccess&&!c.isPending&&c.mutate({targets:a})},children:[S.jsxs(Hp,{children:[S.jsx(Fp,{children:n("settings.downloadSkill")}),S.jsx(Xv,{children:n("settings.downloadSkillDescription")})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(_l,{id:o,children:n("settings.skillTargets")}),u.isPending&&S.jsxs("div",{className:"space-y-2",children:[S.jsx(co,{className:"h-12 w-full"}),S.jsx(co,{className:"h-12 w-full"})]}),u.isError&&S.jsx(Jt,{type:"button",variant:"outline",disabled:u.isFetching,onClick:()=>{u.refetch()},children:n("common.retry")}),u.data&&S.jsx("div",{role:"group","aria-labelledby":o,"aria-required":"true",className:"flex flex-col gap-2",children:u.data.targets.map(({target:d,destination:p})=>S.jsxs(FM,{className:"flex items-start gap-3 rounded-lg border p-3",children:[S.jsx(h7,{checked:a.includes(d),disabled:c.isPending,onCheckedChange:g=>{s(y=>g?[...y,d]:y.filter(h=>h!==d))}}),S.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[S.jsx("span",{children:d==="agents"?".agents":".claude"}),S.jsx("span",{className:`
119
- font-mono text-xs font-normal break-all
120
- text-muted-foreground
121
- `,children:p})]})]},d))})]}),S.jsxs(Up,{children:[S.jsx(Jt,{type:"button",variant:"ghost",disabled:c.isPending,onClick:e,children:n("common.cancel")}),S.jsxs(Jt,{type:"submit",disabled:a.length===0||!u.isSuccess||c.isPending,children:[c.isPending?S.jsx(Fl,{className:"animate-spin"}):S.jsx(SC,{}),S.jsx("span",{children:n(c.isPending?"settings.downloadingSkill":"settings.downloadSkill")})]})]})]}),S.jsxs($v,{disabled:c.isPending,render:S.jsx(Jt,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[S.jsx(Rs,{}),S.jsx("span",{className:"sr-only",children:n("a11y.close")})]})]})})}function g7({disabled:e=!1}){const{t:n}=sn(),[o,a]=v.useState(!1);return S.jsxs(ji,{label:S.jsxs("span",{className:"flex items-center gap-1",children:[n("settings.downloadSkill"),S.jsxs(mh,{children:[S.jsx(yh,{render:S.jsx(Jt,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground","aria-label":n("settings.aboutFoundrySkill")}),children:S.jsx(NP,{})}),S.jsx(vh,{children:n("settings.foundrySkillHint")})]})]}),children:[S.jsxs(Jt,{type:"button",variant:"outline",disabled:e,onClick:()=>a(!0),children:[S.jsx(SC,{}),n("settings.downloadSkill")]}),o&&S.jsx(p7,{onClose:()=>a(!1)})]})}function m7({className:e,...n}){return S.jsx("div",{"data-slot":"input-group",role:"group",className:Ze("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...n})}const y7=Cp("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function v7({className:e,align:n="inline-start",...o}){return S.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":n,className:Ze(y7({align:n}),e),onClick:a=>{a.target.closest("button")||a.currentTarget.parentElement?.querySelector("input")?.focus()},...o})}const b7=Cp("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function x7({className:e,type:n="button",variant:o="ghost",size:a="xs",...s}){return S.jsx(Jt,{type:n,"data-size":a,variant:o,className:Ze(b7({size:a}),e),...s})}function S7({className:e,...n}){return S.jsx(kO,{"data-slot":"input-group-control",className:Ze("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",e),...n})}function Ty({id:e,disabled:n,...o}){const{t:a}=sn(),s=v.useId(),u=e??s,[c,d]=v.useState(!1),p=a(c?"a11y.hidePassword":"a11y.showPassword");return S.jsxs(m7,{"data-disabled":n,children:[S.jsx(S7,{...o,id:u,type:c?"text":"password",disabled:n}),S.jsx(v7,{align:"inline-end",children:S.jsx(x7,{type:"button",size:"icon-xs","aria-label":p,"aria-controls":u,title:p,disabled:n,onClick:()=>d(g=>!g),children:c?S.jsx(PP,{}):S.jsx(kP,{})})})]})}function w7(e,n){const o=URL.createObjectURL(e),a=document.createElement("a");a.href=o,a.download=n,document.body.append(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(o),1e3)}async function R7(e){const n=await fetch("/api/data-export",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error("Unable to export data");const o=n.headers.get("content-disposition")??"",a=/filename="([^"]+)"/u.exec(o)?.[1]??"foundry.foundry-backup";w7(await n.blob(),a)}function E7({onClose:e}){const{t:n}=sn(),o=v.useId(),a=v.useId(),[s,u]=v.useState(""),[c,d]=v.useState(""),p=Ao({mutationFn:R7,onSuccess:()=>{_n.success(n("dataExport.exported")),e()},onError:()=>{_n.error(n("dataExport.error"))}});return S.jsx(zp,{open:!0,onOpenChange:g=>{!g&&!p.isPending&&e()},children:S.jsxs(_p,{showCloseButton:!1,children:[S.jsxs("form",{className:"flex flex-col gap-4","aria-busy":p.isPending,onSubmit:g=>{if(g.preventDefault(),!(!s||!c||p.isPending)){if(s!==c){_n.error(n("dataExport.passphraseMismatch"));return}p.mutate({passphrase:s})}},children:[S.jsxs(Hp,{children:[S.jsx(Fp,{children:n("dataExport.title")}),S.jsx(Xv,{children:n("dataExport.description")})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(_l,{htmlFor:o,children:n("dataExport.passphrase")}),S.jsx(Ty,{id:o,autoComplete:"new-password",required:!0,value:s,disabled:p.isPending,onChange:g=>u(g.target.value)})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(_l,{htmlFor:a,children:n("dataExport.confirmPassphrase")}),S.jsx(Ty,{id:a,autoComplete:"new-password",required:!0,value:c,disabled:p.isPending,"aria-invalid":c.length>0&&s!==c,onChange:g=>d(g.target.value)})]}),S.jsxs("p",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[S.jsx(BP,{className:"size-4 shrink-0"}),S.jsx("span",{children:n("dataExport.passphraseHint")})]}),S.jsxs(Up,{children:[S.jsx(Jt,{type:"button",variant:"ghost",disabled:p.isPending,onClick:e,children:n("common.cancel")}),S.jsxs(Jt,{type:"submit",disabled:!s||!c||p.isPending,children:[p.isPending?S.jsx(Fl,{className:"animate-spin"}):S.jsx(MC,{}),S.jsx("span",{children:n(p.isPending?"dataExport.exporting":"dataExport.action")})]})]})]}),S.jsxs($v,{disabled:p.isPending,render:S.jsx(Jt,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[S.jsx(Rs,{}),S.jsx("span",{className:"sr-only",children:n("a11y.close")})]})]})})}function C7({disabled:e=!1}){const{t:n}=sn(),[o,a]=v.useState(!1);return S.jsxs(ji,{label:n("settings.export"),children:[S.jsxs(Jt,{type:"button",variant:"outline",disabled:e,onClick:()=>a(!0),children:[S.jsx(MC,{}),n("settings.export")]}),o&&S.jsx(E7,{onClose:()=>a(!1)})]})}class YM extends Error{constructor(n){super(n),this.code=n}code}async function T7(e,n){const o=await fetch("/api/data-import",{method:"POST",headers:{"content-type":"application/octet-stream","x-foundry-passphrase":encodeURIComponent(n)},body:e});await O7(o)}async function O7(e){if(e.ok)return;let n="IMPORT_FAILED";try{const a=(await e.json()).error?.code;(a==="INVALID_BACKUP"||a==="INVALID_PASSPHRASE")&&(n=a)}catch{}throw new YM(n)}function M7({file:e,onClose:n}){const{t:o}=sn(),a=v.useId(),[s,u]=v.useState(""),c=Ao({mutationFn:()=>T7(e,s),onSuccess:()=>{location.replace(`${location.pathname}${location.search}`)},onError:g=>_n.error(o(A7(g)))}),d=c.isPending||c.isSuccess,p=()=>{d||n()};return S.jsx(zp,{open:!0,onOpenChange:g=>{g||p()},children:S.jsxs(_p,{showCloseButton:!1,children:[S.jsxs("form",{className:"flex flex-col gap-4","aria-busy":d,onSubmit:g=>{g.preventDefault(),!d&&s&&c.mutate()},children:[S.jsxs(Hp,{children:[S.jsx(Fp,{children:o("dataImport.title")}),S.jsx(Xv,{className:"break-all",children:e.name})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(_l,{htmlFor:a,children:o("dataImport.passphrase")}),S.jsx(Ty,{id:a,autoComplete:"current-password",required:!0,value:s,disabled:d,onChange:g=>u(g.target.value)})]}),S.jsx("p",{className:"text-xs text-muted-foreground",children:o("dataImport.replaceWarning")}),S.jsxs(Up,{children:[S.jsx(Jt,{type:"button",variant:"ghost",disabled:d,onClick:p,children:o("common.cancel")}),S.jsxs(Jt,{type:"submit",variant:"destructive",disabled:d||!s,children:[d?S.jsx(Fl,{className:"animate-spin"}):S.jsx(TC,{}),S.jsx("span",{children:o("dataImport.replaceAction")})]})]})]}),S.jsxs(Jt,{type:"button",disabled:d,onClick:p,variant:"ghost",size:"icon",className:"absolute top-2 right-2",children:[S.jsx(Rs,{}),S.jsx("span",{className:"sr-only",children:o("a11y.close")})]})]})})}function A7(e){if(e instanceof YM)switch(e.code){case"INVALID_BACKUP":return"dataImport.invalidBackup";case"INVALID_PASSPHRASE":return"dataImport.invalidPassphrase"}return"dataImport.error"}function D7({disabled:e=!1}){const{t:n}=sn(),o=v.useRef(null),[a,s]=v.useState(null);return S.jsxs(ji,{label:n("settings.import"),children:[S.jsx("input",{ref:o,type:"file",accept:".foundry-backup,application/octet-stream",hidden:!0,onChange:u=>{s(u.target.files?.[0]??null),u.target.value=""}}),S.jsxs(Jt,{type:"button",variant:"outline",disabled:e,onClick:()=>o.current?.click(),children:[S.jsx(TC,{}),n("settings.import")]}),a&&S.jsx(M7,{file:a,onClose:()=>s(null)})]})}const N7="data-checked",I7="data-unchecked",Oy={checked(e){return e?{[N7]:""}:{[I7]:""}},...pa,...Yl},Qv="data-composite-item-active",KM=v.createContext(void 0);function j7(){return v.useContext(KM)}const GM=v.createContext(void 0);function P7(){const e=v.useContext(GM);if(e===void 0)throw new Error(Rn(52));return e}const k7=v.forwardRef(function(n,o){const{render:a,className:s,disabled:u=!1,readOnly:c=!1,required:d=!1,"aria-labelledby":p,value:g,inputRef:y,nativeButton:h=!1,id:b,style:x,...w}=n,C=j7(),{disabled:R,readOnly:T,required:O,form:M,checkedValue:A,touched:N=!1,validation:k,name:j,setCheckedValue:D=Sn,setTouched:z=Sn,registerInputRef:F=Sn}=C??{},{setTouched:G,setFilled:J,state:Y,disabled:U}=qa(),H=PO(),{labelId:L,getDescriptionProps:$}=Cs(),K=U||H.disabled||R||u,V=T||c,X=O||d,ee=M,q=C?A===g:g==="",se=v.useRef(null),I=Bc(K,se),B=v.useRef(null),W=k?.registerInput,re=v.useCallback(Qe=>W?.(Qe,{controlRef:se,value:void 0}),[W]),Re=Xr(y,B,F,re);_e(()=>{B.current?.checked&&J(!0)},[J]),_e(()=>{if(B.current){if(K&&q){F(null);return}F(B.current)}},[q,K,F]);const le=Tr(),me=Kl({id:b}),ge=h?void 0:me,ce=Pv(p,L,B,!h,ge,w["aria-label"]),Te={role:"radio","aria-checked":q,"aria-labelledby":ce,[Qv]:q?"":void 0,id:h?me:le,onKeyDown(Qe){Qe.key==="Enter"&&Qe.preventDefault()},onClick(Qe){if(Qe.defaultPrevented||K||V)return;Qe.preventDefault();const it=B.current;it&&hs(it,Qe)},onFocus(Qe){I(!0),!(Qe.defaultPrevented||K||V||!N)&&(B.current?.click(),z(!1))},onBlur(){C||I(!1)}},{getButtonProps:ve,buttonRef:ke}=ma({disabled:K,native:h,composite:!1}),Me={type:"radio",ref:Re,form:ee,id:ge,name:j,tabIndex:-1,style:j?Bh:Dc,"aria-hidden":!0,...g!==void 0?{value:Sh(g)}:Gt,disabled:K,checked:q,required:X,readOnly:V,onChange(Qe){if(Qe.nativeEvent.defaultPrevented||K||V||g===void 0)return;const it=dt(_r,Qe.nativeEvent);D(g,it),!it.isCanceled&&G(!0)},onClick(Qe){Qe.stopPropagation()},onFocus(){se.current?.focus()}},Le=v.useMemo(()=>({...Y,required:X,disabled:K,readOnly:V,checked:q}),[Y,K,V,q,X]),Fe=Le,Oe=C!==void 0,He=[o,se,ke],be=[Te,w,ve,$,k?Qe=>k.getValidationProps(K,Qe):Gt],Ue=Mt("span",n,{enabled:!Oe,state:Le,ref:He,props:be,stateAttributesMapping:Oy});return S.jsxs(GM.Provider,{value:Fe,children:[Oe?S.jsx(EO,{tag:"span",render:a,className:s,style:x,state:Le,refs:He,props:be,stateAttributesMapping:Oy}):Ue,S.jsx("input",{...Me,suppressHydrationWarning:!0})]})}),L7=v.forwardRef(function(n,o){const{render:a,className:s,style:u,keepMounted:c=!1,...d}=n,p=P7(),g=p.checked,{mounted:y,transitionStatus:h,setMounted:b}=ws(g),x={...p,transitionStatus:h},w=v.useRef(null),C=c||y,R=Mt("span",n,{ref:[o,w],state:x,props:d,stateAttributesMapping:Oy});return jo({batch:!0,enabled:!g,open:g,ref:w,onComplete(){g||b(!1)}}),C?R:null});function z7(e){const{loopFocus:n=!0,orientation:o="both",grid:a,onLoop:s,direction:u,highlightedIndex:c,onHighlightedIndexChange:d,rootRef:p,enableHomeAndEndKeys:g=!1,stopEventPropagation:y,disabledIndices:h,modifierKeys:b=fa}=e,[x,w]=v.useState(0),C=a!=null,R=v.useRef(null),T=Xr(R,p),O=v.useRef([]),M=v.useRef(!1),A=v.useRef(null),N=c??x,k=Be((G,J=!1)=>{if(A.current=O.current[G]??null,(d??w)(G),J){const Y=O.current[G];Vw(R.current,Y,u,o)}}),j=Be(G=>{if(G.size===0)return;if(M.current){const H=O.current,L=H.indexOf(A.current);if(L===-1){const $=H[N];!$||Rl(H,N,h)?k(_7(H,h)):A.current=$}else L!==N&&k(L);return}M.current=!0;const J=Array.from(G.keys()),Y=J.find(H=>H?.hasAttribute(Qv))??null,U=Y?G.get(Y)?.index??-1:-1;if(U!==-1)k(U);else if(Rl(J,N,h)){const H=wl(J,{disabledIndices:h});Sl(J,H)||k(H)}Vw(R.current,Y,u,o)});_e(()=>{if(h==null||c!=null||!M.current)return;const G=O.current;if(Rl(G,N,h)){const J=wl(G,{disabledIndices:h});Sl(G,J)||k(J)}},[h,c,N,O,k]);const D=Be((G,J,Y)=>s?s(G,J,Y,O):Y),z=Be(G=>{const J=G.key===my||G.key===yy;if(!Uc.has(G.key)||!g&&J||H7(G,b)||!R.current)return;const U=u==="rtl",H=U?py:gy,L=U?gy:py,$=o==="vertical"?hy:H,K=o==="vertical"?fy:L,V=tr(G.nativeEvent);if(V!=null&&Bw(V)&&!CO(V)){const B=V.selectionStart,W=V.selectionEnd,re=V.value;if(B==null||G.shiftKey||B!==W||G.key!==K&&B<re.length||G.key!==$&&B>0)return}let X=N;const ee=Bf(O,h),q=Z0(O,h);a!=null&&(X=a({disabledIndices:h,elementsRef:O,event:G,highlightedIndex:N,loopFocus:n,maxIndex:q,minIndex:ee,onLoop:D,orientation:o,rtl:U}));const se=o!=="vertical"&&G.key===H||o!=="horizontal"&&G.key===hy,I=o!=="vertical"&&G.key===L||o!=="horizontal"&&G.key===fy;g&&(G.key===my?X=ee:G.key===yy&&(X=q)),X===N&&(se||I)&&(n&&X===q&&se?(X=ee,s&&(X=s(G,N,X,O))):n&&X===ee&&I?(X=q,s&&(X=s(G,N,X,O))):X=wl(O.current,{startingIndex:X,decrement:I,disabledIndices:h})),X!==N&&!Sl(O.current,X)&&(y&&G.stopPropagation(),(C||J||se||I)&&G.preventDefault(),k(X,!0),queueMicrotask(()=>{O.current[X]?.focus()}))});return{props:{ref:T,onFocus(G){const J=R.current,Y=tr(G.nativeEvent);!J||Y==null||!Bw(Y)||Y.setSelectionRange(0,Y.value.length)},onKeyDown:z},highlightedIndex:N,onHighlightedIndexChange:k,elementsRef:O,onMapChange:j,relayKeyboardEvent:z}}function _7(e,n){let o=-1;for(let a=0;a<e.length;a+=1){const s=e[a];if(!(!s||Rl(e,a,n))){if(s.hasAttribute(Qv))return a;o===-1&&(o=a)}}return Math.max(o,0)}function H7(e,n){for(const o of Xz)if(!n.includes(o)&&e.getModifierState(o))return!0;return!1}function U7(e){const{render:n,className:o,style:a,refs:s=fa,props:u=fa,state:c=Gt,stateAttributesMapping:d,highlightedIndex:p,onHighlightedIndexChange:g,orientation:y,grid:h,loopFocus:b,onLoop:x,enableHomeAndEndKeys:w,onMapChange:C,stopEventPropagation:R=!0,rootRef:T,disabledIndices:O,modifierKeys:M,highlightItemOnHover:A=!1,tag:N="div",...k}=e,j=ap(),{props:D,highlightedIndex:z,onHighlightedIndexChange:F,elementsRef:G,onMapChange:J,relayKeyboardEvent:Y}=z7({grid:h,loopFocus:b,onLoop:x,orientation:y,highlightedIndex:p,onHighlightedIndexChange:g,rootRef:T,stopEventPropagation:R,enableHomeAndEndKeys:w,direction:j,disabledIndices:O,modifierKeys:M}),U=Mt(N,e,{state:c,ref:s,props:[D,...u,k],stateAttributesMapping:d}),H=v.useMemo(()=>({highlightedIndex:z,onHighlightedIndexChange:F,highlightItemOnHover:A,relayKeyboardEvent:Y}),[z,F,A,Y]);return S.jsx(WT.Provider,{value:H,children:S.jsx(Mv,{elementsRef:G,onMapChange:L=>{C?.(L),J(L)},children:U})})}const F7=[uO],B7=v.forwardRef(function(n,o){const{render:a,className:s,disabled:u,readOnly:c,required:d,onValueChange:p,value:g,defaultValue:y,form:h,name:b,inputRef:x,id:w,style:C,...R}=n,{setTouched:T,setFocused:O,validationMode:M,name:A,disabled:N,state:k,validation:j,setDirty:D,setFilled:z,validityData:F}=qa(),{labelId:G}=Cs(),{clearErrors:J,elementRef:Y}=Fc(),U=s6(!0),H=N||u,L=A??b,$=Tr(w),[K,V]=bs({controlled:g,default:y,name:"RadioGroup",state:"value"}),[X,ee]=v.useState(!1),q=Be((Me,Le)=>{p?.(Me,Le),!Le.isCanceled&&V(Me)}),se=j.getInputControl,I=v.useMemo(()=>({get current(){return se()}}),[se]),B=v.useRef(null),W=v.useRef(null),re=Xr(B,x),Re=v.useRef(re),le=Be(Me=>{B.current===Me&&Re.current===re||(Re.current=re,re?.(Me))});_e(()=>{le(B.current)},[re,le]);const me=Be(Me=>{if(Me){if(!Me.disabled){W.current||(W.current=Me);const Le=B.current;(Me.checked||Le==null||Le.disabled)&&le(Me)}return()=>{W.current===Me&&(W.current=null),B.current===Me&&le(null)}}}),ge=Be(()=>{const Me=Y.current;if(!Me)return K??null;for(const Le of j.registeredInputs.keys())if(Le.checked&&f6(Le,Me))return K??null;return null});Vc(I,$,K??null,ge,!H,b),ql(K,()=>{J(L),D(K!==F.initialValue),z(K!=null),j.change(K);const Me=W.current;K==null&&Me&&!Me.disabled&&le(Me)});const ce=G??U?.legendId,Te={...k,disabled:H??!1,required:d??!1,readOnly:c??!1},ve=v.useMemo(()=>({checkedValue:K,disabled:H,form:h,validation:j,name:L,readOnly:c,registerInputRef:me,required:d,setCheckedValue:q,setTouched:ee,touched:X}),[K,H,h,j,L,c,me,d,q,ee,X]),ke={id:w,role:"radiogroup","aria-required":d||void 0,"aria-disabled":H||void 0,"aria-readonly":c||void 0,"aria-labelledby":ce,onBlur(Me){ot(Me.currentTarget,Me.relatedTarget)||(ee(!1),T(!0),O(!1),M==="onBlur"&&j.commit(K))},onKeyDownCapture(Me){Me.key.startsWith("Arrow")&&ee(!0)}};return S.jsx(KM.Provider,{value:ve,children:S.jsx(U7,{render:a,className:s,style:C,state:Te,props:[ke,R,Me=>j.getValidationProps(H??!1,Me)],refs:[o],stateAttributesMapping:Yl,enableHomeAndEndKeys:!1,modifierKeys:F7})})});function V7({className:e,...n}){return S.jsx(B7,{"data-slot":"radio-group",className:Ze("grid w-full gap-3",e),...n})}function q7({className:e,...n}){return S.jsx(k7,{"data-slot":"radio-group-item",className:Ze("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-focus-visible/field-label:ring-0 group-has-focus-visible/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:data-checked:bg-primary",e),...n,children:S.jsx(L7,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:S.jsx("span",{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground"})})})}const Y7=[{value:"system",labelKey:"common.system"},{value:"light",labelKey:"theme.light"},{value:"dark",labelKey:"theme.dark"}];function K7({value:e,onValueChange:n,disabled:o=!1}){const{t:a}=sn();return S.jsx(ji,{label:a("settings.colorTheme"),children:S.jsx(V7,{"aria-label":a("settings.colorTheme"),value:e,onValueChange:n,disabled:o,"aria-busy":o,className:"flex w-auto flex-row flex-wrap items-center gap-x-6 gap-y-2",children:Y7.map(s=>S.jsxs("label",{className:Ze("flex items-center gap-2 text-sm select-none",s.value===e?"font-medium text-foreground":"text-muted-foreground",o?"cursor-not-allowed opacity-60":"cursor-pointer"),children:[S.jsx(q7,{value:s.value,disabled:o}),S.jsx("span",{children:a(s.labelKey)})]},s.value))})})}function G7(e){const n=v.useRef(!0);n.current&&(n.current=!1,e())}const $M=v.createContext(void 0),XM=v.createContext(void 0);function ya(){const e=v.useContext($M);if(e===void 0)throw new Error(Rn(60));return e}function QM(){const e=v.useContext(XM);if(e===void 0)throw new Error(Rn(61));return e}function $7(e,n,o=Object.is){const{length:a}=e;if(a!==n.length)return!1;for(let s=0;s<a;s+=1)if(!o(e[s],n[s]))return!1;return!0}const ZM=(e,n)=>Object.is(e,n);function Ss(e,n,o){return e==null||n==null?Object.is(e,n):o(e,n)}function X7(e,n,o){return Array.isArray(e)&&Array.isArray(n)?!$7(e,n,(a,s)=>Ss(a,s,o)):e!==n}function My(e,n,o){return e?e.some(a=>a===void 0?!1:Ss(n,a,o)):!1}function th(e,n,o){return e?e.findIndex(a=>a===void 0?!1:Ss(a,n,o)):-1}function Q7(e,n){if(n!==ZM)return a=>My(e,a,n);const o=new Set(e);return o.delete(void 0),a=>o.has(a)&&(a!==0||e.some(s=>Object.is(a,s)))}function JM(e,n,o,a){const s=a&&Array.isArray(n)?e.findIndex(Q7(n,o)):th(e,n,o);return s===-1?null:s}function Z7(e,n,o,a,s,u){return My(a,n,s)?u!=null&&e>u&&My(a,o[u],s)?u:e:e===u?JM(o,a,s,!0):u}function J7(e,n,o){return e.filter(a=>!Ss(n,a,o))}const W7={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{const{value:n,multiple:o,itemToStringValue:a}=e;return n==null?!1:o&&Array.isArray(n)?n.length>0:vl(n,a)!==""},hasNullItemLabel:(e,n)=>n?Y_(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,n)=>e.activeIndex===n,isSelected:(e,n)=>{const o=e.isItemEqualToValue,a=e.value;return e.multiple?Array.isArray(a)&&a.some(s=>Ss(n,s,o)):Ss(n,a,o)},isSelectedByFocus:(e,n)=>e.selectedIndex===n,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function tc(e,n=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER){return Math.max(n,Math.min(e,o))}const Vo=1;function Zv(e,n){return Math.max(0,e-n)}function Nh(e,n){if(n<=0)return 0;const o=tc(e,0,n),a=o,s=n-o,u=a<=Vo,c=s<=Vo;return u&&c?a<=s?0:n:u?0:c?n:o}function eB(e){const{id:n,value:o,defaultValue:a=null,onValueChange:s,open:u,defaultOpen:c=!1,onOpenChange:d,name:p,form:g,autoComplete:y,disabled:h=!1,readOnly:b=!1,required:x=!1,modal:w=!0,actionsRef:C,inputRef:R,onOpenChangeComplete:T,items:O,multiple:M=!1,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:k=ZM,highlightItemOnHover:j=!0,children:D}=e,{clearErrors:z}=Fc(),{setDirty:F,setTouched:G,setFocused:J,validityData:Y,setFilled:U,name:H,disabled:L,validation:$,validationMode:K}=qa(),V=Kl({id:n}),X=L||h,ee=H??p,[q,se]=bs({controlled:o,default:M?a??fa:a,name:"Select",state:"value"}),[I,B]=bs({controlled:u,default:c,name:"Select",state:"open"}),W=v.useRef([]),re=v.useRef([]),Re=v.useRef(null),le=v.useRef(null),me=v.useRef(0),ge=v.useRef(null),ce=v.useRef([]),Te=v.useRef(!1),ve=v.useRef(null),ke=v.useRef(null),Me=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Le=v.useRef(!1),Fe=v.useRef(q),{openMethod:Oe,triggerProps:He}=xO(I),be=er(()=>new Ul({id:V,labelId:void 0,modal:w,multiple:M,disabled:X,readOnly:b,required:x,highlightItemOnHover:j,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:k,value:q,open:I,mounted:I,transitionStatus:void 0,items:O,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Gt,triggerProps:Gt,itemRoot:{props:Gt,multiple:M,disabled:X,readOnly:b,isItemEqualToValue:k},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:Sn,setOpen:Sn,handleScrollArrowVisibility:Sn,onOpenChangeComplete:Sn,listRef:W,popupRef:Re,scrollHandlerRef:le,scrollArrowsMountedCountRef:me,valueRef:ge,valuesRef:ce,labelsRef:re,typingRef:Te,selectionRef:Me,firstItemTextRef:ve,selectedItemTextRef:ke,alignItemWithTriggerActiveRef:Le,initialValueRef:Fe},W7)).current,[Ue,Qe]=v.useState(!1),{mounted:it,transitionStatus:de,forceUnmount:we}=NE({open:I,ref:Re,preventUnmountOnClose:Ue,setPreventUnmountOnClose:Qe,onUnmount(){be.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),T?.(!1)}}),Ke=be.useState("activeIndex"),De=be.useState("selectedIndex"),Ie=be.useState("triggerElement"),yt=be.useState("positionerElement"),ut=sj(Oe),ht=Oe??ut,Ot=v.useMemo(()=>M?"":vl(q,N),[M,q,N]),Dt=v.useMemo(()=>M&&Array.isArray(q)?q.map(_=>vl(_,N)):vl(q,N),[M,q,N]),Wt=kn(Ie),rn=Be(()=>Dt);Vc(Wt,V,q,rn,!X,p);const en=M?Array.isArray(q)&&q.length>0:q!=null&&Ot!=="";_e(()=>{U(en)},[en,U]),_e(function(){const Z=JM(ce.current,q,k,M);Z===null&&(ke.current=null),!I&&be.set("selectedIndex",Z)},[M,I,q,k,be]),ql(q,()=>{z(ee),F(X7(q,Y.initialValue,k)),$.change(q)});const We=Be((_,Z)=>{const ne=Z,ye=Zh(ne);d?.(_,ne),!Z.isCanceled&&(_||Qe(ye()),B(_),!_&&(Z.reason===Ti||Z.reason===Fh)&&(G(!0),J(!1),K==="onBlur"&&$.commit(q)))});v.useImperativeHandle(C,()=>({unmount:we,close:()=>{be.state.open&&We(!1,dt(Ac))}}),[we,We,be]);const xt=Be((_,Z)=>{s?.(_,Z),!Z.isCanceled&&se(_)}),$t=Be(_=>{const Z=Zv(_.scrollHeight,_.clientHeight),ne=Nh(_.scrollTop,Z),ye=ne>0,xe=ne<Z;be.set("scrollUpArrowVisible",ye),be.set("scrollDownArrowVisible",xe)}),ft=V3({open:I,onOpenChange:We,elements:{reference:Ie,floating:yt}}),vt=AE(ft,{enabled:!X,event:"mousedown"}),gt=Nc(ft),kt=VE(ft,{enabled:!X,listRef:W,activeIndex:Ke,selectedIndex:De,disabledIndices:fa,onNavigate(_){_===null&&!I||be.set("activeIndex",_)},focusItemOnHover:j}),un=qE(ft,{enabled:!X&&(I||!b&&!M),listRef:re,activeIndex:Ke,selectedIndex:De,disabledIndices:_=>CO(W.current[_]),onMatch(_){I?be.set("activeIndex",_):xt(ce.current[_],dt(_r))},onTyping(_){Te.current=_}}),je=v.useMemo(()=>Lr(un.reference,kt.reference,gt.reference,vt.reference,He),[vt.reference,un.reference,kt.reference,gt.reference,He]),at=v.useMemo(()=>Lr(Ic,un.floating,kt.floating,gt.floating),[un.floating,kt.floating,gt.floating]),Pe=kt.item??Gt,ze=v.useMemo(()=>({props:Pe,multiple:M,disabled:X,readOnly:b,isItemEqualToValue:k}),[Pe,M,X,b,k]);be.useContextCallback("setValue",xt),be.useContextCallback("setOpen",We),be.useContextCallback("handleScrollArrowVisibility",$t),be.useContextCallback("onOpenChangeComplete",T),G7(()=>{be.update({popupProps:at,triggerProps:je,itemRoot:ze})}),be.useSyncedValues({id:V,modal:w,multiple:M,disabled:X,readOnly:b,required:x,highlightItemOnHover:j,value:q,open:I,mounted:it,transitionStatus:de,popupProps:at,triggerProps:je,itemRoot:ze,items:O,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:k,openMethod:ht});const Ge=Xr(R,$.inputRef),et=M?void 0:ee,Et=v.useMemo(()=>!M||!Array.isArray(q)||!ee?null:q.map(_=>{const Z=vl(_,N);return S.jsx("input",{type:"hidden",form:g,name:ee,value:Z,disabled:X},Z)}),[M,q,g,ee,N,X]);return S.jsxs($M.Provider,{value:be,children:[S.jsx(XM.Provider,{value:ft,children:D}),S.jsx("input",{...$.getValidationProps(X,{onFocus(){be.state.triggerElement?.focus({focusVisible:!0})},onChange(_){if(_.nativeEvent.defaultPrevented||X||b)return;const Z=_.currentTarget.value,ne=dt(_r,_.nativeEvent);function ye(){if(M)return;const xe=Z.toLowerCase();let qe=ce.current.findIndex(Xe=>vl(Xe,N).toLowerCase()===xe||OO(Xe,A).toLowerCase()===xe);qe===-1&&(qe=ce.current.findIndex((Xe,$e)=>{const st=re.current[$e];return st!=null&&st.toLowerCase()===xe}));const Ve=ce.current[qe];Ve!=null&&xt(Ve,ne)}be.set("forceMount",!0),queueMicrotask(ye)}}),id:V&&et==null?`${V}-hidden-input`:void 0,form:g,name:et,autoComplete:y,value:Ot,disabled:X,required:x&&!(M&&en),readOnly:b,ref:Ge,style:ee?Bh:Dc,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Et]})}function tB(e,n){return e??n}const nB="data-popup-side",rB=400,oB={...rh,...Yl,popupSide:e=>e?{[nB]:e}:null,value:()=>null},aB=v.forwardRef(function(n,o){const{render:a,className:s,id:u,disabled:c=!1,nativeButton:d=!0,style:p,...g}=n,{setTouched:y,validationMode:h,validation:b,state:x,disabled:w}=qa(),{labelId:C}=Cs(),R=ya(),T=R.useState("readOnly"),O=R.useState("required"),M=R.useState("disabled"),A=w||M||c,N=R.useState("open"),k=R.useState("mounted"),j=R.useState("value"),D=R.useState("triggerProps"),z=R.useState("positionerElement"),F=R.useState("listElement"),G=R.useState("popupSide"),J=R.useState("id"),Y=R.useState("labelId"),U=R.useState("hasSelectedValue"),H=k&&z?G:null,L=u??J,$=tB(C,Y);Kl({id:u});const K=kn(z),V=v.useRef(null),X=Bc(A,V),{getButtonProps:ee,buttonRef:q}=ma({disabled:A,native:d}),se=R.useStateSetter("triggerElement"),I=Hn(),B=Hn(),W=Hn();v.useEffect(()=>{if(N)return W.start(rB,()=>{R.context.selectionRef.current.allowUnselectedMouseUp=!0,R.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{W.clear()};R.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},B.clear()},[N,R,B,W]);const re=Lr(D,{id:L,role:"combobox","aria-expanded":N,"aria-haspopup":"listbox","aria-controls":N?F?.id??ah(z)?.id:void 0,"aria-labelledby":$,"aria-readonly":T||void 0,"aria-required":O||void 0,tabIndex:A?-1:0,onFocus(me){X(!0),N&&R.context.alignItemWithTriggerActiveRef.current&&R.context.setOpen(!1,dt(_r,me.nativeEvent)),I.start(0,()=>{R.set("forceMount",!0)})},onBlur(me){ot(z,me.relatedTarget)||(y(!0),X(!1),h==="onBlur"&&b.commit(j))},onMouseDown(me){if(N)return;const ge=Kt(me.currentTarget);function ce(Te){if(!V.current)return;const ve=Te.target;ot(V.current,ve)||ot(K.current,ve)||RO(Te,V.current)||R.context.setOpen(!1,dt(Uy,Te))}B.start(0,()=>{ge.addEventListener("mouseup",ce,{once:!0})})}},g,ee),Re=b.getValidationProps(A,re);Re.role="combobox";const le={...x,open:N,disabled:A,value:j,readOnly:T,popupSide:H,placeholder:!U};return Mt("button",n,{ref:[o,V,q,se],state:le,stateAttributesMapping:oB,props:Re})}),iB={value:()=>null},sB=v.forwardRef(function(n,o){const{className:a,render:s,children:u,placeholder:c,style:d,...p}=n,g=ya(),y=g.useState("value"),h=g.useState("items"),b=g.useState("itemToStringLabel"),x=g.useState("hasSelectedValue"),w=!x&&c!=null&&u==null,C=g.useState("hasNullItemLabel",w),R={value:y,placeholder:!x};let T=null;return typeof u=="function"?T=u(y):u!=null?T=u:w&&!C?T=c:Array.isArray(y)?T=K_(y,h,b):T=MO(y,h,b),Mt("span",n,{state:R,ref:[o,g.context.valueRef],props:[{children:T},p],stateAttributesMapping:iB})}),lB=v.forwardRef(function(n,o){const{render:a,className:s,style:u,...c}=n,g={open:ya().useState("open")};return Mt("span",n,{state:g,ref:o,props:[{"aria-hidden":!0,children:"▼"},c],stateAttributesMapping:YR})}),uB=v.forwardRef(function(n,o){const a=ya(),s=a.useState("mounted"),u=a.useState("forceMount");return s||u?S.jsx(Kh,{ref:o,...n}):null}),WM=v.createContext(void 0);function Jv(){const e=v.useContext(WM);if(!e)throw new Error(Rn(59));return e}function Ih(e,n){e&&Object.assign(e.style,n)}const eA={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},cB={position:"fixed"},dB=v.forwardRef(function(n,o){const{anchor:a,className:s,render:u,positionMethod:c,side:d,align:p,sideOffset:g,alignOffset:y,collisionBoundary:h="clipping-ancestors",collisionPadding:b,arrowPadding:x,sticky:w,disableAnchorTracking:C,alignItemWithTrigger:R=!0,collisionAvoidance:T=xE,style:O,...M}=n,A=ya(),N=QM(),k=A.useState("open"),j=A.useState("mounted"),D=A.useState("modal"),z=A.useState("value"),F=A.useState("openMethod"),G=A.useState("positionerElement"),J=A.useState("triggerElement"),Y=A.useState("isItemEqualToValue"),U=A.useState("transitionStatus"),H=v.useRef(null),L=v.useRef(null),[$,K]=v.useState(R),V=j&&$&&F!=="touch";!j&&$!==R&&K(R),v.useImperativeHandle(A.context.alignItemWithTriggerActiveRef,()=>V),Av((V||D)&&k,F==="touch",G,J);const X=ip({anchor:a,floatingRootContext:N,positionMethod:c,mounted:j,side:d,sideOffset:g,align:p,alignOffset:y,arrowPadding:x,collisionBoundary:h,collisionPadding:b,sticky:w,disableAnchorTracking:C??V,collisionAvoidance:T,keepMounted:!0}),ee=V?"none":X.side,q=V?cB:X.positionerStyles,se={open:k,side:ee,align:X.align,anchorHidden:X.anchorHidden};_e(()=>{A.set("popupSide",X.side)},[A,X.side]);const I=A.useStateSetter("positionerElement"),B=sp(n,se,{styles:q,transitionStatus:U,props:M,refs:[o,I],hidden:!j,inert:!k}),W=v.useRef(0),re=Be(le=>{if(A.context.valuesRef.current.length===0)return;const me=W.current;W.current=le.size;const ge=dt(_r);if(me!==0&&!A.state.multiple&&z!==null&&th(A.context.valuesRef.current,z,Y)===-1){const Te=A.context.initialValueRef.current,ke=Te!=null&&th(A.context.valuesRef.current,Te,Y)!==-1?Te:null;A.context.setValue(ke,ge),ke===null&&(A.set("selectedIndex",null),A.context.selectedItemTextRef.current=null)}if(me!==0&&A.state.multiple&&Array.isArray(z)){const ce=z.filter(Te=>th(A.context.valuesRef.current,Te,Y)!==-1);ce.length!==z.length&&(A.context.setValue(ce,ge),ce.length===0&&(A.set("selectedIndex",null),A.context.selectedItemTextRef.current=null))}if(k&&V){A.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ce={height:""};Ih(G,ce),Ih(A.context.popupRef.current,ce)}}),Re=v.useMemo(()=>({...X,side:ee,alignItemWithTriggerActive:V,setControlledAlignItemWithTrigger:K,scrollUpArrowRef:H,scrollDownArrowRef:L}),[X,ee,V,K]);return S.jsx(Mv,{elementsRef:A.context.listRef,labelsRef:A.context.labelsRef,onMapChange:re,children:S.jsxs(WM.Provider,{value:Re,children:[j&&D&&S.jsx(Rp,{inert:lp(!k),cutout:J}),B]})})}),Hf="base-ui-disable-scrollbar",Ay={className:Hf,getElement(e){return S.jsx("style",{nonce:e,href:Hf,precedence:"base-ui:low",children:`.${Hf}{scrollbar-width:none}.${Hf}::-webkit-scrollbar{display:none}`})}},fB=v.createContext(void 0),hB={disableStyleElements:!1};function pB(){return v.useContext(fB)??hB}const NR="--transform-origin",gB={...Tc,...pa},mB=v.forwardRef(function(n,o){const{render:a,className:s,style:u,finalFocus:c,...d}=n,p=ya(),g=p.useState("multiple"),y=p.useState("readOnly"),h=p.useState("highlightItemOnHover"),b=QM(),{side:x,align:w,alignItemWithTriggerActive:C,isPositioned:R,setControlledAlignItemWithTrigger:T}=Jv(),O=Ov()!=null,M=ap(),{nonce:A,disableStyleElements:N}=pB(),k=p.useState("id"),j=p.useState("open"),D=p.useState("openMethod"),z=p.useState("mounted"),F=p.useState("popupProps"),G=p.useState("transitionStatus"),J=p.useState("triggerElement"),Y=p.useState("positionerElement"),U=p.useState("listElement"),H=v.useRef(!1),L=v.useRef(!1),$=v.useRef({}),K=Il(),V=Be(se=>{if(!Y||!p.context.popupRef.current||!L.current)return;const I=Y.style.top==="0px",B=Y.style.bottom==="0px";if(H.current||!C||!I&&!B){p.context.handleScrollArrowVisibility(se);return}const W=jR(Y),re=nc(Y.getBoundingClientRect().height,"y",W),Re=Kt(Y),le=wn(Y),me=le.getComputedStyle(Y),ge=parseFloat(me.marginTop),ce=parseFloat(me.marginBottom),Te=IR(le.getComputedStyle(p.context.popupRef.current)),ve=Math.min(Re.documentElement.clientHeight-ge-ce,Te),ke=se.scrollTop,Me=Uf(se);let Le=null;const Fe=Ue=>{Y.style.height=`${Ue}px`},Oe=I?Me-ke:ke,He=Math.min(re+Oe,ve);if(Oe<=Vo){const Ue=tc(Oe,0,ve-re);Ue>0&&Fe(re+Ue),se.scrollTop=I?Me:0,ve-(re+Ue)<=Vo&&(H.current=!0),p.context.handleScrollArrowVisibility(se);return}if(ve-He>Vo)Le=I?1/0:0;else if(B&&ke<Me){const Ue=re+Oe-ve;Le=ke-(Oe-Ue)}const be=Math.ceil(He);if(be!==0&&Fe(be),Le!=null){const Ue=tc(Le,0,Uf(se));Math.abs(se.scrollTop-Ue)>Vo&&(se.scrollTop=Ue)}be>=ve-Vo&&(H.current=!0),p.context.handleScrollArrowVisibility(se)});v.useImperativeHandle(p.context.scrollHandlerRef,()=>V,[V]),jo({open:j,ref:p.context.popupRef,onComplete(){j&&p.context.onOpenChangeComplete(!0)}});const X={open:j,transitionStatus:G,side:x,align:w};_e(()=>{!Y||!p.context.popupRef.current||Object.keys($.current).length||($.current={top:Y.style.top||"0",left:Y.style.left||"0",right:Y.style.right,height:Y.style.height,bottom:Y.style.bottom,minHeight:Y.style.minHeight,maxHeight:Y.style.maxHeight,marginTop:Y.style.marginTop,marginBottom:Y.style.marginBottom})},[p,Y]),_e(()=>{j||C||(L.current=!1,H.current=!1,Ih(Y,$.current))},[j,C,Y]),_e(()=>{const se=p.context.popupRef.current;if(!j||!J||!Y||!se||C&&!R||p.state.transitionStatus==="ending")return;if(L.current=!0,se.style.removeProperty(NR),!C){K.request(()=>p.context.handleScrollArrowVisibility(U||se));return}const I=yB(se);try{let B=p.context.selectedItemTextRef.current;B?.isConnected||(B=!p.select("hasSelectedValue")&&p.context.firstItemTextRef.current?.isConnected?p.context.firstItemTextRef.current:null);const W=p.context.valueRef.current,re=wn(Y),Re=re.getComputedStyle(Y),le=re.getComputedStyle(se),me=Kt(J),ge=jR(J),ce=Ff(J.getBoundingClientRect(),ge),Te=Ff(Y.getBoundingClientRect(),ge),ve=ce.height,ke=U||se,Me=ke.scrollHeight,Le=parseFloat(le.borderBottomWidth),Fe=parseFloat(Re.marginTop)||10,Oe=parseFloat(Re.marginBottom)||10,He=parseFloat(Re.minHeight)||100,be=IR(le),Ue=5,Qe=5,it=20,de=me.documentElement.clientHeight-Fe-Oe,we=me.documentElement.clientWidth,Ke=de-ce.bottom+ve;let De,Ie=M==="rtl"?ce.right-Te.width:ce.left,yt=0;if(B&&W){const ft=Ff(W.getBoundingClientRect(),ge);De=Ff(B.getBoundingClientRect(),ge),Ie=Te.left+(M==="rtl"?ft.right-De.right:ft.left-De.left);const vt=ft.top-ce.top+ft.height/2;yt=De.top-Te.top+De.height/2-vt}const ut=Ke+yt+Oe+Le;let ht=Math.min(de,ut);const Ot=de-Fe-Oe,Dt=ut-ht,Wt=we-Qe;Y.style.left=`${tc(Ie,Ue,Wt-Te.width)}px`,Y.style.height=`${ht}px`,Y.style.maxHeight="none",Y.style.marginTop=`${Fe}px`,Y.style.marginBottom=`${Oe}px`,se.style.height="100%";const rn=Uf(ke),en=Dt>=rn-Vo;en&&(ht=Math.min(de,Te.height)-(Dt-rn));const We=ce.top<it||ce.bottom>de-it||Math.ceil(ht)+Vo<Math.min(Me,He),xt=(re.visualViewport?.scale??1)!==1&&ha;if(We||xt){Ih(Y,$.current),T(!1);return}const $t=Math.max(He,ht);if(en){const ft=Math.max(0,de-ut);Y.style.top=Te.height>=Ot?"0":`${ft}px`,Y.style.height=`${ht}px`,ke.scrollTop=Uf(ke)}else Y.style.bottom="0",ke.scrollTop=Dt;if(De){const ft=Te.top,vt=Te.height,gt=De.top+De.height/2,kt=tc(vt>0?(gt-ft)/vt*100:50,0,100);se.style.setProperty(NR,`50% ${kt}%`)}($t===de||ht>=be)&&(H.current=!0),p.context.handleScrollArrowVisibility(ke),h&&p.state.selectedIndex===null&&p.state.activeIndex===null&&p.context.listRef.current[0]!=null&&p.set("activeIndex",0)}finally{I()}},[p,j,Y,J,C,T,K,U,h,M,R]),v.useEffect(()=>{if(!C||!Y||!j)return;const se=wn(Y);function I(B){p.context.setOpen(!1,dt(M4,B))}return jt(se,"resize",I)},[p,C,Y,j]);const ee={...U?{role:"presentation"}:{role:"listbox","aria-multiselectable":g||void 0,"aria-readonly":y||void 0,id:`${k}-list`},onKeyDown(se){O&&Uc.has(se.key)&&se.stopPropagation()},onScroll(se){U||V(se.currentTarget)},...C&&{style:U?{height:"100%"}:eA},className:!U&&C?Ay.className:void 0},q=Mt("div",n,{ref:[o,p.context.popupRef],state:X,stateAttributesMapping:gB,props:[F,ee,Pc(G),d]});return S.jsxs(v.Fragment,{children:[!N&&Ay.getElement(A),S.jsx(Gh,{context:b,modal:!1,disabled:!z,openInteractionType:D,returnFocus:c,restoreFocus:!0,children:q})]})});function IR(e){const n=e.maxHeight;return n.endsWith("px")&&parseFloat(n)||1/0}function Uf(e){return Zv(e.scrollHeight,e.clientHeight)}function jR(e){return ZE.getScale(e)}function nc(e,n,o){return e/o[n]}function Ff(e,n){return pc({x:nc(e.x,"x",n),y:nc(e.y,"y",n),width:nc(e.width,"x",n),height:nc(e.height,"y",n)})}const PR=[["transform","none"],["scale","1"],["translate","0 0"]];function yB(e){const{style:n}=e,o={};for(const[a,s]of PR)o[a]=n.getPropertyValue(a),n.setProperty(a,s,"important");return()=>{for(const[a]of PR){const s=o[a];s?n.setProperty(a,s):n.removeProperty(a)}}}const vB=v.forwardRef(function(n,o){const{render:a,className:s,style:u,...c}=n,d=ya(),p=d.useState("multiple"),g=d.useState("readOnly"),{alignItemWithTriggerActive:y}=Jv(),h=d.useState("hasScrollArrows"),b=d.useState("openMethod"),w={id:`${d.useState("id")}-list`,role:"listbox","aria-multiselectable":p||void 0,"aria-readonly":g||void 0,onScroll(R){d.context.scrollHandlerRef.current?.(R.currentTarget)},...y&&{style:eA},className:h&&b!=="touch"?Ay.className:void 0},C=d.useStateSetter("listElement");return Mt("div",n,{ref:[o,C],props:[w,c]})}),tA=v.createContext(void 0);function nA(){const e=v.useContext(tA);if(!e)throw new Error(Rn(57));return e}const bB=v.memo(v.forwardRef(function(n,o){const{render:a,className:s,style:u,value:c=null,label:d,disabled:p=!1,nativeButton:g=!1,...y}=n,h=v.useRef(null),b=wp({guess:!0,label:d,textRef:h}),x=ya(),{props:w,multiple:C,disabled:R,readOnly:T,isItemEqualToValue:O}=x.useState("itemRoot"),M=R||p,A=x.useState("isActive",b.index),N=x.useState("open"),k=x.useState("isSelected",c),j=x.useState("isSelectedByFocus",b.index),D=b.index,z=v.useRef(null);_e(()=>{const X=x.context.valuesRef.current;return X[D]=c,()=>{delete X[D]}},[D,c,x]),_e(()=>{const X=x.state.value,ee=x.state.selectedIndex;let q=ee,se;C&&Array.isArray(X)?(q=Z7(D,c,x.context.valuesRef.current,X,O,ee),se=q===D,D===ee&&!se&&(x.context.selectedItemTextRef.current=null)):(se=X!==void 0&&Ss(c,X,O),se&&(q=D)),x.set("selectedIndex",q),se&&h.current&&(x.context.selectedItemTextRef.current=h.current)},[D,C,O,x,c]);const F=v.useRef("mouse"),G=v.useRef(!1),{getButtonProps:J,buttonRef:Y}=ma({disabled:M,focusableWhenDisabled:!0,native:g,composite:!0}),U={disabled:M,selected:k,highlighted:A};function H(X){if(R||T)return;const ee=x.state.value;if(C){const q=Array.isArray(ee)?ee:[],se=k?J7(q,c,O):[...q,c];x.context.setValue(se,dt(fs,X))}else x.context.setValue(c,dt(fs,X)),x.context.setOpen(!1,dt(fs,X))}function L(){x.context.selectionRef.current.dragY=0}const $={role:"option","aria-selected":k,tabIndex:N&&A?0:-1,onKeyDown(X){x.set("activeIndex",D),X.key===" "&&x.context.typingRef.current&&X.preventDefault()},onClick(X){const ee=F.current!=="touch",q=X.nativeEvent.pointerType,se=ee&&Nl(X.nativeEvent)&&(q!==void 0||A),I=ee&&!se&&!G.current;G.current=!1,!(M||I)&&H(X.nativeEvent)},onPointerEnter(X){F.current=X.pointerType},onPointerMove(X){if(X.pointerType==="mouse"&&X.buttons===1){const ee=x.context.selectionRef.current;ee.dragY+=X.movementY,ee.dragY**2>=64&&(ee.allowUnselectedMouseUp=!0)}},onPointerDown(X){F.current=X.pointerType,G.current=!0,L()},onMouseUp(){if(L(),M||F.current==="touch"||G.current)return;const X=!x.context.selectionRef.current.allowSelectedMouseUp&&k,ee=!x.context.selectionRef.current.allowUnselectedMouseUp&&!k;X||ee||(G.current=!0,z.current?.click(),G.current=!1)}},K=Mt("div",n,{ref:[Y,o,b.ref,z],state:U,props:[w,$,y,J]}),V=v.useMemo(()=>({selected:k,index:D,textRef:h,selectedByFocus:j}),[k,D,h,j]);return S.jsx(tA.Provider,{value:V,children:K})})),xB=v.memo(v.forwardRef(function(n,o){const{render:a,className:s,style:u,keepMounted:c,selected:d,...p}=n,g=v.useRef(null),{transitionStatus:y,setMounted:h}=ws(d),x=Mt("span",n,{ref:[o,g],state:{selected:d,transitionStatus:y},props:[{"aria-hidden":!0,children:"✔️"},p],stateAttributesMapping:pa});return jo({batch:!0,enabled:!d,open:d,ref:g,onComplete(){d||h(!1)}}),x})),SB=v.forwardRef(function(n,o){const{selected:a}=nA();return n.keepMounted||a?S.jsx(xB,{...n,selected:a,ref:o}):null}),wB=v.memo(v.forwardRef(function(n,o){const{index:a,textRef:s,selectedByFocus:u}=nA(),c=ya(),{render:d,className:p,style:g,...y}=n,h=v.useCallback(x=>{x&&(a===0&&(c.context.firstItemTextRef.current=x),u&&(c.context.selectedItemTextRef.current=x))},[c,a,u]);return Mt("div",n,{ref:[h,o,s],props:y})})),rA=v.forwardRef(function(n,o){const{render:a,className:s,style:u,direction:c,keepMounted:d,...p}=n,g=c==="up",y=ya(),{side:h,scrollDownArrowRef:b,scrollUpArrowRef:x}=Jv(),w=g?"scrollUpArrowVisible":"scrollDownArrowVisible",C=y.useState(w),R=y.useState("openMethod"),T=C&&R!=="touch",O=Hn(),M=g?x:b,{mounted:A,transitionStatus:N,setMounted:k}=ws(T);_e(()=>(y.context.scrollArrowsMountedCountRef.current+=1,y.set("hasScrollArrows",!0),()=>{y.context.scrollArrowsMountedCountRef.current=Math.max(0,y.context.scrollArrowsMountedCountRef.current-1),y.context.scrollArrowsMountedCountRef.current===0&&y.set("hasScrollArrows",!1)}),[y]),jo({open:T,ref:M,onComplete(){T||k(!1)}});const z=Mt("div",n,{ref:[o,M],state:{direction:c,visible:T,side:h,transitionStatus:N},props:[{"aria-hidden":!0,children:g?"▲":"▼",style:{position:"absolute"},onMouseMove(G){if(G.movementX===0&&G.movementY===0||O.isStarted())return;y.set("activeIndex",null);function J(){const Y=y.state.listElement??y.context.popupRef.current;if(!Y)return;y.set("activeIndex",null),y.context.handleScrollArrowVisibility(Y);const U=Zv(Y.scrollHeight,Y.clientHeight),H=Nh(Y.scrollTop,U),L=H===(g?0:U),$=y.context.listRef.current;if(H!==Y.scrollTop&&(Y.scrollTop=H),L){O.clear();return}if($.length>0){const K=M.current?.offsetHeight||0;Y.scrollTop=RB($,g,H,Y.clientHeight,K,U)}O.start(40,J)}O.start(40,J)},onMouseLeave(){O.clear()}},p],stateAttributesMapping:pa});return A||d?z:null});function RB(e,n,o,a,s,u){if(n){let y=0;const h=o+s-Vo;for(let w=0;w<e.length;w+=1){const C=e[w];if(C&&C.offsetTop>=h){y=w;break}}const b=Math.max(0,y-1),x=e[b];return b<y&&x?Nh(x.offsetTop-s,u):0}let c=e.length-1;const d=o+a-s+Vo;for(let y=0;y<e.length;y+=1){const h=e[y];if(h&&h.offsetTop+h.offsetHeight>d){c=Math.max(0,y-1);break}}const p=Math.min(e.length-1,c+1),g=e[p];return p>c&&g?Nh(g.offsetTop+g.offsetHeight-a+s,u):u}const EB=v.forwardRef(function(n,o){return S.jsx(rA,{...n,ref:o,direction:"down"})}),CB=v.forwardRef(function(n,o){return S.jsx(rA,{...n,ref:o,direction:"up"})}),Wv=eB;function eb({className:e,...n}){return S.jsx(sB,{"data-slot":"select-value",className:Ze("flex flex-1 text-left",e),...n})}function tb({className:e,size:n="default",children:o,...a}){return S.jsxs(aB,{"data-slot":"select-trigger","data-size":n,className:Ze("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-input/20 px-2 py-1.5 text-xs/relaxed whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",e),...a,children:[o,S.jsx(lB,{render:S.jsx(pC,{className:"pointer-events-none size-3.5 text-muted-foreground"})})]})}function nb({className:e,children:n,side:o="bottom",sideOffset:a=4,align:s="center",alignOffset:u=0,alignItemWithTrigger:c=!0,...d}){return S.jsx(uB,{children:S.jsx(dB,{side:o,sideOffset:a,align:s,alignOffset:u,alignItemWithTrigger:c,className:"isolate z-50",children:S.jsxs(mB,{"data-slot":"select-content","data-align-trigger":c,className:Ze("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...d,children:[S.jsx(TB,{}),S.jsx(vB,{children:n}),S.jsx(OB,{})]})})})}function rb({className:e,children:n,...o}){return S.jsxs(bB,{"data-slot":"select-item",className:Ze("relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...o,children:[S.jsx(wB,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:n}),S.jsx(SB,{render:S.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:S.jsx(cp,{className:"pointer-events-none"})})]})}function TB({className:e,...n}){return S.jsx(CB,{"data-slot":"select-scroll-up-button",className:Ze("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...n,children:S.jsx(AP,{})})}function OB({className:e,...n}){return S.jsx(EB,{"data-slot":"select-scroll-down-button",className:Ze("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...n,children:S.jsx(pC,{})})}const oA=["en-US","zh-CN","zh-TW","ja-JP"],MB={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語"},AB={"nav.dashboard":"Dashboard","nav.library":"Library","nav.skills":"Skills","nav.instructions":"Instructions","nav.models":"Models","nav.genesis":"Genesis","nav.explorer":"Explorer","nav.quantum":"Quantum","instructions.create":"New instruction","instructions.createTitle":"New instruction","instructions.name":"Name","instructions.namePlaceholder":"e.g. Code review checklist","instructions.content":"Content","instructions.contentPlaceholder":"Write Markdown instructions. Content is saved as Markdown.","instructions.editorLoading":"Loading editor…","instructions.save":"Create instruction","instructions.creating":"Creating…","instructions.created":"Instruction created.","instructions.error":"Unable to create the instruction. Please try again.","instructions.editTitle":"Edit instruction","instructions.updateSave":"Save changes","instructions.updating":"Saving…","instructions.updated":"Instruction updated. Reapply enabled agents to write the new content.","instructions.updateError":"Unable to update the instruction. Please try again.","instructions.edit":"Edit","instructions.delete":"Delete","instructions.deleted":"Instruction deleted.","instructions.deleteError":"Unable to delete the instruction. Please try again.","instructions.deleteConfirmTitle":"Delete instruction?","instructions.deleteConfirmDescription":'"{{name}}" will be removed from the library and every agent. This cannot be undone.',"instructions.dragHint":"Drag an instruction to an agent","instructions.listAria":"Instructions","instructions.actionsAria":"Actions for {{name}}","instructions.emptyTitle":"No instructions yet","instructions.emptyDescription":"Create an instruction from the New instruction action in the page header.","instructions.loadError":"Unable to load instructions. Please try again.","agents.title":"Agents","agents.orderHint":"Order controls how instructions are combined","agents.loadError":"Unable to load agents. Please try again.","agents.updateError":"Unable to update the agent instructions.","agents.enableError":"Unable to update the agent.","agents.reapplyError":"Unable to reapply the agent instructions.","agents.reapplyHint":"Rewrite the managed instruction block.","agents.reapplyDisabledHint":"Enable instructions before reapplying.","agents.openFileError":"Unable to open the instruction file.","agents.fileMissing":"The instruction file does not exist yet.","agents.duplicateError":"This instruction is already assigned to the agent.","agents.applied":"Instructions applied.","agents.removed":"Foundry instructions removed.","agents.reapplied":"Instructions reapplied.","agents.enableRequiresInstruction":"Add at least one instruction first.","agents.toggleOnHint":"Remove Foundry instructions from this file.","agents.toggleOffHint":"Write Foundry instructions to this file.","agents.emptyAssigned":"Drag instructions here","agents.loadingInstruction":"Loading instruction…","agents.openFileAria":"Open instruction file for {{name}}","agents.reapplyAria":"Reapply instructions for {{name}}","agents.toggleAria":"Apply instructions to {{name}}","agents.removeInstructionAria":"Remove {{name}} from this agent","common.retry":"Retry","settings.downloadSkill":"Download Skill","settings.skillTargets":"Install targets","settings.aboutFoundrySkill":"About the Foundry Skill","settings.foundrySkillHint":"Download the Foundry Skill to teach agents how to operate Foundry through the Foundry CLI.","settings.downloadSkillDescription":"Choose user-level folders to install the Foundry agent skill. Existing copies will be replaced.","settings.skillDownloaded":"Skill installed.","settings.errors.downloadSkill":"Unable to download the skill. Please try again.","settings.errors.skillTargets":"Unable to load skill destinations. Please try again.","settings.downloadingSkill":"Downloading…","timeZone.losAngeles":"Los Angeles","timeZone.newYork":"New York","timeZone.shanghai":"Shanghai","timeZone.taipei":"Taipei","timeZone.tokyo":"Tokyo","timeZone.utc":"Coordinated Universal Time (UTC)","dataImport.title":"Import data","dataImport.passphrase":"Backup passphrase","dataImport.replaceAction":"Replace and import","dataImport.replaceWarning":"Importing completely replaces current Foundry data with this backup. Existing data will not be merged. This cannot be undone.","dataImport.error":"Unable to import data. Please try again.","dataImport.invalidBackup":"This backup is invalid or unsupported.","dataImport.invalidPassphrase":"The passphrase is incorrect or the backup is corrupted.","nav.settings":"Settings","settings.workspace":"Workspace","settings.appearance":"Appearance","settings.appearanceAria":"Appearance settings","settings.languageRegion":"Language & Region","settings.languageRegionAria":"Language & Region settings","settings.advanced":"Advanced","settings.advancedAria":"Advanced settings","settings.export":"Export","dataExport.title":"Export data","dataExport.action":"Export","dataExport.description":"Download an encrypted backup of your Foundry data.","dataExport.passphrase":"Passphrase","dataExport.confirmPassphrase":"Confirm passphrase","dataExport.passphraseHint":"Keep this passphrase. You will need it to import the backup; it cannot be recovered.","dataExport.passphraseMismatch":"The passphrases do not match.","dataExport.exporting":"Exporting…","dataExport.exported":"Backup download started.","dataExport.error":"Unable to export data. Please try again.","common.cancel":"Cancel","settings.import":"Import","settings.configFolder":"Config Folder","settings.openFolder":"Open","settings.copyConfigFolder":"Copy config folder path","settings.configFolderCopied":"Config folder path copied","settings.errors.copyConfigFolder":"Unable to copy the config folder path.","settings.errors.openConfigFolder":"Unable to open the config folder.","settings.language":"Language","settings.timeFormat":"Time format","settings.timeZone":"Time zone","settings.colorTheme":"Color theme","settings.navigation":"Settings navigation","settings.openNavigation":"Open settings navigation","settings.errors.load":"Unable to load settings.","settings.errors.theme":"Unable to update the color theme.","settings.errors.language":"Unable to update the language.","settings.errors.timeFormat":"Unable to update the time format.","settings.errors.timeZone":"Unable to update the time zone.","common.system":"System","theme.light":"Light","theme.dark":"Dark","a11y.goBack":"Go back","a11y.close":"Close","a11y.showPassword":"Reveal password","a11y.hidePassword":"Hide password","a11y.sidebar":"Sidebar","a11y.sidebarDescription":"Displays the mobile sidebar.","a11y.toggleSidebar":"Toggle sidebar"},DB={"nav.dashboard":"仪表盘","nav.library":"资料库","nav.skills":"技能","nav.instructions":"指令","nav.models":"模型","nav.genesis":"创世","nav.explorer":"探索","nav.quantum":"量子","instructions.create":"新建指令","instructions.createTitle":"新建指令","instructions.name":"名称","instructions.namePlaceholder":"例如:代码审查清单","instructions.content":"内容","instructions.contentPlaceholder":"编写 Markdown 指令。内容将以 Markdown 格式保存。","instructions.editorLoading":"正在加载编辑器…","instructions.save":"创建指令","instructions.creating":"创建中…","instructions.created":"指令已创建。","instructions.error":"无法创建指令,请重试。","instructions.editTitle":"编辑指令","instructions.updateSave":"保存修改","instructions.updating":"保存中…","instructions.updated":"指令已更新。对已启用的 Agent 执行重新写入后才会使用新内容。","instructions.updateError":"无法更新指令,请重试。","instructions.edit":"编辑","instructions.delete":"删除","instructions.deleted":"指令已删除。","instructions.deleteError":"无法删除指令,请重试。","instructions.deleteConfirmTitle":"删除指令?","instructions.deleteConfirmDescription":"“{{name}}”将从指令库和所有 Agent 中移除,此操作无法撤销。","instructions.dragHint":"将指令拖到 Agent 上","instructions.listAria":"指令列表","instructions.actionsAria":"{{name}} 的操作","instructions.emptyTitle":"还没有指令","instructions.emptyDescription":"使用页面右上角的“新建指令”操作创建第一条指令。","instructions.loadError":"无法加载指令,请重试。","agents.title":"Agents","agents.orderHint":"顺序决定指令的拼接方式","agents.loadError":"无法加载 Agent,请重试。","agents.updateError":"无法更新 Agent 的指令。","agents.enableError":"无法更新 Agent。","agents.reapplyError":"无法重新写入 Agent 指令。","agents.reapplyHint":"重新生成文件中的 Foundry 指令块。","agents.reapplyDisabledHint":"启用指令后才能重新写入。","agents.openFileError":"无法打开指令文件。","agents.fileMissing":"指令文件尚不存在。","agents.duplicateError":"该指令已经添加到此 Agent。","agents.applied":"指令已写入。","agents.removed":"Foundry 指令已移除。","agents.reapplied":"指令已重新写入。","agents.enableRequiresInstruction":"请先添加至少一条指令。","agents.toggleOnHint":"从文件中移除 Foundry 指令。","agents.toggleOffHint":"将 Foundry 指令写入此文件。","agents.emptyAssigned":"将指令拖到这里","agents.loadingInstruction":"正在加载指令…","agents.openFileAria":"打开 {{name}} 的指令文件","agents.reapplyAria":"重新写入 {{name}} 的指令","agents.toggleAria":"将指令应用到 {{name}}","agents.removeInstructionAria":"从此 Agent 移除 {{name}}","common.retry":"重试","settings.downloadSkill":"下载 Skill","settings.skillTargets":"安装目标","settings.aboutFoundrySkill":"关于 Foundry Skill","settings.foundrySkillHint":"下载 Foundry Skill,让 Agent 了解如何通过 Foundry CLI 操作 Foundry。","settings.downloadSkillDescription":"选择用于安装 Foundry Agent Skill 的用户目录,已有副本将被替换。","settings.skillDownloaded":"Skill 已安装。","settings.errors.downloadSkill":"无法下载 Skill,请重试。","settings.errors.skillTargets":"无法加载 Skill 目标路径,请重试。","settings.downloadingSkill":"下载中…","timeZone.losAngeles":"洛杉矶","timeZone.newYork":"纽约","timeZone.shanghai":"上海","timeZone.taipei":"台北","timeZone.tokyo":"东京","timeZone.utc":"协调世界时(UTC)","dataImport.title":"导入数据","dataImport.passphrase":"备份密码","dataImport.replaceAction":"覆盖并导入","dataImport.replaceWarning":"导入会用备份完全覆盖当前 Foundry 数据,不会合并现有数据。此操作无法撤销。","dataImport.error":"无法导入数据,请重试。","dataImport.invalidBackup":"备份无效或不受支持。","dataImport.invalidPassphrase":"密码不正确或备份已损坏。","nav.settings":"设置","settings.workspace":"工作区","settings.appearance":"外观","settings.appearanceAria":"外观设置","settings.languageRegion":"语言和地区","settings.languageRegionAria":"语言和地区设置","settings.advanced":"高级","settings.advancedAria":"高级设置","settings.export":"导出","dataExport.title":"导出数据","dataExport.action":"导出","dataExport.description":"下载当前 Foundry 数据的加密备份。","dataExport.passphrase":"密码","dataExport.confirmPassphrase":"确认密码","dataExport.passphraseHint":"请保存此密码,导入备份时需要使用。密码无法找回。","dataExport.passphraseMismatch":"两次输入的密码不一致。","dataExport.exporting":"导出中…","dataExport.exported":"已开始下载数据备份。","dataExport.error":"无法导出数据,请重试。","common.cancel":"取消","settings.import":"导入","settings.configFolder":"配置文件夹","settings.openFolder":"打开","settings.copyConfigFolder":"复制配置文件夹路径","settings.configFolderCopied":"已复制配置文件夹路径","settings.errors.copyConfigFolder":"无法复制配置文件夹路径。","settings.errors.openConfigFolder":"无法打开配置文件夹。","settings.language":"语言","settings.timeFormat":"时间格式","settings.timeZone":"时区","settings.colorTheme":"颜色主题","settings.navigation":"设置导航","settings.openNavigation":"打开设置导航","settings.errors.load":"无法加载设置。","settings.errors.theme":"无法更新颜色主题。","settings.errors.language":"无法更新语言。","settings.errors.timeFormat":"无法更新时间格式。","settings.errors.timeZone":"无法更新时区。","common.system":"跟随系统","theme.light":"浅色","theme.dark":"深色","a11y.goBack":"返回","a11y.close":"关闭","a11y.showPassword":"显示密码","a11y.hidePassword":"隐藏密码","a11y.sidebar":"侧边栏","a11y.sidebarDescription":"显示移动端侧边栏。","a11y.toggleSidebar":"切换侧边栏"},NB={"nav.dashboard":"儀表板","nav.library":"資料庫","nav.skills":"技能","nav.instructions":"指令","nav.models":"模型","nav.genesis":"創世","nav.explorer":"探索","nav.quantum":"量子","instructions.create":"新增指令","instructions.createTitle":"新增指令","instructions.name":"名稱","instructions.namePlaceholder":"例如:程式碼審查清單","instructions.content":"內容","instructions.contentPlaceholder":"撰寫 Markdown 指令。內容將以 Markdown 格式儲存。","instructions.editorLoading":"正在載入編輯器…","instructions.save":"建立指令","instructions.creating":"建立中…","instructions.created":"指令已建立。","instructions.error":"無法建立指令,請重試。","instructions.editTitle":"編輯指令","instructions.updateSave":"儲存修改","instructions.updating":"儲存中…","instructions.updated":"指令已更新。對已啟用的 Agent 執行重新寫入後才會使用新內容。","instructions.updateError":"無法更新指令,請重試。","instructions.edit":"編輯","instructions.delete":"刪除","instructions.deleted":"指令已刪除。","instructions.deleteError":"無法刪除指令,請重試。","instructions.deleteConfirmTitle":"刪除指令?","instructions.deleteConfirmDescription":"「{{name}}」將從指令庫和所有 Agent 中移除,此操作無法復原。","instructions.dragHint":"將指令拖到 Agent 上","instructions.listAria":"指令列表","instructions.actionsAria":"{{name}} 的操作","instructions.emptyTitle":"尚無指令","instructions.emptyDescription":"使用頁面右上角的「新增指令」操作建立第一條指令。","instructions.loadError":"無法載入指令,請重試。","agents.title":"Agents","agents.orderHint":"順序決定指令的拼接方式","agents.loadError":"無法載入 Agent,請重試。","agents.updateError":"無法更新 Agent 的指令。","agents.enableError":"無法更新 Agent。","agents.reapplyError":"無法重新寫入 Agent 指令。","agents.reapplyHint":"重新產生檔案中的 Foundry 指令區塊。","agents.reapplyDisabledHint":"啟用指令後才能重新寫入。","agents.openFileError":"無法開啟指令檔案。","agents.fileMissing":"指令檔案尚不存在。","agents.duplicateError":"此指令已經加入此 Agent。","agents.applied":"指令已寫入。","agents.removed":"Foundry 指令已移除。","agents.reapplied":"指令已重新寫入。","agents.enableRequiresInstruction":"請先加入至少一條指令。","agents.toggleOnHint":"從檔案中移除 Foundry 指令。","agents.toggleOffHint":"將 Foundry 指令寫入此檔案。","agents.emptyAssigned":"將指令拖到這裡","agents.loadingInstruction":"正在載入指令…","agents.openFileAria":"開啟 {{name}} 的指令檔案","agents.reapplyAria":"重新寫入 {{name}} 的指令","agents.toggleAria":"將指令套用到 {{name}}","agents.removeInstructionAria":"從此 Agent 移除 {{name}}","common.retry":"重試","settings.downloadSkill":"下載 Skill","settings.skillTargets":"安裝目標","settings.aboutFoundrySkill":"關於 Foundry Skill","settings.foundrySkillHint":"下載 Foundry Skill,讓 Agent 瞭解如何透過 Foundry CLI 操作 Foundry。","settings.downloadSkillDescription":"選擇用於安裝 Foundry Agent Skill 的使用者目錄,已有副本將被替換。","settings.skillDownloaded":"Skill 已安裝。","settings.errors.downloadSkill":"無法下載 Skill,請重試。","settings.errors.skillTargets":"無法載入 Skill 目標路徑,請重試。","settings.downloadingSkill":"下載中…","timeZone.losAngeles":"洛杉磯","timeZone.newYork":"紐約","timeZone.shanghai":"上海","timeZone.taipei":"臺北","timeZone.tokyo":"東京","timeZone.utc":"協調世界時(UTC)","dataImport.title":"匯入資料","dataImport.passphrase":"備份密碼","dataImport.replaceAction":"覆蓋並匯入","dataImport.replaceWarning":"匯入會以備份完全覆蓋目前的 Foundry 資料,不會合併現有資料。此操作無法復原。","dataImport.error":"無法匯入資料,請重試。","dataImport.invalidBackup":"備份無效或不受支援。","dataImport.invalidPassphrase":"密碼不正確或備份已損壞。","nav.settings":"設定","settings.workspace":"工作區","settings.appearance":"外觀","settings.appearanceAria":"外觀設定","settings.languageRegion":"語言與地區","settings.languageRegionAria":"語言與地區設定","settings.advanced":"進階","settings.advancedAria":"進階設定","settings.export":"匯出","dataExport.title":"匯出資料","dataExport.action":"匯出","dataExport.description":"下載目前 Foundry 資料的加密備份。","dataExport.passphrase":"密碼","dataExport.confirmPassphrase":"確認密碼","dataExport.passphraseHint":"請保留此密碼,匯入備份時需要使用。密碼無法復原。","dataExport.passphraseMismatch":"兩次輸入的密碼不一致。","dataExport.exporting":"匯出中…","dataExport.exported":"已開始下載資料備份。","dataExport.error":"無法匯出資料,請重試。","common.cancel":"取消","settings.import":"匯入","settings.configFolder":"設定資料夾","settings.openFolder":"開啟","settings.copyConfigFolder":"複製設定資料夾路徑","settings.configFolderCopied":"已複製設定資料夾路徑","settings.errors.copyConfigFolder":"無法複製設定資料夾路徑。","settings.errors.openConfigFolder":"無法開啟設定資料夾。","settings.language":"語言","settings.timeFormat":"時間格式","settings.timeZone":"時區","settings.colorTheme":"色彩主題","settings.navigation":"設定導覽","settings.openNavigation":"開啟設定導覽","settings.errors.load":"無法載入設定。","settings.errors.theme":"無法更新色彩主題。","settings.errors.language":"無法更新語言。","settings.errors.timeFormat":"無法更新時間格式。","settings.errors.timeZone":"無法更新時區。","common.system":"跟隨系統","theme.light":"淺色","theme.dark":"深色","a11y.goBack":"返回","a11y.close":"關閉","a11y.showPassword":"顯示密碼","a11y.hidePassword":"隱藏密碼","a11y.sidebar":"側邊欄","a11y.sidebarDescription":"顯示行動版側邊欄。","a11y.toggleSidebar":"切換側邊欄"},IB={"nav.dashboard":"ダッシュボード","nav.library":"ライブラリ","nav.skills":"スキル","nav.instructions":"指示","nav.models":"モデル","nav.genesis":"ジェネシス","nav.explorer":"エクスプローラー","nav.quantum":"クォンタム","instructions.create":"新しい指示","instructions.createTitle":"新しい指示","instructions.name":"名前","instructions.namePlaceholder":"例:コードレビューチェックリスト","instructions.content":"内容","instructions.contentPlaceholder":"Markdown の指示を入力。内容は Markdown 形式で保存されます。","instructions.editorLoading":"エディターを読み込み中…","instructions.save":"指示を作成","instructions.creating":"作成中…","instructions.created":"指示を作成しました。","instructions.error":"指示を作成できませんでした。もう一度お試しください。","instructions.editTitle":"指示を編集","instructions.updateSave":"変更を保存","instructions.updating":"保存中…","instructions.updated":"指示を更新しました。有効な Agent は再書き込みすると新しい内容が反映されます。","instructions.updateError":"指示を更新できませんでした。もう一度お試しください。","instructions.edit":"編集","instructions.delete":"削除","instructions.deleted":"指示を削除しました。","instructions.deleteError":"指示を削除できませんでした。もう一度お試しください。","instructions.deleteConfirmTitle":"指示を削除しますか?","instructions.deleteConfirmDescription":"「{{name}}」はライブラリとすべての Agent から削除されます。この操作は取り消せません。","instructions.dragHint":"指示を Agent にドラッグ","instructions.listAria":"指示一覧","instructions.actionsAria":"{{name}} の操作","instructions.emptyTitle":"指示はまだありません","instructions.emptyDescription":"ページ右上の「新しい指示」から最初の指示を作成してください。","instructions.loadError":"指示を読み込めませんでした。もう一度お試しください。","agents.title":"Agents","agents.orderHint":"順序が指示の結合順になります","agents.loadError":"Agent を読み込めませんでした。もう一度お試しください。","agents.updateError":"Agent の指示を更新できませんでした。","agents.enableError":"Agent を更新できませんでした。","agents.reapplyError":"Agent の指示を再書き込みできませんでした。","agents.reapplyHint":"管理対象の指示ブロックを再生成します。","agents.reapplyDisabledHint":"再書き込みするには指示を有効にしてください。","agents.openFileError":"指示ファイルを開けませんでした。","agents.fileMissing":"指示ファイルはまだ存在しません。","agents.duplicateError":"この指示はすでに Agent に追加されています。","agents.applied":"指示を書き込みました。","agents.removed":"Foundry の指示を削除しました。","agents.reapplied":"指示を再書き込みしました。","agents.enableRequiresInstruction":"先に指示を 1 つ以上追加してください。","agents.toggleOnHint":"このファイルから Foundry の指示を削除します。","agents.toggleOffHint":"Foundry の指示をこのファイルに書き込みます。","agents.emptyAssigned":"ここに指示をドラッグ","agents.loadingInstruction":"指示を読み込み中…","agents.openFileAria":"{{name}} の指示ファイルを開く","agents.reapplyAria":"{{name}} の指示を再書き込み","agents.toggleAria":"{{name}} に指示を適用","agents.removeInstructionAria":"この Agent から {{name}} を削除","common.retry":"再試行","settings.downloadSkill":"Skill をダウンロード","settings.skillTargets":"インストール先","settings.aboutFoundrySkill":"Foundry Skill について","settings.foundrySkillHint":"Foundry Skill をダウンロードして、Agent に Foundry CLI を使った Foundry の操作方法を伝えます。","settings.downloadSkillDescription":"Foundry Agent Skill のインストール先を選択します。既存のコピーは置き換えられます。","settings.skillDownloaded":"Skill をインストールしました。","settings.errors.downloadSkill":"Skill をダウンロードできません。再試行してください。","settings.errors.skillTargets":"Skill の保存先を取得できません。再試行してください。","settings.downloadingSkill":"ダウンロード中…","timeZone.losAngeles":"ロサンゼルス","timeZone.newYork":"ニューヨーク","timeZone.shanghai":"上海","timeZone.taipei":"台北","timeZone.tokyo":"東京","timeZone.utc":"協定世界時(UTC)","dataImport.title":"データをインポート","dataImport.passphrase":"バックアップのパスフレーズ","dataImport.replaceAction":"上書きしてインポート","dataImport.replaceWarning":"現在の Foundry データはバックアップの内容で完全に置き換えられます。既存データとの結合は行われません。この操作は取り消せません。","dataImport.error":"データをインポートできませんでした。もう一度お試しください。","dataImport.invalidBackup":"バックアップが無効または未対応です。","dataImport.invalidPassphrase":"パスフレーズが違うか、バックアップが破損しています。","nav.settings":"設定","settings.workspace":"ワークスペース","settings.appearance":"外観","settings.appearanceAria":"外観設定","settings.languageRegion":"言語と地域","settings.languageRegionAria":"言語と地域の設定","settings.advanced":"詳細設定","settings.advancedAria":"詳細設定","settings.export":"エクスポート","dataExport.title":"データをエクスポート","dataExport.action":"エクスポート","dataExport.description":"Foundry のデータを暗号化したバックアップとしてダウンロードします。","dataExport.passphrase":"パスフレーズ","dataExport.confirmPassphrase":"パスフレーズの確認","dataExport.passphraseHint":"インポート時に必要なため、このパスフレーズを保管してください。復元はできません。","dataExport.passphraseMismatch":"パスフレーズが一致しません。","dataExport.exporting":"エクスポート中…","dataExport.exported":"バックアップのダウンロードを開始しました。","dataExport.error":"データをエクスポートできませんでした。もう一度お試しください。","common.cancel":"キャンセル","settings.import":"インポート","settings.configFolder":"設定フォルダー","settings.openFolder":"開く","settings.copyConfigFolder":"設定フォルダーのパスをコピー","settings.configFolderCopied":"設定フォルダーのパスをコピーしました","settings.errors.copyConfigFolder":"設定フォルダーのパスをコピーできませんでした。","settings.errors.openConfigFolder":"設定フォルダーを開けませんでした。","settings.language":"言語","settings.timeFormat":"時刻形式","settings.timeZone":"タイムゾーン","settings.colorTheme":"カラーテーマ","settings.navigation":"設定ナビゲーション","settings.openNavigation":"設定ナビゲーションを開く","settings.errors.load":"設定を読み込めませんでした。","settings.errors.theme":"カラーテーマを更新できませんでした。","settings.errors.language":"言語を更新できませんでした。","settings.errors.timeFormat":"時刻形式を更新できませんでした。","settings.errors.timeZone":"タイムゾーンを更新できませんでした。","common.system":"システム","theme.light":"ライト","theme.dark":"ダーク","a11y.goBack":"戻る","a11y.close":"閉じる","a11y.showPassword":"パスワードを表示","a11y.hidePassword":"パスワードを非表示","a11y.sidebar":"サイドバー","a11y.sidebarDescription":"モバイル用サイドバーを表示します。","a11y.toggleSidebar":"サイドバーを切り替える"},jB={"en-US":{translation:AB},"zh-CN":{translation:DB},"zh-TW":{translation:NB},"ja-JP":{translation:IB}};function PB({value:e,onValueChange:n,disabled:o=!1}){const{t:a}=sn(),s=[{value:"system",label:a("common.system")},...oA.map(u=>({value:u,label:MB[u]}))];return S.jsx(ji,{label:a("settings.language"),children:S.jsxs(Wv,{items:s,value:e,onValueChange:u=>{u&&n(u)},disabled:o,children:[S.jsx(tb,{"aria-label":a("settings.language"),className:"w-52",children:S.jsx(eb,{})}),S.jsx(nb,{children:s.map(u=>S.jsx(rb,{value:u.value,children:u.label},u.value))})]})})}const kB=["YYYY-MM-DD HH:mm:ss","YYYY-MM-DD","YYYY/MM/DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MM/DD/YYYY hh:mm:ss A","HH:mm:ss"],LB=["America/Los_Angeles","America/New_York","Asia/Shanghai","Asia/Taipei","Asia/Tokyo","UTC"],zB=1,_B="settings.changed",kR=kB.map(e=>({value:e,label:e}));function HB({value:e,onValueChange:n,disabled:o=!1}){const{t:a}=sn();return S.jsx(ji,{label:a("settings.timeFormat"),children:S.jsxs(Wv,{items:kR,value:e,onValueChange:s=>{s&&n(s)},disabled:o,children:[S.jsx(tb,{"aria-label":a("settings.timeFormat"),className:"w-52",children:S.jsx(eb,{})}),S.jsx(nb,{children:kR.map(s=>S.jsx(rb,{value:s.value,children:s.label},s.value))})]})})}const UB={"America/Los_Angeles":"timeZone.losAngeles","America/New_York":"timeZone.newYork","Asia/Shanghai":"timeZone.shanghai","Asia/Taipei":"timeZone.taipei","Asia/Tokyo":"timeZone.tokyo",UTC:"timeZone.utc"};function FB({value:e,onValueChange:n,disabled:o=!1}){const{t:a}=sn(),s=LB.map(u=>({value:u,label:a(UB[u])}));return S.jsx(ji,{label:a("settings.timeZone"),children:S.jsxs(Wv,{items:s,value:e,onValueChange:u=>{u&&n(u)},disabled:o,children:[S.jsx(tb,{"aria-label":a("settings.timeZone"),className:"w-52",children:S.jsx(eb,{})}),S.jsx(nb,{children:s.map(u=>S.jsx(rb,{value:u.value,children:u.label},u.value))})]})})}const xi=["settings"],nh=["settings","update"];function ob(){const{t:e}=sn(),n=Ba(),o=_k({mutationKey:nh})>0,a=dp({queryKey:xi,queryFn:({signal:h})=>ZF(h),staleTime:1/0,retry:!1}),s=Ao({mutationKey:nh,mutationFn:JF,onMutate:async h=>{await n.cancelQueries({queryKey:xi});const b=n.getQueryData(xi);return b&&n.setQueryData(xi,BB(b,h)),{previous:b}},onSuccess:h=>{n.setQueryData(xi,h)},onError:(h,b,x)=>{x?.previous&&n.setQueryData(xi,x.previous),_n.error(e(VB(b)))},onSettled:()=>n.invalidateQueries({queryKey:xi})}),u=a.data??null,c=u?.workspace.appearance["color-theme"]??"system",d=u?.workspace["language-region"].language??"system",p=u?.workspace["language-region"]["time-format"]??"YYYY-MM-DD HH:mm:ss",g=u?.workspace["language-region"]["time-zone"]??"America/Los_Angeles";function y(h){!u||n.isMutating({mutationKey:nh})>0||s.mutate(h)}return{settings:u,theme:c,language:d,timeFormat:p,timeZone:g,isLoading:a.isPending,isUpdating:o,setTheme:h=>{h!==c&&y({theme:h})},setLanguage:h=>{h!==d&&y({language:h})},setTimeFormat:h=>{h!==p&&y({timeFormat:h})},setTimeZone:h=>{h!==g&&y({timezone:h})}}}function BB(e,n){const o=e.workspace,a=o["language-region"];return{...e,workspace:{appearance:{"color-theme":n.theme??o.appearance["color-theme"]},"language-region":{language:n.language??a.language,"time-format":n.timeFormat??a["time-format"],"time-zone":n.timezone??a["time-zone"]}}}}function VB(e){return e.theme!==void 0?"settings.errors.theme":e.language!==void 0?"settings.errors.language":e.timeFormat!==void 0?"settings.errors.timeFormat":"settings.errors.timeZone"}const us=[{id:"appearance",labelKey:"settings.appearance",ariaKey:"settings.appearanceAria",icon:YP},{id:"language-region",labelKey:"settings.languageRegion",ariaKey:"settings.languageRegionAria",icon:HP},{id:"advanced",labelKey:"settings.advanced",ariaKey:"settings.advancedAria",icon:ZP}];function qB(){const{t:e}=sn(),[n,o]=iz(),a=us.find(({id:O})=>O===n.get("panel"))?.id??us[0].id,s=O=>{o(M=>{const A=new URLSearchParams(M);return A.set("panel",O),A})},{settings:u,theme:c,language:d,timeFormat:p,timeZone:g,isLoading:y,isUpdating:h,setTheme:b,setLanguage:x,setTimeFormat:w,setTimeZone:C}=ob(),R=us.find(O=>O.id===a)?.ariaKey??"settings.appearanceAria",T=us.find(O=>O.id===a)?.labelKey??"settings.appearance";return S.jsxs("div",{className:`
122
- grid h-full min-h-0 grid-cols-[260px_minmax(0,1fr)]
123
- max-[680px]:grid-cols-1
124
- `,children:[S.jsx("aside",{className:`
125
- hidden min-h-0 overflow-y-auto p-4
126
- min-[680px]:block
127
- `,children:S.jsx(YB,{activeSection:a,onSectionChange:s})}),S.jsxs("section",{"aria-label":e(R),className:"min-h-0 overflow-y-auto p-4",children:[S.jsxs("div",{className:`
128
- mb-3 flex items-center gap-3
129
- min-[680px]:hidden
130
- `,children:[S.jsxs(Nv,{children:[S.jsx(Iv,{render:S.jsx(Jt,{type:"button",variant:"outline",size:"icon","aria-label":e("settings.openNavigation")}),children:S.jsx(VP,{})}),S.jsx(jv,{side:"bottom",align:"start",sideOffset:8,"aria-label":e("settings.navigation"),className:"w-56",children:S.jsxs(AO,{children:[S.jsx(DO,{children:e("settings.workspace")}),S.jsx(G_,{value:a,onValueChange:O=>{const M=us.find(({id:A})=>A===O);M&&s(M.id)},children:us.map(({id:O,labelKey:M,icon:A})=>S.jsxs($_,{value:O,closeOnClick:!0,children:[S.jsx(A,{}),e(M)]},O))})]})})]}),S.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:e(T)})]}),S.jsxs(La,{className:"gap-0 py-0",children:[y&&S.jsxs("div",{className:`
131
- flex flex-col items-start gap-3 p-4
132
- min-[680px]:min-h-16 min-[680px]:flex-row
133
- min-[680px]:items-center min-[680px]:justify-between
134
- min-[680px]:gap-8
135
- `,children:[S.jsx(co,{className:"h-4 w-24"}),S.jsxs("div",{className:"flex items-center gap-6",children:[S.jsx(co,{className:"h-4 w-16"}),S.jsx(co,{className:"h-4 w-10"}),S.jsx(co,{className:"h-4 w-10"})]})]}),!y&&a==="appearance"&&S.jsx(K7,{value:c,onValueChange:O=>{b(O)},disabled:h||!u}),!y&&a==="language-region"&&S.jsxs("div",{className:"divide-y",children:[S.jsx(PB,{value:d,onValueChange:O=>{x(O)},disabled:h||!u}),S.jsx(FB,{value:g,onValueChange:O=>{C(O)},disabled:h||!u}),S.jsx(HB,{value:p,onValueChange:O=>{w(O)},disabled:h||!u})]}),!y&&a==="advanced"&&S.jsxs("div",{className:"divide-y",children:[S.jsx(C7,{disabled:h||!u}),S.jsx(D7,{disabled:h||!u}),S.jsx(r7,{configFolder:u?.configFolder}),S.jsx(g7,{disabled:h||!u})]})]})]})]})}function YB({activeSection:e,onSectionChange:n}){const{t:o}=sn();return S.jsx("nav",{"aria-label":o("settings.navigation"),children:S.jsxs(La,{size:"sm",children:[S.jsx(zU,{children:S.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:o("settings.workspace")})}),S.jsx(_U,{className:"flex flex-col gap-1",children:us.map(({id:a,labelKey:s,icon:u})=>{const c=a===e;return S.jsxs(Jt,{type:"button",variant:c?"secondary":"ghost","aria-current":c?"page":void 0,onClick:()=>{n(a)},className:"w-full justify-start gap-2",children:[S.jsx(u,{className:c?void 0:"text-muted-foreground"}),S.jsx("span",{children:o(s)})]},a)})})]})})}dr.use(n8).init({resources:jB,lng:aA(),fallbackLng:"en-US",supportedLngs:[...oA],keySeparator:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1}});function aA(){const e=new Intl.DateTimeFormat().resolvedOptions().locale.toLowerCase();return e.startsWith("zh-tw")||e.startsWith("zh-hk")||e.startsWith("zh-mo")||e.startsWith("zh-hant")?"zh-TW":e.startsWith("zh")?"zh-CN":e.startsWith("ja")?"ja-JP":"en-US"}function KB(){const e=Ba();v.useEffect(()=>{const n=new EventSource("/api/events"),o=()=>{e.invalidateQueries({queryKey:xi,refetchType:e.isMutating({mutationKey:nh})>0?"none":"active"})},a=s=>{try{const u=JSON.parse(s.data);typeof u=="object"&&u!==null&&"version"in u&&u.version===zB&&"type"in u&&u.type===_B&&o()}catch{}};return n.addEventListener("open",o),n.addEventListener("foundry",a),()=>{n.removeEventListener("open",o),n.removeEventListener("foundry",a),n.close()}},[e])}const Dy=matchMedia("(prefers-color-scheme: dark)");function GB(e){return Dy.addEventListener("change",e),()=>Dy.removeEventListener("change",e)}function $B(){return Dy.matches?"dark":"light"}function XB({children:e}){KB();const{theme:n,language:o}=ob(),a=v.useSyncExternalStore(GB,$B),s=n==="system"?a:n,u=o==="system"?aA():o;return v.useLayoutEffect(()=>{const c=document.documentElement;c.classList.toggle("dark",s==="dark"),c.style.colorScheme=s},[s]),v.useLayoutEffect(()=>{dr.changeLanguage(u),document.documentElement.lang=u},[u]),e}const QB=new Tk({queryCache:new uT({onError:(e,n)=>{n.queryKey[0]==="skill-targets"?_n.error(dr.t("settings.errors.skillTargets")):n.queryKey[0]==="settings"&&_n.error(dr.t("settings.errors.load"))}})});function ZB(){return null}const JB=ez([{element:S.jsx(F8,{}),children:L8.map(e=>({path:e,element:e==="/library/instructions"?S.jsx($F,{}):S.jsx(ZB,{})}))},{element:S.jsx(B8,{}),children:[{path:"/settings",element:S.jsx(qB,{}),handle:{backTo:"/dashboard"}}]},{path:"*",element:S.jsx(ML,{to:"/dashboard",replace:!0})}]);function WB(){return S.jsx(tk,{client:QB,children:S.jsx(zj,{children:S.jsx(XB,{children:S.jsx(e9,{})})})})}function e9(){const{theme:e}=ob();return S.jsxs(S.Fragment,{children:[S.jsx(fz,{router:JB}),S.jsx(ek,{theme:e})]})}qN.createRoot(document.getElementById("root")).render(S.jsx(v.StrictMode,{children:S.jsx(WB,{})}));export{Ne as W,BF as _,S as j,v as r,sn as u};