@dhzh/foundry 10.0.1 → 10.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,246 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-editor-YDVCfCfS.js","assets/code-editor-DMeNDIaI.css"])))=>i.map(i=>d[i]);
2
- function u4(e,t){for(var i=0;i<t.length;i++){const s=t[i];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(s,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(o){if(o.ep)return;o.ep=!0;const c=i(o);fetch(o.href,c)}})();function FR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var F0={exports:{}},uu={};var nw;function d4(){if(nw)return uu;nw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(s,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var d in o)d!=="key"&&(c[d]=o[d])}else c=o;return o=c.ref,{$$typeof:e,type:s,key:u,ref:o!==void 0?o:null,props:c}}return uu.Fragment=t,uu.jsx=i,uu.jsxs=i,uu}var rw;function f4(){return rw||(rw=1,F0.exports=d4()),F0.exports}var v=f4(),B0={exports:{}},At={};var iw;function h4(){if(iw)return At;iw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),x=Symbol.for("react.view_transition"),S=Symbol.iterator;function w(I){return I===null||typeof I!="object"?null:(I=S&&I[S]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,R={};function k(I,V,W){this.props=I,this.context=V,this.refs=R,this.updater=W||C}k.prototype.isReactComponent={},k.prototype.setState=function(I,V){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,V,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function O(){}O.prototype=k.prototype;function A(I,V,W){this.props=I,this.context=V,this.refs=R,this.updater=W||C}var N=A.prototype=new O;N.constructor=A,E(N,k.prototype),N.isPureReactComponent=!0;var j=Array.isArray;function D(){}var M={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function L(I,V,W){var re=W.ref;return{$$typeof:e,type:I,key:V,ref:re!==void 0?re:null,props:W}}function q(I,V){return L(I.type,V,I.props)}function X(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function B(I){var V={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(W){return V[W]})}var H=/\/+/g;function U(I,V){return typeof I=="object"&&I!==null&&I.key!=null?B(""+I.key):V.toString(36)}function z(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(D,D):(I.status="pending",I.then(function(V){I.status==="pending"&&(I.status="fulfilled",I.value=V)},function(V){I.status==="pending"&&(I.status="rejected",I.reason=V)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function Q(I,V,W,re,Ee){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 t:me=!0;break;case m:return me=I._init,Q(me(I._payload),V,W,re,Ee)}}if(me)return Ee=Ee(I),me=re===""?"."+U(I,0):re,j(Ee)?(W="",me!=null&&(W=me.replace(H,"$&/")+"/"),Q(Ee,V,W,"",function(Te){return Te})):Ee!=null&&(X(Ee)&&(Ee=q(Ee,W+(Ee.key==null||I&&I.key===Ee.key?"":(""+Ee.key).replace(H,"$&/")+"/")+me)),V.push(Ee)),1;me=0;var ge=re===""?".":re+":";if(j(I))for(var ue=0;ue<I.length;ue++)re=I[ue],le=ge+U(re,ue),me+=Q(re,V,W,le,Ee);else if(ue=w(I),typeof ue=="function")for(I=ue.call(I),ue=0;!(re=I.next()).done;)re=re.value,le=ge+U(re,ue++),me+=Q(re,V,W,le,Ee);else if(le==="object"){if(typeof I.then=="function")return Q(z(I),V,W,re,Ee);throw V=String(I),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return me}function $(I,V,W){if(I==null)return I;var re=[],Ee=0;return Q(I,re,"","",function(le){return V.call(W,le,Ee++)}),re}function K(I){if(I._status===-1){var V=I._result,W=V();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 Y=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=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(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)};function ee(I){var V=M.T,W={};W.types=V!==null?V.types:null,M.T=W;try{var re=I(),Ee=M.S;Ee!==null&&Ee(W,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(D,Y)}catch(le){Y(le)}finally{V!==null&&W.types!==null&&(V.types=W.types),M.T=V}}function G(I){var V=M.T;if(V!==null){var W=V.types;W===null?V.types=[I]:W.indexOf(I)===-1&&W.push(I)}else ee(G.bind(null,I))}var oe={map:$,forEach:function(I,V,W){$(I,function(){V.apply(this,arguments)},W)},count:function(I){var V=0;return $(I,function(){V++}),V},toArray:function(I){return $(I,function(V){return V})||[]},only:function(I){if(!X(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return At.Activity=h,At.Children=oe,At.Component=k,At.Fragment=i,At.Profiler=o,At.PureComponent=A,At.StrictMode=s,At.Suspense=f,At.ViewTransition=x,At.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,At.__COMPILER_RUNTIME={__proto__:null,c:function(I){return M.H.useMemoCache(I)}},At.addTransitionType=G,At.cache=function(I){return function(){return I.apply(null,arguments)}},At.cacheSignal=function(){return null},At.cloneElement=function(I,V,W){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var re=E({},I.props),Ee=I.key;if(V!=null)for(le in V.key!==void 0&&(Ee=""+V.key),V)!_.call(V,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&V.ref===void 0||(re[le]=V[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 L(I.type,Ee,re)},At.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:c,_context:I},I},At.createElement=function(I,V,W){var re,Ee={},le=null;if(V!=null)for(re in V.key!==void 0&&(le=""+V.key),V)_.call(V,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(Ee[re]=V[re]);var me=arguments.length-2;if(me===1)Ee.children=W;else if(1<me){for(var ge=Array(me),ue=0;ue<me;ue++)ge[ue]=arguments[ue+2];Ee.children=ge}if(I&&I.defaultProps)for(re in me=I.defaultProps,me)Ee[re]===void 0&&(Ee[re]=me[re]);return L(I,le,Ee)},At.createRef=function(){return{current:null}},At.forwardRef=function(I){return{$$typeof:d,render:I}},At.isValidElement=X,At.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:K}},At.memo=function(I,V){return{$$typeof:g,type:I,compare:V===void 0?null:V}},At.startTransition=ee,At.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},At.use=function(I){return M.H.use(I)},At.useActionState=function(I,V,W){return M.H.useActionState(I,V,W)},At.useCallback=function(I,V){return M.H.useCallback(I,V)},At.useContext=function(I){return M.H.useContext(I)},At.useDebugValue=function(){},At.useDeferredValue=function(I,V){return M.H.useDeferredValue(I,V)},At.useEffect=function(I,V){return M.H.useEffect(I,V)},At.useEffectEvent=function(I){return M.H.useEffectEvent(I)},At.useId=function(){return M.H.useId()},At.useImperativeHandle=function(I,V,W){return M.H.useImperativeHandle(I,V,W)},At.useInsertionEffect=function(I,V){return M.H.useInsertionEffect(I,V)},At.useLayoutEffect=function(I,V){return M.H.useLayoutEffect(I,V)},At.useMemo=function(I,V){return M.H.useMemo(I,V)},At.useOptimistic=function(I,V){return M.H.useOptimistic(I,V)},At.useReducer=function(I,V,W){return M.H.useReducer(I,V,W)},At.useRef=function(I){return M.H.useRef(I)},At.useState=function(I){return M.H.useState(I)},At.useSyncExternalStore=function(I,V,W){return M.H.useSyncExternalStore(I,V,W)},At.useTransition=function(){return M.H.useTransition()},At.version="19.3.1",At}var sw;function $u(){return sw||(sw=1,B0.exports=h4()),B0.exports}var b=$u();const Ne=FR(b),BR=u4({__proto__:null,default:Ne},[b]);var V0={exports:{}},du={},K0={exports:{}},q0={};var aw;function p4(){return aw||(aw=1,(function(e){function t(z,Q){var $=z.length;z.push(Q);e:for(;0<$;){var K=$-1>>>1,Y=z[K];if(0<o(Y,Q))z[K]=Q,z[$]=Y,$=K;else break e}}function i(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var Q=z[0],$=z.pop();if($!==Q){z[0]=$;e:for(var K=0,Y=z.length,ee=Y>>>1;K<ee;){var G=2*(K+1)-1,oe=z[G],I=G+1,V=z[I];if(0>o(oe,$))I<Y&&0>o(V,oe)?(z[K]=V,z[I]=$,K=I):(z[K]=oe,z[G]=$,K=G);else if(I<Y&&0>o(V,$))z[K]=V,z[I]=$,K=I;else break e}}return Q}function o(z,Q){var $=z.sortIndex-Q.sortIndex;return $!==0?$:z.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var f=[],g=[],m=1,h=null,x=3,S=!1,w=!1,C=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function A(z){for(var Q=i(g);Q!==null;){if(Q.callback===null)s(g);else if(Q.startTime<=z)s(g),Q.sortIndex=Q.expirationTime,t(f,Q);else break;Q=i(g)}}function N(z){if(C=!1,A(z),!w)if(i(f)!==null)w=!0,j||(j=!0,X());else{var Q=i(g);Q!==null&&U(N,Q.startTime-z)}}var j=!1,D=-1,M=5,_=-1;function L(){return E?!0:!(e.unstable_now()-_<M)}function q(){if(E=!1,j){var z=e.unstable_now();_=z;var Q=!0;try{e:{w=!1,C&&(C=!1,k(D),D=-1),S=!0;var $=x;try{t:{for(A(z),h=i(f);h!==null&&!(h.expirationTime>z&&L());){var K=h.callback;if(typeof K=="function"){h.callback=null,x=h.priorityLevel;var Y=K(h.expirationTime<=z);if(z=e.unstable_now(),typeof Y=="function"){h.callback=Y,A(z),Q=!0;break t}h===i(f)&&s(f),A(z)}else s(f);h=i(f)}if(h!==null)Q=!0;else{var ee=i(g);ee!==null&&U(N,ee.startTime-z),Q=!1}}break e}finally{h=null,x=$,S=!1}Q=void 0}}finally{Q?X():j=!1}}}var X;if(typeof O=="function")X=function(){O(q)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,H=B.port2;B.port1.onmessage=q,X=function(){H.postMessage(null)}}else X=function(){R(q,0)};function U(z,Q){D=R(function(){z(e.unstable_now())},Q)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(z){switch(x){case 1:case 2:case 3:var Q=3;break;default:Q=x}var $=x;x=Q;try{return z()}finally{x=$}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(z,Q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var $=x;x=z;try{return Q()}finally{x=$}},e.unstable_scheduleCallback=function(z,Q,$){var K=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?K+$:K):$=K,z){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=$+Y,z={id:m++,callback:Q,priorityLevel:z,startTime:$,expirationTime:Y,sortIndex:-1},$>K?(z.sortIndex=$,t(g,z),i(f)===null&&z===i(g)&&(C?(k(D),D=-1):C=!0,U(N,$-K))):(z.sortIndex=Y,t(f,z),w||S||(w=!0,j||(j=!0,X()))),z},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(z){var Q=x;return function(){var $=x;x=Q;try{return z.apply(this,arguments)}finally{x=$}}}})(q0)),q0}var ow;function g4(){return ow||(ow=1,K0.exports=p4()),K0.exports}var Y0={exports:{}},wr={};var lw;function m4(){if(lw)return wr;lw=1;var e=$u();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)h+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(t(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal"),c=Symbol.for("react.recoverable"),u=Symbol.for("react.optimistic_key");function d(m,h,x){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:S==null?null:S===u?u:""+S,children:m,containerInfo:h,implementation:x}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return wr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,wr.browser=function(m){return{$$typeof:c,_reason:m}},wr.createPortal=function(m,h){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return d(m,h,null,x)},wr.flushSync=function(m){var h=f.T,x=s.p;try{if(f.T=null,s.p=2,m)return m()}finally{f.T=h,s.p=x,s.d.f()}},wr.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(m,h))},wr.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},wr.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var x=h.as,S=g(x,h.crossOrigin),w=typeof h.integrity=="string"?h.integrity:void 0,C=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;x==="style"?s.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:S,integrity:w,fetchPriority:C}):x==="script"&&s.d.X(m,{crossOrigin:S,integrity:w,fetchPriority:C,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},wr.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var x=g(h.as,h.crossOrigin);s.d.M(m,{crossOrigin:x,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&&s.d.M(m)},wr.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var x=h.as,S=g(x,h.crossOrigin);s.d.L(m,x,{crossOrigin:S,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})}},wr.preloadModule=function(m,h){if(typeof m=="string")if(h){var x=g(h.as,h.crossOrigin);s.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:x,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 s.d.m(m)},wr.requestFormReset=function(m){s.d.r(m)},wr.unstable_batchedUpdates=function(m,h){return m(h)},wr.useFormState=function(m,h,x){return f.H.useFormState(m,h,x)},wr.useFormStatus=function(){return f.H.useHostTransitionStatus()},wr.version="19.3.1",wr}var cw;function VR(){if(cw)return Y0.exports;cw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Y0.exports=m4(),Y0.exports}var uw;function y4(){if(uw)return du;uw=1;var e=g4(),t=$u(),i=VR();function s(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){for(var r=n,a=r;a&&!a.alternate;)r=a,(r.flags&4098)!==0&&(n=r.return),a=r.return;for(;r.return;)r=r.return;return r.tag===3?n:null}function u(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function d(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function f(n){if(c(n)!==n)throw Error(s(188))}function g(n){var r=n.alternate;if(!r){if(r=c(n),r===null)throw Error(s(188));return r!==n?null:n}for(var a=n,l=r;;){var p=a.return;if(p===null)break;var y=p.alternate;if(y===null){if(l=p.return,l!==null){a=l;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===a)return f(p),n;if(y===l)return f(p),r;y=y.sibling}throw Error(s(188))}if(a.return!==l.return)a=p,l=y;else{for(var T=!1,P=p.child;P;){if(P===a){T=!0,a=p,l=y;break}if(P===l){T=!0,l=p,a=y;break}P=P.sibling}if(!T){for(P=y.child;P;){if(P===a){T=!0,a=y,l=p;break}if(P===l){T=!0,l=y,a=p;break}P=P.sibling}if(!T)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?n:r}function m(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=m(n),r!==null)return r;n=n.sibling}return null}function h(n,r,a,l,p,y){for(;n!==null;){if((n.tag===5||n.tag===27||n.tag===6)&&a(n,l,p,y)||(n.tag!==22||n.memoizedState===null)&&(r||n.tag!==5&&n.tag!==27)&&h(n.child,r,a,l,p,y))return!0;n=n.sibling}return!1}function x(n){for(n=n.return;n!==null;){if(n.tag===3||n.tag===5||n.tag===27)return n;n=n.return}return null}function S(n){var r=!1;for(n=n.return;n!==null&&(n.tag===4&&(r=!0),!(n.tag===3||n.tag===5||n.tag===27));)n=n.return;return r}function w(n){var r=[null,null],a=x(n);return a===null||C(r,n,a.child,{foundSelf:!1}),r}function C(n,r,a,l){for(;a!==null;){if(a===r)l.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(l.foundSelf)return n[1]=a,!0;n[0]=a}else if((a.tag!==22||a.memoizedState===null)&&C(n,r,a.child,l))return!0;a=a.sibling}return!1}function E(n){switch(n.tag){case 5:case 27:case 6:return n.stateNode;case 3:return n.stateNode.containerInfo;default:throw Error(s(559))}}var R=null,k=null;function O(n,r,a){return n===a?!0:n===r?(R=n,!0):!1}function A(n,r,a){return n===a?(k=n,!1):n===r?(k!==null&&(R=n),!0):!1}function N(n){if(n===null)return null;do n=n===null?null:n.return;while(n&&n.tag!==5&&n.tag!==27&&n.tag!==3);return n||null}function j(n,r,a){for(var l=0,p=n;p;p=a(p))l++;p=0;for(var y=r;y;y=a(y))p++;for(;0<l-p;)n=a(n),l--;for(;0<p-l;)r=a(r),p--;for(;l--;){if(n===r||r!==null&&n===r.alternate)return n;n=a(n),r=a(r)}return null}var D=Object.assign,M=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),U=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),G=Symbol.for("react.legacy_hidden"),oe=Symbol.for("react.memo_cache_sentinel"),I=Symbol.for("react.view_transition"),V=Symbol.for("react.recoverable"),W=Symbol.iterator;function re(n){return n===null||typeof n!="object"?null:(n=W&&n[W]||n["@@iterator"],typeof n=="function"?n:null)}var Ee=Symbol.for("react.client.reference");function le(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Ee?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case q:return"Fragment";case B:return"Profiler";case X:return"StrictMode";case Q:return"Suspense";case $:return"SuspenseList";case ee:return"Activity";case I:return"ViewTransition"}if(typeof n=="object")switch(n.$$typeof){case L:return"Portal";case U:return n.displayName||"Context";case H:return(n._context.displayName||"Context")+".Consumer";case z:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case K:return r=n.displayName||null,r!==null?r:le(n.type)||"Memo";case Y:r=n._payload,n=n._init;try{return le(n(r))}catch{}}return null}var me=Array.isArray,ge=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Te={pending:!1,data:null,method:null,action:null},ve=[],Pe=-1;function Oe(n){return{current:n}}function Le(n){0>Pe||(n.current=ve[Pe],ve[Pe]=null,Pe--)}function Ve(n,r){Pe++,ve[Pe]=n.current,n.current=r}var ke=Oe(null),Ue=Oe(null),be=Oe(null),He=Oe(null);function Ze(n,r){switch(Ve(be,r),Ve(Ue,n),Ve(ke,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?dS(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=dS(r),n=fS(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Le(ke),Ve(ke,n)}function ot(){Le(ke),Le(Ue),Le(be)}function de(n){var r=n.memoizedState;r!==null&&(Al._currentValue=r.memoizedState,Ve(He,n)),r=ke.current;var a=fS(r,n.type);r!==a&&(Ve(Ue,n),Ve(ke,a))}function we(n){Ue.current===n&&(Le(ke),Le(Ue)),He.current===n&&(Le(He),Al._currentValue=Te)}var Ge,Me;function De(n){if(Ge===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);Ge=r&&r[1]||"",Me=-1<a.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Ge+n+Me}var bt=!1;function dt(n,r){if(!n||bt)return"";bt=!0;var a=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 ie=Ye}Reflect.construct(n,[],Ce)}else{try{Ce.call()}catch(Ye){ie=Ye}Ce=!1;try{var fe=Object.getOwnPropertyDescriptor(n.prototype,"props");Object.defineProperty(n.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Ce=!0,new n}finally{Ce&&(fe!==void 0?Object.defineProperty(n.prototype,"props",fe):delete n.prototype.props)}}}else{try{throw Error()}catch(Ye){ie=Ye}(Ce=n())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(Ye){if(Ye&&ie&&typeof Ye.stack=="string")return[Ye.stack,ie.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=l.DetermineComponentFrameRoot(),T=y[0],P=y[1];if(T&&P){var Z=T.split(`
5
- `),ae=P.split(`
6
- `);for(p=l=0;l<Z.length&&!Z[l].includes("DetermineComponentFrameRoot");)l++;for(;p<ae.length&&!ae[p].includes("DetermineComponentFrameRoot");)p++;if(l===Z.length||p===ae.length)for(l=Z.length-1,p=ae.length-1;1<=l&&0<=p&&Z[l]!==ae[p];)p--;for(;1<=l&&0<=p;l--,p--)if(Z[l]!==ae[p]){if(l!==1||p!==1)do if(l--,p--,0>p||Z[l]!==ae[p]){var pe=`
7
- `+Z[l].replace(" at new "," at ");return n.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",n.displayName)),pe}while(1<=l&&0<=p);break}}}finally{bt=!1,Error.prepareStackTrace=a}return(a=n?n.displayName||n.name:"")?De(a):""}function pt(n,r){switch(n.tag){case 26:case 27:case 5:return De(n.type);case 16:return De("Lazy");case 13:return n.child!==r&&r!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return dt(n.type,!1);case 11:return dt(n.type.render,!1);case 1:return dt(n.type,!0);case 31:return De("Activity");case 30:return De("ViewTransition");default:return""}}function Nt(n){try{var r="",a=null;do r+=pt(n,a),a=n,n=n.return;while(n);return r}catch(l){return`
8
- Error generating stack: `+l.message+`
9
- `+l.stack}}var jt=Object.prototype.hasOwnProperty,tn=e.unstable_scheduleCallback,an=e.unstable_cancelCallback,nn=e.unstable_shouldYield,We=e.unstable_requestPaint,wt=e.unstable_now,Zt=e.unstable_getCurrentPriorityLevel,ht=e.unstable_ImmediatePriority,xt=e.unstable_UserBlockingPriority,yt=e.unstable_NormalPriority,Ut=e.unstable_LowPriority,un=e.unstable_IdlePriority,je=e.log,st=e.unstable_setDisableYieldValue,Ie=null,ze=null;function $e(n){if(typeof je=="function"&&st(n),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(Ie,n)}catch{}}var et=Math.clz32?Math.clz32:J,Tt=Math.log,F=Math.LN2;function J(n){return n>>>=0,n===0?32:31-(Tt(n)/F|0)|0}var ne=256,ye=262144,xe=4194304;function qe(n){var r=n&42;if(r!==0)return r;switch(n&-n){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 n&-n;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ke(n,r,a){var l=n.pendingLanes;if(l===0)return 0;var p=0,y=n.suspendedLanes,T=n.pingedLanes;n=n.warmLanes;var P=l&134217727;return P!==0?(l=P&~y,l!==0?p=qe(l):(T&=P,T!==0?p=qe(T):a||(a=P&~n,a!==0&&(p=qe(a))))):(P=l&~y,P!==0?p=qe(P):T!==0?p=qe(T):a||(a=l&~n,a!==0&&(p=qe(a)))),p===0?0:r!==0&&r!==p&&(r&y)===0&&(y=p&-p,a=r&-r,y>=a||y===32&&(a&4194048)!==0)?r:p}function Xe(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function Qe(n,r){(r&8)!==0&&(r|=r&32);var a=n.entangledLanes;if(a!==0)for(n=n.entanglements,a&=r;0<a;){var l=31-et(a),p=1<<l;r|=n[l],a&=~p}return r}function lt(n,r){switch(n){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 n=xe;return xe<<=1,(xe&62914560)===0&&(xe=4194304),n}function Et(n){for(var r=[],a=0;31>a;a++)r.push(n);return r}function ft(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Kt(n,r,a,l,p,y){var T=n.pendingLanes;n.pendingLanes=a,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=a,n.entangledLanes&=a,n.errorRecoveryDisabledLanes&=a,n.shellSuspendCounter=0;var P=n.entanglements,Z=n.expirationTimes,ae=n.hiddenUpdates;for(a=T&~a;0<a;){var pe=31-et(a),Ce=1<<pe;P[pe]=0,Z[pe]=-1;var ie=ae[pe];if(ie!==null)for(ae[pe]=null,pe=0;pe<ie.length;pe++){var fe=ie[pe];fe!==null&&(fe.lane&=-536870913)}a&=~Ce}l!==0&&Ft(n,l,0),y!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=y&~(T&~r))}function Ft(n,r,a){n.pendingLanes|=r,n.suspendedLanes&=~r;var l=31-et(r);n.entangledLanes|=r,n.entanglements[l]=n.entanglements[l]|1073741824|a&261930}function On(n,r){var a=n.entangledLanes|=r;for(n=n.entanglements;a;){var l=31-et(a),p=1<<l;p&r|n[l]&r&&(n[l]|=r),a&=~p}}function qt(n,r){var a=r&-r;return a=(a&42)!==0?1:Bt(a),(a&(n.suspendedLanes|r))!==0?0:a}function Bt(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Cn(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Tn(){var n=ue.p;return n!==0?n:(n=window.event,n===void 0?32:QS(n.type))}function ti(n,r){var a=ue.p;try{return ue.p=n,r()}finally{ue.p=a}}var dn=Math.random().toString(36).slice(2),fn="__reactFiber$"+dn,An="__reactProps$"+dn,jn="__reactContainer$"+dn,Os="__reactEvents$"+dn,Dr="__reactListeners$"+dn,_i="__reactHandles$"+dn,ni="__reactResources$"+dn,xi="__reactMarker$"+dn,zt="__reactLoad$"+dn;function qn(n){delete n[fn],delete n[An],delete n[Dr],delete n[_i]}function Fn(n){var r;if(r=n[fn])return r;for(var a=n.parentNode;a;){if(r=a[jn]||a[fn]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(n=AS(n);n!==null;){if(a=n[fn])return a;n=AS(n)}return r}n=a,a=n.parentNode}return null}function pr(n){if(n=n[fn]||n[jn]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function he(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(s(33))}function Ae(n){var r=n[ni];return r||(r=n[ni]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Se(n){n[xi]=!0}function nt(n){n[zt]=void 0}var Ot=new Set,Rt={};function Ht(n,r){xn(n,r),xn(n+"Capture",r)}function xn(n,r){for(Rt[n]=r,n=0;n<r.length;n++)Ot.add(r[n])}var hn=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]*$"),vt={},Dt={};function on(n){return jt.call(Dt,n)?!0:jt.call(vt,n)?!1:hn.test(n)?Dt[n]=!0:(vt[n]=!0,!1)}var gt=!1;function nr(){var n=gt;return gt=!1,n}function zn(n,r,a){if(on(r))if(a===null)n.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,a)}}function ri(n,r,a){if(a===null)n.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,a)}}function Gn(n,r,a,l){if(l===null)n.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttributeNS(r,a,l)}}function $n(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Go(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function bc(n,r,a){var l=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,y=l.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return p.call(this)},set:function(T){a=""+T,y.call(this,T)}}),Object.defineProperty(n,r,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(T){a=""+T},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function As(n){if(!n._valueTracker){var r=Go(n)?"checked":"value";n._valueTracker=bc(n,r,""+n[r])}}function $o(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return n&&(l=Go(n)?n.checked?"true":"false":n.value),n=l,n!==a?(r.setValue(n),!0):!1}var Od=/[\n"\\]/g;function Dn(n){return n.replace(Od,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Cr(n,r,a,l,p,y,T,P){n.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?n.type=T:n.removeAttribute("type"),r!=null?T==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+$n(r)):n.value!==""+$n(r)&&(n.value=""+$n(r)):T!=="submit"&&T!=="reset"||n.removeAttribute("value"),r!=null?T==="number"&&n.value==r?Qo(n,$n(n.value)):Qo(n,$n(r)):a!=null?Qo(n,$n(a)):l!=null&&n.removeAttribute("value"),p==null&&y!=null&&(n.defaultChecked=!!y),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?n.name=""+$n(P):n.removeAttribute("name")}function ia(n,r,a,l,p,y,T,P){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(n.type=y),r!=null||a!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){As(n);return}a=a!=null?""+$n(a):"",r=r!=null?""+$n(r):a,P||r===n.value||(n.value=r),n.defaultValue=r}l=l??p,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=P?n.checked:!!l,n.defaultChecked=!!l,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(n.name=T),As(n)}function Qo(n,r){n.defaultValue!==""+r&&(n.defaultValue=""+r)}function Kr(n,r,a,l){if(n=n.options,r){r={};for(var p=0;p<a.length;p++)r["$"+a[p]]=!0;for(a=0;a<n.length;a++)p=r.hasOwnProperty("$"+n[a].value),n[a].selected!==p&&(n[a].selected=p),p&&l&&(n[a].defaultSelected=!0)}else{for(a=""+$n(a),r=null,p=0;p<n.length;p++){if(n[p].value===a){n[p].selected=!0,l&&(n[p].defaultSelected=!0);return}r!==null||n[p].disabled||(r=n[p])}r!==null&&(r.selected=!0)}}function Xo(n,r,a){if(r!=null&&(r=""+$n(r),r!==n.value&&(n.value=r),a==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=a!=null?""+$n(a):""}function ii(n,r,a,l){if(r==null){if(l!=null){if(a!=null)throw Error(s(92));if(me(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a==null&&(a=""),r=a}a=$n(r),n.defaultValue=a,l=n.textContent,l===a&&l!==""&&l!==null&&(n.value=l),As(n)}function jr(n,r){if(r){var a=n.firstChild;if(a&&a===n.lastChild&&a.nodeType===3){a.nodeValue=r;return}}n.textContent=r}var sa=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 xc(n,r,a){var l=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":l?n.setProperty(r,a):typeof a!="number"||a===0||sa.has(r)?r==="float"?n.cssFloat=a:n[r]=(""+a).trim():n[r]=a+"px"}function si(n,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(n=n.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="",gt=!0);for(var p in r)l=r[p],r.hasOwnProperty(p)&&a[p]!==l&&(xc(n,p,l),gt=!0)}else for(var y in r)r.hasOwnProperty(y)&&xc(n,y,r[y])}function Za(n){if(n.indexOf("-")===-1)return!1;switch(n){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 Sc=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"]]),wc=/^[\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 gr(n){return wc.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Ir(){}var Ja=null;function Wa(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var rn=null,or=null;function Si(n){var r=pr(n);if(r&&(n=r.stateNode)){var a=n[An]||null;e:switch(n=r.stateNode,r.type){case"input":if(Cr(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=n;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Dn(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var l=a[r];if(l!==n&&l.form===n.form){var p=l[An]||null;if(!p)throw Error(s(90));Cr(l,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<a.length;r++)l=a[r],l.form===n.form&&$o(l)}break e;case"textarea":Xo(n,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&Kr(n,!!a.multiple,r,!1)}}}var ai=!1;function eo(n,r,a){if(ai)return n(r,a);ai=!0;try{var l=n(r);return l}finally{if(ai=!1,(rn!==null||or!==null)&&(Af(),rn&&(r=rn,n=or,or=rn=null,Si(r),n)))for(r=0;r<n.length;r++)Si(n[r])}}function Ms(n,r){var a=n.stateNode;if(a===null)return null;var l=a[An]||null;if(l===null)return null;a=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)||(n=n.type,l=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!l;break e;default:n=!1}if(n)return null;if(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),to=!1;if(mr)try{var Ec={};Object.defineProperty(Ec,"passive",{get:function(){to=!0}}),window.addEventListener("test",Ec,Ec),window.removeEventListener("test",Ec,Ec)}catch{to=!1}var aa=null,Cg=null,Ad=null;function ox(){if(Ad)return Ad;var n,r=Cg,a=r.length,l,p="value"in aa?aa.value:aa.textContent,y=p.length;for(n=0;n<a&&r[n]===p[n];n++);var T=a-n;for(l=1;l<=T&&r[a-l]===p[y-l];l++);return Ad=p.slice(n,1<l?1-l:void 0)}function Md(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function Nd(){return!0}function lx(){return!1}function Pr(n){function r(a,l,p,y,T){this._reactName=a,this._targetInst=p,this.type=l,this.nativeEvent=y,this.target=T,this.currentTarget=null;for(var P in n)n.hasOwnProperty(P)&&(a=n[P],this[P]=a?a(y):y[P]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Nd:lx,this.isPropagationStopped=lx,this}return D(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Nd)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Nd)},persist:function(){},isPersistent:Nd}),r}var oa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dd=Pr(oa),Rc=D({},oa,{view:0,detail:0}),PM=Pr(Rc),Tg,kg,Cc,jd=D({},Rc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ag,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Cc&&(Cc&&n.type==="mousemove"?(Tg=n.screenX-Cc.screenX,kg=n.screenY-Cc.screenY):kg=Tg=0,Cc=n),Tg)},movementY:function(n){return"movementY"in n?n.movementY:kg}}),cx=Pr(jd),LM=D({},jd,{dataTransfer:0}),zM=Pr(LM),_M=D({},Rc,{relatedTarget:0}),Og=Pr(_M),UM=D({},oa,{animationName:0,elapsedTime:0,pseudoElement:0}),HM=Pr(UM),FM=D({},oa,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),BM=Pr(FM),VM=D({},oa,{data:0}),ux=Pr(VM),KM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qM={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"},YM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function GM(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=YM[n])?!!r[n]:!1}function Ag(){return GM}var $M=D({},Rc,{key:function(n){if(n.key){var r=KM[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=Md(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?qM[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ag,charCode:function(n){return n.type==="keypress"?Md(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Md(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),QM=Pr($M),XM=D({},jd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dx=Pr(XM),ZM=D({},oa,{submitter:0}),JM=Pr(ZM),WM=D({},Rc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ag}),eN=Pr(WM),tN=D({},oa,{propertyName:0,elapsedTime:0,pseudoElement:0}),nN=Pr(tN),rN=D({},jd,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),iN=Pr(rN),sN=D({},oa,{newState:0,oldState:0,source:0}),aN=Pr(sN),oN=[9,13,27,32],Mg=mr&&"CompositionEvent"in window,Tc=null;mr&&"documentMode"in document&&(Tc=document.documentMode);var lN=mr&&"TextEvent"in window&&!Tc,fx=mr&&(!Mg||Tc&&8<Tc&&11>=Tc),hx=" ",px=!1;function gx(n,r){switch(n){case"keyup":return oN.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mx(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Zo=!1;function cN(n,r){switch(n){case"compositionend":return mx(r);case"keypress":return r.which!==32?null:(px=!0,hx);case"textInput":return n=r.data,n===hx&&px?null:n;default:return null}}function uN(n,r){if(Zo)return n==="compositionend"||!Mg&&gx(n,r)?(n=ox(),Ad=Cg=aa=null,Zo=!1,n):null;switch(n){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 fx&&r.locale!=="ko"?null:r.data;default:return null}}var dN={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 yx(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!dN[n.type]:r==="textarea"}function vx(n,r,a,l){rn?or?or.push(l):or=[l]:rn=l,r=Pf(r,"onChange"),0<r.length&&(a=new Dd("onChange","change",null,a,l),n.push({event:a,listeners:r}))}var kc=null,Oc=null;function fN(n){sS(n,0)}function Id(n){var r=he(n);if($o(r))return n}function bx(n,r){if(n==="change")return r}var xx=!1;if(mr){var Ng;if(mr){var Dg="oninput"in document;if(!Dg){var Sx=document.createElement("div");Sx.setAttribute("oninput","return;"),Dg=typeof Sx.oninput=="function"}Ng=Dg}else Ng=!1;xx=Ng&&(!document.documentMode||9<document.documentMode)}function wx(){kc&&(kc.detachEvent("onpropertychange",Ex),Oc=kc=null)}function Ex(n){if(n.propertyName==="value"&&Id(Oc)){var r=[];vx(r,Oc,n,Wa(n)),eo(fN,r)}}function hN(n,r,a){n==="focusin"?(wx(),kc=r,Oc=a,kc.attachEvent("onpropertychange",Ex)):n==="focusout"&&wx()}function pN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Id(Oc)}function gN(n,r){if(n==="click")return Id(r)}function mN(n,r){if(n==="input"||n==="change")return Id(r)}function yN(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var oi=typeof Object.is=="function"?Object.is:yN;function Ac(n,r){if(oi(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var a=Object.keys(n),l=Object.keys(r);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var p=a[l];if(!jt.call(r,p)||!oi(n[p],r[p]))return!1}return!0}function jg(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function Rx(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Cx(n,r){var a=Rx(n);n=0;for(var l;a;){if(a.nodeType===3){if(l=n+a.textContent.length,n<=r&&l>=r)return{node:a,offset:r-n};n=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Rx(a)}}function Tx(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Tx(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function kx(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=jg(n.document);r instanceof n.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)n=r.contentWindow;else break;r=jg(n.document)}return r}function Ig(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var vN=mr&&"documentMode"in document&&11>=document.documentMode,Jo=null,Pg=null,Mc=null,Lg=!1;function Ox(n,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Lg||Jo==null||Jo!==jg(l)||(l=Jo,"selectionStart"in l&&Ig(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}),Mc&&Ac(Mc,l)||(Mc=l,l=Pf(Pg,"onSelect"),0<l.length&&(r=new Dd("onSelect","select",null,r,a),n.push({event:r,listeners:l}),r.target=Jo)))}function no(n,r){var a={};return a[n.toLowerCase()]=r.toLowerCase(),a["Webkit"+n]="webkit"+r,a["Moz"+n]="moz"+r,a}var Wo={animationend:no("Animation","AnimationEnd"),animationiteration:no("Animation","AnimationIteration"),animationstart:no("Animation","AnimationStart"),transitionrun:no("Transition","TransitionRun"),transitionstart:no("Transition","TransitionStart"),transitioncancel:no("Transition","TransitionCancel"),transitionend:no("Transition","TransitionEnd")},zg={},Ax={};mr&&(Ax=document.createElement("div").style,"AnimationEvent"in window||(delete Wo.animationend.animation,delete Wo.animationiteration.animation,delete Wo.animationstart.animation),"TransitionEvent"in window||delete Wo.transitionend.transition);function ro(n){if(zg[n])return zg[n];if(!Wo[n])return n;var r=Wo[n],a;for(a in r)if(r.hasOwnProperty(a)&&a in Ax)return zg[n]=r[a];return n}var Mx=ro("animationend"),Nx=ro("animationiteration"),Dx=ro("animationstart"),bN=ro("transitionrun"),xN=ro("transitionstart"),SN=ro("transitioncancel"),jx=ro("transitionend"),Ix=new Map,_g="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(" ");_g.push("scrollEnd");function Ui(n,r){Ix.set(n,r),Ht(r,[n])}var wN=0;function Ns(n,r){if(n.name!=null&&n.name!=="auto")return n.name;if(r.autoName!==null)return r.autoName;n=Vi.identifierPrefix;var a=wN++;return n="_"+n+"t_"+a.toString(32)+"_",r.autoName=n}function Px(n){if(n==null||typeof n=="string")return n;var r=null,a=bl;if(a!==null)for(var l=0;l<a.length;l++){var p=n[a[l]];if(p!=null){if(p==="none")return"none";r=r==null?p:r+(" "+p)}}return r??n.default}function Ds(n,r){return n=Px(n),r=Px(r),r==null?n==="auto"?null:n:r==="auto"?null:r}var Pd=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},wi=[],el=0,Ug=0;function Ld(){for(var n=el,r=Ug=el=0;r<n;){var a=wi[r];wi[r++]=null;var l=wi[r];wi[r++]=null;var p=wi[r];wi[r++]=null;var y=wi[r];if(wi[r++]=null,l!==null&&p!==null){var T=l.pending;T===null?p.next=p:(p.next=T.next,T.next=p),l.pending=p}y!==0&&Lx(a,p,y)}}function zd(n,r,a,l){wi[el++]=n,wi[el++]=r,wi[el++]=a,wi[el++]=l,Ug|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function Hg(n,r,a,l){return zd(n,r,a,l),_d(n)}function io(n,r){return zd(n,null,null,r),_d(n)}function Lx(n,r,a){n.lanes|=a;var l=n.alternate;l!==null&&(l.lanes|=a);for(var p=!1,y=n.return;y!==null;)y.childLanes|=a,l=y.alternate,l!==null&&(l.childLanes|=a),y.tag===22&&(n=y.stateNode,n===null||n._visibility&1||(p=!0)),n=y,y=y.return;return n.tag===3?(y=n.stateNode,p&&r!==null&&(p=31-et(a),n=y.hiddenUpdates,l=n[p],l===null?n[p]=[r]:l.push(r),r.lane=a|536870912),y):null}function _d(n){if(50<Jc)throw Jc=0,Of=null,Error(s(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var tl={};function EN(n,r,a,l){this.tag=n,this.key=a,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 qr(n,r,a,l){return new EN(n,r,a,l)}function Fg(n){return n=n.prototype,!(!n||!n.isReactComponent)}function js(n,r){var a=n.alternate;return a===null?(a=qr(n.tag,r,n.key,n.mode),a.elementType=n.elementType,a.type=n.type,a.stateNode=n.stateNode,a.alternate=n,n.alternate=a):(a.pendingProps=r,a.type=n.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=n.flags&1206910976,a.childLanes=n.childLanes,a.lanes=n.lanes,a.child=n.child,a.memoizedProps=n.memoizedProps,a.memoizedState=n.memoizedState,a.updateQueue=n.updateQueue,r=n.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=n.sibling,a.index=n.index,a.ref=n.ref,a.refCleanup=n.refCleanup,a}function zx(n,r){n.flags&=1206910978;var a=n.alternate;return a===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,r=a.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Ud(n,r,a,l,p,y){var T=0;if(l=n,typeof l=="function")Fg(l)&&(T=1);else if(typeof l=="string")T=ZD(n,a,ke.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(l){case ee:return n=qr(31,a,r,p),n.elementType=ee,n.lanes=y,n;case q:return so(a.children,p,y,r);case X:T=8,p|=24;break;case B:return n=qr(12,a,r,p|2),n.elementType=B,n.lanes=y,n;case Q:return n=qr(13,a,r,p),n.elementType=Q,n.lanes=y,n;case $:return n=qr(19,a,r,p),n.elementType=$,n.lanes=y,n;case G:case I:return n=p|32,n=qr(30,a,r,n),n.elementType=I,n.lanes=y,n.stateNode={autoName:null,paired:null,clones:null,ref:null},n;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case U:T=10;break e;case H:T=9;break e;case z:T=11;break e;case K:T=14;break e;case Y:T=16,l=null;break e}T=29,a=Error(s(130,n===null?"null":typeof n,"")),l=null}return r=qr(T,a,r,p),r.elementType=n,r.type=l,r.lanes=y,r}function so(n,r,a,l){return n=qr(7,n,l,r),n.lanes=a,n}function Bg(n,r,a){return n=qr(6,n,null,r),n.lanes=a,n}function _x(n){var r=qr(18,null,null,0);return r.stateNode=n,r}function Vg(n,r,a){return r=qr(4,n.children!==null?n.children:[],n.key,r),r.lanes=a,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var Ux=new WeakMap;function Ei(n,r){if(typeof n=="object"&&n!==null){var a=Ux.get(n);return a!==void 0?a:(r={value:n,source:r,stack:Nt(r)},Ux.set(n,r),r)}return{value:n,source:r,stack:Nt(r)}}var nl=[],rl=0,Hd=null,Nc=0,Ri=[],Ci=0,la=null,ts=1,ns="";function Is(n,r){nl[rl++]=Nc,nl[rl++]=Hd,Hd=n,Nc=r}function Hx(n,r,a){Ri[Ci++]=ts,Ri[Ci++]=ns,Ri[Ci++]=la,la=n;var l=ts;n=ns;var p=32-et(l)-1;l&=~(1<<p),a+=1;var y=32-et(r)+p;if(30<y){var T=p-p%5;y=(l&(1<<T)-1).toString(32),l>>=T,p-=T,ts=1<<32-et(r)+p|a<<p|l,ns=y+n}else ts=1<<y|a<<p|l,ns=n}function Fd(n){n.return!==null&&(Is(n,1),Hx(n,1,0))}function Kg(n){for(;n===Hd;)Hd=nl[--rl],nl[rl]=null,Nc=nl[--rl],nl[rl]=null;for(;n===la;)la=Ri[--Ci],Ri[Ci]=null,ns=Ri[--Ci],Ri[Ci]=null,ts=Ri[--Ci],Ri[Ci]=null}function Fx(n,r){Ri[Ci++]=ts,Ri[Ci++]=ns,Ri[Ci++]=la,ts=r.id,ns=r.overflow,la=n}var lr=null,Mn=null,Vt=!1,ca=null,Ti=!1,qg=Error(s(519));function ua(n){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Dc(Ei(r,n)),qg}function Bx(n){var r=n.stateNode,a=n.type,l=n.memoizedProps;switch(r[fn]=n,r[An]=l,a){case"dialog":Gt("cancel",r),Gt("close",r);break;case"iframe":case"object":case"embed":Gt("load",r);break;case"video":case"audio":for(a=0;a<eu.length;a++)Gt(eu[a],r);break;case"source":Gt("error",r);break;case"img":case"image":case"link":Gt("error",r),Gt("load",r);break;case"details":Gt("toggle",r);break;case"input":Gt("invalid",r),ia(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Gt("invalid",r);break;case"textarea":Gt("invalid",r),ii(r,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||l.suppressHydrationWarning===!0||cS(r.textContent,a)?(l.popover!=null&&(Gt("beforetoggle",r),Gt("toggle",r)),l.onScroll!=null&&Gt("scroll",r),l.onScrollEnd!=null&&Gt("scrollend",r),l.onClick!=null&&(r.onclick=Ir),r=!0):r=!1,r||ua(n,!0)}function Bd(n){for(lr=n.return;lr;)switch(lr.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:lr=lr.return}}function il(n){if(n!==lr)return!1;if(!Vt)return Bd(n),Vt=!0,!1;var r=n.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=n.type,a=!(a!=="form"&&a!=="button")||S0(n.type,n.memoizedProps)),a=!a),a&&Mn&&ua(n),Bd(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Mn=OS(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Mn=OS(n)}else r===27?(r=Mn,Ta(n.type)?(n=M0,M0=null,Mn=n):Mn=r):Mn=lr?Oi(n.stateNode.nextSibling):null;return!0}function ao(){Mn=lr=null,Vt=!1}function Yg(){var n=ca;return n!==null&&($r===null?$r=n:$r.push.apply($r,n),ca=null),n}function Dc(n){ca===null?ca=[n]:ca.push(n)}var Gg=Oe(null),oo=null,Ps=null;function da(n,r,a){Ve(Gg,r._currentValue),r._currentValue=a}function Ls(n){n._currentValue=Gg.current,Le(Gg)}function Vd(n,r,a){for(;n!==null;){var l=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),n===a)break;n=n.return}}function $g(n,r,a,l){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var y=p.dependencies;if(y!==null){var T=p.child;y=y.firstContext;e:for(;y!==null;){var P=y;y=p;for(var Z=0;Z<r.length;Z++)if(P.context===r[Z]){y.lanes|=a,P=y.alternate,P!==null&&(P.lanes|=a),Vd(y.return,a,n),l||(T=null);break e}y=P.next}}else if(p.tag===18){if(T=p.return,T===null)throw Error(s(341));T.lanes|=a,y=T.alternate,y!==null&&(y.lanes|=a),Vd(T,a,n),T=null}else p.tag===13&&p.memoizedState!==null&&p.memoizedState.dehydrated===null?(p.lanes|=a,T=p.alternate,T!==null&&(T.lanes|=a),Vd(p.return,a,n),T=p.child,T=T!==null?T.sibling:null):T=p.child;if(T!==null)T.return=p;else for(T=p;T!==null;){if(T===n){T=null;break}if(p=T.sibling,p!==null){p.return=T.return,T=p;break}T=T.return}p=T}}function lo(n,r,a,l){n=null;for(var p=r,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var T=p.alternate;if(T===null)throw Error(s(387));if(T=T.memoizedProps,T!==null){var P=p.type;oi(p.pendingProps.value,T.value)||(n!==null?n.push(P):n=[P])}}else if(p===He.current){if(T=p.alternate,T===null)throw Error(s(387));T.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(Al):n=[Al])}p=p.return}return n!==null&&$g(r,n,a,l),r.flags|=262144,n!==null}function Kd(n){for(n=n.firstContext;n!==null;){if(!oi(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function co(n){oo=n,Ps=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function yr(n){return Vx(oo,n)}function qd(n,r){return oo===null&&co(n),Vx(n,r)}function Vx(n,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Ps===null){if(n===null)throw Error(s(308));Ps=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else Ps=Ps.next=r;return a}var RN=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(a,l){n.push(l)}};this.abort=function(){r.aborted=!0,n.forEach(function(a){return a()})}},CN=e.unstable_scheduleCallback,TN=e.unstable_NormalPriority,Qn={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qg(){return{controller:new RN,data:new Map,refCount:0}}function jc(n){n.refCount--,n.refCount===0&&CN(TN,function(){n.controller.abort()})}function Kx(n,r){if((n.pendingLanes&4194048)!==0){var a=n.transitionTypes;for(a===null&&(a=n.transitionTypes=[]),n=0;n<r.length;n++){var l=r[n];a.indexOf(l)===-1&&a.push(l)}}}var Ic=null;function kN(n){var r=n.transitionTypes;return n.transitionTypes=null,r}var Pc=null,Xg=0,uo=0,sl=null;function ON(n,r){if(Pc===null){var a=Pc=[];Xg=0,uo=f0(),sl={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Xg++,r.then(qx,qx),r}function qx(){if(--Xg===0&&(Ic=null,Pc!==null)){sl!==null&&(sl.status="fulfilled");var n=Pc;Pc=null,uo=0,sl=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function AN(n,r){var a=[],l={status:"pending",value:null,reason:null,then:function(p){a.push(p)}};return n.then(function(){l.status="fulfilled",l.value=r;for(var p=0;p<a.length;p++)(0,a[p])(r)},function(p){for(l.status="rejected",l.reason=p,p=0;p<a.length;p++)(0,a[p])(void 0)}),l}var Yx=ge.S;ge.S=function(n,r){if(_1=wt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&ON(n,r),Ic!==null)for(var a=El;a!==null;)Kx(a,Ic),a=a.next;if(a=n.types,a!==null){for(var l=El;l!==null;)Kx(l,a),l=l.next;if(uo!==0){l=Ic,l===null&&(l=Ic=[]);for(var p=0;p<a.length;p++){var y=a[p];l.indexOf(y)===-1&&l.push(y)}}}Yx!==null&&Yx(n,r)};var fo=Oe(null);function Zg(){var n=fo.current;return n!==null?n:kn.pooledCache}function Yd(n,r){r===null?Ve(fo,fo.current):Ve(fo,r.pool)}function Gx(){var n=Zg();return n===null?null:{parent:Qn._currentValue,pool:n}}var al=Error(s(460)),Jg=Error(s(474)),Gd=Error(s(542)),$d={then:function(){}};function $x(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Qx(n,r,a){switch(a=n[a],a===void 0?n.push(r):a!==r&&(r.then(Ir,Ir),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,Zx(n),n===void 0&&!("reason"in r)?Error(s(600)):n;default:if(typeof r.status=="string")r.then(Ir,Ir);else{if(n=kn,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=r,n.status="pending",n.then(function(l){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=l}},function(l){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,Zx(n),n}throw po=r,al}}function ho(n){try{var r=n._init;return r(n._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(po=a,al):a}}var po=null;function Xx(){if(po===null)throw Error(s(459));var n=po;return po=null,n}function Zx(n){if(n===al||n===Gd)throw Error(s(483))}var ol=null,Lc=0;function Qd(n){var r=Lc;return Lc+=1,ol===null&&(ol=[]),Qx(ol,n,r)}function fa(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Xd(n,r){throw r.$$typeof===M?Error(s(525)):(n=Object.prototype.toString.call(r),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function Jx(n){function r(se,te){if(n){var ce=se.deletions;ce===null?(se.deletions=[te],se.flags|=16):ce.push(te)}}function a(se,te){if(!n)return null;for(;te!==null;)r(se,te),te=te.sibling;return null}function l(se){for(var te=new Map;se!==null;)se.key===null?te.set(se.index,se):te.set(se.key,se),se=se.sibling;return te}function p(se,te){return se=js(se,te),se.index=0,se.sibling=null,se}function y(se,te,ce){return se.index=ce,n?(ce=se.alternate,ce!==null?(ce=ce.index,ce<te?(se.flags|=2,te):ce):(se.flags|=134217730,te)):(se.flags|=1048576,te)}function T(se){return n&&se.alternate===null&&(se.flags|=134217730),se}function P(se,te,ce,Re){return te===null||te.tag!==6?(te=Bg(ce,se.mode,Re),te.return=se,te):(te=p(te,ce),te.return=se,te)}function Z(se,te,ce,Re){var Je=ce.type;return Je===q?(se=pe(se,te,ce.props.children,Re,ce.key),fa(se,ce),se):te!==null&&(te.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===Y&&ho(Je)===te.type)?(te=p(te,ce.props),fa(te,ce),te.return=se,te):(te=Ud(ce.type,ce.key,ce.props,null,se.mode,Re),fa(te,ce),te.return=se,te)}function ae(se,te,ce,Re){return te===null||te.tag!==4||te.stateNode.containerInfo!==ce.containerInfo||te.stateNode.implementation!==ce.implementation?(te=Vg(ce,se.mode,Re),te.return=se,te):(te=p(te,ce.children||[]),te.return=se,te)}function pe(se,te,ce,Re,Je){return te===null||te.tag!==7?(te=so(ce,se.mode,Re,Je),te.return=se,te):(te=p(te,ce),te.return=se,te)}function Ce(se,te,ce){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Bg(""+te,se.mode,ce),te.return=se,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case _:return ce=Ud(te.type,te.key,te.props,null,se.mode,ce),fa(ce,te),ce.return=se,ce;case L:return te=Vg(te,se.mode,ce),te.return=se,te;case Y:return te=ho(te),Ce(se,te,ce)}if(me(te)||re(te))return te=so(te,se.mode,ce,null),te.return=se,te;if(typeof te.then=="function")return Ce(se,Qd(te),ce);if(te.$$typeof===U)return Ce(se,qd(se,te),ce);Xd(se,te)}return null}function ie(se,te,ce,Re){var Je=te!==null?te.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Je!==null?null:P(se,te,""+ce,Re);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case _:return ce.key===Je?Z(se,te,ce,Re):null;case L:return ce.key===Je?ae(se,te,ce,Re):null;case Y:return ce=ho(ce),ie(se,te,ce,Re)}if(me(ce)||re(ce))return Je!==null?null:pe(se,te,ce,Re,null);if(typeof ce.then=="function")return ie(se,te,Qd(ce),Re);if(ce.$$typeof===U)return ie(se,te,qd(se,ce),Re);Xd(se,ce)}return null}function fe(se,te,ce,Re,Je){if(typeof Re=="string"&&Re!==""||typeof Re=="number"||typeof Re=="bigint")return se=se.get(ce)||null,P(te,se,""+Re,Je);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case _:return se=se.get(Re.key===null?ce:Re.key)||null,Z(te,se,Re,Je);case L:return se=se.get(Re.key===null?ce:Re.key)||null,ae(te,se,Re,Je);case Y:return Re=ho(Re),fe(se,te,ce,Re,Je)}if(me(Re)||re(Re))return se=se.get(ce)||null,pe(te,se,Re,Je,null);if(typeof Re.then=="function")return fe(se,te,ce,Qd(Re),Je);if(Re.$$typeof===U)return fe(se,te,ce,qd(te,Re),Je);Xd(te,Re)}return null}function Ye(se,te,ce,Re){for(var Je=null,Wt=null,ct=te,St=te=0,Jn=null;ct!==null&&St<ce.length;St++){ct.index>St?(Jn=ct,ct=null):Jn=ct.sibling;var sn=ie(se,ct,ce[St],Re);if(sn===null){ct===null&&(ct=Jn);break}n&&ct&&sn.alternate===null&&r(se,ct),te=y(sn,te,St),Wt===null?Je=sn:Wt.sibling=sn,Wt=sn,ct=Jn}if(St===ce.length)return a(se,ct),Vt&&Is(se,St),Je;if(ct===null){for(;St<ce.length;St++)ct=Ce(se,ce[St],Re),ct!==null&&(te=y(ct,te,St),Wt===null?Je=ct:Wt.sibling=ct,Wt=ct);return Vt&&Is(se,St),Je}for(ct=l(ct);St<ce.length;St++)Jn=fe(ct,se,St,ce[St],Re),Jn!==null&&(n&&(sn=Jn.alternate,sn!==null&&ct.delete(sn.key===null?St:sn.key)),te=y(Jn,te,St),Wt===null?Je=Jn:Wt.sibling=Jn,Wt=Jn);return n&&ct.forEach(function(Na){return r(se,Na)}),Vt&&Is(se,St),Je}function rt(se,te,ce,Re){if(ce==null)throw Error(s(151));for(var Je=null,Wt=null,ct=te,St=te=0,Jn=null,sn=ce.next();ct!==null&&!sn.done;St++,sn=ce.next()){ct.index>St?(Jn=ct,ct=null):Jn=ct.sibling;var Na=ie(se,ct,sn.value,Re);if(Na===null){ct===null&&(ct=Jn);break}n&&ct&&Na.alternate===null&&r(se,ct),te=y(Na,te,St),Wt===null?Je=Na:Wt.sibling=Na,Wt=Na,ct=Jn}if(sn.done)return a(se,ct),Vt&&Is(se,St),Je;if(ct===null){for(;!sn.done;St++,sn=ce.next())sn=Ce(se,sn.value,Re),sn!==null&&(te=y(sn,te,St),Wt===null?Je=sn:Wt.sibling=sn,Wt=sn);return Vt&&Is(se,St),Je}for(ct=l(ct);!sn.done;St++,sn=ce.next())sn=fe(ct,se,St,sn.value,Re),sn!==null&&(n&&(Jn=sn.alternate,Jn!==null&&ct.delete(Jn.key===null?St:Jn.key)),te=y(sn,te,St),Wt===null?Je=sn:Wt.sibling=sn,Wt=sn);return n&&ct.forEach(function(c4){return r(se,c4)}),Vt&&Is(se,St),Je}function Pt(se,te,ce,Re){if(typeof ce=="object"&&ce!==null&&ce.type===q&&ce.key===null&&ce.props.ref===void 0&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case _:e:{for(var Je=ce.key;te!==null;){if(te.key===Je){if(Je=ce.type,Je===q){if(te.tag===7){a(se,te.sibling),Re=p(te,ce.props.children),fa(Re,ce),Re.return=se,se=Re;break e}}else if(te.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===Y&&ho(Je)===te.type){a(se,te.sibling),Re=p(te,ce.props),fa(Re,ce),Re.return=se,se=Re;break e}a(se,te);break}else r(se,te);te=te.sibling}ce.type===q?(Re=so(ce.props.children,se.mode,Re,ce.key),fa(Re,ce),Re.return=se,se=Re):(Re=Ud(ce.type,ce.key,ce.props,null,se.mode,Re),fa(Re,ce),Re.return=se,se=Re)}return T(se);case L:e:{for(Je=ce.key;te!==null;){if(te.key===Je)if(te.tag===4&&te.stateNode.containerInfo===ce.containerInfo&&te.stateNode.implementation===ce.implementation){a(se,te.sibling),Re=p(te,ce.children||[]),Re.return=se,se=Re;break e}else{a(se,te);break}else r(se,te);te=te.sibling}Re=Vg(ce,se.mode,Re),Re.return=se,se=Re}return T(se);case Y:return ce=ho(ce),Pt(se,te,ce,Re)}if(me(ce))return Ye(se,te,ce,Re);if(re(ce)){if(Je=re(ce),typeof Je!="function")throw Error(s(150));return ce=Je.call(ce),rt(se,te,ce,Re)}if(typeof ce.then=="function")return Pt(se,te,Qd(ce),Re);if(ce.$$typeof===U)return Pt(se,te,qd(se,ce),Re);Xd(se,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,te!==null&&te.tag===6?(a(se,te.sibling),Re=p(te,ce),Re.return=se,se=Re):(a(se,te),Re=Bg(ce,se.mode,Re),Re.return=se,se=Re),T(se)):a(se,te)}return function(se,te,ce,Re){try{Lc=0;var Je=Pt(se,te,ce,Re);return ol=null,Je}catch(ct){if(ct===al||ct===Gd)throw ct;var Wt=qr(29,ct,null,se.mode);return Wt.lanes=Re,Wt.return=se,Wt}}}var go=Jx(!0),Wx=Jx(!1),ha=!1;function Wg(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function em(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function pa(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function ga(n,r,a){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(cn&2)!==0){var p=l.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),l.pending=r,r=_d(n),Lx(n,null,a),r}return zd(n,l,r,a),_d(n)}function zc(n,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var l=r.lanes;l&=n.pendingLanes,a|=l,r.lanes=a,On(n,a)}}function tm(n,r){var a=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var p=null,y=null;if(a=a.firstBaseUpdate,a!==null){do{var T={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};y===null?p=y=T:y=y.next=T,a=a.next}while(a!==null);y===null?p=y=r:y=y.next=r}else p=y=r;a={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:l.shared,callbacks:l.callbacks},n.updateQueue=a;return}n=a.lastBaseUpdate,n===null?a.firstBaseUpdate=r:n.next=r,a.lastBaseUpdate=r}var nm=!1;function _c(){if(nm){var n=sl;if(n!==null)throw n}}function Uc(n,r,a,l){nm=!1;var p=n.updateQueue;ha=!1;var y=p.firstBaseUpdate,T=p.lastBaseUpdate,P=p.shared.pending;if(P!==null){p.shared.pending=null;var Z=P,ae=Z.next;Z.next=null,T===null?y=ae:T.next=ae,T=Z;var pe=n.alternate;pe!==null&&(pe=pe.updateQueue,P=pe.lastBaseUpdate,P!==T&&(P===null?pe.firstBaseUpdate=ae:P.next=ae,pe.lastBaseUpdate=Z))}if(y!==null){var Ce=p.baseState;T=0,pe=ae=Z=null,P=y;do{var ie=P.lane&-536870913,fe=ie!==P.lane;if(fe?(Jt&ie)===ie:(l&ie)===ie){ie!==0&&ie===uo&&(nm=!0),pe!==null&&(pe=pe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ye=n,rt=P;ie=r;var Pt=a;switch(rt.tag){case 1:if(Ye=rt.payload,typeof Ye=="function"){Ce=Ye.call(Pt,Ce,ie);break e}Ce=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=rt.payload,ie=typeof Ye=="function"?Ye.call(Pt,Ce,ie):Ye,ie==null)break e;Ce=D({},Ce,ie);break e;case 2:ha=!0}}ie=P.callback,ie!==null&&(n.flags|=64,fe&&(n.flags|=8192),fe=p.callbacks,fe===null?p.callbacks=[ie]:fe.push(ie))}else fe={lane:ie,tag:P.tag,payload:P.payload,callback:P.callback,next:null},pe===null?(ae=pe=fe,Z=Ce):pe=pe.next=fe,T|=ie;if(P=P.next,P===null){if(P=p.shared.pending,P===null)break;fe=P,P=fe.next,fe.next=null,p.lastBaseUpdate=fe,p.shared.pending=null}}while(!0);pe===null&&(Z=Ce),p.baseState=Z,p.firstBaseUpdate=ae,p.lastBaseUpdate=pe,y===null&&(p.shared.lanes=0),wa|=T,n.lanes=T,n.memoizedState=Ce}}function e2(n,r){if(typeof n!="function")throw Error(s(191,n));n.call(r)}function t2(n,r){var a=n.callbacks;if(a!==null)for(n.callbacks=null,n=0;n<a.length;n++)e2(a[n],r)}var ma=Oe(null),Zd=Oe(0);function n2(n,r){n=Fs,Ve(Zd,n),Ve(ma,r),Fs=n|r.baseLanes}function rm(){Ve(Zd,Fs),Ve(ma,ma.current)}function im(){Fs=Zd.current,Le(ma),Le(Zd)}var vr=Oe(null),Tr=null;function ya(n){var r=n.alternate;Ve(br,br.current&1),Ve(vr,n),Tr===null&&(r===null||ma.current!==null||r.memoizedState!==null)&&(Tr=n)}function sm(n){Ve(br,br.current),Ve(vr,n),Tr===null&&(Tr=n)}function r2(n){n.tag===22?(Ve(br,br.current),Ve(vr,n),Tr===null&&(Tr=n)):va()}function va(){Ve(br,br.current),Ve(vr,vr.current)}function li(n){Le(vr),Tr===n&&(Tr=null),Le(br)}var br=Oe(0);function Hc(n,r){Ve(vr,vr.current),Ve(br,r)}function am(n){Le(br),Le(vr),Tr===n&&(Tr=null)}function Jd(n){for(var r=n;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||O0(a)||A0(a)))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===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var zs=0,It=null,Sn=null,Xn=null,Wd=!1,ll=!1,mo=!1,ef=0,Fc=0,cl=null,MN=0;function Bn(){throw Error(s(321))}function om(n,r){if(r===null)return!1;for(var a=0;a<r.length&&a<n.length;a++)if(!oi(n[a],r[a]))return!1;return!0}function lm(n,r,a,l,p,y){return zs=y,It=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,ge.H=n===null||n.memoizedState===null?H2:F2,mo=!1,y=a(l,p),mo=!1,ll&&(y=s2(r,a,l,p)),i2(n),y}function i2(n){ge.H=lf;var r=Sn!==null&&Sn.next!==null;if(zs=0,Xn=Sn=It=null,Wd=!1,Fc=0,cl=null,r)throw Error(s(300));n===null||Zn||(n=n.dependencies,n!==null&&Kd(n)&&(Zn=!0))}function s2(n,r,a,l){It=n;var p=0;do{if(ll&&(cl=null),Fc=0,ll=!1,25<=p)throw Error(s(301));if(p+=1,Xn=Sn=null,n.updateQueue!=null){var y=n.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}ge.H=_N,y=r(a,l)}while(ll);return y}function NN(){var n=ge.H,r=n.useState()[0];return r=typeof r.then=="function"?Bc(r):r,n=n.useState()[0],(Sn!==null?Sn.memoizedState:null)!==n&&(It.flags|=1024),r}function cm(){var n=ef!==0;return ef=0,n}function um(n,r,a){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~a}function dm(n){if(Wd){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}Wd=!1}zs=0,Xn=Sn=It=null,ll=!1,Fc=ef=0,cl=null}function Lr(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?It.memoizedState=Xn=n:Xn=Xn.next=n,Xn}function Yn(){if(Sn===null){var n=It.alternate;n=n!==null?n.memoizedState:null}else n=Sn.next;var r=Xn===null?It.memoizedState:Xn.next;if(r!==null)Xn=r,Sn=n;else{if(n===null)throw It.alternate===null?Error(s(467)):Error(s(310));Sn=n,n={memoizedState:Sn.memoizedState,baseState:Sn.baseState,baseQueue:Sn.baseQueue,queue:Sn.queue,next:null},Xn===null?It.memoizedState=Xn=n:Xn=Xn.next=n}return Xn}function tf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bc(n){var r=Fc;return Fc+=1,cl===null&&(cl=[]),n=Qx(cl,n,r),r=It,(Xn===null?r.memoizedState:Xn.next)===null&&(r=r.alternate,ge.H=r===null||r.memoizedState===null?H2:F2),n}function nf(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Bc(n);if(n.$$typeof===V)return;if(n.$$typeof===U)return yr(n)}throw Error(s(438,String(n)))}function fm(n){var r=null,a=It.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var l=It.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=tf(),It.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(n),l=0;l<n;l++)a[l]=oe;return r.index++,a}function _s(n,r){return typeof r=="function"?r(n):r}function rf(n){var r=Yn();return hm(r,Sn,n)}function hm(n,r,a){var l=n.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var p=n.baseQueue,y=l.pending;if(y!==null){if(p!==null){var T=p.next;p.next=y.next,y.next=T}r.baseQueue=p=y,l.pending=null}if(y=n.baseState,p===null)n.memoizedState=y;else{r=p.next;var P=T=null,Z=null,ae=r,pe=!1;do{var Ce=ae.lane&-536870913;if(Ce!==ae.lane?(Jt&Ce)===Ce:(zs&Ce)===Ce){var ie=ae.revertLane;if(ie===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),Ce===uo&&(pe=!0);else if((zs&ie)===ie){ae=ae.next,ie===uo&&(pe=!0);continue}else Ce={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Z===null?(P=Z=Ce,T=y):Z=Z.next=Ce,It.lanes|=ie,wa|=ie;Ce=ae.action,mo&&a(y,Ce),y=ae.hasEagerState?ae.eagerState:a(y,Ce)}else ie={lane:Ce,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Z===null?(P=Z=ie,T=y):Z=Z.next=ie,It.lanes|=Ce,wa|=Ce;ae=ae.next}while(ae!==null&&ae!==r);if(Z===null?T=y:Z.next=P,!oi(y,n.memoizedState)&&(Zn=!0,pe&&(a=sl,a!==null)))throw a;n.memoizedState=y,n.baseState=T,n.baseQueue=Z,l.lastRenderedState=y}return p===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function pm(n){var r=Yn(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=n;var l=a.dispatch,p=a.pending,y=r.memoizedState;if(p!==null){a.pending=null;var T=p=p.next;do y=n(y,T.action),T=T.next;while(T!==p);oi(y,r.memoizedState)||(Zn=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),a.lastRenderedState=y}return[y,l]}function a2(n,r,a){var l=It,p=Yn(),y=Vt;if(y){if(a===void 0)throw Error(s(407));a=a()}else a=r();var T=!oi((Sn||p).memoizedState,a);if(T&&(p.memoizedState=a,Zn=!0),p=p.queue,ym(c2.bind(null,l,p,n),[n]),n=p.getSnapshot!==r||T||Xn!==null&&(Xn.memoizedState.tag&1)!==0,ul(n?9:8,{destroy:void 0},l2.bind(null,l,p,a,r),null),n){if(l.flags|=2048,kn===null)throw Error(s(349));y||(zs&127)!==0||o2(l,r,a)}return a}function o2(n,r,a){n.flags|=16384,n={getSnapshot:r,value:a},r=It.updateQueue,r===null?(r=tf(),It.updateQueue=r,r.stores=[n]):(a=r.stores,a===null?r.stores=[n]:a.push(n))}function l2(n,r,a,l){r.value=a,r.getSnapshot=l,u2(r)&&d2(n)}function c2(n,r,a){return a(function(){u2(r)&&d2(n)})}function u2(n){var r=n.getSnapshot;n=n.value;try{var a=r();return!oi(n,a)}catch{return!0}}function d2(n){var r=io(n,2);r!==null&&Qr(r,n,2)}function gm(n){var r=Lr();if(typeof n=="function"){var a=n;if(n=a(),mo){$e(!0);try{a()}finally{$e(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:n},r}function f2(n,r,a,l){return n.baseState=a,hm(n,Sn,typeof l=="function"?l:_s)}function DN(n,r,a,l,p){if(of(n))throw Error(s(485));if(n=r.action,n!==null){var y={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){y.listeners.push(T)}};ge.T!==null?a(!0):y.isTransition=!1,l(y),a=r.pending,a===null?(y.next=r.pending=y,h2(r,y)):(y.next=a.next,r.pending=a.next=y)}}function h2(n,r){var a=r.action,l=r.payload,p=n.state;if(r.isTransition){var y=ge.T,T={};T.types=y!==null?y.types:null,ge.T=T;try{var P=a(p,l),Z=ge.S;Z!==null&&Z(T,P),p2(n,r,P)}catch(ae){mm(n,r,ae)}finally{y!==null&&T.types!==null&&(y.types=T.types),ge.T=y}}else try{y=a(p,l),p2(n,r,y)}catch(ae){mm(n,r,ae)}}function p2(n,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){g2(n,r,l)},function(l){return mm(n,r,l)}):g2(n,r,a)}function g2(n,r,a){r.status="fulfilled",r.value=a,m2(r),n.state=a,r=n.pending,r!==null&&(a=r.next,a===r?n.pending=null:(a=a.next,r.next=a,h2(n,a)))}function mm(n,r,a){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,m2(r),r=r.next;while(r!==l)}n.action=null}function m2(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function y2(n,r){return r}function v2(n,r){if(Vt){var a=kn.formState;if(a!==null){e:{var l=It;if(Vt){if(Mn){t:{for(var p=Mn,y=Ti;p.nodeType!==8;){if(!y){p=null;break t}if(p=Oi(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){Mn=Oi(p.nextSibling),l=p.data==="F!";break e}}ua(l)}l=!1}l&&(r=a[0])}}return a=Lr(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:y2,lastRenderedState:r},a.queue=l,a=z2.bind(null,It,l),l.dispatch=a,l=gm(!1),y=wm.bind(null,It,!1,l.queue),l=Lr(),p={state:r,dispatch:null,action:n,pending:null},l.queue=p,a=DN.bind(null,It,p,y,a),p.dispatch=a,l.memoizedState=n,[r,a,!1]}function b2(n){var r=Yn();return x2(r,Sn,n)}function x2(n,r,a){if(r=hm(n,r,y2)[0],n=rf(_s)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var l=Bc(r)}catch(T){throw T===al?Gd:T}else l=r;r=Yn();var p=r.queue,y=p.dispatch;return a!==r.memoizedState&&(It.flags|=2048,ul(9,{destroy:void 0},jN.bind(null,p,a),null)),[l,y,n]}function jN(n,r){n.action=r}function S2(n){var r=Yn(),a=Sn;if(a!==null)return x2(r,a,n);Yn(),r=r.memoizedState,a=Yn();var l=a.queue.dispatch;return a.memoizedState=n,[r,l,!1]}function ul(n,r,a,l){return n={tag:n,create:a,deps:l,inst:r,next:null},r=It.updateQueue,r===null&&(r=tf(),It.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=n.next=n:(l=a.next,a.next=n,n.next=l,r.lastEffect=n),n}function w2(){return Yn().memoizedState}function sf(n,r,a,l){var p=Lr();It.flags|=n,p.memoizedState=ul(1|r,{destroy:void 0},a,l===void 0?null:l)}function af(n,r,a,l){var p=Yn();l=l===void 0?null:l;var y=p.memoizedState.inst;Sn!==null&&l!==null&&om(l,Sn.memoizedState.deps)?p.memoizedState=ul(r,y,a,l):(It.flags|=n,p.memoizedState=ul(1|r,y,a,l))}function E2(n,r){sf(8390656,8,n,r)}function ym(n,r){af(2048,8,n,r)}function IN(n){It.flags|=4;var r=It.updateQueue;if(r===null)r=tf(),It.updateQueue=r,r.events=[n];else{var a=r.events;a===null?r.events=[n]:a.push(n)}}function R2(n){var r=Yn().memoizedState;return IN({ref:r,nextImpl:n}),function(){if((cn&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function C2(n,r){return af(4,2,n,r)}function T2(n,r){return af(4,4,n,r)}function k2(n,r){if(typeof r=="function"){n=n();var a=r(n);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function O2(n,r,a){a=a!=null?a.concat([n]):null,af(4,4,k2.bind(null,r,n),a)}function vm(){}function A2(n,r){var a=Yn();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&om(r,l[1])?l[0]:(a.memoizedState=[n,r],n)}function M2(n,r){var a=Yn();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&om(r,l[1]))return l[0];if(l=n(),mo){$e(!0);try{n()}finally{$e(!1)}}return a.memoizedState=[l,r],l}function bm(n,r,a){return a===void 0||(zs&1073741824)!==0&&(Jt&261930)===0?n.memoizedState=r:(n.memoizedState=a,n=H1(),It.lanes|=n,wa|=n,a)}function N2(n,r,a,l){return oi(a,r)?a:ma.current!==null?(n=bm(n,a,l),oi(n,r)||(Zn=!0),n):(zs&106)===0||(zs&1073741824)!==0&&(Jt&261930)===0?(Zn=!0,n.memoizedState=a):(n=H1(),It.lanes|=n,wa|=n,r)}function D2(n,r,a,l,p){var y=ue.p;ue.p=y!==0&&8>y?y:8;var T=ge.T,P={};P.types=T!==null?T.types:null,ge.T=P,wm(n,!1,r,a);try{var Z=p(),ae=ge.S;if(ae!==null&&ae(P,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var pe=AN(Z,l);Vc(n,r,pe,fi(n))}else Vc(n,r,l,fi(n))}catch(Ce){Vc(n,r,{then:function(){},status:"rejected",reason:Ce},fi())}finally{ue.p=y,T!==null&&P.types!==null&&(T.types=P.types),ge.T=T}}function PN(){}function xm(n,r,a,l){if(n.tag!==5)throw Error(s(476));var p=j2(n).queue;D2(n,p,r,Te,a===null?PN:function(){return I2(n),a(l)})}function j2(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:Te,baseState:Te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:Te},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:a},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function I2(n){var r=j2(n);r.next===null&&(r=n.alternate.memoizedState),Vc(n,r.next.queue,{},fi())}function Sm(){return yr(Al)}function P2(){return Yn().memoizedState}function L2(){return Yn().memoizedState}function LN(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var a=fi();n=pa(a);var l=ga(r,n,a);l!==null&&(Qr(l,r,a),zc(l,r,a)),r={cache:Qg()},n.payload=r;return}r=r.return}}function zN(n,r,a){var l=fi();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},of(n)?_2(r,a):(a=Hg(n,r,a,l),a!==null&&(Qr(a,n,l),U2(a,r,l)))}function z2(n,r,a){var l=fi();Vc(n,r,a,l)}function Vc(n,r,a,l){var p={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(of(n))_2(r,p);else{var y=n.alternate;if(n.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var T=r.lastRenderedState,P=y(T,a);if(p.hasEagerState=!0,p.eagerState=P,oi(P,T))return zd(n,r,p,0),kn===null&&Ld(),!1}catch{}if(a=Hg(n,r,p,l),a!==null)return Qr(a,n,l),U2(a,r,l),!0}return!1}function wm(n,r,a,l){if(l={lane:2,revertLane:f0(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},of(n)){if(r)throw Error(s(479))}else r=Hg(n,a,l,2),r!==null&&Qr(r,n,2)}function of(n){var r=n.alternate;return n===It||r!==null&&r===It}function _2(n,r){ll=Wd=!0;var a=n.pending;a===null?r.next=r:(r.next=a.next,a.next=r),n.pending=r}function U2(n,r,a){if((a&4194048)!==0){var l=r.lanes;l&=n.pendingLanes,a|=l,r.lanes=a,On(n,a)}}var lf={readContext:yr,use:nf,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},H2={readContext:yr,use:nf,useCallback:function(n,r){return Lr().memoizedState=[n,r===void 0?null:r],n},useContext:yr,useEffect:E2,useImperativeHandle:function(n,r,a){a=a!=null?a.concat([n]):null,sf(4194308,4,k2.bind(null,r,n),a)},useLayoutEffect:function(n,r){return sf(4194308,4,n,r)},useInsertionEffect:function(n,r){sf(4,2,n,r)},useMemo:function(n,r){var a=Lr();r=r===void 0?null:r;var l=n();if(mo){$e(!0);try{n()}finally{$e(!1)}}return a.memoizedState=[l,r],l},useReducer:function(n,r,a){var l=Lr();if(a!==void 0){var p=a(r);if(mo){$e(!0);try{a(r)}finally{$e(!1)}}}else p=r;return l.memoizedState=l.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},l.queue=n,n=n.dispatch=zN.bind(null,It,n),[l.memoizedState,n]},useRef:function(n){var r=Lr();return n={current:n},r.memoizedState=n},useState:function(n){n=gm(n);var r=n.queue,a=z2.bind(null,It,r);return r.dispatch=a,[n.memoizedState,a]},useDebugValue:vm,useDeferredValue:function(n,r){var a=Lr();return bm(a,n,r)},useTransition:function(){var n=gm(!1);return n=D2.bind(null,It,n.queue,!0,!1),Lr().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,a){var l=It,p=Lr();if(Vt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),kn===null)throw Error(s(349));(Jt&127)!==0||o2(l,r,a)}p.memoizedState=a;var y={value:a,getSnapshot:r};return p.queue=y,E2(c2.bind(null,l,y,n),[n]),l.flags|=2048,ul(9,{destroy:void 0},l2.bind(null,l,y,a,r),null),a},useId:function(){var n=Lr(),r=kn.identifierPrefix;if(Vt){var a=ns,l=ts;a=(l&~(1<<32-et(l)-1)).toString(32)+a,r="_"+r+"R_"+a,a=ef++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=MN++,r="_"+r+"r_"+a.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:Sm,useFormState:v2,useActionState:v2,useOptimistic:function(n){var r=Lr();r.memoizedState=r.baseState=n;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=wm.bind(null,It,!0,a),a.dispatch=r,[n,r]},useMemoCache:fm,useCacheRefresh:function(){return Lr().memoizedState=LN.bind(null,It)},useEffectEvent:function(n){var r=Lr(),a={impl:n};return r.memoizedState=a,function(){if((cn&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},F2={readContext:yr,use:nf,useCallback:A2,useContext:yr,useEffect:ym,useImperativeHandle:O2,useInsertionEffect:C2,useLayoutEffect:T2,useMemo:M2,useReducer:rf,useRef:w2,useState:function(){return rf(_s)},useDebugValue:vm,useDeferredValue:function(n,r){var a=Yn();return N2(a,Sn.memoizedState,n,r)},useTransition:function(){var n=rf(_s)[0],r=Yn().memoizedState;return[typeof n=="boolean"?n:Bc(n),r]},useSyncExternalStore:a2,useId:P2,useHostTransitionStatus:Sm,useFormState:b2,useActionState:b2,useOptimistic:function(n,r){var a=Yn();return f2(a,Sn,n,r)},useMemoCache:fm,useCacheRefresh:L2,useEffectEvent:R2},_N={readContext:yr,use:nf,useCallback:A2,useContext:yr,useEffect:ym,useImperativeHandle:O2,useInsertionEffect:C2,useLayoutEffect:T2,useMemo:M2,useReducer:pm,useRef:w2,useState:function(){return pm(_s)},useDebugValue:vm,useDeferredValue:function(n,r){var a=Yn();return Sn===null?bm(a,n,r):N2(a,Sn.memoizedState,n,r)},useTransition:function(){var n=pm(_s)[0],r=Yn().memoizedState;return[typeof n=="boolean"?n:Bc(n),r]},useSyncExternalStore:a2,useId:P2,useHostTransitionStatus:Sm,useFormState:S2,useActionState:S2,useOptimistic:function(n,r){var a=Yn();return Sn!==null?f2(a,Sn,n,r):(a.baseState=n,[n,a.queue.dispatch])},useMemoCache:fm,useCacheRefresh:L2,useEffectEvent:R2};function Em(n,r,a,l){r=n.memoizedState,a=a(l,r),a=a==null?r:D({},r,a),n.memoizedState=a,n.lanes===0&&(n.updateQueue.baseState=a)}var Rm={enqueueSetState:function(n,r,a){n=n._reactInternals;var l=fi(),p=pa(l);p.payload=r,a!=null&&(p.callback=a),r=ga(n,p,l),r!==null&&(Qr(r,n,l),zc(r,n,l))},enqueueReplaceState:function(n,r,a){n=n._reactInternals;var l=fi(),p=pa(l);p.tag=1,p.payload=r,a!=null&&(p.callback=a),r=ga(n,p,l),r!==null&&(Qr(r,n,l),zc(r,n,l))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var a=fi(),l=pa(a);l.tag=2,r!=null&&(l.callback=r),r=ga(n,l,a),r!==null&&(Qr(r,n,a),zc(r,n,a))}};function B2(n,r,a,l,p,y,T){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,y,T):r.prototype&&r.prototype.isPureReactComponent?!Ac(a,l)||!Ac(p,y):!0}function V2(n,r,a,l){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,l),r.state!==n&&Rm.enqueueReplaceState(r,r.state,null)}function yo(n,r){var a=r;if("ref"in r){a={};for(var l in r)l!=="ref"&&(a[l]=r[l])}if(n=n.defaultProps){a===r&&(a=D({},a));for(var p in n)a[p]===void 0&&(a[p]=n[p])}return a}function K2(n){Pd(n)}function q2(n){console.error(n)}function Y2(n){Pd(n)}function cf(n,r){try{var a=n.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function G2(n,r,a){try{var l=n.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Cm(n,r,a){return a=pa(a),a.tag=3,a.payload={element:null},a.callback=function(){cf(n,r)},a}function $2(n){return n=pa(n),n.tag=3,n}function Q2(n,r,a,l){var p=a.type.getDerivedStateFromError;if(typeof p=="function"){var y=l.value;n.payload=function(){return p(y)},n.callback=function(){G2(r,a,l)}}var T=a.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(n.callback=function(){G2(r,a,l),typeof p!="function"&&(Ea===null?Ea=new Set([this]):Ea.add(this));var P=l.stack;this.componentDidCatch(l.value,{componentStack:P!==null?P:""})})}function UN(n,r,a,l,p){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(r=a.alternate,r!==null&&lo(r,a,p,!0),a=vr.current,a!==null){switch(a.tag){case 31:case 13:case 19:return Tr===null?Mf():a.alternate===null&&Vn===0&&(Vn=3),a.flags&=-257,a.flags|=65536,a.lanes=p,l===$d?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),c0(n,l,p)),!1;case 22:return a.flags|=65536,l===$d?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([l]):a.add(l)),c0(n,l,p)),!1}throw Error(s(435,a.tag))}return c0(n,l,p),Mf(),!1}if(Vt)return r=vr.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,l!==qg&&(n=Error(s(422),{cause:l}),Dc(Ei(n,a)))):(l!==qg&&(r=Error(s(423),{cause:l}),Dc(Ei(r,a))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,l=Ei(l,a),p=Cm(n.stateNode,l,p),tm(n,p),Vn!==4&&(Vn=2)),!1;var y=Error(s(520),{cause:l});if(y=Ei(y,a),Zc===null?Zc=[y]:Zc.push(y),Vn!==4&&(Vn=2),r===null)return!0;l=Ei(l,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,n=p&-p,a.lanes|=n,n=Cm(a.stateNode,l,n),tm(a,n),!1;case 1:if(r=a.type,y=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ea===null||!Ea.has(y))))return a.flags|=65536,p&=-p,a.lanes|=p,p=$2(p),Q2(p,n,a,l),tm(a,p),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var Tm=Error(s(461)),Zn=!1;function rr(n,r,a,l){r.child=n===null?Wx(r,null,a,l):go(r,n.child,a,l)}function X2(n,r,a,l,p){a=a.render;var y=r.ref;if("ref"in l){var T={};for(var P in l)P!=="ref"&&(T[P]=l[P])}else T=l;return co(r),l=lm(n,r,a,T,y,p),P=cm(),n!==null&&!Zn?(um(n,r,p),Us(n,r,p)):(Vt&&P&&Fd(r),r.flags|=1,rr(n,r,l,p),r.child)}function Z2(n,r,a,l,p){if(n===null){var y=a.type;return typeof y=="function"&&!Fg(y)&&y.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=y,J2(n,r,y,l,p)):(n=Ud(a.type,null,l,r,r.mode,p),n.ref=r.ref,n.return=r,r.child=n)}if(y=n.child,!Im(n,p)){var T=y.memoizedProps;if(a=a.compare,a=a!==null?a:Ac,a(T,l)&&n.ref===r.ref)return Us(n,r,p)}return r.flags|=1,n=js(y,l),n.ref=r.ref,n.return=r,r.child=n}function J2(n,r,a,l,p){if(n!==null){var y=n.memoizedProps;if(Ac(y,l)&&n.ref===r.ref)if(Zn=!1,r.pendingProps=l=y,Im(n,p))(n.flags&131072)!==0&&(Zn=!0);else return r.lanes=n.lanes,Us(n,r,p)}return km(n,r,a,l,p)}function W2(n,r,a,l){var p=l.children,y=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((r.flags&128)!==0){if(y=y!==null?y.baseLanes|a:a,n!==null){for(l=r.child=n.child,p=0;l!==null;)p=p|l.lanes|l.childLanes,l=l.sibling;l=p&~y}else l=0,r.child=null;return e1(n,r,y,a,l)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&Yd(r,y!==null?y.cachePool:null),y!==null?n2(r,y):rm(),r2(r);else return l=r.lanes=536870912,e1(n,r,y!==null?y.baseLanes|a:a,a,l)}else y!==null?(Yd(r,y.cachePool),n2(r,y),va(),r.memoizedState=null):(n!==null&&Yd(r,null),rm(),va());return rr(n,r,p,a),r.child}function Kc(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function e1(n,r,a,l,p){var y=Zg();return y=y===null?null:{parent:Qn._currentValue,pool:y},r.memoizedState={baseLanes:a,cachePool:y},n!==null&&Yd(r,null),rm(),r2(r),n!==null&&lo(n,r,l,!0),r.childLanes=p,null}function uf(n,r){return r=df({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function t1(n,r,a){return go(r,n.child,null,a),n=uf(r,r.pendingProps),n.flags|=2,li(r),r.memoizedState=null,n}function HN(n,r,a){var l=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(Vt){if(l.mode==="hidden")return n=uf(r,l),r.lanes=536870912,n.memoizedState={baseLanes:0,cachePool:null},Kc(null,n);if(sm(r),(n=Mn)?(n=kS(n,Ti),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:la!==null?{id:ts,overflow:ns}:null,retryLane:536870912,hydrationErrors:null},a=_x(n),a.return=r,r.child=a,lr=r,Mn=null)):n=null,n===null)throw ua(r);return r.lanes=536870912,null}return uf(r,l)}var y=n.memoizedState;if(y!==null){var T=y.dehydrated;if(sm(r),p)if(r.flags&256)r.flags&=-257,r=t1(n,r,a);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(s(558));else if(Zn||lo(n,r,a,!1),p=(a&n.childLanes)!==0,Zn||p){if(ma.current===null){if(l=kn,l!==null&&(T=qt(l,a),T!==0&&T!==y.retryLane))throw y.retryLane=T,io(n,T),Qr(l,n,T),Tm;Mf()}r=t1(n,r,a)}else n=y.treeContext,Mn=Oi(T.nextSibling),lr=r,Vt=!0,ca=null,Ti=!1,n!==null&&Fx(r,n),r=uf(r,l),r.flags|=134221824;return r}return n=js(n.child,{mode:l.mode,children:l.children}),n.ref=r.ref,r.child=n,n.return=r,n}function dl(n,r){var a=r.ref;if(a===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(n===null||n.ref!==a)&&(r.flags|=4194816)}}function km(n,r,a,l,p){return co(r),a=lm(n,r,a,l,void 0,p),l=cm(),n!==null&&!Zn?(um(n,r,p),Us(n,r,p)):(Vt&&l&&Fd(r),r.flags|=1,rr(n,r,a,p),r.child)}function n1(n,r,a,l,p,y){return co(r),r.updateQueue=null,a=s2(r,l,a,p),i2(n),l=cm(),n!==null&&!Zn?(um(n,r,y),Us(n,r,y)):(Vt&&l&&Fd(r),r.flags|=1,rr(n,r,a,y),r.child)}function r1(n,r,a,l,p){if(co(r),r.stateNode===null){var y=tl,T=a.contextType;typeof T=="object"&&T!==null&&(y=yr(T)),y=new a(l,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Rm,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=l,y.state=r.memoizedState,y.refs={},Wg(r),T=a.contextType,y.context=typeof T=="object"&&T!==null?yr(T):tl,y.state=r.memoizedState,T=a.getDerivedStateFromProps,typeof T=="function"&&(Em(r,a,T,l),y.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(T=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),T!==y.state&&Rm.enqueueReplaceState(y,y.state,null),Uc(r,l,y,p),_c(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(n===null){y=r.stateNode;var P=r.memoizedProps,Z=yo(a,P);y.props=Z;var ae=y.context,pe=a.contextType;T=tl,typeof pe=="object"&&pe!==null&&(T=yr(pe));var Ce=a.getDerivedStateFromProps;pe=typeof Ce=="function"||typeof y.getSnapshotBeforeUpdate=="function",P=r.pendingProps!==P,pe||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(P||ae!==T)&&V2(r,y,l,T),ha=!1;var ie=r.memoizedState;y.state=ie,Uc(r,l,y,p),_c(),ae=r.memoizedState,P||ie!==ae||ha?(typeof Ce=="function"&&(Em(r,a,Ce,l),ae=r.memoizedState),(Z=ha||B2(r,a,Z,l,ie,ae,T))?(pe||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=ae),y.props=l,y.state=ae,y.context=T,l=Z):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{y=r.stateNode,em(n,r),T=r.memoizedProps,pe=yo(a,T),y.props=pe,Ce=r.pendingProps,ie=y.context,ae=a.contextType,Z=tl,typeof ae=="object"&&ae!==null&&(Z=yr(ae)),P=a.getDerivedStateFromProps,(ae=typeof P=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(T!==Ce||ie!==Z)&&V2(r,y,l,Z),ha=!1,ie=r.memoizedState,y.state=ie,Uc(r,l,y,p),_c();var fe=r.memoizedState;T!==Ce||ie!==fe||ha||n!==null&&n.dependencies!==null&&Kd(n.dependencies)?(typeof P=="function"&&(Em(r,a,P,l),fe=r.memoizedState),(pe=ha||B2(r,a,pe,l,ie,fe,Z)||n!==null&&n.dependencies!==null&&Kd(n.dependencies))?(ae||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(l,fe,Z),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(l,fe,Z)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=fe),y.props=l,y.state=fe,y.context=Z,l=pe):(typeof y.componentDidUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(r.flags|=1024),l=!1)}return y=l,dl(n,r),l=(r.flags&128)!==0,y||l?(y=r.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,n!==null&&l?(r.child=go(r,n.child,null,p),r.child=go(r,null,a,p)):rr(n,r,a,p),r.memoizedState=y.state,n=r.child):n=Us(n,r,p),n}function i1(n,r,a,l){return ao(),r.flags|=256,rr(n,r,a,l),r.child}var Om={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Am(n){return{baseLanes:n,cachePool:Gx()}}function Mm(n,r,a){return n=n!==null?n.childLanes&~a:0,r&&(n|=di),n}function s1(n,r,a){var l=r.pendingProps,p=!1,y=(r.flags&128)!==0,T;if((T=y)||(T=n!==null&&n.memoizedState===null?!1:(br.current&2)!==0),T&&(p=!0,r.flags&=-129),T=(r.flags&32)!==0,r.flags&=-33,n===null){if(Vt){if(p?ya(r):va(),(n=Mn)?(n=kS(n,Ti),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:la!==null?{id:ts,overflow:ns}:null,retryLane:536870912,hydrationErrors:null},a=_x(n),a.return=r,r.child=a,lr=r,Mn=null)):n=null,n===null)throw ua(r);return A0(n)?r.lanes=32:r.lanes=536870912,null}return y=l.children,l=l.fallback,p?(va(),p=r.mode,y=df({mode:"hidden",children:y},p),l=so(l,p,a,null),y.return=r,l.return=r,y.sibling=l,r.child=y,l=r.child,l.memoizedState=Am(a),l.childLanes=Mm(n,T,a),r.memoizedState=Om,Kc(null,l)):(ya(r),Nm(r,y))}var P=n.memoizedState;if(P!==null){var Z=P.dehydrated;if(Z!==null)return FN(n,r,y,T,l,Z,P,a)}return p?(va(),p=l.fallback,y=r.mode,P=n.child,Z=P.sibling,l=js(P,{mode:"hidden",children:l.children}),l.subtreeFlags=P.subtreeFlags&1206910976,Z!==null?p=js(Z,p):(p=so(p,y,a,null),p.flags|=2),p.return=r,l.return=r,l.sibling=p,r.child=l,Kc(null,l),l=r.child,p=n.child.memoizedState,p===null?p=Am(a):(y=p.cachePool,y!==null?(P=Qn._currentValue,y=y.parent!==P?{parent:P,pool:P}:y):y=Gx(),p={baseLanes:p.baseLanes|a,cachePool:y}),l.memoizedState=p,l.childLanes=Mm(n,T,a),r.memoizedState=Om,Kc(n.child,l)):(ya(r),a=n.child,n=a.sibling,a=js(a,{mode:"visible",children:l.children}),a.return=r,a.sibling=null,n!==null&&(T=r.deletions,T===null?(r.deletions=[n],r.flags|=16):T.push(n)),r.child=a,r.memoizedState=null,a)}function Nm(n,r){return r=df({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function df(n,r){return n=qr(22,n,null,r),n.lanes=0,n}function ff(n,r,a){return go(r,n.child,null,a),n=Nm(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function FN(n,r,a,l,p,y,T,P){if(a)return r.flags&256?(ya(r),r.flags&=-257,ff(n,r,P)):r.memoizedState!==null?(va(),r.child=n.child,r.flags|=128,null):(va(),y=p.fallback,T=r.mode,p=df({mode:"visible",children:p.children},T),y=so(y,T,P,null),y.flags|=2,p.return=r,y.return=r,p.sibling=y,r.child=p,go(r,n.child,null,P),p=r.child,p.memoizedState=Am(P),p.childLanes=Mm(n,l,P),r.memoizedState=Om,Kc(null,p));if(ya(r),A0(y)){if(l=y.nextSibling&&y.nextSibling.dataset,l)var Z=l.dgst;return l=Z,l!==""&&(p=Error(s(419)),p.stack="",p.digest=l,Dc({value:p,source:null,stack:null})),ff(n,r,P)}if(Zn||lo(n,r,P,!1),l=(P&n.childLanes)!==0,Zn||l){if(ma.current!==null)return ff(n,r,P);if(l=kn,l!==null&&(p=qt(l,P),p!==0&&p!==T.retryLane))throw T.retryLane=p,io(n,p),Qr(l,n,p),Tm;return O0(y)||Mf(),ff(n,r,P)}return O0(y)?(r.flags|=192,r.child=n.child,null):(n=T.treeContext,Mn=Oi(y.nextSibling),lr=r,Vt=!0,ca=null,Ti=!1,n!==null&&Fx(r,n),r=Nm(r,p.children),r.flags|=134221824,r)}function a1(n,r,a){n.lanes|=r;var l=n.alternate;l!==null&&(l.lanes|=r),Vd(n.return,r,a)}function o1(n){for(var r=null;n!==null;){var a=n.alternate;a!==null&&Jd(a)===null&&(r=n),n=n.sibling}return r}function hf(n,r,a,l,p,y){var T=n.memoizedState;T===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:p,treeForkCount:y}:(T.isBackwards=r,T.rendering=null,T.renderingStartTime=0,T.last=l,T.tail=a,T.tailMode=p,T.treeForkCount=y)}function Dm(n){var r=n.child;for(n.child=null;r!==null;){var a=r.sibling;r.sibling=n.child,n.child=r,r=a}}function jm(n,r,a){var l=r.pendingProps,p=l.revealOrder,y=l.tail;l=l.children;var T=br.current;if(r.flags&128)return Hc(r,T),null;var P=(T&2)!==0;if(P?(T=T&1|2,r.flags|=128):T&=1,Hc(r,T),p==="backwards"&&n!==null?(Dm(n),rr(n,r,l,a),Dm(n)):rr(n,r,l,a),l=Vt?Nc:0,!P&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&a1(n,a,r);else if(n.tag===19)a1(n,a,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"backwards":a=o1(r.child),a===null?(p=r.child,r.child=null):(p=a.sibling,a.sibling=null,Dm(r)),hf(r,!0,p,null,y,l);break;case"unstable_legacy-backwards":for(a=null,p=r.child,r.child=null;p!==null;){if(n=p.alternate,n!==null&&Jd(n)===null){r.child=p;break}n=p.sibling,p.sibling=a,a=p,p=n}hf(r,!0,a,null,y,l);break;case"together":hf(r,!1,null,null,void 0,l);break;case"independent":r.memoizedState=null;break;default:a=o1(r.child),a===null?(p=r.child,r.child=null):(p=a.sibling,a.sibling=null),hf(r,!1,p,a,y,l)}return r.child}function l1(n,r,a){var l=r.pendingProps;return da(r,r.type,l.value),rr(n,r,l.children,a),r.child}function Us(n,r,a){if(n!==null&&(r.dependencies=n.dependencies),wa|=r.lanes,(a&r.childLanes)===0)if(n!==null){if(lo(n,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(s(153));if(r.child!==null){for(n=r.child,a=js(n,n.pendingProps),r.child=a,a.return=r;n.sibling!==null;)n=n.sibling,a=a.sibling=js(n,n.pendingProps),a.return=r;a.sibling=null}return r.child}function Im(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&Kd(n)))}function BN(n,r,a){switch(r.tag){case 3:Ze(r,r.stateNode.containerInfo),da(r,Qn,n.memoizedState.cache),ao();break;case 27:case 5:de(r);break;case 4:Ze(r,r.stateNode.containerInfo);break;case 10:da(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,sm(r),null;break;case 13:var l=r.memoizedState;if(l!==null){if(l.dehydrated!==null)return ya(r),r.flags|=128,null;l=lo(n,r,a,!1);var p=r.child.childLanes;return l||(a&p)!==0?s1(n,r,a):(ya(r),n=Us(n,r,a),n!==null?n.sibling:null)}ya(r);break;case 19:if(r.flags&128)return jm(n,r,a);if(p=(n.flags&128)!==0,l=(a&r.childLanes)!==0,l||(lo(n,r,a,!1),l=(a&r.childLanes)!==0),p){if(l)return jm(n,r,a);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Hc(r,br.current),l)break;return null;case 22:return r.lanes=0,W2(n,r,a,r.pendingProps);case 24:da(r,Qn,n.memoizedState.cache)}return Us(n,r,a)}function c1(n,r,a){if(n!==null)if(n.memoizedProps!==r.pendingProps)Zn=!0;else{if(!Im(n,a)&&(r.flags&128)===0)return Zn=!1,BN(n,r,a);Zn=(n.flags&131072)!==0}else Zn=!1,Vt&&(r.flags&1048576)!==0&&Hx(r,Nc,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(n=ho(r.elementType),r.type=n,typeof n=="function")Fg(n)?(l=yo(n,l),r.tag=1,r=r1(null,r,n,l,a)):(r.tag=0,r=km(null,r,n,l,a));else{if(n!=null){var p=n.$$typeof;if(p===z){r.tag=11,r=X2(null,r,n,l,a);break e}else if(p===K){r.tag=14,r=Z2(null,r,n,l,a);break e}else if(p===U){r.tag=10,r.type=n,r=l1(null,r,a);break e}}throw r=le(n)||n,Error(s(306,r,""))}}return r;case 0:return km(n,r,r.type,r.pendingProps,a);case 1:return l=r.type,p=yo(l,r.pendingProps),r1(n,r,l,p,a);case 3:e:{if(Ze(r,r.stateNode.containerInfo),n===null)throw Error(s(387));l=r.pendingProps;var y=r.memoizedState;p=y.element,em(n,r),Uc(r,l,null,a);var T=r.memoizedState;if(l=T.cache,da(r,Qn,l),l!==y.cache&&$g(r,[Qn],a,!0),_c(),l=T.element,y.isDehydrated)if(y={element:l,isDehydrated:!1,cache:T.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=i1(n,r,l,a);break e}else if(l!==p){p=Ei(Error(s(424)),r),Dc(p),r=i1(n,r,l,a);break e}else for(n=r.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Mn=Oi(n.firstChild),lr=r,Vt=!0,ca=null,Ti=!0,a=Wx(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling;else{if(ao(),l===p){r=Us(n,r,a);break e}rr(n,r,l,a)}r=r.child}return r;case 26:return dl(n,r),n===null?(a=IS(r.type,null,r.pendingProps,null))?r.memoizedState=a:Vt||(r.stateNode=hS(r.type,r.pendingProps,be.current,r)):r.memoizedState=IS(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return de(r),n===null&&Vt&&(l=r.stateNode=MS(r.type,r.pendingProps,be.current),lr=r,Ti=!0,p=Mn,Ta(r.type)?(M0=p,Mn=Oi(l.firstChild)):Mn=p),rr(n,r,r.pendingProps.children,a),dl(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&Vt&&((p=l=Mn)&&(l=LD(l,r.type,r.pendingProps,Ti),l!==null?(r.stateNode=l,lr=r,Mn=Oi(l.firstChild),Ti=!1,p=!0):p=!1),p||ua(r)),de(r),p=r.type,y=r.pendingProps,T=n!==null?n.memoizedProps:null,l=y.children,S0(p,y)?l=null:T!==null&&S0(p,T)&&(r.flags|=32),r.memoizedState!==null&&(p=lm(n,r,NN,null,null,a),Al._currentValue=p),dl(n,r),rr(n,r,l,a),r.child;case 6:return n===null&&Vt&&((n=a=Mn)&&(a=zD(a,r.pendingProps,Ti),a!==null?(r.stateNode=a,lr=r,Mn=null,n=!0):n=!1),n||ua(r)),null;case 13:return s1(n,r,a);case 4:return Ze(r,r.stateNode.containerInfo),l=r.pendingProps,n===null?r.child=go(r,null,l,a):rr(n,r,l,a),r.child;case 11:return X2(n,r,r.type,r.pendingProps,a);case 7:return l=r.pendingProps,dl(n,r),rr(n,r,l,a),r.child;case 8:return rr(n,r,r.pendingProps.children,a),r.child;case 12:return rr(n,r,r.pendingProps.children,a),r.child;case 10:return l1(n,r,a);case 9:return p=r.type._context,l=r.pendingProps.children,co(r),p=yr(p),l=l(p),r.flags|=1,rr(n,r,l,a),r.child;case 14:return Z2(n,r,r.type,r.pendingProps,a);case 15:return J2(n,r,r.type,r.pendingProps,a);case 19:return jm(n,r,a);case 31:return HN(n,r,a);case 22:return W2(n,r,a,r.pendingProps);case 24:return co(r),l=yr(Qn),n===null?(p=Zg(),p===null&&(p=kn,y=Qg(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=a),p=y),r.memoizedState={parent:l,cache:p},Wg(r),da(r,Qn,p)):((n.lanes&a)!==0&&(em(n,r),Uc(r,null,null,a),_c()),p=n.memoizedState,y=r.memoizedState,p.parent!==l?(p={parent:l,cache:l},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),da(r,Qn,l)):(l=y.cache,da(r,Qn,l),l!==p.cache&&$g(r,[Qn],a,!0))),rr(n,r,r.pendingProps.children,a),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|=n===null?18882560:18874368:Vt&&Fd(r),n!==null&&n.memoizedProps.name!==l.name?r.flags|=4194816:dl(n,r),rr(n,r,l.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Hs(n){n.flags|=4}function Pm(n,r,a,l,p){var y;if((y=(n.mode&32)!==0)&&(y=a===null?_S(r,l):_S(r,l)&&(l.src!==a.src||l.srcSet!==a.srcSet)),y){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(K1())n.flags|=8192;else throw po=$d,Jg}else n.flags&=-16777217}function u1(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!US(r))if(K1())n.flags|=8192;else throw po=$d,Jg}function pf(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?tt():536870912,n.lanes|=r,ml|=r)}function qc(n,r){if(!Vt)switch(n.tailMode){case"visible":break;case"collapsed":for(var a=n.tail,l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:l.sibling=null;break;default:for(r=n.tail,a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?n.tail=null:a.sibling=null}}function Nn(n){var r=n.alternate!==null&&n.alternate.child===n.child,a=0,l=0;if(r)for(var p=n.child;p!==null;)a|=p.lanes|p.childLanes,l|=p.subtreeFlags&1206910976,l|=p.flags&1206910976,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)a|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=l,n.childLanes=a,r}function VN(n,r,a){var l=r.pendingProps;switch(Kg(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nn(r),null;case 1:return Nn(r),null;case 3:return a=r.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Ls(Qn),ot(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(n===null||n.child===null)&&(il(r)?Hs(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Yg())),Nn(r),null;case 26:var p=r.type,y=r.memoizedState;return n===null?(Hs(r),y!==null?(Nn(r),u1(r,y)):(Nn(r),Pm(r,p,null,l,a))):y?y!==n.memoizedState?(Hs(r),Nn(r),u1(r,y)):(Nn(r),r.flags&=-16777217):(n=n.memoizedProps,n!==l&&Hs(r),Nn(r),Pm(r,p,n,l,a)),null;case 27:if(we(r),a=be.current,p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==l&&Hs(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Nn(r),r.subtreeFlags&=-33554433,null}n=ke.current,il(r)?Bx(r):(n=MS(p,l,a),r.stateNode=n,Hs(r))}return Nn(r),r.subtreeFlags&=-33554433,null;case 5:if(we(r),p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==l&&Hs(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Nn(r),r.subtreeFlags&=-33554433,null}if(y=ke.current,il(r))Bx(r);else{var T=nu(be.current);switch(y){case 1:y=T.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=T.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=T.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=T.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=T.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof l.is=="string"?T.createElement("select",{is:l.is}):T.createElement("select"),l.multiple?y.multiple=!0:l.size&&(y.size=l.size);break;default:y=typeof l.is=="string"?T.createElement(p,{is:l.is}):T.createElement(p)}}y[fn]=r,y[An]=l;e:for(T=r.child;T!==null;){if(T.tag===5||T.tag===6)y.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&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}r.stateNode=y;e:switch(Sr(y,p,l),p){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Hs(r)}}return Nn(r),r.subtreeFlags&=-33554433,Pm(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,a),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==l&&Hs(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(n=be.current,il(r)){if(n=r.stateNode,a=r.memoizedProps,l=null,p=lr,p!==null)switch(p.tag){case 27:case 5:l=p.memoizedProps}n[fn]=r,n=!!(n.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||cS(n.nodeValue,a)),n||ua(r,!0)}else n=nu(n).createTextNode(l),n[fn]=r,r.stateNode=n}return Nn(r),null;case 31:if(a=r.memoizedState,n===null||n.memoizedState!==null){if(l=il(r),a!==null){if(n===null){if(!l)throw Error(s(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[fn]=r}else ao(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nn(r),n=!1}else a=Yg(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=a),n=!0;if(!n)return r.flags&256?(li(r),r):(li(r),null);if((r.flags&128)!==0)throw Error(s(558))}return Nn(r),null;case 13:if(l=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=il(r),l!==null&&l.dehydrated!==null){if(n===null){if(!p)throw Error(s(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[fn]=r}else ao(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nn(r),p=!1}else p=Yg(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(li(r),r):(li(r),null)}return li(r),(r.flags&128)!==0?(r.lanes=a,r):(a=l!==null,n=n!==null&&n.memoizedState!==null,a&&(l=r.child,p=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(p=l.alternate.memoizedState.cachePool.pool),y=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(y=l.memoizedState.cachePool.pool),y!==p&&(l.flags|=2048)),a!==n&&a&&(r.child.flags|=8192),pf(r,r.updateQueue),Nn(r),null);case 4:return ot(),n===null&&m0(r.stateNode.containerInfo),r.flags|=67108864,Nn(r),null;case 10:return Ls(r.type),Nn(r),null;case 19:if(am(r),l=r.memoizedState,l===null)return Nn(r),null;if(p=(r.flags&128)!==0,y=l.rendering,y===null)if(p)qc(l,!1);else{if(Vn!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(y=Jd(n),y!==null){for(r.flags|=128,qc(l,!1),n=y.updateQueue,r.updateQueue=n,pf(r,n),r.subtreeFlags=0,n=a,a=r.child;a!==null;)zx(a,n),a=a.sibling;return Hc(r,br.current&1|2),Vt&&Is(r,l.treeForkCount),r.child}n=n.sibling}l.tail!==null&&wt()>Tf&&(r.flags|=128,p=!0,qc(l,!1),r.lanes=4194304)}else{if(!p)if(n=Jd(y),n!==null){if(r.flags|=128,p=!0,n=n.updateQueue,r.updateQueue=n,pf(r,n),qc(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!y.alternate&&!Vt)return Nn(r),null}else 2*wt()-l.renderingStartTime>Tf&&a!==536870912&&(r.flags|=128,p=!0,qc(l,!1),r.lanes=4194304);l.isBackwards?(y.sibling=r.child,r.child=y):(n=l.last,n!==null?n.sibling=y:r.child=y,l.last=y)}if(l.tail!==null){n=l.tail;e:{for(a=n;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return l.rendering=n,l.tail=n.sibling,l.renderingStartTime=wt(),n.sibling=null,y=br.current,y=p?y&1|2:y&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!a||Vt?Hc(r,y):(a=y,Ve(vr,r),Ve(br,a),Tr===null&&(Tr=r)),Vt&&Is(r,l.treeForkCount),n}return Nn(r),null;case 22:case 23:return li(r),im(),l=r.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(a&536870912)!==0&&(r.flags&128)===0&&(Nn(r),r.subtreeFlags&6&&(r.flags|=8192)):Nn(r),a=r.updateQueue,a!==null&&pf(r,a.retryQueue),a=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==a&&(r.flags|=2048),n!==null&&Le(fo),null;case 24:return a=null,n!==null&&(a=n.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Ls(Qn),Nn(r),null;case 25:return null;case 30:return r.flags|=33554432,Nn(r),null}throw Error(s(156,r.tag))}function KN(n,r){switch(Kg(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return Ls(Qn),ot(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return we(r),null;case 31:if(r.memoizedState!==null){if(li(r),r.alternate===null)throw Error(s(340));ao()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(li(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(s(340));ao()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return am(r),n=r.flags,n&65536?(r.flags=n&-65537|128,n=r.memoizedState,n!==null&&(n.rendering=null,n.tail=null),r.flags|=4,r):null;case 4:return ot(),null;case 10:return Ls(r.type),null;case 22:case 23:return li(r),im(),n!==null&&Le(fo),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return Ls(Qn),null;case 25:return null;default:return null}}function d1(n,r){switch(Kg(r),r.tag){case 3:Ls(Qn),ot();break;case 26:case 27:case 5:we(r);break;case 4:ot();break;case 31:r.memoizedState!==null&&li(r);break;case 13:li(r);break;case 19:am(r);break;case 10:Ls(r.type);break;case 22:case 23:li(r),im(),n!==null&&Le(fo);break;case 24:Ls(Qn)}}function Yc(n,r){try{var a=r.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var p=l.next;a=p;do{if((a.tag&n)===n){l=void 0;var y=a.create,T=a.inst;l=y(),T.destroy=l}a=a.next}while(a!==p)}}catch(P){yn(r,r.return,P)}}function ba(n,r,a){try{var l=r.updateQueue,p=l!==null?l.lastEffect:null;if(p!==null){var y=p.next;l=y;do{if((l.tag&n)===n){var T=l.inst,P=T.destroy;if(P!==void 0){T.destroy=void 0,p=r;var Z=a,ae=P;try{ae()}catch(pe){yn(p,Z,pe)}}}l=l.next}while(l!==y)}}catch(pe){yn(r,r.return,pe)}}function f1(n){var r=n.updateQueue;if(r!==null){var a=n.stateNode;try{t2(r,a)}catch(l){yn(n,n.return,l)}}}function h1(n,r,a){a.props=yo(n.type,n.memoizedProps),a.state=n.memoizedState;try{a.componentWillUnmount()}catch(l){yn(n,r,l)}}function rs(n,r){try{var a=n.ref;if(a!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:var p=n.stateNode,y=Ns(n.memoizedProps,p);(p.ref===null||p.ref.name!==y)&&(p.ref=xS(y)),l=p.ref;break;case 7:if(n.stateNode===null){var T=new hi(n);h(n.child,!1,ID,T,void 0,void 0),n.stateNode=T}l=n.stateNode;break;default:l=n.stateNode}typeof a=="function"?n.refCleanup=a(l):a.current=l}}catch(P){yn(n,r,P)}}function xr(n,r){var a=n.ref,l=n.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(p){yn(n,r,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(p){yn(n,r,p)}else a.current=null}function gf(n,r){if((n.tag===5||n.tag===27||n.tag===6)&&n.alternate===null&&r!==null)for(var a=0;a<r.length;a++)TS(n.stateNode,r[a])}function p1(n){for(var r=n.return;r!==null&&(zm(r)&&TS(n.stateNode,r.stateNode),!Lm(r));)r=r.return}function Gc(n){for(var r=n.return;r!==null&&(zm(r)&&PD(n.stateNode,r.stateNode),!Lm(r));)r=r.return}function Lm(n){return n.tag===5||n.tag===3||n.tag===27}function zm(n){return n&&n.tag===7&&n.stateNode!==null}function _m(n){var r=n.type,a=n.memoizedProps,l=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(p){yn(n,n.return,p)}}function Um(n,r,a){try{var l=n.stateNode;mD(l,n.type,a,r),l[An]=r}catch(p){yn(n,n.return,p)}}function g1(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Ta(n.type)||n.tag===4}function Hm(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||g1(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Ta(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Fm(n,r,a,l){var p=n.tag;if(p===5||p===6)p=n.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(p,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(p),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=Ir)),gf(n,l),gt=!0;else if(p!==4&&(p===27&&(gf(n,l),l=null,Ta(n.type)&&(a=n.stateNode,r=null)),n=n.child,n!==null))for(Fm(n,r,a,l),n=n.sibling;n!==null;)Fm(n,r,a,l),n=n.sibling}function mf(n,r,a,l){var p=n.tag;if(p===5||p===6)p=n.stateNode,r?a.insertBefore(p,r):a.appendChild(p),gf(n,l),gt=!0;else if(p!==4&&(p===27&&(gf(n,l),l=null,Ta(n.type)&&(a=n.stateNode)),n=n.child,n!==null))for(mf(n,r,a,l),n=n.sibling;n!==null;)mf(n,r,a,l),n=n.sibling}function m1(n){var r=n.stateNode,a=n.memoizedProps;try{for(var l=n.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Sr(r,l,a),r[fn]=n,r[An]=a}catch(y){yn(n,n.return,y)}}var yf=!1,ci=null;function y1(n){(n.tag===30||(n.subtreeFlags&33554432)!==0)&&(yf=!0)}var is=null;function v1(){var n=is;return is=null,n}var Yr=0;function fl(n,r,a,l,p){return Yr=0,b1(n.child,r,a,l,p)}function b1(n,r,a,l,p){for(var y=!1;n!==null;){if(n.tag===5){var T=n.stateNode;if(l!==null){var P=R0(T);l.push(P),P.view&&(y=!0)}else y||R0(T).view&&(y=!0);yf=!0,vS(T,Yr===0?r:r+"_"+Yr,a),Yr++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&p||b1(n.child,r,a,l,p)&&(y=!0));n=n.sibling}return y}function ss(n,r){for(;n!==null;)n.tag===5?bS(n.stateNode,n.memoizedProps):(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&r||ss(n.child,r)),n=n.sibling}function vf(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if((n.tag!==22||n.memoizedState===null)&&(vf(n),n.tag===30&&(n.flags&18874368)!==0&&n.stateNode.paired)){var r=n.memoizedProps;if(r.name==null||r.name==="auto")throw Error(s(544));var a=r.name;r=Ds(r.default,r.share),r!=="none"&&(fl(n,a,r,null,!1)||ss(n.child,!1))}n=n.sibling}}function Bm(n,r){if(n.tag===30){var a=n.stateNode,l=n.memoizedProps,p=Ns(l,a),y=Ds(l.default,a.paired?l.share:l.enter);y!=="none"?fl(n,p,y,null,!1)?(vf(n),a.paired||r||xl(n,l.onEnter)):ss(n.child,!1):vf(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Bm(n,r),n=n.sibling;else vf(n)}function Vm(n){if(ci!==null&&ci.size!==0){var r=ci;if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var a=n.memoizedProps,l=a.name;if(l!=null&&l!=="auto"){var p=r.get(l);if(p!==void 0){var y=Ds(a.default,a.share);if(y!=="none"&&(fl(n,l,y,null,!1)?(y=n.stateNode,p.paired=y,y.paired=p,xl(n,a.onShare)):ss(n.child,!1)),r.delete(l),r.size===0)break}}}Vm(n)}n=n.sibling}}}function Km(n){if(n.tag===30){var r=n.memoizedProps,a=Ns(r,n.stateNode),l=ci!==null?ci.get(a):void 0,p=Ds(r.default,l!==void 0?r.share:r.exit);p!=="none"&&(fl(n,a,p,null,!1)?l!==void 0?(p=n.stateNode,l.paired=p,p.paired=l,ci.delete(a),xl(n,r.onShare)):xl(n,r.onExit):ss(n.child,!1)),ci!==null&&Vm(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Km(n),n=n.sibling;else ci!==null&&Vm(n)}function x1(n){for(n=n.child;n!==null;){if(n.tag===30){var r=n.memoizedProps,a=Ns(r,n.stateNode);r=Ds(r.default,r.update),n.flags&=-5,r!=="none"&&fl(n,a,r,n.memoizedState=[],!1)}else(n.subtreeFlags&33554432)!==0&&x1(n);n=n.sibling}}function qm(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var r=n.stateNode;r.paired!==null&&(r.paired=null,ss(n.child,!1))}qm(n)}n=n.sibling}}function bf(n){if(n.tag===30)n.stateNode.paired=null,ss(n.child,!1),qm(n);else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)bf(n),n=n.sibling;else qm(n)}function S1(n){for(n=n.child;n!==null;)n.tag===30?ss(n.child,!1):(n.subtreeFlags&33554432)!==0&&S1(n),n=n.sibling}function Ym(n,r,a,l,p,y,T){for(var P=!1;r!==null;){if(r.tag===5){var Z=r.stateNode;if(y!==null&&Yr<y.length){var ae=y[Yr],pe=R0(Z);(ae.view||pe.view)&&(P=!0);var Ce;if(Ce=(n.flags&4)===0)if(pe.clip)Ce=!0;else{Ce=ae.rect;var ie=pe.rect;Ce=Ce.y!==ie.y||Ce.x!==ie.x||Ce.height!==ie.height||Ce.width!==ie.width}Ce&&(n.flags|=4),pe.abs?pe=!ae.abs:(ae=ae.rect,pe=pe.rect,pe=ae.height!==pe.height||ae.width!==pe.width),pe&&(n.flags|=32)}else n.flags|=32;(n.flags&4)!==0&&vS(Z,Yr===0?a:a+"_"+Yr,p),P&&(n.flags&4)!==0||(is===null&&(is=[]),is.push(Z,Yr===0?l:l+"_"+Yr,r.memoizedProps)),Yr++}else(r.tag!==22||r.memoizedState===null)&&(r.tag===30&&T?n.flags|=r.flags&32:Ym(n,r.child,a,l,p,y,T)&&(P=!0));r=r.sibling}return P}function w1(n,r){for(n=n.child;n!==null;){if(n.tag===30){var a=n.memoizedProps,l=n.stateNode,p=Ns(a,l),y=Ds(a.default,a.update),T;T=n.memoizedState,n.memoizedState=null,l=n;var P=n.child;Yr=0,p=Ym(l,P,p,p,y,T,!1),(n.flags&4)!==0&&p&&xl(n,a.onUpdate)}else(n.subtreeFlags&33554432)!==0&&w1(n);n=n.sibling}}var cr=!1,pn=!1,as=!1,Gm=!1,E1=typeof WeakSet=="function"?WeakSet:Set,ur=null,os=!1,$c=!1,xf=!1,$m=!1;function qN(n,r,a){if(n=n.containerInfo,b0=Ml,n=kx(n),Ig(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var p=l.getSelection&&l.getSelection();if(p&&p.rangeCount!==0){l=p.anchorNode;var y=p.anchorOffset,T=p.focusNode;p=p.focusOffset;try{l.nodeType,T.nodeType}catch{l=null;break e}var P=0,Z=-1,ae=-1,pe=0,Ce=0,ie=n,fe=null;t:for(;;){for(var Ye;ie!==l||y!==0&&ie.nodeType!==3||(Z=P+y),ie!==T||p!==0&&ie.nodeType!==3||(ae=P+p),ie.nodeType===3&&(P+=ie.nodeValue.length),(Ye=ie.firstChild)!==null;)fe=ie,ie=Ye;for(;;){if(ie===n)break t;if(fe===l&&++pe===y&&(Z=P),fe===T&&++Ce===p&&(ae=P),(Ye=ie.nextSibling)!==null)break;ie=fe,fe=ie.parentNode}ie=Ye}l=Z===-1||ae===-1?null:{start:Z,end:ae}}else l=null}l=l||{start:0,end:0}}else l=null;for(x0={focusedElem:n,selectionRange:l},Ml=!1,a=(a&335544064)===a,ur=r,r=a?9270:1024;ur!==null;){if(n=ur,a&&(l=n.deletions,l!==null))for(y=0;y<l.length;y++)a&&Km(l[y]);if(n.alternate===null&&(n.flags&2)!==0)a&&y1(n),Sf(a);else{if(n.tag===22){if(l=n.alternate,n.memoizedState!==null){l!==null&&l.memoizedState===null&&a&&Km(l),Sf(a);continue}else if(l!==null&&l.memoizedState!==null){a&&y1(n),Sf(a);continue}}l=n.child,(n.subtreeFlags&r)!==0&&l!==null?(l.return=n,ur=l):(a&&x1(n),Sf(a))}}ci=null}function Sf(n){for(;ur!==null;){var r=ur,a=n,l=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 15:break;case 1:if((p&1024)!==0&&l!==null){a=void 0,p=l.memoizedProps,l=l.memoizedState;var y=r.stateNode;try{var T=yo(r.type,p);a=y.getSnapshotBeforeUpdate(T,l),y.__reactInternalSnapshotBeforeUpdate=a}catch(P){yn(r,r.return,P)}}break;case 3:if((p&1024)!==0){if(l=r.stateNode.containerInfo,a=l.nodeType,a===9)k0(l);else if(a===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":k0(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&l!==null&&(a=Ns(l.memoizedProps,l.stateNode),p=r.memoizedProps,p=Ds(p.default,p.update),p!=="none"&&fl(l,a,p,l.memoizedState=[],!0));break;default:if((p&1024)!==0)throw Error(s(163))}if(l=r.sibling,l!==null){l.return=r.return,ur=l;break}ur=r.return}}function R1(n,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:ls(n,a),l&4&&Yc(5,a);break;case 1:if(ls(n,a),l&4)if(n=a.stateNode,r===null)try{n.componentDidMount()}catch(T){yn(a,a.return,T)}else{var p=yo(a.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(p,r,n.__reactInternalSnapshotBeforeUpdate)}catch(T){yn(a,a.return,T)}}l&64&&f1(a),l&512&&rs(a,a.return);break;case 3:if(ls(n,a),l&64&&(n=a.updateQueue,n!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{t2(n,r)}catch(T){yn(a,a.return,T)}}break;case 27:r===null&&l&4&&m1(a);case 26:case 5:ls(n,a),r===null&&l&4&&_m(a),l&512&&rs(a,a.return);break;case 12:ls(n,a);break;case 31:ls(n,a),l&4&&O1(n,a);break;case 13:ls(n,a),l&4&&A1(n,a),l&64&&(n=a.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(a=rD.bind(null,a),_D(n,a))));break;case 22:if(l=a.memoizedState!==null||cr,!l){var y=r!==null&&r.memoizedState!==null||pn;r=cr,p=pn,cr=l,(pn=y)&&!p?(l=2,(a.subtreeFlags&8772)!==0&&(l|=1),Bi(n,a,l)):ls(n,a),cr=r,pn=p}break;case 30:ls(n,a),l&512&&rs(a,a.return);break;case 7:l&512&&rs(a,a.return);default:ls(n,a)}}function Qm(n,r){for(n=n.child;n!==null;)C1(n,r),n=n.sibling}function C1(n,r){switch(n.tag){case 5:case 26:try{var a=n.stateNode;if(r){var l=a.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var p=n.stateNode,y=n.memoizedProps.style,T=y!=null&&y.hasOwnProperty("display")?y.display:null;p.style.display=T==null||typeof T=="boolean"?"":(""+T).trim()}}catch(Z){yn(n,n.return,Z)}Xm(n,r);break;case 6:try{n.stateNode.nodeValue=r?"":n.memoizedProps,gt=!0}catch(Z){yn(n,n.return,Z)}break;case 18:try{var P=n.stateNode;r?yS(P,!0):yS(n.stateNode,!1)}catch(Z){yn(n,n.return,Z)}break;case 22:case 23:n.memoizedState===null&&Qm(n,r);break;default:Qm(n,r)}}function Xm(n,r){if(n.subtreeFlags&67108864)for(n=n.child;n!==null;){e:{var a=n,l=r;switch(a.tag){case 4:C1(a,l);break e;case 22:a.memoizedState===null&&Xm(a,l);break e;default:Xm(a,l)}}n=n.sibling}}function T1(n){var r=n.alternate;r!==null&&(n.alternate=null,T1(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&qn(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var In=null,Gr=!1;function Hi(n,r,a){for(a=a.child;a!==null;)k1(n,r,a),a=a.sibling}function k1(n,r,a){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(Ie,a)}catch{}switch(a.tag){case 26:pn||xr(a,r),Hi(n,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!pn&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:pn||xr(a,r),Gc(a);var l=In,p=Gr;Ta(a.type)&&(In=a.stateNode,Gr=!1),Hi(n,r,a),NS(a.stateNode,a.type,a.memoizedProps),In=l,Gr=p;break;case 5:pn||xr(a,r),Gc(a);case 6:if(a.tag===6&&Gc(a),l=In,p=Gr,In=null,Hi(n,r,a),In=l,Gr=p,In!==null)if(Gr)try{(In.nodeType===9?In.body:In.nodeName==="HTML"?In.ownerDocument.body:In).removeChild(a.stateNode),gt=!0}catch(y){yn(a,r,y)}else try{In.removeChild(a.stateNode),gt=!0}catch(y){yn(a,r,y)}break;case 18:In!==null&&(Gr?(n=In,mS(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,a.stateNode),Nl(n)):mS(In,a.stateNode));break;case 4:l=In,p=Gr,In=a.stateNode.containerInfo,Gr=!0,Hi(n,r,a),In=l,Gr=p;break;case 0:case 11:case 14:case 15:ba(2,a,r),pn||ba(4,a,r),Hi(n,r,a);break;case 1:pn||(xr(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&h1(a,r,l)),Hi(n,r,a);break;case 21:Hi(n,r,a);break;case 22:pn=(l=pn)||a.memoizedState!==null,Hi(n,r,a),pn=l;break;case 30:xr(a,r),Hi(n,r,a);break;case 7:pn||xr(a,r),Hi(n,r,a);break;default:Hi(n,r,a)}}function O1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Nl(n)}catch(a){yn(r,r.return,a)}}}function A1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Nl(n)}catch(a){yn(r,r.return,a)}}function YN(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new E1),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new E1),r;default:throw Error(s(435,n.tag))}}function wf(n,r){var a=YN(n);r.forEach(function(l){if(!a.has(l)){a.add(l);var p=iD.bind(null,n,l);l.then(p,p)}})}function zr(n,r,a){var l=r.deletions;if(l!==null)for(var p=0;p<l.length;p++){var y=l[p],T=n,P=r,Z=P;e:for(;Z!==null;){switch(Z.tag){case 27:if(Ta(Z.type)){In=Z.stateNode,Gr=!1;break e}break;case 5:In=Z.stateNode,Gr=!1;break e;case 3:case 4:In=Z.stateNode.containerInfo,Gr=!0;break e}Z=Z.return}if(In===null)throw Error(s(160));k1(T,P,y),In=null,Gr=!1,T=y.alternate,T!==null&&(T.return=null),y.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)M1(r,n,a),r=r.sibling}var Fi=null;function M1(n,r,a){var l=n.alternate,p=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(p&4&&(l=n.updateQueue,l=l!==null?l.events:null,l!==null))for(var y=0;y<l.length;y++){var T=l[y];T.ref.impl=T.nextImpl}zr(r,n,a),_r(n),p&4&&(ba(3,n,n.return),Yc(3,n),ba(5,n,n.return));break;case 1:zr(r,n,a),_r(n),p&512&&(pn||l===null||xr(l,l.return)),p&64&&cr&&(n=n.updateQueue,n!==null&&(r=n.callbacks,r!==null&&(a=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:if(y=Fi,zr(r,n,a),_r(n),p&512&&(pn||l===null||xr(l,l.return)),p&4)if(p=l!==null?l.memoizedState:null,a=n.memoizedState,l===null)if(a===null)if(n.stateNode===null)if(cr)n.stateNode=hS(n.type,n.memoizedProps,r.containerInfo,n);else{e:{r=n.type,a=n.memoizedProps,p=y.ownerDocument||y;t:switch(r){case"title":l=p.getElementsByTagName("title")[0],(!l||l[xi]||l[fn]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=p.createElement(r),p.head.insertBefore(l,p.querySelector("head > title"))),Sr(l,r,a),l[fn]=n,Se(l),r=l;break e;case"link":if(y=zS("link","href",p).get(r+(a.href||""))){for(T=0;T<y.length;T++)if(l=y[T],l.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&l.getAttribute("rel")===(a.rel==null?null:a.rel)&&l.getAttribute("title")===(a.title==null?null:a.title)&&l.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){y.splice(T,1);break t}}l=p.createElement(r),Sr(l,r,a),p.head.appendChild(l);break;case"meta":if(y=zS("meta","content",p).get(r+(a.content||""))){for(T=0;T<y.length;T++)if(l=y[T],l.getAttribute("content")===(a.content==null?null:""+a.content)&&l.getAttribute("name")===(a.name==null?null:a.name)&&l.getAttribute("property")===(a.property==null?null:a.property)&&l.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&l.getAttribute("charset")===(a.charSet==null?null:a.charSet)){y.splice(T,1);break t}}l=p.createElement(r),Sr(l,r,a),p.head.appendChild(l);break;default:throw Error(s(468,r))}l[fn]=n,Se(l),r=l}n.stateNode=r}else cr||I0(y,n.type,n.stateNode);else n.stateNode=LS(y,a,n.memoizedProps);else p!==a?(p===null?(r=l.stateNode,r===null||pn||r.parentNode.removeChild(r)):p.count--,a===null?cr||I0(y,n.type,n.stateNode):LS(y,a,n.memoizedProps)):a===null&&n.stateNode!==null&&Um(n,n.memoizedProps,l.memoizedProps);break;case 27:zr(r,n,a),_r(n),p&512&&(pn||l===null||xr(l,l.return)),l!==null&&p&4&&Um(n,n.memoizedProps,l.memoizedProps);break;case 5:if(y=as,as=!1,zr(r,n,a),as=y,_r(n),p&512&&(pn||l===null||xr(l,l.return)),n.flags&32){r=n.stateNode;try{jr(r,""),gt=!0}catch(pe){yn(n,n.return,pe)}}p&4&&n.stateNode!=null&&(r=n.memoizedProps,Um(n,r,l!==null?l.memoizedProps:r)),p&1024&&(Gm=!0);break;case 6:if(zr(r,n,a),_r(n),p&4){if(n.stateNode===null)throw Error(s(162));r=n.memoizedProps,a=n.stateNode;try{a.nodeValue=r,gt=!0}catch(pe){yn(n,n.return,pe)}}break;case 3:if(gt=!1,zf=null,y=Fi,Fi=ru(r.containerInfo),zr(r,n,a),Fi=y,_r(n),p&4&&l!==null&&l.memoizedState.isDehydrated)try{Nl(r.containerInfo)}catch(pe){yn(n,n.return,pe)}Gm&&(Gm=!1,N1(n)),gt=!1;break;case 4:p=as,as=cr,l=nr(),y=Fi,Fi=ru(n.stateNode.containerInfo),zr(r,n,a),_r(n),Fi=y,gt&&$c&&(xf=!0),gt=l,as=p;break;case 12:zr(r,n,a),_r(n);break;case 31:zr(r,n,a),_r(n),p&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,wf(n,r)));break;case 13:zr(r,n,a),_r(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Cf=wt()),p&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,wf(n,r)));break;case 22:y=n.memoizedState!==null,T=l!==null&&l.memoizedState!==null;var P=cr,Z=pn,ae=as;cr=P||y,as=ae||y,pn=Z||T,zr(r,n,a),pn=Z,as=ae,cr=P,_r(n),p&8192&&(r=n.stateNode,r._visibility=y?r._visibility&-2:r._visibility|1,!y||l===null||T||cr||pn||(r=T||pn,a=cr,l=pn,cr=y||cr,pn=r,xa(n,2),cr=a,pn=l),!y&&as||Qm(n,y)),p&4&&(r=n.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,wf(n,a))));break;case 19:zr(r,n,a),_r(n),p&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,wf(n,r)));break;case 30:p&512&&(pn||l===null||xr(l,l.return)),p=nr(),y=$c,T=(a&335544064)===a,P=n.memoizedProps,$c=T&&Ds(P.default,P.update)!=="none",zr(r,n,a),_r(n),T&&l!==null&&gt&&(n.flags|=4),$c=y,gt=p;break;case 21:break;case 7:p&512&&(pn||l===null||xr(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=n);default:zr(r,n,a),_r(n)}}function _r(n){var r=n.flags;if(r&2){try{for(var a,l=n.return;l!==null;){if(g1(l)){a=l;break}l=l.return}l=null;for(var p=n.return;p!==null;){if(zm(p)){var y=p.stateNode;l===null?l=[y]:l.push(y)}if(Lm(p))break;p=p.return}var T=l;if(a==null)throw Error(s(160));switch(a.tag){case 27:var P=a.stateNode,Z=Hm(n);mf(n,Z,P,T);break;case 5:var ae=a.stateNode;a.flags&32&&(jr(ae,""),a.flags&=-33);var pe=Hm(n);mf(n,pe,ae,T);break;case 3:case 4:var Ce=a.stateNode.containerInfo,ie=Hm(n);Fm(n,ie,Ce,T);break;default:throw Error(s(161))}}catch(fe){yn(n,n.return,fe)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function N1(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;N1(r),r.tag===5&&r.flags&1024&&(r=r.stateNode,Ml=!0,r.reset(),Ml=!1),n=n.sibling}}function hl(n,r){if(r.subtreeFlags&9270)for(r=r.child;r!==null;)D1(r,n),r=r.sibling;else w1(r)}function D1(n,r){var a=n.alternate;if(a===null)Bm(n,!1);else switch(n.tag){case 3:if($m=os=!1,v1(),hl(r,n),!os&&!xf){if(n=is,n!==null)for(var l=0;l<n.length;l+=3){a=n[l];var p=n[l+1];bS(a,n[l+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+p+")"})}n=r.containerInfo,n=n.nodeType===9?n.documentElement:n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName===""&&(n.style.viewTransitionName="none",n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),n.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),$m=!0}is=null;break;case 5:hl(r,n);break;case 4:l=os,os=!1,hl(r,n),os&&(xf=!0),os=l;break;case 22:n.memoizedState===null&&(a.memoizedState!==null?Bm(n,!1):hl(r,n));break;case 30:l=os,p=v1(),os=!1,hl(r,n),os&&(n.flags|=4);var y=n.memoizedProps,T=n.stateNode;r=Ns(y,T),T=Ns(a.memoizedProps,T);var P=Ds(y.default,y.update);P==="none"?r=!1:(y=a.memoizedState,a.memoizedState=null,a=n.child,Yr=0,r=Ym(n,a,r,T,P,y,!0),Yr!==(y===null?0:y.length)&&(n.flags|=32)),(n.flags&4)!==0&&r?(xl(n,n.memoizedProps.onUpdate),is=p):p!==null&&(p.push.apply(p,is),is=p),os=(n.flags&32)!==0?!0:l;break;default:hl(r,n)}}function ls(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)R1(n,r.alternate,r),r=r.sibling}function xa(n,r){for(n=n.child;n!==null;){var a=n,l=r;switch(a.tag){case 0:case 11:case 14:case 15:ba(4,a,a.return),xa(a,l);break;case 1:xr(a,a.return);var p=a.stateNode;typeof p.componentWillUnmount=="function"&&h1(a,a.return,p),xa(a,l);break;case 27:(l&2)!==0&&NS(a.stateNode,a.type,a.memoizedProps);case 5:xr(a,a.return),a.tag!==5&&a.tag!==27||Gc(a),xa(a,l);break;case 6:Gc(a);break;case 26:xr(a,a.return),p=a.stateNode,a.memoizedState!==null||p===null||pn||p.parentNode.removeChild(p),xa(a,l);break;case 22:a.memoizedState===null&&xa(a,l);break;case 30:xr(a,a.return),xa(a,l);break;case 7:xr(a,a.return);default:xa(a,l)}n=n.sibling}}function Bi(n,r,a){for(a=(r.subtreeFlags&8772)!==0?a:a&-2,r=r.child;r!==null;){var l=r.alternate,p=n,y=r,T=y.flags,P=(a&1)!==0;switch(y.tag){case 0:case 11:case 15:Bi(p,y,a),Yc(4,y);break;case 1:if(Bi(p,y,a),l=y,p=l.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(pe){yn(l,l.return,pe)}if(l=y,p=l.updateQueue,p!==null){var Z=l.stateNode;try{var ae=p.shared.hiddenCallbacks;if(ae!==null)for(p.shared.hiddenCallbacks=null,p=0;p<ae.length;p++)e2(ae[p],Z)}catch(pe){yn(l,l.return,pe)}}P&&T&64&&f1(y),rs(y,y.return);break;case 27:(a&2)!==0&&m1(y);case 5:y.tag!==5&&y.tag!==27||p1(y),Bi(p,y,a),P&&l===null&&T&4&&_m(y),rs(y,y.return);break;case 6:p1(y);break;case 26:Z=y.stateNode,y.memoizedState!==null||Z===null||cr||I0(ru(Z.ownerDocument),y.type,Z),Bi(p,y,a),P&&l===null&&T&4&&_m(y),rs(y,y.return);break;case 12:Bi(p,y,a);break;case 31:Bi(p,y,a),P&&T&4&&O1(p,y);break;case 13:Bi(p,y,a),P&&T&4&&A1(p,y);break;case 22:y.memoizedState===null&&Bi(p,y,a),rs(y,y.return);break;case 30:Bi(p,y,a),rs(y,y.return);break;case 7:rs(y,y.return);default:Bi(p,y,a)}r=r.sibling}}function Zm(n,r){var a=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==a&&(n!=null&&n.refCount++,a!=null&&jc(a))}function Jm(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&jc(n))}function ki(n,r,a,l){var p=(a&335544064)===a;if(r.subtreeFlags&(p?10262:10256))for(r=r.child;r!==null;)j1(n,r,a,l),r=r.sibling;else p&&S1(r)}function j1(n,r,a,l){var p=(a&335544064)===a;p&&r.alternate===null&&r.return!==null&&r.return.alternate!==null&&bf(r);var y=r.flags;switch(r.tag){case 0:case 11:case 15:ki(n,r,a,l),y&2048&&Yc(9,r);break;case 1:ki(n,r,a,l);break;case 3:ki(n,r,a,l),p&&$m&&(n=n.containerInfo,n=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,n.style.viewTransitionName==="root"&&(n.style.viewTransitionName=""),n=n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName==="none"&&(n.style.viewTransitionName="")),y&2048&&(y=null,r.alternate!==null&&(y=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==y&&(r.refCount++,y!=null&&jc(y)));break;case 12:if(y&2048){ki(n,r,a,l),y=r.stateNode;try{var T=r.memoizedProps,P=T.id,Z=T.onPostCommit;typeof Z=="function"&&Z(P,r.alternate===null?"mount":"update",y.passiveEffectDuration,-0)}catch(ae){yn(r,r.return,ae)}}else ki(n,r,a,l);break;case 31:ki(n,r,a,l);break;case 13:ki(n,r,a,l);break;case 23:break;case 22:T=r.stateNode,P=r.alternate,r.memoizedState!==null?(p&&P!==null&&P.memoizedState===null&&bf(P),T._visibility&2?ki(n,r,a,l):Qc(n,r)):(p&&P!==null&&P.memoizedState!==null&&bf(r),T._visibility&2?ki(n,r,a,l):(T._visibility|=2,pl(n,r,a,l,(r.subtreeFlags&10256)!==0||!1))),y&2048&&Zm(P,r);break;case 24:ki(n,r,a,l),y&2048&&Jm(r.alternate,r);break;case 30:p&&(y=r.alternate,y!==null&&(ss(y.child,!0),ss(r.child,!0))),ki(n,r,a,l);break;default:ki(n,r,a,l)}}function pl(n,r,a,l,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=n,T=r,P=a,Z=l,ae=T.flags;switch(T.tag){case 0:case 11:case 15:pl(y,T,P,Z,p),Yc(8,T);break;case 23:break;case 22:var pe=T.stateNode;T.memoizedState!==null?pe._visibility&2?pl(y,T,P,Z,p):Qc(y,T):(pe._visibility|=2,pl(y,T,P,Z,p)),p&&ae&2048&&Zm(T.alternate,T);break;case 24:pl(y,T,P,Z,p),p&&ae&2048&&Jm(T.alternate,T);break;default:pl(y,T,P,Z,p)}r=r.sibling}}function Qc(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=n,l=r,p=l.flags;switch(l.tag){case 22:Qc(a,l),p&2048&&Zm(l.alternate,l);break;case 24:Qc(a,l),p&2048&&Jm(l.alternate,l);break;default:Qc(a,l)}r=r.sibling}}var vo=8192;function bo(n,r,a){if(n.subtreeFlags&vo)for(n=n.child;n!==null;)I1(n,r,a),n=n.sibling}function I1(n,r,a){switch(n.tag){case 26:bo(n,r,a),n.flags&vo&&(n.memoizedState!==null?JD(a,Fi,n.memoizedState,n.memoizedProps):(n=n.stateNode,(r&335544128)===r&&FS(a,n)));break;case 5:bo(n,r,a),n.flags&vo&&(n=n.stateNode,(r&335544128)===r&&FS(a,n));break;case 3:case 4:var l=Fi;Fi=ru(n.stateNode.containerInfo),bo(n,r,a),Fi=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=vo,vo=16777216,bo(n,r,a),vo=l):bo(n,r,a));break;case 30:if((n.flags&vo)!==0&&(l=n.memoizedProps.name,l!=null&&l!=="auto")){var p=n.stateNode;p.paired=null,ci===null&&(ci=new Map),ci.set(l,p)}bo(n,r,a);break;default:bo(n,r,a)}}function P1(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function Xc(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];ur=l,z1(l,n)}P1(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)L1(n),n=n.sibling}function L1(n){switch(n.tag){case 0:case 11:case 15:Xc(n),n.flags&2048&&ba(9,n,n.return);break;case 3:Xc(n);break;case 12:Xc(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,Ef(n)):Xc(n);break;default:Xc(n)}}function Ef(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];ur=l,z1(l,n)}P1(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:ba(8,r,r.return),Ef(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Ef(r));break;default:Ef(r)}n=n.sibling}}function z1(n,r){for(;ur!==null;){var a=ur;switch(a.tag){case 0:case 11:case 15:ba(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:jc(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,ur=l;else e:for(a=n;ur!==null;){l=ur;var p=l.sibling,y=l.return;if(T1(l),l===a){ur=null;break e}if(p!==null){p.return=y,ur=p;break e}ur=y}}}var GN={getCacheForType:function(n){var r=yr(Qn),a=r.data.get(n);return a===void 0&&(a=n(),r.data.set(n,a)),a},cacheSignal:function(){return yr(Qn).controller.signal}},$N=typeof WeakMap=="function"?WeakMap:Map,cn=0,kn=null,Yt=null,Jt=0,mn=0,ui=null,Sa=!1,gl=!1,Wm=!1,Fs=0,Vn=0,wa=0,xo=0,Rf=0,di=0,ml=0,Zc=null,$r=null,e0=!1,Cf=0,_1=0,Tf=1/0,kf=null,Ea=null,_n=0,Vi=null,So=null,cs=0,t0=0,n0=null,U1=null,yl=null,vl=null,bl=null,Jc=0,Of=null;function fi(){return(cn&2)!==0&&Jt!==0?Jt&-Jt:ge.T!==null?f0():Tn()}function H1(){if(di===0)if((Jt&536870912)===0||Vt){var n=ye;ye<<=1,(ye&3932160)===0&&(ye=262144),di=n}else di=536870912;return n=vr.current,n!==null&&(n.flags|=32),di}function xl(n,r){if(r!=null){var a=n.stateNode,l=a.ref;l===null&&(l=a.ref=xS(Ns(n.memoizedProps,a))),vl===null&&(vl=[]),vl.push(r.bind(null,l))}}function Qr(n,r,a){(n===kn&&(mn===2||mn===9)||n.cancelPendingCommit!==null)&&(Sl(n,0),Ra(n,Jt,di,!1)),ft(n,a),((cn&2)===0||n!==kn)&&(n===kn&&((cn&2)===0&&(xo|=a),Vn===4&&Ra(n,Jt,di,!1)),us(n))}function F1(n,r,a){if((cn&6)!==0)throw Error(s(327));var l=!a&&(r&127)===0&&(r&n.expiredLanes)===0||Xe(n,r),p=l?ZN(n,r):i0(n,r,!0),y=l;do{if(p===0){gl&&!l&&Ra(n,r,0,!1);break}else{if(a=n.current.alternate,y&&!QN(a)){p=i0(n,r,!1),y=!1;continue}if(p===2){if(y=r,n.errorRecoveryDisabledLanes&y)var T=0;else T=n.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){r=T;e:{var P=n;p=Zc;var Z=P.current.memoizedState.isDehydrated;if(Z&&(Sl(P,T).flags|=256),T=i0(P,T,!1),T!==2&&T!==6){if(Wm&&!Z){P.errorRecoveryDisabledLanes|=y,xo|=y,p=4;break e}y=$r,$r=p,y!==null&&($r===null?$r=y:$r.push.apply($r,y))}p=T}if(y=!1,p!==2)continue}}if(p===1){Sl(n,0),Ra(n,r,0,!0);break}e:{switch(l=n,y=p,y){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r&&(r&62914560)!==r)break;case 6:Ra(l,r,di,!Sa);break e;case 2:$r=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(p=Cf+300-wt(),10<p)){if(Ra(l,r,di,!Sa),Ke(l,0,!0)!==0)break e;cs=r,l.timeoutHandle=E0(B1.bind(null,l,a,$r,kf,e0,r,di,xo,ml,Sa,y,"Throttled",-0,0),p);break e}B1(l,a,$r,kf,e0,r,di,xo,ml,Sa,y,null,-0,0)}}break}while(!0);us(n)}function B1(n,r,a,l,p,y,T,P,Z,ae,pe,Ce,ie,fe){n.timeoutHandle=-1;var Ye=r.subtreeFlags,rt=(y&335544064)===y;if(Ce=null,(rt||Ye&8192||(Ye&16785408)===16785408)&&(Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ir},ci=null,I1(r,y,Ce),rt&&(Ye=Ce,rt=n.containerInfo,rt=(rt.nodeType===9?rt:rt.ownerDocument).__reactViewTransition,rt!=null&&(Ye.count++,Ye.waitingForViewTransition=!0,Ye=au.bind(Ye),rt.finished.then(Ye,Ye))),Ye=(y&62914560)===y?Cf-wt():(y&4194048)===y?_1-wt():0,Ye=WD(Ce,Ye),Ye!==null)){cs=y,n.cancelPendingCommit=Ye(X1.bind(null,n,r,y,a,l,p,T,P,Z,ae,pe,Ce,null,ie,fe)),Ra(n,y,T,!ae);return}X1(n,r,y,a,l,p,T,P,Z,ae,pe,Ce)}function QN(n){for(var r=n;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var p=a[l],y=p.getSnapshot;p=p.value;try{if(!oi(y(),p))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ra(n,r,a,l){r=Qe(n,r),r&=~Rf,r&=~xo,n.suspendedLanes|=r,n.pingedLanes&=~r,l&&(n.warmLanes|=r),l=n.expirationTimes;for(var p=r;0<p;){var y=31-et(p),T=1<<y;l[y]=-1,p&=~T}a!==0&&Ft(n,a,r)}function Af(){return(cn&6)===0?(Wc(0),!1):!0}function r0(){if(Yt!==null){if(mn===0)var n=Yt.return;else n=Yt,Ps=oo=null,dm(n),ol=null,Lc=0,n=Yt;for(;n!==null;)d1(n.alternate,n),n=n.return;Yt=null}}function Sl(n,r){var a=n.timeoutHandle;return a!==-1&&(n.timeoutHandle=-1,bD(a)),a=n.cancelPendingCommit,a!==null&&(n.cancelPendingCommit=null,a()),cs=0,r0(),kn=n,Yt=a=js(n.current,null),Jt=r,mn=0,ui=null,Sa=!1,gl=Xe(n,r),Wm=!1,ml=di=Rf=xo=wa=Vn=0,$r=Zc=null,e0=!1,Fs=Qe(n,r),Ld(),a}function V1(n,r){It=null,ge.H=lf,r===al||r===Gd?(r=Xx(),mn=3):r===Jg?(r=Xx(),mn=4):mn=r===Tm?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ui=r,Yt===null&&(Vn=1,cf(n,Ei(r,n.current)))}function K1(){var n=vr.current;return n===null?!0:(Jt&4194048)===Jt?Tr===null:(Jt&62914560)===Jt||(Jt&536870912)!==0?n===Tr:!1}function q1(){var n=ge.H;return ge.H=lf,n===null?lf:n}function Y1(){var n=ge.A;return ge.A=GN,n}function Mf(){Vn=4,Sa||(Jt&4194048)!==Jt&&vr.current!==null||(gl=!0),(wa&134217727)===0&&(xo&134217727)===0||kn===null||Ra(kn,Jt,di,!1)}function i0(n,r,a){var l=cn;cn|=2;var p=q1(),y=Y1();(kn!==n||Jt!==r)&&(kf=null,Sl(n,r)),r=!1;var T=Vn;e:do try{if(mn!==0&&Yt!==null){var P=Yt,Z=ui;switch(mn){case 8:r0(),T=6;break e;case 3:case 2:case 9:case 6:vr.current===null&&(r=!0);var ae=mn;if(mn=0,ui=null,wl(n,P,Z,ae),a&&gl){T=0;break e}break;default:ae=mn,mn=0,ui=null,wl(n,P,Z,ae)}}XN(),T=Vn;break}catch(pe){V1(n,pe)}while(!0);return r&&n.shellSuspendCounter++,Ps=oo=null,cn=l,ge.H=p,ge.A=y,Yt===null&&(kn=null,Jt=0,Ld()),T}function XN(){for(;Yt!==null;)G1(Yt)}function ZN(n,r){var a=cn;cn|=2;var l=q1(),p=Y1();kn!==n||Jt!==r?(kf=null,Tf=wt()+500,Sl(n,r)):gl=Xe(n,r);e:do try{if(mn!==0&&Yt!==null){r=Yt;var y=ui;t:switch(mn){case 1:mn=0,ui=null,wl(n,r,y,1);break;case 2:case 9:if($x(y)){mn=0,ui=null,$1(r);break}r=function(){mn!==2&&mn!==9||kn!==n||(mn=7),us(n)},y.then(r,r);break e;case 3:mn=7;break e;case 4:mn=5;break e;case 7:$x(y)?(mn=0,ui=null,$1(r)):(mn=0,ui=null,wl(n,r,y,7));break;case 5:var T=null;switch(Yt.tag){case 26:T=Yt.memoizedState;case 5:case 27:var P=Yt;if(T?US(T):P.stateNode.complete){mn=0,ui=null;var Z=P.sibling;if(Z!==null)Yt=Z;else{var ae=P.return;ae!==null?(Yt=ae,Nf(ae)):Yt=null}break t}}mn=0,ui=null,wl(n,r,y,5);break;case 6:mn=0,ui=null,wl(n,r,y,6);break;case 8:r0(),Vn=6;break e;default:throw Error(s(462))}}JN();break}catch(pe){V1(n,pe)}while(!0);return Ps=oo=null,ge.H=l,ge.A=p,cn=a,Yt!==null?0:(kn=null,Jt=0,Ld(),Vn)}function JN(){for(;Yt!==null&&!nn();)G1(Yt)}function G1(n){var r=c1(n.alternate,n,Fs);n.memoizedProps=n.pendingProps,r===null?Nf(n):Yt=r}function $1(n){var r=n,a=r.alternate;switch(r.tag){case 15:case 0:r=n1(a,r,r.pendingProps,r.type,void 0,Jt);break;case 11:r=n1(a,r,r.pendingProps,r.type.render,r.ref,Jt);break;case 5:dm(r);var l=r;l===lr&&(Vt?(Bd(l),l.tag===5&&l.stateNode!=null&&(Mn=l.stateNode)):(Bd(l),Vt=!0));default:d1(a,r),r=Yt=zx(r,Fs),r=c1(a,r,Fs)}n.memoizedProps=n.pendingProps,r===null?Nf(n):Yt=r}function wl(n,r,a,l){Ps=oo=null,dm(r),ol=null,Lc=0;var p=r.return;try{if(UN(n,p,r,a,Jt)){Vn=1,cf(n,Ei(a,n.current)),Yt=null;return}}catch(y){if(p!==null)throw Yt=p,y;Vn=1,cf(n,Ei(a,n.current)),Yt=null;return}r.flags&32768?(Vt||l===1?n=!0:gl||(Jt&536870912)!==0?n=!1:(Sa=n=!0,(l===2||l===9||l===3||l===6)&&(l=vr.current,l!==null&&l.tag===13&&(l.flags|=16384))),Q1(r,n)):Nf(r)}function Nf(n){var r=n;do{if((r.flags&32768)!==0){Q1(r,Sa);return}n=r.return;var a=VN(r.alternate,r,Fs);if(a!==null){Yt=a;return}if(r=r.sibling,r!==null){Yt=r;return}Yt=r=n}while(r!==null);Vn===0&&(Vn=5)}function Q1(n,r){do{var a=KN(n.alternate,n);if(a!==null){a.flags&=32767,Yt=a;return}if(a=n.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(n=n.sibling,n!==null)){Yt=n;return}Yt=n=a}while(n!==null);Vn=6,Yt=null}function X1(n,r,a,l,p,y,T,P,Z,ae,pe,Ce){n.cancelPendingCommit=null;do Df();while(_n!==0);if((cn&6)!==0)throw Error(s(327));if(r!==null){if(r===n.current)throw Error(s(177));n===kn&&(Yt=kn=null,Jt=0),So=r,Vi=n,cs=a,n0=p,U1=l,WN(n,r,a,T,P,Z,Ce)}}function WN(n,r,a,l,p,y,T){var P=r.lanes|r.childLanes;if(t0=P,P|=Ug,Kt(n,a,P,l,p,y),vl=null,(a&335544064)===a?(bl=kN(n),l=10262):(bl=null,l=10256),(r.subtreeFlags&l)!==0||(r.flags&l)!==0?(n.callbackNode=null,n.callbackPriority=0,sD(yt,function(){return l0(),null})):(n.callbackNode=null,n.callbackPriority=0),yf=!1,l=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||l){l=ge.T,ge.T=null,p=ue.p,ue.p=2,y=cn,cn|=4;try{qN(n,r,a)}finally{cn=y,ue.p=p,ge.T=l}}_n=1,yf?yl=CD(T,n.containerInfo,bl,s0,a0,tD,o0,l0,eD):(s0(),a0(),o0())}function eD(n){if(_n!==0){var r=Vi.onRecoverableError;r(n,{componentStack:null})}}function tD(){_n===3&&(_n=0,D1(So,Vi),_n=4)}function s0(){if(_n===1){_n=0;var n=Vi,r=So,a=cs,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=ge.T,ge.T=null;var p=ue.p;ue.p=2;var y=cn;cn|=4;try{$c=xf=!1,M1(r,n,a),a=x0;var T=kx(n.containerInfo),P=a.focusedElem,Z=a.selectionRange;if(T!==P&&P&&P.ownerDocument&&Tx(P.ownerDocument.documentElement,P)){if(Z!==null&&Ig(P)){var ae=Z.start,pe=Z.end;if(pe===void 0&&(pe=ae),"selectionStart"in P)P.selectionStart=ae,P.selectionEnd=Math.min(pe,P.value.length);else{var Ce=P.ownerDocument||document,ie=Ce&&Ce.defaultView||window;if(ie.getSelection){var fe=ie.getSelection(),Ye=P.textContent.length,rt=Math.min(Z.start,Ye),Pt=Z.end===void 0?rt:Math.min(Z.end,Ye);!fe.extend&&rt>Pt&&(T=Pt,Pt=rt,rt=T);var se=Cx(P,rt),te=Cx(P,Pt);if(se&&te&&(fe.rangeCount!==1||fe.anchorNode!==se.node||fe.anchorOffset!==se.offset||fe.focusNode!==te.node||fe.focusOffset!==te.offset)){var ce=Ce.createRange();ce.setStart(se.node,se.offset),fe.removeAllRanges(),rt>Pt?(fe.addRange(ce),fe.extend(te.node,te.offset)):(ce.setEnd(te.node,te.offset),fe.addRange(ce))}}}}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 Re=Ce[P];Re.element.scrollLeft=Re.left,Re.element.scrollTop=Re.top}}Ml=!!b0,x0=b0=null}finally{cn=y,ue.p=p,ge.T=l}}n.current=r,_n=2}}function a0(){if(_n===2){_n=0;var n=Vi,r=So,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=ge.T,ge.T=null;var l=ue.p;ue.p=2;var p=cn;cn|=4;try{R1(n,r.alternate,r)}finally{cn=p,ue.p=l,ge.T=a}}_n=3}}function o0(){if(_n===4||_n===3){_n=0;var n=yl;yl=null,We();var r=Vi,a=So,l=cs,p=U1,y=(l&335544064)===l?10262:10256;if((a.subtreeFlags&y)!==0||(a.flags&y)!==0?_n=5:(_n=0,So=Vi=null,Z1(r,r.pendingLanes)),y=r.pendingLanes,y===0&&(Ea=null),Cn(l),a=a.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(Ie,a,void 0,(a.current.flags&128)===128)}catch{}if(p!==null){a=ge.T,y=ue.p,ue.p=2,ge.T=null;try{for(var T=r.onRecoverableError,P=0;P<p.length;P++){var Z=p[P];T(Z.value,{componentStack:Z.stack})}}finally{ge.T=a,ue.p=y}}if(p=vl,T=bl,bl=null,p!==null&&(vl=null,T===null&&(T=[]),n!==null))for(Z=0;Z<p.length;Z++)a=(0,p[Z])(T),a!==void 0&&n.finished.finally(a);(cs&3)!==0&&Df(),us(r),y=r.pendingLanes,(l&261930)!==0&&(y&42)!==0?r===Of?Jc++:(Jc=0,Of=r):(Jc=0,Of=null),Wc(0)}}function Z1(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,jc(r)))}function Df(){return yl!==null&&(yl.skipTransition(),yl=null),s0(),a0(),o0(),l0()}function l0(){if(_n!==5)return!1;var n=Vi,r=t0;t0=0;var a=Cn(cs),l=ge.T,p=ue.p;try{ue.p=32>a?32:a,ge.T=null,a=n0,n0=null;var y=Vi,T=cs;if(_n=0,So=Vi=null,cs=0,(cn&6)!==0)throw Error(s(331));var P=cn;if(cn|=4,L1(y.current),j1(y,y.current,T,a),cn=P,Wc(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(Ie,y)}catch{}return!0}finally{ue.p=p,ge.T=l,Z1(n,r)}}function J1(n,r,a){r=Ei(a,r),r=Cm(n.stateNode,r,2),n=ga(n,r,2),n!==null&&(ft(n,2),us(n))}function yn(n,r,a){if(n.tag===3)J1(n,n,a);else for(;r!==null;){if(r.tag===3){J1(r,n,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ea===null||!Ea.has(l))){n=Ei(a,n),a=$2(2),l=ga(r,a,2),l!==null&&(Q2(a,l,r,n),ft(l,2),us(l));break}}r=r.return}}function c0(n,r,a){var l=n.pingCache;if(l===null){l=n.pingCache=new $N;var p=new Set;l.set(r,p)}else p=l.get(r),p===void 0&&(p=new Set,l.set(r,p));p.has(a)||(Wm=!0,p.add(a),n=nD.bind(null,n,r,a),r.then(n,n))}function nD(n,r,a){var l=n.pingCache;l!==null&&l.delete(r),n.pingedLanes|=n.suspendedLanes&a,n.warmLanes&=~a,kn===n&&(Jt&a)===a&&((Vn===4||Vn===3&&(Jt&62914560)===Jt&&300>wt()-Cf)&&(cn&2)===0?Sl(n,0):Rf|=a,ml===Jt&&(ml=0)),us(n)}function W1(n,r){r===0&&(r=tt()),n=io(n,r),n!==null&&(ft(n,r),us(n))}function rD(n){var r=n.memoizedState,a=0;r!==null&&(a=r.retryLane),W1(n,a)}function iD(n,r){var a=0;switch(n.tag){case 31:case 13:var l=n.stateNode,p=n.memoizedState;p!==null&&(a=p.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),W1(n,a)}function sD(n,r){return tn(n,r)}var El=null,Rl=null,u0=!1,jf=!1,d0=!1,Ca=0;function us(n){n!==Rl&&n.next===null&&(Rl===null?El=Rl=n:Rl=Rl.next=n),jf=!0,u0||(u0=!0,oD())}function Wc(n,r){if(!d0&&jf){d0=!0;do for(var a=!1,l=El;l!==null;){if(n!==0){var p=l.pendingLanes;if(p===0)var y=0;else{var T=l.suspendedLanes,P=l.pingedLanes;y=(1<<31-et(42|n)+1)-1,y&=p&~(T&~P),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(a=!0,rS(l,y))}else y=Jt,y=Ke(l,l===kn?y:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(y&3)===0||Xe(l,y)||(a=!0,rS(l,y));l=l.next}while(a);d0=!1}}function aD(){eS()}function eS(){jf=u0=!1;var n=0;Ca!==0&&vD()&&(n=Ca);for(var r=wt(),a=null,l=El;l!==null;){var p=l.next,y=tS(l,r);y===0?(l.next=null,a===null?El=p:a.next=p,p===null&&(Rl=a)):(a=l,(n!==0||(y&3)!==0)&&(jf=!0)),l=p}_n!==0&&_n!==5||Wc(n),Ca!==0&&(Ca=0)}function tS(n,r){for(var a=n.suspendedLanes,l=n.pingedLanes,p=n.expirationTimes,y=n.pendingLanes&-62914561;0<y;){var T=31-et(y),P=1<<T,Z=p[T];Z===-1?((P&a)===0||(P&l)!==0)&&(p[T]=lt(P,r)):Z<=r&&(n.expiredLanes|=P),y&=~P}if(r=kn,a=Jt,a=Ke(n,n===r?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l=n.callbackNode,a===0||n===r&&(mn===2||mn===9)||n.cancelPendingCommit!==null)return l!==null&&l!==null&&an(l),n.callbackNode=null,n.callbackPriority=0;if((a&3)===0||Xe(n,a)){if(r=a&-a,r===n.callbackPriority)return r;switch(l!==null&&an(l),Cn(a)){case 2:case 8:a=xt;break;case 32:a=yt;break;case 268435456:a=un;break;default:a=yt}return l=nS.bind(null,n),a=tn(a,l),n.callbackPriority=r,n.callbackNode=a,r}return l!==null&&l!==null&&an(l),n.callbackPriority=2,n.callbackNode=null,2}function nS(n,r){if(_n!==0&&_n!==5)return n.callbackNode=null,n.callbackPriority=0,null;var a=n.callbackNode;if(Df()&&n.callbackNode!==a)return null;var l=Jt;return l=Ke(n,n===kn?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(F1(n,l,r),tS(n,wt()),n.callbackNode!=null&&n.callbackNode===a?nS.bind(null,n):null)}function rS(n,r){if(Df())return null;F1(n,r,!0)}function oD(){xD(function(){(cn&6)!==0?tn(ht,aD):eS()})}function f0(){if(Ca===0){var n=uo;n===0&&(n=ne,ne<<=1,(ne&261888)===0&&(ne=256)),Ca=n}return Ca}function iS(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:gr(n)}function lD(n,r,a,l,p){if(r==="submit"&&a&&a.stateNode===p){var y=iS((p[An]||null).action),T=l.submitter;T&&(r=(r=T[An]||null)?iS(r.formAction):T.getAttribute("formAction"),r!==null&&(y=r,T=null));var P=new Dd("action","action",null,l,p);n.push({event:P,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ca!==0){var Z=new FormData(p,T);xm(a,{pending:!0,data:Z,method:p.method,action:y},null,Z)}}else typeof y=="function"&&(P.preventDefault(),Z=new FormData(p,T),xm(a,{pending:!0,data:Z,method:p.method,action:y},y,Z))},currentTarget:p}]})}}for(var h0=0;h0<_g.length;h0++){var p0=_g[h0],cD=p0.toLowerCase(),uD=p0[0].toUpperCase()+p0.slice(1);Ui(cD,"on"+uD)}Ui(Mx,"onAnimationEnd"),Ui(Nx,"onAnimationIteration"),Ui(Dx,"onAnimationStart"),Ui("dblclick","onDoubleClick"),Ui("focusin","onFocus"),Ui("focusout","onBlur"),Ui(bN,"onTransitionRun"),Ui(xN,"onTransitionStart"),Ui(SN,"onTransitionCancel"),Ui(jx,"onTransitionEnd"),xn("onMouseEnter",["mouseout","mouseover"]),xn("onMouseLeave",["mouseout","mouseover"]),xn("onPointerEnter",["pointerout","pointerover"]),xn("onPointerLeave",["pointerout","pointerover"]),Ht("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ht("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ht("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ht("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ht("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ht("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var eu="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(" "),dD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(eu));function sS(n,r){r=(r&4)!==0;for(var a=0;a<n.length;a++){var l=n[a],p=l.event;l=l.listeners;e:{var y=void 0;if(r)for(var T=l.length-1;0<=T;T--){var P=l[T],Z=P.instance,ae=P.currentTarget;if(P=P.listener,Z!==y&&p.isPropagationStopped())break e;y=P,p.currentTarget=ae;try{y(p)}catch(pe){Pd(pe)}p.currentTarget=null,y=Z}else for(T=0;T<l.length;T++){if(P=l[T],Z=P.instance,ae=P.currentTarget,P=P.listener,Z!==y&&p.isPropagationStopped())break e;y=P,p.currentTarget=ae;try{y(p)}catch(pe){Pd(pe)}p.currentTarget=null,y=Z}}}}function Gt(n,r){var a=r[Os];a===void 0&&(a=r[Os]=new Set);var l=n+"__bubble";a.has(l)||(aS(r,n,2,!1),a.add(l))}function g0(n,r,a){var l=0;r&&(l|=4),aS(a,n,l,r)}var If="_reactListening"+Math.random().toString(36).slice(2);function m0(n){if(!n[If]){n[If]=!0,Ot.forEach(function(a){a!=="selectionchange"&&(dD.has(a)||g0(a,!1,n),g0(a,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[If]||(r[If]=!0,g0("selectionchange",!1,r))}}function aS(n,r,a,l){switch(QS(r)){case 2:var p=r4;break;case 8:p=i4;break;default:p=L0}a=p.bind(null,r,a,n),p=void 0,!to||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),l?p!==void 0?n.addEventListener(r,a,{capture:!0,passive:p}):n.addEventListener(r,a,!0):p!==void 0?n.addEventListener(r,a,{passive:p}):n.addEventListener(r,a,!1)}function y0(n,r,a,l,p){var y=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var T=l.tag;if(T===3||T===4){var P=l.stateNode.containerInfo;if(P===p)break;if(T===4)for(T=l.return;T!==null;){var Z=T.tag;if((Z===3||Z===4)&&T.stateNode.containerInfo===p)return;T=T.return}for(;P!==null;){if(T=Fn(P),T===null)return;if(Z=T.tag,Z===5||Z===6||Z===26||Z===27){l=y=T;continue e}P=P.parentNode}}l=l.return}eo(function(){var ae=y,pe=Wa(a),Ce=[];e:{var ie=Ix.get(n);if(ie!==void 0){var fe=Dd,Ye=n;switch(n){case"keypress":if(Md(a)===0)break e;case"keydown":case"keyup":fe=QM;break;case"focusin":Ye="focus",fe=Og;break;case"focusout":Ye="blur",fe=Og;break;case"beforeblur":case"afterblur":fe=Og;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=cx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=zM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=eN;break;case Mx:case Nx:case Dx:fe=HM;break;case jx:fe=nN;break;case"scroll":case"scrollend":fe=PM;break;case"wheel":fe=iN;break;case"copy":case"cut":case"paste":fe=BM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=dx;break;case"submit":fe=JM;break;case"toggle":case"beforetoggle":fe=aN}var rt=(r&4)!==0,Pt=!rt&&(n==="scroll"||n==="scrollend"),se=rt?ie!==null?ie+"Capture":null:ie;rt=[];for(var te=ae,ce;te!==null;){var Re=te;if(ce=Re.stateNode,Re=Re.tag,Re!==5&&Re!==26&&Re!==27||ce===null||se===null||(Re=Ms(te,se),Re!=null&&rt.push(tu(te,Re,ce))),Pt)break;te=te.return}0<rt.length&&(ie=new fe(ie,Ye,null,a,pe),Ce.push({event:ie,listeners:rt}))}}if((r&7)===0){e:{if(fe=n==="mouseover"||n==="pointerover",ie=n==="mouseout"||n==="pointerout",fe&&a!==Ja&&(Ye=a.relatedTarget||a.fromElement)&&(Fn(Ye)||Ye[jn]))break e;(ie||fe)&&(Ye=pe.window===pe?pe:(fe=pe.ownerDocument)?fe.defaultView||fe.parentWindow:window,ie?(fe=a.relatedTarget||a.toElement,ie=ae,fe=fe?Fn(fe):null,fe!==null&&(Pt=c(fe),rt=fe.tag,fe!==Pt||rt!==5&&rt!==27&&rt!==6)&&(fe=null)):(ie=null,fe=ae),ie!==fe&&(rt=cx,Re="onMouseLeave",se="onMouseEnter",te="mouse",(n==="pointerout"||n==="pointerover")&&(rt=dx,Re="onPointerLeave",se="onPointerEnter",te="pointer"),Pt=ie==null?Ye:he(ie),ce=fe==null?Ye:he(fe),Ye=new rt(Re,te+"leave",ie,a,pe),Ye.target=Pt,Ye.relatedTarget=ce,Re=null,Fn(pe)===ae&&(rt=new rt(se,te+"enter",fe,a,pe),rt.target=ce,rt.relatedTarget=Pt,Re=rt),Pt=Re,rt=ie&&fe?j(ie,fe,fD):null,ie!==null&&oS(Ce,Ye,ie,rt,!1),fe!==null&&Pt!==null&&oS(Ce,Pt,fe,rt,!0)))}e:{if(ie=ae?he(ae):window,fe=ie.nodeName&&ie.nodeName.toLowerCase(),fe==="select"||fe==="input"&&ie.type==="file")var Je=bx;else if(yx(ie))if(xx)Je=mN;else{Je=pN;var Wt=hN}else fe=ie.nodeName,!fe||fe.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ae&&Za(ae.elementType)&&(Je=bx):Je=gN;if(Je&&(Je=Je(n,ae))){vx(Ce,Je,a,pe);break e}Wt&&Wt(n,ie,ae)}switch(Wt=ae?he(ae):window,n){case"focusin":(yx(Wt)||Wt.contentEditable==="true")&&(Jo=Wt,Pg=ae,Mc=null);break;case"focusout":Mc=Pg=Jo=null;break;case"mousedown":Lg=!0;break;case"contextmenu":case"mouseup":case"dragend":Lg=!1,Ox(Ce,a,pe);break;case"selectionchange":if(vN)break;case"keydown":case"keyup":Ox(Ce,a,pe)}var ct;if(Mg)e:{switch(n){case"compositionstart":var St="onCompositionStart";break e;case"compositionend":St="onCompositionEnd";break e;case"compositionupdate":St="onCompositionUpdate";break e}St=void 0}else Zo?gx(n,a)&&(St="onCompositionEnd"):n==="keydown"&&a.keyCode===229&&(St="onCompositionStart");St&&(fx&&a.locale!=="ko"&&(Zo||St!=="onCompositionStart"?St==="onCompositionEnd"&&Zo&&(ct=ox()):(aa=pe,Cg="value"in aa?aa.value:aa.textContent,Zo=!0)),Wt=Pf(ae,St),0<Wt.length&&(St=new ux(St,n,null,a,pe),Ce.push({event:St,listeners:Wt}),ct?St.data=ct:(ct=mx(a),ct!==null&&(St.data=ct)))),(ct=lN?cN(n,a):uN(n,a))&&(St=Pf(ae,"onBeforeInput"),0<St.length&&(Wt=new ux("onBeforeInput","beforeinput",null,a,pe),Ce.push({event:Wt,listeners:St}),Wt.data=ct)),lD(Ce,n,ae,a,pe)}sS(Ce,r)})}function tu(n,r,a){return{instance:n,listener:r,currentTarget:a}}function Pf(n,r){for(var a=r+"Capture",l=[];n!==null;){var p=n,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Ms(n,a),p!=null&&l.unshift(tu(n,p,y)),p=Ms(n,r),p!=null&&l.push(tu(n,p,y))),n.tag===3)return l;n=n.return}return[]}function fD(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function oS(n,r,a,l,p){for(var y=r._reactName,T=[];a!==null&&a!==l;){var P=a,Z=P.alternate,ae=P.stateNode;if(P=P.tag,Z!==null&&Z===l)break;P!==5&&P!==26&&P!==27||ae===null||(Z=ae,p?(ae=Ms(a,y),ae!=null&&T.unshift(tu(a,ae,Z))):p||(ae=Ms(a,y),ae!=null&&T.push(tu(a,ae,Z)))),a=a.return}T.length!==0&&n.push({event:r,listeners:T})}var hD=/\r\n?/g,pD=/\u0000|\uFFFD/g;function lS(n){return(typeof n=="string"?n:""+n).replace(hD,`
10
- `).replace(pD,"")}function cS(n,r){return r=lS(r),lS(n)===r}function vn(n,r,a,l,p,y){switch(a){case"children":if(typeof l=="string")r==="body"||r==="textarea"&&l===""||jr(n,l);else if(typeof l=="number"||typeof l=="bigint")r!=="body"&&jr(n,""+l);else return;break;case"className":ri(n,"class",l);break;case"tabIndex":ri(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ri(n,a,l);break;case"style":si(n,l,y);return;case"data":if(r!=="object"){ri(n,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||a!=="href")){n.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(a);break}l=gr(l),n.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){n.setAttribute(a,"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 y=="function"&&(a==="formAction"?(r!=="input"&&vn(n,r,"name",p.name,p,null),vn(n,r,"formEncType",p.formEncType,p,null),vn(n,r,"formMethod",p.formMethod,p,null),vn(n,r,"formTarget",p.formTarget,p,null)):(vn(n,r,"encType",p.encType,p,null),vn(n,r,"method",p.method,p,null),vn(n,r,"target",p.target,p,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(a);break}l=gr(l),n.setAttribute(a,l);break;case"onClick":l!=null&&(n.onclick=Ir);return;case"onScroll":l!=null&&Gt("scroll",n);return;case"onScrollEnd":l!=null&&Gt("scrollend",n);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(p.children!=null)throw Error(s(60));y?.__html!==a&&(n.innerHTML=a)}}break;case"multiple":n.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":n.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"){n.removeAttribute("xlink:href");break}a=gr(l),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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"?n.setAttribute(a,l):n.removeAttribute(a);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"?n.setAttribute(a,""):n.removeAttribute(a);break;case"capture":case"download":l===!0?n.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(a,l):n.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?n.setAttribute(a,l):n.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?n.removeAttribute(a):n.setAttribute(a,l);break;case"popover":Gt("beforetoggle",n),Gt("toggle",n),zn(n,"popover",l);break;case"xlinkActuate":Gn(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Gn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Gn(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Gn(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Gn(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Gn(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Gn(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Gn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Gn(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":zn(n,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=Sc.get(a)||a,zn(n,a,l);else return}gt=!0}function v0(n,r,a,l,p,y){switch(a){case"style":si(n,l,y);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(p.children!=null)throw Error(s(60));y?.__html!==a&&(n.innerHTML=a)}}break;case"children":if(typeof l=="string")jr(n,l);else if(typeof l=="number"||typeof l=="bigint")jr(n,""+l);else return;break;case"onScroll":l!=null&&Gt("scroll",n);return;case"onScrollEnd":l!=null&&Gt("scrollend",n);return;case"onClick":l!=null&&(n.onclick=Ir);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Rt.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(p=a.endsWith("Capture"),y=a.slice(2,p?a.length-7:void 0),r=n[An]||null,r=r!=null?r[a]:null,typeof r=="function"&&n.removeEventListener(y,r,p),typeof l=="function")){typeof r!="function"&&r!==null&&(a in n?n[a]=null:n.hasAttribute(a)&&n.removeAttribute(a)),n.addEventListener(y,l,p);break e}gt=!0,a in n?n[a]=l:l===!0?n.setAttribute(a,""):zn(n,a,l)}return}gt=!0}function Sr(n,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Gt("error",n),Gt("load",n);var l=!1,p=!1,y;for(y in a)if(a.hasOwnProperty(y)){var T=a[y];if(T!=null)switch(y){case"src":l=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:vn(n,r,y,T,a,null)}}p&&vn(n,r,"srcSet",a.srcSet,a,null),l&&vn(n,r,"src",a.src,a,null);return;case"input":Gt("invalid",n);var P=y=T=p=null,Z=null,ae=null;for(l in a)if(a.hasOwnProperty(l)){var pe=a[l];if(pe!=null)switch(l){case"name":p=pe;break;case"type":T=pe;break;case"checked":Z=pe;break;case"defaultChecked":ae=pe;break;case"value":y=pe;break;case"defaultValue":P=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(s(137,r));break;default:vn(n,r,l,pe,a,null)}}ia(n,y,P,Z,ae,T,p,!1);return;case"select":Gt("invalid",n),l=T=y=null;for(p in a)if(a.hasOwnProperty(p)&&(P=a[p],P!=null))switch(p){case"value":y=P;break;case"defaultValue":T=P;break;case"multiple":l=P;default:vn(n,r,p,P,a,null)}r=y,a=T,n.multiple=!!l,r!=null?Kr(n,!!l,r,!1):a!=null&&Kr(n,!!l,a,!0);return;case"textarea":Gt("invalid",n),y=p=l=null;for(T in a)if(a.hasOwnProperty(T)&&(P=a[T],P!=null))switch(T){case"value":l=P;break;case"defaultValue":p=P;break;case"children":y=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(s(91));break;default:vn(n,r,T,P,a,null)}ii(n,l,p,y);return;case"option":for(Z in a)a.hasOwnProperty(Z)&&(l=a[Z],l!=null)&&(Z==="selected"?n.selected=l&&typeof l!="function"&&typeof l!="symbol":vn(n,r,Z,l,a,null));return;case"dialog":Gt("beforetoggle",n),Gt("toggle",n),Gt("cancel",n),Gt("close",n);break;case"iframe":case"object":Gt("load",n);break;case"video":case"audio":for(l=0;l<eu.length;l++)Gt(eu[l],n);break;case"image":Gt("error",n),Gt("load",n);break;case"details":Gt("toggle",n);break;case"embed":case"source":case"link":Gt("error",n),Gt("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in a)if(a.hasOwnProperty(ae)&&(l=a[ae],l!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:vn(n,r,ae,l,a,null)}return;default:if(Za(r)){for(pe in a)a.hasOwnProperty(pe)&&(l=a[pe],l!==void 0&&v0(n,r,pe,l,a,void 0));return}}for(P in a)a.hasOwnProperty(P)&&(l=a[P],l!=null&&vn(n,r,P,l,a,null))}var gD={};function mD(n,r,a,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,T=null,P=null,Z=null,ae=null,pe=null;for(fe in a){var Ce=a[fe];if(a.hasOwnProperty(fe)&&Ce!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":Z=Ce;default:l.hasOwnProperty(fe)||vn(n,r,fe,null,l,Ce)}}for(var ie in l){var fe=l[ie];if(Ce=a[ie],l.hasOwnProperty(ie)&&(fe!=null||Ce!=null))switch(ie){case"type":fe!==Ce&&(gt=!0),y=fe;break;case"name":fe!==Ce&&(gt=!0),p=fe;break;case"checked":fe!==Ce&&(gt=!0),ae=fe;break;case"defaultChecked":fe!==Ce&&(gt=!0),pe=fe;break;case"value":fe!==Ce&&(gt=!0),T=fe;break;case"defaultValue":fe!==Ce&&(gt=!0),P=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(s(137,r));break;default:fe!==Ce&&vn(n,r,ie,fe,l,Ce)}}Cr(n,T,P,Z,ae,pe,y,p);return;case"select":fe=T=P=ie=null;for(y in a)if(Z=a[y],a.hasOwnProperty(y)&&Z!=null)switch(y){case"value":break;case"multiple":fe=Z;default:l.hasOwnProperty(y)||vn(n,r,y,null,l,Z)}for(p in l)if(y=l[p],Z=a[p],l.hasOwnProperty(p)&&(y!=null||Z!=null))switch(p){case"value":y!==Z&&(gt=!0),ie=y;break;case"defaultValue":y!==Z&&(gt=!0),P=y;break;case"multiple":y!==Z&&(gt=!0),T=y;default:y!==Z&&vn(n,r,p,y,l,Z)}r=P,a=T,l=fe,ie!=null?Kr(n,!!a,ie,!1):!!l!=!!a&&(r!=null?Kr(n,!!a,r,!0):Kr(n,!!a,a?[]:"",!1));return;case"textarea":fe=ie=null;for(P in a)if(p=a[P],a.hasOwnProperty(P)&&p!=null&&!l.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:vn(n,r,P,null,l,p)}for(T in l)if(p=l[T],y=a[T],l.hasOwnProperty(T)&&(p!=null||y!=null))switch(T){case"value":p!==y&&(gt=!0),ie=p;break;case"defaultValue":p!==y&&(gt=!0),fe=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(s(91));break;default:p!==y&&vn(n,r,T,p,l,y)}Xo(n,ie,fe);return;case"option":for(var Ye in a)ie=a[Ye],a.hasOwnProperty(Ye)&&ie!=null&&!l.hasOwnProperty(Ye)&&(Ye==="selected"?n.selected=!1:vn(n,r,Ye,null,l,ie));for(Z in l)ie=l[Z],fe=a[Z],l.hasOwnProperty(Z)&&ie!==fe&&(ie!=null||fe!=null)&&(Z==="selected"?(ie!==fe&&(gt=!0),n.selected=ie&&typeof ie!="function"&&typeof ie!="symbol"):vn(n,r,Z,ie,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 a)ie=a[rt],a.hasOwnProperty(rt)&&ie!=null&&!l.hasOwnProperty(rt)&&vn(n,r,rt,null,l,ie);for(ae in l)if(ie=l[ae],fe=a[ae],l.hasOwnProperty(ae)&&ie!==fe&&(ie!=null||fe!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,r));break;default:vn(n,r,ae,ie,l,fe)}return;default:if(Za(r)){for(var Pt in a)ie=a[Pt],a.hasOwnProperty(Pt)&&ie!==void 0&&!l.hasOwnProperty(Pt)&&v0(n,r,Pt,void 0,l,ie);for(pe in l)ie=l[pe],fe=a[pe],!l.hasOwnProperty(pe)||ie===fe||ie===void 0&&fe===void 0||v0(n,r,pe,ie,l,fe);return}}for(var se in a)ie=a[se],a.hasOwnProperty(se)&&ie!=null&&!l.hasOwnProperty(se)&&vn(n,r,se,null,l,ie);for(Ce in l)ie=l[Ce],fe=a[Ce],!l.hasOwnProperty(Ce)||ie===fe||ie==null&&fe==null||vn(n,r,Ce,ie,l,fe)}function uS(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yD(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var p=a[l],y=p.transferSize,T=p.initiatorType,P=p.duration;if(y&&P&&uS(T)){for(T=0,P=p.responseEnd,l+=1;l<a.length;l++){var Z=a[l],ae=Z.startTime;if(ae>P)break;var pe=Z.transferSize,Ce=Z.initiatorType;pe&&uS(Ce)&&(Z=Z.responseEnd,T+=pe*(Z<P?1:(P-ae)/(Z-ae)))}if(--l,r+=8*(y+T)/(p.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var b0=null,x0=null;function nu(n){return n.nodeType===9?n:n.ownerDocument}function dS(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fS(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function hS(n,r,a,l){return a=nu(a).createElement(n),a[fn]=l,a[An]=r,Sr(a,n,r),Se(a),a}function S0(n,r){return n==="textarea"||n==="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 w0=null;function vD(){var n=window.event;return n&&n.type==="popstate"?n===w0?!1:(w0=n,!0):(w0=null,!1)}var E0=typeof setTimeout=="function"?setTimeout:void 0,bD=typeof clearTimeout=="function"?clearTimeout:void 0,pS=typeof Promise=="function"?Promise:void 0,gS=typeof requestAnimationFrame=="function"?requestAnimationFrame:E0,xD=typeof queueMicrotask=="function"?queueMicrotask:typeof pS<"u"?function(n){return pS.resolve(null).then(n).catch(SD)}:E0;function SD(n){setTimeout(function(){throw n})}function Ta(n){return n==="head"}function mS(n,r){var a=r,l=0;do{var p=a.nextSibling;if(n.removeChild(a),p&&p.nodeType===8)if(a=p.data,a==="/$"||a==="/&"){if(l===0){n.removeChild(p),Nl(r);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")N0(n.ownerDocument.documentElement);else if(a==="head"){a=n.ownerDocument.head,N0(a);for(var y=a.firstChild;y;){var T=y.nextSibling,P=y.nodeName;y[xi]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&y.rel.toLowerCase()==="stylesheet"||a.removeChild(y),y=T}}else a==="body"&&N0(n.ownerDocument.body);a=p}while(a);Nl(r)}function yS(n,r){var a=n;n=0;do{var l=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(n===0)break;n--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||n++;a=l}while(a)}function vS(n,r,a){if(r=CSS.escape(r)!==r?"r-"+btoa(r).replace(/=/g,""):r,n.style.viewTransitionName=r,a!=null&&(n.style.viewTransitionClass=a),a=getComputedStyle(n),a.display==="inline"){if(r=n.getClientRects(),r.length===1)var l=1;else for(var p=l=0;p<r.length;p++){var y=r[p];0<y.width&&0<y.height&&l++}l===1&&(n=n.style,n.display=r.length===1?"inline-block":"block",n.marginTop="-"+a.paddingTop,n.marginBottom="-"+a.paddingBottom)}}function bS(n,r){n=n.style,r=r.style;var a=r!=null?r.hasOwnProperty("viewTransitionName")?r.viewTransitionName:r.hasOwnProperty("view-transition-name")?r["view-transition-name"]:null:null;n.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=r!=null?r.hasOwnProperty("viewTransitionClass")?r.viewTransitionClass:r.hasOwnProperty("view-transition-class")?r["view-transition-class"]:null:null,n.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),n.display==="inline-block"&&(r==null?n.display=n.margin="":(a=r.display,n.display=a==null||typeof a=="boolean"?"":a,a=r.margin,a!=null?n.margin=a:(a=r.hasOwnProperty("marginTop")?r.marginTop:r["margin-top"],n.marginTop=a==null||typeof a=="boolean"?"":a,r=r.hasOwnProperty("marginBottom")?r.marginBottom:r["margin-bottom"],n.marginBottom=r==null||typeof r=="boolean"?"":r)))}function wD(n,r,a){return a=a.ownerDocument.defaultView,{rect:n,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<=n.bottom&&0<=n.right&&n.top<=a.innerHeight&&n.left<=a.innerWidth}}function R0(n){var r=n.getBoundingClientRect(),a=getComputedStyle(n);return wD(r,a,n)}function ED(n){return n.documentElement.clientHeight}function RD(n){this.addEventListener("load",n),this.addEventListener("error",n)}function CD(n,r,a,l,p,y,T,P,Z){var ae=r.nodeType===9?r:r.ownerDocument;try{var pe=ae.startViewTransition({update:function(){var ie=ae.defaultView,fe=ie.navigation&&ie.navigation.transition,Ye=ae.fonts.status;l();var rt=[];if(Ye==="loaded"&&(ED(ae),ae.fonts.status==="loading"&&rt.push(ae.fonts.ready)),Ye=rt.length,n!==null)for(var Pt=n.suspenseyImages,se=0,te=0;te<Pt.length;te++){var ce=Pt[te];if(!ce.complete){var Re=ce.getBoundingClientRect();if(0<Re.bottom&&0<Re.right&&Re.top<ie.innerHeight&&Re.left<ie.innerWidth){if(se+=HS(ce),se>_f){rt.length=Ye;break}ce=new Promise(RD.bind(ce)),rt.push(ce)}}}if(0<rt.length)return ie=Promise.race([Promise.all(rt),new Promise(function(Je){return setTimeout(Je,500)})]).then(p,p),(fe?Promise.allSettled([fe.finished,ie]):ie).then(y,y);if(p(),fe)return fe.finished.then(y,y);y()},types:a});ae.__reactViewTransition=pe;var Ce=[];return pe.ready.then(function(){for(var ie=ae.documentElement.getAnimations({subtree:!0}),fe=0;fe<ie.length;fe++){var Ye=ie[fe],rt=Ye.effect,Pt=rt.pseudoElement;if(Pt!=null&&Pt.startsWith("::view-transition")){Ce.push(Ye),Ye=rt.getKeyframes();for(var se=Pt=void 0,te=!0,ce=0;ce<Ye.length;ce++){var Re=Ye[ce],Je=Re.width;if(Pt===void 0)Pt=Je;else if(Pt!==Je){te=!1;break}if(Je=Re.height,se===void 0)se=Je;else if(se!==Je){te=!1;break}delete Re.width,delete Re.height,Re.transform==="none"&&delete Re.transform}te&&Pt!==void 0&&se!==void 0&&(rt.setKeyframes(Ye),te=getComputedStyle(rt.target,rt.pseudoElement),te.width!==Pt||te.height!==se)&&(te=Ye[0],te.width=Pt,te.height=se,te=Ye[Ye.length-1],te.width=Pt,te.height=se,rt.setKeyframes(Ye))}}T()},function(ie){ae.__reactViewTransition===pe&&(ae.__reactViewTransition=null);try{typeof ie=="object"&&ie!==null&&ie.name==="InvalidStateError"&&(ie.message==="View transition was skipped because document visibility state is hidden."||ie.message==="Skipping view transition because document visibility state has become hidden."||ie.message==="Skipping view transition because viewport size changed."||ie.message==="Transition was aborted because of invalid state")&&(ie=null),ie!==null&&Z(ie)}finally{l(),p(),T()}}),pe.finished.finally(function(){for(var ie=0;ie<Ce.length;ie++)Ce[ie].cancel();ae.__reactViewTransition===pe&&(ae.__reactViewTransition=null),P()}),pe}catch{return l(),p(),T(),null}}function wo(n,r){this._scope=document.documentElement,this._selector="::view-transition-"+n+"("+r+")"}wo.prototype.animate=function(n,r){return r=typeof r=="number"?{duration:r}:D({},r),r.pseudoElement=this._selector,this._scope.animate(n,r)},wo.prototype.getAnimations=function(){for(var n=this._scope,r=this._selector,a=n.getAnimations({subtree:!0}),l=[],p=0;p<a.length;p++){var y=a[p].effect;y!==null&&y.target===n&&y.pseudoElement===r&&l.push(a[p])}return l},wo.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function xS(n){return{name:n,group:new wo("group",n),imagePair:new wo("image-pair",n),old:new wo("old",n),new:new wo("new",n)}}function hi(n){this._fragmentFiber=n,this._observers=this._eventListeners=null}hi.prototype.addEventListener=function(n,r,a){var l=null,p=null;if(!(a!=null&&typeof a!="boolean"&&(l=a.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var y=this._eventListeners;if(wS(y,n,r,a)===-1){var T=this,P=r;a!=null&&typeof a!="boolean"&&a.once===!0&&(P=function(Z){T.removeEventListener(n,r,a),typeof r=="function"?r.call(this,Z):r.handleEvent(Z)}),l!==null&&(p=T.removeEventListener.bind(T,n,r,a),l.addEventListener("abort",p,{once:!0}),p=l.removeEventListener.bind(l,"abort",p)),l=Cl(a),y.push({type:n,listener:r,optionsOrUseCapture:a,attachedListener:P,cleanup:p}),h(this._fragmentFiber.child,!1,TD,n,P,l)}this._eventListeners=y}};function TD(n,r,a,l){return E(n).addEventListener(r,a,l),!1}hi.prototype.removeEventListener=function(n,r,a){var l=this._eventListeners;if(l!==null&&(r=wS(l,n,r,a),r!==-1)){var p=l[r];a=p.attachedListener;var y=p.cleanup;p=Cl(p.optionsOrUseCapture),h(this._fragmentFiber.child,!1,kD,n,a,p),l.splice(r,1),y!==null&&y()}};function kD(n,r,a,l){return E(n).removeEventListener(r,a,l),!1}function Cl(n){return n!=null&&typeof n!="boolean"&&(n.once===!0||n.signal instanceof AbortSignal)?{capture:n.capture,passive:n.passive}:n}function SS(n){return n==null?"c=0":typeof n=="boolean"?"c="+(n?"1":"0"):"c="+(n.capture?"1":"0")}function wS(n,r,a,l){if(n.length===0)return-1;l=SS(l);for(var p=0;p<n.length;p++){var y=n[p];if(y.type===r&&y.listener===a&&SS(y.optionsOrUseCapture)===l)return p}return-1}hi.prototype.dispatchEvent=function(n){var r=x(this._fragmentFiber);if(r===null)return!0;r=E(r);var a=this._eventListeners;if(a!==null&&0<a.length||!n.bubbles){var l=r.nodeType===9?r.createComment(""):document.createTextNode("");if(a)for(var p=0;p<a.length;p++){var y=a[p];l.addEventListener(y.type,y.attachedListener,Cl(y.optionsOrUseCapture))}if(r.appendChild(l),n=l.dispatchEvent(n),a)for(p=0;p<a.length;p++)y=a[p],l.removeEventListener(y.type,y.attachedListener,Cl(y.optionsOrUseCapture));return r.removeChild(l),n}return r.dispatchEvent(n)},hi.prototype.focus=function(n){h(this._fragmentFiber.child,!0,ES,n,void 0,void 0)};function ES(n,r){return n.tag===6?!1:(n=E(n),UD(n,r))}hi.prototype.focusLast=function(n){var r=[];h(this._fragmentFiber.child,!0,C0,r,void 0,void 0);for(var a=r.length-1;0<=a&&!ES(r[a],n);a--);};function C0(n,r){return r.push(n),!1}hi.prototype.blur=function(){var n=x(this._fragmentFiber);n!==null&&(n=E(n),n=nu(n).activeElement,n!==null&&h(this._fragmentFiber.child,!1,OD,n,void 0,void 0))};function OD(n,r){return n.tag===6?!1:(n=E(n),n===r||n.contains(r)?(r.blur(),!0):!1)}hi.prototype.observeUsing=function(n){this._observers===null&&(this._observers=new Set),this._observers.add(n),h(this._fragmentFiber.child,!1,AD,n,void 0,void 0)};function AD(n,r){return n.tag===6||(n=E(n),r.observe(n)),!1}hi.prototype.unobserveUsing=function(n){var r=this._observers;if(r!==null&&r.has(n)){r.delete(n),h(this._fragmentFiber.child,!1,MD,n,void 0,void 0);for(var a=r=0;a<Ki.length;a++){var l=Ki[a];l.fragmentInstance===this&&l.observer===n?n.unobserve(l.instance):Ki[r++]=l}Ki.length=r}};function MD(n,r){return n.tag===6||(n=E(n),r.unobserve(n)),!1}var Ki=[],T0=!1;function ND(n,r,a){Ki.push({fragmentInstance:n,observer:r,instance:a}),T0||(T0=!0,HD(function(){T0=!1;var l=Ki;Ki=[];for(var p=0;p<l.length;p++){var y=l[p];y.observer.unobserve(y.instance)}}))}hi.prototype.getClientRects=function(){var n=[];return h(this._fragmentFiber.child,!1,DD,n,void 0,void 0),n};function DD(n,r){if(n.tag===6){n=n.stateNode;var a=n.ownerDocument.createRange();a.selectNodeContents(n),r.push.apply(r,a.getClientRects())}else n=E(n),r.push.apply(r,n.getClientRects());return!1}hi.prototype.getRootNode=function(n){var r=x(this._fragmentFiber);return r===null?this:E(r).getRootNode(n)},hi.prototype.compareDocumentPosition=function(n){var r=x(this._fragmentFiber);if(r===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];h(this._fragmentFiber.child,!1,C0,a,void 0,void 0);var l=E(r);if(a.length===0){if(a=l,S(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&&(a=r)}r=this._fragmentFiber;var p=l=a.compareDocumentPosition(n);return a===n?p=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=w(r)[1],a===null?p=Node.DOCUMENT_POSITION_PRECEDING:(n=E(a).compareDocumentPosition(n),p=n===0||n&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),p|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}r=E(a[0]),p=E(a[a.length-1]);var y=S(this._fragmentFiber)?r.parentElement:l;if(y==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=y.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY,y=y.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_CONTAINED_BY;var T=r.compareDocumentPosition(n),P=p.compareDocumentPosition(n),Z=T&Node.DOCUMENT_POSITION_CONTAINED_BY||P&Node.DOCUMENT_POSITION_CONTAINED_BY;return P=l&&y&&T&Node.DOCUMENT_POSITION_FOLLOWING&&P&Node.DOCUMENT_POSITION_PRECEDING,r=l&&r===n||y&&p===n||Z||P?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&r===n||!y&&p===n?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:T,r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||jD(r,this._fragmentFiber,a[0],a[a.length-1],n)?r:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function jD(n,r,a,l,p){var y=Fn(p);if(n&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!y)e:{for(;y!==null;){if(y.tag===7&&(y===r||y.alternate===r)){a=!0;break e}y=y.return}a=!1}return a}if(n&Node.DOCUMENT_POSITION_CONTAINS){if(y===null)return y=p.ownerDocument,p===y||p===y.documentElement||p===y.body;e:{for(y=r,r=x(r);y!==null;){if(!(y.tag!==5&&y.tag!==3&&y.tag!==27||y!==r&&y.alternate!==r)){y=!0;break e}y=y.return}y=!1}return y}return n&Node.DOCUMENT_POSITION_PRECEDING?((r=!!y)&&!(r=y===a)&&(r=j(a,y,N),r===null?r=!1:(h(r,!0,O,y,a),y=R,R=null,r=y!==null)),r):n&Node.DOCUMENT_POSITION_FOLLOWING?((r=!!y)&&!(r=y===l)&&(r=j(l,y,N),r===null?r=!1:(h(r,!0,A,y,l),y=R,k=R=null,r=y!==null)),r):!1}function RS(n,r){var a=n.ownerDocument.createRange();a.selectNodeContents(n),n=a.getBoundingClientRect(),window.scrollTo(window.scrollX+n.left,r?window.scrollY+n.top:window.scrollY+n.bottom-window.innerHeight)}hi.prototype.scrollIntoView=function(n){if(typeof n=="object")throw Error(s(566));var r=[];h(this._fragmentFiber.child,!1,C0,r,void 0,void 0);var a=n!==!1;if(r.length===0){var l=w(this._fragmentFiber);if(l=a?l[1]||l[0]||x(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){n=E(l),RS(n,a);return}if(l=E(l),l.nodeType!==9){if(l.nodeType===11){a="host"in l?l.host:null,a!==null&&a.scrollIntoView(n);return}l.scrollIntoView(n)}}for(l=a?r.length-1:0;l!==(a?-1:r.length);){var p=r[l];p.tag===6?(p=E(p),RS(p,a)):E(p).scrollIntoView(n),l+=a?-1:1}};function ID(n,r){return n=E(n),CS(n,r),!1}function CS(n,r){n.reactFragments==null&&(n.reactFragments=new Set),n.reactFragments.add(r)}function TS(n,r){var a=r._eventListeners;if(a!==null)for(var l=0;l<a.length;l++){var p=a[l];n.addEventListener(p.type,p.attachedListener,Cl(p.optionsOrUseCapture))}n.nodeType!==3&&(a=r._observers,a!==null&&a.forEach(function(y){for(var T=0,P=0;P<Ki.length;P++){var Z=Ki[P];(Z.fragmentInstance!==r||Z.observer!==y||Z.instance!==n)&&(Ki[T++]=Z)}Ki.length=T,y.observe(n)}),CS(n,r))}function PD(n,r){var a=r._eventListeners;if(a!==null)for(var l=0;l<a.length;l++){var p=a[l];n.removeEventListener(p.type,p.attachedListener,Cl(p.optionsOrUseCapture))}n.nodeType!==3&&(a=r._observers,a!==null&&a.forEach(function(y){typeof y.rootMargin=="string"?ND(r,y,n):y.unobserve(n)}),n.reactFragments!=null&&n.reactFragments.delete(r))}function k0(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":k0(a),qn(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}n.removeChild(a)}}function LD(n,r,a,l){for(;n.nodeType===1;){var p=a;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[xi])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(y=n.getAttribute("rel"),y==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(y!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(y=n.getAttribute("src"),(y!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===y)return n}else return n;if(n=Oi(n.nextSibling),n===null)break}return null}function zD(n,r,a){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=Oi(n.nextSibling),n===null))return null;return n}function kS(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=Oi(n.nextSibling),n===null))return null;return n}function O0(n){return n.data==="$?"||n.data==="$~"}function A0(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function _D(n,r){var a=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||a.readyState!=="loading")r();else{var l=function(){r(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),n._reactRetry=l}}function Oi(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var M0=null;function OS(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var a=n.data;if(a==="/$"||a==="/&"){if(r===0)return Oi(n.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}n=n.nextSibling}return null}function AS(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var a=n.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return n;r--}else a!=="/$"&&a!=="/&"||r++}n=n.previousSibling}return null}function UD(n,r){function a(){l=!0}if(n.ownerDocument.activeElement===n)return!0;var l=!1;try{n.ownerDocument.addEventListener("focus",a,!0),(n.focus||HTMLElement.prototype.focus).call(n,r)}finally{n.ownerDocument.removeEventListener("focus",a,!0)}return l}function HD(n){gS(function(){gS(function(r){return n(r)})})}function MS(n,r,a){switch(r=nu(a),n){case"html":if(n=r.documentElement,!n)throw Error(s(452));return n;case"head":if(n=r.head,!n)throw Error(s(453));return n;case"body":if(n=r.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function NS(n,r,a){for(var l in a){var p=a[l];a.hasOwnProperty(l)&&p!=null&&vn(n,r,l,null,gD,p)}a.dangerouslySetInnerHTML!=null&&(n.textContent=""),n.onclick===Ir&&(n.onclick=null),qn(n)}function N0(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);qn(n)}var Ai=new Map,DS=new Set;function ru(n){if(typeof n.getRootNode=="function"){var r=n.getRootNode();if(r.nodeType===9||r.nodeType===11)return r}return n.nodeType===9?n:n.ownerDocument}var Bs=ue.d;ue.d={f:FD,r:BD,D:VD,C:KD,L:qD,m:YD,X:$D,S:GD,M:QD};function FD(){var n=Bs.f(),r=Af();return n||r}function BD(n){var r=pr(n);r!==null&&r.tag===5&&r.type==="form"?I2(r):Bs.r(n)}var Tl=typeof document>"u"?null:document;function jS(n,r,a){var l=Tl;if(l&&typeof r=="string"&&r){var p=Dn(r);p='link[rel="'+n+'"][href="'+p+'"]',typeof a=="string"&&(p+='[crossorigin="'+a+'"]'),DS.has(p)||(DS.add(p),n={rel:n,crossOrigin:a,href:r},l.querySelector(p)===null&&(r=l.createElement("link"),Sr(r,"link",n),Se(r),l.head.appendChild(r)))}}function VD(n){Bs.D(n),jS("dns-prefetch",n,null)}function KD(n,r){Bs.C(n,r),jS("preconnect",n,r)}function qD(n,r,a){Bs.L(n,r,a);var l=Tl;if(l&&n&&r){var p='link[rel="preload"][as="'+Dn(r)+'"]';r==="image"&&a&&a.imageSrcSet?(p+='[imagesrcset="'+Dn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(p+='[imagesizes="'+Dn(a.imageSizes)+'"]')):p+='[href="'+Dn(n)+'"]';var y=p;switch(r){case"style":y=kl(n);break;case"script":y=Ol(n)}if(!(Ai.has(y)||(n=D({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:n,as:r},a),Ai.set(y,n),l.querySelector(p)!==null||r==="style"&&l.querySelector(iu(y))||r==="script"&&l.querySelector(su(y))))){var T=l.createElement("link");Sr(T,"link",n),r==="style"&&(T[zt]=!0,T.onload=T.onerror=function(){nt(T)}),Se(T),l.head.appendChild(T)}}}function YD(n,r){Bs.m(n,r);var a=Tl;if(a&&n){var l=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Dn(l)+'"][href="'+Dn(n)+'"]',y=p;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Ol(n)}if(!Ai.has(y)&&(n=D({rel:"modulepreload",href:n},r),Ai.set(y,n),a.querySelector(p)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(su(y)))return}l=a.createElement("link"),Sr(l,"link",n),Se(l),a.head.appendChild(l)}}}function GD(n,r,a){Bs.S(n,r,a);var l=Tl;if(l&&n){var p=Ae(l).hoistableStyles,y=kl(n);r=r||"default";var T=p.get(y);if(!T){var P={loading:0,preload:null};if(T=l.querySelector(iu(y)))P.loading=5;else{n=D({rel:"stylesheet",href:n,"data-precedence":r},a),(a=Ai.get(y))&&D0(n,a);var Z=T=l.createElement("link");Se(Z),Sr(Z,"link",n),Z._p=new Promise(function(ae,pe){Z.onload=ae,Z.onerror=pe}),Z.addEventListener("load",function(){P.loading|=1}),Z.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Lf(T,r,l)}T={type:"stylesheet",instance:T,count:1,state:P},p.set(y,T)}}}function $D(n,r){Bs.X(n,r);var a=Tl;if(a&&n){var l=Ae(a).hoistableScripts,p=Ol(n),y=l.get(p);y||(y=a.querySelector(su(p)),y||(n=D({src:n,async:!0},r),(r=Ai.get(p))&&j0(n,r),y=a.createElement("script"),Se(y),Sr(y,"link",n),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},l.set(p,y))}}function QD(n,r){Bs.M(n,r);var a=Tl;if(a&&n){var l=Ae(a).hoistableScripts,p=Ol(n),y=l.get(p);y||(y=a.querySelector(su(p)),y||(n=D({src:n,async:!0,type:"module"},r),(r=Ai.get(p))&&j0(n,r),y=a.createElement("script"),Se(y),Sr(y,"link",n),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},l.set(p,y))}}function IS(n,r,a,l){var p=(p=be.current)?ru(p):null;if(!p)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=kl(a.href),r=Ae(p).hoistableStyles,l=r.get(a),l||(l={type:"style",instance:null,count:0,state:null},r.set(a,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){n=kl(a.href);var y=Ae(p).hoistableStyles,T=y.get(n);if(T||(p=p.ownerDocument||p,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(n,T),(y=p.querySelector(iu(n)))?y._p||(T.instance=y,T.state.loading=5):(y=Ai.get(n),y||(y={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ai.set(n,y)),XD(p,n,y,T.state))),r&&l===null)throw Error(s(528,""));return T}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(a=Ol(a),r=Ae(p).hoistableScripts,l=r.get(a),l||(l={type:"script",instance:null,count:0,state:null},r.set(a,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function kl(n){return'href="'+Dn(n)+'"'}function iu(n){return'link[rel="stylesheet"]['+n+"]"}function PS(n){return D({},n,{"data-precedence":n.precedence,precedence:null})}function XD(n,r,a,l){if(r=n.querySelector('link[rel="preload"][as="style"]['+r+"]")){if(r[zt]!==!0){l.loading=1;return}}else r=n.createElement("link"),r[zt]=!0,r.onload=r.onerror=nt.bind(null,r),Sr(r,"link",a),Se(r),n.head.appendChild(r);l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2})}function Ol(n){return'[src="'+Dn(n)+'"]'}function su(n){return"script[async]"+n}function LS(n,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var l=n.querySelector('style[data-href~="'+Dn(a.href)+'"]');if(l)return r.instance=l,Se(l),l;var p=D({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),Se(l),Sr(l,"style",p),Lf(l,a.precedence,n),r.instance=l;case"stylesheet":p=kl(a.href);var y=n.querySelector(iu(p));if(y)return r.state.loading|=4,r.instance=y,Se(y),y;l=PS(a),(p=Ai.get(p))&&D0(l,p),y=(n.ownerDocument||n).createElement("link"),Se(y);var T=y;return T._p=new Promise(function(P,Z){T.onload=P,T.onerror=Z}),Sr(y,"link",l),r.state.loading|=4,Lf(y,a.precedence,n),r.instance=y;case"script":return y=Ol(a.src),(p=n.querySelector(su(y)))?(r.instance=p,Se(p),p):(l=a,(p=Ai.get(y))&&(l=D({},a),j0(l,p)),n=n.ownerDocument||n,p=n.createElement("script"),Se(p),Sr(p,"link",l),n.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,Lf(l,a.precedence,n));return r.instance}function Lf(n,r,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=l.length?l[l.length-1]:null,y=p,T=0;T<l.length;T++){var P=l[T];if(P.dataset.precedence===r)y=P;else if(y!==p)break}y?y.parentNode.insertBefore(n,y.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(n,r.firstChild))}function D0(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function j0(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var zf=null;function zS(n,r,a){if(zf===null){var l=new Map,p=zf=new Map;p.set(a,l)}else p=zf,l=p.get(a),l||(l=new Map,p.set(a,l));if(l.has(n))return l;for(l.set(n,null),a=a.getElementsByTagName(n),p=0;p<a.length;p++){var y=a[p];if(!(y[xi]||y[fn]||n==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var T=y.getAttribute(r)||"";T=n+T;var P=l.get(T);P?P.push(y):l.set(T,[y])}}return l}function I0(n,r,a){n=n.ownerDocument||n,n.head.insertBefore(a,r==="title"?n.querySelector("head > title"):null)}function ZD(n,r,a){if(a===1||r.itemProp!=null)return!1;switch(n){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"?(n=r.disabled,typeof r.precedence=="string"&&n==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 _S(n,r){return n==="img"&&r.src!=null&&r.src!==""&&r.onLoad==null&&r.loading!=="lazy"}function US(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function HS(n){return(n.width||100)*(n.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function FS(n,r){typeof r.decode=="function"&&(n.imgCount++,r.complete||(n.imgBytes+=HS(r),n.suspenseyImages.push(r)),n=e4.bind(n),r.decode().then(n,n))}function JD(n,r,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var p=kl(l.href),y=r.querySelector(iu(p));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=au.bind(n),r.then(n,n)),a.state.loading|=4,a.instance=y,Se(y);return}y=r.ownerDocument||r,l=PS(l),(p=Ai.get(p))&&D0(l,p),y=y.createElement("link"),Se(y);var T=y;T._p=new Promise(function(P,Z){T.onload=P,T.onerror=Z}),Sr(y,"link",l),a.instance=y}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(n.count++,a=au.bind(n),r.addEventListener("load",a),r.addEventListener("error",a))}}var _f=0;function WD(n,r){return n.stylesheets&&n.count===0&&Hf(n,n.stylesheets),0<n.count||0<n.imgCount?function(a){var l=setTimeout(function(){if(n.stylesheets&&Hf(n,n.stylesheets),n.unsuspend){var y=n.unsuspend;n.unsuspend=null,y()}},6e4+r);0<n.imgBytes&&_f===0&&(_f=62500*yD());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Hf(n,n.stylesheets),n.unsuspend)){var y=n.unsuspend;n.unsuspend=null,y()}},(n.imgBytes>_f?50:800)+r);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(p)}}:null}function BS(n){if(n.count===0&&(n.imgCount===0||!n.waitingForImages)){if(n.stylesheets)Hf(n,n.stylesheets);else if(n.unsuspend){var r=n.unsuspend;n.unsuspend=null,r()}}}function au(){this.count--,BS(this)}function e4(){this.imgCount--,BS(this)}var Uf=null;function Hf(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Uf=new Map,r.forEach(t4,n),Uf=null,au.call(n))}function t4(n,r){if(!(r.state.loading&4)){var a=Uf.get(n);if(a)var l=a.get(null);else{a=new Map,Uf.set(n,a);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var T=p[y];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(a.set(T.dataset.precedence,T),l=T)}l&&a.set(null,l)}p=r.instance,T=p.getAttribute("data-precedence"),y=a.get(T)||l,y===l&&a.set(null,p),a.set(T,p),this.count++,l=au.bind(this),p.addEventListener("load",l),p.addEventListener("error",l),y?y.parentNode.insertBefore(p,y.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),r.state.loading|=4}}var Al={$$typeof:U,Provider:null,Consumer:null,_currentValue:Te,_currentValue2:Te,_threadCount:0};function n4(n,r,a,l,p,y,T,P,Z){this.tag=1,this.containerInfo=n,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=Et(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Et(0),this.hiddenUpdates=Et(null),this.identifierPrefix=l,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.transitionTypes=null,this.incompleteTransitions=new Map}function VS(n,r,a,l,p,y,T,P,Z,ae,pe,Ce){return n=new n4(n,r,a,T,Z,ae,pe,Ce,P),r=1,y===!0&&(r|=24),y=qr(3,null,null,r),n.current=y,y.stateNode=n,r=Qg(),r.refCount++,n.pooledCache=r,r.refCount++,y.memoizedState={element:l,isDehydrated:a,cache:r},Wg(y),n}function KS(n){return n?(n=tl,n):tl}function qS(n,r,a,l,p,y){p=KS(p),l.context===null?l.context=p:l.pendingContext=p,l=pa(r),l.payload={element:a},y=y===void 0?null:y,y!==null&&(l.callback=y),a=ga(n,l,r),a!==null&&(Qr(a,n,r),zc(a,n,r))}function YS(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var a=n.retryLane;n.retryLane=a!==0&&a<r?a:r}}function P0(n,r){YS(n,r),(n=n.alternate)&&YS(n,r)}function GS(n){if(n.tag===13||n.tag===31){var r=io(n,67108864);r!==null&&Qr(r,n,67108864),P0(n,67108864)}}function $S(n){if(n.tag===13||n.tag===31){var r=fi();r=Bt(r);var a=io(n,r);a!==null&&Qr(a,n,r),P0(n,r)}}var Ml=!0;function r4(n,r,a,l){var p=ge.T;ge.T=null;var y=ue.p;try{ue.p=2,L0(n,r,a,l)}finally{ue.p=y,ge.T=p}}function i4(n,r,a,l){var p=ge.T;ge.T=null;var y=ue.p;try{ue.p=8,L0(n,r,a,l)}finally{ue.p=y,ge.T=p}}function L0(n,r,a,l){if(Ml){var p=z0(l);if(p===null)y0(n,r,l,Ff,a),XS(n,l);else if(a4(p,n,r,a,l))l.stopPropagation();else if(XS(n,l),r&4&&-1<s4.indexOf(n)){for(;p!==null;){var y=pr(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var T=qe(y.pendingLanes);if(T!==0){var P=y;for(P.pendingLanes|=2,P.entangledLanes|=2;T;){var Z=1<<31-et(T);P.entanglements[1]|=Z,T&=~Z}us(y),(cn&6)===0&&(Tf=wt()+500,Wc(0))}}break;case 31:case 13:P=io(y,2),P!==null&&Qr(P,y,2),Af(),P0(y,2)}if(y=z0(l),y===null&&y0(n,r,l,Ff,a),y===p)break;p=y}p!==null&&l.stopPropagation()}else y0(n,r,l,null,a)}}function z0(n){return n=Wa(n),_0(n)}var Ff=null;function _0(n){if(Ff=null,n=Fn(n),n!==null){var r=c(n);if(r===null)n=null;else{var a=r.tag;if(a===13){if(n=u(r),n!==null)return n;n=null}else if(a===31){if(n=d(r),n!==null)return n;n=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return Ff=n,null}function QS(n){switch(n){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(Zt()){case ht:return 2;case xt:return 8;case yt:case Ut:return 32;case un:return 268435456;default:return 32}default:return 32}}var U0=!1,ka=null,Oa=null,Aa=null,ou=new Map,lu=new Map,Ma=[],s4="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 XS(n,r){switch(n){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":Oa=null;break;case"mouseover":case"mouseout":Aa=null;break;case"pointerover":case"pointerout":ou.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":lu.delete(r.pointerId)}}function cu(n,r,a,l,p,y){return n===null||n.nativeEvent!==y?(n={blockedOn:r,domEventName:a,eventSystemFlags:l,nativeEvent:y,targetContainers:[p]},r!==null&&(r=pr(r),r!==null&&GS(r)),n):(n.eventSystemFlags|=l,r=n.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),n)}function a4(n,r,a,l,p){switch(r){case"focusin":return ka=cu(ka,n,r,a,l,p),!0;case"dragenter":return Oa=cu(Oa,n,r,a,l,p),!0;case"mouseover":return Aa=cu(Aa,n,r,a,l,p),!0;case"pointerover":var y=p.pointerId;return ou.set(y,cu(ou.get(y)||null,n,r,a,l,p)),!0;case"gotpointercapture":return y=p.pointerId,lu.set(y,cu(lu.get(y)||null,n,r,a,l,p)),!0}return!1}function ZS(n){var r=Fn(n.target);if(r!==null){var a=c(r);if(a!==null){if(r=a.tag,r===13){if(r=u(a),r!==null){n.blockedOn=r,ti(n.priority,function(){$S(a)});return}}else if(r===31){if(r=d(a),r!==null){n.blockedOn=r,ti(n.priority,function(){$S(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){n.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Bf(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var a=z0(n.nativeEvent);if(a===null){a=n.nativeEvent;var l=new a.constructor(a.type,a);Ja=l,a.target.dispatchEvent(l),Ja=null}else return r=pr(a),r!==null&&GS(r),n.blockedOn=a,!1;r.shift()}return!0}function JS(n,r,a){Bf(n)&&a.delete(r)}function o4(){U0=!1,ka!==null&&Bf(ka)&&(ka=null),Oa!==null&&Bf(Oa)&&(Oa=null),Aa!==null&&Bf(Aa)&&(Aa=null),ou.forEach(JS),lu.forEach(JS)}function Vf(n,r){n.blockedOn===r&&(n.blockedOn=null,U0||(U0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,o4)))}var Kf=null;function WS(n){Kf!==n&&(Kf=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Kf===n&&(Kf=null);for(var r=0;r<n.length;r+=3){var a=n[r],l=n[r+1],p=n[r+2];if(typeof l!="function"){if(_0(l||a)===null)continue;break}var y=pr(a);y!==null&&(n.splice(r,3),r-=3,xm(y,{pending:!0,data:p,method:a.method,action:l},l,p))}}))}function Nl(n){function r(Z){return Vf(Z,n)}ka!==null&&Vf(ka,n),Oa!==null&&Vf(Oa,n),Aa!==null&&Vf(Aa,n),ou.forEach(r),lu.forEach(r);for(var a=0;a<Ma.length;a++){var l=Ma[a];l.blockedOn===n&&(l.blockedOn=null)}for(;0<Ma.length&&(a=Ma[0],a.blockedOn===null);)ZS(a),a.blockedOn===null&&Ma.shift();if(a=(n.ownerDocument||n).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var p=a[l],y=a[l+1],T=p[An]||null;if(typeof y=="function")T||WS(a);else if(T){var P=null;if(y&&y.hasAttribute("formAction")){if(p=y,T=y[An]||null)P=T.formAction;else if(_0(p)!==null)continue}else P=T.action;typeof P=="function"?a[l+1]=P:(a.splice(l,3),l-=3),WS(a)}}}function ew(){function n(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(T){return p=T})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function H0(n){this._internalRoot=n}qf.prototype.render=H0.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current,l=fi();qS(a,l,n,r,null,null)},qf.prototype.unmount=H0.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;qS(n.current,2,null,n,null,null),Af(),r[jn]=null}};function qf(n){this._internalRoot=n}qf.prototype.unstable_scheduleHydration=function(n){if(n){var r=Tn();n={blockedOn:null,target:n,priority:r};for(var a=0;a<Ma.length&&r!==0&&r<Ma[a].priority;a++);Ma.splice(a,0,n),a===0&&ZS(n)}};var tw=t.version;if(tw!=="19.3.1")throw Error(s(527,tw,"19.3.1"));ue.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=g(r),n=n!==null?m(n):null,n=n===null?null:n.stateNode,n};var l4={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ge,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yf.isDisabled&&Yf.supportsFiber)try{Ie=Yf.inject(l4),ze=Yf}catch{}}return du.createRoot=function(n,r){if(!o(n))throw Error(s(299));var a=!1,l="",p=K2,y=q2,T=Y2;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(T=r.onRecoverableError)),r=VS(n,1,!1,null,null,a,l,null,p,y,T,ew),n[jn]=r.current,m0(n),new H0(r)},du.hydrateRoot=function(n,r,a){if(!o(n))throw Error(s(299));var l=!1,p="",y=K2,T=q2,P=Y2,Z=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(T=a.onCaughtError),a.onRecoverableError!==void 0&&(P=a.onRecoverableError),a.formState!==void 0&&(Z=a.formState)),r=VS(n,1,!0,r,a??null,l,p,Z,y,T,P,ew),r.context=KS(null),a=r.current,l=fi(),l=Bt(l),p=pa(l),p.callback=null,ga(a,p,l),a=l,r.current.lanes=a,ft(r,a),us(r),n[jn]=r.current,m0(n),new qf(r)},du.version="19.3.1",du}var dw;function v4(){if(dw)return V0.exports;dw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),V0.exports=y4(),V0.exports}var b4=v4();const fw={};function er(e,t){const i=b.useRef(fw);return i.current===fw&&(i.current=e(t)),i}const ky=[];let Oy;function x4(){return Oy}function S4(e){ky.push(e)}function Qu(e){const t=(i,s)=>{const o=er(w4).current;let c;try{Oy=o;for(const u of ky)u.before(o);c=e(i,s);for(const u of ky)u.after(o);o.didInitialize=!0}finally{Oy=void 0}return c};return t.displayName=e.displayName||e.name,t}function pp(e){return b.forwardRef(Qu(e))}function w4(){return{didInitialize:!1}}function En(){}const $i=Object.freeze([]),Xt=Object.freeze({}),E4=()=>{},_e=typeof document<"u"?b.useLayoutEffect:E4;function R4(e,t){return function(s,...o){const c=new URL(e);return c.searchParams.set("code",s.toString()),o.forEach(u=>c.searchParams.append("args[]",u)),`${t} error #${s}; visit ${c} for the full message.`}}const gn=R4("https://base-ui.com/production-error","Base UI"),KR=b.createContext(void 0);function Xu(e){const t=b.useContext(KR);if(t===void 0&&!e)throw new Error(gn(72));return t}function xv(e){b.useEffect(e,$i)}const fu=0;class Pi{static create(){return new Pi}currentId=fu;start(t,i){this.clear(),this.currentId=setTimeout(()=>{this.currentId=fu,i()},t)}isStarted(){return this.currentId!==fu}clear=()=>{this.currentId!==fu&&(clearTimeout(this.currentId),this.currentId=fu)};disposeEffect=()=>this.clear}function Un(){const e=er(Pi.create).current;return xv(e.disposeEffect),e}function C4(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:T4,platform:k4,maxTouchPoints:O4}=C4(),gp=T4.toLowerCase(),Iu=k4.toLowerCase(),mp=/^i(os$|p)/.test(Iu)||Iu==="macintel"&&O4>1,hw="android",Ay=Iu===hw||gp.includes(hw),Sv=!mp&&Iu.startsWith("mac");Iu.startsWith("win");const A4=Sv||mp,Ss=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Ss&&gp.includes("firefox");!Ss&&gp.includes("chrom");const M4=A4,wv=/jsdom|happydom/.test(gp);function Yi(e){e.preventDefault(),e.stopPropagation()}function N4(e){return"nativeEvent"in e}function ec(e){return e.pointerType===""&&e.isTrusted?!0:Ay&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ev(e){return wv?!1:!Ay&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(Ay||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function _a(e,t){const i=["mouse","pen"];return t||i.push("",void 0),i.includes(e)}function D4(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function yp(){return typeof window<"u"}function Rr(e){return Rv(e)?(e.nodeName||"").toLowerCase():"#document"}function Rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ea(e){var t;return(t=(Rv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Rv(e){return yp()?e instanceof Node||e instanceof Rn(e).Node:!1}function ln(e){return yp()?e instanceof Element||e instanceof Rn(e).Element:!1}function bn(e){return yp()?e instanceof HTMLElement||e instanceof Rn(e).HTMLElement:!1}function Do(e){return!yp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rn(e).ShadowRoot}function Zu(e){const{overflow:t,overflowX:i,overflowY:s,display:o}=mi(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+i)&&o!=="inline"&&o!=="contents"}function j4(e){return/^(table|td|th)$/.test(Rr(e))}function vp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const I4=/transform|translate|scale|rotate|perspective|filter/,P4=/paint|layout|strict|content/,Eo=e=>!!e&&e!=="none";let G0;function Cv(e){const t=ln(e)?mi(e):e;return Eo(t.transform)||Eo(t.translate)||Eo(t.scale)||Eo(t.rotate)||Eo(t.perspective)||!Tv()&&(Eo(t.backdropFilter)||Eo(t.filter))||I4.test(t.willChange||"")||P4.test(t.contain||"")}function L4(e){let t=Zs(e);for(;bn(t)&&!$s(t);){if(Cv(t))return t;if(vp(t))return null;t=Zs(t)}return null}function Tv(){return G0==null&&(G0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),G0}function $s(e){return/^(html|body|#document)$/.test(Rr(e))}function mi(e){return Rn(e).getComputedStyle(e)}function bp(e){return ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zs(e){if(Rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Do(e)&&e.host||ea(e);return Do(t)?t.host:t}function qR(e){const t=Zs(e);return $s(t)?(e.ownerDocument||e).body:bn(t)&&Zu(t)?t:qR(t)}function Pu(e,t,i){var s;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=qR(e),c=o===((s=e.ownerDocument)==null?void 0:s.body),u=Rn(o);if(c){const d=My(u);return t.concat(u,u.visualViewport||[],Zu(o)?o:[],d&&i?Pu(d):[])}else return t.concat(o,Pu(o,[],i))}function My(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Zr(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function it(e,t){if(!e||!t)return!1;const i=t.getRootNode?.();if(e.contains(t))return!0;if(i&&Do(i)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Lu(e,t){let i=e;for(;i;){if(ln(i)&&i.matches(t))return i;i=i.assignedSlot??i.parentNode??(Do(i)?i.host:null)}return null}function tr(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const Ny="data-base-ui-focusable",YR="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",xp="ArrowLeft",Sp="ArrowRight",GR="ArrowUp",kv="ArrowDown",Ov="data-starting-style",z4="data-ending-style",_4={[Ov]:""},U4={[z4]:""},ws={transitionStatus(e){return e==="starting"?_4:e==="ending"?U4:null}},H4="data-open",F4="data-closed",B4="data-anchor-hidden",$R="data-popup-open",V4="data-pressed",K4={[$R]:""},q4={[$R]:"",[V4]:""},Y4={[H4]:""},G4={[F4]:""},$4={[B4]:""},wp={open(e){return e?K4:null}},zu={open(e){return e?q4:null}},Ju={open(e){return e?Y4:G4},anchorHidden(e){return e?$4:null}},Ep={...Ju,...ws},Dy="data-trigger-disabled";function zh(e,t){if(!ln(e))return!1;const i=e;if(t.hasElement(i))return!i.hasAttribute(Dy);for(const[,s]of t.entries())if(it(s,i))return!s.hasAttribute(Dy);return!1}function $0(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const i=e;return i.target!=null&&t.contains(i.target)}function Q4(e){return e.matches("html,body")}function Wu(e){return bn(e)&&e.matches(YR)}function X4(e){return Lu(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${YR}`)!=null}function jy(e){return e?e.getAttribute("role")==="combobox"&&Wu(e):!1}function Z4(e){if(!e||wv)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function _h(e){return e?e.hasAttribute(Ny)?e:e.querySelector(`[${Ny}]`)||e:null}function J4(e,t){return t!=null&&!_a(t)?0:typeof e=="function"?e():e}function jo(e,t,i){const s=J4(e,i);return typeof s=="number"?s:s?.[t]}function pw(e){return typeof e=="function"?e():e}function QR(e,t){return t||e==="click"||e==="mousedown"}function W4(e){return e?.includes("mouse")&&e!=="mousedown"}function ut(e,t,i,s){let o=!1,c=!1;const u=s??Xt;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){c=!0},get isCanceled(){return o},get isPropagationAllowed(){return c},trigger:i,...u}}function ej(e,t,i){const s=i??Xt;return{reason:e,event:t??new Event("base-ui"),...s}}const Mr="none",Qi="trigger-press",Kn="trigger-hover",Fl="trigger-focus",Rp="outside-press",Mo="item-press",XR="close-press",Ha="focus-out",ed="escape-key",Uh="list-navigation",ZR="keyboard",tj="pointer",Av="cancel-open",vu="sibling-open",nj="disabled",td="imperative-action",rj="window-resize",JR=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Pi,currentIdRef:{current:null},currentContextRef:{current:null}});function ij(e,t){e.current=t.current}function sj(e){const{children:t,delay:i,timeoutMs:s=0}=e,o=b.useRef(i),c=b.useRef(i),u=b.useRef(null),d=b.useRef(null),f=Un();return _e(()=>{if(c.current=i,!u.current){o.current=i;return}o.current={open:jo(o.current,"open"),close:jo(i,"close")}},[i,u,o,c]),v.jsx(JR.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:o,initialDelayRef:c,currentIdRef:u,timeoutMs:s,currentContextRef:d,timeout:f}),[s,f]),children:t})}function aj(e,t={open:!1}){const{open:i}=t,s=e.useState("floatingId"),o=b.useContext(JR),{currentIdRef:c,delayRef:u,timeoutMs:d,initialDelayRef:f,currentContextRef:g,hasProvider:m,timeout:h}=o,[x,S]=b.useState(!1),w=b.useRef(i);return _e(()=>{w.current=i},[i]),_e(()=>{function C(){g.current?.setIsInstantPhase(!1),c.current=null,g.current=null,u.current=f.current,h.clear()}if(c.current&&!i&&c.current===s){if(S(!1),d){const E=s;return h.start(d,()=>{e.select("open")||c.current&&c.current!==E||C()}),()=>{(w.current||c.current!==E)&&h.clear()}}C()}},[i,s,c,u,d,f,g,h,e]),_e(()=>{if(!i)return;const C=g.current,E=c.current;h.clear(),g.current={onOpenChange:e.setOpen,setIsInstantPhase:S},c.current=s,u.current={open:0,close:jo(f.current,"close")},E!==null&&E!==s?(S(!0),C?.setIsInstantPhase(!0),C?.onOpenChange(!1,ut(Mr))):(S(!1),C?.setIsInstantPhase(!1))},[i,s,e,c,u,f,g,h]),_e(()=>()=>{if(c.current===s){if(g.current=null,!w.current)return;c.current=null,ij(u,f),h.clear()}},[g,c,u,s,f,h]),b.useMemo(()=>({activeIdRef:c,hasProvider:m,delayRef:u,isInstantPhase:x}),[c,m,u,x])}function Lt(e,t,i,s){return e.addEventListener(t,i,s),()=>{e.removeEventListener(t,i,s)}}function ys(...e){return()=>{for(let t=0;t<e.length;t+=1){const i=e[t];i&&i()}}}function Wr(e,t,i,s){const o=er(WR).current;return lj(o,e,t,i,s)&&eC(o,[e,t,i,s]),o.callback}function oj(e){const t=er(WR).current;return cj(t,e)&&eC(t,e),t.callback}function WR(){return{callback:null,cleanup:null,refs:[]}}function lj(e,t,i,s,o){return e.refs[0]!==t||e.refs[1]!==i||e.refs[2]!==s||e.refs[3]!==o}function cj(e,t){return e.refs.length!==t.length||e.refs.some((i,s)=>i!==t[s])}function eC(e,t){if(e.refs=t,t.every(i=>i==null)){e.callback=null;return}e.callback=i=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),i!=null){const s=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const c=t[o];if(c!=null)switch(typeof c){case"function":{const u=c(i);typeof u=="function"&&(s[o]=u);break}case"object":{c.current=i;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const c=t[o];if(c!=null)switch(typeof c){case"function":{const u=s[o];typeof u=="function"?u():c(null);break}case"object":{c.current=null;break}}}}}}}function Ln(e){const t=er(uj,e).current;return t.next=e,_e(t.effect),t}function uj(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Mv={...BR},Q0=Mv.useInsertionEffect,dj=Q0&&Q0!==Mv.useLayoutEffect?Q0:e=>e();function Be(e){const t=er(fj).current;return t.next=e,dj(t.effect),t.trampoline}function fj(){const e={next:void 0,callback:hj,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function hj(){}const Gf=null;class pj{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const i=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let o=0;o<i.length;o+=1)i[o]?.(t)};request(t){const i=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),i}cancel(t){const i=t-this.startId;i<0||i>=this.callbacks.length||this.callbacks[i]!==null&&(this.callbacks[i]=null,this.callbacksCount-=1)}}let $f=new pj;class Or{static create(){return new Or}static request(t){return $f.request(t)}static cancel(t){return $f.cancel(t)}currentId=Gf;request(t){this.cancel(),this.currentId=$f.request(()=>{this.currentId=Gf,t()})}cancel=()=>{this.currentId!==Gf&&($f.cancel(this.currentId),this.currentId=Gf)};disposeEffect=()=>this.cancel}function tc(){const e=er(Or.create).current;return xv(e.disposeEffect),e}function $t(e){return e?.ownerDocument||document}const tC={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},nd={...tC,position:"fixed",margin:0,top:0,left:0},Cp={...tC,position:"absolute"},Fa=b.forwardRef(function(t,i){const[s,o]=b.useState();_e(()=>{M4&&Ss&&o("button")},[]);const c={tabIndex:0,role:s};return v.jsx("span",{...t,ref:i,style:nd,"aria-hidden":s?void 0:!0,...c,"data-base-ui-focus-guard":""})}),nc=Math.min,Qs=Math.max,Hh=Math.round,Qf=Math.floor,Xs=e=>({x:e,y:e}),gj={left:"right",right:"left",bottom:"top",top:"bottom"};function nC(e,t,i){return Qs(e,nc(t,i))}function Ba(e,t){return typeof e=="function"?e(t):e}function gi(e){return e.split("-")[0]}function vs(e){return e.split("-")[1]}function Nv(e){return e==="x"?"y":"x"}function Dv(e){return e==="y"?"height":"width"}function ji(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function jv(e){return Nv(ji(e))}function mj(e,t,i){i===void 0&&(i=!1);const s=vs(e),o=jv(e),c=Dv(o);let u=o==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=Fh(u)),[u,Fh(u)]}function yj(e){const t=Fh(e);return[Iy(e),t,Iy(t)]}function Iy(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const gw=["left","right"],mw=["right","left"],vj=["top","bottom"],bj=["bottom","top"];function xj(e,t,i){switch(e){case"top":case"bottom":return i?t?mw:gw:t?gw:mw;case"left":case"right":return t?vj:bj;default:return[]}}function Sj(e,t,i,s){const o=vs(e);let c=xj(gi(e),i==="start",s);return o&&(c=c.map(u=>u+"-"+o),t&&(c=c.concat(c.map(Iy)))),c}function Fh(e){const t=gi(e);return gj[t]+e.slice(t.length)}function wj(e){var t,i,s,o;return{top:(t=e.top)!=null?t:0,right:(i=e.right)!=null?i:0,bottom:(s=e.bottom)!=null?s:0,left:(o=e.left)!=null?o:0}}function rC(e){return typeof e!="number"?wj(e):{top:e,right:e,bottom:e,left:e}}function _u(e){const{x:t,y:i,width:s,height:o}=e;return{width:s,height:o,top:i,left:t,right:t+s,bottom:i+o,x:t,y:i}}function Bl(e,t){return t<0||t>=e.length}function Sh(e,t){return Vl(e.current,{disabledIndices:t})}function Py(e,t){return Vl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ej(e,t,i){const{decrement:s,loopFocus:o,allowEscape:c,disabledIndices:u,minIndex:d,maxIndex:f}=i,g=()=>Vl(e,{startingIndex:t,decrement:s,disabledIndices:u});let m,h=!1;if(!o)m=s?Math.max(d,g()):Math.min(f,g());else if(s?t<=d:t>=f){const x=s?-1:e.length;c&&t!==x?m=-1:(m=s?f:d,h=!0)}else m=g();return{index:Bl(e,m)?-1:m,wrapped:h}}function Vl(e,{startingIndex:t=-1,decrement:i=!1,disabledIndices:s,amount:o=1}={}){let c=t;do c+=i?-o:o;while(c>=0&&c<=e.length-1&&Kl(e,c,s));return c}function Kl(e,t,i){if(typeof i=="function"?i(t):i?.includes(t)??!1)return!0;const o=e[t];return o?!Tp(o)||o.matches(":disabled")?!0:!i&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function Rj(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Tp(e,t=e?mi(e):null){return!e||!e.isConnected||!t||Rj(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Cj='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Tj(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const i=e.getRootNode();return Do(i)?i.host:null}function Ly(e){for(const t of Array.from(e.children))if(Rr(t)==="summary")return t;return null}function kj(e,t){const i=Ly(t);return!!i&&(e===i||it(i,e))}function iC(e){const t=e?Rr(e):"";return e!=null&&e.matches(Cj)&&(t!=="summary"||e.parentElement!=null&&Rr(e.parentElement)==="details"&&Ly(e.parentElement)===e)&&(t!=="details"||Ly(e)==null)&&(t!=="input"||e.type!=="hidden")}function Iv(e){if(!iC(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Tj(t)){const i=t!==e,s=Rr(t)==="slot";if(t.hasAttribute("inert")||i&&Rr(t)==="details"&&!t.open&&!kj(e,t)||t.hasAttribute("hidden")||!s&&!Oj(t,i))return!1}return!0}function Oj(e,t){const i=mi(e);return t?i.display!=="none":Tp(e,i)}function sC(e){const t=e.tabIndex;if(t<0){const i=Rr(e);if(i==="details"||i==="audio"||i==="video"||bn(e)&&e.isContentEditable)return 0}return t}function X0(e){if(Rr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function aC(e,t){const i=X0(e);if(!i)return!0;const s=t.find(o=>{const c=X0(o);return c?.name===i.name&&c.form===i.form&&c.checked});return s?s===i:t.find(o=>{const c=X0(o);return c?.name===i.name&&c.form===i.form})===i}function oC(e){if(bn(e)&&Rr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return bn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Pv(e,t){oC(e).forEach(i=>{iC(i)&&t.push(i),Pv(i,t)})}function lC(e,t,i){oC(e).forEach(s=>{bn(s)&&s.matches(t)&&i.push(s),lC(s,t,i)})}function kp(e){return Iv(e)&&sC(e)>=0}function cC(e){const t=[];return Pv(e,t),t.filter(Iv)}function Op(e){const t=cC(e);return t.filter(i=>sC(i)>=0&&aC(i,t))}function uC(e,t){const i=Op(e),s=i.length;if(s===0)return;const o=Zr($t(e)),c=i.indexOf(o),u=c===-1?t===1?0:s-1:c+t;return i[u]}function dC(e){return uC($t(e).body,1)||e}function fC(e){return uC($t(e).body,-1)||e}function Aj(e,t,i){if(!e)return null;const s=[];Pv($t(e).body,s);const o=s.indexOf(e);if(o===-1)return null;const c=s.filter(Iv);for(let u=1;u<s.length;u+=1){const d=s[(o+t*u+s.length)%s.length];if(!it(i,d)&&kp(d)&&aC(d,c))return d}return s[o]}function ql(e,t){const i=t||e.currentTarget,s=e.relatedTarget;return!s||!it(i,s)}function Mj(e){Op(e).forEach(i=>{i.dataset.tabindex=i.getAttribute("tabindex")||"",i.setAttribute("tabindex","-1")})}function yw(e){const t=[];lC(e,"[data-tabindex]",t),t.forEach(i=>{const s=i.dataset.tabindex;delete i.dataset.tabindex,s?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")})}function Va(e,t,i=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!i||o.context?.open?[o]:[],...Va(e,o.id,i)])}function vw(e,t){let i=[],s=e.find(o=>o.id===t)?.parentId;for(;s;){const o=e.find(c=>c.id===s);s=o?.parentId,o&&(i=i.concat(o))}return i}function Yl(e){return`data-base-ui-${e}`}let Xf=0;function wh(e,t={}){const{preventScroll:i=!1,sync:s=!1,shouldFocus:o}=t;cancelAnimationFrame(Xf);function c(){o&&!o()||e?.focus({preventScroll:i})}if(s)return c(),En;const u=requestAnimationFrame(c);return Xf=u,()=>{Xf===u&&(cancelAnimationFrame(u),Xf=0)}}const bw="data-base-ui-inert";let hu=new WeakMap,Zf=new WeakSet,pu=new WeakMap,Z0=0;function hC(e){return e?Do(e)?e.host:hC(e.parentNode):null}const xw=(e,t)=>t.map(i=>{if(e.contains(i))return i;const s=hC(i);return e.contains(s)?s:null}).filter(i=>i!=null),Sw=e=>{const t=new Set;return e.forEach(i=>{let s=i;for(;s&&!t.has(s);)t.add(s),s=s.parentNode}),t},ww=(e,t,i)=>{const s=[],o=c=>{!c||i.has(c)||Array.from(c.children).forEach(u=>{Rr(u)!=="script"&&(t.has(u)?o(u):s.push(u))})};return o(e),s};function Nj(e,t,i,{mark:s=!0}){const o=xw(t,e),c=s?ww(t,Sw(o),new Set(o)):[],u=[],d=[];if(i){const f=xw(t,Array.from(t.querySelectorAll("[aria-live]"))),g=o.concat(f);ww(t,Sw(g),new Set(g)).forEach(h=>{const x=h.getAttribute("aria-hidden"),S=x!==null&&x!=="false",w=(hu.get(h)||0)+1;hu.set(h,w),u.push(h),w===1&&S&&Zf.add(h),S||h.setAttribute("aria-hidden","true")})}return s&&c.forEach(f=>{const g=(pu.get(f)||0)+1;pu.set(f,g),d.push(f),g===1&&f.setAttribute(bw,"")}),Z0+=1,()=>{u.forEach(f=>{const g=(hu.get(f)||0)-1;hu.set(f,g),g||(Zf.has(f)||f.removeAttribute("aria-hidden"),Zf.delete(f))}),s&&d.forEach(f=>{const g=(pu.get(f)||0)-1;pu.set(f,g),g||f.removeAttribute(bw)}),Z0-=1,Z0||(hu=new WeakMap,Zf=new WeakSet,pu=new WeakMap)}}function Ew(e,t={}){const{ariaHidden:i=!1,mark:s=!0}=t,o=$t(e[0]).body;return Nj(e,o,i,{mark:s})}var fr=VR();const Dj=FR(fr);function pC(){const[,e]=b.useState({});return b.useCallback(()=>{e({})},[])}let Rw=0;function jj(e,t="mui"){const i=b.useRef(void 0),s=pC(),o=e??i.current;return b.useEffect(()=>{i.current==null&&(Rw+=1,i.current=`${t}-${Rw}`,e==null&&s())},[e,t,s]),o}const Cw=Mv.useId;function ac(e,t){if(Cw!==void 0){const i=Cw();return e??(t?`${t}-${i}`:i)}return jj(e,t)}const Ij=parseInt(b.version,10);function Lv(e){return Ij>=e}function Tw(e){if(!b.isValidElement(e))return null;const t=e,i=t.props;return(Lv(19)?i?.ref:t.ref)??null}function zy(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Pj(e,t){const i={};for(const s in e){const o=e[s];if(t?.hasOwnProperty(s)){const c=t[s](o);c!=null&&Object.assign(i,c);continue}o===!0?i[`data-${s.toLowerCase()}`]="":o&&(i[`data-${s.toLowerCase()}`]=o.toString())}return i}function Lj(e,t){return typeof e=="function"?e(t):e}function gC(e,t){return typeof e=="function"?e(t):e}const mC={};function Ar(e,t,i,s,o){if(!i&&!s&&!o&&!e)return Bh(t);let c=Bh(e);return t&&(c=bu(c,t)),i&&(c=bu(c,i)),s&&(c=bu(c,s)),o&&(c=bu(c,o)),c}function zj(e){if(e.length===0)return mC;if(e.length===1)return Bh(e[0]);let t=Bh(e[0]);for(let i=1;i<e.length;i+=1)t=bu(t,e[i]);return t}function Bh(e){return vC(e)?{...e(mC)}:_j(e)}function bu(e,t){return vC(t)?t(e):Uj(e,t)}function _j(e){const t={...e};for(const i in t){const s=t[i];yC(i,s)&&(t[i]=bC(s))}return t}function Uj(e,t){if(!t)return e;for(const i in t){const s=t[i];switch(i){case"style":{e[i]=zy(e.style,s);break}case"className":{e[i]=xC(e.className,s);break}default:yC(i,s)?e[i]=Hj(e[i],s):e[i]=s}}return e}function yC(e,t){const i=e.charCodeAt(0),s=e.charCodeAt(1),o=e.charCodeAt(2);return i===111&&s===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function vC(e){return typeof e=="function"}function Hj(e,t){return t?e?(...i)=>{const s=i[0];if(SC(s)){const c=s;Vh(c);const u=t(...i);return c.baseUIHandlerPrevented||e?.(...i),u}const o=t(...i);return e?.(...i),o}:bC(t):e}function bC(e){return e&&((...t)=>{const i=t[0];return SC(i)&&Vh(i),e(...t)})}function Vh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function xC(e,t){return t?e?t+" "+e:t:e}function SC(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function kt(e,t,i={}){let s=t.render;i.enabled!==!1&&(s=zv(s));const o=Fj(t,i,s);if(i.enabled===!1)return null;const c=i.state??Xt;return Kj(e,s,o,c)}function Fj(e,t,i){const{className:s,style:o}=e,{state:c=Xt,ref:u,props:d,stateAttributesMapping:f,enabled:g=!0}=t,m=g?Lj(s,c):void 0,h=g?gC(o,c):void 0,x=g?Pj(c,f):Xt,S=g&&d?Bj(d):void 0,w=g?zy(x,S)??{}:Xt;return typeof document<"u"&&(g?Array.isArray(u)?w.ref=oj([w.ref,Tw(i),...u]):w.ref=Wr(w.ref,Tw(i),u):Wr(null,null)),g?(m!==void 0&&(w.className=xC(w.className,m)),h!==void 0&&(w.style=zy(w.style,h)),w):Xt}function Bj(e){return Array.isArray(e)?zj(e):Ar(void 0,e)}const Vj=Symbol.for("react.lazy");function zv(e){if(e?.$$typeof!==Vj)return e;const t=b.Children.toArray(e)[0];return b.isValidElement(t)?t:e}function Kj(e,t,i,s){if(t){if(typeof t=="function")return t(i,s);const o=Ar(i,t.props);return o.ref=i.ref,b.cloneElement(t,o)}return qj(e,i)}function qj(e,t){return e==="button"?b.createElement("button",{type:"button",...t,key:t.key}):e==="img"?b.createElement("img",{alt:"",...t,key:t.key}):b.createElement(e,t)}const Yj=500,wC=500,Gj={style:{transition:"none"}},_v="data-base-ui-click-trigger",EC={fallbackAxisSide:"none"},Uv={fallbackAxisSide:"end"},$j={clipPath:"inset(50%)",position:"fixed",top:0,left:0},RC=b.createContext(null),CC=()=>b.useContext(RC),Qj=Yl("portal");function TC(e={}){const{ref:t,container:i,componentProps:s=Xt,elementProps:o}=e,c=ac(),d=CC()?.portalNode,[f,g]=b.useState(null),[m,h]=b.useState(null),x=Be(E=>{E!==null&&h(E)}),S=b.useRef(null);_e(()=>{if(i===null){S.current&&(S.current=null,h(null),g(null));return}const E=(i&&(Rv(i)?i:i.current))??d??document.body;if(E==null){S.current&&(S.current=null,h(null),g(null));return}S.current!==E&&(S.current=E,h(null),g(E))},[i,d]);const w=kt("div",s,{ref:[t,x],props:[{id:c,[Qj]:""},o]}),C=f&&w?fr.createPortal(w,f):null;return{node:m,nodeId:b.isValidElement(w)?w.props.id:void 0,subtree:C}}const Ap=b.forwardRef(function(t,i){const{render:s,className:o,style:c,children:u,container:d,portalOwnerRole:f,...g}=t,{node:m,nodeId:h,subtree:x}=TC({container:d,ref:i,componentProps:t,elementProps:g}),S=b.useRef(null),w=b.useRef(null),C=b.useRef(null),E=b.useRef(null),[R,k]=b.useState(null),O=b.useRef(!1),A=R?.modal,N=R?.open,j=!!R&&!R.modal&&R.open&&!!m;b.useEffect(()=>{if(!m||A)return;function M(_){m&&_.relatedTarget&&ql(_)&&(_.type==="focusin"?O.current&&(yw(m),O.current=!1):(Mj(m),O.current=!0))}return ys(Lt(m,"focusin",M,!0),Lt(m,"focusout",M,!0))},[m,A]),_e(()=>{!m||N!==!0||!O.current||(yw(m),O.current=!1)},[N,m]);const D=b.useMemo(()=>({beforeOutsideRef:S,afterOutsideRef:w,beforeInsideRef:C,afterInsideRef:E,portalNode:m,setFocusManagerState:k}),[m]);return v.jsxs(b.Fragment,{children:[x,v.jsxs(RC.Provider,{value:D,children:[j&&m&&v.jsx(Fa,{"data-type":"outside",ref:S,onFocus:M=>{if(ql(M,m))C.current?.focus();else{const _=R?R.domReference:null;fC(_)?.focus()}}}),j&&m&&v.jsx("span",{role:f,"aria-owns":h,style:$j}),m&&fr.createPortal(u,m),j&&m&&v.jsx(Fa,{"data-type":"outside",ref:w,onFocus:M=>{if(ql(M,m))E.current?.focus();else{const _=R?R.domReference:null;dC(_)?.focus(),R?.closeOnFocusOut&&R?.onOpenChange(!1,ut(Ha,M.nativeEvent))}}})]})]})});function kC(){const e=new Map;return{emit(t,i){e.get(t)?.forEach(s=>s(i))},on(t,i){e.has(t)||e.set(t,new Set),e.get(t).add(i)},off(t,i){e.get(t)?.delete(i)}}}class Hv{nodesRef={current:[]};events=kC();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const i=this.nodesRef.current.findIndex(s=>s===t);i!==-1&&this.nodesRef.current.splice(i,1)}}const OC=b.createContext(null),AC=b.createContext(null),Ya=()=>b.useContext(OC)?.id||null,Ga=e=>{const t=b.useContext(AC);return e??t};function Fv(e){const t=ac(),i=Ga(e),s=Ya();return _e(()=>{if(!t)return;const o={id:t,parentId:s};return i?.addNode(o),()=>{i?.removeNode(o)}},[i,t,s]),t}function MC(e){const{children:t,id:i}=e,s=Ya();return v.jsx(OC.Provider,{value:b.useMemo(()=>({id:i,parentId:s}),[i,s]),children:t})}function NC(e){const{children:t,externalTree:i}=e,s=er(()=>i??new Hv).current;return v.jsx(AC.Provider,{value:s,children:t})}function Ks(e){return e==null?e:"current"in e?e.current:e}function Xj(e,t){const i=Rn(tr(e));return e instanceof i.KeyboardEvent?"keyboard":e instanceof i.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||(ec(e)?"keyboard":t||"mouse"):"touches"in e?"touch":e instanceof i.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const kw=20;let La=[];function Bv(){La=La.filter(e=>e.deref()?.isConnected)}function Ow(e){Bv(),e&&Rr(e)!=="body"&&(La.push(new WeakRef(e)),La.length>kw&&(La=La.slice(-kw)))}function Aw(){return Bv(),La[La.length-1]?.deref()}function Zj(e){return e?kp(e)?e:Op(e)[0]||e:null}function Mw(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const i=cC(e).filter(o=>{const c=o.getAttribute("data-tabindex")||"";return kp(o)||o.hasAttribute("data-tabindex")&&!c.startsWith("-")}),s=e.getAttribute("tabindex");i.length===0?s!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Mp(e){const{context:t,children:i,disabled:s=!1,initialFocus:o=!0,returnFocus:c=!0,explicitReturnFocus:u,restoreFocus:d=!1,modal:f=!0,closeOnFocusOut:g=!0,openInteractionType:m="",nextFocusableElement:h,previousFocusableElement:x,beforeContentFocusGuardRef:S,externalTree:w,getInsideElements:C}=e,E=t.useState("open"),R=t.useState("domReferenceElement"),k=t.useState("floatingElement"),{events:O,dataRef:A}=t.context,N=Be(()=>A.current.floatingContext?.nodeId),j=o===!1,D=jy(R)&&j,M=Ln(o),_=Ln(c),L=Ln(u),q=Ln(m),X=Ln(E),B=Ga(w),H=CC(),U=b.useRef(!1),z=b.useRef(!1),Q=b.useRef(!1),$=b.useRef(null),K=b.useRef(""),Y=b.useRef(""),ee=b.useRef(null),G=b.useRef(null),oe=Wr(ee,S,H?.beforeInsideRef),I=Wr(G,H?.afterInsideRef),V=Un(),W=Un(),re=tc(),Ee=H!=null,le=_h(k),me=Be((ve=le)=>ve?Op(ve):[]),ge=Be(()=>C?.().filter(ve=>ve!=null)??[]);b.useEffect(()=>{if(s||!f)return;function ve(Oe){Oe.key==="Tab"&&it(le,Zr($t(le)))&&me().length===0&&!D&&Yi(Oe)}const Pe=$t(le);return Lt(Pe,"keydown",ve)},[s,le,f,D,me]),b.useEffect(()=>{if(s||!E)return;const ve=$t(le);function Pe(){Q.current=!1}function Oe(Ve){const ke=tr(Ve),Ue=ge(),be=it(k,ke)||it(R,ke)||it(H?.portalNode,ke)||Ue.some(He=>He===ke||it(He,ke));Q.current=!be,Y.current=Ve.pointerType||"keyboard",Lu(ke,`[${_v}]`)&&(z.current=!0,W.start(0,()=>{z.current=!1}))}function Le(){Y.current="keyboard"}return ys(Lt(ve,"pointerdown",Oe,!0),Lt(ve,"pointerup",Pe,!0),Lt(ve,"pointercancel",Pe,!0),Lt(ve,"keydown",Le,!0),Pe)},[s,k,R,le,E,H,W,ge]),b.useEffect(()=>{if(s||!g)return;const ve=$t(le);function Pe(){z.current=!0,W.start(0,()=>{z.current=!1})}function Oe(Ue){const be=tr(Ue);kp(be)&&($.current=be)}function Le(Ue){const be=Ue.relatedTarget,He=Ue.currentTarget,Ze=tr(Ue);f&&be==null&&Ze!=null&&it(k,Ze)&&Ow(Ze),queueMicrotask(()=>{const ot=N(),de=t.context.triggerElements,we=ge(),Ge=be?.hasAttribute(Yl("focus-guard"))&&[ee.current,G.current,H?.beforeInsideRef.current,H?.afterInsideRef.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,Ks(x),Ks(h)].includes(be),Me=!(it(R,be)||it(k,be)||it(be,k)||it(H?.portalNode,be)||we.some(De=>De===be||it(De,be))||de.hasMatchingElement(De=>it(De,be))||Ge||B&&(Va(B.nodesRef.current,ot).find(De=>it(De.context?.elements.floating,be)||it(De.context?.elements.domReference,be))||vw(B.nodesRef.current,ot).find(De=>[De.context?.elements.floating,_h(De.context?.elements.floating)].includes(be)||De.context?.elements.domReference===be)));if(He===R&&le&&Mw(le),d&&He!==R&&!Tp(Ze)&&Zr(ve)===ve.body){if(bn(le)&&(le.focus(),d==="popup")){re.request(()=>{le.focus()});return}const De=me(),bt=$.current,dt=(bt&&De.includes(bt)?bt:null)||De[De.length-1]||le;bn(dt)&&dt.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(D||!f)&&be&&Me&&!z.current&&(D||be!==Aw())&&(U.current=!0,t.setOpen(!1,ut(Ha,Ue)))})}function Ve(){Q.current||(A.current.insideReactTree=!0,V.start(0,()=>{A.current.insideReactTree=!1}))}const ke=bn(R)?R:null;if(!(!k&&!ke))return ys(ke&&Lt(ke,"focusout",Le),ke&&Lt(ke,"pointerdown",Pe),k&&Lt(k,"focusin",Oe),k&&Lt(k,"focusout",Le),k&&H&&Lt(k,"focusout",Ve,!0))},[s,R,k,le,f,B,H,t,g,d,me,D,N,A,V,W,re,h,x,ge]),b.useEffect(()=>{if(s||!k||!E)return;const ve=Array.from(H?.portalNode?.querySelectorAll(`[${Yl("portal")}]`)||[]),Oe=(B?vw(B.nodesRef.current,N()):[]).find(He=>jy(He.context?.elements.domReference||null))?.context?.elements.domReference,Ve=[...[k,...ve,ee.current,G.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,...ge()],Oe,Ks(x),Ks(h),D?R:null].filter(He=>He!=null),ke=Ew(Ve,{ariaHidden:f||D,mark:!1}),Ue=[k,...ve].filter(He=>He!=null),be=Ew(Ue);return()=>{be(),ke()}},[E,s,R,k,f,H,D,B,N,h,x,ge]),_e(()=>{if(!E||s||!bn(le))return;K.current="",Y.current="";const ve=$t(le),Pe=Zr(ve);queueMicrotask(()=>{const Oe=M.current,Le=typeof Oe=="function"?Oe(q.current||""):Oe;if(Le===void 0||Le===!1||it(le,Pe))return;let ke=null;const Ue=()=>(ke==null&&(ke=me(le)),ke[0]||le);let be;Le===!0||Le===null?be=Ue():be=Ks(Le),be=be||Ue();const He=it(le,Zr(ve)),Ze=A.current.openEvent,ot=Ze?.type==="mousedown"&&ec(Ze);wh(be,{sync:ot,preventScroll:be===le,shouldFocus(){if(!X.current)return!1;if(He)return!0;const de=Zr(ve);return!(de!==be&&it(le,de))}})})},[s,E,le,me,M,q,X,A]);const ue=b.useRef(null);_e(()=>{if(s||!le){ue.current=null;return}ue.current&&(ue.current.cancelled=!0,ue.current=null);const ve=$t(le),Pe=Zr(ve),Oe=q.current==null;Ow(Pe);function Le(ke){if(ke.open||(K.current=Xj(ke.nativeEvent,Y.current)),(ke.reason===Ha&&ke.triggerElement?.hasAttribute(Yl("focus-guard"))||ke.reason===Kn&&ke.nativeEvent.type==="mouseleave")&&(U.current=!0),ke.reason===Rp)if(ke.nested)U.current=!1;else if(ec(ke.nativeEvent)||Ev(ke.nativeEvent))U.current=!1;else{let Ue=!1;$t(le).createElement("div").focus({get preventScroll(){return Ue=!0,!1}}),Ue?U.current=!1:U.current=!0}}O.on("openchange",Le);function Ve(ke){const Ue=_.current;let be=typeof Ue=="function"?Ue(ke):Ue;if(be===void 0||be===!1)return null;be===null&&(be=!0);const He=R?.isConnected?R:null,Ze=Pe?.isConnected&&Rr(Pe)!=="body"?Pe:null;let ot=Oe?Ze||He:He||Ze;return ot||(ot=Aw()||null),typeof be=="boolean"?ot:Ks(be)||ot||null}return()=>{O.off("openchange",Le);const ke=Zr(ve),Ue=ge(),be=it(k,ke)||Ue.some(we=>we===ke||it(we,ke))||B&&Va(B.nodesRef.current,N(),!1).some(we=>it(we.context?.elements.floating,ke)),He=_.current,Ze=K.current,ot=Ve(Ze),de={cancelled:!1};ue.current=de,queueMicrotask(()=>{ue.current===de&&(ue.current=null);const we=Zj(ot),Ge=L.current??typeof He!="boolean";if(!de.cancelled&&He&&!U.current&&bn(we)&&(!(!Ge&&we!==ke&&ke!==ve.body)||be)){const Me={preventScroll:!0};Ze==="keyboard"&&(Me.focusVisible=!0),we.focus(Me)}U.current=!1})}},[s,k,le,_,L,q,O,B,R,N,ge]),_e(()=>{if(!Ss||E||!k)return;const ve=Zr($t(k));!bn(ve)||!Wu(ve)||it(k,ve)&&ve.blur()},[E,k]),_e(()=>{if(!(s||!H))return H.setFocusManagerState({modal:f,closeOnFocusOut:g,open:E,onOpenChange:t.setOpen,domReference:R}),()=>{H.setFocusManagerState(null)}},[s,H,f,E,t,g,R]),_e(()=>{if(!(s||!le))return Mw(le),()=>{queueMicrotask(Bv)}},[s,le]);const Te=!s&&(f?!D:!0)&&(Ee||f);return v.jsxs(b.Fragment,{children:[Te&&v.jsx(Fa,{"data-type":"inside",ref:oe,onFocus:ve=>{if(f){const Pe=me();wh(Pe[Pe.length-1])}else H?.portalNode&&(U.current=!1,ql(ve,H.portalNode)?dC(R)?.focus():Ks(x??H.beforeOutsideRef)?.focus())}}),i,Te&&v.jsx(Fa,{"data-type":"inside",ref:I,onFocus:ve=>{f?wh(me()[0]):H?.portalNode&&(g&&(U.current=!0),ql(ve,H.portalNode)?fC(R)?.focus():Ks(h??H.afterOutsideRef)?.focus())}})]})}function Np(e,t={}){const{enabled:i=!0,event:s="click",toggle:o=!0,ignoreMouse:c=!1,stickIfOpen:u=!0,touchOpenDelay:d=0,reason:f=Qi}=t,g=e.context.dataRef,m=b.useRef(void 0),h=tc(),x=Un(),S=b.useMemo(()=>{function w(E,R,k,O){const A=ut(f,R,k);E&&O==="touch"&&d>0?x.start(d,()=>{e.setOpen(!0,A)}):e.setOpen(E,A)}function C(E,R,k){const O=g.current.openEvent,A=e.select("domReferenceElement")!==R;return E&&A||!E||!o?!0:O&&(typeof u=="function"?u():u)?!k(O.type):!1}return{onPointerDown(E){m.current=_a(E.pointerType,!0)&&Ev(E.nativeEvent)?"virtual":E.pointerType},onMouseDown(E){const R=m.current,k=E.nativeEvent,O=e.select("open");if(E.button!==0||s==="click"||_a(R,!0)&&c)return;const A=C(O,E.currentTarget,M=>M==="click"||M==="mousedown"),N=tr(k),j=Wu(N);if(j||R==="virtual"){w(A,k,j?N:E.currentTarget,R);return}const D=E.currentTarget;h.request(()=>{w(A,k,D,R)})},onClick(E){if(s==="mousedown-only")return;const R=m.current;if(s==="mousedown"&&R){m.current=void 0;return}if(_a(R,!0)&&c)return;const k=e.select("open"),O=C(k,E.currentTarget,A=>A==="click"||A==="mousedown"||A==="keydown"||A==="keyup");w(O,E.nativeEvent,E.currentTarget,R)},onKeyDown(){m.current=void 0}}},[g,s,c,f,e,u,o,h,x,d]);return b.useMemo(()=>i?{reference:S}:Xt,[i,S])}function Jj(e,t){let i=null,s=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){const c=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},u=t.axis==="x"||t.axis==="both",d=t.axis==="y"||t.axis==="both",f=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch",g=t.axis==="y"?c.width:0,m=t.axis==="x"?c.height:0;let h=c.x,x=c.y;return i==null&&t.x&&u&&(i=c.x-t.x),s==null&&t.y&&d&&(s=c.y-t.y),h-=i||0,x-=s||0,(!o||f)&&(h=u&&t.x!=null?t.x:h,x=d&&t.y!=null?t.y:x),o=!0,{width:g,height:m,x:h,y:x,top:x,right:h+g,bottom:x+m,left:h}}}}function Nw(e){return e!=null&&e.clientX!=null}function Wj(e,t={}){const{enabled:i=!0,axis:s="both"}=t,o=e.useState("open"),c=e.useState("floatingElement"),u=e.useState("domReferenceElement"),d=e.context.dataRef,f=b.useRef(!1),g=b.useRef(null),[m,h]=b.useState(),[x,S]=b.useState([]),w=Be(O=>{e.set("positionReference",O)}),C=Be((O,A,N)=>{f.current||d.current.openEvent&&!Nw(d.current.openEvent)||e.set("positionReference",Jj(N??u,{x:O,y:A,axis:s,dataRef:d,pointerType:m}))}),E=Be(O=>{o?g.current||(C(O.clientX,O.clientY,O.currentTarget),S([])):C(O.clientX,O.clientY,O.currentTarget)}),R=_a(m)?c:o;b.useEffect(()=>{if(!i){w(u);return}if(!R)return;function O(){g.current?.(),g.current=null}const A=Rn(c);function N(j){const D=tr(j);it(c,D)?O():C(j.clientX,j.clientY)}return!d.current.openEvent||Nw(d.current.openEvent)?g.current=Lt(A,"mousemove",N):w(u),O},[R,i,c,d,u,e,C,w,x]),b.useEffect(()=>()=>{e.set("positionReference",null)},[e]),b.useEffect(()=>{i&&!c&&(f.current=!1)},[i,c]),b.useEffect(()=>{!i&&o&&(f.current=!0)},[i,o]);const k=b.useMemo(()=>{function O(A){h(A.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:E,onMouseEnter:E}},[E]);return b.useMemo(()=>i?{reference:k,trigger:k}:{},[i,k])}function eI(){return!1}function tI(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function rd(e,t={}){const{enabled:i=!0,escapeKey:s=!0,outsidePress:o=!0,outsidePressEvent:c="sloppy",referencePress:u=eI,bubbles:d,externalTree:f}=t,g=e.useState("open"),m=e.useState("floatingElement"),{dataRef:h,events:x}=e.context,S=Ga(f),w=Be(typeof o=="function"?o:()=>!1),C=typeof o=="function"?w:o,E=C!==!1,R=Be(()=>c),{escapeKey:k,outsidePress:O}=tI(d),A=b.useRef(!1),N=b.useRef(!1),j=b.useRef(!1),D=b.useRef(!1),M=b.useRef(!1),_=b.useRef(""),L=b.useRef(null),q=Un(),X=Un(),B=Un(),H=Be(()=>{X.clear(),h.current.insideReactTree=!1}),U=Be(I=>{const V=h.current.floatingContext?.nodeId;return(S?Va(S.nodesRef.current,V):[]).some(re=>re.context?.open&&!re.context.dataRef.current[I])}),z=Be(I=>$0(I,e.select("floatingElement"))||$0(I,e.select("domReferenceElement"))),Q=Be(I=>{u()&&e.setOpen(!1,ut(Qi,I.nativeEvent))}),$=Be(I=>{if(!g||!i||!s||I.key!=="Escape")return;const V=N4(I)?I.nativeEvent:I;if(M.current||V.isComposing||!k&&U("__escapeKeyBubbles"))return;const W=ut(ed,V);e.setOpen(!1,W),W.isCanceled||I.preventDefault(),!k&&!W.isPropagationAllowed&&I.stopPropagation()}),K=Be(()=>{h.current.insideReactTree=!0,X.start(0,H)}),Y=Be(I=>{if(!g||!i||I.button!==0)return;const V=tr(I.nativeEvent);it(e.select("floatingElement"),V)&&(A.current||(A.current=!0,N.current=!1))}),ee=Be(I=>{!g||!i||(I.defaultPrevented||I.nativeEvent.defaultPrevented)&&A.current&&(N.current=!0)});b.useEffect(()=>{function I(V){V.open||(D.current=!1)}return x.on("openchange",I),()=>{x.off("openchange",I)}},[x]),b.useEffect(()=>H,[H]),b.useEffect(()=>{if(!g||!i)return g||(D.current=!1,M.current=!1,_.current="",L.current=null),H;h.current.__escapeKeyBubbles=k,h.current.__outsidePressBubbles=O;const I=new Pi,V=$t(m);function W(){B.clear(),M.current=!0}function re(){M.current=!0,B.start(Ss?5:0,()=>{M.current=!1})}function Ee(){j.current=!0,I.start(0,()=>{j.current=!1})}function le(){A.current=!1,N.current=!1}function me(){const de=_.current,we=de==="pen"||!de?"mouse":de,Ge=R(),Me=typeof Ge=="function"?Ge():Ge;return typeof Me=="string"?Me:Me[we]}function ge(de){const we=me();return we==="intentional"&&de.type!=="click"||we==="sloppy"&&de.type==="click"}function ue(de){const we=h.current.floatingContext?.nodeId,Ge=S&&Va(S.nodesRef.current,we).some(Me=>$0(de,Me.context?.elements.floating));return z(de)||Ge}function Te(de){if(ge(de)){de.type!=="click"&&!z(de)&&(I.clear(),j.current=!1),H();return}if(h.current.insideReactTree){H();return}const we=tr(de),Ge=`[${Yl("inert")}]`,Me=ln(we)?we.getRootNode():null,De=Array.from((Do(Me)?Me:$t(e.select("floatingElement"))).querySelectorAll(Ge)),bt=e.context.triggerElements;if(we&&(bt.hasElement(we)||bt.hasMatchingElement(pt=>it(pt,we))))return;let dt=ln(we)?we:null;for(;dt&&!$s(dt);){const pt=Zs(dt);if($s(pt)||!ln(pt))break;dt=pt}if(!(De.length&&ln(we)&&!Q4(we)&&!it(we,e.select("floatingElement"))&&De.every(pt=>!it(dt,pt)))){if(bn(we)&&!("touches"in de)){const pt=$s(we),Nt=mi(we),jt=/auto|scroll/,tn=pt||jt.test(Nt.overflowX),an=pt||jt.test(Nt.overflowY),nn=tn&&we.clientWidth>0&&we.scrollWidth>we.clientWidth,We=an&&we.clientHeight>0&&we.scrollHeight>we.clientHeight,wt=Nt.direction==="rtl",Zt=We&&(wt?de.offsetX<=we.offsetWidth-we.clientWidth:de.offsetX>we.clientWidth),ht=nn&&de.offsetY>we.clientHeight;if(Zt||ht)return}if(!ue(de)){if(me()==="intentional"){if(de.detail!==0&&!ec(de)&&!D.current)return;if(j.current){I.clear(),j.current=!1;return}}typeof C=="function"&&!C(de)||U("__outsidePressBubbles")||(e.setOpen(!1,ut(Rp,de)),H())}}}function ve(de){me()!=="sloppy"||de.pointerType==="touch"||!e.select("open")||!i||z(de)||Te(de)}function Pe(de){if(me()!=="sloppy"||!e.select("open")||!i||z(de))return;const we=de.touches[0];we&&(L.current={startTime:Date.now(),startX:we.clientX,startY:we.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},q.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}function Oe(de,we){const Ge=tr(de);if(!Ge)return;const Me=Lt(Ge,de.type,()=>{we(de),Me()})}function Le(de){_.current="touch",Oe(de,Pe)}function Ve(de){q.clear(),de.type==="pointerdown"&&(de.button===0&&(D.current=!0),_.current=de.pointerType),!(de.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)&&Oe(de,we=>{we.type==="pointerdown"?ve(we):Te(we)})}function ke(de){if(de.type==="pointercancel"&&(D.current=!1),!A.current)return;const we=N.current;if(le(),me()==="intentional"){if(de.type==="pointercancel"){we&&Ee();return}if(!ue(de)){if(we){Ee();return}typeof C=="function"&&!C(de)||(I.clear(),j.current=!0,H())}}}function Ue(de){if(me()!=="sloppy"||!L.current||z(de))return;const we=de.touches[0];if(!we)return;const Ge=Math.abs(we.clientX-L.current.startX),Me=Math.abs(we.clientY-L.current.startY),De=Math.sqrt(Ge*Ge+Me*Me);De>5&&(L.current.dismissOnTouchEnd=!0),De>10&&(Te(de),q.clear(),L.current=null)}function be(de){Oe(de,Ue)}function He(de){me()!=="sloppy"||!L.current||z(de)||(L.current.dismissOnTouchEnd&&Te(de),q.clear(),L.current=null)}function Ze(de){Oe(de,He)}const ot=ys(s&&ys(Lt(V,"keydown",$),Lt(V,"compositionstart",W),Lt(V,"compositionend",re)),E&&ys(Lt(V,"click",Ve,!0),Lt(V,"pointerdown",Ve,!0),Lt(V,"pointerup",ke,!0),Lt(V,"pointercancel",ke,!0),Lt(V,"mousedown",Ve,!0),Lt(V,"mouseup",ke,!0),Lt(V,"touchstart",Le,{capture:!0,passive:!0}),Lt(V,"touchmove",be,{capture:!0,passive:!0}),Lt(V,"touchend",Ze,{capture:!0,passive:!0})));return()=>{ot(),I.clear(),le(),j.current=!1}},[h,m,s,E,C,g,i,k,O,$,H,R,U,z,S,e,q,B]);const G=b.useMemo(()=>({onKeyDown:$,onPointerDown:Q,onClick:Q}),[$,Q]),oe=b.useMemo(()=>({onKeyDown:$,onPointerDown:ee,onMouseDown:ee,onClickCapture:K,onMouseDownCapture(I){K(),Y(I)},onPointerDownCapture(I){K(),Y(I)},onMouseUpCapture:K,onTouchEndCapture:K,onTouchMoveCapture:K}),[$,K,Y,ee]);return b.useMemo(()=>i?{reference:G,floating:oe,trigger:G}:{},[i,G,oe])}function DC(e){const{popupStore:t,treatPopupAsFloatingElement:i=!1,floatingRootContext:s,floatingId:o,nested:c,onOpenChange:u}=e,d=t.useState("open"),f=t.useState("activeTriggerElement"),g=t.useState(i?"popupElement":"positionerElement"),m=u;return t.useSyncedValue("floatingId",o),_e(()=>{const h={open:d,floatingId:o,referenceElement:f,floatingElement:g};ln(f)&&(h.domReferenceElement=f),s.state.positionReference===s.state.referenceElement&&(h.positionReference=f),s.update(h)},[d,o,f,g,s]),s.context.onOpenChange=m,s.context.nested=c,s}function _o(e,t=!1,i=!1,s=!1){const[o,c]=b.useState(e&&t?"idle":void 0),[u,d]=b.useState(e&&!s);return e&&!u&&(d(!0),c("starting")),!e&&u&&o!=="ending"&&!i&&c("ending"),!e&&!u&&o==="ending"&&c(void 0),_e(()=>{if(!e&&u&&o!=="ending"&&i){const f=Or.request(()=>{c("ending")});return()=>{Or.cancel(f)}}},[e,u,o,i]),_e(()=>{if(!e||t||o===void 0)return;const f=Or.request(()=>{c(void 0)});return()=>{Or.cancel(f)}},[t,e,o]),_e(()=>{if(!e||!t)return;e&&u&&o!=="idle"&&c("starting");const f=Or.request(()=>{c("idle")});return()=>{Or.cancel(f)}},[t,e,u,o]),{mounted:u,setMounted:d,transitionStatus:o}}function Dw(e,t){return e.getAnimations(t).filter(i=>{const s=i.effect?.getTiming();return s?.duration!==1/0&&s?.iterations!==1/0})}let Jf=null;function nI(e){if(!Jf){const t=[];Jf=t,queueMicrotask(()=>{Jf=null,fr.flushSync(()=>{for(const i of t)i()})})}Jf.push(e)}function Dp(e,t=!1,i=!1){const s=tc();return Be((o,c=null)=>{s.cancel();const u=Ks(e);if(u==null)return;const d=u,f=()=>{if(!i){fr.flushSync(o);return}nI(()=>{c?.aborted||o()})};if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){o();return}function g(){Promise.all(Dw(d).map(m=>m.finished.then(En))).then(()=>{c?.aborted||f()},()=>{if(c?.aborted)return;if(Dw(d).some(h=>h.pending||h.playState!=="finished")){g();return}f()})}if(t){const m=Ov;if(!d.hasAttribute(m)){s.request(g);return}const h=new MutationObserver(()=>{d.hasAttribute(m)||(h.disconnect(),g())});h.observe(d,{attributes:!0,attributeFilter:[m]}),c?.addEventListener("abort",()=>h.disconnect(),{once:!0});return}s.request(g)})}function Li(e){const{enabled:t=!0,open:i,ref:s,batch:o=!1,onComplete:c}=e,u=Be(c),d=Dp(s,i,o);b.useEffect(()=>{if(!t)return;const f=new AbortController;return d(u,f.signal),()=>{f.abort()}},[t,i,u,d])}function jC(e){const{open:t,ref:i,preventUnmountOnClose:s,setPreventUnmountOnClose:o,onUnmount:c,animateInitialOpen:u}=e,d=Be(o),{mounted:f,setMounted:g,transitionStatus:m}=_o(t,!1,!1,u),h=t?!1:s;_e(()=>{t&&d(!1)},[t,d]);const x=b.useRef(f),S=b.useRef(!1),w=pC(),C=()=>{x.current=!1,g(!1),c()};_e(()=>{x.current=f,S.current&&(S.current=!1,!t&&f&&C())});const E=Be(()=>{if(x.current){if(t){S.current=!0,w();return}C()}});return Li({enabled:f&&!t&&!h,open:t,ref:i,onComplete(){t||E()}}),{mounted:f,transitionStatus:m,preventUnmountingOnClose:h,forceUnmount:E}}const id={tabIndex:-1,[Ny]:""};function IC(e){return t=>t==="touch"?e.current:!0}function Vv(e,t=!1){const i=ac(),s=Ya()!=null,o=er(()=>e(i,s)).current;return DC({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:i,nested:s,onOpenChange:o.setOpen}),o}function jp({handle:e,store:t}){return _e(()=>e.attachStore(t),[e,t]),null}function jw(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function rI(e,t){const i=b.useRef(null);return Be(s=>{const o=i.current;if(o!==null){if(o.element===s&&o.store===t&&o.id===e)return;i.current=null;const c=o.store;c.context.triggerElements.getById(o.id)===o.element&&(c.context.triggerElements.delete(o.id),jw(c))}s!==null&&e!==void 0&&(i.current={store:t,id:e,element:s},t.context.triggerElements.add(e,s),jw(t))})}function Ip(e,t,i,s=!1){let o=e.preventUnmountingOnClose;t?o=!1:s&&(o=!0);const c=i?.id??null;let u=e.activeTriggerId,d=e.activeTriggerElement;return(c||t)&&(u=c,d=i??null),{open:t,preventUnmountingOnClose:o,activeTriggerId:u,activeTriggerElement:d,openedWithoutTrigger:t?i==null:e.openedWithoutTrigger}}function Pp(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function iI(e,t,i,s={}){const o=i.reason,c=o===Kn,u=t&&o===Fl,d=!t&&(o===Qi||o===ed),f=Pp(i);if(e.context.onOpenChange?.(t,i),i.isCanceled)return;s.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,i);const g=()=>{const m=Ip(e.state,t,i.trigger,f()),h={...s.extraState,...m};u?h.instantType="focus":d?h.instantType="dismiss":c&&(h.instantType=void 0),e.update(h)};c?fr.flushSync(g):g()}function Lp(e,t,i,s){const o=i.useState("isMountedByTrigger",e),c=rI(e,i),u=Be(f=>{const g=i.select("open"),m=i.select("activeTriggerId");if(m===e){const h={activeTriggerElement:f,...g?s:null};i.update(h);return}if(m==null&&g&&!i.state.openedWithoutTrigger){const h={activeTriggerId:e??null,activeTriggerElement:f,...s};i.update(h)}}),d=Be(f=>{c(f),f&&u(f)});return _e(()=>(d(t.current),()=>d(null)),[d,t,i,e]),_e(()=>{if(o){const f={activeTriggerElement:t.current,...s};i.update(f)}},[o,i,t,...Object.values(s)]),{registerTrigger:d,isMountedByThisTrigger:o}}function zp(e,t={}){const{closeOnActiveTriggerUnmount:i=!1}=t,s=b.useRef(null),o=e.useState("open"),c=e.useState("triggerCount"),u=e.useState("activeTriggerId"),d=e.useState("activeTriggerElement");_e(()=>{if(!o){s.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0),e.state.openedWithoutTrigger&&e.set("openedWithoutTrigger",!1);return}const f=e.context.triggerElements.size,g={};e.state.triggerCount!==f&&(g.triggerCount=f);const m=e.select("activeTriggerId");let h=null;if(m){const x=e.context.triggerElements.getById(m);if(x)s.current=m,x!==e.state.activeTriggerElement&&(g.activeTriggerElement=x);else{for(const[S,w]of e.context.triggerElements.entries())if(w===e.state.activeTriggerElement){g.activeTriggerId=S,g.activeTriggerElement=w,s.current=S;break}g.activeTriggerId===void 0&&(s.current===m?h=m:s.current=null)}}else s.current=null;if(!h&&!m&&!e.state.openedWithoutTrigger&&f===1){const x=e.context.triggerElements.entries().next();if(!x.done){const[S,w]=x.value;g.activeTriggerId=S,g.activeTriggerElement=w,s.current=S}}(g.triggerCount!==void 0||g.activeTriggerId!==void 0||g.activeTriggerElement!==void 0)&&e.update(g),h&&i&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===h&&!e.context.triggerElements.getById(h)){const x=ut(Mr);e.setOpen(!1,x),x.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,c,u,d,i])}function _p(e,t,i,s){const{mounted:o,transitionStatus:c,forceUnmount:u}=jC({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:d=>t.set("preventUnmountingOnClose",d),animateInitialOpen:s,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),i?.(),t.context.onOpenChangeComplete?.(!1)}});return er(()=>(t.set("mounted",o),null)),t.useSyncedValues({mounted:o,transitionStatus:c}),{forceUnmount:u,transitionStatus:c}}function Up(e,t){e.useSyncedValues(t),_e(()=>()=>{e.update({activeTriggerProps:Xt,inactiveTriggerProps:Xt,popupProps:Xt})},[e])}function PC(e,t){_e(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),_e(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class sd{idMap=new Map;add(t,i){this.idMap.set(t,i)}delete(t){this.idMap.delete(t)}hasElement(t){for(const i of this.idMap.values())if(i===t)return!0;return!1}hasMatchingElement(t){for(const i of this.idMap.values())if(t(i))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var J0={exports:{}},W0={};var Iw;function sI(){if(Iw)return W0;Iw=1;var e=$u();function t(h,x){return h===x&&(h!==0||1/h===1/x)||h!==h&&x!==x}var i=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function d(h,x){var S=x(),w=s({inst:{value:S,getSnapshot:x}}),C=w[0].inst,E=w[1];return c(function(){C.value=S,C.getSnapshot=x,f(C)&&E({inst:C})},[h,S,x]),o(function(){return f(C)&&E({inst:C}),h(function(){f(C)&&E({inst:C})})},[h]),u(S),S}function f(h){var x=h.getSnapshot;h=h.value;try{var S=x();return!i(h,S)}catch{return!0}}function g(h,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:d;return W0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,W0}var Pw;function LC(){return Pw||(Pw=1,J0.exports=sI()),J0.exports}var Hp=LC(),ey={exports:{}},ty={};var Lw;function aI(){if(Lw)return ty;Lw=1;var e=$u(),t=LC();function i(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var s=typeof Object.is=="function"?Object.is:i,o=t.useSyncExternalStore,c=e.useRef,u=e.useEffect,d=e.useMemo,f=e.useDebugValue;return ty.useSyncExternalStoreWithSelector=function(g,m,h,x,S){var w=c(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=d(function(){function R(j){if(!k){if(k=!0,O=j,j=x(j),S!==void 0&&C.hasValue){var D=C.value;if(S(D,j))return A=D}return A=j}if(D=A,s(O,j))return D;var M=x(j);return S!==void 0&&S(D,M)?(O=j,D):(O=j,A=M)}var k=!1,O,A,N=h===void 0?null:h;return[function(){return R(m())},N===null?void 0:function(){return R(N())}]},[m,h,x,S]);var E=o(g,w[0],w[1]);return u(function(){C.hasValue=!0,C.value=E},[E]),f(E),E},ty}var zw;function oI(){return zw||(zw=1,ey.exports=aI()),ey.exports}var lI=oI();const cI=Lv(19),uI=cI?fI:hI;function zC(e,t,i,s,o){return uI(e,t,i,s,o)}function dI(e,t,i,s,o){const c=b.useCallback(()=>t(e.getSnapshot(),i,s,o),[e,t,i,s,o]);return Hp.useSyncExternalStore(e.subscribe,c,c)}S4({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let i=0;i<e.syncHooks.length;i+=1){const s=e.syncHooks[i],o=s.selector(s.store.state,s.a1,s.a2,s.a3);Object.is(s.value,o)||(t=!0,s.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const i=new Set;for(const o of e.syncHooks)i.add(o.store);const s=[];for(const o of i)s.push(o.subscribe(t));return()=>{for(const o of s)o()}}),Hp.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function fI(e,t,i,s,o){const c=x4();if(!c)return dI(e,t,i,s,o);const u=c.syncIndex;c.syncIndex+=1;let d;return c.didInitialize?(d=c.syncHooks[u],(d.store!==e||d.selector!==t||!Object.is(d.a1,i)||!Object.is(d.a2,s)||!Object.is(d.a3,o))&&(d.store!==e&&(c.didChangeStore=!0),d.store=e,d.selector=t,d.a1=i,d.a2=s,d.a3=o,d.value=t(e.getSnapshot(),i,s,o))):(d={store:e,selector:t,a1:i,a2:s,a3:o,value:t(e.getSnapshot(),i,s,o)},c.syncHooks.push(d)),d.value}function hI(e,t,i,s,o){return lI.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,c=>t(c,i,s,o))}class pI{static create(t){return new this(t)}constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const i=this.updateTick;for(const s of this.listeners){if(i!==this.updateTick)return;s(t)}}update(t){for(const i in t)if(!Object.is(this.state[i],t[i])){this.setState({...this.state,...t});return}}set(t,i){Object.is(this.state[t],i)||this.setState({...this.state,[t]:i})}notifyAll(){const t={...this.state};this.setState(t)}use(t,i,s,o){return zC(this,t,i,s,o)}}class oc extends pI{constructor(t,i={},s){super(t),this.context=i,this.selectors=s}useSyncedValue(t,i){b.useDebugValue(t);const s=this;_e(()=>{s.state[t]!==i&&s.set(t,i)},[s,t,i])}useSyncedValueWithCleanup(t,i){const s=this;_e(()=>(s.state[t]!==i&&s.set(t,i),()=>{s.set(t,void 0)}),[s,t,i])}useSyncedValues(t){const i=this,s=Object.values(t);_e(()=>{i.update(t)},[i,...s])}useControlledProp(t,i){b.useDebugValue(t);const s=this,o=i!==void 0;_e(()=>{o&&!Object.is(s.state[t],i)&&s.setState({...s.state,[t]:i})},[s,t,i,o])}select(t,i,s,o){const c=this.selectors[t];return c(this.state,i,s,o)}useState(t,i,s,o){return b.useDebugValue(t),zC(this,this.selectors[t],i,s,o)}useContextCallback(t,i){b.useDebugValue(t);const s=Be(i??En);this.context[t]=s}useStateSetter(t){const i=b.useRef(void 0);return i.current===void 0&&(i.current=s=>{this.set(t,s)}),i.current}observe(t,i){let s;typeof t=="function"?s=t:s=this.selectors[t];let o=s(this.state);return i(o,o,this),this.subscribe(c=>{const u=s(c);if(!Object.is(o,u)){const d=o;o=u,i(u,d,this)}})}}const gI={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 _C extends oc{constructor(t){const{syncOnly:i,nested:s,onOpenChange:o,triggerElements:c,...u}=t;super({...u,positionReference:u.referenceElement,domReferenceElement:u.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:kC(),nested:s,triggerElements:c},gI),this.syncOnly=i}syncOpenEvent=(t,i)=>{(!t||!this.state.open||i!=null&&D4(i))&&(this.context.dataRef.current.openEvent=t?i:void 0)};dispatchOpenChange=(t,i)=>{this.syncOpenEvent(t,i.event);const s={open:t,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",s)};setOpen=(t,i)=>{if(this.syncOnly){this.context.onOpenChange?.(t,i);return}this.dispatchOpenChange(t,i),this.context.onOpenChange?.(t,i)}}function Fp(e,t,i=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new _C({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:i,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Xt,inactiveTriggerProps:Xt,popupProps:Xt}}const Tu=e=>e.triggerIdProp??e.activeTriggerId,Kh=e=>e.openProp??e.open,_w=e=>(e.popupElement?.id??e.floatingId)||void 0;function UC(e,t){return t!==void 0&&Kh(e)&&Tu(e)===t}function mI(e,t){return UC(e,t)?!0:t!==void 0&&Kh(e)&&Tu(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}const Ys={open:Kh,mounted:e=>e.mounted,transitionStatus:e=>Kh(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Tu,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:_w,isTriggerActive:(e,t)=>t!==void 0&&Tu(e)===t,isOpenedByTrigger:(e,t)=>UC(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Tu(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>mI(e,t)?_w(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Bp(e){const t=b.useCallback(s=>e===void 0?En:e.subscribeStore(s),[e]),i=b.useCallback(()=>e===void 0?void 0:e.store,[e]);return Hp.useSyncExternalStore(t,i,()=>e?.serverStore)}function yI(e){const{open:t=!1,onOpenChange:i,elements:s={}}=e,o=ac(),c=Ya()!=null,u=er(()=>new _C({open:t,transitionStatus:void 0,onOpenChange:i,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:new sd,floatingId:o,syncOnly:!1,nested:c})).current;return _e(()=>{const d={open:t,floatingId:o};s.reference!==void 0&&(d.referenceElement=s.reference,d.domReferenceElement=ln(s.reference)?s.reference:null),s.floating!==void 0&&(d.floatingElement=s.floating),u.update(d)},[t,o,s.reference,s.floating,u]),u.context.onOpenChange=i,u.context.nested=c,u}const ny=Sv&&Ss;function HC(e,t={}){const{enabled:i=!0,delay:s}=t,{events:o,dataRef:c}=e.context,u=b.useRef(!1),d=b.useRef(null),f=b.useRef(!0),g=Un();b.useEffect(()=>{const h=e.select("domReferenceElement");if(!i)return;const x=Rn(h);function S(){const E=e.select("domReferenceElement");!e.select("open")&&bn(E)&&E===Zr($t(E))&&(u.current=!0,d.current=E)}function w(){f.current=!0}function C(){f.current=!1}return ys(Lt(x,"blur",S),ny&&Lt(x,"keydown",w,!0),ny&&Lt(x,"pointerdown",C,!0))},[e,i]),b.useEffect(()=>{if(!i)return;function h(x){if(x.reason===Qi||x.reason===ed){const S=e.select("domReferenceElement");ln(S)&&(d.current=S,u.current=!0)}}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,i,e]);const m=b.useMemo(()=>{function h(){u.current=!1,d.current=null}return{onMouseLeave(){h()},onFocus(x){const S=x.currentTarget;if(u.current){if(d.current===S)return;h()}const w=tr(x.nativeEvent);if(ln(w)){if(ny&&!x.relatedTarget){if(!f.current&&!Wu(w))return}else if(!Z4(w))return}const C=zh(x.relatedTarget,e.context.triggerElements),{nativeEvent:E,currentTarget:R}=x;if(e.select("open")&&C||!s){e.setOpen(!0,ut(Fl,E,R));return}g.start(s,()=>{u.current||e.setOpen(!0,ut(Fl,E,R))})},onBlur(x){h();const S=x.relatedTarget,w=x.nativeEvent,C=ln(S)&&S.hasAttribute(Yl("focus-guard"))&&S.getAttribute("data-type")==="outside";g.start(0,()=>{const E=e.select("domReferenceElement"),R=Zr($t(E));!S&&R===E||it(c.current.floatingContext?.refs.floating.current,R)||it(E,R)||C||zh(S??R,e.context.triggerElements)||e.setOpen(!1,ut(Fl,w))})}}},[c,s,e,g]);return b.useMemo(()=>i?{reference:m,trigger:m}:{},[i,m])}class Kv{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Pi;restTimeout=new Pi;handleCloseOptions=void 0;static create(){return new Kv}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const qh=new WeakMap;function Yh(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&qh.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),qh.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function FC(e,t){const{scopeElement:i,referenceElement:s,floatingElement:o}=t,c=qh.get(i);c&&c!==e&&Yh(c),Yh(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=i,e.pointerEventsReferenceElement=s,e.pointerEventsFloatingElement=o,qh.set(i,e),i.style.pointerEvents="none",s.style.pointerEvents="auto",o.style.pointerEvents="auto"}function qv(e){const t=e.context.dataRef.current,i=er(()=>t.hoverInteractionState??Kv.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=i),xv(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Yv(e,t={}){const{enabled:i=!0,closeDelay:s=0,nodeId:o}=t,c=e.useState("open"),u=e.useState("floatingElement"),d=e.useState("domReferenceElement"),{dataRef:f}=e.context,g=Ga(),m=Ya(),h=qv(e),x=Un(),S=Be(()=>QR(f.current.openEvent?.type,h.interactedInside)),w=Be(()=>W4(f.current.openEvent?.type)),C=Be(()=>{Yh(h)});_e(()=>{c||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,C())},[c,h,C]),b.useEffect(()=>C,[C]),_e(()=>{if(i&&c&&h.handleCloseOptions?.blockPointerEvents&&w()&&ln(d)&&u){const E=d,R=u,k=$t(u),O=g?.nodesRef.current.find(D=>D.id===m)?.context?.elements.floating;O&&(O.style.pointerEvents="");const A=h.pointerEventsScopeElement!==R?h.pointerEventsScopeElement:null,N=O!==R?O:null,j=h.handleCloseOptions?.getScope?.()??A??N??Lu(E,"[data-rootownerid]")??k.body;return FC(h,{scopeElement:j,referenceElement:E,floatingElement:R}),()=>{C()}}},[i,c,d,u,h,w,g,m,C]),b.useEffect(()=>{if(!i)return;function E(){return!!(g&&m&&Va(g.nodesRef.current,m).length>0)}function R(D){const M=jo(s,"close",h.pointerType),_=()=>{e.setOpen(!1,ut(Kn,D)),g?.events.emit("floating.closed",D)};M?h.openChangeTimeout.start(M,_):(h.openChangeTimeout.clear(),_())}function k(D){const M=tr(D);if(!X4(M)){h.interactedInside=!1;return}h.interactedInside=Lu(M,"[aria-haspopup]")!=null}function O(){h.openChangeTimeout.clear(),x.clear(),g?.events.off("floating.closed",N),C()}function A(D){if(E()&&g){g.events.on("floating.closed",N);return}if(zh(D.relatedTarget,e.context.triggerElements))return;const M=f.current.floatingContext?.nodeId??o,_=D.relatedTarget;if(!(g&&M&&ln(_)&&Va(g.nodesRef.current,M,!1).some(q=>it(q.context?.elements.floating,_)))){if(h.handler){h.handler(D);return}C(),w()&&!S()&&R(D)}}function N(D){!g||!m||E()||x.start(0,()=>{g.events.off("floating.closed",N),e.setOpen(!1,ut(Kn,D)),g.events.emit("floating.closed",D)})}const j=u;return ys(j&&Lt(j,"mouseenter",O),j&&Lt(j,"mouseleave",A),j&&Lt(j,"pointerdown",k,!0),()=>{g?.events.off("floating.closed",N)})},[i,u,e,f,s,o,w,S,C,h,g,m,x])}const vI={current:null};function Gv(e,t={}){const{enabled:i=!0,delay:s=0,handleClose:o=null,mouseOnly:c=!1,restMs:u=0,move:d=!0,triggerElementRef:f=vI,externalTree:g,isActiveTrigger:m=!0,getHandleCloseContext:h,isClosing:x,shouldOpen:S,guardStaleOpen:w=!1}=t,{dataRef:C,events:E}=e.context,R=Ga(g),k=qv(e),O=b.useRef(!1),A=Ln(o),N=Ln(s),j=Ln(u),D=Ln(i),M=Ln(S),_=Ln(x),L=Be(()=>QR(C.current.openEvent?.type,k.interactedInside)),q=Be(()=>M.current?.()!==!1),X=Be((U,z,Q)=>{const $=e.context.triggerElements;if($.hasElement(z))return!U||!it(U,z);if(!ln(Q))return!1;const K=Q;return $.hasMatchingElement(Y=>it(Y,K))&&(!U||!it(U,K))}),B=Be(()=>{if(!k.handler)return;$t(e.select("domReferenceElement")).removeEventListener("mousemove",k.handler),k.handler=void 0}),H=Be(()=>{Yh(k)});return m&&(k.handleCloseOptions=o?.__options),b.useEffect(()=>B,[B]),b.useEffect(()=>{if(!i)return;function U(z){z.open?O.current=!1:(O.current=z.reason===Kn,B(),k.openChangeTimeout.clear(),k.restTimeout.clear(),k.blockMouseMove=!0,k.restTimeoutPending=!1)}return E.on("openchange",U),()=>{E.off("openchange",U)}},[i,E,k,B]),b.useEffect(()=>{if(!i)return;function U(ee,G=!0){const oe=jo(N.current,"close",k.pointerType);oe?k.openChangeTimeout.start(oe,()=>{e.setOpen(!1,ut(Kn,ee)),R?.events.emit("floating.closed",ee)}):G&&(k.openChangeTimeout.clear(),e.setOpen(!1,ut(Kn,ee)),R?.events.emit("floating.closed",ee))}const z=f.current??(m?e.select("domReferenceElement"):null);if(!ln(z))return;function Q(ee){if(k.openChangeTimeout.clear(),k.blockMouseMove=!1,c&&!_a(k.pointerType))return;const G=pw(j.current),oe=jo(N.current,"open",k.pointerType),I=tr(ee),V=ee.currentTarget??null,W=e.select("domReferenceElement");let re=V;if(ln(I)&&!e.context.triggerElements.hasElement(I)){for(const Oe of e.context.triggerElements.elements())if(it(Oe,I)){re=Oe;break}}ln(V)&&ln(W)&&!e.context.triggerElements.hasElement(V)&&it(V,W)&&(re=W);const Ee=re==null?!1:X(W,re,I),le=e.select("open"),me=_.current?.()??e.select("transitionStatus")==="ending",ge=!le&&me&&O.current,ue=!Ee&&ln(re)&&ln(W)&&it(W,re)&&ge,Te=G>0&&!oe,ve=Ee&&(le||ge)||ue,Pe=!le||Ee;if(ve){q()&&e.setOpen(!0,ut(Kn,ee,re));return}Te||(oe?k.openChangeTimeout.start(oe,()=>{Pe&&q()&&e.setOpen(!0,ut(Kn,ee,re))}):Pe&&q()&&e.setOpen(!0,ut(Kn,ee,re)))}function $(ee){if(L()){H();return}B();const G=e.select("domReferenceElement"),oe=$t(G);k.restTimeout.clear(),k.restTimeoutPending=!1;const I=C.current.floatingContext??h?.();if(zh(ee.relatedTarget,e.context.triggerElements))return;if(A.current&&I){e.select("open")||k.openChangeTimeout.clear();const W=f.current;k.handler=A.current({...I,tree:R,x:ee.clientX,y:ee.clientY,onClose(){H(),B(),D.current&&!L()&&W===e.select("domReferenceElement")&&U(ee,!0)}}),oe.addEventListener("mousemove",k.handler),k.handler(ee);return}(k.pointerType!=="touch"||!it(e.select("floatingElement"),ee.relatedTarget))&&U(ee)}function K(ee){it(z,ee.relatedTarget)||(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1)}const Y=w?Lt(z,"mouseout",K):void 0;return d?ys(Lt(z,"mousemove",Q,{once:!0}),Lt(z,"mouseenter",Q),Lt(z,"mouseleave",$),Y):ys(Lt(z,"mouseenter",Q),Lt(z,"mouseleave",$),Y)},[B,H,C,N,e,i,A,k,m,X,L,c,d,j,f,R,D,h,_,q,w]),b.useMemo(()=>{if(!i)return;function U(z){k.pointerType=z.pointerType}return{onPointerDown:U,onPointerEnter:U,onMouseMove(z){const{nativeEvent:Q}=z,$=z.currentTarget,K=e.select("domReferenceElement"),Y=e.select("open"),ee=X(K,$,z.target);if(c&&!_a(k.pointerType))return;if(Y&&ee&&k.handleCloseOptions?.blockPointerEvents){const I=e.select("floatingElement");if(I){const V=k.handleCloseOptions?.getScope?.()??$.ownerDocument.body;FC(k,{scopeElement:V,referenceElement:$,floatingElement:I})}}const G=pw(j.current);if(Y&&!ee||G===0||!ee&&k.restTimeoutPending&&z.movementX**2+z.movementY**2<2)return;k.restTimeout.clear();function oe(){if(k.restTimeoutPending=!1,L())return;const I=e.select("open");!k.blockMouseMove&&(!I||ee)&&q()&&e.setOpen(!0,ut(Kn,Q,$))}k.pointerType==="touch"?fr.flushSync(()=>{oe()}):ee&&Y?oe():(k.restTimeoutPending=!0,k.restTimeout.start(G,oe))}}},[i,k,L,X,c,e,j,q])}function Uw(e){return Ss&&e.movementX===0&&e.movementY===0}function Vp(e,t,i){switch(e){case"vertical":return t;case"horizontal":return i;default:return t||i}}function Wf(e,t){return Vp(t,e===GR||e===kv,e===xp||e===Sp)}function ry(e,t,i){return Vp(t,e===kv,i?e===xp:e===Sp)||e==="Enter"||e===" "||e===""}function bI(e,t,i){return Vp(t,i?e===xp:e===Sp,e===kv)}function xI(e,t,i,s){const o=i?e===Sp:e===xp,c=e===GR;return t==="both"||t==="horizontal"&&s?e==="Escape":Vp(t,o,c)}function BC(e,t){const{listRef:i,activeIndex:s,onNavigate:o=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loopFocus:f=!1,nested:g=!1,rtl:m=!1,virtual:h=!1,focusItemOnOpen:x="auto",focusItemOnHover:S=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:E="vertical",triggerOrientation:R=E,parentOrientation:k,id:O,resetOnPointerLeave:A=!0,externalTree:N,nestedReturnFocusRef:j,grid:D}=t,M=D!=null,_=e.useState("open"),L=e.useState("floatingElement"),q=e.useState("domReferenceElement"),X=e.context.dataRef,B=_h(L),H=jy(q),U=Ln(B),z=Ya(),Q=Ga(N),$=b.useRef(x),K=b.useRef(u??-1),Y=b.useRef(null),ee=b.useRef(!0),G=Be(de=>{o(K.current===-1?null:K.current,de)}),oe=b.useRef(!!L),I=b.useRef(_),V=b.useRef(!1),W=b.useRef(!1),re=b.useRef(null),Ee=Ln(C),le=Ln(_),me=Ln(u),ge=Ln(A),ue=tc(),Te=tc(),ve=Be(()=>{ue.cancel();function de(De){h||(re.current=wh(De,{sync:V.current,preventScroll:!0}))}const we=i.current[K.current],Ge=W.current;we&&de(we),(V.current?De=>De():De=>ue.request(De))(()=>{const De=i.current[K.current]||we;if(!De)return;we||de(De),Ue&&(Ge||!ee.current)&&De.scrollIntoView?.({block:"nearest",inline:"nearest"})})});_e(()=>{X.current.orientation=E},[X,E]),_e(()=>{_||(Y.current=null),(!_||x!=="auto")&&($.current=x)},[_,x]),_e(()=>{c&&(_&&L?(K.current=u??-1,$.current&&u!=null&&(W.current=!0,G())):oe.current&&(K.current=-1,G()))},[c,_,L,u,G]),_e(()=>{if(c){if(!_){V.current=!1;return}if(L)if(s==null){if(V.current=!1,me.current!=null)return;if(oe.current&&(K.current=-1,ve()),(!I.current||!oe.current)&&$.current&&(Y.current!=null||$.current===!0&&Y.current==null)){let de=0;const we=()=>{i.current[0]==null?(de<2&&(de?Me=>Te.request(Me):queueMicrotask)(we),de+=1):(K.current=Y.current==null||ry(Y.current,R,m)||g?Sh(i):Py(i),Y.current=null,G())};we()}}else Bl(i.current,s)||(K.current=s,ve(),W.current=!1)}},[c,_,L,s,me,g,i,R,m,G,ve,Te]),_e(()=>{if(!c||L||!Q||h||!oe.current)return;const de=Q.nodesRef.current,we=de.find(De=>De.id===z)?.context?.elements.floating,Ge=Zr($t(q??we??null)),Me=de.some(De=>De.context&&it(De.context.elements.floating,Ge));we&&!Me&&ee.current&&we.focus({preventScroll:!0})},[c,L,q,Q,z,h]),_e(()=>{I.current=_,oe.current=!!L});const Pe=s!=null,Oe=Be(de=>{if(!le.current)return;const we=i.current.indexOf(de.currentTarget);we!==-1&&(K.current!==we||s!==we)&&(K.current=we,G(de))}),Le=Be(()=>k??Q?.nodesRef.current.find(de=>de.id===z)?.context?.dataRef?.current.orientation),Ve=Be(()=>Sh(i,Ee.current)),ke=Be(de=>{if(ee.current=!1,V.current=!0,de.which===229||!le.current&&de.currentTarget===U.current)return;if(g&&xI(de.key,E,m,M)){Wf(de.key,Le())||Yi(de),e.setOpen(!1,ut(Uh,de.nativeEvent));const De=j?.current??q;bn(De)&&De.focus();return}s!=null&&s!==K.current&&!Bl(i.current,s)&&(K.current=s);const we=K.current,Ge=Sh(i,C),Me=Py(i,C);if(H||(de.key==="Home"&&(Yi(de),K.current=Ge,G(de)),de.key==="End"&&(Yi(de),K.current=Me,G(de))),D!=null){const De=D(de,K.current,i,E,f,m,C,Ge,Me);if(De!=null&&De!==K.current&&(K.current=De,G(de)),E==="both")return}if(Wf(de.key,E)){Yi(de);const De=Zr(de.currentTarget.ownerDocument);if(_&&!h&&it(de.currentTarget,De)&&!i.current.some(pt=>pt!=null&&it(pt,De))){K.current=ry(de.key,E,m)?Ge:Me,G(de),s===K.current&&ve();return}const{index:bt,wrapped:dt}=Ej(i.current,we,{decrement:!ry(de.key,E,m),loopFocus:f,allowEscape:d,disabledIndices:C,minIndex:Ge,maxIndex:Me});dt&&(V.current=!1),K.current=bt,G(de)}}),Ue=b.useMemo(()=>({onFocus(we){V.current=!0,Oe(we)},onClick({currentTarget:we}){h||we.focus({preventScroll:!0})},onMouseMove(we){Uw(we)||(V.current=!0,W.current=!1,S&&Oe(we))},onPointerLeave(we){if(!le.current||!ee.current||we.pointerType==="touch")return;V.current=!0;const Ge=we.relatedTarget;if(!(!S||i.current.includes(Ge))&&ge.current&&(re.current?.(),re.current=null,K.current=-1,G(we),!h)){const Me=U.current,De=Zr($t(Me));Me&&it(Me,De)&&Me.focus({preventScroll:!0})}}}),[Oe,le,U,S,i,G,ge,h]),be=b.useMemo(()=>h&&_&&Pe&&{"aria-activedescendant":`${O}-${s}`},[h,_,Pe,O,s]),He=b.useMemo(()=>({...H?{}:be,onKeyDown(de){if(de.key==="Tab"&&de.shiftKey&&_&&!h){const we=tr(de.nativeEvent);if(we&&!it(U.current,we))return;Yi(de);const Ge=ut(Ha,de.nativeEvent);e.setOpen(!1,Ge);const Me=j?.current??q;!Ge.isCanceled&&bn(Me)&&Me.focus();return}ke(de)},onPointerMove(de){Uw(de)||(ee.current=!0)}}),[be,ke,U,H,e,_,h,q,j]),Ze=b.useMemo(()=>{function de(Me){e.setOpen(!0,ut(Uh,Me.nativeEvent,Me.currentTarget))}function we(Me){x==="auto"&&ec(Me.nativeEvent)&&($.current=!h)}function Ge(Me){$.current=x,x==="auto"&&Ev(Me.nativeEvent)&&($.current=!0)}return{onKeyDown(Me){const De=e.select("open");ee.current=!1;const bt=Me.key.startsWith("Arrow"),dt=bI(Me.key,Le(),m),pt=Wf(Me.key,De?E:R),Nt=(g?dt:pt)||Me.key==="Enter"||Me.key.trim()==="";if(h&&De&&(!g||Wu(Me.currentTarget)))return ke(Me);if(!(!De&&!w&&bt)){if(Nt){const jt=Wf(Me.key,Le());Y.current=g&&jt?null:Me.key}if(g){dt&&(Yi(Me),De?(K.current=Ve(),G(Me),h&&U.current?.focus()):de(Me));return}pt&&(me.current!=null&&(K.current=me.current),Yi(Me),!De&&w?de(Me):ke(Me),De&&G(Me))}},onFocus(Me){Me.target===Me.currentTarget&&e.select("open")&&!h&&(K.current=-1,G(Me))},onPointerDown:Ge,onPointerEnter:Ge,onMouseDown:we,onClick:we}},[ke,x,Ve,g,G,e,w,E,R,Le,m,me,h,U]),ot=b.useMemo(()=>({...be,...Ze}),[be,Ze]);return b.useMemo(()=>c?{reference:ot,floating:He,item:Ue,trigger:Ze}:{},[c,ot,He,Ze,Ue])}function VC(e,t){const{listRef:i,elementsRef:s,activeIndex:o,onMatch:c,disabledIndices:u,onTyping:d,enabled:f=!0,resetMs:g=750,selectedIndex:m=null}=t,h=Be(d),x=e.useState("open"),S=Un(),w=b.useRef(""),C=b.useRef(m??o??-1),E=b.useRef(null),R=Be(A=>{function N(H){return s?.current[H]}function j(H){const U=N(H);return U&&!Tp(U)||U?.matches(":disabled")?!1:u==null||!Kl($i,H,u)}function D(H,U,z=0){if(H.length===0)return-1;const Q=(z%H.length+H.length)%H.length,$=U.toLowerCase();for(let K=0;K<H.length;K+=1){const Y=(Q+K)%H.length;if(!(!H[Y]?.toLowerCase().startsWith($)||!j(Y)))return Y}return-1}const M=i.current;if(w.current.length>0&&A.key===" "&&(Yi(A),h?.(!0)),w.current.length>0&&w.current[0]!==" "&&D(M,w.current)===-1&&A.key!==" "&&h?.(!1),M==null||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;x&&A.key!==" "&&(Yi(A),h?.(!0));const _=w.current==="";_&&(C.current=m??o??-1),M.every((H,U)=>H&&j(U)?H[0]?.toLowerCase()!==H[1]?.toLowerCase():!0)&&w.current===A.key&&(w.current="",C.current=E.current),w.current+=A.key,S.start(g,()=>{w.current="",C.current=E.current,h?.(!1)});const X=((_?m??o??-1:C.current)??0)+1,B=D(M,w.current,X);B!==-1?(c?.(B,A),E.current=B):A.key!==" "&&(w.current="",h?.(!1))}),k=Be(A=>{const N=A.relatedTarget,j=e.select("domReferenceElement"),D=e.select("floatingElement");it(j,N)||it(D,N)||(S.clear(),w.current="",C.current=E.current,h?.(!1))});_e(()=>{!x&&m!==null||(S.clear(),E.current=null,w.current!==""&&(w.current="",h?.(!1)))},[x,m,S,h]);const O=b.useMemo(()=>({onKeyDown:R,onBlur:k}),[R,k]);return b.useMemo(()=>f?{reference:O,floating:O}:{},[f,O])}const Hw=.1,SI=Hw*Hw,wn=.5;function eh(e,t,i,s,o,c){return s>=t!=c>=t&&e<=(o-i)*(t-s)/(c-s)+i}function th(e,t,i,s,o,c,u,d,f,g){let m=!1;return eh(e,t,i,s,o,c)&&(m=!m),eh(e,t,o,c,u,d)&&(m=!m),eh(e,t,u,d,f,g)&&(m=!m),eh(e,t,f,g,i,s)&&(m=!m),m}function wI(e,t,i){return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height}function nh(e,t,i,s,o,c){const u=Math.min(i,o),d=Math.max(i,o),f=Math.min(s,c),g=Math.max(s,c);return e>=u&&e<=d&&t>=f&&t<=g}function $v(e={}){const{blockPointerEvents:t=!1}=e,i=new Pi,s=({x:o,y:c,placement:u,elements:d,onClose:f,nodeId:g,tree:m})=>{const h=u?.split("-")[0];let x=!1,S=null,w=null,C=typeof performance<"u"?performance.now():0;function E(k,O){const A=performance.now(),N=A-C;if(S===null||w===null||N===0)return S=k,w=O,C=A,!1;const j=k-S,D=O-w,M=j*j+D*D,_=N*N*SI;return S=k,w=O,C=A,M<_}function R(){i.clear(),f()}return function(O){i.clear();const A=d.domReference,N=d.floating;if(!A||!N||h==null||o==null||c==null)return;const{clientX:j,clientY:D}=O,M=tr(O),_=O.type==="mouseleave",L=it(N,M),q=it(A,M);if(L&&(x=!0,!_))return;if(q&&(x=!1,!_)){x=!0;return}if(_&&ln(O.relatedTarget)&&it(N,O.relatedTarget))return;function X(){return!!(m&&Va(m.nodesRef.current,g).length>0)}function B(){X()||R()}if(X())return;const H=A.getBoundingClientRect(),U=N.getBoundingClientRect(),z=o>U.right-U.width/2,Q=c>U.bottom-U.height/2,$=U.width>H.width,K=U.height>H.height,Y=($?H:U).left,ee=($?H:U).right,G=(K?H:U).top,oe=(K?H:U).bottom;if(h==="top"&&c>=H.bottom-1||h==="bottom"&&c<=H.top+1||h==="left"&&o>=H.right-1||h==="right"&&o<=H.left+1){B();return}let I=!1;switch(h){case"top":I=nh(j,D,Y,H.top+1,ee,U.bottom-1);break;case"bottom":I=nh(j,D,Y,U.top+1,ee,H.bottom-1);break;case"left":I=nh(j,D,U.right-1,oe,H.left+1,G);break;case"right":I=nh(j,D,H.right-1,oe,U.left+1,G);break}if(I)return;if(x&&!wI(j,D,H)){B();return}if(!_&&E(j,D)){B();return}let V=!1;switch(h){case"top":{const W=$?wn/2:wn*4,re=$||z?o+W:o-W,Ee=$?o-W:z?o+W:o-W,le=c+wn+1,me=z||$?U.bottom-wn:U.top,ge=z?$?U.bottom-wn:U.top:U.bottom-wn;V=th(j,D,re,le,Ee,le,U.left,me,U.right,ge);break}case"bottom":{const W=$?wn/2:wn*4,re=$||z?o+W:o-W,Ee=$?o-W:z?o+W:o-W,le=c-wn,me=z||$?U.top+wn:U.bottom,ge=z?$?U.top+wn:U.bottom:U.top+wn;V=th(j,D,re,le,Ee,le,U.left,me,U.right,ge);break}case"left":{const W=K?wn/2:wn*4,re=K||Q?c+W:c-W,Ee=K?c-W:Q?c+W:c-W,le=o+wn+1,me=Q||K?U.right-wn:U.left,ge=Q?K?U.right-wn:U.left:U.right-wn;V=th(j,D,me,U.top,ge,U.bottom,le,re,le,Ee);break}case"right":{const W=K?wn/2:wn*4,re=K||Q?c+W:c-W,Ee=K?c-W:Q?c+W:c-W,le=o-wn,me=Q||K?U.left+wn:U.right,ge=Q?K?U.left+wn:U.right:U.left+wn;V=th(j,D,le,re,le,Ee,me,U.top,ge,U.bottom);break}}V?x||i.start(40,B):B()}};return s.__options={...e,blockPointerEvents:t},s}function Fw(e,t,i){let{reference:s,floating:o}=e;const c=ji(t),u=jv(t),d=Dv(u),f=gi(t),g=c==="y",m=s.x+s.width/2-o.width/2,h=s.y+s.height/2-o.height/2,x=s[d]/2-o[d]/2;let S;switch(f){case"top":S={x:m,y:s.y-o.height};break;case"bottom":S={x:m,y:s.y+s.height};break;case"right":S={x:s.x+s.width,y:h};break;case"left":S={x:s.x-o.width,y:h};break;default:S={x:s.x,y:s.y}}const w=vs(t);return w&&(S[u]+=x*(w==="end"?1:-1)*(i&&g?-1:1)),S}async function EI(e,t){var i;t===void 0&&(t={});const{x:s,y:o,platform:c,rects:u,elements:d,strategy:f}=e,{boundary:g="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:x=!1,padding:S=0}=Ba(t,e),w=rC(S),E=d[x?h==="floating"?"reference":"floating":h],R=_u(await c.getClippingRect({element:(i=await(c.isElement==null?void 0:c.isElement(E)))==null||i?E:E.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(d.floating)),boundary:g,rootBoundary:m,strategy:f})),k=h==="floating"?{x:s,y:o,width:u.floating.width,height:u.floating.height}:u.reference,O=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d.floating)),A=await(c.isElement==null?void 0:c.isElement(O))&&await(c.getScale==null?void 0:c.getScale(O))||{x:1,y:1},N=_u(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:k,offsetParent:O,strategy:f}):k);return{top:(R.top-N.top+w.top)/A.y,bottom:(N.bottom-R.bottom+w.bottom)/A.y,left:(R.left-N.left+w.left)/A.x,right:(N.right-R.right+w.right)/A.x}}const RI=50,CI=async(e,t,i)=>{const{placement:s="bottom",strategy:o="absolute",middleware:c=[],platform:u}=i,d=u.detectOverflow?u:{...u,detectOverflow:EI},f=await(u.isRTL==null?void 0:u.isRTL(t));let g=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:h}=Fw(g,s,f),x=s,S=0;const w={};for(let C=0;C<c.length;C++){const E=c[C];if(!E)continue;const{name:R,fn:k}=E,{x:O,y:A,data:N,reset:j}=await k({x:m,y:h,initialPlacement:s,placement:x,strategy:o,middlewareData:w,rects:g,platform:d,elements:{reference:e,floating:t}});m=O??m,h=A??h,w[R]={...w[R],...N},j&&S<RI&&(S++,typeof j=="object"&&(j.placement&&(x=j.placement),j.rects&&(g=j.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:m,y:h}=Fw(g,x,f)),C=-1)}return{x:m,y:h,placement:x,strategy:o,middlewareData:w}},TI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,s;const{placement:o,middlewareData:c,rects:u,initialPlacement:d,platform:f,elements:g}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:x,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...E}=Ba(e,t);if((i=c.arrow)!=null&&i.alignmentOffset)return{};const R=gi(o),k=ji(d),O=gi(d)===d,A=await(f.isRTL==null?void 0:f.isRTL(g.floating)),N=x||(O||!C?[Fh(d)]:yj(d)),j=w!=="none";!x&&j&&N.push(...Sj(d,C,w,A));const D=[d,...N],M=await f.detectOverflow(t,E),_=[];let L=((s=c.flip)==null?void 0:s.overflows)||[];if(m&&_.push(M[R]),h){const H=mj(o,u,A);_.push(M[H[0]],M[H[1]])}if(L=[...L,{placement:o,overflows:_}],!_.every(H=>H<=0)){var q,X;const H=(((q=c.flip)==null?void 0:q.index)||0)+1,U=D[H];if(U&&(!(h==="alignment"?k!==ji(U):!1)||L.every($=>ji($.placement)===k?$.overflows[0]>0:!0)))return{data:{index:H,overflows:L},reset:{placement:U}};let z=(X=L.filter(Q=>Q.overflows[0]<=0).sort((Q,$)=>Q.overflows[1]-$.overflows[1])[0])==null?void 0:X.placement;if(!z)switch(S){case"bestFit":{var B;const Q=(B=L.filter($=>{if(j){const K=ji($.placement);return K===k||K==="y"}return!0}).map($=>[$.placement,$.overflows.filter(K=>K>0).reduce((K,Y)=>K+Y,0)]).sort(($,K)=>$[1]-K[1])[0])==null?void 0:B[0];Q&&(z=Q);break}case"initialPlacement":z=d;break}if(o!==z)return{reset:{placement:z}}}return{}}}},KC=new Set(["left","top"]);async function kI(e,t){const{placement:i,platform:s,elements:o}=e,c=await(s.isRTL==null?void 0:s.isRTL(o.floating)),u=gi(i),d=vs(i),f=ji(i)==="y",g=KC.has(u)?-1:1,m=c&&f?-1:1,h=Ba(t,e);let{mainAxis:x,crossAxis:S,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"&&(S=d==="end"?w*-1:w),f?{x:S*m,y:x*g}:{x:x*g,y:S*m}}const OI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,s;const{x:o,y:c,placement:u,middlewareData:d}=t,f=await kI(t,e);return u===((i=d.offset)==null?void 0:i.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:o+f.x,y:c+f.y,data:{...f,placement:u}}}}},AI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:s,placement:o,platform:c}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:f={fn:k=>{let{x:O,y:A}=k;return{x:O,y:A}}},...g}=Ba(e,t),m={x:i,y:s},h=await c.detectOverflow(t,g),x=ji(o),S=Nv(x);let w=m[S],C=m[x];const E=(k,O)=>nC(O+h[k==="y"?"top":"left"],O,O-h[k==="y"?"bottom":"right"]);u&&(w=E(S,w)),d&&(C=E(x,C));const R=f.fn({...t,[S]:w,[x]:C});return{...R,data:{x:R.x-i,y:R.y-s,enabled:{[S]:u,[x]:d}}}}}},MI=function(e){return e===void 0&&(e={}),{options:e,fn(t){var i,s;const{x:o,y:c,placement:u,rects:d,middlewareData:f}=t,{offset:g=0,mainAxis:m=!0,crossAxis:h=!0}=Ba(e,t),x={x:o,y:c},S=ji(u),w=Nv(S);let C=x[w],E=x[S];const R=Ba(g,t),k=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(i=R.mainAxis)!=null?i:0,crossAxis:(s=R.crossAxis)!=null?s:0};if(m){const N=w==="y"?"height":"width",j=d.reference[w]-d.floating[N]+k.mainAxis,D=d.reference[w]+d.reference[N]-k.mainAxis;C<j?C=j:C>D&&(C=D)}if(h){var O,A;const N=w==="y"?"width":"height",j=KC.has(gi(u)),D=d.reference[S]-d.floating[N]+(j&&((O=f.offset)==null?void 0:O[S])||0)+(j?0:k.crossAxis),M=d.reference[S]+d.reference[N]+(j?0:((A=f.offset)==null?void 0:A[S])||0)-(j?k.crossAxis:0);E<D?E=D:E>M&&(E=M)}return{[w]:C,[S]:E}}}},NI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:i,rects:s,platform:o,elements:c}=t,{apply:u=()=>{},...d}=Ba(e,t),f=await o.detectOverflow(t,d),g=gi(i),m=vs(i),h=ji(i)==="y",{width:x,height:S}=s.floating;let w,C;g==="top"||g==="bottom"?(w=g,C=m===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(C=g,w=m==="end"?"top":"bottom");const E=S-f.top-f.bottom,R=x-f.left-f.right,k=nc(S-f[w],E),O=nc(x-f[C],R),A=t.middlewareData.shift,N=!A;let j=k,D=O;A!=null&&A.enabled.x&&(D=R),A!=null&&A.enabled.y&&(j=E),N&&!m&&(h?D=x-2*Qs(f.left,f.right):j=S-2*Qs(f.top,f.bottom)),await u({...t,availableWidth:D,availableHeight:j});const M=await o.getDimensions(c.floating);return x!==M.width||S!==M.height?{reset:{rects:!0}}:{}}}};function qC(e){const t=mi(e);let i=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=bn(e),c=o?e.offsetWidth:i,u=o?e.offsetHeight:s,d=Hh(i)!==c||Hh(s)!==u;return d&&(i=c,s=u),{width:i,height:s,$:d}}function Qv(e){return ln(e)?e:e.contextElement}function Gl(e){const t=Qv(e);if(!bn(t))return Xs(1);const i=t.getBoundingClientRect(),{width:s,height:o,$:c}=qC(t);let u=(c?Hh(i.width):i.width)/s,d=(c?Hh(i.height):i.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const DI=Xs(0);function YC(e){const t=Rn(e);return!Tv()||!t.visualViewport?DI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jI(e,t,i){return t===void 0&&(t=!1),!!i&&t&&i===Rn(e)}function Io(e,t,i,s){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),c=Qv(e);let u=Xs(1);t&&(s?ln(s)&&(u=Gl(s)):u=Gl(e));const d=jI(c,i,s)?YC(c):Xs(0);let f=(o.left+d.x)/u.x,g=(o.top+d.y)/u.y,m=o.width/u.x,h=o.height/u.y;if(c&&s){const x=Rn(c),S=ln(s)?Rn(s):s;let w=x,C=My(w);for(;C&&S!==w;){const E=Gl(C),R=C.getBoundingClientRect(),k=mi(C),O=R.left+(C.clientLeft+parseFloat(k.paddingLeft))*E.x,A=R.top+(C.clientTop+parseFloat(k.paddingTop))*E.y;f*=E.x,g*=E.y,m*=E.x,h*=E.y,f+=O,g+=A,w=Rn(C),C=My(w)}}return _u({width:m,height:h,x:f,y:g})}function Kp(e,t){const i=bp(e).scrollLeft;return t?t.left+i:Io(ea(e)).left+i}function GC(e,t){const i=e.getBoundingClientRect(),s=i.left+t.scrollLeft-Kp(e,i),o=i.top+t.scrollTop;return{x:s,y:o}}function II(e){let{elements:t,rect:i,offsetParent:s,strategy:o}=e;const c=o==="fixed",u=ea(s),d=t?vp(t.floating):!1;if(s===u||d&&c)return i;let f={scrollLeft:0,scrollTop:0},g=Xs(1);const m=Xs(0),h=bn(s);if((h||!c)&&((Rr(s)!=="body"||Zu(u))&&(f=bp(s)),h)){const S=Io(s);g=Gl(s),m.x=S.x+s.clientLeft,m.y=S.y+s.clientTop}const x=u&&!h&&!c?GC(u,f):Xs(0);return{width:i.width*g.x,height:i.height*g.y,x:i.x*g.x-f.scrollLeft*g.x+m.x+x.x,y:i.y*g.y-f.scrollTop*g.y+m.y+x.y}}function PI(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function LI(e){const t=bp(e),i=e.ownerDocument.body,s=Qs(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=Qs(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let c=-t.scrollLeft+Kp(e);const u=-t.scrollTop;return mi(i).direction==="rtl"&&(c+=Qs(e.clientWidth,i.clientWidth)-s),{width:s,height:o,x:c,y:u}}const zI=25;function _I(e,t,i){i===void 0&&(i="viewport");const s=i==="layoutViewport",o=Rn(e),c=ea(e),u=o.visualViewport;let d=c.clientWidth,f=c.clientHeight,g=0,m=0;if(u){const x=!Tv()||t==="fixed";s?x||(g=-u.offsetLeft,m=-u.offsetTop):(d=u.width,f=u.height,x&&(g=u.offsetLeft,m=u.offsetTop))}if(Kp(c)<=0){const x=c.ownerDocument,S=x.body,w=getComputedStyle(S),C=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,E=Math.abs(c.clientWidth-S.clientWidth-C),R=getComputedStyle(c).scrollbarGutter==="stable both-edges"?E/2:E;R<=zI&&(d-=R)}return{width:d,height:f,x:g,y:m}}function UI(e,t){const i=Io(e,!0,t==="fixed"),s=i.top+e.clientTop,o=i.left+e.clientLeft,c=Gl(e),u=e.clientWidth*c.x,d=e.clientHeight*c.y,f=o*c.x,g=s*c.y;return{width:u,height:d,x:f,y:g}}function Bw(e,t,i){let s;if(t==="viewport"||t==="layoutViewport")s=_I(e,i,t);else if(t==="document")s=LI(ea(e));else if(ln(t))s=UI(t,i);else{const o=YC(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return _u(s)}function HI(e,t){const i=t.get(e);if(i)return i;let s=Pu(e,[],!1).filter(d=>ln(d)&&Rr(d)!=="body"),o=null;const c=mi(e).position==="fixed";let u=c?Zs(e):e;for(;ln(u)&&!$s(u);){const d=mi(u),f=Cv(u),g=o?o.position:c?"fixed":"";!f&&(g==="fixed"||g==="absolute"&&d.position==="static")?s=s.filter(h=>h!==u):o=d,u=Zs(u)}return t.set(e,s),s}function FI(e){let{element:t,boundary:i,rootBoundary:s,strategy:o}=e;const u=[...i==="clippingAncestors"?vp(t)?[]:HI(t,this._c):[].concat(i),s],d=Bw(t,u[0],o);let f=d.top,g=d.right,m=d.bottom,h=d.left;for(let x=1;x<u.length;x++){const S=Bw(t,u[x],o);f=Qs(S.top,f),g=nc(S.right,g),m=nc(S.bottom,m),h=Qs(S.left,h)}return{width:g-h,height:m-f,x:h,y:f}}function BI(e){const{width:t,height:i}=qC(e);return{width:t,height:i}}function VI(e,t,i){const s=bn(t),o=ea(t),c=i==="fixed",u=Io(e,!0,c,t);let d={scrollLeft:0,scrollTop:0};const f=Xs(0);if((s||!c)&&((Rr(t)!=="body"||Zu(o))&&(d=bp(t)),s)){const x=Io(t,!0,c,t);f.x=x.x+t.clientLeft,f.y=x.y+t.clientTop}!s&&o&&(f.x=Kp(o));const g=o&&!s&&!c?GC(o,d):Xs(0),m=u.left+d.scrollLeft-f.x-g.x,h=u.top+d.scrollTop-f.y-g.y;return{x:m,y:h,width:u.width,height:u.height}}function iy(e){return mi(e).position==="static"}function Vw(e,t){if(!bn(e)||mi(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return ea(e)===i&&(i=i.ownerDocument.body),i}function $C(e,t){const i=Rn(e);if(vp(e))return i;if(!bn(e)){let o=Zs(e);for(;o&&!$s(o);){if(ln(o)&&!iy(o))return o;o=Zs(o)}return i}let s=Vw(e,t);for(;s&&j4(s)&&iy(s);)s=Vw(s,t);return s&&$s(s)&&iy(s)&&!Cv(s)?i:s||L4(e)||i}const KI=async function(e){const t=this.getOffsetParent||$C,i=this.getDimensions,s=await i(e.floating);return{reference:VI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function qI(e){return mi(e).direction==="rtl"}const QC={convertOffsetParentRelativeRectToViewportRelativeRect:II,getDocumentElement:ea,getClippingRect:FI,getOffsetParent:$C,getElementRects:KI,getClientRects:PI,getDimensions:BI,getScale:Gl,isElement:ln,isRTL:qI};function XC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function YI(e,t,i){let s=null,o;const c=ea(e);function u(){var m;clearTimeout(o),(m=s)==null||m.disconnect(),s=null}function d(m,h){m===void 0&&(m=!1),h===void 0&&(h=1),u();const x=e.getBoundingClientRect(),{left:S,top:w,width:C,height:E}=x;if(m||t(),!C||!E)return;const R=Qf(w),k=Qf(c.clientWidth-(S+C)),O=Qf(c.clientHeight-(w+E)),A=Qf(S),j={rootMargin:-R+"px "+-k+"px "+-O+"px "+-A+"px",threshold:Qs(0,nc(1,h))||1};let D=!0;function M(_){const L=_[0].intersectionRatio;if(!XC(x,e.getBoundingClientRect()))return d();if(L!==h){if(!D)return d();L?d(!1,L):o=setTimeout(()=>{d(!1,1e-7)},1e3)}D=!1}try{s=new IntersectionObserver(M,{...j,root:c.ownerDocument})}catch{s=new IntersectionObserver(M,j)}s.observe(e)}const f=Rn(e),g=()=>d(i);return f.addEventListener("resize",g),d(!0),()=>{f.removeEventListener("resize",g),u()}}function Kw(e,t,i,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=s,g=Qv(e),m=o||c?[...g?Pu(g):[],...t?Pu(t):[]]:[];m.forEach(R=>{o&&R.addEventListener("scroll",i),c&&R.addEventListener("resize",i)});const h=g&&d?YI(g,i,c):null;let x=-1,S=null;u&&(S=new ResizeObserver(R=>{let[k]=R;k&&k.target===g&&S&&t&&(S.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var O;(O=S)==null||O.observe(t)})),i()}),g&&!f&&S.observe(g),t&&S.observe(t));let w,C=f?Io(e):null;f&&E();function E(){const R=Io(e);C&&!XC(C,R)&&i(),C=R,w=requestAnimationFrame(E)}return i(),()=>{var R;m.forEach(k=>{o&&k.removeEventListener("scroll",i),c&&k.removeEventListener("resize",i)}),h?.(),(R=S)==null||R.disconnect(),S=null,f&&cancelAnimationFrame(w)}}const GI=OI,$I=AI,QI=TI,XI=NI,ZI=MI,JI=(e,t,i)=>{const s=new Map,o=i??{},c={...QC,...o.platform,_c:s};return CI(e,t,{...o,platform:c})};var WI=typeof document<"u",e3=function(){},Eh=WI?b.useLayoutEffect:e3;function Gh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let i,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(i=e.length,i!==t.length)return!1;for(s=i;s--!==0;)if(!Gh(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),i=o.length,i!==Object.keys(t).length)return!1;for(s=i;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=i;s--!==0;){const c=o[s];if(!(c==="_owner"&&e.$$typeof)&&!Gh(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function ZC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qw(e,t){const i=ZC(e);return Math.round(t*i)/i}function sy(e){const t=b.useRef(e);return Eh(()=>{t.current=e}),t}function t3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:i="absolute",middleware:s=[],platform:o,elements:{reference:c,floating:u}={},transform:d=!0,whileElementsMounted:f,open:g}=e,[m,h]=b.useState({x:0,y:0,strategy:i,placement:t,middlewareData:{},isPositioned:!1}),[x,S]=b.useState(s);Gh(x,s)||S(s);const[w,C]=b.useState(null),[E,R]=b.useState(null),k=b.useCallback($=>{$!==j.current&&(j.current=$,C($))},[]),O=b.useCallback($=>{$!==D.current&&(D.current=$,R($))},[]),A=c||w,N=u||E,j=b.useRef(null),D=b.useRef(null),M=b.useRef(m),_=f!=null,L=sy(f),q=sy(o),X=sy(g),B=b.useCallback(()=>{if(!j.current||!D.current)return;const $={placement:t,strategy:i,middleware:x};q.current&&($.platform=q.current),JI(j.current,D.current,$).then(K=>{const Y={...K,isPositioned:X.current!==!1};H.current&&!Gh(M.current,Y)&&(M.current=Y,fr.flushSync(()=>{h(Y)}))})},[x,t,i,q,X]);Eh(()=>{g===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h($=>({...$,isPositioned:!1})))},[g]);const H=b.useRef(!1);Eh(()=>(H.current=!0,()=>{H.current=!1}),[]),Eh(()=>{if(A&&(j.current=A),N&&(D.current=N),A&&N){if(L.current)return L.current(A,N,B);B()}},[A,N,B,L,_]);const U=b.useMemo(()=>({reference:j,floating:D,setReference:k,setFloating:O}),[k,O]),z=b.useMemo(()=>({reference:A,floating:N}),[A,N]),Q=b.useMemo(()=>{const $={position:i,left:0,top:0};if(!z.floating)return $;const K=qw(z.floating,m.x),Y=qw(z.floating,m.y);return d?{...$,transform:"translate("+K+"px, "+Y+"px)",...ZC(z.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:K,top:Y}},[i,d,z.floating,m.x,m.y]);return b.useMemo(()=>({...m,update:B,refs:U,elements:z,floatingStyles:Q}),[m,B,U,z,Q])}const n3=(e,t)=>{const i=GI(e);return{name:i.name,fn:i.fn,options:[e,t]}},r3=(e,t)=>{const i=$I(e);return{name:i.name,fn:i.fn,options:[e,t]}},i3=(e,t)=>({fn:ZI(e).fn,options:[e,t]}),s3=(e,t)=>{const i=QI(e);return{name:i.name,fn:i.fn,options:[e,t]}},a3=(e,t)=>{const i=XI(e);return{name:i.name,fn:i.fn,options:[e,t]}},o3={...Ys,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,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class l3 extends oc{constructor(t,i,s){const o=new sd;super(c3(t,o,i,s),u3(o),o3)}setOpen=(t,i)=>{iI(this,t,i,{extraState:{openChangeReason:i.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,ut(Qi,t))}}function c3(e,t,i,s=!1){return{...Fp(t,i,s),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function u3(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const d3=Qu(function(t){const{disabled:i=!1,defaultOpen:s=!1,open:o,disableHoverablePopup:c=!1,trackCursorAxis:u="none",actionsRef:d,onOpenChange:f,onOpenChangeComplete:g,handle:m,triggerId:h,defaultTriggerId:x=null,children:S}=t,w=Vv((q,X)=>new l3({open:s,openProp:o,activeTriggerId:x,triggerIdProp:h},q,X));w.useControlledProp("openProp",o),w.useControlledProp("triggerIdProp",h),w.useContextCallback("onOpenChange",f),w.useContextCallback("onOpenChangeComplete",g);const C=w.useState("open"),E=!i&&C,R=w.useState("activeTriggerId"),k=w.useState("mounted"),O=w.useState("payload");w.useSyncedValues({trackCursorAxis:u,disableHoverablePopup:c,disabled:i}),zp(w,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:A,transitionStatus:N}=_p(E,w),j=w.useState("isInstantPhase"),D=w.useState("instantType"),M=w.useState("lastOpenChangeReason"),_=b.useRef(null);_e(()=>{C&&i&&w.setOpen(!1,ut(nj))},[C,i,w]),_e(()=>{N==="ending"&&M===Mr||N!=="ending"&&j?(D!=="delay"&&(_.current=D),w.set("instantType","delay")):_.current!==null&&(w.set("instantType",_.current),_.current=null)},[N,j,M,D,w]),_e(()=>{E&&R==null&&w.set("payload",void 0)},[w,R,E]),b.useImperativeHandle(d,()=>({unmount:A,close:()=>w.setOpen(!1,ut(td))}),[A,w]);const L=E||k||!i&&u!=="none";return v.jsxs(KR.Provider,{value:w,children:[m&&v.jsx(jp,{handle:m,store:w}),L&&v.jsx(f3,{store:w,disabled:i,trackCursorAxis:u}),typeof S=="function"?S({payload:O}):S]})});function f3({store:e,disabled:t,trackCursorAxis:i}){const s=e.useState("floatingRootContext"),o=rd(s,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),c=Wj(s,{enabled:!t&&i!=="none",axis:i==="none"?void 0:i}),u=b.useMemo(()=>Ar(c.reference,o.reference),[c.reference,o.reference]);return Up(e,{activeTriggerProps:u,inactiveTriggerProps:u,popupProps:o.floating??Xt}),null}function ar(e){return ac(e,"base-ui")}const JC=b.createContext(void 0);function h3(){return b.useContext(JC)}const p3=600,Yw="data-base-ui-tooltip-trigger";function Gw(e){const t=tr(e);return ln(t)?t:null}const g3=pp(function(t,i){const{render:s,className:o,style:c,handle:u,payload:d,disabled:f,delay:g,closeOnClick:m=!0,closeDelay:h,id:x,...S}=t,w=Xu(!0),E=Bp(u)??w;if(!E)throw new Error(gn(82));const R=ar(x),k=E.useState("isTriggerActive",R),O=E.useState("isOpenedByTrigger",R),A=E.useState("floatingRootContext"),N=b.useRef(null),j=h??0,{registerTrigger:D,isMountedByThisTrigger:M}=Lp(R,N,E,{payload:d,closeOnClick:m,closeDelay:j}),_=h3(),{activeIdRef:L,delayRef:q,isInstantPhase:X,hasProvider:B}=aj(A,{open:O}),H=qv(A);E.useSyncedValue("isInstantPhase",X);const U=E.useState("disabled"),z=f??U,Q=Ln(z),$=E.useState("trackCursorAxis"),K=E.useState("disableHoverablePopup"),Y=b.useRef(!1),ee=Un(),G=b.useRef(void 0);function oe(){return B&&L.current!=null?0:g??_??p3}function I(ue){const Te=N.current;if(!Te||!ue)return!1;const ve=Lu(ue,`[${Yw}]`);return ve!==null&&ve!==Te&&it(Te,ve)}function V(ue){const Te=I(ue);return Y.current=Te,Te&&(H.openChangeTimeout.clear(),H.restTimeout.clear(),H.restTimeoutPending=!1,ee.clear()),Te}const W=Gv(A,{enabled:!z,mouseOnly:!0,move:!1,handleClose:!K&&$!=="both"?$v():null,restMs:oe,delay(){return h==null&&B?{close:jo(q.current,"close")}:{close:j}},triggerElementRef:N,isActiveTrigger:k,isClosing:()=>E.select("transitionStatus")==="ending",shouldOpen(){return!Y.current}}),re=HC(A,{enabled:!z}).reference,Ee=ue=>{const Te=Y.current,ve=Gw(ue),Pe=V(ve),Oe=N.current,Le=Oe&&ve&&it(Oe,ve);if(Pe&&E.select("open")&&E.select("lastOpenChangeReason")===Kn){E.setOpen(!1,ut(Kn,ue));return}if(Te&&!Pe&&Le&&!Q.current&&!E.select("open")&&Oe&&_a(G.current)){const Ve=()=>{!Y.current&&!Q.current&&!E.select("open")&&E.setOpen(!0,ut(Kn,ue,Oe))},ke=oe();ke===0?(ee.clear(),Ve()):ee.start(ke,Ve)}},le=E.useState("appliedTriggerProps",M||$!=="none");return kt("button",t,{state:{open:O},ref:[i,D,N],props:[W,re,le,{onMouseOver(ue){Ee(ue.nativeEvent)},onFocus(ue){I(Gw(ue.nativeEvent))&&ue.preventBaseUIHandler()},onMouseLeave(){Y.current=!1,ee.clear(),G.current=void 0},onPointerEnter(ue){G.current=ue.pointerType},onPointerDown(ue){G.current=ue.pointerType,E.set("closeOnClick",m),m&&!E.select("open")&&E.cancelPendingOpen(ue.nativeEvent)},onClick(ue){m&&!E.select("open")&&E.cancelPendingOpen(ue.nativeEvent)},id:R,[Dy]:z?"":void 0,[Yw]:z?void 0:""},S],stateAttributesMapping:wp})}),WC=b.createContext(void 0);function m3(){const e=b.useContext(WC);if(e===void 0)throw new Error(gn(70));return e}const y3=b.forwardRef(function(t,i){const{children:s,container:o,className:c,render:u,style:d,...f}=t,{node:g,subtree:m}=TC({container:o,ref:i,componentProps:t,elementProps:f});return!m&&!g?null:v.jsxs(b.Fragment,{children:[m,g&&fr.createPortal(s,g)]})}),v3=b.forwardRef(function(t,i){const{keepMounted:s=!1,...o}=t;return Xu().useState("mounted")||s?v.jsx(WC.Provider,{value:s,children:v.jsx(y3,{ref:i,...o})}):null}),eT=b.createContext(void 0);function tT(){const e=b.useContext(eT);if(e===void 0)throw new Error(gn(71));return e}function b3(e){const{nodeId:t,externalTree:i,rootContext:s}=e,o=s.useState("referenceElement"),c=s.useState("floatingElement"),u=s.useState("domReferenceElement"),d=s.useState("open"),f=s.useState("floatingId"),[g,m]=b.useState(null),h=b.useRef(null),x=Ga(i),S=b.useMemo(()=>({reference:o,floating:c,domReference:u}),[o,c,u]),w=t3({...e,elements:{...S,...g&&{reference:g}}}),C=b.useCallback(O=>{const A=ln(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),getClientRects:()=>O.getClientRects(),contextElement:O}:O;m(A),w.refs.setReference(A)},[w.refs]),E=b.useMemo(()=>({...w.refs,setPositionReference:C,domReference:h}),[w.refs,C]),R=b.useMemo(()=>({...w.elements,domReference:u}),[w.elements,u]),k=b.useMemo(()=>({...w,dataRef:s.context.dataRef,open:d,onOpenChange:s.setOpen,events:s.context.events,floatingId:f,refs:E,elements:R,nodeId:t,rootStore:s}),[w,E,R,t,s,d,f]);return _e(()=>{u&&(h.current=u)},[u]),_e(()=>{s.context.dataRef.current.floatingContext=k;const O=x?.nodesRef.current.find(A=>A.id===t);O&&(O.context=k)}),b.useMemo(()=>({...w,context:k,refs:E,elements:R,rootStore:s}),[w,E,R,k,s])}const x3=b.createContext(void 0);function qp(){return b.useContext(x3)?.direction??"ltr"}const S3=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:s,placement:o,rects:c,platform:u,elements:d,middlewareData:f}=t,{element:g,padding:m=0}=Ba(e,t)||{};if(g==null)return{};const h=rC(m),x={x:i,y:s},S=jv(o),w=Dv(S),C=await u.getDimensions(g),E=S==="y",R=E?"top":"left",k=E?"bottom":"right",O=E?"clientHeight":"clientWidth",A=c.reference[w]+c.reference[S]-x[S]-c.floating[w],N=x[S]-c.reference[S],j=d.floating[O]||c.floating[w],D=A/2-N/2,M=j/2-C[w]/2-1,_=Math.min(h[R],M),L=Math.min(h[k],M),q=_,X=j-C[w]-L,B=j/2-C[w]/2+D,H=nC(q,B,X),U=!f.arrow&&vs(o)!=null&&B!==H&&c.reference[w]/2-(B<q?_:L)-C[w]/2<0,z=U?B<q?B-q:B-X:0;return{[S]:x[S]+z,data:{[S]:H,centerOffset:B-H-z,...U&&{alignmentOffset:z}},reset:U}}}),w3=(e,t)=>{const{name:i,fn:s}=S3(e);return{name:i,fn:s,options:[e,t]}},E3={name:"hide",async fn(e){const{width:t,height:i,x:s,y:o}=e.rects.reference,c=t===0&&i===0&&s===0&&o===0,u=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:u.top-i>=0||u.right-t>=0||u.bottom-i>=0||u.left-t>=0||c}}}},R3={sideX:"left",sideY:"top"},C3="--available-width",T3="--available-height",k3="--anchor-width",O3="--anchor-height",A3="--transform-origin",$w=C3,Qw=T3;function nT(e,t,i){const s=e==="inline-start"||e==="inline-end";return{top:"top",right:s?i?"inline-start":"inline-end":"right",bottom:"bottom",left:s?i?"inline-end":"inline-start":"left"}[t]}function Xw(e,t,i){const{rects:s,placement:o}=e;return{side:nT(t,gi(o),i),align:vs(o)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function Yp(e){return M3(e,b3)}function M3(e,t){const{anchor:i,positionMethod:s="absolute",side:o="bottom",sideOffset:c=0,align:u="center",alignOffset:d=0,collisionBoundary:f,collisionPadding:g=5,sticky:m=!1,arrowPadding:h=5,disableAnchorTracking:x=!1,inline:S,keepMounted:w=!1,floatingRootContext:C,mounted:E,collisionAvoidance:R,shift:k,nodeId:O,adaptiveOrigin:A,lazyFlip:N=!1,externalTree:j}=e,D=R.side||"flip",M=R.align||"flip",_=R.fallbackAxisSide||"end",L=k?.crossAxis??!1,q=k?.rootBoundary,X=typeof i=="function"?i:void 0,B=Be(X),H=X?B:i,U=Ln(i),z=Ln(E),$=qp()==="rtl",[K,Y]=b.useState(null);!E&&K!==null&&Y(null);const ee=N==="placement",G=K?gi(K):null,oe=K&&ee?vs(K)||"center":null,I=G||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":$?"left":"right","inline-start":$?"right":"left"}[o],V=oe||u,W=V==="center"?I:`${I}-${V}`;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 Ee=1,le=o==="bottom"?Ee:0,me=o==="top"?Ee:0,ge=o==="right"?Ee:0,ue=o==="left"?Ee:0,Te={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:re},ve=b.useRef(null),Pe=Ln(c),Oe=Ln(d),Le=typeof c!="function"?c:0,Ve=typeof d!="function"?d:0,ke=[];S&&ke.push(S),ke.push(n3(je=>{const st=Xw(je,o,$),Ie=typeof Pe.current=="function"?Pe.current(st):Pe.current,ze=typeof Oe.current=="function"?Oe.current(st):Oe.current;return{mainAxis:Ie,crossAxis:ze,alignmentAxis:ze}},[Le,Ve,$,o]));const Ue=M==="none"&&D!=="shift",be=!Ue&&(m||L||D==="shift"),He=D==="none"?null:s3({...Te,padding:{top:re.top+Ee+le,right:re.right+Ee+ue,bottom:re.bottom+Ee+me,left:re.left+Ee+ge},mainAxis:!L&&D==="flip",crossAxis:M==="flip"?"alignment":!1,fallbackAxisSideDirection:_}),Ze=Ue?null:r3({...Te,rootBoundary:q,mainAxis:M!=="none",crossAxis:be,limiter:m||L?void 0:i3(je=>{if(!ve.current)return{};const{width:st,height:Ie}=ve.current.getBoundingClientRect(),ze=ji(gi(je.placement)),$e=ze==="y"?st:Ie,et=ze==="y"?re.left+re.right:re.top+re.bottom;return{offset:$e/2+et/2}})},[Te,m,L,q,re,M]);D==="shift"||M==="shift"||V==="center"?ke.push(Ze,He):ke.push(He,Ze),ke.push(a3({...Te,apply({elements:{floating:je},availableWidth:st,availableHeight:Ie,rects:ze}){if(!z.current)return;const $e=je.style;$e.setProperty($w,`${st}px`),$e.setProperty(Qw,`${Ie}px`);const et=Rn(je).devicePixelRatio||1,{x:Tt,y:F,width:J,height:ne}=ze.reference,ye=(Math.round((Tt+J)*et)-Math.round(Tt*et))/et,xe=(Math.round((F+ne)*et)-Math.round(F*et))/et;$e.setProperty(k3,`${ye}px`),$e.setProperty(O3,`${xe}px`)}}),w3(je=>({element:ve.current||$t(je.elements.floating).createElement("div"),padding:ve.current?h:0}),[h]),{name:"transformOrigin",fn(je){const{elements:{floating:st},middlewareData:Ie,placement:ze,platform:$e,rects:et,y:Tt}=je,F=gi(ze),J=vs(ze),ne=ji(F)==="y",ye=ve.current,xe=typeof c=="function"?c(Xw(je,o,$)):c;let qe;if(!ye&&J&&Math.abs(ne?Ie.shift?.x||0:Ie.shift?.y||0)<=1)qe=J==="start"===(ne&&$e.isRTL?.(st)===!0)?"100%":"0%";else{const Xe=ne?Ie.arrow?.x||0:Ie.arrow?.y||0,Qe=ne?ye?.clientWidth||0:ye?.clientHeight||0;qe=`${Xe+Qe/2}px`}let Ke=F==="top"||F==="left"?`calc(100% + ${xe}px)`:`${-xe}px`;return be&&ne&&Math.abs(Ie.shift?.y||0)>xe&&(Ke=`${et.reference.y+et.reference.height/2-Tt}px`),st.style.setProperty(A3,ne?`${qe} ${Ke}`:`${Ke} ${qe}`),{}}},E3,A),_e(()=>{!E&&C&&C.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[E,C]);const ot=b.useMemo(()=>({ancestorScroll:!x,elementResize:!x&&typeof ResizeObserver<"u",layoutShift:!x&&typeof IntersectionObserver<"u"}),[x]),{refs:de,elements:we,x:Ge,y:Me,middlewareData:De,update:bt,placement:dt,context:pt,isPositioned:Nt,floatingStyles:jt}=t({rootContext:C,open:w?E:void 0,placement:W,middleware:ke,strategy:s,whileElementsMounted:w?void 0:(...je)=>Kw(...je,ot),nodeId:O,externalTree:j}),{sideX:tn,sideY:an}=De.adaptiveOrigin||R3,nn=Nt?s:"fixed",We=b.useMemo(()=>{let je;return Nt?A?je={position:nn,[tn]:Ge,[an]:Me}:je={...jt,position:nn}:je={position:nn,top:0,left:0},je[$w]="100vw",je[Qw]="100vh",Nt||(je.opacity=0),je},[A,nn,tn,Ge,an,Me,jt,Nt]),wt=b.useRef(null);_e(()=>{if(!E)return;const je=U.current,st=typeof je=="function"?je():je,ze=(Zw(st)?st.current:st)||null||null;ze!==wt.current&&(de.setPositionReference(ze),wt.current=ze)},[E,de,H,U]),b.useEffect(()=>{if(!E)return;const je=U.current;typeof je!="function"&&Zw(je)&&je.current!==wt.current&&(de.setPositionReference(je.current),wt.current=je.current)},[E,de,H,U]),b.useEffect(()=>{if(w&&E&&we.reference&&we.floating)return Kw(we.reference,we.floating,bt,ot)},[w,E,we,bt,ot]);const Zt=gi(dt),ht=nT(o,Zt,$),xt=vs(dt)||"center",yt=!!De.hide?.referenceHidden;_e(()=>{N&&E&&Nt&&(Zt!==I||ee&&xt!==V)&&Y(dt)},[N,ee,E,Nt,dt,Zt,xt,I,V]);const Ut=b.useMemo(()=>({position:"absolute",top:De.arrow?.y,left:De.arrow?.x}),[De.arrow]),un=De.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:We,arrowStyles:Ut,arrowRef:ve,arrowUncentered:un,side:ht,align:xt,physicalSide:Zt,anchorHidden:yt,refs:de,context:pt,isPositioned:Nt,update:bt}),[We,Ut,ve,un,ht,xt,Zt,yt,de,pt,Nt,bt])}function Zw(e){return e!=null&&"current"in e}function ad(e){return e==="starting"?Gj:Xt}function Gp(e,t,{styles:i,transitionStatus:s,props:o,refs:c,hidden:u,inert:d=!1}){const f={...i};return d&&(f.pointerEvents="none"),kt("div",e,{state:t,ref:c,props:[{role:"presentation",hidden:u,style:f},ad(s),o],stateAttributesMapping:Ju})}const N3=b.forwardRef(function(t,i){const{render:s,className:o,anchor:c,positionMethod:u="absolute",side:d="top",align:f="center",sideOffset:g=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:x=5,arrowPadding:S=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:E=Uv,style:R,...k}=t,O=Xu(),A=m3(),N=O.useState("open"),j=O.useState("mounted"),D=O.useState("trackCursorAxis"),M=O.useState("disableHoverablePopup"),_=O.useState("floatingRootContext"),L=O.useState("instantType"),q=O.useState("transitionStatus"),X=O.useState("adaptiveOrigin"),B=Yp({anchor:c,positionMethod:u,floatingRootContext:_,mounted:j,side:d,sideOffset:g,align:f,alignOffset:m,collisionBoundary:h,collisionPadding:x,sticky:w,arrowPadding:S,disableAnchorTracking:C,keepMounted:A,collisionAvoidance:E,adaptiveOrigin:X}),H=b.useMemo(()=>({open:N,side:B.side,align:B.align,anchorHidden:B.anchorHidden,instant:D!=="none"?"tracking-cursor":L}),[N,B.side,B.align,B.anchorHidden,D,L]),U=Gp(t,H,{styles:B.positionerStyles,transitionStatus:q,props:k,refs:[i,O.useStateSetter("positionerElement")],hidden:!j,inert:!N||D==="both"||M});return v.jsx(eT.Provider,{value:B,children:U})}),D3=b.forwardRef(function(t,i){const{render:s,className:o,style:c,...u}=t,d=Xu(),{side:f,align:g}=tT(),m=d.useState("open"),h=d.useState("instantType"),x=d.useState("transitionStatus"),S=d.useState("popupProps"),w=d.useState("floatingRootContext"),C=d.useState("disabled"),E=d.useState("closeDelay");Li({open:m,ref:d.context.popupRef,onComplete(){m&&d.context.onOpenChangeComplete?.(!0)}}),Yv(w,{enabled:!C,closeDelay:E});const R=d.useStateSetter("popupElement");return kt("div",t,{state:{open:m,side:f,align:g,instant:h,transitionStatus:x},ref:[i,d.context.popupRef,R],props:[id,S,ad(x),u],stateAttributesMapping:Ep})}),j3=b.forwardRef(function(t,i){const{render:s,className:o,style:c,...u}=t,d=Xu(),{arrowRef:f,side:g,align:m,arrowUncentered:h,arrowStyles:x}=tT(),S=d.useState("open"),w=d.useState("instantType");return kt("div",t,{state:{open:S,side:g,align:m,uncentered:h,instant:w},ref:[i,f],props:[{style:x,"aria-hidden":!0},u],stateAttributesMapping:Ju})}),I3=function(t){const{delay:i,closeDelay:s,timeout:o=400}=t,c=b.useMemo(()=>({open:i,close:s}),[i,s]);return v.jsx(JC.Provider,{value:i,children:v.jsx(sj,{delay:c,timeoutMs:o,children:t.children})})};function $p(e){return Lv(19)?e:e?"true":void 0}function P3(e){const[t,i]=b.useState({current:e,previous:null});return Object.is(e,t.current)||i({current:e,previous:t.current}),t.previous}const rT=48,Es=(e,t=0)=>{const i=new Int32Array(e.length);for(let s=0;s<e.length;s++)i[s]=e.charCodeAt(s)-rT-t;return i},Qp=e=>{const t=new Int32Array(e.length+1);for(let i=0;i<e.length;i++)t[i+1]=t[i]+e[i];return t},Ka=e=>{const t=new Int32Array(e.length);let i=0;for(let s=0;s<e.length;s++){const o=e.charCodeAt(s)-rT;i+=o>>>1^-(o&1),t[s]=i}return t},L3=384,z3=[],Co=Qp(Es("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),_3=Qp(Es(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),U3="@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",H3=(()=>{const e=Co.length-1,t=new Int32Array(e);for(let o=e-1;o>=0;o--){let c=1,u=o+1;for(let d=Co[o];d<Co[o+1];d++)c+=t[u],u+=t[u];t[o]=c}const i=new Int32Array(Co[e]);let s=0;for(let o=0;o<e;o++){let c=o+1;for(let u=Co[o];u<Co[o+1];u++)i[s++]=c,c+=t[c]}return i})(),F3=Es("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),B3=Qp(Es("123333359346463635126536711576")),V3=Es("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),K3=Es("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),q3=Ka("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),Y3=(()=>{const e=new Int32Array(319).fill(-1),t=Ka("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),i=Ka("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let s=0;s<t.length;s++)e[t[s]]=i[s];return e})(),G3="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 t=e.split(" "),i=t.shift();for(let s=0;s<t.length;s++)t[s]=i+t[s];return t}),Jw=Ka("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),$3=Ka("ɠ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"),Q3=Ka("02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}€22ƒ†…:22z22222222222G000q†OVI00000{˜2™<40000Œ›@00000G¦§000ª00000000000000021K¬«00®“000000000000000000000–222›HGH_1¸222½2¾2222ÇÊ000­°2±"),iT=new Int32Array(987),sT=new Int32Array(987),aT=new Int32Array(987);let _y="";const Uy=new Int32Array(1022);{const e=new Map;let t=0,i=0;for(let s=0;s<Jw.length;s++)for(const o of G3[Q3[s]]){let c=e.get(o);c===void 0&&(c=t++,e.set(o,c),Uy[c*2]=_y.length,Uy[c*2+1]=o.length,_y+=o),iT[i]=Jw[s],sT[i]=$3[s],aT[i]=c,i++}}const X3=Ka("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),Z3=Qp(Es("1::24444432:442:44:44>222222:44:4421322511111311111114")),J3=Ka("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"),W3=Es("ij"),eP=Es("—"),tP=Es("1"),nP="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var rP={GROUP_COUNT:L3,customValidatorNames:z3,edgeStart:Co,labelStart:_3,labelText:U3,edgeTarget:H3,nodeGroup:F3,nodeVlist:Y3,vlistPat:B3,vlistOps:V3,vlistRef:K3,vlistGroup:q3,litAnchor:iT,litGroup:sT,litPool:aT,poolOffsets:Uy,poolText:_y,adjGid:X3,adjStart:Z3,adjTgt:J3,patGid:W3,patTgt:eP,postfixLookupGroups:tP,orderSensitiveModifiers:nP};const iP="line"in new Error,ds=-1,Ro=-1,ay=(e,t,i)=>{let s=2166136261;for(let o=t;o<i;o++)s=Math.imul(s^e.charCodeAt(o),16777619);return s},Rh=(e,t,i)=>{const s=i-t;let o=Math.imul(s,2654435761)^e.charCodeAt(t);if(s>3){const c=s>>2,u=s>>1;o=Math.imul(o^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+c),2246822507),o=Math.imul(o^e.charCodeAt(t+u)<<8^e.charCodeAt(t+u+c)<<16^e.charCodeAt(i-3),3266489909),o^=e.charCodeAt(i-2)<<8^e.charCodeAt(i-1)<<16;for(let d=t+3,f=i-4;d<t+8&&d<f;d++,f--)o=Math.imul(o^e.charCodeAt(d)^e.charCodeAt(f)<<8,16777619)}return o^o>>>15|0},sP=(e,t,i={})=>{const{GROUP_COUNT:s,edgeStart:o,labelStart:c,labelText:u,edgeTarget:d,nodeGroup:f,nodeVlist:g,vlistPat:m,vlistOps:h,vlistRef:x,vlistGroup:S,litAnchor:w,litGroup:C,litPool:E,poolOffsets:R,poolText:k,adjGid:O,adjStart:A,adjTgt:N,patGid:j,patTgt:D,postfixLookupGroups:M,customValidatorNames:_,orderSensitiveModifiers:L}=e,q=new Int32Array(s).fill(-1);for(let he=0;he<O.length;he++)q[O[he]]=he;let X=0;for(let he=0;he+1<A.length;he++){const Ae=A[he+1]-A[he];Ae>X&&(X=Ae)}let B=32;for(;B<2*(1+X+j.length);)B<<=1;const H=new Int32Array(x.length+1);for(let he=0;he<x.length;he++)H[he+1]=H[he]+m[x[he]+1]-m[x[he]];const U=new Uint8Array(s);for(let he=0;he<M.length;he++)U[M[he]]=1;const z=o.length-1,Q=new Uint8Array(z);let $=0,K=!0;for(let he=0;he<w.length;he++){Q[w[he]]=1;const Ae=R[E[he]*2+1];Ae>$&&($=Ae);const Se=k.charCodeAt(R[E[he]*2]);(Se===91||Se===40)&&(K=!1)}let Y=1;for(;Y<w.length*2;)Y<<=1;const ee=new Int32Array(Y).fill(-1);for(let he=0;he<w.length;he++){const Ae=R[E[he]*2];let Se=(ay(k,Ae,Ae+R[E[he]*2+1])^Math.imul(w[he],2654435761)|0)&Y-1;for(;ee[Se]!==-1;)Se=Se+1&Y-1;ee[Se]=he}const G=(he,Ae,Se,nt)=>{let Ot=(ay(Ae,Se,nt)^Math.imul(he,2654435761)|0)&Y-1;const Rt=nt-Se;for(;;){const Ht=ee[Ot];if(Ht===-1)return-1;if(w[Ht]===he&&R[E[Ht]*2+1]===Rt){const xn=R[E[Ht]*2];let hn=!0;for(let vt=0;vt<Rt;vt++)if(k.charCodeAt(xn+vt)!==Ae.charCodeAt(Se+vt)){hn=!1;break}if(hn)return C[Ht]}Ot=Ot+1&Y-1}},oe=i.cacheSize??8192,I=i.prefix??e.prefix??"",V=I===""?"":I+":",W=V.length,re=(_??[]).map(he=>{throw new Error("cn: missing validator "+he)}),Ee=/\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 ue=0,Te=-1,ve=-1,Pe=-1,Oe=-1;const Le=he=>he>=97&&he<=122||he>=65&&he<=90||he>=48&&he<=57||he===95,Ve=he=>/\s/.test(String.fromCharCode(he)),ke=(he,Ae,Se)=>{if(ue=0,Te=-1,Se-Ae<3)return;const nt=he.charCodeAt(Ae),Ot=he.charCodeAt(Se-1);if(nt===91&&Ot===93)ue=1;else if(nt===40&&Ot===41)ue=2;else return;Pe=Ae+1,Oe=Se-1;let Rt=Ae+1;if(Le(he.charCodeAt(Rt))){for(Rt++;Rt<Se-1;){const Ht=he.charCodeAt(Rt);if(!Le(Ht)&&Ht!==45)break;Rt++}Rt<Se-2&&he.charCodeAt(Rt)===58&&(Te=Ae+1,ve=Rt,Pe=Rt+1)}},Ue=(he,Ae,Se,nt)=>{if(Se-Ae!==nt.length)return!1;for(let Ot=0;Ot<nt.length;Ot++)if(he.charCodeAt(Ae+Ot)!==nt.charCodeAt(Ot))return!1;return!0},be=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,He=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ze=he=>!!he&&!Number.isNaN(Number(he)),ot=(he,Ae,Se)=>{if(Se-Ae<11||!Ue(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&&Ue(he,Ae+10,Ae+16,"-size/")||nt===110&&Se-Ae>=19&&Ue(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(" ")),Ge=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Me=(he,Ae,Se,nt)=>{if(he>=10){if(he>=25)return re[he-25](Ae.slice(Se,nt));const Ot=he-10;if(ue!==de[Ot])return!1;if(Te>=0){for(const Rt of we[Ot])if(Ue(Ae,Te,ve,Rt))return!0;return!1}switch(Ge[Ot]){case 0:return!1;case 1:return!0;case 2:{const Rt=Ae.slice(Pe,Oe);return Ee.test(Rt)&&!le.test(Rt)}case 3:return Ze(Ae.slice(Pe,Oe));case 4:return ge.test(Ae.slice(Pe,Oe));default:return me.test(Ae.slice(Pe,Oe))}}switch(he){case 0:return!0;case 1:return ue===0;case 2:return ue===1;case 3:return ue===2;case 4:return be.test(Ae.slice(Se,nt));case 5:return Ze(Ae.slice(Se,nt));case 6:{const Ot=Ae.slice(Se,nt);return!!Ot&&Number.isInteger(Number(Ot))}case 7:return nt>Se&&Ae.charCodeAt(nt-1)===37&&Ze(Ae.slice(Se,nt-1));case 8:return He.test(Ae.slice(Se,nt));default:return ot(Ae,Se,nt)}},De=new Set(typeof L=="string"?L.split(" "):L),bt=(he,Ae,Se,nt,Ot,Rt)=>{const Ht=ay(Ae,Se,nt)^(Ot?2654435769:0)|0;let xn=he.get(Ht);if(xn!==void 0)e:for(let Dt=0;Dt<xn.length;Dt++){const on=xn[Dt];if(!(on.imp!==Ot||on.k.length!==nt-Se)){for(let gt=0;gt<on.k.length;gt++)if(on.k.charCodeAt(gt)!==Ae.charCodeAt(Se+gt))continue e;return on.id}}else he.set(Ht,xn=[]);const hn=Ae.slice(Se,nt),vt=Rt(hn);return xn.push({k:hn,imp:Ot,id:vt}),vt};let dt=new Map,pt=new Map,Nt=2;const jt=4096,tn=(he,Ae)=>{const Se=[];let nt=0,Ot=0,Rt=0;for(let vt=0;vt<he.length;vt++){const Dt=he.charCodeAt(vt);nt===0&&Ot===0&&Dt===58?(Se.push(he.slice(Rt,vt)),Rt=vt+1):Dt===91?nt++:Dt===93?nt--:Dt===40?Ot++:Dt===41&&Ot--}Se.push(he.slice(Rt));let Ht=Se[0];if(Se.length>1){const vt=[];let Dt=[];for(const on of Se)on.charCodeAt(0)===91||De.has(on)?(Dt.length&&(vt.push(...Dt.sort()),Dt=[]),vt.push(on)):Dt.push(on);Dt.length&&vt.push(...Dt.sort()),Ht=vt.join(":")}const xn=Ae?Ht+" !":Ht;let hn=pt.get(xn);return hn===void 0&&pt.set(xn,hn=Nt++),hn};let an=new Map,nn=s;const We=s+4096,wt=()=>nn++,Zt=2097152,ht=8192,xt=new Int32Array(ht),yt=new Array(ht).fill(null),Ut=new Int32Array(ht),un=new Int32Array(ht),je=new Uint8Array(ht);let st=0;const Ie=(he,Ae,Se,nt,Ot,Rt,Ht,xn)=>{let hn=he;if(yt[he]!==null)if(yt[he|1]===null)hn=he|1;else if((st++&3)===0)hn=he|st>>2&1;else return;yt[hn]=Ae.slice(Se,nt),xt[hn]=Ot,Ut[hn]=Rt,un[hn]=Ht,je[hn]=xn},ze=()=>yt.fill(null);let $e=256,et=[new Int32Array($e),new Int32Array($e),new Int32Array($e),new Int32Array($e)],[Tt,F,J,ne]=et,ye=new Uint8Array($e),xe=new Uint8Array($e);const qe=()=>{$e*=2,et=et.map(Ae=>{const Se=new Int32Array($e);return Se.set(Ae),Se}),[Tt,F,J,ne]=et;const he=new Uint8Array($e);he.set(ye),ye=he,xe=new Uint8Array($e)};let Ke=64,Xe=new Int32Array(Ke),Qe=new Int32Array(Ke);const lt=new Int32Array(s);let tt=2048,Et=21,ft=new Float64Array(tt),Kt=new Int32Array(tt),Ft=0;const On=(he,Ae)=>{if(he===0&&Ae<s)return lt[Ae]===Ft?1:(lt[Ae]=Ft,0);const Se=he*2097152+Ae+1;let nt=Math.imul(Se,2654435761)>>>Et;for(;Kt[nt]===Ft;){if(ft[nt]===Se)return 1;nt=nt+1&tt-1}return ft[nt]=Se,Kt[nt]=Ft,0},qt=(he,Ae,Se,nt,Ot)=>{if(Se-Ae>=2&&he.charCodeAt(Ae)===91&&he.charCodeAt(Se-1)===93){let Rt=-1;for(let Ht=Ae+1;Ht<Se-1;Ht++)if(he.charCodeAt(Ht)===58){Rt=Ht;break}return Rt===-1||Rt===Ae+1?ds:bt(an,he,Ae+1,Rt,0,wt)}if(nt>=0&&f[nt]>=0)return f[nt];for(let Rt=Ot-1;Rt>=0;Rt--){const Ht=Qe[Rt];if(Ht>Se)continue;const xn=Xe[Rt],hn=Se-Ht;if(Q[xn]===1&&hn>0&&hn<=$){const zn=he.charCodeAt(Ht);if(K===!1||zn!==91&&zn!==40){const ri=G(xn,he,Ht,Se);if(ri>=0)return ri}}const vt=g[xn];if(vt<0)continue;const Dt=x[vt],on=m[Dt],gt=m[Dt+1];if(on===gt)continue;ke(he,Ht,Se);const nr=H[vt]-on;for(let zn=on;zn<gt;zn++)if(Me(h[zn],he,Ht,Se))return S[nr+zn]}return ds},Bt=he=>{const Ae=he.length;let Se=0,nt=0,Ot=!1;(Nt>jt||dt.size>jt)&&(dt=new Map,pt=new Map,Nt=2,ze()),nn>We&&(an=new Map,nn=s,ze());let Rt=0;for(;Rt<Ae;){let vt=he.charCodeAt(Rt);if(vt===32||vt>=9&&vt<=13||vt>=160&&Ve(vt)){vt!==32&&(Ot=!0),Rt++;continue}const Dt=Rt;let on=0;for(;Rt<Ae;){if(vt=he.charCodeAt(Rt),vt<=32){if(vt===32)break;if(vt>=9&&vt<=13){Ot=!0;break}}else if(vt>=160&&Ve(vt)){Ot=!0;break}on=Math.imul(on^vt,16777619),Rt++}const gt=Rt,nr=gt-Dt;Se===$e&&qe();const zn=Se++;Tt[zn]=Dt,F[zn]=gt,nt+=nr,on^=Math.imul(nr,2654435761);const ri=on^on>>>15|0,Gn=ri&8190;{let rn=-1;if(xt[Gn]===ri&&yt[Gn]!==null&&yt[Gn].length===nr?rn=Gn:xt[Gn|1]===ri&&yt[Gn|1]!==null&&yt[Gn|1].length===nr&&(rn=Gn|1),rn>=0){const or=yt[rn];let Si=!0;for(let ai=0;ai<nr;ai++)if(or.charCodeAt(ai)!==he.charCodeAt(Dt+ai)){Si=!1;break}if(Si){J[zn]=Ut[rn],ne[zn]=un[rn],ye[zn]=je[rn];continue}}}let $n=Dt;if(W!==0){if(gt-Dt<=W||!he.startsWith(V,Dt)){J[zn]=ds,Ie(Gn,he,Dt,gt,ri,ds,0,0);continue}$n=Dt+W}let Go=0,bc=0,As=-1,$o=-1;for(let rn=$n;rn<gt;rn++){const or=he.charCodeAt(rn);if(Go===0&&bc===0){if(or===58){As=rn;continue}if(or===47){$o=rn;continue}}or===91?Go++:or===93?Go--:or===40?bc++:or===41&&bc--}const Od=As>=$n?As+1:$n;let Dn=Od,Cr=gt,ia=!1,Qo=0;Cr>Dn&&he.charCodeAt(Cr-1)===33?(ia=!0,Cr--):Cr>Dn&&he.charCodeAt(Dn)===33&&(ia=!0,Dn++,Qo=1);let Kr=-1;$o>Od&&(Kr=$o+Qo,Kr>=Cr&&(Kr=-1));let Xo=Dn;Cr-Dn>1&&he.charCodeAt(Dn)===45&&(Xo=Dn+1);let ii=0,jr=0,sa=0,xc=-1,si=0;(g[0]>=0||Q[0]===1)&&(Xe[0]=0,Qe[0]=Xo,si=1);let Za=Ro,Sc=0;for(let rn=Xo;rn<Cr;rn++)if(rn===Kr&&(Za=jr<sa?Ro:ii,Sc=si),ii!==Ro){const or=he.charCodeAt(rn);let Si=-1;if(jr<sa)u.charCodeAt(jr)===or?(jr++,jr===sa&&(Si=ii=xc)):ii=Ro;else{const ai=o[ii],eo=o[ii+1];let Ms=Ro;for(let mr=ai;mr<eo;mr++){const to=c[mr];if(u.charCodeAt(to)===or){c[mr+1]-to===1?Si=Ms=d[mr]:(jr=to+1,sa=c[mr+1],xc=d[mr],Ms=ii);break}}ii=Ms}if(Si>=0&&(g[Si]>=0||Q[Si]===1)&&rn+1<Cr&&he.charCodeAt(rn+1)===45){if(si===Ke){Ke*=2;const ai=new Int32Array(Ke);ai.set(Xe),Xe=ai;const eo=new Int32Array(Ke);eo.set(Qe),Qe=eo}Xe[si]=Si,Qe[si]=rn+2,si++}}Kr===Cr&&(Za=jr<sa?Ro:ii,Sc=si);const wc=jr<sa?Ro:ii;let gr,Ir=!1;if(Kr>=0)if(Ir=!0,gr=qt(he,Dn,Kr,Za,Sc),gr!==ds&&gr<s&&U[gr]){const rn=qt(he,Dn,Cr,wc,si);rn!==ds&&rn!==gr&&(gr=rn,Ir=!1)}else gr===ds&&(gr=qt(he,Dn,Cr,wc,si),Ir=!1);else gr=qt(he,Dn,Cr,wc,si);let Ja=0,Wa=0;gr===ds?J[zn]=ds:(Wa=Ir?1:0,Ja=$n>=As?ia?1:0:bt(dt,he,$n,As,ia?1:0,rn=>tn(rn,ia)),J[zn]=gr,ye[zn]=Wa,ne[zn]=Ja),Ie(Gn,he,Dt,gt,ri,gr,Ja,Wa)}if(Se===0)return"";if(Se===1)return Tt[0]===0&&F[0]===Ae?he:he.slice(Tt[0],F[0]);if(Se*B>tt){for(;Se*B>tt;)tt<<=1,Et--;ft=new Float64Array(tt),Kt=new Int32Array(tt)}if(Nt>=Zt||nn>=Zt)throw new Error("cn: too many distinct classes in one merge");Ft=Ft+1|0,Ft===0&&(lt.fill(0),Kt.fill(0),Ft=1);let Ht=!1;for(let vt=Se-1;vt>=0;vt--){const Dt=J[vt];if(Dt===ds){xe[vt]=1;continue}const on=ne[vt];if(On(on,Dt)===1){xe[vt]=0,Ht=!0;continue}if(xe[vt]=1,Dt<s){const gt=q[Dt];if(gt>=0)for(let nr=A[gt];nr<A[gt+1];nr++)On(on,N[nr]);if(ye[vt]&1)for(let nr=0;nr<j.length;nr++)j[nr]===Dt&&On(on,D[nr])}}if(!Ht&&!Ot&&Ae===nt+Se-1)return he;let xn="",hn=0;for(;hn<Se;){if(!xe[hn]){hn++;continue}const vt=Tt[hn];let Dt=F[hn],on=hn+1;for(;on<Se&&xe[on]&&Tt[on]===Dt+1&&he.charCodeAt(Dt)===32;)Dt=F[on],on++;xn.length>0&&(xn+=" "),xn+=he.slice(vt,Dt),hn=on}return xn},Cn=16384,Tn=new Int32Array(Cn*2);let ti=0,dn=1,fn=Object.create(null),An=Object.create(null),jn=new Map,Os=new Map,Dr=0,_i=0;const ni=()=>{ti^=Cn,dn=dn+1|0,_i=0},xi=he=>{let Ae=fn[he];if(Ae!==void 0)return Ae;const Se=Rh(he,0,he.length),nt=(Se&16383)+ti,Ot=Tn[nt]===(Se^dn)||Tn[nt^Cn]===(Se^dn-1);return Ot&&(Ae=An[he],Ae!==void 0)?(fn[he]=Ae,Ae):(Ae=Bt(he),Ot?(fn[he]=Ae,++Dr>oe&&(Dr=0,An=fn,fn=Object.create(null),ni())):(Tn[nt]=Se^dn,++_i>Cn&&ni()),Ae)},zt=he=>{let Ae=jn.get(he);if(Ae!==void 0)return Ae;const Se=Rh(he,0,he.length),nt=(Se&16383)+ti,Ot=Tn[nt]===(Se^dn)||Tn[nt^Cn]===(Se^dn-1);return Ot&&(Ae=Os.get(he),Ae!==void 0)?(jn.set(he,Ae),Ae):(Ae=Bt(he),Ot?(jn.set(he,Ae),++Dr>oe&&(Dr=0,Os=jn,jn=new Map,ni())):(Tn[nt]=Se^dn,++_i>Cn&&ni()),Ae)},qn=he=>{const Ae=Rh(he,0,he.length),Se=(Ae&16383)+ti;return Tn[Se]===(Ae^dn)||Tn[Se^Cn]===(Ae^dn-1)?!0:(Tn[Se]=Ae^dn,++_i>Cn&&ni(),!1)},Fn=oe===0?Bt:iP?he=>{const Ae=jn.get(he);return Ae!==void 0?Ae:zt(he)}:xi;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?Fn(arguments[0]):Fn(oP.apply(null,arguments))},mergeString:Fn,seenBefore:oe===0?()=>!1:qn,mergeUncached:Bt}},$h=(e,t)=>{if(!e)return"";if(typeof e=="string")return e;let i="";if(typeof e.length=="number"&&(!t||Array.isArray(e))){const s=e;for(let o=0;o<s.length;o++){const c=s[o];if(!c)continue;const u=typeof c=="string"?c:$h(c,t);u&&(i&&(i+=" "),i+=u)}return i}if(t){if(typeof e=="number")return""+e;if(typeof e=="object")for(const s in e)e[s]&&(i&&(i+=" "),i+=s)}return i},aP=(e,t)=>{let i="";for(let s=0;s<e.length;s++){const o=e[s];if(!o)continue;const c=typeof o=="string"?o:$h(o,t);c&&(i&&(i+=" "),i+=c)}return i},oP=function(){return aP(arguments,!1)},lP=256,Ww=16,cP=1024,oy=4096,uP=(e,t)=>{const i=t===void 0?()=>!0:t.seenBefore,s=t===void 0?e:t.mergeUncached;let o=new Map,c=new Map,u=0,d=null,f=null,g=[],m=[],h=0;const x=(R,k,O)=>{f===null&&(f=new Array(oy).fill(""),g=new Array(oy).fill(""),m=new Array(oy).fill(""));const A=Rh(R,0,R.length)&4094;if(f[A]===R&&g[A]===k)return m[A];if(f[A|1]===R&&g[A|1]===k)return m[A|1];const N=e(O?k+" "+R:R),j=f[A]===""?A:A|(f[A|1]===""?1:h++&1);return f[j]=R,g[j]=k,m[j]=N,N},S=(R,k,O,A)=>{let N=0;if(k){if(k!==R.a0)return!1;N=1}if(O){if(O!==(N===0?R.a0:R.a1))return!1;N++}if(A){if(A!==(N===0?R.a0:N===1?R.a1:R.a2))return!1;N++}return N===R.t},w=(R,k)=>{const O=R.a;let A=0;for(let N=0;N<k.length;N++){const j=k[N];if(j){if(j!==O[A])return!1;A++}}return A===R.t},C=(R,k)=>{const O=R.length,A=d===null?null:d.n;if(!k){if(A!==null&&w(A,R))return d=A,A.r;if(d!==null&&d!==A&&w(d,R))return d.r}let N="",j=-1,D=0,M=!1;for(let q=0;q<O;q++){let X=R[q];if(X){if(typeof X!="string"){if(X=R[q]=$h(X,!0),!X)continue;M=!0}j<0&&(N=X,j=q),D++}}if(D===0)return"";if(D===1)return e(N);if(M){if(A!==null&&w(A,R))return d=A,A.r;if(d!==null&&d!==A&&w(d,R))return d.r}let _=o.get(N);_===void 0&&(_=c.get(N),_!==void 0&&o.set(N,_));let L=null;if(_!==void 0){if(_.skip>0){_.skip--,d=null;let X=N;for(let B=j+1;B<O;B++){const H=R[B];H&&(X+=" "+H)}return x(X,"",!1)}const q=_.e;e:for(let X=0;X<q.length;X++){const B=q[X];if(B.t!==D)continue;const H=B.a;let U=1;for(let z=j+1;z<O;z++){const Q=R[z];if(Q&&Q!==H[U++])continue e}L=B;break}L!==null&&(_.miss=0)}if(L===null){let q=N;const X=[N];for(let H=j+1;H<O;H++){const U=R[H];U&&(q+=" "+U,X.push(U))}if(!i(q))return s(q);L={r:e(q),t:X.length,a0:X[0],a1:X[1],a2:X[2]??"",a:X,n:null},_===void 0?o.set(N,_={e:[],miss:0,skip:0,at:0}):++_.miss>Ww&&(_.miss=Ww,_.skip=cP,_.e.length=0,_.at=0);const B=_.e;B.length<lP?B.push(L):(B[_.at]=L,_.at=_.at+1&255),++u>1e3&&(u=0,c=o,o=new Map)}return d!==null&&d!==L&&(d.n=L),d=L,L.r},E=R=>Array.isArray(R)?C(R.slice(),!1):e($h(R,!0));return function(R,k,O){const A=arguments.length;if((A|1)===3){const D=d;if(D!==null){const M=D.n;if(M!==null&&S(M,R,k,O))return d=M,M.r;if(D!==M&&S(D,R,k,O))return D.r}if(A===2&&typeof k=="string"&&k!==""){const M=o.get(R);if(M!==void 0&&M.skip>0)return M.skip--,d=null,x(k,R,!0)}return C([R,k,O],!0)}if(A===1)return typeof R=="string"?e(R):E(R);const N=d;if(N!==null){const D=N.n;if(D!==null){const M=D.a;let _=0,L=!0;for(let q=0;q<A;q++){const X=arguments[q];if(X){if(X!==M[_]){L=!1;break}_++}}if(L&&_===D.t)return d=D,D.r}if(N!==D){const M=N.a;let _=0,L=!0;for(let q=0;q<A;q++){const X=arguments[q];if(X){if(X!==M[_]){L=!1;break}_++}}if(L&&_===N.t)return N.r}}const j=[];for(let D=0;D<A;D++)j.push(arguments[D]);return C(j,!0)}},eE=sP(rP),Fe=uP(eE.mergeString,eE);function dP({delay:e=0,...t}){return v.jsx(I3,{"data-slot":"tooltip-provider",delay:e,...t})}function Qh({...e}){return v.jsx(d3,{"data-slot":"tooltip",...e})}function Xh({...e}){return v.jsx(g3,{"data-slot":"tooltip-trigger",...e})}function Zh({className:e,side:t="top",sideOffset:i=4,align:s="center",alignOffset:o=0,children:c,...u}){return v.jsx(v3,{children:v.jsx(N3,{align:s,alignOffset:o,side:t,sideOffset:i,className:"isolate z-50",children:v.jsxs(D3,{"data-slot":"tooltip-content",className:Fe("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),...u,children:[c,v.jsx(j3,{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 fP=(e,t,i,s,o,c,u,d)=>{let f=document.documentElement,g=["light","dark"];function m(S){(Array.isArray(e)?e:[e]).forEach(w=>{let C=w==="class",E=C&&c?o.map(R=>c[R]||R):o;C?(f.classList.remove(...E),f.classList.add(c&&c[S]?c[S]:S)):f.setAttribute(w,S)}),h(S)}function h(S){d&&g.includes(S)&&(f.style.colorScheme=S)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)m(s);else try{let S=localStorage.getItem(t)||i,w=u&&S==="system"?x():S;m(w)}catch{}},hP=b.createContext(void 0),pP={setTheme:e=>{},themes:[]},gP=()=>{var e;return(e=b.useContext(hP))!=null?e:pP};b.memo(({forcedTheme:e,storageKey:t,attribute:i,enableSystem:s,enableColorScheme:o,defaultTheme:c,value:u,themes:d,nonce:f,scriptProps:g})=>{let m=JSON.stringify([i,t,c,e,d,u,s,o]).slice(1,-1);return b.createElement("script",{...g,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${fP.toString()})(${m})`}})});function mP(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}const yP=e=>{switch(e){case"success":return xP;case"info":return wP;case"warning":return SP;case"error":return EP;default:return null}},vP=Array(12).fill(0),bP=({visible:e,className:t})=>Ne.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ne.createElement("div",{className:"sonner-spinner"},vP.map((i,s)=>Ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),xP=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"})),SP=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"})),wP=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"})),EP=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"})),RP=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"})),CP=()=>{const[e,t]=Ne.useState(document.hidden);return Ne.useEffect(()=>{const i=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)},[]),e};let TP=1;const kP=100,tE=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:TP++};class OP{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(i=>t(i)),()=>{const i=this.subscribers.indexOf(t);this.subscribers.splice(i,1)}),this.publish=t=>{this.subscribers.forEach(i=>i(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-kP;t<=0||(this.toasts=this.toasts.filter(i=>t>0&&this.dismissedToasts.has(i.id)?(this.dismissedToasts.delete(i.id),t--,!1):!0))},this.create=t=>{const{message:i,...s}=t,o=tE(t),c=this.pendingDismissals.get(o);c!==void 0&&(cancelAnimationFrame(c),this.pendingDismissals.delete(o),this.dismissedToasts.delete(o));const u=this.dismissedToasts.has(o),d=t.dismissible===void 0?!0:t.dismissible;return u&&(this.dismissedToasts.delete(o),this.toasts=this.toasts.filter(g=>g.id!==o)),(u?void 0:this.toasts.find(g=>g.id===o))?this.toasts=this.toasts.map(g=>g.id===o?(this.publish({...g,...t,id:o,title:i}),{...g,...t,id:o,dismissible:d,title:i}):g):this.addToast({title:i,...s,dismissible:d,id:o}),o},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(s=>{this.dismissedToasts.add(s.id),this.subscribers.forEach(o=>o({id:s.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const i=this.pendingDismissals.get(t);return i!==void 0&&cancelAnimationFrame(i),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(s=>s({id:t,dismiss:!0}))})),t},this.message=(t,i)=>this.create({...i,message:t,type:void 0}),this.error=(t,i)=>this.create({...i,message:t,type:"error"}),this.success=(t,i)=>this.create({...i,type:"success",message:t}),this.info=(t,i)=>this.create({...i,type:"info",message:t}),this.warning=(t,i)=>this.create({...i,type:"warning",message:t}),this.loading=(t,i)=>this.create({...i,type:"loading",message:t}),this.promise=(t,i)=>{if(!i)return;let s;i.loading!==void 0&&(s=this.create({...i,promise:t,type:"loading",message:i.loading,description:typeof i.description!="function"?i.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let c=s!==void 0,u;const d=o.then(async g=>{if(u=["resolve",g],Ne.isValidElement(g))c=!1,this.create({id:s,type:"default",message:g});else if(MP(g)&&!g.ok){c=!1;const h=typeof i.error=="function"?await i.error(`HTTP error! status: ${g.status}`):i.error,x=typeof i.description=="function"?await i.description(`HTTP error! status: ${g.status}`):i.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:s,type:"error",description:x,...w})}else if(g instanceof Error){c=!1;const h=typeof i.error=="function"?await i.error(g):i.error,x=typeof i.description=="function"?await i.description(g):i.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:s,type:"error",description:x,...w})}else if(i.success!==void 0){c=!1;const h=typeof i.success=="function"?await i.success(g):i.success,x=typeof i.description=="function"?await i.description(g):i.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:s,type:"success",description:x,...w})}}).catch(async g=>{if(u=["reject",g],i.error!==void 0){c=!1;const m=typeof i.error=="function"?await i.error(g):i.error,h=typeof i.description=="function"?await i.description(g):i.description,S=typeof m=="object"&&!Ne.isValidElement(m)?m:{message:m};this.create({id:s,type:"error",description:h,...S})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),i.finally==null||i.finally.call(i)}),f=()=>new Promise((g,m)=>d.then(()=>u[0]==="reject"?m(u[1]):g(u[1])).catch(m));return typeof s!="string"&&typeof s!="number"?{unwrap:f}:Object.assign(s,{unwrap:f})},this.custom=(t,i)=>{const s=tE(i);return this.create({...i,jsx:t(s),id:s,type:void 0}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Xr=new OP,AP=(e,t)=>Xr.message(e,t),MP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",NP=AP,DP=()=>Xr.toasts,jP=()=>Xr.getActiveToasts(),Qt=Object.assign(NP,{success:Xr.success,info:Xr.info,warning:Xr.warning,error:Xr.error,custom:Xr.custom,message:Xr.message,promise:Xr.promise,dismiss:Xr.dismiss,loading:Xr.loading},{getHistory:DP,getToasts:jP});mP("[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 rh(e){return e.label!==void 0}const IP=3,PP="24px",LP="16px",nE=4e3,zP=356,_P=14,UP=45,HP=200;function fs(...e){return e.filter(Boolean).join(" ")}function FP(e){const[t,i]=e.split("-"),s=[];return t&&s.push(t),i&&s.push(i),s}const BP=e=>{var t,i,s,o,c,u,d,f,g;const{invert:m,toast:h,unstyled:x,interacting:S,setHeights:w,visibleToasts:C,heights:E,index:R,toasts:k,expanded:O,removeToast:A,defaultRichColors:N,closeButton:j,style:D,cancelButtonStyle:M,actionButtonStyle:_,className:L="",descriptionClassName:q="",duration:X,position:B,gap:H,expandByDefault:U,classNames:z,icons:Q,closeButtonAriaLabel:$="Close toast"}=e,[K,Y]=Ne.useState(null),[ee,G]=Ne.useState(null),[oe,I]=Ne.useState(!1),[V,W]=Ne.useState(!1),[re,Ee]=Ne.useState(!1),[le,me]=Ne.useState(!1),[ge,ue]=Ne.useState(!1),[Te,ve]=Ne.useState(0),[Pe,Oe]=Ne.useState(0),Le=Ne.useRef(h.duration||X||nE),Ve=Ne.useRef(null),ke=Ne.useRef(null),Ue=R===0,be=R+1<=C,He=h.type,Ze=He??"default",ot=h.dismissible!==!1,de=h.className||"",we=h.descriptionClassName||"",Ge=Ne.useMemo(()=>E.findIndex(je=>je.toastId===h.id)||0,[E,h.id]),Me=Ne.useMemo(()=>{var je;return(je=h.closeButton)!=null?je:j},[h.closeButton,j]),De=Ne.useMemo(()=>h.duration||X||nE,[h.duration,X]),bt=Ne.useRef(0),dt=Ne.useRef(0),pt=Ne.useRef(0),Nt=Ne.useRef(null),[jt,tn]=B.split("-"),an=Ne.useMemo(()=>E.reduce((je,st,Ie)=>Ie>=Ge?je:je+st.height,0),[E,Ge]),nn=CP(),We=Ne.useMemo(()=>{var je;return(je=e.swipeDirections)!=null?je:FP(B)},[e.swipeDirections,B]),wt=h.invert||m,Zt=He==="loading";dt.current=Ne.useMemo(()=>Ge*H+an,[Ge,an]),Ne.useEffect(()=>{Le.current=De},[De]),Ne.useEffect(()=>{I(!0)},[]),Ne.useEffect(()=>{const je=ke.current;if(je){const st=je.getBoundingClientRect().height;return Oe(st),w(Ie=>[{toastId:h.id,height:st,position:h.position},...Ie]),()=>w(Ie=>Ie.filter(ze=>ze.toastId!==h.id))}},[w,h.id]),Ne.useLayoutEffect(()=>{if(!oe)return;const je=ke.current,st=je.style.height;je.style.height="auto";const Ie=je.getBoundingClientRect().height;je.style.height=st,Oe(Ie),w(ze=>ze.find(et=>et.toastId===h.id)?ze.map(et=>et.toastId===h.id?{...et,height:Ie}:et):[{toastId:h.id,height:Ie,position:h.position},...ze])},[oe,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const ht=Ne.useCallback(()=>{W(!0),ve(dt.current),w(je=>je.filter(st=>st.toastId!==h.id)),setTimeout(()=>{A(h)},HP)},[h,A,w,dt]);Ne.useEffect(()=>{if(h.promise&&He==="loading"||h.duration===1/0||h.type==="loading")return;let je;return O||S||nn?(()=>{if(pt.current<bt.current){const ze=new Date().getTime()-bt.current;Le.current=Le.current-ze}pt.current=new Date().getTime()})():Le.current!==1/0&&(bt.current=new Date().getTime(),je=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),ht()},Le.current)),()=>clearTimeout(je)},[O,S,h,He,nn,ht]),Ne.useEffect(()=>{h.delete&&(ht(),h.onDismiss==null||h.onDismiss.call(h,h))},[ht,h.delete]);function xt(){var je;if(Q?.loading){var st;return Ne.createElement("div",{className:fs(z?.loader,h==null||(st=h.classNames)==null?void 0:st.loader,"sonner-loader"),"data-visible":He==="loading"},Q.loading)}return Ne.createElement(bP,{className:fs(z?.loader,h==null||(je=h.classNames)==null?void 0:je.loader),visible:He==="loading"})}const yt=h.icon||Q?.[He]||yP(He);var Ut,un;return Ne.createElement("li",{tabIndex:0,ref:ke,className:fs(L,de,z?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,z?.[Ze],h==null||(i=h.classNames)==null?void 0:i[Ze]),"data-sonner-toast":"","data-rich-colors":(Ut=h.richColors)!=null?Ut:N,"data-styled":!(h.jsx||h.unstyled||x),"data-mounted":oe,"data-promise":!!h.promise,"data-swiped":ge,"data-removed":V,"data-visible":be,"data-y-position":jt,"data-x-position":tn,"data-index":R,"data-front":Ue,"data-swiping":re,"data-dismissible":ot,"data-type":He,"data-invert":wt,"data-swipe-out":le,"data-swipe-direction":ee,"data-expanded":!!(O||U&&oe),"data-testid":h.testId,style:{"--index":R,"--toasts-before":R,"--z-index":k.length-R,"--offset":`${V?Te:dt.current}px`,"--initial-height":U?"auto":`${Pe}px`,...D,...h.style},onDragEnd:()=>{Ee(!1),Y(null),Nt.current=null},onPointerDown:je=>{je.button!==2&&(Zt||!ot||(Ve.current=new Date,ve(dt.current),je.target.setPointerCapture(je.pointerId),je.target.tagName!=="BUTTON"&&(Ee(!0),Nt.current={x:je.clientX,y:je.clientY})))},onPointerUp:()=>{var je,st,Ie;if(le||!ot)return;Nt.current=null;const ze=Number(((je=ke.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$e=Number(((st=ke.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),et=new Date().getTime()-((Ie=Ve.current)==null?void 0:Ie.getTime()),Tt=K==="x"?ze:$e,F=Math.abs(Tt)/et;if((K==="x"?We.includes(ze>0?"right":"left"):We.includes($e>0?"bottom":"top"))&&(Math.abs(Tt)>=UP||F>.11)){ve(dt.current),h.onDismiss==null||h.onDismiss.call(h,h),G(K==="x"?ze>0?"right":"left":$e>0?"down":"up"),ht(),me(!0);return}else{var ne,ye;(ne=ke.current)==null||ne.style.setProperty("--swipe-amount-x","0px"),(ye=ke.current)==null||ye.style.setProperty("--swipe-amount-y","0px")}ue(!1),Ee(!1),Y(null)},onPointerMove:je=>{var st,Ie,ze;if(!Nt.current||!ot||((st=window.getSelection())==null?void 0:st.toString().length)>0)return;const et=je.clientY-Nt.current.y,Tt=je.clientX-Nt.current.x;!K&&(Math.abs(Tt)>1||Math.abs(et)>1)&&Y(Math.abs(Tt)>Math.abs(et)?"x":"y");let F={x:0,y:0};const J=ne=>1/(1.5+Math.abs(ne)/20);if(K==="y"){if(We.includes("top")||We.includes("bottom"))if(We.includes("top")&&et<0||We.includes("bottom")&&et>0)F.y=et;else{const ne=et*J(et);F.y=Math.abs(ne)<Math.abs(et)?ne:et}}else if(K==="x"&&(We.includes("left")||We.includes("right")))if(We.includes("left")&&Tt<0||We.includes("right")&&Tt>0)F.x=Tt;else{const ne=Tt*J(Tt);F.x=Math.abs(ne)<Math.abs(Tt)?ne:Tt}(Math.abs(F.x)>0||Math.abs(F.y)>0)&&ue(!0),(Ie=ke.current)==null||Ie.style.setProperty("--swipe-amount-x",`${F.x}px`),(ze=ke.current)==null||ze.style.setProperty("--swipe-amount-y",`${F.y}px`)}},Me&&!h.jsx&&He!=="loading"?Ne.createElement("button",{"aria-label":$,"data-disabled":Zt,"data-close-button":!0,onClick:Zt||!ot?()=>{}:()=>{ht(),h.onDismiss==null||h.onDismiss.call(h,h)},className:fs(z?.closeButton,h==null||(s=h.classNames)==null?void 0:s.closeButton)},(un=Q?.close)!=null?un:RP):null,(He||h.icon||h.promise)&&h.icon!==null&&(Q?.[He]!==null||h.icon)?Ne.createElement("div",{"data-icon":"",className:fs(z?.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},He==="loading"?h.icon||xt():h.promise?xt():null,He!=="loading"?yt:null):null,Ne.createElement("div",{"data-content":"",className:fs(z?.content,h==null||(c=h.classNames)==null?void 0:c.content)},Ne.createElement("div",{"data-title":"",className:fs(z?.title,h==null||(u=h.classNames)==null?void 0:u.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Ne.createElement("div",{"data-description":"",className:fs(q,we,z?.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&&rh(h.cancel)?Ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||M,onClick:je=>{rh(h.cancel)&&ot&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,je),ht())},className:fs(z?.cancelButton,h==null||(f=h.classNames)==null?void 0:f.cancelButton)},h.cancel.label):null,Ne.isValidElement(h.action)?h.action:h.action&&rh(h.action)?Ne.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||_,onClick:je=>{rh(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,je),!je.defaultPrevented&&ht())},className:fs(z?.actionButton,h==null||(g=h.classNames)==null?void 0:g.actionButton)},h.action.label):null)};function rE(){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 VP(e,t){const i={};return[e,t].forEach((s,o)=>{const c=o===1,u=c?"--mobile-offset":"--offset",d=c?LP:PP;function f(g){["top","right","bottom","left"].forEach(m=>{i[`${u}-${m}`]=typeof g=="number"?`${g}px`:g})}typeof s=="number"||typeof s=="string"?f(s):typeof s=="object"?["top","right","bottom","left"].forEach(g=>{s[g]===void 0?i[`${u}-${g}`]=d:i[`${u}-${g}`]=typeof s[g]=="number"?`${s[g]}px`:s[g]}):f(d)}),i}const KP=Ne.forwardRef(function(t,i){const{id:s,invert:o,position:c="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:f,className:g,offset:m,mobileOffset:h,theme:x="light",richColors:S,duration:w,style:C,visibleToasts:E=IP,toastOptions:R,dir:k=rE(),gap:O=_P,icons:A,customAriaLabel:N,containerAriaLabel:j="Notifications"}=t,[D,M]=Ne.useState([]),_=Ne.useMemo(()=>s?D.filter(I=>I.toasterId===s):D.filter(I=>!I.toasterId),[D,s]),L=Ne.useMemo(()=>Array.from(new Set([c].concat(_.filter(I=>I.position).map(I=>I.position)))),[_,c]),[q,X]=Ne.useState([]),[B,H]=Ne.useState(!1),[U,z]=Ne.useState(!1),[Q,$]=Ne.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=Ne.useRef(null),Y=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=Ne.useRef(null),G=Ne.useRef(!1),oe=Ne.useCallback(I=>{M(V=>{var W;return(W=V.find(re=>re.id===I.id))!=null&&W.delete||Xr.dismiss(I.id),V.filter(({id:re})=>re!==I.id)})},[]);return Ne.useEffect(()=>Xr.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{M(V=>V.map(W=>W.id===I.id?{...W,delete:!0}:W))});return}setTimeout(()=>{Dj.flushSync(()=>{M(V=>{const W=V.findIndex(re=>re.id===I.id);return W!==-1?[...V.slice(0,W),{...V[W],...I},...V.slice(W+1)]:[I,...V]})})})}),[]),Ne.useEffect(()=>{if(x!=="system"){$(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:V})=>{$(V?"dark":"light")})}catch{I.addListener(({matches:W})=>{try{$(W?"dark":"light")}catch(re){console.error(re)}})}},[x]),Ne.useEffect(()=>{D.length<=1&&H(!1)},[D]),Ne.useEffect(()=>{const I=V=>{var W;if(u.length>0&&u.every(le=>V[le]||V.code===le)){var Ee;H(!0),(Ee=K.current)==null||Ee.focus()}V.code==="Escape"&&(document.activeElement===K.current||(W=K.current)!=null&&W.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[u]),Ne.useEffect(()=>{if(K.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,G.current=!1)}},[K.current]),Ne.createElement("section",{ref:i,"aria-label":N??`${j} ${Y}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},L.map((I,V)=>{var W;const[re,Ee]=I.split("-");return _.length?Ne.createElement("ol",{key:I,dir:k==="auto"?rE():k,tabIndex:-1,ref:K,className:g,"data-sonner-toaster":!0,"data-sonner-theme":Q,"data-y-position":re,"data-x-position":Ee,style:{"--front-toast-height":`${((W=q[0])==null?void 0:W.height)||0}px`,"--width":`${zP}px`,"--gap":`${O}px`,...C,...VP(m,h)},onBlur:le=>{G.current&&!le.currentTarget.contains(le.relatedTarget)&&(G.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G.current||(G.current=!0,ee.current=le.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{U||H(!1)},onDragEnd:()=>H(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},_.filter(le=>!le.position&&V===0||le.position===I).map((le,me)=>{var ge,ue;return Ne.createElement(BP,{key:le.id,icons:A,index:me,toast:le,defaultRichColors:S,duration:(ge=R?.duration)!=null?ge:w,className:R?.className,descriptionClassName:R?.descriptionClassName,invert:o,visibleToasts:E,closeButton:(ue=R?.closeButton)!=null?ue:f,interacting:U,position:I,style:R?.style,unstyled:R?.unstyled,classNames:R?.classNames,cancelButtonStyle:R?.cancelButtonStyle,actionButtonStyle:R?.actionButtonStyle,closeButtonAriaLabel:R?.closeButtonAriaLabel,removeToast:oe,toasts:_.filter(Te=>Te.position==le.position),heights:q.filter(Te=>Te.position==le.position),setHeights:X,expandByDefault:d,gap:O,expanded:B,swipeDirections:t.swipeDirections})})):null}))}),qP=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join("-").toLowerCase();function YP(e,t,i=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:qP(e),size:24,node:t,...i.length>0?{aliases:i}:{}}}const GP=e=>{let t="",i=!1;for(const s of e){if(s==="-"||s==="_"||s<=" "){i=t.length>0;continue}t.length===0?t+=s.toLowerCase():t+=i?s.toUpperCase():s,i=!1}return t},$P=e=>{const t=GP(e);return t.charAt(0).toUpperCase()+t.slice(1)},Hy=(...e)=>{const t=new Set;for(const i of e)if(typeof i=="string")for(const s of i.split(/\s+/))s&&t.add(s);return[...t].join(" ")},Dl={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 ly(e){return e!=null}function QP(e,t={}){const i=t.attributeNames??{},s=x=>i[x]??x,o=e.size??e.width??Dl.width,c=e.size??e.height??Dl.height,u=e.aliases?.filter(x=>typeof x=="string"&&x.trim()!=="").map(x=>`lucide-${x}`)??[],d=[...e.name?[`lucide-${e.name}`]:[],...u],f=t.className?.split(" ").filter(Boolean)??[],g=t.includeDefaultClasses===!1?Hy(...f):Hy("lucide",...d,...f);let m=t.strokeWidth??Dl["stroke-width"];if(t.absoluteStrokeWidth){const x=Number(m)*Number(e.size??e.width??Dl.width)/Number(t.size??t.width??Dl.width);Number.isFinite(x)&&(m=x)}return["svg",{...Object.entries(Dl).reduce((x,[S,w])=>(x[s(S)]=w,x),{}),..."color"in t&&t.color&&{[s("stroke")]:t.color},..."size"in t&&ly(t.size)&&{[s("width")]:t.size,[s("height")]:t.size},..."width"in t&&ly(t.width)&&{[s("width")]:t.width},..."height"in t&&ly(t.height)&&{[s("height")]:t.height},[s("stroke-width")]:m,...g&&{[s("class")]:g},[s("viewBox")]:`0 0 ${o} ${c}`,...t.hasA11yProp===!1?{[s("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(x=>{const[S,w,C]=x,E=t.nonScalingStroke?{[s("vector-effect")]:"non-scaling-stroke",...w}:w;return C?[S,E,C]:[S,E]})]}function XP(e,t={}){return QP(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const ZP=e=>{if(e==null||typeof e!="object")return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith("aria-")||t==="role"||t==="title")&&e[t]!=null)return!0;return!1},JP=b.createContext({}),WP=()=>b.useContext(JP),eL=b.forwardRef(({color:e,size:t,width:i,height:s,strokeWidth:o,absoluteStrokeWidth:c,nonScalingStroke:u,className:d="",children:f,iconNode:g=[],icon:m={node:g,aliases:[],size:24},...h},x)=>{const{size:S=24,strokeWidth:w=2,absoluteStrokeWidth:C=!1,nonScalingStroke:E=!1,color:R="currentColor",className:k=""}=WP()??{},O=!!f||ZP(h),[A,N,j=[]]=XP(m,{color:e??R,width:i??t??S,height:s??t??S,strokeWidth:o??w,absoluteStrokeWidth:c??C,nonScalingStroke:u??E,className:Hy(k,d),hasA11yProp:O,attributes:h});return b.createElement(A,{ref:x,...N},[...j.map(([D,M])=>b.createElement(D,M)),...Array.isArray(f)?f:[f]])});function Mt(e,t=[],i=[]){const s=typeof e=="string"?YP(e,t,i):e,o=b.forwardRef(({className:c,...u},d)=>b.createElement(eL,{ref:d,icon:s,className:c,...u}));return s.name&&(o.displayName=$P(s.name)),o}const oT={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};oT.node;const tL=Mt(oT),lT={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"}]]};lT.node;const cT=Mt(lT),uT={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};uT.node;const od=Mt(uT),dT={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};dT.node;const Xv=Mt(dT),fT={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};fT.node;const Zv=Mt(fT),hT={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};hT.node;const nL=Mt(hT),pT={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"]};pT.node;const gT=Mt(pT),mT={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"]};mT.node;const rL=Mt(mT),yT={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};yT.node;const iL=Mt(yT),vT={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"}]]};vT.node;const bT=Mt(vT),xT={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"}]]};xT.node;const Xp=Mt(xT),ST={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"]};ST.node;const Jv=Mt(ST),wT={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"}]]};wT.node;const sL=Mt(wT),ET={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"}]]};ET.node;const aL=Mt(ET),RT={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"}]]};RT.node;const CT=Mt(RT),TT={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"}]]};TT.node;const kT=Mt(TT),OT={name:"file-plus",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:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]};OT.node;const oL=Mt(OT),AT={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"}]]};AT.node;const Wv=Mt(AT),MT={name:"files",size:24,node:[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]};MT.node;const lL=Mt(MT),NT={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"}]]};NT.node;const DT=Mt(NT),jT={name:"folder-plus",size:24,node:[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};jT.node;const cL=Mt(jT),IT={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};IT.node;const PT=Mt(IT),LT={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"}]]};LT.node;const eb=Mt(LT),zT={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"}]]};zT.node;const uL=Mt(zT),_T={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"}]]};_T.node;const dL=Mt(_T),UT={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"}]]};UT.node;const fL=Mt(UT),HT={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"}]]};HT.node;const hL=Mt(HT),FT={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};FT.node;const yi=Mt(FT),BT={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"}]]};BT.node;const pL=Mt(BT),VT={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};VT.node;const gL=Mt(VT),KT={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"]};KT.node;const mL=Mt(KT),qT={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"}]]};qT.node;const yL=Mt(qT),YT={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"]};YT.node;const vL=Mt(YT),GT={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"}]]};GT.node;const $T=Mt(GT),QT={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};QT.node;const lc=Mt(QT),XT={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"}]]};XT.node;const bL=Mt(XT),ZT={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"}]]};ZT.node;const JT=Mt(ZT),WT={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"}]]};WT.node;const tb=Mt(WT),ek={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"}]]};ek.node;const xL=Mt(ek),tk={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"}]]};tk.node;const nk=Mt(tk),rk={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};rk.node;const SL=Mt(rk),ik={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"]};ik.node;const nb=Mt(ik),sk={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"]};sk.node;const rb=Mt(sk),ak={name:"user-round-plus",size:24,node:[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]],aliases:["user-plus-2"]};ak.node;const wL=Mt(ak),ok={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};ok.node;const Fy=Mt(ok),lk={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};lk.node;const ta=Mt(lk),EL=({...e})=>{const{theme:t="system"}=gP();return v.jsx(KP,{theme:t,className:"toaster group",icons:{success:v.jsx(gT,{className:"size-4"}),info:v.jsx(uL,{className:"size-4"}),warning:v.jsx(rb,{className:"size-4"}),error:v.jsx(mL,{className:"size-4"}),loading:v.jsx(yi,{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})},Ct=e=>typeof e=="string",gu=()=>{let e,t;const i=new Promise((s,o)=>{e=s,t=o});return i.resolve=e,i.reject=t,i},ih=e=>e==null?"":String(e),RL=(e,t,i)=>{e.forEach(s=>{t[s]&&(i[s]=t[s])})},CL=/###/g,iE=e=>e&&e.includes("###")?e.replace(CL,"."):e,sE=e=>!e||Ct(e),ku=(e,t,i)=>{const s=Ct(t)?t.split("."):t;let o=0;for(;o<s.length-1;){if(sE(e))return{};const c=iE(s[o]);!e[c]&&i&&(e[c]=new i),Object.prototype.hasOwnProperty.call(e,c)?e=e[c]:e={},++o}return sE(e)?{}:{obj:e,k:iE(s[o])}},aE=(e,t,i)=>{const{obj:s,k:o}=ku(e,t,Object);if(s!==void 0||t.length===1){s[o]=i;return}let c=t[t.length-1],u=t.slice(0,t.length-1),d=ku(e,u,Object);for(;d.obj===void 0&&u.length;)c=`${u[u.length-1]}.${c}`,u=u.slice(0,u.length-1),d=ku(e,u,Object),d?.obj&&typeof d.obj[`${d.k}.${c}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${c}`]=i},TL=(e,t,i,s)=>{const{obj:o,k:c}=ku(e,t,Object);o[c]=o[c]||[],o[c].push(i)},Jh=(e,t)=>{const{obj:i,k:s}=ku(e,t);if(i&&Object.prototype.hasOwnProperty.call(i,s))return i[s]},kL=(e,t,i)=>{const s=Jh(e,i);return s!==void 0?s:Jh(t,i)},ck=(e,t,i)=>{for(const s in t)s!=="__proto__"&&s!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,s)?Ct(e[s])||e[s]instanceof String||Ct(t[s])||t[s]instanceof String?i&&(e[s]=t[s]):ck(e[s],t[s],i):e[s]=t[s]);return e},Vs=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),OL={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},AL=e=>Ct(e)?e.replace(/[&<>"'\/]/g,t=>OL[t]):e;class ML{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const i=this.regExpMap.get(t);if(i!==void 0)return i;const s=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,s),this.regExpQueue.push(t),s}}const NL=[" ",",","?","!",";"],DL=new ML(20),jL=(e,t,i)=>{t=t||"",i=i||"";const s=NL.filter(u=>!t.includes(u)&&!i.includes(u));if(s.length===0)return!0;const o=DL.getRegExp(`(${s.map(u=>u==="?"?"\\?":u).join("|")})`);let c=!o.test(e);if(!c){const u=e.indexOf(i);u>0&&!o.test(e.substring(0,u))&&(c=!0)}return c},By=(e,t,i=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const s=t.split(i);let o=e;for(let c=0;c<s.length;){if(!o||typeof o!="object")return;let u,d="";for(let f=c;f<s.length;++f)if(f!==c&&(d+=i),d+=s[f],u=o[d],(typeof u=="function"||d==="__proto__")&&!Object.prototype.hasOwnProperty.call(o,d)&&(u=void 0),u!==void 0){if(["string","number","boolean"].includes(typeof u)&&f<s.length-1)continue;c+=f-c+1;break}o=u}return o},rc=e=>e?.replace(/_/g,"-"),IL={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Wh{constructor(t,i={}){this.init(t,i)}init(t,i={}){this.prefix=i.prefix||"i18next:",this.logger=t||IL,this.options=i,this.debug=i.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,s,o){return o&&!this.debug?null:(t=t.map(c=>Ct(c)?c.replace(/[\r\n\x00-\x1F\x7F]/g," "):c),Ct(t[0])&&(t[0]=`${s}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new Wh(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Wh(this.logger,t)}}var ms=new Wh;class Zp{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const o=this.observers[s].get(i)||0;this.observers[s].set(i,o+1)}),this}off(t,i){if(this.observers[t]){if(!i){delete this.observers[t];return}this.observers[t].delete(i)}}once(t,i){const s=(...o)=>{i(...o),this.off(t,s)};return this.on(t,s),this}emit(t,...i){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,c])=>{for(let u=0;u<c;u++)o(...i)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,c])=>{for(let u=0;u<c;u++)o(t,...i)})}}const oE=new WeakSet;class lE extends Zp{constructor(t,i={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){const i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,s,o={}){const c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;t.includes(".")?d=t.split("."):(d=[t,i],s&&(Array.isArray(s)?d.push(...s):Ct(s)&&c?d.push(...s.split(c)):d.push(s)));const f=Jh(this.data,d);return f==null&&!i&&!s&&t.includes(".")&&(t=d[0],i=d[1],s=d.slice(2).join(".")),f!=null||!u||!Ct(s)?f:By(this.data?.[t]?.[i],s,c)}addResource(t,i,s,o,c={silent:!1}){const u=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let d=[t,i];s&&(d=d.concat(u?s.split(u):s)),t.includes(".")&&(d=t.split("."),o=i,i=d[1]),this.addNamespaces(i),aE(this.data,d,o),c.silent||this.emit("added",t,i,s,o)}addResources(t,i,s,o={silent:!1}){for(const c in s)(Ct(s[c])||Array.isArray(s[c]))&&this.addResource(t,i,c,s[c],{silent:!0});o.silent||this.emit("added",t,i,s)}addResourceBundle(t,i,s,o,c,u={silent:!1,skipCopy:!1}){let d=[t,i];t.includes(".")&&(d=t.split("."),o=s,s=i,i=d[1]),this.addNamespaces(i);let f=Jh(this.data,d)||{};u.skipCopy||(s=JSON.parse(JSON.stringify(s))),o?ck(f,s,c):f={...f,...s},aE(this.data,d,f),u.silent||this.emit("added",t,i,s)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return this.getResource(t,i)!==void 0}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find(o=>{const c=i[o];return oE.has(c)?!0:!c||Object.keys(c).length===0?!1:(typeof c=="object"&&oE.add(c),!0)})}toJSON(){return this.data}}var uk={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,s,o){return e.forEach(c=>{t=this.processors[c]?.process(t,i,s,o)??t}),t}};const dk=Symbol("i18next/PATH_KEY");function PL(){const e=[],t=Object.create(null);let i;return t.get=(s,o)=>(i?.revoke?.(),o===dk?e:(e.push(o),i=Proxy.revocable(s,t),i.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Ua(e,t){const{[dk]:i}=e(PL()),s=t?.keySeparator??".",o=t?.nsSeparator??":",c=t?.enableSelector==="strict";if(i.length>1&&o){const u=t?.ns,d=c?Array.isArray(u)?u:u?[u]:null:Array.isArray(u)?u:null;if(d&&(c?d:d.length>1?d.slice(1):[]).includes(i[0]))return`${i[0]}${o}${i.slice(1).join(s)}`}return i.join(s)}const cy=e=>!Ct(e)&&typeof e!="boolean"&&typeof e!="number";class ep extends Zp{constructor(t,i={}){super(),RL(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ms.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,i={interpolation:{}}){const s={...i};if(t==null)return!1;const o=this.resolve(t,s);if(o?.res===void 0)return!1;const c=cy(o.res);return!(s.returnObjects===!1&&c)}extractFromKey(t,i){let s=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let c=i.ns||this.options.defaultNS||[];const u=s&&t.includes(s),d=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!jL(t,s,o);if(u&&!d){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:Ct(c)?[c]:c};const g=t.split(s);(s!==o||s===o&&this.options.ns.includes(g[0]))&&(c=g.shift()),t=g.join(o)}return{key:t,namespaces:Ct(c)?[c]:c}}translate(t,i,s){let o=typeof i=="object"?{...i}:i;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),t==null)return"";typeof t=="function"&&(t=Ua(t,{...this.options,...o})),Array.isArray(t)||(t=[String(t)]),t=t.map(B=>typeof B=="function"?Ua(B,{...this.options,...o}):String(B));const c=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:d,namespaces:f}=this.extractFromKey(t[t.length-1],o),g=f[f.length-1];let m=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const h=o.lng||this.language,x=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h?.toLowerCase()==="cimode")return x?c?{res:`${g}${m}${d}`,usedKey:d,exactUsedKey:d,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(o)}:`${g}${m}${d}`:c?{res:d,usedKey:d,exactUsedKey:d,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(o)}:d;const S=this.resolve(t,o);let w=S?.res;const C=S?.usedKey||d,E=S?.exactUsedKey||d,R=["[object Number]","[object Function]","[object RegExp]"],k=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,A=o.count!==void 0&&!Ct(o.count),N=ep.hasDefaultValue(o),j=A?this.pluralResolver.getSuffix(h,o.count,o):"",D=o.ordinal&&A?this.pluralResolver.getSuffix(h,o.count,{ordinal:!1}):"",M=A&&!o.ordinal&&o.count===0,_=M&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${j}`]||o[`defaultValue${D}`]||o.defaultValue;let L=w;O&&!w&&N&&(L=_);const q=cy(L),X=Object.prototype.toString.apply(L);if(O&&L&&q&&!R.includes(X)&&!(Ct(k)&&Array.isArray(L))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,L,{...o,ns:f}):`key '${d} (${this.language})' returned an object instead of string.`;return c?(S.res=B,S.usedParams=this.getUsedParamsDetails(o),S):B}if(u){const B=Array.isArray(L),H=B?[]:{},U=B?E:C;for(const z in L)if(Object.prototype.hasOwnProperty.call(L,z)){const Q=`${U}${u}${z}`;N&&!w?H[z]=this.translate(Q,{...o,defaultValue:cy(_)?_[z]:void 0,joinArrays:!1,ns:f}):H[z]=this.translate(Q,{...o,joinArrays:!1,ns:f}),H[z]===Q&&(H[z]=L[z])}w=H}}else if(O&&Ct(k)&&Array.isArray(w))w=w.join(k),w&&(w=this.extendTranslation(w,t,o,S,s));else{let B=!1,H=!1;!this.isValidLookup(w)&&N&&(B=!0,w=_),this.isValidLookup(w)||(H=!0,w=d);const z=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:w,Q=N&&_!==w&&this.options.updateMissing;if(H||B||Q){if(this.logger.log(Q?"updateKey":"missingKey",h,g,A&&!Q?`${d}${this.pluralResolver.getSuffix(h,o.count,o)}`:d,Q?_:w),u){const ee=this.resolve(d,{...o,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 $=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let ee=0;ee<K.length;ee++)$.push(K[ee]);else this.options.saveMissingTo==="all"?$=this.languageUtils.toResolveHierarchy(o.lng||this.language):$.push(o.lng||this.language);const Y=(ee,G,oe)=>{const I=N&&oe!==w?oe:z;this.options.missingKeyHandler?this.options.missingKeyHandler(ee,g,G,I,Q,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ee,g,G,I,Q,o),this.emit("missingKey",ee,g,G,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?$.forEach(ee=>{const G=this.pluralResolver.getSuffixes(ee,o);M&&o[`defaultValue${this.options.pluralSeparator}zero`]&&!G.includes(`${this.options.pluralSeparator}zero`)&&G.push(`${this.options.pluralSeparator}zero`),G.forEach(oe=>{Y([ee],d+oe,o[`defaultValue${oe}`]||_)})}):Y($,d,_))}w=this.extendTranslation(w,t,o,S,s),H&&w===d&&this.options.appendNamespaceToMissingKey&&(w=`${g}${m}${d}`),(H||B)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}${m}${d}`:d,B?w:void 0,o))}return c?(S.res=w,S.usedParams=this.getUsedParamsDetails(o),S):w}extendTranslation(t,i,s,o,c){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const f=Ct(t)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let g;if(f){const h=t.match(this.interpolator.nestingRegexp);g=h&&h.length}let m=s.replace&&!Ct(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),t=this.interpolator.interpolate(t,m,s.lng||this.language||o.usedLng,s),f){const h=t.match(this.interpolator.nestingRegexp),x=h&&h.length;g<x&&(s.nest=!1)}!s.lng&&o&&o.res&&(s.lng=this.language||o.usedLng),s.nest!==!1&&(t=this.interpolator.nest(t,(...h)=>c?.[0]===h[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${i[0]}`),null):this.translate(...h,i),s)),s.interpolation&&this.interpolator.reset()}const u=s.postProcess||this.options.postProcess,d=Ct(u)?[u]:u;return t!=null&&d?.length&&s.applyPostProcessor!==!1&&(t=uk.handle(d,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),t}resolve(t,i={}){let s,o,c,u,d;return Ct(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(f=>typeof f=="function"?Ua(f,{...this.options,...i}):f)),t.forEach(f=>{if(this.isValidLookup(s))return;const g=this.extractFromKey(f,i),m=g.key;o=m;let h=g.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const x=i.count!==void 0&&!Ct(i.count),S=x&&!i.ordinal&&i.count===0,w=i.context!==void 0&&(Ct(i.context)||typeof i.context=="number")&&i.context!=="",C=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);h.forEach(E=>{this.isValidLookup(s)||(d=E,!this.checkedLoadedFor[`${C[0]}-${E}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(d)&&(this.checkedLoadedFor[`${C[0]}-${E}`]=!0,this.logger.warn(`key "${o}" 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(R=>{if(this.isValidLookup(s))return;u=R;const k=[m];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(k,m,R,E,i);else{let A;x&&(A=this.pluralResolver.getSuffix(R,i.count,i));const N=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(x&&(i.ordinal&&A.startsWith(j)&&k.push(m+A.replace(j,this.options.pluralSeparator)),k.push(m+A),S&&k.push(m+N)),w){const D=`${m}${this.options.contextSeparator||"_"}${i.context}`;k.push(D),x&&(i.ordinal&&A.startsWith(j)&&k.push(D+A.replace(j,this.options.pluralSeparator)),k.push(D+A),S&&k.push(D+N))}}let O;for(;O=k.pop();)this.isValidLookup(s)||(c=O,s=this.getResource(R,E,O,i))}))})}),{res:s,usedKey:o,exactUsedKey:c,usedLng:u,usedNS:d}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,i,s,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,i,s,o):this.resourceStore.getResource(t,i,s,o)}getUsedParamsDetails(t={}){const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=t.replace&&!Ct(t.replace);let o=s?t.replace:t;if(s&&typeof t.count<"u"&&(o={...o,count:t.count}),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!s){o={...o};for(const c of i)delete o[c]}return o}static hasDefaultValue(t){const i="defaultValue";for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&s.startsWith(i)&&t[s]!==void 0)return!0;return!1}}class cE{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ms.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=rc(t),!t||!t.includes("-"))return null;const i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}getLanguagePartFromCode(t){if(t=rc(t),!t||!t.includes("-"))return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(Ct(t)&&t.includes("-")){let i;try{i=Intl.getCanonicalLocales(t)[0]}catch{}return i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let i;return t.forEach(s=>{if(i)return;const o=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(o))&&(i=o)}),!i&&this.options.supportedLngs&&t.forEach(s=>{if(i)return;const o=this.getScriptPartFromCode(s);if(this.isSupportedCode(o))return i=o;const c=this.getLanguagePartFromCode(s);if(this.isSupportedCode(c))return i=c;i=this.options.supportedLngs.find(u=>u===c?!0:!u.includes("-")&&!c.includes("-")?!1:!!(u.includes("-")&&!c.includes("-")&&u.slice(0,u.indexOf("-"))===c))}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),Ct(t)&&(t=[t]),Array.isArray(t))return t;if(!i)return t.default||[];let s=t[i];return s||(s=t[this.getScriptPartFromCode(i)]),s||(s=t[this.formatLanguageCode(i)]),s||(s=t[this.getLanguagePartFromCode(i)]),s||(s=t.default),s||[]}toResolveHierarchy(t,i){const s=this.options.fallbackLng,o=Array.isArray(s)?s.join("|"):s;o!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=o);const c=i===void 0||i===!1||Ct(i),u=i===void 0&&typeof this.options.fallbackLng=="function",d=Ct(t)&&c&&!u;let f=null;if(d){let x;i===void 0?x="undefined":i===!1?x="boolean:false":x=`string:${i}`,f=`${t.length}:${t}|${x}`}if(f!==null){const x=this.resolveHierarchyCache[f];if(x!==void 0)return x.slice()}const g=this.getFallbackCodes((i===!1?[]:i)||this.options.fallbackLng||[],t),m=[],h=x=>{x&&(this.isSupportedCode(x)?m.push(x):this.logger.warn(`rejecting language code not found in supportedLngs: ${x}`))};return Ct(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&h(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&h(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&h(this.getLanguagePartFromCode(t))):Ct(t)&&h(this.formatLanguageCode(t)),g.forEach(x=>{const S=this.formatLanguageCode(x);m.includes(S)||h(S)}),f!==null?(this.resolveHierarchyCache[f]=m,m.slice()):m}}const uE={zero:0,one:1,two:2,few:3,many:4,other:5},dE={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class LL{constructor(t,i={}){this.languageUtils=t,this.options=i,this.logger=ms.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,i={}){const s=rc(t==="dev"?"en":t),o=i.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:s,type:o});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let u;try{u=new Intl.PluralRules(s,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),dE;if(!t.match(/-|_/))return dE;const f=this.languageUtils.getLanguagePartFromCode(t);u=this.getRule(f,i)}return this.pluralRulesCache[c]=u,u}needsPlural(t,i={}){let s=this.getRule(t,i);return s||(s=this.getRule("dev",i)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,i,s={}){return this.getSuffixes(t,s).map(o=>`${i}${o}`)}getSuffixes(t,i={}){let s=this.getRule(t,i);return s||(s=this.getRule("dev",i)),s?s.resolvedOptions().pluralCategories.sort((o,c)=>uE[o]-uE[c]).map(o=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,i,s={}){const o=this.getRule(t,s);return o?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o.select(i)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",i,s))}}const fE=(e,t,i,s=".",o=!0)=>{let c=kL(e,t,i);return!c&&o&&Ct(i)&&(c=By(e,i,s),c===void 0&&(c=By(t,i,s))),c};class hE{constructor(t={}){this.logger=ms.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:i,escapeValue:s,useRawValueToEscape:o,prefix:c,prefixEscaped:u,suffix:d,suffixEscaped:f,formatSeparator:g,unescapeSuffix:m,unescapePrefix:h,nestingPrefix:x,nestingPrefixEscaped:S,nestingSuffix:w,nestingSuffixEscaped:C,nestingOptionsSeparator:E,maxReplaces:R,alwaysFormat:k}=t.interpolation;this.escape=i!==void 0?i:AL,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=c?Vs(c):u||"{{",this.suffix=d?Vs(d):f||"}}",this.formatSeparator=g||",",this.unescapePrefix=m?"":h?Vs(h):"-",this.unescapeSuffix=this.unescapePrefix?"":m?Vs(m):"",this.nestingPrefix=x?Vs(x):S||Vs("$t("),this.nestingSuffix=w?Vs(w):C||Vs(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=R||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(i,s)=>i?.source===s?(i.lastIndex=0,i):new RegExp(s,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,i,s,o){let c,u,d;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},g=C=>{if(!C.includes(this.formatSeparator)){const O=fE(i,f,C,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(O,void 0,s,{...o,...i,interpolationkey:C}):O}const E=C.split(this.formatSeparator),R=E.shift().trim(),k=E.join(this.formatSeparator).trim();return this.format(fE(i,f,R,this.options.keySeparator,this.options.ignoreJSONStructure),k,s,{...o,...i,interpolationkey:R})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&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 m=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,x=[{regex:this.regexpUnescape,safeValue:C=>C},{regex:this.regexp,safeValue:C=>this.escapeValue?this.escape(C):C}],S=[];let w=0;return x.forEach(C=>{for(d=0;c=C.regex.exec(t);){const E=c.index-w,R=S.find(([A,N])=>E>=A&&E<N);if(R){C.regex.lastIndex=R[1]+w;continue}const k=c[1].trim();if(u=g(k),u===void 0)if(typeof m=="function"){const A=m(t,c,o);u=Ct(A)?A:""}else if(o&&Object.prototype.hasOwnProperty.call(o,k))u="";else if(h){u=c[0];continue}else this.logger.warn(`missed to pass in variable ${k} for interpolating ${t}`),u="";else!Ct(u)&&!this.useRawValueToEscape&&(u=ih(u));const O=ih(C.safeValue(u));if(t=t.slice(0,c.index)+O+t.slice(c.index+c[0].length),h?(C.regex===this.regexpUnescape?S.push([c.index,c.index+O.length]):w+=O.length-c[0].length,C.regex.lastIndex+=O.length,C.regex.lastIndex-=c[0].length):C.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),t}nest(t,i,s={}){let o,c,u;const d=(h,x)=>{const S=this.nestingOptionsSeparator;if(!h.includes(S))return h;const w=h.split(new RegExp(`${Vs(S)}[ ]*{`));let C=`{${w[1]}`;h=w[0],C=this.interpolate(C,u);const E=C.match(/'/g),R=C.match(/"/g);((E?.length??0)%2===0&&!R||(R?.length??0)%2!==0)&&(C=C.replace(/'/g,'"'));try{u=JSON.parse(C),x&&(u={...x,...u})}catch(k){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,k),`${h}${S}${C}`}return u.defaultValue&&u.defaultValue.includes(this.prefix)&&delete u.defaultValue,h},f=new RegExp(this.nestingRegexp);let g="",m=0;for(;o=f.exec(t);){let h=[];u={...s},u=u.replace&&!Ct(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const x=/{.*}/s.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(x!==-1&&(h=o[1].slice(x).split(this.formatSeparator).map(S=>S.trim()).filter(Boolean),o[1]=o[1].slice(0,x)),c=i(d.call(this,o[1].trim(),u),u),c&&o[0]===t&&!Ct(c))return c;Ct(c)||(c=ih(c)),c||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),c=""),h.length&&(c=h.reduce((S,w)=>this.format(S,w,s.lng,{...s,interpolationkey:o[1].trim()}),c.trim())),g+=t.slice(m,o.index)+ih(c),m=f.lastIndex,this.regexp.lastIndex=0}return m?g+t.slice(m):t}}const zL=e=>{let t=e.toLowerCase().trim();const i={};if(e.includes("(")){const s=e.split("(");t=s[0].toLowerCase().trim();const o=s[1].slice(0,-1);t==="currency"&&!o.includes(":")?i.currency||(i.currency=o.trim()):t==="relativetime"&&!o.includes(":")?i.range||(i.range=o.trim()):o.split(";").forEach(u=>{if(u){const[d,...f]=u.split(":"),g=f.join(":").trim().replace(/^'+|'+$/g,""),m=d.trim();i[m]||(i[m]=g),g==="false"&&(i[m]=!1),g==="true"&&(i[m]=!0),isNaN(g)||(i[m]=parseInt(g,10))}})}return{formatName:t,formatOptions:i}},pE=e=>{const t={};return(i,s,o)=>{let c=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(c={...c,[o.interpolationkey]:void 0});let u;try{u=s+JSON.stringify(c)}catch{return e(rc(s),o)(i)}let d=t[u];return d||(d=e(rc(s),o),t[u]=d),d(i)}},_L=e=>(t,i,s)=>e(rc(i),s)(t);class UL{constructor(t={}){this.logger=ms.create("formatter"),this.options=t,this.init(t)}init(t,i={interpolation:{}}){this.formatSeparator=i.interpolation.formatSeparator||",";const s=i.cacheInBuiltFormats?pE:_L;this.formats={number:s((o,c)=>{const u=new Intl.NumberFormat(o,{...c});return d=>u.format(d)}),currency:s((o,c)=>{const u=new Intl.NumberFormat(o,{...c,style:"currency"});return d=>u.format(d)}),datetime:s((o,c)=>{const u=new Intl.DateTimeFormat(o,{...c});return d=>u.format(d)}),relativetime:s((o,c)=>{const u=new Intl.RelativeTimeFormat(o,{...c});return d=>u.format(d,c.range||"day")}),list:s((o,c)=>{const u=new Intl.ListFormat(o,{...c});return d=>u.format(d)})}}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=pE(i)}format(t,i,s,o={}){if(!i||t==null)return t;const c=i.split(this.formatSeparator),u=[];for(let f=0;f<c.length;f++){let g=c[f];for(;g.indexOf("(")>-1&&!g.includes(")")&&f+1<c.length;)g=`${g}${this.formatSeparator}${c[++f]}`;u.push(g)}return u.reduce((f,g)=>{const{formatName:m,formatOptions:h}=zL(g);if(this.formats[m]){let x=f;try{const S=o?.formatParams?.[o.interpolationkey]||{},w=S.locale||S.lng||o.locale||o.lng||s;x=this.formats[m](f,w,{...h,...o,...S})}catch(S){this.logger.warn(S)}return x}else this.logger.warn(`there was no format function for ${m}`);return f},t)}}const HL=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class FL extends Zp{constructor(t,i,s,o={}){super(),this.backend=t,this.store=i,this.services=s,this.languageUtils=s.languageUtils,this.options=o,this.logger=ms.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,o.backend,o)}queueLoad(t,i,s,o){const c={},u={},d={},f={};return t.forEach(g=>{let m=!0;i.forEach(h=>{const x=`${g}|${h}`;!s.reload&&this.store.hasResourceBundle(g,h)?this.state[x]=2:this.state[x]<0||(this.state[x]===1?u[x]===void 0&&(u[x]=!0):(this.state[x]=1,m=!1,u[x]===void 0&&(u[x]=!0),c[x]===void 0&&(c[x]=!0),f[h]===void 0&&(f[h]=!0)))}),m||(d[g]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(f)}}loaded(t,i,s){const o=t.split("|"),c=o[0],u=o[1];i&&this.emit("failedLoading",c,u,i),!i&&s&&this.store.addResourceBundle(c,u,s,void 0,void 0,{skipCopy:!0}),this.state[t]=i?-1:2,i&&s&&(this.state[t]=0);const d={};this.queue.forEach(f=>{TL(f.loaded,[c],u),HL(f,t),i&&f.errors.push(i),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(g=>{d[g]||(d[g]={});const m=f.loaded[g];m.length&&m.forEach(h=>{d[g][h]===void 0&&(d[g][h]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(f=>!f.done)}read(t,i,s,o=0,c=this.retryTimeout,u){if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:i,fcName:s,tried:o,wait:c,callback:u});return}this.readingCalls++;const d=(g,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(g&&m&&o<this.maxRetries){setTimeout(()=>{this.read(t,i,s,o+1,c*2,u)},c);return}u(g,m)},f=this.backend[s].bind(this.backend);if(f.length===2){try{const g=f(t,i);g&&typeof g.then=="function"?g.then(m=>d(null,m)).catch(d):d(null,g)}catch(g){d(g)}return}return f(t,i,d)}prepareLoading(t,i,s={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Ct(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ct(i)&&(i=[i]);const c=this.queueLoad(t,i,s,o);if(!c.toLoad.length)return c.pending.length||o(),null;c.toLoad.forEach(u=>{this.loadOne(u)})}load(t,i,s){this.prepareLoading(t,i,{},s)}reload(t,i,s){this.prepareLoading(t,i,{reload:!0},s)}loadOne(t,i=""){const s=t.split("|"),o=s[0],c=s[1];this.read(o,c,"read",void 0,void 0,(u,d)=>{u&&this.logger.warn(`${i}loading namespace ${c} for language ${o} failed`,u),!u&&d&&this.logger.log(`${i}loaded namespace ${c} for language ${o}`,d),this.loaded(t,u,d)})}saveMissing(t,i,s,o,c,u={},d=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(i)){this.logger.warn(`did not save key "${s}" as the namespace "${i}" 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(!(s==null||s==="")){if(this.backend?.create){const f={...u,isUpdate:c},g=this.backend.create.bind(this.backend);if(g.length<6)try{let m;g.length===5?m=g(t,i,s,o,f):m=g(t,i,s,o),m&&typeof m.then=="function"?m.then(h=>d(null,h)).catch(d):d(null,m)}catch(m){d(m)}else g(t,i,s,o,d,f)}!t||!t[0]||this.store.addResource(t[0],i,s,o)}}}const uy=()=>({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 t={};if(typeof e[1]=="object"&&(t=e[1]),Ct(e[1])&&(t.defaultValue=e[1]),Ct(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const i=e[3]||e[2];Object.keys(i).forEach(s=>{t[s]=i[s]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),gE=e=>(Ct(e.ns)&&(e.ns=[e.ns]),Ct(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ct(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),sh=()=>{},BL=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(i=>{typeof e[i]=="function"&&(e[i]=e[i].bind(e))})};class Ou extends Zp{constructor(t={},i){if(super(),this.options=gE(t),this.services={},this.logger=ms,this.modules={external:[]},BL(this),i&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,i),this;setTimeout(()=>{this.init(t,i)},0)}}init(t={},i){this.isInitializing=!0,typeof t=="function"&&(i=t,t={}),t.defaultNS==null&&t.ns&&(Ct(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const s=uy();this.options={...s,...this.options,...gE(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler);const o=g=>g?typeof g=="function"?new g:g:null;if(!this.options.isClone){this.modules.logger?ms.init(o(this.modules.logger),this.options):ms.init(null,this.options);let g;this.modules.formatter?g=this.modules.formatter:g=UL;const m=new cE(this.options);this.store=new lE(this.options.resources,this.options);const h=this.services;h.logger=ms,h.resourceStore=this.store,h.languageUtils=m,h.pluralResolver=new LL(m,{prepend:this.options.pluralSeparator}),g&&(h.formatter=o(g),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new hE(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new FL(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(x,...S)=>{this.emit(x,...S)}),this.modules.languageDetector&&(h.languageDetector=o(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=o(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new ep(this.services,this.options),this.translator.on("*",(x,...S)=>{this.emit(x,...S)}),this.modules.external.forEach(x=>{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,i||(i=sh),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]=(...m)=>this.store[g](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(g=>{this[g]=(...m)=>(this.store[g](...m),this)});const d=gu(),f=()=>{const g=(m,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(h),i(m,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?f():setTimeout(f,0),d}loadResources(t,i=sh){let s=i;const o=Ct(t)?t:this.language;if(typeof t=="function"&&(s=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const c=[],u=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(g=>{g!=="cimode"&&(c.includes(g)||c.push(g))})};o?u(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>u(f)),this.options.preload?.forEach?.(d=>u(d)),this.services.backendConnector.load(c,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(d)})}else s(null)}reloadResources(t,i,s){const o=gu();return typeof t=="function"&&(s=t,t=void 0),typeof i=="function"&&(s=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),s||(s=sh),this.services.backendConnector.reload(t,i,c=>{o.resolve(),s(c)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&uk.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let i=0;i<this.languages.length;i++){const s=this.languages[i];if(!["cimode","dev"].includes(s)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,i){this.isLanguageChangingTo=t;const s=gu();this.emit("languageChanging",t);const o=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},c=(d,f)=>{f?this.isLanguageChangingTo===t&&(o(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,s.resolve((...g)=>this.t(...g)),i&&i(d,(...g)=>this.t(...g))},u=d=>{!t&&!d&&this.services.languageDetector&&(d=[]);const f=Ct(d)?d:d&&d[0],g=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(Ct(d)?[d]:d);g&&(this.language||o(g),this.translator.language||this.translator.changeLanguage(g),this.services.languageDetector?.cacheUserLanguage?.(g)),this.loadResources(g,m=>{c(m,g)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(t),s}getFixedT(t,i,s,o){const c=o?.scopeNs,u=(d,f,...g)=>{let m;typeof f!="object"?m=this.options.overloadTranslationOptionHandler([d,f].concat(g)):m={...f},m.lng=m.lng||u.lng,m.lngs=m.lngs||u.lngs;const h=m.ns!==void 0&&m.ns!==null;m.ns=m.ns||u.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||s||u.keyPrefix);const x={...this.options,...m};Array.isArray(c)&&!h&&(x.ns=c),typeof m.keyPrefix=="function"&&(m.keyPrefix=Ua(m.keyPrefix,x));const S=this.options.keySeparator||".";let w;return m.keyPrefix&&Array.isArray(d)?w=d.map(C=>(typeof C=="function"&&(C=Ua(C,x)),`${m.keyPrefix}${S}${C}`)):(typeof d=="function"&&(d=Ua(d,x)),w=m.keyPrefix?`${m.keyPrefix}${S}${d}`:d),this.t(w,m)};return Ct(t)?u.lng=t:u.lngs=t,u.ns=i,u.keyPrefix=s,u}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,i={}){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 s=i.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const u=(g,m)=>{const h=this.services.backendConnector.state[`${g}|${m}`];return h===-1||h===0||h===2};if(i.precheck){const g=i.precheck(this,u);if(g!==void 0)return g}if(this.hasResourceBundle(s,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;const{languageUtils:d}=this.services,f=i.lng?d.isSupportedCode(s)&&d.toResolveHierarchy(s,!1)[0]:s;return!!((!f||u(f,t))&&(!o||u(c,t)))}loadNamespaces(t,i){const s=gu();return this.options.ns?(Ct(t)&&(t=[t]),t.forEach(o=>{this.options.ns.includes(o)||this.options.ns.push(o)}),this.loadResources(o=>{s.resolve(),i&&i(o)}),s):(i&&i(),Promise.resolve())}loadLanguages(t,i){const s=gu();Ct(t)&&(t=[t]);const o=this.options.preload||[],c=t.filter(u=>!o.includes(u)&&this.services.languageUtils.isSupportedCode(u));return c.length?(this.options.preload=o.concat(c),this.loadResources(u=>{s.resolve(),i&&i(u)}),s):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const c=o.getTextInfo();if(c&&c.direction)return c.direction}}catch{}const i=["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"],s=this.services?.languageUtils||new cE(uy());return t.toLowerCase().indexOf("-latn")>1?"ltr":i.includes(s.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},i){const s=new Ou(t,i);return s.createInstance=Ou.createInstance,s}cloneInstance(t={},i=sh){const s=t.forkResourceStore;s&&delete t.forkResourceStore;const o={...this.options,preload:!1,...t,isClone:!0},c=new Ou(o);if((t.debug!==void 0||t.prefix!==void 0)&&(c.logger=c.logger.clone(t)),["store","services","language"].forEach(d=>{c[d]=this[d]}),c.services={...this.services},c.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},s){const d=g=>{const m=Array.isArray(g)?[...g]:{...g};return Object.keys(m).forEach(h=>{m[h]&&typeof m[h]=="object"&&(m[h]=d(m[h]))}),m},f=d(this.store.data);c.store=new lE(f,o),c.services.resourceStore=c.store}if(t.interpolation){const f={...uy().interpolation,...this.options.interpolation,...t.interpolation},g={...o,interpolation:f};c.services.interpolator=new hE(g)}return c.translator=new ep(c.services,o),c.translator.on("*",(d,...f)=>{c.emit(d,...f)}),c.init(o,i),c.translator.options=o,c.translator.backendConnector.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const hr=Ou.createInstance();hr.createInstance;hr.dir;hr.init;hr.loadResources;hr.reloadResources;hr.use;hr.changeLanguage;hr.getFixedT;hr.t;hr.exists;hr.setDefaultNamespace;hr.hasLoadedNamespace;hr.loadNamespaces;hr.loadLanguages;const VL={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},KL=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function mE(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},i=e.match(/<\/?([^\s]+?)[/\s>]/);if(i&&(t.name=i[1],(VL[i[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){const c=e.indexOf("-->");return{type:"comment",comment:c!==-1?e.slice(4,c):""}}const s=new RegExp(KL);let o=null;for(;o=s.exec(e),o!==null;)if(o[0].trim())if(o[1]){const c=o[1].trim();let u=[c,null];const d=c.indexOf("=");d>-1&&(u=[c.slice(0,d),c.slice(d+1)]),t.attrs[u[0]]=u[1],s.lastIndex--}else o[2]&&(t.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1));return t}const ah=/<!--[\s\S]*?-->|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,qL=/<\/?([^\s]+?)[/\s>]/,YL=/^\s*$/,GL=/^(script|style)$/i,xu="\0",$L=Object.create(null);function fk(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(xu).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(xu).join("<");return}for(const i in t.attrs){const s=t.attrs[i];typeof s=="string"&&s.indexOf(xu)>-1&&(t.attrs[i]=s.split(xu).join("<"))}t.children.length&&fk(t.children)})}function QL(e,t){const i=t&&t.components||$L,s=t&&t.allowedTags;let o=!1;if(s){const w=typeof s=="function"?s:function(k){return s.indexOf(k)>-1};let C="",E=0;ah.lastIndex=0;let R;for(;R=ah.exec(e);){const k=R[0];C+=e.slice(E,R.index);const O=k.match(qL);k.startsWith("<!--")||O&&w(O[1])?(C+=k,E=R.index+k.length):(o=!0,C+=xu,E=R.index+1,ah.lastIndex=E)}e=C+e.slice(E)}const c=[],u=[];let d,f=-1,g=!1,m=0,h;if(e.indexOf("<")!==0){const w=e.indexOf("<");c.push({type:"text",content:w===-1?e:e.substring(0,w)})}const x=[];let S;for(;S=ah.exec(e);)x.push(S);return x.forEach(function(w,C){const E=w[0];if(!E||E.startsWith("<!--"))return;let R=0,k=0,O=-1,A=null;for(let j=0;j<E.length;j++){const D=E.charAt(j);A?D===A&&(A=null):D==='"'||D==="'"?A=D:D==="<"?(R++,R===2&&(O=j)):D===">"&&k++}const N=O>-1&&/[a-zA-Z0-9\-!/]/.test(E.charAt(O+1));if(R>k&&N){const j=E.substring(0,O),D=E.substring(j.length);x[C][0]=D,x[C].index+=j.length}}),x.forEach(function(w,C){const E=w[0];if(!E)return;const R=w.index;if(R<m)return;if(g){if(E!=="</"+d.name+">")return;g=!1}const k=E.charAt(1)!=="/",O=E.startsWith("<!--"),A=R+E.length,N=e.charAt(A),j=x[C+1];let D;if(N==="<"&&j){const _=e.substring(A,j.index);D=_.split("<").length>_.split(">").length}let M;if(O){const _=mE(E);if(f<0)return c.push(_),c;M=u[f],M.children.push(_);const L=e.slice(A,j?j.index:void 0);return L.length>0&&M.children.push({type:"text",content:L}),c}if(k){f++,d=mE(E),d.type==="tag"&&i[d.name]&&(d.type="component",g=!0);let _=!1;if(!g&&!d.voidElement&&GL.test(d.name)){_=!0,h||(h=e.toLowerCase());const L=h.indexOf("</"+d.name.toLowerCase()+">",A),q=L===-1?e.length:L,X=e.slice(A,q);X&&d.children.push({type:"text",content:X}),m=q}!d.voidElement&&!g&&!_&&N&&N!=="<"&&d.children.push({type:"text",content:e.slice(A,j?j.index:void 0)}),f===0&&c.push(d),M=u[f-1],M&&M.children.push(d),u[f]=d}if((!k||d.voidElement)&&(f>-1&&(d.voidElement||d.name===E.slice(2,-1))&&(f--,d=f===-1?c:u[f]),!g&&(N!=="<"||D)&&N)){M=f===-1?c:u[f].children;const _=j?j.index:-1;let L=e.slice(A,_===-1?void 0:_);YL.test(L)&&(L=" "),(_>-1&&f+M.length>=0||L!==" ")&&M.push({type:"text",content:L})}}),o&&fk(c),c}function XL(e){const t=[];for(const i in e)e[i]===null?t.push(i):t.push(i+'="'+String(e[i]).replace(/"/g,"&quot;")+'"');return t.length?" "+t.join(" "):""}function hk(e,t){switch(t.type){case"text":return e+t.content;case"tag":{const i=t.voidElement&&t.name.toLowerCase()!=="!doctype"?"/>":">";return e+="<"+t.name+(t.attrs?XL(t.attrs):"")+i,t.voidElement?e:e+t.children.reduce(hk,"")+"</"+t.name+">"}case"comment":return e+="<!--"+t.comment+"-->",e}}function ZL(e){return e.reduce(function(t,i){return t+hk("",i)},"")}var JL={parse:QL,stringify:ZL};const Ch=(e,t,i,s)=>{const o=[i,{code:t,...s||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);Jr(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...o):console?.warn&&console.warn(...o)},yE={},$l=(e,t,i,s)=>{Jr(i)&&yE[i]||(Jr(i)&&(yE[i]=new Date),Ch(e,t,i,s))},pk=(e,t)=>()=>{if(e.isInitialized)t();else{const i=()=>{setTimeout(()=>{e.off("initialized",i)},0),t()};e.on("initialized",i)}},Vy=(e,t,i)=>{e.loadNamespaces(t,pk(e,i))},vE=(e,t,i,s)=>{if(Jr(i)&&(i=[i]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Vy(e,i,s);i.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,pk(e,s))},WL=(e,t,i={})=>!t.languages||!t.languages.length?($l(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:i.lng,precheck:(s,o)=>{if(i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!o(s.isLanguageChangingTo,e))return!1}}),Jr=e=>typeof e=="string",gs=e=>typeof e=="object"&&e!==null,e5=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,t5={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},n5=e=>t5[e],gk=e=>e.replace(e5,n5);let Ky={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:gk,transDefaultProps:void 0};const r5=(e={})=>{Ky={...Ky,...e}},ib=()=>Ky;let mk;const i5=e=>{mk=e},sb=()=>mk,Th=(e,t)=>{if(!e)return!1;const i=e.props?.children??e.children;return t?i.length>0:!!i},Su=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?qs(t):t},s5=e=>qs(e).every(b.isValidElement),qs=e=>Array.isArray(e)?e:[e],a5=(e,t)=>{const i={...t};return i.props={...t.props,...e.props},i},o5=e=>{const t={};if(!e)return t;const i=s=>{qs(s).forEach(c=>{Jr(c)||(Th(c)?i(Su(c)):gs(c)&&!b.isValidElement(c)&&Object.assign(t,c))})};return i(e),t},qy=(e,t,i,s)=>{if(!e)return"";let o="";const c=qs(e),u=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return c.forEach((d,f)=>{if(Jr(d)){o+=`${d}`;return}if(b.isValidElement(d)){const{props:g,type:m}=d,h=Object.keys(g).length,x=u.indexOf(m)>-1,S=g.children;if(!S&&x&&!h){o+=`<${m}/>`;return}if(!S&&(!x||h)||g.i18nIsDynamicList){o+=`<${f}></${f}>`;return}if(x&&h<=1){const C=Jr(S)?S:qy(S,t,i,s);o+=`<${m}>${C}</${m}>`;return}const w=qy(S,t,i,s);o+=`<${f}>${w}</${f}>`;return}if(d===null){Ch(i,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:s});return}if(gs(d)){const{format:g,...m}=d,h=Object.keys(m);if(h.length===1){const x=g?`${h[0]}, ${g}`:h[0];o+=`{{${x}}}`;return}if(!h.length&&Object.keys(d).length===1&&"format"in d){o+="{{format}}";return}Ch(i,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:s,child:d});return}Ch(i,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:s,child:d})}),o},l5=(e,t,i,s,o,c,u)=>{if(i==="")return[];const d=o.transKeepBasicHtmlNodesFor||[],f=i&&new RegExp(d.map(O=>`<${O}`).join("|")).test(i);if(!e&&!t&&!f&&!u)return[i];const g=t??{},m=O=>{qs(O).forEach(N=>{Jr(N)||(Th(N)?m(Su(N)):gs(N)&&!b.isValidElement(N)&&Object.assign(g,N))})};m(e);const h=Object.keys(g),x=O=>/^\d+$/.test(O)||d.indexOf(O)>-1||h.indexOf(O)>-1,S=JL.parse(`<0>${i}</0>`,{allowedTags:x}),w={...g,...c},C=(O,A,N)=>{const j=Su(O),D=R(j,A.children,N);return s5(j)&&D.length===0||O.props?.i18nIsDynamicList?j:D},E=(O,A,N,j,D)=>{O.dummy?(O.children=A,N.push(b.cloneElement(O,{key:j},D?void 0:A))):N.push(...b.Children.map([O],M=>{if(M.type===b.Fragment||M.props?.i18nIsDynamicList!==void 0){const L={key:j};return M&&M.props&&Object.keys(M.props).forEach(q=>{q==="children"||q==="i18nIsDynamicList"||(L[q]=M.props[q])}),b.createElement(M.type,L,D?null:A)}const _={key:j};return M&&M.props&&Object.keys(M.props).forEach(L=>{L==="ref"||L==="children"||(_[L]=M.props[L])}),b.cloneElement(M,_,D?null:A)}))},R=(O,A,N)=>{const j=qs(O),D=qs(A),M={};return D.reduce((_,L,q)=>{const X=L.children?.[0]?.content&&s.services.interpolator.interpolate(L.children[0].content,w,s.language);if(L.type==="tag"){let B=j[parseInt(L.name,10)];!B&&t&&(B=t[L.name]),N.length===1&&!B&&gs(N[0])&&(B=N[0][L.name]),B||(B={});const H={...L.attrs};u&&Object.keys(H).forEach(Y=>{const ee=H[Y];Jr(ee)&&(H[Y]=gk(ee))});const U=Object.keys(H).length!==0?a5({props:H},B):B,z=b.isValidElement(U),Q=z&&Th(L,!0)&&!L.voidElement,$=f&&gs(U)&&U.dummy&&!z,K=gs(t)&&Object.hasOwnProperty.call(t,L.name);if(Jr(U)){const Y=s.services.interpolator.interpolate(U,w,s.language);_.push(Y)}else if(Th(U)||Q){const Y=C(U,L,N);E(U,Y,_,q)}else if($){const Y=R(j,L.children,N);E(U,Y,_,q)}else if(Number.isNaN(parseFloat(L.name)))if(K){const Y=C(U,L,N);E(U,Y,_,q,L.voidElement)}else if(o.transSupportBasicHtmlNodes&&d.indexOf(L.name)>-1)if(L.voidElement)_.push(b.createElement(L.name,{key:`${L.name}-${q}`}));else{const Y=M[L.name]||0;M[L.name]=Y+1;let ee,G=0;for(let V=0;V<j.length;V+=1){const W=j[V];if(b.isValidElement(W)&&W.type===L.name){if(G===Y){ee=W;break}G+=1}}const oe=ee?qs(Su(ee)):j,I=R(oe,L.children,N);_.push(b.createElement(L.name,{key:`${L.name}-${q}`},I))}else if(L.voidElement)_.push(`<${L.name} />`);else{const Y=R(j,L.children,N);_.push(`<${L.name}>${Y}</${L.name}>`)}else if(gs(U)&&!z){const Y=L.children[0]?X:null;Y&&_.push(Y)}else E(U,X,_,q,L.children.length!==1||!X)}else if(L.type==="text"){const B=o.transWrapTextNodes,H=typeof o.unescape=="function"?o.unescape:ib().unescape,U=u?H(s.services.interpolator.interpolate(L.content,w,s.language)):s.services.interpolator.interpolate(L.content,w,s.language);B?_.push(b.createElement(B,{key:`${L.name}-${q}`},U)):_.push(U)}return _},[])},k=R([{dummy:!0,children:e||[]}],S,qs(e||[]));return Su(k[0])},yk=(e,t,i)=>{const s=e.key||t,o=b.cloneElement(e,{key:s});if(!o.props||!o.props.children||i.indexOf(`${t}/>`)<0&&i.indexOf(`${t} />`)<0)return o;function c(){return b.createElement(b.Fragment,null,o)}return b.createElement(c,{key:s})},c5=(e,t)=>e.map((i,s)=>yk(i,s,t)),u5=(e,t)=>{const i={};return Object.keys(e).forEach(s=>{Object.assign(i,{[s]:yk(e[s],s,t)})}),i},d5=(e,t,i,s)=>e?Array.isArray(e)?c5(e,t):gs(e)?u5(e,t):($l(i,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:s}),null):null,f5=e=>!gs(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,i)=>t&&Number.isNaN(Number.parseFloat(i)),!0);function h5({children:e,count:t,parent:i,i18nKey:s,context:o,tOptions:c={},values:u,defaults:d,components:f,ns:g,i18n:m,t:h,shouldUnescape:x,...S}){const w=m||sb();if(!w)return $l(w,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:s}),e;const C=h||w.t.bind(w)||(ee=>ee),E={...ib(),...w.options?.react};let R=g||(C.ns?void 0:w.options?.defaultNS||"translation");Jr(R)&&(R=[R]);const{transDefaultProps:k}=E,O=k?.tOptions?{...k.tOptions,...c}:c,A=x??k?.shouldUnescape,N=k?.values?{...k.values,...u}:u,j=k?.components?{...k.components,...f}:f,D=qy(e,E,w,s),M=Array.isArray(s)?s[s.length-1]:s,_=d||O?.defaultValue||D||E.transEmptyNodeValue||(typeof M=="function"?Ua(M):M),{hashTransKey:L}=E,q=s||(L?L(D||_):D||_);w.options?.interpolation?.defaultVariables?u={...w.options.interpolation.defaultVariables,...N}:u=N;const X=o5(e);X&&typeof X.count=="number"&&t===void 0&&(t=X.count),t===void 0&&(t=O?.count);const B=u||t!==void 0&&!w.options?.interpolation?.alwaysFormat||!e?O.interpolation:{interpolation:{...O.interpolation,prefix:"#$?",suffix:"?$#"}},H={...O,context:o||O.context,count:t,...u,...B,defaultValue:_,ns:R};let U=q?C(q,H):_;U===q&&_&&(U=_);const z=d5(j,U,w,s);let Q=z||e,$=null;f5(z)?($=z,Q=e):z&&!Array.isArray(z)&&($=z,Q=void 0);const K=l5(Q,$,U,w,E,H,A),Y=i??E.defaultTransParent;return Y?b.createElement(Y,S,K):K}const p5={type:"3rdParty",init(e){r5(e.options.react),i5(e)}},vk=b.createContext();class g5{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(i=>{this.usedNamespaces[i]||(this.usedNamespaces[i]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Jp({children:e,count:t,parent:i,i18nKey:s,context:o,tOptions:c={},values:u,defaults:d,components:f,ns:g,i18n:m,t:h,shouldUnescape:x,...S}){const{i18n:w,defaultNS:C}=b.useContext(vk)||{},E=m||w||sb(),R=h||E?.t.bind(E);return h5({children:e,count:t,parent:i,i18nKey:s,context:o,tOptions:c,values:u,defaults:d,components:f,ns:g||(R?.ns?void 0:C||E?.options?.defaultNS),i18n:E,t:h,shouldUnescape:x,...S})}const m5=(e,t)=>{if(Jr(t))return t;if(gs(t)&&Jr(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const i=e[e.length-1];return typeof i=="function"?"":i}return e},y5={t:m5,ready:!1},v5=()=>()=>{},mt=(e,t={})=>{const{i18n:i}=t,{i18n:s,defaultNS:o}=b.useContext(vk)||{},c=i||s||sb();c&&!c.reportNamespaces&&(c.reportNamespaces=new g5),c||$l(c,"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 u=b.useMemo(()=>({...ib(),...c?.options?.react,...t}),[c,t]),{useSuspense:d,keyPrefix:f,bindI18n:g,bindI18nStore:m}=u,h=o||c?.options?.defaultNS,x=Jr(h)?[h]:h||["translation"],S=JSON.stringify(x),w=b.useMemo(()=>x,[S]);c?.reportNamespaces?.addUsedNamespaces?.(w);const C=b.useRef(0),E=b.useCallback(H=>{if(!c)return v5;const U=()=>{C.current+=1,H()};return g&&c.on(g,U),m&&c.store.on(m,U),()=>{g&&g.split(" ").forEach(z=>c.off(z,U)),m&&m.split(" ").forEach(z=>c.store.off(z,U))}},[c,g,m]),R=b.useRef(),k=b.useCallback(()=>{if(!c)return y5;const H=!!(c.isInitialized||c.initializedStoreOnce)&&w.every(ee=>WL(ee,c,u)),U=t.lng||c.language,z=C.current,Q=typeof f=="function"?Ua(f,{...c.options,ns:w}):f,$=R.current;if($&&$.i18n===c&&$.ready===H&&$.lng===U&&$.namespaces===w&&$.keyPrefix===Q&&$.revision===z)return $;const Y={t:c.getFixedT(U,u.nsMode==="fallback"?w:w[0],f,{scopeNs:w}),i18n:c,ready:H,lng:U,namespaces:w,keyPrefix:Q,revision:z};return R.current=Y,Y},[c,w,f,u,t.lng]),[O,A]=b.useState(0);let{t:N,ready:j}=Hp.useSyncExternalStore(E,k,k),D;c&&d&&!j&&(D=new Promise(H=>{const U=()=>H();t.lng?vE(c,t.lng,w,U):Vy(c,w,U)}),{t:N,ready:j}=k()),b.useEffect(()=>{if(c&&!j&&!d){const H=()=>A(U=>U+1);t.lng?vE(c,t.lng,w,H):Vy(c,w,H)}},[c,t.lng,w,j,d,O]);const M=c||{},_=b.useRef(null),L=b.useRef(),q=H=>`${H.language}|${H.resolvedLanguage}|${H.languages?.join(",")}`,X=H=>{const U=Object.getOwnPropertyDescriptors(H);U.__original&&delete U.__original;const z=Object.create(Object.getPrototypeOf(H),U);if(!Object.prototype.hasOwnProperty.call(z,"__original"))try{Object.defineProperty(z,"__original",{value:H,writable:!1,enumerable:!1,configurable:!1})}catch{}return z},B=b.useMemo(()=>{const H=M,U=H&&q(H);let z=H;H&&(_.current&&_.current.__original===H?L.current!==U?(z=X(H),_.current=z,L.current=U):z=_.current:(z=X(H),_.current=z,L.current=U));const Q=!j&&!d?(...K)=>($l(c,"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(...K)):N,$=[Q,z,j];return $.t=Q,$.i18n=z,$.ready=j,$},[N,M,j,M.resolvedLanguage,M.language,M.languages]);if(c&&d&&!j){let H=!1;try{H=!1}catch{}throw H&&$l(c,"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"),D}return B};function bk(e){var t,i,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(i=bk(e[t]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}function b5(){for(var e,t,i=0,s="",o=arguments.length;i<o;i++)(e=arguments[i])&&(t=bk(e))&&(s&&(s+=" "),s+=t);return s}const bE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xE=b5,Uo=(e,t)=>i=>{var s;if(t?.variants==null)return xE(e,i?.class,i?.className);const{variants:o,defaultVariants:c}=t,u=Object.keys(o).map(g=>{const m=i?.[g],h=c?.[g];if(m===null)return null;const x=bE(m)||bE(h);return o[g][x]}),d=i&&Object.entries(i).reduce((g,m)=>{let[h,x]=m;return x===void 0||(g[h]=x),g},{}),f=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((g,m)=>{let{class:h,className:x,...S}=m;return Object.entries(S).every(w=>{let[C,E]=w;return Array.isArray(E)?E.includes({...c,...d}[C]):{...c,...d}[C]===E})?[...g,h,x]:g},[]);return xE(e,u,f,i?.class,i?.className)},xk=b.createContext(void 0);function ab(e=!1){const t=b.useContext(xk);if(t===void 0&&!e)throw new Error(gn(16));return t}function x5(e){const{focusableWhenDisabled:t,disabled:i,composite:s=!1,tabIndex:o=0,isNativeButton:c}=e,u=s&&t!==!1,d=s&&t===!1;return{props:b.useMemo(()=>{const g={onKeyDown(m){i&&t&&m.key!=="Tab"&&m.preventDefault()}};return s||(g.tabIndex=o,!c&&i&&(g.tabIndex=t?o:-1)),(c&&(t||u)||!c&&i)&&(g["aria-disabled"]=i),c&&(!t||d)&&(g.disabled=i),g},[s,i,t,u,d,c,o])}}function No(e,t,{detail:i=0,pointerType:s=""}={}){e.dispatchEvent(new(Rn(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:i,pointerType:s,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function vi(e={}){const{disabled:t=!1,focusableWhenDisabled:i,tabIndex:s=0,native:o=!0,composite:c}=e,u=b.useRef(null),d=ab(!0),f=c??d!==void 0,{props:g}=x5({focusableWhenDisabled:i,disabled:t,composite:f,tabIndex:s,isNativeButton:o}),m=b.useCallback(()=>{const S=u.current;dy(S)&&f&&t&&g.disabled===void 0&&S.disabled&&(S.disabled=!1)},[t,g.disabled,f]);_e(m,[m]);const h=b.useCallback((S={})=>{const{onClick:w,onMouseDown:C,onKeyUp:E,onKeyDown:R,onPointerDown:k,...O}=S;return Ar({onClick(A){if(t){A.preventDefault();return}w?.(A)},onMouseDown(A){t||C?.(A)},onKeyDown(A){if(t||(Vh(A),R?.(A),A.baseUIHandlerPrevented))return;const N=A.target===A.currentTarget,j=A.currentTarget,D=dy(j),M=!o&&S5(j),_=N&&(o?D:!M),L=A.key==="Enter",q=A.key===" ",X=j.getAttribute("role"),B=X?.startsWith("menuitem")||X==="option"||X==="gridcell";if(N&&f&&q){if(A.defaultPrevented&&B)return;A.preventDefault(),(!o||D)&&(A.preventBaseUIHandler(),No(j,A));return}if(!_||o||!q&&!L){N&&M&&q&&A.preventDefault();return}A.defaultPrevented||(A.preventDefault(),L&&(A.preventBaseUIHandler(),No(j,A)))},onKeyUp(A){if(!t){if(Vh(A),E?.(A),A.target===A.currentTarget&&o&&f&&dy(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!o&&!f&&!A.defaultPrevented&&A.key===" "&&(A.preventBaseUIHandler(),No(A.currentTarget,A))}},onPointerDown(A){if(t){A.preventDefault();return}k?.(A)}},o?{type:"button"}:{role:"button"},g,O)},[t,g,f,o]),x=Be(S=>{u.current=S,m()});return{getButtonProps:h,buttonRef:x}}function dy(e){return bn(e)&&e.tagName==="BUTTON"}function S5(e){return bn(e)&&e.tagName==="A"&&!!e.href}const w5=b.forwardRef(function(t,i){const{render:s,className:o,disabled:c=!1,focusableWhenDisabled:u=!1,nativeButton:d=!0,style:f,...g}=t,{getButtonProps:m,buttonRef:h}=vi({disabled:c,focusableWhenDisabled:u,native:d});return kt("button",t,{state:{disabled:c},ref:[i,h],props:[g,m]})}),Sk=Uo("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 at({className:e,variant:t="default",size:i="default",...s}){return v.jsx(w5,{"data-slot":"button",className:Fe(Sk({variant:t,size:i,className:e})),...s})}const E5=Uo("group/code-block relative flex w-full min-w-0 flex-col overflow-hidden rounded-md text-sm has-[>[data-slot=code-block-content]:focus-visible]:ring-2 has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/30 data-[size=sm]:text-xs",{variants:{variant:{default:"border border-input text-foreground has-[>[data-slot=code-block-content]:focus-visible]:border-ring dark:bg-input/30",destructive:"border border-destructive/30 text-destructive dark:border-destructive/40"}},defaultVariants:{variant:"default"}});function R5({className:e,variant:t="default",size:i="default",...s}){return v.jsx("div",{"data-slot":"code-block","data-variant":t,"data-size":i,className:Fe(E5({variant:t}),e),...s})}function C5({className:e,...t}){return v.jsx("div",{"data-slot":"code-block-header",className:Fe("flex min-w-0 shrink-0 items-center gap-2 px-3 pt-3 text-muted-foreground group-data-[size=sm]/code-block:px-2 group-data-[size=sm]/code-block:pt-2 group-data-[variant=destructive]/code-block:text-destructive *:has-[>[data-slot=code-block-title]]:min-w-0",e),...t})}function T5({className:e,...t}){return v.jsx("div",{"data-slot":"code-block-title",className:Fe("min-w-0 truncate font-sans text-xs font-medium text-foreground group-data-[variant=destructive]/code-block:text-destructive [&_svg]:pointer-events-none [&_svg]:inline-block [&_svg]:align-middle [&_svg:not([class*='size-'])]:size-3.5 *:[svg]:me-1.5",e),...t})}function k5({className:e,...t}){return v.jsx("div",{"data-slot":"code-block-actions",className:Fe("-my-1 ms-auto -me-1.5 flex shrink-0 items-center gap-1 [[data-slot=code-block]>&]:absolute [[data-slot=code-block]>&]:end-2 [[data-slot=code-block]>&]:top-2 [[data-slot=code-block]>&]:z-10 [[data-slot=code-block]>&]:m-0 [[data-slot=code-block]>&]:opacity-0 [[data-slot=code-block]>&]:transition-opacity [[data-slot=code-block]>&]:group-focus-within/code-block:opacity-100 [[data-slot=code-block]>&]:group-hover/code-block:opacity-100 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:end-1.5 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:top-1.5 [[data-slot=code-block]>&]:pointer-coarse:opacity-100 [[data-slot=code-block]>&]:*:[button]:bg-background [[data-slot=code-block]>&]:*:[button]:ring-1 [[data-slot=code-block]>&]:*:[button]:ring-foreground/10",e),...t})}function O5({value:e,variant:t="ghost",size:i="icon-xs",className:s,onClick:o,...c}){const[u,d]=b.useState(!1);return b.useEffect(()=>{if(!u)return;const f=setTimeout(()=>d(!1),2e3);return()=>clearTimeout(f)},[u]),v.jsxs(v.Fragment,{children:[v.jsx(at,{"data-slot":"code-block-copy-button","data-copied":u||void 0,variant:t,size:i,"aria-label":u?"Copied":"Copy",className:Fe(s),onClick:f=>{o?.(f),navigator.clipboard.writeText(e).then(()=>d(!0)).catch(()=>{})},...c,children:u?v.jsx(od,{}):v.jsx(bT,{})}),v.jsx("span",{"aria-live":"polite",className:"sr-only",children:u?"Copied":""})]})}function A5({className:e,children:t,style:i,wrap:s=!1,lineNumbers:o=!1,startLine:c=1,...u}){return v.jsx("pre",{"data-slot":"code-block-content","data-wrap":s||void 0,"data-numbered":o||void 0,dir:"ltr",tabIndex:0,style:{counterReset:`line ${c-1}`,...i},className:Fe("min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto px-3 py-3 text-start font-mono leading-relaxed outline-none group-has-data-[slot=code-block-footer]/code-block:pb-2 group-has-data-[slot=code-block-header]/code-block:pt-2 group-data-[size=sm]/code-block:px-2 group-data-[size=sm]/code-block:py-2 group-data-[size=sm]/code-block:group-has-data-[slot=code-block-header]/code-block:pt-1.5 data-wrap:scroll-fade-y data-wrap:wrap-break-word data-wrap:whitespace-pre-wrap",e),...u,children:v.jsx("code",{"data-slot":"code-block-code",className:"grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0",children:o&&typeof t=="string"?t.replace(/\n$/,"").split(`
11
- `).map((d,f)=>v.jsx(N5,{children:d},f)):t})})}const M5=Uo("relative -mx-3 block min-h-lh px-3 group-data-[size=sm]/code-block:-mx-2 group-data-[size=sm]/code-block:px-2 before:min-w-6 before:text-end before:text-muted-foreground after:absolute after:start-1 after:top-0 after:text-muted-foreground after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:gap-x-3 in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']",{variants:{variant:{default:"",added:"bg-muted after:content-['+']",removed:"bg-destructive/10 after:text-destructive after:content-['−']",highlighted:"bg-muted"}},defaultVariants:{variant:"default"}});function N5({className:e,variant:t="default",children:i,...s}){const o=i==null||i===""||Array.isArray(i)&&i.length===0;return v.jsx("span",{"data-slot":"code-block-line","data-variant":t,className:Fe(M5({variant:t}),e),...s,children:v.jsx("span",{"data-slot":"code-block-line-content",className:"min-w-0",children:o?`
12
- `:i})})}const wk=b.createContext(void 0);function ld(e){const t=b.useContext(wk);if(t===void 0&&!e)throw new Error(gn(47));return t}const D5={...Ys,disabled:e=>e.disabled,instantType:e=>e.instantType==="trigger-change"&&!Ys.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===Qi&&Ys.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod==="touch"&&e.openChangeReason===Qi,hasTriggerFocusGuards:(e,t)=>Ys.isOpenedByTrigger(e,t)&&!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 j5 extends oc{constructor(t,i,s){const o=new sd;super(I5(t,o,i,s),P5(o),D5)}setOpen=(t,i)=>{const s=i.reason===Kn,o=i.reason===Qi&&i.event.detail===0,c=!t&&(i.reason===ed||i.reason==null),u=Pp(i),d=this.select("activeTriggerId");if(!t&&i.reason===XR&&i.trigger==null&&d!=null&&(i.trigger=this.context.triggerElements.getById(d)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(t,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,i);const f=()=>{const m=Ip(this.state,t,i.trigger,u());m.openChangeReason=i.reason,this.update(m)};s?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(wC,()=>{this.context.stickIfOpen=!1}),fr.flushSync(f)):f();let g;o?g="click":c?g="dismiss":i.reason===Ha&&(g="focus"),this.set("instantType",g)}}function I5(e,t,i,s=!1){const o={...Fp(t,i,s),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 o.open&&e?.mounted===void 0&&(o.mounted=!0),o}function P5(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeTriggerFocusGuardRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new Pi,stickIfOpen:!0,triggerElements:e}}const SE=Qu(function({props:t}){const{children:i,open:s,defaultOpen:o=!1,onOpenChange:c,onOpenChangeComplete:u,modal:d=!1,handle:f,triggerId:g,defaultTriggerId:m=null}=t,h=z5(f,{modal:d,open:o,openProp:s,activeTriggerId:m,triggerIdProp:g});h.useControlledProp("openProp",s),h.useControlledProp("triggerIdProp",g);const x=h.useState("open"),S=h.useState("mounted"),w=h.useState("payload");h.useContextCallback("onOpenChange",c),h.useContextCallback("onOpenChangeComplete",u),PC(h,x),zp(h);const{forceUnmount:C}=_p(x,h,()=>{h.context.stickIfOpen=!0,h.set("openChangeReason",null)});h.useSyncedValues({modal:d}),b.useEffect(()=>{x||h.context.stickIfOpenTimeout.clear()},[h,x]),b.useImperativeHandle(t.actionsRef,()=>({unmount:C,close:()=>h.setOpen(!1,ut(td))}),[C,h]);const E=x||S||f!=null;return v.jsxs(wk.Provider,{value:h,children:[f&&v.jsx(jp,{handle:f,store:h}),E&&v.jsx(_5,{store:h,modal:d}),typeof i=="function"?i({payload:w}):i]})});function L5(e){return ld(!0)?v.jsx(SE,{props:e}):v.jsx(NC,{children:v.jsx(SE,{props:e})})}function z5(e,t){const i=Vv((s,o)=>new j5(t,s,o));return b.useEffect(()=>i.context.stickIfOpenTimeout.disposeEffect(),[i]),i}function _5({store:e,modal:t}){const i=e.useState("floatingRootContext"),s=rd(i,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),o=s.reference,c=s.floating;return Up(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:c}),null}const U5=300;function Ek(e,t){function i(c,u,d){const f=c.currentTarget;fr.flushSync(()=>{e.setOpen(!1,ut(Ha,c.nativeEvent,f))}),Aj(f.isConnected?f:t.current,u,d)?.focus()}function s(c){i(c,-1,e.select("positionerElement"))}function o(c){const u=e.select("positionerElement");u&&ql(c,u)?e.context.beforeContentFocusGuardRef.current?.focus():i(c,1,u)}return{handlePreFocusGuardFocus:s,handleFocusTargetFocus:o}}function H5(e){const t=b.useRef(""),i=b.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:b.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:i}}function cc(e,t){const i=b.useRef(e),s=Be(t);_e(()=>{i.current!==e&&s(i.current),i.current=e},[e,s])}function ob(e,t){const i=Be((c,u)=>{(typeof e=="function"?e():e)||t(u||(mp?"touch":""))}),{onClick:s,onPointerDown:o}=H5(i);return b.useMemo(()=>({onClick:s,onPointerDown:o}),[s,o])}function Rk(e){const[t,i]=b.useState(null),s=ob(e,i);return cc(e,o=>{o&&!e&&i(null)}),b.useMemo(()=>({openMethod:t,triggerProps:s}),[t,s])}const F5=pp(function(t,i){const{render:s,className:o,style:c,disabled:u=!1,nativeButton:d=!0,handle:f,payload:g,openOnHover:m=!1,delay:h=U5,closeDelay:x=0,id:S,...w}=t,C=ld(!0),R=Bp(f)??C;if(!R)throw new Error(gn(74));const k=ar(S),O=R.useState("isTriggerActive",k),A=R.useState("floatingRootContext"),N=R.useState("isOpenedByTrigger",k),j=R.useState("triggerPopupId",k),D=b.useRef(null),{registerTrigger:M,isMountedByThisTrigger:_}=Lp(k,D,R,{payload:g,disabled:u,openOnHover:m,closeDelay:x}),L=R.useState("isPressOpenedByTrigger",k),q=R.useState("isTouchPressOpen",m),X=R.useState("hasTriggerFocusGuards",k),B=Gv(A,{enabled:!u&&m&&!q,mouseOnly:!0,move:!1,handleClose:$v(),restMs:h,delay:{close:x},triggerElementRef:D,isActiveTrigger:O,isClosing:()=>R.select("transitionStatus")==="ending"}),H=Be(()=>R.context.stickIfOpen),U=Np(A,{stickIfOpen:H}),z=ob(()=>R.select("open"),W=>{R.set("openMethod",W)}),Q=R.useState("triggerProps",_),{getButtonProps:$,buttonRef:K}=vi({disabled:u,native:d}),Y={open(W){return L?zu.open(W):wp.open(W)}},{handlePreFocusGuardFocus:ee,handleFocusTargetFocus:G}=Ek(R,D),I=kt("button",t,{state:{disabled:u,open:N},ref:[K,i,M,D],props:[U.reference,B,Q,z,{[_v]:"",id:k,"aria-haspopup":"dialog","aria-expanded":N,"aria-controls":j},w,$],stateAttributesMapping:Y}),V=v.jsx(b.Fragment,{children:I},k);return X?v.jsxs(b.Fragment,{children:[v.jsx(Fa,{ref:R.context.beforeTriggerFocusGuardRef,onFocus:ee}),V,v.jsx(Fa,{ref:R.context.triggerFocusTargetRef,onFocus:G})]}):V}),Ck=b.createContext(void 0);function B5(){const e=b.useContext(Ck);if(e===void 0)throw new Error(gn(45));return e}const V5=b.forwardRef(function(t,i){const{keepMounted:s=!1,...o}=t;return ld().useState("mounted")||s?v.jsx(Ck.Provider,{value:s,children:v.jsx(Ap,{ref:i,...o})}):null}),Tk=b.createContext(void 0);function K5(){const e=b.useContext(Tk);if(!e)throw new Error(gn(46));return e}const Wp=b.forwardRef(function(t,i){const{cutout:s,...o}=t;let c;if(s){const u=s.getBoundingClientRect();c=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${u.left}px ${u.top}px,${u.left}px ${u.bottom}px,${u.right}px ${u.bottom}px,${u.right}px ${u.top}px,${u.left}px ${u.top}px)`}return v.jsx("div",{ref:i,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:c}})});function kk(e){const{store:t,domReference:i,positionerElement:s,open:o}=e,c=b.useRef(null),u=b.useRef(null),d=Dp(s);_e(()=>{o||(u.current?.abort(),u.current=null,t.state.instantType==="trigger-change"&&t.set("instantType",void 0))},[o,t]),_e(()=>{const f=i,g=c.current;if(f&&(c.current=f),!g||!f||f===g||!t.select("open"))return;t.set("instantType",void 0);const m=new AbortController;return u.current=m,d(()=>{t.select("open")&&t.set("instantType","trigger-change")},m.signal),()=>{m.abort()}},[i,d,t])}let wE={},EE={},RE="";function eg(e,t){return Zu(e)?e:t}function CE(e,t,i){return/hidden|clip/.test(e.getComputedStyle(eg(t,i)).overflowY)}function q5(e){if(typeof document>"u")return!1;const t=$t(e);return Rn(t).innerWidth-t.documentElement.clientWidth>0}function Y5(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const i=$t(e),s=i.documentElement,o=i.body,c=eg(s,o),u=c.style.overflowY,d=s.style.scrollbarGutter;s.style.scrollbarGutter="stable",c.style.overflowY="scroll";const f=c.offsetWidth;c.style.overflowY="hidden";const g=c.offsetWidth;return c.style.overflowY=u,s.style.scrollbarGutter=d,f===g}function G5(e){const t=$t(e),i=t.documentElement,s=t.body,o=eg(i,s),c={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,c)}}function $5(e){const t=$t(e),i=t.documentElement,s=t.body,o=Rn(i);let c=0,u=0,d=!1;const f=Or.create();if(Ss&&(o.visualViewport?.scale??1)!==1)return()=>{};function g(){const S=o.getComputedStyle(i),w=o.getComputedStyle(s),R=(S.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";c=i.scrollTop,u=i.scrollLeft,wE={scrollbarGutter:i.style.scrollbarGutter,overflowY:i.style.overflowY,overflowX:i.style.overflowX},RE=i.style.scrollBehavior,EE={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const k=i.scrollHeight>i.clientHeight,O=i.scrollWidth>i.clientWidth,A=S.overflowY==="scroll"||w.overflowY==="scroll",N=S.overflowX==="scroll"||w.overflowX==="scroll",j=Math.max(0,o.innerWidth-s.clientWidth),D=Math.max(0,o.innerHeight-s.clientHeight),M=parseFloat(w.marginTop)+parseFloat(w.marginBottom),_=parseFloat(w.marginLeft)+parseFloat(w.marginRight),L=eg(i,s);if(d=Y5(e),d){i.style.scrollbarGutter=R,L.style.overflowY="hidden",L.style.overflowX="hidden";return}Object.assign(i.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(k||A)&&(i.style.overflowY="scroll"),(O||N)&&(i.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:M||D?`calc(100dvh - ${M+D}px)`:"100dvh",width:_||j?`calc(100vw - ${_+j}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),s.scrollTop=c,s.scrollLeft=u,i.setAttribute("data-base-ui-scroll-locked",""),i.style.scrollBehavior="unset"}function m(){Object.assign(i.style,wE),Object.assign(s.style,EE),d||(i.scrollTop=c,i.scrollLeft=u,i.removeAttribute("data-base-ui-scroll-locked"),i.style.scrollBehavior=RE)}function h(){m(),f.request(g)}g();const x=Lt(o,"resize",h);return()=>{f.cancel(),m(),typeof o.removeEventListener=="function"&&x()}}class Q5{lockCount=0;restore=null;timeoutLock=Pi.create();timeoutUnlock=Pi.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const i=$t(t),s=i.documentElement,o=i.body,c=Rn(s);if(CE(c,s,o)){const d=new c.MutationObserver(()=>{CE(c,s,o)||(d.disconnect(),this.restore=null,this.lock(t))}),f={attributes:!0};d.observe(s,f),d.observe(o,f),this.restore=()=>d.disconnect();return}const u=mp||!q5(t);this.restore=u?G5(t):$5(t)}}const X5=new Q5;function Ok(e=!0,t=null){_e(()=>{if(e)return X5.acquire(t)},[e,t])}const Z5=20;function lb(e,t,i,s){const[o,c]=b.useState(!1);_e(()=>{if(!e||!t||i==null){c(!1);return}const u=$t(i).documentElement.clientWidth,d=i.offsetWidth;c(u>0&&d>0&&d>=u-Z5)},[e,t,i]),Ok(e&&(!t||o),s)}const J5=b.forwardRef(function(t,i){const{render:s,className:o,style:c,anchor:u,positionMethod:d,side:f,align:g,sideOffset:m,alignOffset:h,collisionBoundary:x="clipping-ancestors",collisionPadding:S,arrowPadding:w,sticky:C,disableAnchorTracking:E=!1,collisionAvoidance:R=Uv,...k}=t,O=ld(),A=B5(),N=Fv(),j=O.useState("floatingRootContext"),D=O.useState("mounted"),M=O.useState("open"),_=O.useState("openChangeReason"),L=O.useState("activeTriggerElement"),q=O.useState("modal"),X=O.useState("openMethod"),B=O.useState("positionerElement"),H=O.useState("instantType"),U=O.useState("transitionStatus"),z=O.useState("adaptiveOrigin"),Q=Yp({anchor:u,floatingRootContext:j,positionMethod:d,mounted:D,side:f,sideOffset:m,align:g,alignOffset:h,arrowPadding:w,collisionBoundary:x,collisionPadding:S,sticky:C,disableAnchorTracking:E,keepMounted:A,nodeId:N,collisionAvoidance:R,adaptiveOrigin:z}),$=j.useState("domReferenceElement");kk({store:O,domReference:$,positionerElement:B,open:M});const K=q===!0&&_!==Kn;lb(M&&K,X==="touch",B,L);const Y=O.useStateSetter("positionerElement"),ee={open:M,side:Q.side,align:Q.align,anchorHidden:Q.anchorHidden,instant:H},G=Gp(t,ee,{styles:Q.positionerStyles,transitionStatus:U,props:k,refs:[i,Y],hidden:!D,inert:!M});return v.jsxs(Tk.Provider,{value:Q,children:[D&&K&&v.jsx(Wp,{inert:$p(!M),cutout:L}),v.jsx(MC,{id:N,children:G})]})}),Yy="ArrowUp",Gy="ArrowDown",$y="ArrowLeft",Qy="ArrowRight",Xy="Home",Zy="End",cd=new Set([Yy,Gy,$y,Qy,Xy,Zy]),Ak="Shift",W5=[Ak,"Control","Alt","Meta"];function ez(e){return bn(e)&&e.tagName==="INPUT"}function TE(e){return!!(ez(e)&&e.selectionStart!=null||bn(e)&&e.tagName==="TEXTAREA")}function kE(e,t,i,s){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,c=e.scrollTop;const u=e.clientWidth<e.scrollWidth,d=e.clientHeight<e.scrollHeight;if(u&&s!=="vertical"){const f=OE(e,t,"left"),g=oh(e),m=oh(t);i==="ltr"&&(f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-g.scrollPaddingRight?o=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+g.scrollPaddingRight:f-m.scrollMarginLeft<e.scrollLeft+g.scrollPaddingLeft&&(o=f-m.scrollMarginLeft-g.scrollPaddingLeft)),i==="rtl"&&(f-m.scrollMarginLeft<e.scrollLeft+g.scrollPaddingLeft?o=f-m.scrollMarginLeft-g.scrollPaddingLeft:f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-g.scrollPaddingRight&&(o=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+g.scrollPaddingRight))}if(d&&s!=="horizontal"){const f=OE(e,t,"top"),g=oh(e),m=oh(t);f-m.scrollMarginTop<e.scrollTop+g.scrollPaddingTop?c=f-m.scrollMarginTop-g.scrollPaddingTop:f+t.offsetHeight+m.scrollMarginBottom>e.scrollTop+e.clientHeight-g.scrollPaddingBottom&&(c=f+t.offsetHeight+m.scrollMarginBottom-e.clientHeight+g.scrollPaddingBottom)}e.scrollTo({left:o,top:c,behavior:"auto"})}function OE(e,t,i){const s=i==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[s],t.offsetParent!==e);)t=t.offsetParent;return o}function oh(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const tz=b.createContext(void 0);function tg(e){return b.useContext(tz)}const nz=b.createContext(void 0);function rz(){const[e,t]=b.useState(0),i=Be(()=>(t(o=>o+1),()=>{t(o=>Math.max(0,o-1))}));return{context:b.useMemo(()=>({register:i}),[i]),hasClosePart:e>0}}const iz=b.forwardRef(function(t,i){const{render:s,className:o,style:c,initialFocus:u,finalFocus:d,...f}=t,g=ld(),m=K5(),h=tg()!=null,{context:x,hasClosePart:S}=rz(),w=g.useState("open"),C=g.useState("openMethod"),E=g.useState("instantType"),R=g.useState("transitionStatus"),k=g.useState("popupProps"),O=g.useState("titleElementId"),A=g.useState("descriptionElementId"),N=g.useState("modal"),j=g.useState("mounted"),D=g.useState("openChangeReason"),M=g.useState("activeTriggerElement"),_=g.useState("floatingRootContext"),L=_.useState("floatingId"),q=g.useState("disabled"),X=g.useState("openOnHover"),B=g.useState("closeDelay");Li({open:w,ref:g.context.popupRef,onComplete(){w&&g.context.onOpenChangeComplete?.(!0)}}),Yv(_,{enabled:X&&!q,closeDelay:B});const H=u===void 0?IC(g.context.popupRef):u,U=N!==!1&&S;g.useSyncedValue("focusManagerModal",U);const z=g.useStateSetter("popupElement"),Q={open:w,side:m.side,align:m.align,instant:E,transitionStatus:R},$=kt("div",t,{state:Q,ref:[i,g.context.popupRef,z],props:[k,{id:L,role:"dialog",...id,"aria-labelledby":O,"aria-describedby":A,onKeyDown(K){h&&cd.has(K.key)&&K.stopPropagation()}},ad(R),f],stateAttributesMapping:Ep});return v.jsx(Mp,{context:_,openInteractionType:C,modal:U,disabled:!j||D===Kn,initialFocus:H,returnFocus:d,restoreFocus:"popup",getInsideElements:()=>[g.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:bn(M)?M:void 0,nextFocusableElement:g.context.triggerFocusTargetRef,beforeContentFocusGuardRef:g.context.beforeContentFocusGuardRef,children:v.jsx(nz.Provider,{value:x,children:$})})});function Mk({...e}){return v.jsx(L5,{"data-slot":"popover",...e})}function sz({...e}){return v.jsx(F5,{"data-slot":"popover-trigger",...e})}function Nk({anchor:e,align:t="center",alignOffset:i=0,side:s="bottom",sideOffset:o=4,className:c,...u}){return v.jsx(V5,{children:v.jsx(J5,{anchor:e,className:"isolate z-50 outline-none",align:t,alignOffset:i,side:s,sideOffset:o,children:v.jsx(iz,{"data-slot":"popover-content",className:Fe("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",c),...u})})})}const Dk=b.createContext(void 0),Br=e=>{const t=b.useContext(Dk);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},az=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(Dk.Provider,{value:e,children:t})),oz={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var lz=class{#e=oz;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};const Oo=new lz;function cz(e){setTimeout(e,0)}const uz=typeof window>"u"||"Deno"in globalThis;function Hr(){}function dz(e,t){return typeof e=="function"?e(t):e}function jk(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ik(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pn(e,t){return typeof e=="function"?e(t):e}function AE(e,t){const{type:i="all",exact:s,fetchStatus:o,predicate:c,queryKey:u,stale:d}=e;if(u){if(s){if(t.queryHash!==cb(u,t.options))return!1}else if(!ic(t.queryKey,u))return!1}if(i!=="all"){const f=t.isActive();if(i==="active"&&!f||i==="inactive"&&f)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||o&&o!==t.state.fetchStatus||c&&!c(t))}function ME(e,t){const{exact:i,status:s,predicate:o,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(i){if(Po(t.options.mutationKey)!==Po(c))return!1}else if(!ic(t.options.mutationKey,c))return!1}return!(s&&t.state.status!==s||o&&!o(t))}function cb(e,t){return(t?.queryKeyHashFn||Po)(e)}function Po(e){return JSON.stringify(e,(t,i)=>Jy(i)?Object.keys(i).sort().reduce((s,o)=>(s[o]=i[o],s),{}):i)}function ic(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let s=0;s<t.length;s++)if(!ic(e[s],t[s]))return!1;return!0}const i=Object.keys(t);for(const s of i)if(!ic(e[s],t[s]))return!1;return!0}return!1}const fz=Object.prototype.hasOwnProperty;function ub(e,t,i=0){if(e===t)return e;if(i>500)return t;const s=NE(e)&&NE(t);if(!s&&!(Jy(e)&&Jy(t)))return t;const o=(s?e:Object.keys(e)).length,c=s?t:Object.keys(t),u=c.length,d=s?new Array(u):{};let f=0;for(let g=0;g<u;g++){const m=s?g:c[g],h=e[m],x=t[m];if(h===x){d[m]=h,(s?g<o:fz.call(e,m))&&f++;continue}if(h===null||x===null||typeof h!="object"||typeof x!="object"){d[m]=x;continue}const S=ub(h,x,i+1);d[m]=S,S===h&&f++}return o===u&&f===o?e:d}function kh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(e[i]!==t[i])return!1;return!0}function NE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jy(e){if(!DE(e))return!1;const t=Object.getPrototypeOf(e),i=t?.constructor;if(i===void 0)return!0;if(typeof i!="function")return!1;const s=i.prototype;return!(!DE(s)||!s.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function DE(e){return Object.prototype.toString.call(e)==="[object Object]"}function hz(e){return new Promise(t=>{Oo.setTimeout(t,e)})}function Wy(e,t,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,t):i.structuralSharing!==!1?ub(e,t):t}function pz(e,t,i=0){const s=[...e,t];return i&&s.length>i?s.slice(1):s}function gz(e,t,i=0){const s=[t,...e];return i&&s.length>i?s.slice(0,-1):s}const db=Symbol();function Pk(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===db?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fb(e,t){return typeof e=="function"?e(...t):!!e}function mz(e,t,i){let s=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),s||(s=!0,o.aborted?i():o.addEventListener("abort",i,{once:!0})),o)}),e}let yz=()=>uz;const hb=()=>yz();var uc=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(){}},vz=class extends uc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const pb=new vz,bz=cz;function xz(){let e=[],t=0,i=d=>{d()},s=d=>{d()},o=bz;const c=d=>{t?e.push(d):o(()=>{i(d)})},u=()=>{const d=e;e=[],d.length&&o(()=>{s(()=>{d.forEach(f=>{i(f)})})})};return{batch:d=>{let f;t++;try{f=d()}finally{t--,t||u()}return f},batchCalls:d=>(...f)=>{c(()=>{d(...f)})},schedule:c,setNotifyFunction:d=>{i=d},setBatchNotifyFunction:d=>{s=d},setScheduler:d=>{o=d}}}const Wn=xz();var Sz=class extends uc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",i)}}}}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(t=>{t(e)}))}isOnline(){return this.#e}};const tp=new Sz;function wz(e){return Math.min(1e3*2**e,3e4)}function Lk(e){return(e??"online")==="online"?tp.isOnline():!0}var ev=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function zk(e){let t=!1,i=0,s,o="pending",c,u;const d=new Promise((k,O)=>{c=k,u=O});d.catch(Hr);const f=()=>o!=="pending",g=k=>{if(!f()){const O=new ev(k);C(O),e.onCancel?.(O)}},m=()=>{t=!0},h=()=>{t=!1},x=()=>pb.isFocused()&&(e.networkMode==="always"||tp.isOnline())&&e.canRun(),S=()=>Lk(e.networkMode)&&e.canRun(),w=k=>{f()||(s?.(),o="resolved",c(k))},C=k=>{f()||(s?.(),o="rejected",u(k))},E=k=>new Promise(O=>{s=A=>{(f()||k())&&O(A)},e.onPause?.()}).then(()=>{s=void 0,f()||e.onContinue?.()}),R=()=>{if(f())return;let k;const O=i===0?e.initialPromise:void 0;try{k=O??e.fn()}catch(A){k=Promise.reject(A)}Promise.resolve(k).then(w).catch(A=>{if(f())return;const N=e.retry??(hb()?0:3),j=e.retryDelay??wz,D=typeof j=="function"?j(i,A):j,M=N===!0||typeof N=="number"&&i<N||typeof N=="function"&&N(i,A);if(t||!M){C(A);return}i++,e.onFail?.(i,A),hz(D).then(()=>x()?void 0:E(x)).then(()=>{t?C(A):R()})})};return{promise:d,status:()=>o,cancel:g,continue:()=>(s?.(),d),cancelRetry:m,continueRetry:h,canStart:S,start:()=>(S()?R():E(S).then(R),d)}}var _k=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jk(this.gcTime)&&(this.#e=Oo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hb()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Oo.clearTimeout(this.#e),this.#e=void 0)}};function Ez(e){return{onFetch:(t,i)=>{const s=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let d={pages:[],pageParams:[]},f=0;const g=async()=>{let m=!1;const h=w=>{mz(w,()=>t.signal,()=>m=!0)},x=Pk(t.options,t.fetchOptions),S=async(w,C,E)=>{if(m)return Promise.reject(t.signal.reason);if(C==null&&w.pages.length)return Promise.resolve(w);const k=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};return h(j),j})(),O=await x(k),{maxPages:A}=t.options,N=E?gz:pz;return{pages:N(w.pages,O,A),pageParams:N(w.pageParams,C,A)}};if(o&&c.length){const w=o==="backward",C=w?Rz:jE,E={pages:c,pageParams:u};d=await S(E,C(s,E),w)}else{const w=e??c.length;do{const C=f===0?u[0]===void 0?s.initialPageParam:u[0]:jE(s,d);if(f>0&&C==null)break;d=await S(d,C),f++}while(f<w)}return d};t.options.persister?t.fetchFn=()=>t.options.persister?.(g,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},i):t.fetchFn=g}}}function jE(e,{pages:t,pageParams:i}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,i[s],i):void 0}function Rz(e,{pages:t,pageParams:i}){return t.length>0?e.getPreviousPageParam?.(t[0],t,i[0],i):void 0}var Cz=class extends _k{#e;#t;#n;#r;#s;#i;#a;#l;constructor(e){super(),this.#l=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=PE(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.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=PE(this.options);t.data!==void 0&&(this.setState(IE(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const i=Wy(this.state.data,e,this.options);return this.#o({data:i,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),i}setState(e){this.#o({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Hr).catch(Hr):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===db||!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:!Ik(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.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 t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#i&&(this.#l||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(g=>g.options.queryFn);f&&this.setOptions(f.options)}const i=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#l=!0,i.signal)})},o=()=>{const f=Pk(this.options,t),m=(()=>{const h={client:this.#s,queryKey:this.queryKey,meta:this.meta};return s(h),h})();return this.#l=!1,this.options.persister?this.options.persister(f,m,this):f(m)},u=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:o};return s(f),f})();(this.#e==="infinite"?Ez(this.options.pages):this.options.behavior)?.onFetch(u,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#o({type:"fetch",meta:u.fetchOptions?.meta});const d=this.#i=zk({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:f=>{f instanceof ev&&f.revert&&this.setState({...this.#n,fetchStatus:"idle"}),i.abort()},onFail:(f,g)=>{this.#o({type:"failed",failureCount:f,error:g})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const f=await d.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#r.config.onSuccess?.(f,this),this.#r.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof ev){if(f.silent)return this.#i.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#o({type:"error",error:f}),this.#r.config.onError?.(f,this),this.#r.config.onSettled?.(this.state.data,f,this),f}finally{this.#i===d&&(this.#i=void 0),this.scheduleGc()}}#o(e){const t=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Uk(i.data,this.options),fetchMeta:e.meta??null};case"success":const s={...i,...IE(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?s:void 0,s;case"error":const o=e.error;return{...i,error:o,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=t(this.state),Wn.batch(()=>{this.observers.slice().forEach(i=>{i.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Uk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lk(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function IE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function PE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,i=t!==void 0,s=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Tz=class extends uc{#e;#t=void 0;#n=void 0;#r=void 0;#s;#i;#a;#l;#o;#h;#u;#d;#c;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),LE(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tv(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,i=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),t._defaulted&&!kh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&zE(this.#t,i,this.options,t)&&this.#f(),this.updateResult(),s&&(this.#t!==i||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||Pn(this.options.staleTime,this.#t)!==Pn(t.staleTime,this.#t))&&this.#m();const o=this.#y();s&&(this.#t!==i||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||o!==this.#c)&&this.#v(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(t,e);return kh(this.getCurrentResult(),i)||(this.#r=i,this.#i=this.options,this.#s=this.#t.state),i}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(i,s)=>(this.trackProp(s),t?.(s),Reflect.get(i,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this.#e,t);let s=()=>{},o;const c=new Promise(u=>{o=u,s=this.#e.getQueryCache().subscribe(d=>{d.type==="updated"&&d.query.queryHash===i.queryHash&&i.state.data!==void 0&&(s(),u(this.createResult(i,t)))})});return Promise.race([i.fetch(t).then(()=>{const u=this.createResult(i,t);return o?.(u),u}).finally(()=>{s()}),c])}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Hr)),t}#g(e){return!hb()&&Pn(this.options.enabled,this.#t)!==!1&&jk(e)}#m(){this.#x();const e=Pn(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#g(e))return;const t=Ik(this.#r.dataUpdatedAt,e)+1;this.#u=Oo.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#y(){return Pn(this.options.refetchInterval,this.#t)??!1}#v(e){this.#S(),this.#c=e,!(this.#c===0||!this.#g(this.#c))&&(this.#d=Oo.setInterval(()=>{(this.options.refetchIntervalInBackground||pb.isFocused())&&this.#f()},this.#c))}#b(){this.#m(),this.#v(this.#y())}#x(){this.#u!==void 0&&(Oo.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#d!==void 0&&(Oo.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){const i=this.#t,s=this.options,o=this.#r,c=this.#s,u=this.#i,d=e!==i?e.state:this.#n,{state:f}=e;let g={...f},m=!1,h;if(t._optimisticResults){const N=this.hasListeners(),j=!N&&LE(e,t),D=N&&zE(e,i,t,s);(j||D)&&(g={...g,...Uk(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=g;h=g.data;let C=!1;if(t.placeholderData!==void 0&&h===void 0&&w==="pending"){let N;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(N=o.data,C=!0):N=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,N!==void 0&&(w="success",h=Wy(o?.data,N,t),m=!0)}if(t.select&&h!==void 0&&!C)if(o&&h===c?.data&&t.select===this.#l)h=this.#o;else try{this.#l=t.select,h=t.select(h),h=Wy(o?.data,h,t),this.#o=h,this.#a=null}catch(N){this.#a=N}else h===void 0&&(this.#a=null);this.#a&&(x=this.#a,h=this.#o,S=Date.now(),w="error",m=!1);const E=g.fetchStatus==="fetching",R=w==="pending",k=w==="error",O=R&&E,A=h!==void 0;return{status:w,fetchStatus:g.fetchStatus,isPending:R,isSuccess:w==="success",isError:k,isInitialLoading:O,isLoading:O,data:h,dataUpdatedAt:g.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:g.dataUpdateCount>d.dataUpdateCount||g.errorUpdateCount>d.errorUpdateCount,isFetching:E,isRefetching:E&&!R,isLoadingError:k&&!A,isPaused:g.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:k&&A,isStale:gb(e,t),refetch:this.refetch,isEnabled:Pn(t.enabled,e)!==!1}}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#i=this.options,this.#s.data!==void 0&&(this.#h=this.#t),kh(t,e))return;this.#r=t;const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,c=typeof o=="function"?o():o;if(c==="all"||!c&&!this.#p.size)return!0;const u=new Set(c??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(d=>{const f=d;return this.#r[f]!==e[f]&&u.has(f)})})();Wn.batch(()=>{s&&this.listeners.forEach(o=>{o(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 t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}};function kz(e,t){return Pn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Pn(t.retryOnMount,e)===!1)}function LE(e,t){return kz(e,t)||e.state.data!==void 0&&tv(e,t,t.refetchOnMount)}function tv(e,t,i){if(Pn(t.enabled,e)!==!1&&Pn(t.staleTime,e)!=="static"){const s=Pn(i,e);return s==="always"||s!==!1&&gb(e,t)}return!1}function zE(e,t,i,s){return(e!==t||Pn(s.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&gb(e,i)}function gb(e,t){return Pn(t.enabled,e)!==!1&&e.isStaleByTime(Pn(t.staleTime,e))}var Oz=class extends _k{#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||Hk(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){const t=()=>{this.#s({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},s=this.#r=zk({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,d)=>{this.#s({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),o=this.state.status==="pending",c=!s.canStart();try{if(o)t();else{this.#s({type:"pending",variables:e,isPaused:c}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,i);const d=await this.options.onMutate?.(e,i);d!==this.state.context&&this.#s({type:"pending",context:d,variables:e,isPaused:c})}const u=await s.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#s({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,i)}catch(d){Promise.reject(d)}try{await this.options.onError?.(u,e,this.state.context,i)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,i)}catch(d){Promise.reject(d)}throw this.#s({type:"error",error:u}),u}finally{this.#r===s&&(this.#r=void 0),this.#n.runNext(this)}}#s(e){const t=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,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{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Wn.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Hk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Az=class extends uc{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,i){const s=new Oz({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:i});return this.add(s),s}add(e){this.#e.add(e);const t=lh(e);if(typeof t=="string"){const i=this.#t.get(t);i?i.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=lh(e);if(typeof t=="string"){const i=this.#t.get(t);if(i)if(i.length>1){const s=i.indexOf(e);s!==-1&&i.splice(s,1)}else i[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=lh(e);if(typeof t=="string"){const i=this.#t.get(t)?.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){const t=lh(e);return typeof t=="string"?this.#t.get(t)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Wn.batch(()=>{const e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(t=>{this.notify({type:"removed",mutation:t})})})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(i=>ME(t,i))}findAll(e={}){return this.getAll().filter(t=>ME(e,t))}notify(e){Wn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Wn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Hr))))}};function lh(e){return e.options.scope?.id}var Mz=class extends uc{#e;#t=void 0;#n;#r;constructor(t,i){super(),this.#e=t,this.setOptions(i),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const i=this.options;this.options=this.#e.defaultMutationOptions(t),kh(this.options,i)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&Po(i.mutationKey)!==Po(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.#s())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#i()}mutate(t,i){return this.#r=i,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??Hk();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){Wn.batch(()=>{const i=this.#r;if(i&&this.hasListeners()){const s=this.#t.variables,o=this.#t.context,c={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{i.onSuccess?.(t.data,s,o,c)}catch(u){Promise.reject(u)}try{i.onSettled?.(t.data,null,s,o,c)}catch(u){Promise.reject(u)}}else if(t?.type==="error"){try{i.onError?.(t.error,s,o,c)}catch(u){Promise.reject(u)}try{i.onSettled?.(void 0,t.error,s,o,c)}catch(u){Promise.reject(u)}}}this.listeners.forEach(s=>{s(this.#t)})})}},Fk=class extends uc{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,i){const s=t.queryKey,o=t.queryHash??cb(s,t);let c=this.get(o);return c||(c=new Cz({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(t),state:i,defaultOptions:e.getQueryDefaults(s)}),this.add(c)),c}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 t={exact:!0,...e};return this.getAll().find(i=>AE(t,i))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(i=>AE(e,i)):t}notify(e){Wn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Wn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Nz=class{#e;#t;#n;#r;#s;#i;#a;#l;constructor(e={}){this.#e=e.queryCache||new Fk,this.#t=e.mutationCache||new Az,this.#n=e.defaultOptions||{},this.#r=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=pb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=tp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=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 t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),i=this.#e.build(this,t),s=i.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Pn(t.staleTime,i))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:i})=>[t,i.data])}setQueryData(e,t,i){const s=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(s.queryHash)?.state.data,c=dz(t,o);if(c!==void 0)return this.#e.build(this,s).setData(c,{...i,manual:!0})}setQueriesData(e,t,i){return Wn.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,i)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Wn.batch(()=>{t.findAll(e).forEach(i=>{t.remove(i)})})}resetQueries(e,t){const i=this.#e;return Wn.batch(()=>{const s=i.findAll(e),o=new Set(s);return s.forEach(c=>{c.reset()}),this.refetchQueries({type:"active",predicate:c=>o.has(c)},t)})}cancelQueries(e,t={}){const i={revert:!0,...t},s=Wn.batch(()=>this.#e.findAll(e).map(o=>o.cancel(i)));return Promise.all(s).then(Hr).catch(Hr)}invalidateQueries(e,t={}){return Wn.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const i={...t,cancelRefetch:t.cancelRefetch??!0},s=Wn.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,i);return i.throwOnError||(c=c.catch(Hr)),o.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Hr)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const i=this.#e.build(this,t),s=i.isStaleByTime(Pn(t.staleTime,i))?await i.fetch(t):i.state.data,o=t.select;return o?o(s):s}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const i=this.#e.build(this,t);return i.isStaleByTime(Pn(t.staleTime,i))?i.fetch(t):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Hr).catch(Hr)}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(Hr).catch(Hr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return tp.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Po(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],i={};return t.forEach(s=>{ic(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(e,t){this.#s.set(Po(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],i={};return t.forEach(s=>{ic(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=cb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===db&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const Bk=b.createContext(!1),Dz=()=>b.useContext(Bk);Bk.Provider;function jz(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Iz=b.createContext(jz()),Pz=()=>b.useContext(Iz),Lz=(e,t,i)=>{const s=i?.state.status==="error"&&typeof e.throwOnError=="function"?fb(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||s)&&(t.isReset()||(e.retryOnMount=!1))},zz=e=>{b.useEffect(()=>{e.clearReset()},[e])},_z=({result:e,errorResetBoundary:t,throwOnError:i,query:s,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||fb(i,[e.error,s])),Uz=e=>{if(e.suspense){const i=o=>o==="static"?o:Math.max(o??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...o)=>i(s(...o)):i(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Hz=(e,t)=>e?.suspense&&t.isPending,Fz=(e,t,i)=>t.fetchOptimistic(e).catch(()=>{i.clearReset()});function Bz(e,t,i){const s=Dz(),o=Pz(),c=Br(i),u=c.defaultQueryOptions(e),d=c.getQueryCache().get(u.queryHash),f=e.subscribed!==!1;u._optimisticResults=s?"isRestoring":f?"optimistic":void 0,Uz(u),Lz(u,o,d),zz(o);const[g]=b.useState(()=>new t(c,u)),m=g.getOptimisticResult(u),h=!s&&f;if(b.useSyncExternalStore(b.useCallback(x=>{const S=h?g.subscribe(Wn.batchCalls(x)):Hr;return g.updateResult(),S},[g,h]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),b.useEffect(()=>{g.setOptions(u)},[u,g]),Hz(u,m))throw Fz(u,g,o);if(_z({result:m,errorResetBoundary:o,throwOnError:u.throwOnError,query:d,suspense:u.suspense}))throw m.error;return u.notifyOnChangeProps?m:g.trackResult(m)}function $a(e,t){return Bz(e,Tz,t)}function Vk(e,t){const i=Br(t);return Kz({filters:{...e,status:"pending"}},i).length}function Vz(){let e;return(t,i)=>{let s=[],o;return()=>{const c=t.findAll(i.filters),u=c.flatMap(d=>[d,d.state]);return(!o||u.length!==s.length||u.some((d,f)=>!Object.is(d,s[f])))&&(s=u,o=ub(e,c.map(d=>i.select?i.select(d):d.state)),e=o),o}}}function Kz(e={},t){const i=Br(t).getMutationCache(),[s]=b.useState(()=>Vz()),o=s(i,e);return b.useSyncExternalStore(b.useCallback(c=>i.subscribe(Wn.batchCalls(c)),[i]),o,o)}function sr(e,t){const i=Br(t),[s]=b.useState(()=>new Mz(i,e));b.useEffect(()=>{s.setOptions(e)},[s,e]);const o=b.useSyncExternalStore(b.useCallback(u=>s.subscribe(Wn.batchCalls(u)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=b.useCallback((...u)=>{s.mutate(u[0],u[1]).catch(Hr)},[s]);if(o.error&&fb(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}const ud="/api/settings";function qz(e){return dc({signal:e})}function Yz(e){return dc({method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function Gz(){return dc({method:"POST"},`${ud}/config-folder/open`)}function $z(e){return dc({signal:e},`${ud}/skill-copy`)}function Qz(e){return dc({method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)},`${ud}/skill-copy`)}function Xz(e){return dc({signal:e},`${ud}/skill-status`)}async function dc(e,t=ud){const i=await fetch(t,e);if(!i.ok)throw new Error(await Zz(i));return i.json()}async function Zz(e){try{return(await e.json()).error?.message??`Request failed with status ${e.status}`}catch{return`Request failed with status ${e.status}`}}const Kk=["skill-status"];function Jz(){return $a({queryKey:Kk,queryFn:({signal:e})=>Xz(e),retry:!1})}const fy=768;function mb(){const[e,t]=b.useState(void 0);return b.useEffect(()=>{const i=window.matchMedia(`(max-width: ${fy-1}px)`),s=()=>{t(window.innerWidth<fy)};return i.addEventListener("change",s),t(window.innerWidth<fy),()=>i.removeEventListener("change",s)},[]),!!e}const Wz={agents:"statusBar.targetAgents",claude:"statusBar.targetClaude"},e_={missing:"statusBar.statusMissing",outdated:"statusBar.statusOutdated",current:"statusBar.statusCurrent"},nv={missing:"text-red-600 dark:text-red-400",outdated:"text-amber-600 dark:text-amber-400",current:"text-emerald-600 dark:text-emerald-400"},qk={missing:iL,outdated:rb,current:gT};function t_(){const{t:e}=mt(),t=mb(),i=b.useRef(null),[s,o]=b.useState(!1),c=Jz(),u=c.data?.targets??[],d=u.length>0?r_(u):void 0,f=d?qk[d]:void 0,g=u.filter(({status:h})=>h!=="current"),m=`foundry settings download-skill --target ${g.map(({target:h})=>h==="agents"?".agents":".claude").join(",")}`;return v.jsxs("div",{ref:i,"data-slot":"skill-status-bar",className:`
13
- fixed inset-x-0 bottom-0 z-20 flex h-6 items-center justify-between
14
- gap-3 border-t bg-background/95 px-3 text-[11px] text-muted-foreground
15
- backdrop-blur-sm
16
- `,children:[v.jsx("span",{"data-slot":"skill-status-version",className:"min-w-0 truncate",children:c.data?e("statusBar.foundryVersion",{version:c.data.version}):e("statusBar.foundry")}),v.jsxs(Mk,{open:s,onOpenChange:o,children:[v.jsxs(sz,{openOnHover:!t,delay:120,"aria-label":e("statusBar.skillStatus"),className:`
17
- flex h-5 cursor-pointer items-center gap-1.5 rounded-sm px-1.5
18
- outline-none
19
- hover:bg-muted hover:text-foreground
20
- focus-visible:ring-2 focus-visible:ring-ring/50
21
- `,children:[v.jsx("span",{children:e("statusBar.skill")}),c.isPending&&v.jsx("span",{className:`
22
- size-1.5 animate-pulse rounded-full bg-muted-foreground
23
- `}),c.isError&&v.jsx(rb,{className:`
24
- size-3 text-amber-600
25
- dark:text-amber-400
26
- `}),f&&d&&v.jsx(f,{className:`
27
- size-3
28
- ${nv[d]}
29
- `})]}),v.jsx(Nk,{anchor:t?i:void 0,side:"top",align:t?"center":"end",sideOffset:8,className:`
30
- w-[calc(100vw-2rem)] max-w-[calc(100vw-2rem)]
31
- md:w-116
32
- `,children:v.jsxs("div",{className:"flex flex-col gap-3",children:[c.isPending&&v.jsx("p",{className:"text-xs text-muted-foreground",children:e("statusBar.skillChecking")}),c.isError&&v.jsx("p",{className:`
33
- text-xs text-amber-600
34
- dark:text-amber-400
35
- `,children:e("statusBar.skillUnavailable")}),u.length>0&&v.jsx("div",{className:"flex flex-col gap-3",children:u.map(h=>v.jsx(n_,{...h},h.target))}),g.length>0&&v.jsxs("div",{className:"flex flex-col gap-1.5",children:[v.jsx("p",{className:"text-[11px] text-muted-foreground",children:v.jsx(Jp,{i18nKey:"statusBar.skillRefreshHint",components:{settings:v.jsx("a",{href:"#/settings?panel=advanced",onClick:()=>o(!1),className:`
36
- font-medium text-foreground underline
37
- underline-offset-2
38
- `})}})}),v.jsxs(R5,{size:"sm",children:[v.jsxs(C5,{children:[v.jsxs(T5,{children:[v.jsx(SL,{}),e("statusBar.terminal")]}),v.jsx(k5,{children:v.jsx(O5,{value:m,"aria-label":e("statusBar.copyCommand")})})]}),v.jsx(A5,{wrap:!0,children:m})]})]})]})})]})]})}function n_({target:e,status:t,destination:i}){const{t:s}=mt(),o=qk[t];return v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsxs("span",{className:`
39
- flex items-center gap-1.5 text-xs font-medium text-foreground
40
- `,children:[v.jsx(o,{className:`
41
- size-3
42
- ${nv[t]}
43
- `}),s(Wz[e])]}),v.jsx("span",{className:`
44
- text-[11px]
45
- ${nv[t]}
46
- `,children:s(e_[t])})]}),v.jsx("code",{className:"font-mono text-[11px] break-all text-muted-foreground",children:i})]})}function r_(e){return e.some(({status:t})=>t==="missing")?"missing":e.some(({status:t})=>t==="outdated")?"outdated":"current"}var Yk=e=>{throw TypeError(e)},Gk=(e,t,i)=>t.has(e)||Yk("Cannot "+i),Mi=(e,t,i)=>(Gk(e,t,"read from private field"),i?i.call(e):t.get(e)),wu=(e,t,i)=>t.has(e)?Yk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),hs=(e,t,i,s)=>(Gk(e,t,"write to private field"),t.set(e,i),i),ng=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,rg=/^[\\/]{2}/;function $k(e,t){return t+e.replace(/\\/g,"/")}var _E="popstate";function UE(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function i_(e={}){function t(o,c){let{pathname:u="/",search:d="",hash:f=""}=es(o.location.hash.substring(1));return!u.startsWith("/")&&!u.startsWith(".")&&(u="/"+u),Uu("",{pathname:u,search:d,hash:f},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function i(o,c){let u=o.document.querySelector("base"),d="";if(u&&u.getAttribute("href")){let f=o.location.href,g=f.indexOf("#");d=g===-1?f:f.slice(0,g)}return d+"#"+(typeof c=="string"?c:Fr(c))}function s(o,c){Hn(o.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(c)})`)}return a_(t,i,s,e)}function _t(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Hn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function s_(){return Math.random().toString(36).substring(2,10)}function HE(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Uu(e,t,i=null,s,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?es(t):t,state:i,key:t&&t.key||s||s_(),mask:o}}function Fr({pathname:e="/",search:t="",hash:i=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function es(e){let t={};if(e){let i=e.indexOf("#");i>=0&&(t.hash=e.substring(i),e=e.substring(0,i));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function a_(e,t,i,s={}){let{window:o=document.defaultView,v5Compat:c=!1}=s,u=o.history,d="POP",f=null,g=m();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function m(){return(u.state||{idx:null}).idx}function h(){d="POP";let E=m(),R=E==null?null:E-g;g=E,f&&f({action:d,location:C.location,delta:R})}function x(E,R){d="PUSH";let k=UE(E)?E:Uu(C.location,E,R);i&&i(k,E),g=m()+1;let O=HE(k,g),A=C.createHref(k.mask||k);try{u.pushState(O,"",A)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;o.location.assign(A)}c&&f&&f({action:d,location:C.location,delta:1})}function S(E,R){d="REPLACE";let k=UE(E)?E:Uu(C.location,E,R);i&&i(k,E),g=m();let O=HE(k,g),A=C.createHref(k.mask||k);u.replaceState(O,"",A),c&&f&&f({action:d,location:C.location,delta:0})}function w(E){return Qk(o,E)}let C={get action(){return d},get location(){return e(o,u)},listen(E){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(_E,h),f=E,()=>{o.removeEventListener(_E,h),f=null}},createHref(E){return t(o,E)},createURL:w,encodeLocation(E){let R=w(E);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:S,go(E){return u.go(E)}};return C}function Qk(e,t,i=!1){let s="http://localhost";e&&(s=e.location.origin!=="null"?e.location.origin:e.location.href),_t(s,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Fr(t);return o=o.replace(/ $/,"%20"),!i&&rg.test(o)&&(o=s+o),new URL(o,s)}var Eu,FE=class{constructor(e){if(wu(this,Eu,new Map),e)for(let[t,i]of e)this.set(t,i)}get(e){if(Mi(this,Eu).has(e))return Mi(this,Eu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Mi(this,Eu).set(e,t)}};Eu=new WeakMap;var o_=new Set(["lazy","caseSensitive","path","id","index","children"]);function l_(e){return o_.has(e)}var c_=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function u_(e){return c_.has(e)}function d_(e){return e.index===!0}function Hu(e,t,i=[],s={},o=!1){return e.map((c,u)=>{let d=[...i,String(u)],f=typeof c.id=="string"?c.id:d.join("-");if(_t(c.index!==!0||!c.children,"Cannot specify children on an index route"),_t(o||!s[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),d_(c)){let g={...c,id:f};return s[f]=BE(g,t(g)),g}else{let g={...c,id:f,children:void 0};return s[f]=BE(g,t(g)),c.children&&(g.children=Hu(c.children,t,d,s,o)),g}})}function BE(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Xk(e,t,i="/"){return qi(e,t,i,!1)}function qi(e,t,i,s,o){let c=typeof t=="string"?es(t):t,u=ei(c.pathname||"/",i);if(u==null)return null;let d=o??Oh(e),f=null,g=nO(u);for(let m=0;f==null&&m<d.length;++m)f=S_(d[m],g,s);return f}function Zk(e,t){let{route:i,pathname:s,params:o}=e;return{id:i.id,pathname:s,params:o,data:t[i.id],loaderData:t[i.id],handle:i.handle}}function Oh(e){let t=Jk(e);return f_(t),t}function Jk(e,t=[],i=[],s="",o=!1){let c=(u,d,f=o,g)=>{let m={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(s)&&f)return;_t(m.relativePath.startsWith(s),`Absolute route path "${m.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(s.length)}let h=Ii([s,m.relativePath]),x=i.concat(m);u.children&&u.children.length>0&&(_t(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Jk(u.children,t,x,h,f)),!(u.path==null&&!u.index)&&t.push({path:h,score:b_(h,u.index),routesMeta:x.map((S,w)=>{let[C,E]=tO(S.relativePath,S.caseSensitive,w===x.length-1);return{...S,matcher:C,compiledParams:E}})})};return e.forEach((u,d)=>{if(u.path===""||!u.path?.includes("?"))c(u,d);else for(let f of Wk(u.path))c(u,d,!0,f)}),t}function Wk(e){let t=e.split("/");if(t.length===0)return[];let[i,...s]=t,o=i.endsWith("?"),c=i.replace(/\?$/,"");if(s.length===0)return o?[c,""]:[c];let u=Wk(s.join("/")),d=[];return d.push(...u.map(f=>f===""?c:[c,f].join("/"))),o&&d.push(...u),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function f_(e){e.sort((t,i)=>t.score!==i.score?i.score-t.score:x_(t.routesMeta.map(s=>s.childrenIndex),i.routesMeta.map(s=>s.childrenIndex)))}var h_=/^:[\w-]+$/,p_=3,g_=2,m_=1,y_=10,v_=-2,VE=e=>e==="*";function b_(e,t){let i=e.split("/"),s=i.length;return i.some(VE)&&(s+=v_),t&&(s+=g_),i.filter(o=>!VE(o)).reduce((o,c)=>o+(h_.test(c)?p_:c===""?m_:y_),s)}function x_(e,t){return e.length===t.length&&e.slice(0,-1).every((s,o)=>s===t[o])?e[e.length-1]-t[t.length-1]:0}function S_(e,t,i=!1){let{routesMeta:s}=e,o={},c="/",u=[];for(let d=0;d<s.length;++d){let f=s[d],g=d===s.length-1,m=c==="/"?t:t.slice(c.length)||"/",h={path:f.relativePath,caseSensitive:f.caseSensitive,end:g},x=f.matcher&&f.compiledParams?eO(h,m,f.matcher,f.compiledParams):Fu(h,m),S=f.route;if(!x&&g&&i&&!s[s.length-1].route.index&&(x=Fu({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!x)return null;Object.assign(o,x.params),u.push({params:o,pathname:Ii([c,x.pathname]),pathnameBase:R_(Ii([c,x.pathnameBase])),route:S}),x.pathnameBase!=="/"&&(c=Ii([c,x.pathnameBase]))}return u}function Fu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[i,s]=tO(e.path,e.caseSensitive,e.end);return eO(e,t,i,s)}function eO(e,t,i,s){let o=t.match(i);if(!o)return null;let c=o[0],u=sc(c,1),d=o.slice(1);return{params:s.reduce((g,{paramName:m,isOptional:h},x)=>{if(m==="*"){let w=d[x]||"";u=sc(c.slice(0,c.length-w.length),1)}const S=d[x];return h&&!S?g[m]=void 0:g[m]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:c,pathnameBase:u,pattern:e}}function tO(e,t=!1,i=!0){Hn(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 s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,f,g,m)=>{if(s.push({paramName:d,isOptional:f!=null}),f){let h=m.charAt(g+u.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),s]}function nO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Hn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ei(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let i=t.endsWith("/")?t.length-1:t.length,s=e.charAt(i);return s&&s!=="/"?null:e.slice(i)||"/"}function w_({basename:e,pathname:t}){return t==="/"?e:Ii([e,t])}var yb=e=>ng.test(e);function E_(e,t="/"){let{pathname:i,search:s="",hash:o=""}=typeof e=="string"?es(e):e,c;return i?(i=vb(i),i.startsWith("/")||i.startsWith("\\")?c=KE(i.substring(1),"/"):c=KE(i,t)):c=t,{pathname:c,search:C_(s),hash:T_(o)}}function KE(e,t){let i=sc(t).split("/");return e.split("/").forEach(o=>{o===".."?i.length>1&&i.pop():o!=="."&&i.push(o)}),i.length>1?i.join("/"):"/"}function hy(e,t,i,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function rO(e){return e.filter((t,i)=>i===0||t.route.path&&t.route.path.length>0)}function ig(e){let t=rO(e);return t.map((i,s)=>s===t.length-1?i.pathname:i.pathnameBase)}function dd(e,t,i,s=!1){let o;typeof e=="string"?o=es(e):(o={...e},_t(!o.pathname||!o.pathname.includes("?"),hy("?","pathname","search",o)),_t(!o.pathname||!o.pathname.includes("#"),hy("#","pathname","hash",o)),_t(!o.search||!o.search.includes("#"),hy("#","search","hash",o)));let c=e===""||o.pathname==="",u=c?"/":o.pathname,d;if(u==null)d=i;else{let h=t.length-1;if(!s&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),h-=1;o.pathname=x.join("/")}d=h>=0?t[h]:"/"}let f=E_(o,d),g=u&&u!=="/"&&u.endsWith("/"),m=(c||u===".")&&i.endsWith("/");return!f.pathname.endsWith("/")&&(g||m)&&(f.pathname+="/"),f}var vb=e=>e.replace(/[\\/]{2,}/g,"/"),Ii=e=>vb(e.join("/"));function sc(e,t=0){let i=e.length;for(;i>t&&e.charCodeAt(i-1)===47;)i--;return i===e.length?e:e.slice(0,i)}var R_=e=>sc(e).replace(/^\/*/,"/"),C_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,T_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,k_=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fd=class{constructor(e,t,i,s=!1){this.status=e,this.statusText=t||"",this.internal=s,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Bu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function hd(e){let t=e.map(i=>i.route.path).filter(Boolean);return Ii(t)||"/"}var iO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sO(e,t){let i=e;if(typeof i!="string"||!ng.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let s=i,o=!1;if(iO)try{let c=new URL(window.location.href),u=rg.test(i)?new URL($k(i,c.protocol)):new URL(i),d=ei(u.pathname,t);u.origin===c.origin&&d!=null?i=d+u.search+u.hash:o=!0}catch{Hn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:i}}var za=Symbol("Uninstrumented");function O_(e,t){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(c){let u=Object.keys(i);for(let d of u)c[d]&&i[d].push(c[d])}}));let s={};if(typeof t.lazy=="function"&&i.lazy.length>0){let o=Hl(i.lazy,t.lazy,()=>{});o&&(s.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(c=>{let u=o[c],d=i[`lazy.${c}`];if(typeof u=="function"&&d.length>0){let f=Hl(d,u,()=>{});f&&(s.lazy=Object.assign(s.lazy||{},{[c]:f}))}})}return["loader","action"].forEach(o=>{let c=t[o];if(typeof c=="function"&&i[o].length>0){let u=c[za]??c,d=Hl(i[o],u,(...f)=>qE(f[0]));d&&(o==="loader"&&u.hydrate===!0&&(d.hydrate=!0),d[za]=u,s[o]=d)}}),t.middleware&&t.middleware.length>0&&i.middleware.length>0&&(s.middleware=t.middleware.map(o=>{let c=o[za]??o,u=Hl(i.middleware,c,(...d)=>qE(d[0]));return u?(u[za]=c,u):o})),s}function A_(e,t){let i={navigate:[],fetch:[]};if(t.forEach(s=>s({instrument(o){let c=Object.keys(o);for(let u of c)o[u]&&i[u].push(o[u])}})),i.navigate.length>0){let s=e.navigate[za]??e.navigate,o=Hl(i.navigate,s,(...c)=>{let[u,d]=c;return{to:typeof u=="number"||typeof u=="string"?u:u?Fr(u):".",...YE(e,d??{})}});o&&(o[za]=s,e.navigate=o)}if(i.fetch.length>0){let s=e.fetch[za]??e.fetch,o=Hl(i.fetch,s,(...c)=>{let[u,,d,f]=c;return{href:d??".",fetcherKey:u,...YE(e,f??{})}});o&&(o[za]=s,e.fetch=o)}return e}function Hl(e,t,i){return e.length===0?null:async(...s)=>{let o=await aO(e,i(...s),()=>t(...s),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function aO(e,t,i,s){let o=e[s],c;if(o){let u,d=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=aO(e,t,i,s-1),c=await u,_t(c,"Expected a result"),c.type==="error"&&c.value instanceof Error?{status:"error",error:c.value}:{status:"success",error:void 0});try{await o(d,t)}catch(f){console.error("An instrumentation function threw an error:",f)}u||await d(),await u}else try{c={type:"success",value:await i()}}catch(u){c={type:"error",value:u}}return c||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function qE(e){let{request:t,context:i,params:s,pattern:o}=e;return{request:M_(t),params:{...s},pattern:o,context:N_(i)}}function YE(e,t){return{currentUrl:Fr(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function M_(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function N_(e){if(j_(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var D_=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function j_(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===D_}var GE=new URL("http://localhost");function bb(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),GE)}catch{return GE}}function py(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function I_(e,t){if(e.startsWith("//"))return!0;let i=t.protocol.toLowerCase();return e.toLowerCase().startsWith(i)?t.host===""||e.slice(i.length).startsWith("//"):!1}function Ql(e,t,i,s){let o=null;try{o=e==null?null:new URL(e,i)}catch{}let c=new URL(t,i),u=o!=null&&!py(o,i),d=!py(c,i);if(s==="reject"){if(u||d)throw new Error("External navigation is not allowed")}else if(d&&(o==null||!I_(e,o)||!py(o,c)))throw new Error("External navigation is not allowed")}var oO=["POST","PUT","PATCH","DELETE"],P_=new Set(oO),L_=["GET",...oO],z_=new Set(L_),lO=new Set([301,302,303,307,308]),__=new Set([307,308]),gy={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},U_={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Pl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},H_=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),cO="remix-router-transitions",uO=Symbol("ResetLoaderData"),To,Ll,Da,zl,F_=class{constructor(e){wu(this,To),wu(this,Ll),wu(this,Da),wu(this,zl),hs(this,To,e),hs(this,Ll,Oh(e))}get stableRoutes(){return Mi(this,To)}get activeRoutes(){return Mi(this,Da)??Mi(this,To)}get branches(){return Mi(this,zl)??Mi(this,Ll)}get hasHMRRoutes(){return Mi(this,Da)!=null}setRoutes(e){hs(this,To,e),hs(this,Ll,Oh(e))}setHmrRoutes(e){hs(this,Da,e),hs(this,zl,Oh(e))}commitHmrRoutes(){Mi(this,Da)&&(hs(this,To,Mi(this,Da)),hs(this,Ll,Mi(this,zl)),hs(this,Da,void 0),hs(this,zl,void 0))}};To=new WeakMap;Ll=new WeakMap;Da=new WeakMap;zl=new WeakMap;function B_(e){const t=e.window?e.window:typeof window<"u"?window:void 0,i=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";_t(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],o=e.mapRouteProperties||H_,c=o;if(e.instrumentations){let F=e.instrumentations;c=J=>({...o(J),...O_(F.map(ne=>ne.route).filter(Boolean),J)})}let u={},d=new F_(Hu(e.routes,c,void 0,u)),f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let g=e.dataStrategy||G_,m={...e.future},h=null,x=new Set,S=null,w=null,C=null,E=null,R=e.hydrationData!=null,k=qi(d.activeRoutes,e.history.location,f,!1,d.branches),O=!1,A=null,N,j;if(k==null&&!e.patchRoutesOnNavigation){let F=Ni(404,{pathname:e.history.location.pathname}),{matches:J,route:ne}=ch(d.activeRoutes);N=!0,j=!N,k=J,A={[ne.id]:F}}else if(k&&!e.hydrationData&&Ie(k,d.activeRoutes,e.history.location.pathname).active&&(k=null),k)if(k.some(F=>F.route.lazy))N=!1,j=!N;else if(!k.some(F=>xb(F.route)))N=!0,j=!N;else{let F=e.hydrationData?e.hydrationData.loaderData:null,J=e.hydrationData?e.hydrationData.errors:null,ne=k;if(J){let ye=k.findIndex(xe=>J[xe.route.id]!==void 0);ne=ne.slice(0,ye+1)}j=!1,N=!0,ne.forEach(ye=>{let xe=dO(ye.route,F,J);j=j||xe.renderFallback,N=N&&!xe.shouldLoad})}else{N=!1,j=!N,k=[];let F=Ie(null,d.activeRoutes,e.history.location.pathname);F.active&&F.matches&&(O=!0,k=F.matches)}let D,M={historyAction:e.history.action,location:e.history.location,matches:k,initialized:N,renderFallback:j,navigation:gy,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},_="POP",L=null,q=!1,X,B=!1,H=new Map,U=null,z=!1,Q=!1,$=new Set,K=new Map,Y=0,ee=-1,G=new Map,oe=new Set,I=new Map,V=new Map,W=new Set,re=new Map,Ee,le=null;function me(){if(h=e.history.listen(({action:F,location:J,delta:ne})=>{if(Ee){Ee(),Ee=void 0;return}Hn(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=xt({currentLocation:M.location,nextLocation:J,historyAction:F});if(ye&&ne!=null){let xe=new Promise(qe=>{Ee=qe});e.history.go(ne*-1),ht(ye,{state:"blocked",location:J,proceed(){ht(ye,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),xe.then(()=>e.history.go(ne))},reset(){let qe=new Map(M.blockers);qe.set(ye,Pl),Te({blockers:qe})}}),L?.resolve(),L=null;return}return Le(F,J)}),i){f6(t,H);let F=()=>h6(t,H);t.addEventListener("pagehide",F),U=()=>t.removeEventListener("pagehide",F)}return M.initialized||Le("POP",M.location,{initialHydration:!0}),D}function ge(){h&&h(),U&&U(),x.clear(),X&&X.abort(),M.fetchers.forEach((F,J)=>Nt(M.fetchers,J)),M.blockers.forEach((F,J)=>Zt(J))}function ue(F){if(x.add(F),S){let{newErrors:J}=S;S=null,F(M,{deletedFetchers:[],newErrors:J,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(F)}function Te(F,J={}){F.matches&&(F.matches=F.matches.map(xe=>{let qe=u[xe.route.id],Ke=xe.route;return Ke.element!==qe.element||Ke.errorElement!==qe.errorElement||Ke.hydrateFallbackElement!==qe.hydrateFallbackElement?{...xe,route:qe}:xe})),M={...M,...F};let ne=[],ye=[];M.fetchers.forEach((xe,qe)=>{xe.state==="idle"&&(W.has(qe)?ne.push(qe):ye.push(qe))}),W.forEach(xe=>{!M.fetchers.has(xe)&&!K.has(xe)&&ne.push(xe)}),x.size===0&&(S={newErrors:F.errors??null}),[...x].forEach(xe=>xe(M,{deletedFetchers:ne,newErrors:F.errors??null,viewTransitionOpts:J.viewTransitionOpts,flushSync:J.flushSync===!0})),ne.forEach(xe=>Nt(M.fetchers,xe)),ye.forEach(xe=>M.fetchers.delete(xe))}function ve(F,J,{flushSync:ne}={}){let ye=M.actionData!=null&&M.navigation.formMethod!=null&&kr(M.navigation.formMethod)&&M.navigation.state==="loading"&&F.state?._isRedirect!==!0,xe;J.actionData?Object.keys(J.actionData).length>0?xe=J.actionData:xe=null:ye?xe=M.actionData:xe=null;let qe=J.loaderData?rR(M.loaderData,J.loaderData,J.matches||[],J.errors):M.loaderData,Ke=M.blockers;Ke.size>0&&(Ke=new Map(Ke),Ke.forEach((tt,Et)=>Ke.set(Et,Pl)));let Xe=z?!1:st(F,J.matches||M.matches),Qe=q===!0||M.navigation.formMethod!=null&&kr(M.navigation.formMethod)&&F.state?._isRedirect!==!0;d.commitHmrRoutes(),z||_==="POP"||(_==="PUSH"?e.history.push(F,F.state):_==="REPLACE"&&e.history.replace(F,F.state));let lt;if(_==="POP"&&!z&&F!==M.location){let tt=H.get(M.location.pathname);tt&&tt.has(F.pathname)?lt={currentLocation:M.location,nextLocation:F}:H.has(F.pathname)&&(lt={currentLocation:F,nextLocation:M.location})}else if(B){let tt=H.get(M.location.pathname);tt?tt.add(F.pathname):(tt=new Set([F.pathname]),H.set(M.location.pathname,tt)),lt={currentLocation:M.location,nextLocation:F}}Te({...J,actionData:xe,loaderData:qe,historyAction:_,location:F,initialized:!0,renderFallback:!1,navigation:gy,revalidation:"idle",restoreScrollPosition:Xe,preventScrollReset:Qe,blockers:Ke},{viewTransitionOpts:lt,flushSync:ne===!0}),_="POP",q=!1,B=!1,z=!1,Q=!1,L?.resolve(),L=null,le?.resolve(),le=null}async function Pe(F,J){if(L?.resolve(),L=null,typeof F=="number"){L||(L=oR());let Ft=L.promise;return e.history.go(F),Ft}let ne=rv(M.location,M.matches,f,F,J?.fromRouteId,J?.relative),{path:ye,submission:xe,error:qe}=$E(!1,ne,J),Ke;if(J?.mask){let Ft=typeof J.mask=="string"?es(J.mask):{...M.location.mask,...J.mask};if(Ke={pathname:Ft.pathname??"",search:Ft.search??"",hash:Ft.hash??""},rg.test(Ke.pathname))throw new Error("External navigation is not allowed");Ke.pathname.startsWith("\\")&&(Ke.pathname=Ke.pathname.replace(/^\\+/,"/")),Ql(typeof J.mask=="string"?J.mask:Fr(J.mask),Fr(Ke),e.history.createURL("/"),"reject")}let Xe=M.location,Qe=Uu(Xe,ye,J&&J.state,void 0,Ke);Qe={...Qe,...e.history.encodeLocation(Qe)},Ql(F==null?e.history.createHref(M.location):typeof F=="string"?F:Fr(F),e.history.createHref(Qe.mask||Qe),e.history.createURL("/"),"reject");let lt=J&&J.replace!=null?J.replace:void 0,tt="PUSH";lt===!0?tt="REPLACE":lt===!1||xe!=null&&kr(xe.formMethod)&&xe.formAction===M.location.pathname+M.location.search&&(tt="REPLACE");let Et=J&&"preventScrollReset"in J?J.preventScrollReset===!0:void 0,ft=(J&&J.flushSync)===!0,Kt=xt({currentLocation:Xe,nextLocation:Qe,historyAction:tt});if(Kt){ht(Kt,{state:"blocked",location:Qe,proceed(){ht(Kt,{state:"proceeding",proceed:void 0,reset:void 0,location:Qe}),Pe(F,J)},reset(){let Ft=new Map(M.blockers);Ft.set(Kt,Pl),Te({blockers:Ft})}});return}await Le(tt,Qe,{submission:xe,pendingError:qe,preventScrollReset:Et,replace:J&&J.replace,enableViewTransition:J&&J.viewTransition,flushSync:ft,callSiteDefaultShouldRevalidate:J&&J.defaultShouldRevalidate})}function Oe(){le||(le=oR()),Me(),Te({revalidation:"loading"});let F=le.promise;return M.navigation.state==="submitting"?F:M.navigation.state==="idle"?(Le(M.historyAction,M.location,{startUninterruptedRevalidation:!0}),F):(Le(_||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation,enableViewTransition:B===!0}),F)}async function Le(F,J,ne){X&&X.abort(),X=null,_=F,z=(ne&&ne.startUninterruptedRevalidation)===!0,je(M.location,M.matches),q=(ne&&ne.preventScrollReset)===!0,B=(ne&&ne.enableViewTransition)===!0;let ye=d.activeRoutes,xe=ne?.initialHydration&&M.matches&&M.matches.length>0&&!O?M.matches:qi(ye,J,f,!1,d.branches),qe=(ne&&ne.flushSync)===!0;if(xe&&M.initialized&&!Q&&n6(M.location,J)&&!(ne&&ne.submission&&kr(ne.submission.formMethod))){ve(J,{matches:xe},{flushSync:qe});return}let Ke=Ie(xe,ye,J.pathname);if(Ke.active&&Ke.matches&&(xe=Ke.matches),!xe){let{error:qt,notFoundMatches:Bt,route:Cn}=yt(J.pathname);ve(J,{matches:Bt,loaderData:{},errors:{[Cn.id]:qt}},{flushSync:qe});return}let Xe=ne&&ne.overrideNavigation?{...ne.overrideNavigation,matches:xe,historyAction:F}:void 0;X=new AbortController;let Qe=_l(e.history,J,X.signal,ne&&ne.submission),lt=e.getContext?await e.getContext():new FE,tt;if(ne&&ne.pendingError)tt=[Pa(xe).route.id,{type:"error",error:ne.pendingError}];else if(ne&&ne.submission&&kr(ne.submission.formMethod)){let qt=await Ve(Qe,J,ne.submission,xe,F,lt,Ke.active,ne&&ne.initialHydration===!0,{replace:ne.replace,flushSync:qe});if(qt.shortCircuited)return;if(qt.pendingActionResult){let[Bt,Cn]=qt.pendingActionResult;if(pi(Cn)&&Bu(Cn.error)&&Cn.error.status===404){X=null,ve(J,{matches:qt.matches,loaderData:{},errors:{[Bt]:Cn.error}});return}}xe=qt.matches||xe,tt=qt.pendingActionResult,Xe=my(J,xe,F,ne.submission),qe=!1,Ke.active=!1,Qe=_l(e.history,Qe.url,Qe.signal)}let{shortCircuited:Et,matches:ft,loaderData:Kt,errors:Ft,workingFetchers:On}=await ke(Qe,J,xe,F,lt,Ke.active,Xe,ne&&ne.submission,ne&&ne.fetcherSubmission,ne&&ne.replace,ne&&ne.initialHydration===!0,qe,tt,ne&&ne.callSiteDefaultShouldRevalidate);Et||(X=null,ve(J,{matches:ft||xe,...iR(tt),loaderData:Kt,errors:Ft,...On?{fetchers:On}:{}}))}async function Ve(F,J,ne,ye,xe,qe,Ke,Xe,Qe={}){Me();let lt=u6(J,ye,xe,ne);if(Te({navigation:lt},{flushSync:Qe.flushSync===!0}),Ke){let ft=await ze(ye,J.pathname,F.signal);if(ft.type==="aborted")return{shortCircuited:!0};if(ft.type==="error"){if(ft.partialMatches.length===0){let{matches:Ft,route:On}=ch(d.activeRoutes);return{matches:Ft,pendingActionResult:[On.id,{type:"error",error:ft.error}]}}let Kt=Pa(ft.partialMatches).route.id;return{matches:ft.partialMatches,pendingActionResult:[Kt,{type:"error",error:ft.error}]}}else if(ft.matches)ye=ft.matches;else{let{notFoundMatches:Kt,error:Ft,route:On}=yt(J.pathname);return{matches:Kt,pendingActionResult:[On.id,{type:"error",error:Ft}]}}}let tt,Et=Ah(ye,J);if(!Et.route.action&&!Et.route.lazy)tt={type:"error",error:Ni(405,{method:F.method,pathname:J.pathname,routeId:Et.route.id})};else{let ft=Xl(c,u,F,J,ye,Et,Xe?[]:s,qe),Kt=await we(F,J,ft,qe,null);if(tt=Kt[Et.route.id],!tt){for(let Ft of ye)if(Kt[Ft.route.id]){tt=Kt[Ft.route.id];break}}if(F.signal.aborted)return{shortCircuited:!0}}if(Ao(tt)){let ft;return Qe&&Qe.replace!=null?ft=Qe.replace:ft=eR(tt.response.headers.get("Location"),new URL(F.url),f,e.history)===M.location.pathname+M.location.search,await de(F,tt,!0,{submission:ne,replace:ft}),{shortCircuited:!0}}if(pi(tt)){let ft=Pa(ye,Et.route.id);return(Qe&&Qe.replace)!==!0&&(_="PUSH"),{matches:ye,pendingActionResult:[ft.route.id,tt,Et.route.id]}}return{matches:ye,pendingActionResult:[Et.route.id,tt]}}async function ke(F,J,ne,ye,xe,qe,Ke,Xe,Qe,lt,tt,Et,ft,Kt){let Ft=Ke||my(J,ne,ye,Xe),On=Xe||Qe||aR(Ft),qt=!z&&!tt;if(qe){if(qt){let qn=Ue(ft);Te({navigation:Ft,...qn!==void 0?{actionData:qn}:{}},{flushSync:Et})}let zt=await ze(ne,J.pathname,F.signal);if(zt.type==="aborted")return{shortCircuited:!0};if(zt.type==="error"){if(zt.partialMatches.length===0){let{matches:Fn,route:pr}=ch(d.activeRoutes);return{matches:Fn,loaderData:{},errors:{[pr.id]:zt.error}}}let qn=Pa(zt.partialMatches).route.id;return{matches:zt.partialMatches,loaderData:{},errors:{[qn]:zt.error}}}else if(zt.matches)ne=zt.matches;else{let{error:qn,notFoundMatches:Fn,route:pr}=yt(J.pathname);return{matches:Fn,loaderData:{},errors:{[pr.id]:qn}}}}let Bt=d.activeRoutes,{dsMatches:Cn,revalidatingFetchers:Tn}=QE(F,xe,c,u,e.history,M,ne,On,J,tt?[]:s,tt===!0,Q,$,W,I,oe,Bt,f,e.patchRoutesOnNavigation!=null,d.branches,ft,Kt);if(ee=++Y,!e.dataStrategy&&!Cn.some(zt=>zt.shouldLoad)&&!Cn.some(zt=>zt.route.middleware&&zt.route.middleware.length>0)&&Tn.length===0){let zt=new Map(M.fetchers),qn=nn(zt);return ve(J,{matches:ne,loaderData:{},errors:ft&&pi(ft[1])?{[ft[0]]:ft[1].error}:null,...iR(ft),...qn?{fetchers:zt}:{}},{flushSync:Et}),{shortCircuited:!0}}if(qt){let zt={};if(!qe){zt.navigation=Ft;let qn=Ue(ft);qn!==void 0&&(zt.actionData=qn)}Tn.length>0&&(zt.fetchers=be(Tn)),Te(zt,{flushSync:Et})}Tn.forEach(zt=>{tn(zt.key),zt.controller&&K.set(zt.key,zt.controller)});let ti=()=>Tn.forEach(zt=>tn(zt.key));X&&X.signal.addEventListener("abort",ti);let{loaderResults:dn,fetcherResults:fn}=await Ge(Cn,Tn,F,J,xe);if(F.signal.aborted)return{shortCircuited:!0};X&&X.signal.removeEventListener("abort",ti),Tn.forEach(zt=>K.delete(zt.key));let An=uh(dn);if(An)return await de(F,An.result,!0,{replace:lt}),{shortCircuited:!0};if(An=uh(fn),An)return oe.add(An.key),await de(F,An.result,!0,{replace:lt}),{shortCircuited:!0};let jn=new Map(M.fetchers),{loaderData:Os,errors:Dr}=nR(M,ne,dn,ft,Tn,fn,jn);tt&&M.errors&&(Dr={...M.errors,...Dr});let _i=nn(jn),ni=We(ee,jn),xi=_i||ni||Tn.length>0;return{matches:ne,loaderData:Os,errors:Dr,...xi?{workingFetchers:jn}:{}}}function Ue(F){if(F&&!pi(F[1]))return{[F[0]]:F[1].data};if(M.actionData)return Object.keys(M.actionData).length===0?null:M.actionData}function be(F){let J=new Map(M.fetchers);return F.forEach(ne=>{let ye=J.get(ne.key),xe=mu(void 0,ye?ye.data:void 0);J.set(ne.key,xe)}),J}async function He(F,J,ne,ye){tn(F);let xe=(ye&&ye.flushSync)===!0,qe=d.activeRoutes,Ke=rv(M.location,M.matches,f,ne,J,ye?.relative),Xe=qi(qe,Ke,f,!1,d.branches),Qe=Ie(Xe,qe,Ke);if(Qe.active&&Qe.matches&&(Xe=Qe.matches),!Xe){bt(F,J,Ni(404,{pathname:Ke}),{flushSync:xe});return}let{path:lt,submission:tt,error:Et}=$E(!0,Ke,ye);if(Et){bt(F,J,Et,{flushSync:xe});return}let ft=e.getContext?await e.getContext():new FE,Kt=(ye&&ye.preventScrollReset)===!0;if(tt&&kr(tt.formMethod)){await Ze(F,J,lt,Xe,ft,Qe.active,xe,Kt,tt,ye&&ye.defaultShouldRevalidate);return}I.set(F,{routeId:J,path:lt}),await ot(F,J,lt,Xe,ft,Qe.active,xe,Kt,tt)}async function Ze(F,J,ne,ye,xe,qe,Ke,Xe,Qe,lt){Me(),I.delete(F);let tt=M.fetchers.get(F);De(F,d6(Qe,tt),{flushSync:Ke});let Et=new AbortController,ft=_l(e.history,ne,Et.signal,Qe);if(qe){let Se=await ze(ye,new URL(ft.url).pathname,ft.signal,F);if(Se.type==="aborted")return;if(Se.type==="error"){bt(F,J,Se.error,{flushSync:Ke});return}else if(Se.matches)ye=Se.matches;else{bt(F,J,Ni(404,{pathname:ne}),{flushSync:Ke});return}}let Kt=Ah(ye,ne);if(!Kt.route.action&&!Kt.route.lazy){let Se=Ni(405,{method:Qe.formMethod,pathname:ne,routeId:J});bt(F,J,Se,{flushSync:Ke});return}K.set(F,Et);let Ft=Y,On=Xl(c,u,ft,ne,ye,Kt,s,xe),qt=await we(ft,ne,On,xe,F),Bt=qt[Kt.route.id];if(!Bt){for(let Se of On)if(qt[Se.route.id]){Bt=qt[Se.route.id];break}}if(ft.signal.aborted){K.get(F)===Et&&K.delete(F);return}if(W.has(F)){if(Ao(Bt)||pi(Bt)){De(F,ps(void 0));return}}else{if(Ao(Bt))if(K.delete(F),ee>Ft){De(F,ps(void 0));return}else return oe.add(F),De(F,mu(Qe)),de(ft,Bt,!1,{fetcherSubmission:Qe,preventScrollReset:Xe});if(pi(Bt)){bt(F,J,Bt.error);return}}let Cn=M.navigation.location||M.location,Tn=_l(e.history,Cn,Et.signal),ti=d.activeRoutes,dn=M.navigation.state!=="idle"?qi(ti,M.navigation.location,f,!1,d.branches):M.matches;_t(dn,"Didn't find any matches after fetcher action");let fn=++Y;G.set(F,fn);let{dsMatches:An,revalidatingFetchers:jn}=QE(Tn,xe,c,u,e.history,M,dn,Qe,Cn,s,!1,Q,$,W,I,oe,ti,f,e.patchRoutesOnNavigation!=null,d.branches,[Kt.route.id,Bt],lt),Os=mu(Qe,Bt.data),Dr=new Map(M.fetchers);Dr.set(F,Os),jn.filter(Se=>Se.key!==F).forEach(Se=>{let nt=Se.key,Ot=Dr.get(nt),Rt=mu(void 0,Ot?Ot.data:void 0);Dr.set(nt,Rt),tn(nt),Se.controller&&K.set(nt,Se.controller)}),Te({fetchers:Dr});let _i=()=>jn.forEach(Se=>tn(Se.key));Et.signal.addEventListener("abort",_i);let{loaderResults:ni,fetcherResults:xi}=await Ge(An,jn,Tn,Cn,xe);if(Et.signal.aborted)return;Et.signal.removeEventListener("abort",_i),G.delete(F),K.delete(F),jn.forEach(Se=>K.delete(Se.key));let zt=M.fetchers.has(F),qn=Se=>{if(!zt)return Se;let nt=new Map(Se.fetchers);return nt.set(F,ps(Bt.data)),{...Se,fetchers:nt}},Fn=uh(ni);if(Fn)return M=qn(M),de(Tn,Fn.result,!1,{preventScrollReset:Xe});if(Fn=uh(xi),Fn)return oe.add(Fn.key),M=qn(M),de(Tn,Fn.result,!1,{preventScrollReset:Xe});let pr=new Map(M.fetchers);zt&&pr.set(F,ps(Bt.data));let{loaderData:he,errors:Ae}=nR(M,dn,ni,void 0,jn,xi,pr);We(fn,pr),M.navigation.state==="loading"&&fn>ee?(_t(_,"Expected pending action"),X&&X.abort(),ve(M.navigation.location,{matches:dn,loaderData:he,errors:Ae,fetchers:pr})):(Te({errors:Ae,loaderData:rR(M.loaderData,he,dn,Ae),fetchers:pr}),Q=!1)}async function ot(F,J,ne,ye,xe,qe,Ke,Xe,Qe){let lt=M.fetchers.get(F);De(F,mu(Qe,lt?lt.data:void 0),{flushSync:Ke});let tt=new AbortController,Et=_l(e.history,ne,tt.signal);if(qe){let Bt=await ze(ye,new URL(Et.url).pathname,Et.signal,F);if(Bt.type==="aborted")return;if(Bt.type==="error"){bt(F,J,Bt.error,{flushSync:Ke});return}else if(Bt.matches)ye=Bt.matches;else{bt(F,J,Ni(404,{pathname:ne}),{flushSync:Ke});return}}let ft=Ah(ye,ne);K.set(F,tt);let Kt=Y,Ft=Xl(c,u,Et,ne,ye,ft,s,xe),On=await we(Et,ne,Ft,xe,F),qt=On[ft.route.id];if(!qt){for(let Bt of ye)if(On[Bt.route.id]){qt=On[Bt.route.id];break}}if(K.get(F)===tt&&K.delete(F),!Et.signal.aborted){if(W.has(F)){De(F,ps(void 0));return}if(Ao(qt))if(ee>Kt){De(F,ps(void 0));return}else{oe.add(F),await de(Et,qt,!1,{preventScrollReset:Xe});return}if(pi(qt)){bt(F,J,qt.error);return}De(F,ps(qt.data))}}async function de(F,J,ne,{submission:ye,fetcherSubmission:xe,preventScrollReset:qe,replace:Ke}={}){ne||(L?.resolve(),L=null),J.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let Xe=J.response.headers.get("Location");_t(Xe,"Expected a Location header on the redirect Response");let Qe=Xe,lt=new URL(F.url);Xe=eR(Xe,lt,f,e.history),Ql(Qe,Xe,lt,"allow-explicit");let tt=Uu(M.location,Xe,{_isRedirect:!0});if(i){let qt=!1;if(J.response.headers.has("X-Remix-Reload-Document"))qt=!0;else if(yb(Xe)){const Bt=Qk(t,Xe,!0);qt=Bt.origin!==t.location.origin||ei(Bt.pathname,f)==null}if(qt){Ke?t.location.replace(Xe):t.location.assign(Xe);return}}X=null;let Et=Ke===!0||J.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ft,formAction:Kt,formEncType:Ft}=M.navigation;!ye&&!xe&&ft&&Kt&&Ft&&(ye=aR(M.navigation));let On=ye||xe;if(__.has(J.response.status)&&On&&kr(On.formMethod))await Le(Et,tt,{submission:{...On,formAction:Xe},preventScrollReset:qe||q,enableViewTransition:ne?B:void 0});else{let qt=my(tt,[],Et,ye);await Le(Et,tt,{overrideNavigation:qt,fetcherSubmission:xe,preventScrollReset:qe||q,enableViewTransition:ne?B:void 0})}}async function we(F,J,ne,ye,xe){let qe,Ke={};try{qe=await Q_(g,F,J,ne,xe,ye,!1)}catch(Xe){return ne.filter(Qe=>Qe.shouldLoad).forEach(Qe=>{Ke[Qe.route.id]={type:"error",error:Xe}}),Ke}if(F.signal.aborted)return Ke;if(!kr(F.method))for(let Xe of ne){if(qe[Xe.route.id]?.type==="error")break;!qe.hasOwnProperty(Xe.route.id)&&!M.loaderData.hasOwnProperty(Xe.route.id)&&(!M.errors||!M.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,Qe]of Object.entries(qe))if(a6(Qe)){let lt=Qe.result;Ke[Xe]={type:"redirect",response:W_(lt,F,Xe,ne,f)}}else Ke[Xe]=await J_(Qe);return Ke}async function Ge(F,J,ne,ye,xe){let qe=we(ne,ye,F,xe,null),Ke=Promise.all(J.map(async lt=>{if(lt.matches&&lt.match&&lt.request&&lt.controller){let Et=(await we(lt.request,lt.path,lt.matches,xe,lt.key))[lt.match.route.id];return{[lt.key]:Et}}else return Promise.resolve({[lt.key]:{type:"error",error:Ni(404,{pathname:lt.path})}})})),Xe=await qe,Qe=(await Ke).reduce((lt,tt)=>Object.assign(lt,tt),{});return{loaderResults:Xe,fetcherResults:Qe}}function Me(){Q=!0,I.forEach((F,J)=>{K.has(J)&&$.add(J),tn(J)})}function De(F,J,ne={}){let ye=new Map(M.fetchers);ye.set(F,J),Te({fetchers:ye},{flushSync:(ne&&ne.flushSync)===!0})}function bt(F,J,ne,ye={}){let xe=Pa(M.matches,J),qe=new Map(M.fetchers);Nt(qe,F),Te({errors:{[xe.route.id]:ne},fetchers:qe},{flushSync:(ye&&ye.flushSync)===!0})}function dt(F){return V.set(F,(V.get(F)||0)+1),W.has(F)&&W.delete(F),M.fetchers.get(F)||U_}function pt(F,J){tn(F,J?.reason),De(F,ps(null))}function Nt(F,J){let ne=M.fetchers.get(J);K.has(J)&&!(ne&&ne.state==="loading"&&G.has(J))&&tn(J),I.delete(J),G.delete(J),oe.delete(J),W.delete(J),$.delete(J),F.delete(J)}function jt(F){let J=(V.get(F)||0)-1;J<=0?(V.delete(F),W.add(F)):V.set(F,J),Te({fetchers:new Map(M.fetchers)})}function tn(F,J){let ne=K.get(F);ne&&(ne.abort(J),K.delete(F))}function an(F,J){for(let ne of F){let ye=J.get(ne);_t(ye,`Expected fetcher: ${ne}`);let xe=ps(ye.data);J.set(ne,xe)}}function nn(F){let J=[],ne=!1;for(let ye of oe){let xe=F.get(ye);_t(xe,`Expected fetcher: ${ye}`),xe.state==="loading"&&(oe.delete(ye),J.push(ye),ne=!0)}return an(J,F),ne}function We(F,J){let ne=[];for(let[ye,xe]of G)if(xe<F){let qe=J.get(ye);_t(qe,`Expected fetcher: ${ye}`),qe.state==="loading"&&(tn(ye),G.delete(ye),ne.push(ye))}return an(ne,J),ne.length>0}function wt(F,J){let ne=M.blockers.get(F)||Pl;return re.get(F)!==J&&re.set(F,J),ne}function Zt(F){M.blockers.delete(F),re.delete(F)}function ht(F,J){let ne=M.blockers.get(F)||Pl;_t(ne.state==="unblocked"&&J.state==="blocked"||ne.state==="blocked"&&J.state==="blocked"||ne.state==="blocked"&&J.state==="proceeding"||ne.state==="blocked"&&J.state==="unblocked"||ne.state==="proceeding"&&J.state==="unblocked",`Invalid blocker state transition: ${ne.state} -> ${J.state}`);let ye=new Map(M.blockers);ye.set(F,J),Te({blockers:ye})}function xt({currentLocation:F,nextLocation:J,historyAction:ne}){if(re.size===0)return;re.size>1&&Hn(!1,"A router only supports one blocker at a time");let ye=Array.from(re.entries()),[xe,qe]=ye[ye.length-1],Ke=M.blockers.get(xe);if(!(Ke&&Ke.state==="proceeding")&&qe({currentLocation:F,nextLocation:J,historyAction:ne}))return xe}function yt(F){let J=Ni(404,{pathname:F}),ne=d.activeRoutes,{matches:ye,route:xe}=ch(ne);return{notFoundMatches:ye,route:xe,error:J}}function Ut(F,J,ne){if(w=F,E=J,C=ne||null,!R&&M.navigation===gy){R=!0;let ye=st(M.location,M.matches);ye!=null&&Te({restoreScrollPosition:ye})}return()=>{w=null,E=null,C=null}}function un(F,J){return C&&C(F,J.map(ye=>Zk(ye,M.loaderData)))||F.key}function je(F,J){if(w&&E){let ne=un(F,J);w[ne]=E()}}function st(F,J){if(w){let ne=un(F,J),ye=w[ne];if(typeof ye=="number")return ye}return null}function Ie(F,J,ne){if(e.patchRoutesOnNavigation){let ye=d.branches;if(F){if(Object.keys(F[0].params).length>0)return{active:!0,matches:qi(J,ne,f,!0,ye)}}else return{active:!0,matches:qi(J,ne,f,!0,ye)||[]}}return{active:!1,matches:null}}async function ze(F,J,ne,ye){if(!e.patchRoutesOnNavigation)return{type:"success",matches:F};let xe=F;for(;;){let qe=u;try{await e.patchRoutesOnNavigation({signal:ne,path:J,matches:xe,fetcherKey:ye,patch:(lt,tt)=>{ne.aborted||XE(lt,tt,d,qe,c,!1)}})}catch(lt){return{type:"error",error:lt,partialMatches:xe}}if(ne.aborted)return{type:"aborted"};let Ke=d.branches,Xe=qi(d.activeRoutes,J,f,!1,Ke),Qe=null;if(Xe){if(Object.keys(Xe[0].params).length===0)return{type:"success",matches:Xe};if(Qe=qi(d.activeRoutes,J,f,!0,Ke),!(Qe&&xe.length<Qe.length&&$e(xe,Qe.slice(0,xe.length))))return{type:"success",matches:Xe}}if(Qe||(Qe=qi(d.activeRoutes,J,f,!0,Ke)),!Qe||$e(xe,Qe))return{type:"success",matches:null};xe=Qe}}function $e(F,J){return F.length===J.length&&F.every((ne,ye)=>ne.route.id===J[ye].route.id)}function et(F){u={},d.setHmrRoutes(Hu(F,c,void 0,u))}function Tt(F,J,ne=!1){XE(F,J,d,u,c,ne),d.hasHMRRoutes||Te({})}return D={get basename(){return f},get future(){return m},get state(){return M},get routes(){return d.stableRoutes},get branches(){return d.branches},get manifest(){return u},get window(){return t},initialize:me,subscribe:ue,enableScrollRestoration:Ut,navigate:Pe,fetch:He,revalidate:Oe,createHref:F=>e.history.createHref(F),createURL:F=>e.history.createURL(F),encodeLocation:F=>e.history.encodeLocation(F),getFetcher:dt,resetFetcher:pt,deleteFetcher:jt,dispose:ge,getBlocker:wt,deleteBlocker:Zt,patchRoutes:Tt,_internalFetchControllers:K,_internalSetRoutes:et,_internalSetStateDoNotUseOrYouWillBreakYourApp(F){Te(F)}},e.instrumentations&&(D=A_(D,e.instrumentations.map(F=>F.router).filter(Boolean))),D}function V_(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function rv(e,t,i,s,o,c){let u,d;if(o){u=[];for(let g of t)if(u.push(g),g.route.id===o){d=g;break}}else u=t,d=t[t.length-1];let f=dd(s||".",ig(u),ei(e.pathname,i)||e.pathname,c==="path");if(s==null&&(f.search=e.search,f.hash=e.hash),(s==null||s===""||s===".")&&d){let g=wb(f.search);if(d.route.index&&!g)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&g){let m=new URLSearchParams(f.search),h=m.getAll("index");m.delete("index"),h.filter(S=>S).forEach(S=>m.append("index",S));let x=m.toString();f.search=x?`?${x}`:""}}return i!=="/"&&(f.pathname=w_({basename:i,pathname:f.pathname})),Fr(f)}function $E(e,t,i){if(!i||!V_(i))return{path:t};if(i.formMethod&&!c6(i.formMethod))return{path:t,error:Ni(405,{method:i.formMethod})};let s=()=>({path:t,error:Ni(400,{type:"invalid-body"})}),c=(i.formMethod||"get").toUpperCase(),u=vO(t);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!kr(c))return s();let h=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[S,w])=>`${x}${S}=${w}
47
- `,""):String(i.body);return{path:t,submission:{formMethod:c,formAction:u,formEncType:i.formEncType,formData:void 0,json:void 0,text:h}}}else if(i.formEncType==="application/json"){if(!kr(c))return s();try{let h=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:t,submission:{formMethod:c,formAction:u,formEncType:i.formEncType,formData:void 0,json:h,text:void 0}}}catch{return s()}}}_t(typeof FormData=="function","FormData is not available in this environment");let d,f;if(i.formData)d=av(i.formData),f=i.formData;else if(i.body instanceof FormData)d=av(i.body),f=i.body;else if(i.body instanceof URLSearchParams)d=i.body,f=tR(d);else if(i.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(i.body),f=tR(d)}catch{return s()}let g={formMethod:c,formAction:u,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(kr(g.formMethod))return{path:t,submission:g};let m=es(t);return e&&m.search&&wb(m.search)&&d.append("index",""),m.search=`?${d}`,{path:Fr(m),submission:g}}function QE(e,t,i,s,o,c,u,d,f,g,m,h,x,S,w,C,E,R,k,O,A,N){let j=A?pi(A[1])?A[1].error:A[1].data:void 0,D=o.createURL(c.location),M=o.createURL(f),_;if(m&&c.errors){let z=Object.keys(c.errors)[0];_=u.findIndex(Q=>Q.route.id===z)}else if(A&&pi(A[1])){let z=A[0];_=u.findIndex(Q=>Q.route.id===z)-1}let L=A?A[1].statusCode:void 0,q=L&&L>=400,X={currentUrl:D,currentParams:c.matches[0]?.params||{},nextUrl:M,nextParams:u[0].params,...d,actionResult:j,actionStatus:L},B=hd(u),H=u.map((z,Q)=>{let{route:$}=z,K=null;if(_!=null&&Q>_)K=!1;else if($.lazy)K=!0;else if(!xb($))K=!1;else if(m){let{shouldLoad:oe}=dO($,c.loaderData,c.errors);K=oe}else K_(c.loaderData,c.matches[Q],z)&&(K=!0);if(K!==null)return iv(i,s,e,f,B,z,g,t,K);let Y=!1;typeof N=="boolean"?Y=N:q?Y=!1:(h||D.pathname+D.search===M.pathname+M.search||D.search!==M.search||q_(c.matches[Q],z))&&(Y=!0);let ee={...X,defaultShouldRevalidate:Y},G=Au(z,ee);return iv(i,s,e,f,B,z,g,t,G,ee,N)}),U=[];return w.forEach((z,Q)=>{if(m||!u.some(V=>V.route.id===z.routeId)||S.has(Q))return;let $=c.fetchers.get(Q),K=$&&$.state!=="idle"&&$.data===void 0,Y=qi(E,z.path,R??"/",!1,O);if(!Y){if(k&&K)return;U.push({key:Q,routeId:z.routeId,path:z.path,matches:null,match:null,request:null,controller:null});return}if(C.has(Q))return;let ee=Ah(Y,z.path),G=new AbortController,oe=_l(o,z.path,G.signal),I=null;if(x.has(Q))x.delete(Q),I=Xl(i,s,oe,z.path,Y,ee,g,t);else if(K)h&&(I=Xl(i,s,oe,z.path,Y,ee,g,t));else{let V;typeof N=="boolean"?V=N:q?V=!1:V=h;let W={...X,defaultShouldRevalidate:V};Au(ee,W)&&(I=Xl(i,s,oe,z.path,Y,ee,g,t,W))}I&&U.push({key:Q,routeId:z.routeId,path:z.path,matches:I,match:ee,request:oe,controller:G})}),{dsMatches:H,revalidatingFetchers:U}}function xb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function dO(e,t,i){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!xb(e))return{shouldLoad:!1,renderFallback:!1};let s=t!=null&&e.id in t,o=i!=null&&i[e.id]!==void 0;if(!s&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!s};let c=!s&&!o;return{shouldLoad:c,renderFallback:c}}function K_(e,t,i){let s=!t||i.route.id!==t.route.id,o=!e.hasOwnProperty(i.route.id);return s||o}function q_(e,t){let i=e.route.path;return e.pathname!==t.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==t.params["*"]}function Au(e,t){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(t);if(typeof i=="boolean")return i}return t.defaultShouldRevalidate}function XE(e,t,i,s,o,c){let u;if(e){let g=s[e];_t(g,`No route found to patch children into: routeId = ${e}`),g.children||(g.children=[]),u=g.children}else u=i.activeRoutes;let d=[],f=[];if(t.forEach(g=>{let m=u.find(h=>fO(g,h));m?f.push({existingRoute:m,newRoute:g}):d.push(g)}),d.length>0){let g=Hu(d,o,[e||"_","patch",String(u?.length||"0")],s);u.push(...g)}if(c&&f.length>0)for(let g=0;g<f.length;g++){let{existingRoute:m,newRoute:h}=f[g],x=m,[S]=Hu([h],o,[],{},!0);Object.assign(x,{element:S.element?S.element:x.element,errorElement:S.errorElement?S.errorElement:x.errorElement,hydrateFallbackElement:S.hydrateFallbackElement?S.hydrateFallbackElement:x.hydrateFallbackElement})}i.hasHMRRoutes||i.setRoutes([...i.activeRoutes])}function fO(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((i,s)=>t.children?.some(o=>fO(i,o)))??!1:!1}var ZE=new WeakMap,hO=({key:e,route:t,manifest:i,mapRouteProperties:s})=>{let o=i[t.id];if(_t(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let c=o.lazy[e];if(!c)return;let u=ZE.get(o);u||(u={},ZE.set(o,u));let d=u[e];if(d)return d;let f=(async()=>{let g=l_(e),h=o[e]!==void 0&&e!=="hasErrorBoundary";if(g)Hn(!g,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(h)Hn(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await c();x!=null&&(Object.assign(o,{[e]:x}),Object.assign(o,s(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(x=>x===void 0)&&(o.lazy=void 0))})();return u[e]=f,f},JE=new WeakMap;function Y_(e,t,i,s,o){let c=i[e.id];if(_t(c,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=JE.get(c);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let h=(async()=>{_t(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),S={};for(let w in x){let C=x[w];if(C===void 0)continue;let E=u_(w),k=c[w]!==void 0&&w!=="hasErrorBoundary";E?Hn(!E,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):k?Hn(!k,`Route "${c.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.`):S[w]=C}Object.assign(c,S),Object.assign(c,{...s(c),lazy:void 0})})();return JE.set(c,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let u=Object.keys(e.lazy),d=[],f;for(let m of u){if(o&&o.includes(m))continue;let h=hO({key:m,route:e,manifest:i,mapRouteProperties:s});h&&(d.push(h),m===t&&(f=h))}let g=d.length>0?Promise.all(d).then(()=>{}):void 0;return g?.catch(()=>{}),f?.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:f}}async function WE(e){let t=e.matches.filter(o=>o.shouldLoad),i={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,c)=>{i[t[c].route.id]=o}),i}async function G_(e){return e.matches.some(t=>t.route.middleware)?pO(e,()=>WE(e)):WE(e)}function pO(e,t){return $_(e,t,s=>{if(l6(s))throw s;return s},i6,i);function i(s,o,c){if(c)return Promise.resolve(Object.assign(c.value,{[o]:{type:"error",result:s}}));{let{matches:u}=e,d=Math.min(Math.max(u.findIndex(g=>g.route.id===o),0),Math.max(u.findIndex(g=>g.shouldCallHandler()),0)),f=Pa(u,u[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:s}})}}}async function $_(e,t,i,s,o){let{matches:c,...u}=e,d=c.flatMap(g=>g.route.middleware?g.route.middleware.map(m=>[g.route.id,m]):[]);return await gO(u,d,t,i,s,o)}async function gO(e,t,i,s,o,c,u=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let f=t[u];if(!f)return await i();let[g,m]=f,h,x=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");try{return h={value:await gO(e,t,i,s,o,c,u+1)},h.value}catch(S){return h={value:await c(S,g,h)},h.value}};try{let S=await m(e,x),w=S!=null?s(S):void 0;return o(w)?w:h?w??h.value:(h={value:await x()},h.value)}catch(S){return await c(S,g,h)}}function mO(e,t,i,s,o){let c=hO({key:"middleware",route:s.route,manifest:t,mapRouteProperties:e}),u=Y_(s.route,kr(i.method)?"action":"loader",t,e,o);return{middleware:c,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function iv(e,t,i,s,o,c,u,d,f,g=null,m){let h=!1,x=mO(e,t,i,c,u);return{...c,_lazyPromises:x,shouldLoad:f,shouldRevalidateArgs:g,shouldCallHandler(S){return h=!0,g?typeof m=="boolean"?Au(c,{...g,defaultShouldRevalidate:m}):typeof S=="boolean"?Au(c,{...g,defaultShouldRevalidate:S}):Au(c,g):f},resolve(S){let{lazy:w,loader:C,middleware:E}=c.route,R=h||f||S&&!kr(i.method)&&(w||C),k=E&&E.length>0&&!C&&!w;return R&&(kr(i.method)||!k)?X_({request:i,path:s,pattern:o,match:c,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:S,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function Xl(e,t,i,s,o,c,u,d,f=null){return o.map(g=>g.route.id!==c.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:mO(e,t,i,g,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:iv(e,t,i,s,hd(o),g,u,d,!0,f))}async function Q_(e,t,i,s,o,c,u){s.some(m=>m._lazyPromises?.middleware)&&await Promise.all(s.map(m=>m._lazyPromises?.middleware));let d={request:t,url:yO(t,i),pattern:hd(s),params:s[0].params,context:c,matches:s},g=await e({...d,fetcherKey:o,runClientMiddleware:m=>{let h=d;return pO(h,()=>m({...h,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(m=>[m._lazyPromises?.handler,m._lazyPromises?.route]))}catch{}return g}async function X_({request:e,path:t,pattern:i,match:s,lazyHandlerPromise:o,lazyRoutePromise:c,handlerOverride:u,scopedContext:d}){let f,g,m=kr(e.method),h=m?"action":"loader",x=S=>{let w,C=new Promise((k,O)=>w=O);g=()=>w(),e.signal.addEventListener("abort",g);let E=k=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${s.route.id}]`)):S({request:e,url:yO(e,t),pattern:i,params:s.params,context:d},...k!==void 0?[k]:[]),R=(async()=>{try{return{type:"data",result:await(u?u(O=>E(O)):E())}}catch(k){return{type:"error",result:k}}})();return Promise.race([R,C])};try{let S=m?s.route.action:s.route.loader;if(o||c)if(S){let w,[C]=await Promise.all([x(S).catch(E=>{w=E}),o,c]);if(w!==void 0)throw w;f=C}else{await o;let w=m?s.route.action:s.route.loader;if(w)[f]=await Promise.all([x(w),c]);else if(h==="action"){let C=new URL(e.url),E=C.pathname+C.search;throw Ni(405,{method:e.method,pathname:E,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(S)f=await x(S);else{let w=new URL(e.url),C=w.pathname+w.search;throw Ni(404,{pathname:C})}}catch(S){return{type:"error",result:S}}finally{g&&e.signal.removeEventListener("abort",g)}return f}async function Z_(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function J_(e){let{result:t,type:i}=e;if(Sb(t)){let s;try{s=await Z_(t)}catch(o){return{type:"error",error:o}}return i==="error"?{type:"error",error:new fd(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:"data",data:s,statusCode:t.status,headers:t.headers}}return i==="error"?sR(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:r6(t),statusCode:Bu(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Bu(t)?t.status:void 0}:sR(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function W_(e,t,i,s,o){let c=e.headers.get("Location");if(_t(c,"Redirects returned/thrown from loaders/actions must have a Location header"),!yb(c)){let u=s.slice(0,s.findIndex(d=>d.route.id===i)+1);c=rv(new URL(t.url),u,o,c),e.headers.set("Location",c)}return e}var e6=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function sv(e){try{return e6.includes(new URL(e).protocol)}catch{return!1}}function eR(e,t,i,s){if(yb(e)){let o=e,c=rg.test(o)?new URL($k(o,t.protocol)):new URL(o);if(sv(c.toString()))throw new Error("Invalid redirect location");let u=ei(c.pathname,i)!=null;if(c.origin===t.origin&&u)return vb(c.pathname)+c.search+c.hash}try{let o=s.createURL(e);if(sv(o.toString()))throw new Error("Invalid redirect location")}catch{}return e}function _l(e,t,i,s){let o=e.createURL(vO(t)).toString(),c={signal:i};if(s&&kr(s.formMethod)){let{formMethod:u,formEncType:d}=s;c.method=u.toUpperCase(),d==="application/json"?(c.headers=new Headers({"Content-Type":d}),c.body=JSON.stringify(s.json)):d==="text/plain"?c.body=s.text:d==="application/x-www-form-urlencoded"&&s.formData?c.body=av(s.formData):c.body=s.formData}return new Request(o,c)}function yO(e,t){let i=new URL(e.url),s=typeof t=="string"?es(t):t;if(i.pathname=s.pathname||"/",s.search){let o=new URLSearchParams(s.search),c=o.getAll("index");o.delete("index");for(let u of c.filter(Boolean))o.append("index",u);i.search=o.size?`?${o.toString()}`:""}else i.search="";return i.hash=s.hash||"",i}function av(e){let t=new URLSearchParams;for(let[i,s]of e.entries())t.append(i,typeof s=="string"?s:s.name);return t}function tR(e){let t=new FormData;for(let[i,s]of e.entries())t.append(i,s);return t}function t6(e,t,i,s=!1,o=!1){let c={},u=null,d,f=!1,g={},m=i&&pi(i[1])?i[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let x=h.route.id,S=t[x];if(_t(!Ao(S),"Cannot handle redirect results in processLoaderData"),pi(S)){let w=S.error;if(m!==void 0&&(w=m,m=void 0),u=u||{},o)u[x]=w;else{let C=Pa(e,x);u[C.route.id]==null&&(u[C.route.id]=w)}s||(c[x]=uO),f||(f=!0,d=Bu(S.error)?S.error.status:500),S.headers&&(g[x]=S.headers)}else c[x]=S.data,S.statusCode&&S.statusCode!==200&&!f&&(d=S.statusCode),S.headers&&(g[x]=S.headers)}),m!==void 0&&i&&(u={[i[0]]:m},i[2]&&(c[i[2]]=void 0)),{loaderData:c,errors:u,statusCode:d||200,loaderHeaders:g}}function nR(e,t,i,s,o,c,u){let{loaderData:d,errors:f}=t6(t,i,s);return o.filter(g=>!g.matches||g.matches.some(m=>m.shouldLoad)).forEach(g=>{let{key:m,match:h,controller:x}=g;if(x&&x.signal.aborted)return;let S=c[m];if(_t(S,"Did not find corresponding fetcher result"),pi(S)){let w=Pa(e.matches,h?.route.id);f&&f[w.route.id]||(f={...f,[w.route.id]:S.error}),u.delete(m)}else if(Ao(S))_t(!1,"Unhandled fetcher revalidation redirect");else{let w=ps(S.data);u.set(m,w)}}),{loaderData:d,errors:f}}function rR(e,t,i,s){let o=Object.entries(t).filter(([,c])=>c!==uO).reduce((c,[u,d])=>(c[u]=d,c),{});for(let c of i){let u=c.route.id;if(!t.hasOwnProperty(u)&&e.hasOwnProperty(u)&&c.route.loader&&(o[u]=e[u]),s&&s.hasOwnProperty(u))break}return o}function iR(e){return e?pi(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Pa(e,t){return(t?e.slice(0,e.findIndex(s=>s.route.id===t)+1):[...e]).reverse().find(s=>s.route.hasErrorBoundary===!0)||e[0]}function ch(e){let t=e.length===1?e[0]:e.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ni(e,{pathname:t,routeId:i,method:s,type:o,message:c}={}){let u="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(u="Bad Request",s&&t&&i?d=`You made a ${s} request to "${t}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:o==="invalid-body"&&(d="Unable to encode submission body")):e===403?(u="Forbidden",d=`Route "${i}" does not match URL "${t}"`):e===404?(u="Not Found",d=`No route matches URL "${t}"`):e===405&&(u="Method Not Allowed",s&&t&&i?d=`You made a ${s.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:s&&(d=`Invalid request method "${s.toUpperCase()}"`)),new fd(e||500,u,new Error(d),!0)}function uh(e){let t=Object.entries(e);for(let i=t.length-1;i>=0;i--){let[s,o]=t[i];if(Ao(o))return{key:s,result:o}}}function vO(e){let t=typeof e=="string"?es(e):e;return Fr({...t,hash:""})}function n6(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function r6(e){return new fd(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function i6(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,i])=>typeof t=="string"&&s6(i))}function s6(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function a6(e){return Sb(e.result)&&lO.has(e.result.status)}function pi(e){return e.type==="error"}function Ao(e){return(e&&e.type)==="redirect"}function sR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Sb(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function o6(e){return lO.has(e)}function l6(e){return Sb(e)&&o6(e.status)&&e.headers.has("Location")}function c6(e){return z_.has(e.toUpperCase())}function kr(e){return P_.has(e.toUpperCase())}function wb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ah(e,t){let i=typeof t=="string"?es(t).search:t.search;if(e[e.length-1].route.index&&wb(i||""))return e[e.length-1];let s=rO(e);return s[s.length-1]}function aR(e){let{formMethod:t,formAction:i,formEncType:s,text:o,formData:c,json:u}=e;if(!(!t||!i||!s)){if(o!=null)return{formMethod:t,formAction:i,formEncType:s,formData:void 0,json:void 0,text:o};if(c!=null)return{formMethod:t,formAction:i,formEncType:s,formData:c,json:void 0,text:void 0};if(u!==void 0)return{formMethod:t,formAction:i,formEncType:s,formData:void 0,json:u,text:void 0}}}function my(e,t,i,s){return s?{state:"loading",location:e,matches:t,historyAction:i,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}:{state:"loading",location:e,matches:t,historyAction:i,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function u6(e,t,i,s){return{state:"submitting",location:e,matches:t,historyAction:i,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}}function mu(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function d6(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function ps(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 f6(e,t){try{let i=e.sessionStorage.getItem(cO);if(i){let s=JSON.parse(i);for(let[o,c]of Object.entries(s||{}))c&&Array.isArray(c)&&t.set(o,new Set(c||[]))}}catch{}}function h6(e,t){if(t.size>0){let i={};for(let[s,o]of t)i[s]=[...o];try{e.sessionStorage.setItem(cO,JSON.stringify(i))}catch(s){Hn(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function oR(){let e,t,i=new Promise((s,o)=>{e=async c=>{s(c);try{await i}catch{}},t=async c=>{o(c);try{await i}catch{}}});return{promise:i,resolve:e,reject:t}}var Ho=b.createContext(null);Ho.displayName="DataRouter";var pd=b.createContext(null);pd.displayName="DataRouterState";var bO=b.createContext(!1);function xO(){return b.useContext(bO)}var Eb=b.createContext({isTransitioning:!1});Eb.displayName="ViewTransition";var SO=b.createContext(new Map);SO.displayName="Fetchers";var p6=b.createContext(null);p6.displayName="Await";var bi=b.createContext(null);bi.displayName="Navigation";var sg=b.createContext(null);sg.displayName="Location";var zi=b.createContext({outlet:null,matches:[],isDataRoute:!1});zi.displayName="Route";var Rb=b.createContext(null);Rb.displayName="RouteError";var wO="REACT_ROUTER_ERROR",g6="REDIRECT",m6="ROUTE_ERROR_RESPONSE";function y6(e){if(e.startsWith(`${wO}:${g6}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function v6(e){if(e.startsWith(`${wO}:${m6}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new fd(t.status,t.statusText,t.data)}catch{}}function b6(e,{relative:t}={}){_t(Fo(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:s}=b.useContext(bi),{hash:o,pathname:c,search:u}=gd(e,{relative:t}),d=c;return i!=="/"&&(d=c==="/"?i:Ii([i,c])),s.createHref({pathname:d,search:u,hash:o})}function Fo(){return b.useContext(sg)!=null}function Nr(){return _t(Fo(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(sg).location}function x6(e){_t(Fo(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Nr();return b.useMemo(()=>Fu(e,nO(t)),[t,e])}var EO="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function RO(e){b.useContext(bi).static||b.useLayoutEffect(e)}function Bo(){let{isDataRoute:e}=b.useContext(zi);return e?z6():S6()}function S6(){_t(Fo(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Ho),{basename:t,navigator:i}=b.useContext(bi),{matches:s}=b.useContext(zi),{pathname:o}=Nr(),c=JSON.stringify(ig(s)),u=b.useRef(!1);return RO(()=>{u.current=!0}),b.useCallback((f,g={})=>{if(Hn(u.current,EO),!u.current)return;if(typeof f=="number"){i.go(f);return}let m=dd(f,JSON.parse(c),o,g.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Ii([t,m.pathname])),Ql(typeof f=="string"?f:Fr(f),i.createHref(m),bb(i),"reject"),(g.replace?i.replace:i.push)(m,g.state,g)},[t,i,c,o,e])}var w6=b.createContext(null);function E6(e){let t=b.useContext(zi).outlet;return b.useMemo(()=>t&&b.createElement(w6.Provider,{value:e},t),[t,e])}function R6(){let{matches:e}=b.useContext(zi);return e[e.length-1]?.params??{}}function gd(e,{relative:t}={}){let{matches:i}=b.useContext(zi),{pathname:s}=Nr(),o=JSON.stringify(ig(i));return b.useMemo(()=>dd(e,JSON.parse(o),s,t==="path"),[e,o,s,t])}function C6(e,t,i){_t(Fo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=b.useContext(bi),{matches:o}=b.useContext(zi),c=o[o.length-1],u=c?c.params:{},d=c?c.pathname:"/",f=c?c.pathnameBase:"/",g=c&&c.route;{let E=g&&g.path||"";kO(d,!g||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${E}">) 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.
48
-
49
- Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let m=Nr(),h;h=m;let x=h.pathname||"/",S=x;if(f!=="/"){let E=f.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let w=i&&i.state.matches.length?i.state.matches.map(E=>Object.assign(E,{route:i.manifest[E.route.id]||E.route})):Xk(e,{pathname:S});return Hn(g||w!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Hn(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.`),M6(w&&w.map(E=>Object.assign({},E,{params:Object.assign({},u,E.params),pathname:Ii([f,s.encodeLocation?s.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?f:Ii([f,s.encodeLocation?s.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),o,i)}function T6(){let e=I6(),t=Bu(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},c={padding:"2px 4px",backgroundColor:s},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:c},"ErrorBoundary")," or"," ",b.createElement("code",{style:c},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),i?b.createElement("pre",{style:o},i):null,u)}var k6=b.createElement(T6,null),CO=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const i=v6(e.digest);i&&(e=i)}let t=e!==void 0?b.createElement(zi.Provider,{value:this.props.routeContext},b.createElement(Rb.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(O6,{error:e},t):t}};CO.contextType=bO;var yy=new WeakMap;function O6({children:e,error:t}){let{basename:i,navigator:s}=b.useContext(bi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=y6(t.digest);if(o){let c=yy.get(t);if(c)throw c;let u=sO(o.location,i),d=u.absoluteURL||u.to;if(Ql(o.location,d,bb(s),"allow-explicit"),sv(d))throw new Error("Invalid redirect location");if(iO&&!yy.get(t))if(u.isExternal||o.reloadDocument)window.location.href=d;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw yy.set(t,f),f}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return e}function A6({routeContext:e,match:t,children:i}){let s=b.useContext(Ho);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(zi.Provider,{value:e},i)}function M6(e,t=[],i){let s=i?.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let o=e,c=s?.errors;if(c!=null){let m=o.findIndex(h=>h.route.id&&c?.[h.route.id]!==void 0);_t(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let u=!1,d=-1;if(i&&s){u=s.renderFallback;for(let m=0;m<o.length;m++){let h=o[m];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(d=m),h.route.id){let{loaderData:x,errors:S}=s,w=h.route.loader&&!x.hasOwnProperty(h.route.id)&&(!S||S[h.route.id]===void 0);if(h.route.lazy||w){i.isStatic&&(u=!0),d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}}let f=i?.onError,g=s&&f?(m,h)=>{f(m,{location:s.location,params:s.matches?.[0]?.params??{},pattern:hd(s.matches),errorInfo:h})}:void 0;return o.reduceRight((m,h,x)=>{let S,w=!1,C=null,E=null;s&&(S=c&&h.route.id?c[h.route.id]:void 0,C=h.route.errorElement||k6,u&&(d<0&&x===0?(kO("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,E=null):d===x&&(w=!0,E=h.route.hydrateFallbackElement||null)));let R=t.concat(o.slice(0,x+1)),k=()=>{let O;return S?O=C:w?O=E:h.route.Component?O=b.createElement(h.route.Component,null):h.route.element?O=h.route.element:O=m,b.createElement(A6,{match:h,routeContext:{outlet:m,matches:R,isDataRoute:s!=null},children:O})};return s&&(h.route.ErrorBoundary||h.route.errorElement||x===0)?b.createElement(CO,{location:s.location,revalidation:s.revalidation,component:C,error:S,children:k(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:g}):k()},null)}function Cb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function TO(e){let t=b.useContext(Ho);return _t(t,Cb(e)),t}function Tb(e){let t=b.useContext(pd);return _t(t,Cb(e)),t}function N6(e){let t=b.useContext(zi);return _t(t,Cb(e)),t}function kb(e){let t=N6(e),i=t.matches[t.matches.length-1];return _t(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function D6(){return kb("useRouteId")}function j6(){let{matches:e,loaderData:t}=Tb("useMatches");return b.useMemo(()=>e.map(i=>Zk(i,t)),[e,t])}function I6(){let e=b.useContext(Rb),t=Tb("useRouteError"),i=kb("useRouteError");return e!==void 0?e:t.errors?.[i]}var P6=0;function L6(e){let{router:t,basename:i}=TO("useBlocker"),s=Tb("useBlocker"),[o,c]=b.useState(""),u=b.useCallback(d=>{if(typeof e!="function")return!!e;if(i==="/")return e(d);let{currentLocation:f,nextLocation:g,historyAction:m}=d;return e({currentLocation:{...f,pathname:ei(f.pathname,i)||f.pathname},nextLocation:{...g,pathname:ei(g.pathname,i)||g.pathname},historyAction:m})},[i,e]);return b.useEffect(()=>{let d=String(++P6);return c(d),()=>t.deleteBlocker(d)},[t]),b.useEffect(()=>{o!==""&&t.getBlocker(o,u)},[t,o,u]),o&&s.blockers.has(o)?s.blockers.get(o):Pl}function z6(){let{router:e}=TO("useNavigate"),t=kb("useNavigate"),i=b.useRef(!1);return RO(()=>{i.current=!0}),b.useCallback(async(o,c={})=>{Hn(i.current,EO),i.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...c}))},[e,t])}var lR={};function kO(e,t,i){!t&&!lR[e]&&(lR[e]=!0,Hn(!1,i))}var cR={};function uR(e,t){!e&&!cR[t]&&(cR[t]=!0,console.warn(t))}var _6="useOptimistic",dR=BR[_6],U6=()=>{};function H6(e){return dR?dR(e):[e,U6]}function F6(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Hn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:b.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Hn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:b.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Hn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var B6=["HydrateFallback","hydrateFallbackElement"],V6=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",e(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",t(i))}})}};function K6({router:e,flushSync:t,onError:i,useTransitions:s}){s=xO()||s;let[c,u]=b.useState(e.state),[d,f]=H6(c),[g,m]=b.useState(),[h,x]=b.useState({isTransitioning:!1}),[S,w]=b.useState(),[C,E]=b.useState(),[R,k]=b.useState(),O=b.useRef(new Map),A=b.useCallback((M,{deletedFetchers:_,newErrors:L,flushSync:q,viewTransitionOpts:X})=>{L&&i&&Object.values(L).forEach(H=>i(H,{location:M.location,params:M.matches[0]?.params??{},pattern:hd(M.matches)})),M.fetchers.forEach((H,U)=>{H.data!==void 0&&O.current.set(U,H.data)}),_.forEach(H=>O.current.delete(H)),uR(q===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let B=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(uR(X==null||B,"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."),!X||!B){t&&q?t(()=>u(M)):s===!1?u(M):b.startTransition(()=>{s===!0&&f(H=>fR(H,M)),u(M)});return}if(t&&q){t(()=>{C&&(S?.resolve(),C.skipTransition()),x({isTransitioning:!0,flushSync:!0,currentLocation:X.currentLocation,nextLocation:X.nextLocation})});let H=e.window.document.startViewTransition(()=>{t(()=>u(M))});H.finished.finally(()=>{t(()=>{w(void 0),E(void 0),m(void 0),x({isTransitioning:!1})})}),t(()=>E(H));return}C?(S?.resolve(),C.skipTransition(),k({state:M,currentLocation:X.currentLocation,nextLocation:X.nextLocation})):(m(M),x({isTransitioning:!0,flushSync:!1,currentLocation:X.currentLocation,nextLocation:X.nextLocation}))},[e.window,t,C,S,s,f,i]);b.useLayoutEffect(()=>e.subscribe(A),[e,A]),b.useEffect(()=>{h.isTransitioning&&!h.flushSync&&w(new V6)},[h]),b.useEffect(()=>{if(S&&g&&e.window){let M=g,_=S.promise,L=e.window.document.startViewTransition(async()=>{s===!1?u(M):b.startTransition(()=>{s===!0&&f(q=>fR(q,M)),u(M)}),await _});L.finished.finally(()=>{w(void 0),E(void 0),m(void 0),x({isTransitioning:!1})}),E(L)}},[g,S,e.window,s,f]),b.useEffect(()=>{S&&g&&d.location.key===g.location.key&&S.resolve()},[S,C,d.location,g]),b.useEffect(()=>{!h.isTransitioning&&R&&(m(R.state),x({isTransitioning:!0,flushSync:!1,currentLocation:R.currentLocation,nextLocation:R.nextLocation}),k(void 0))},[h.isTransitioning,R]);let N=b.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:M=>e.navigate(M),push:(M,_,L)=>e.navigate(M,{state:_,preventScrollReset:L?.preventScrollReset}),replace:(M,_,L)=>e.navigate(M,{replace:!0,state:_,preventScrollReset:L?.preventScrollReset})}),[e]),j=e.basename||"/",D=b.useMemo(()=>({router:e,navigator:N,static:!1,basename:j,onError:i}),[e,N,j,i]);return b.createElement(b.Fragment,null,b.createElement(Ho.Provider,{value:D},b.createElement(pd.Provider,{value:d},b.createElement(SO.Provider,{value:O.current},b.createElement(Eb.Provider,{value:h},b.createElement($6,{basename:j,location:d.location,navigationType:d.historyAction,navigator:N,useTransitions:s},b.createElement(q6,{routes:e.routes,manifest:e.manifest,future:e.future,state:d,isStatic:!1,onError:i})))))),null)}function fR(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var q6=b.memo(Y6);function Y6({routes:e,manifest:t,future:i,state:s,isStatic:o,onError:c}){return C6(e,void 0,{manifest:t,state:s,isStatic:o,onError:c})}function G6({to:e,replace:t,state:i,relative:s}){_t(Fo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:c}=b.useContext(bi);Hn(!o,"<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:u}=b.useContext(zi),{pathname:d}=Nr(),f=Bo(),g=dd(e,ig(u),d,s==="path");Ql(typeof e=="string"?e:Fr(e),c.createHref(g),bb(c),"reject");let m=JSON.stringify(g);return b.useEffect(()=>{f(JSON.parse(m),{replace:t,state:i,relative:s})},[f,m,s,t,i]),null}function OO(e){return E6(e.context)}function $6({basename:e="/",children:t=null,location:i,navigationType:s="POP",navigator:o,static:c=!1,useTransitions:u}){_t(!Fo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),f=b.useMemo(()=>({basename:d,navigator:o,static:c,useTransitions:u,future:{}}),[d,o,c,u]);typeof i=="string"&&(i=es(i));let{pathname:g="/",search:m="",hash:h="",state:x=null,key:S="default",mask:w}=i,C=b.useMemo(()=>{let E=ei(g,d);return E==null?null:{location:{pathname:E,search:m,hash:h,state:x,key:S,mask:w},navigationType:s}},[d,g,m,h,x,S,s,w]);return Hn(C!=null,`<Router basename="${d}"> is not able to match the URL "${g}${m}${h}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:b.createElement(bi.Provider,{value:f},b.createElement(sg.Provider,{children:t,value:C}))}var Mh="get",Nh="application/x-www-form-urlencoded";function ag(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Q6(e){return ag(e)&&e.tagName.toLowerCase()==="button"}function X6(e){return ag(e)&&e.tagName.toLowerCase()==="form"}function Z6(e){return ag(e)&&e.tagName.toLowerCase()==="input"}function J6(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function W6(e,t){return e.button===0&&(!t||t==="_self")&&!J6(e)}function ov(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,i)=>{let s=e[i];return t.concat(Array.isArray(s)?s.map(o=>[i,o]):[[i,s]])},[]))}function e8(e,t){let i=ov(e);return t&&t.forEach((s,o)=>{i.has(o)||t.getAll(o).forEach(c=>{i.append(o,c)})}),i}var dh=null;function t8(){if(dh===null)try{new FormData(document.createElement("form"),0),dh=!1}catch{dh=!0}return dh}var n8=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vy(e){return e!=null&&!n8.has(e)?(Hn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nh}"`),null):e}function r8(e,t){let i,s,o,c,u;if(X6(e)){let d=e.getAttribute("action");s=d?ei(d,t):null,i=e.getAttribute("method")||Mh,o=vy(e.getAttribute("enctype"))||Nh,c=new FormData(e)}else if(Q6(e)||Z6(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 f=e.getAttribute("formaction")||d.getAttribute("action");if(s=f?ei(f,t):null,i=e.getAttribute("formmethod")||d.getAttribute("method")||Mh,o=vy(e.getAttribute("formenctype"))||vy(d.getAttribute("enctype"))||Nh,c=new FormData(d,e),!t8()){let{name:g,type:m,value:h}=e;if(m==="image"){let x=g?`${g}.`:"";c.append(`${x}x`,"0"),c.append(`${x}y`,"0")}else g&&c.append(g,h)}}else{if(ag(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Mh,s=null,o=Nh,u=e}return c&&o==="text/plain"&&(u=c,c=void 0),{action:s,method:i.toLowerCase(),encType:o,formData:c,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ob(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function AO(e,t,i,s){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return i?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:t&&ei(o.pathname,t)==="/"?o.pathname=`${sc(t)}/_root.${s}`:o.pathname=`${sc(o.pathname)}.${s}`,o}async function i8(e,t){if(e.id in t)return t[e.id];try{let i=await import(e.module);return t[e.id]=i,i}catch(i){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function s8(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 a8(e,t,i){let s=await Promise.all(e.map(async o=>{let c=t.routes[o.route.id];if(c){let u=await i8(c,i);return u.links?u.links():[]}return[]}));return u8(s.flat(1).filter(s8).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function hR(e,t,i,s,o,c){let u=(f,g)=>i[g]?f.route.id!==i[g].route.id:!0,d=(f,g)=>i[g].pathname!==f.pathname||i[g].route.path?.endsWith("*")&&i[g].params["*"]!==f.params["*"];return c==="assets"?t.filter((f,g)=>u(f,g)||d(f,g)):c==="data"?t.filter((f,g)=>{let m=s.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(u(f,g)||d(f,g))return!0;if(f.route.shouldRevalidate){let h=f.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:i[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function o8(e,t,{includeHydrateFallback:i}={}){return l8(e.map(s=>{let o=t.routes[s.route.id];if(!o)return[];let c=[o.module];return o.clientActionModule&&(c=c.concat(o.clientActionModule)),o.clientLoaderModule&&(c=c.concat(o.clientLoaderModule)),i&&o.hydrateFallbackModule&&(c=c.concat(o.hydrateFallbackModule)),o.imports&&(c=c.concat(o.imports)),c}).flat(1))}function l8(e){return[...new Set(e)]}function c8(e){let t={},i=Object.keys(e).sort();for(let s of i)t[s]=e[s];return t}function u8(e,t){let i=new Set;return new Set(t),e.reduce((s,o)=>{let c=JSON.stringify(c8(o));return i.has(c)||(i.add(c),s.push({key:c,link:o})),s},[])}function Ab(){let e=b.useContext(Ho);return Ob(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function d8(){let e=b.useContext(pd);return Ob(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Mb=b.createContext(void 0);Mb.displayName="FrameworkContext";function og(){let e=b.useContext(Mb);return Ob(e,"You must render this element inside a <HydratedRouter> element"),e}function f8(e,t){let i=b.useContext(Mb),[s,o]=b.useState(!1),[c,u]=b.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:g,onMouseLeave:m,onTouchStart:h}=t,x=b.useRef(null);b.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let C=R=>{R.forEach(k=>{u(k.isIntersecting)})},E=new IntersectionObserver(C,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[e]),b.useEffect(()=>{if(s){let C=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(C)}}},[s]);let S=()=>{o(!0)},w=()=>{o(!1),u(!1)};return i?e!=="intent"?[c,x,{}]:[c,x,{onFocus:yu(d,S),onBlur:yu(f,w),onMouseEnter:yu(g,S),onMouseLeave:yu(m,w),onTouchStart:yu(h,S)}]:[!1,x,{}]}function yu(e,t){return i=>{e&&e(i),i.defaultPrevented||t(i)}}function h8({page:e,...t}){let i=xO(),{nonce:s}=og(),{router:o}=Ab(),c=b.useMemo(()=>Xk(o.routes,e,o.basename),[o.routes,e,o.basename]);return c?(t.nonce==null&&s&&(t={...t,nonce:s}),i?b.createElement(g8,{page:e,matches:c,...t}):b.createElement(m8,{page:e,matches:c,...t})):null}function p8(e){let{manifest:t,routeModules:i}=og(),[s,o]=b.useState([]);return b.useEffect(()=>{let c=!1;return a8(e,t,i).then(u=>{c||o(u)}),()=>{c=!0}},[e,t,i]),s}function g8({page:e,matches:t,...i}){let s=Nr(),{future:o}=og(),{basename:c}=Ab(),u=b.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let d=AO(e,c,o.v8_trailingSlashAwareDataRequests,"rsc"),f=!1,g=[];for(let m of t)typeof m.route.shouldRevalidate=="function"?f=!0:g.push(m.route.id);return f&&g.length>0&&d.searchParams.set("_routes",g.join(",")),[d.pathname+d.search]},[c,o.v8_trailingSlashAwareDataRequests,e,s,t]);return b.createElement(b.Fragment,null,u.map(d=>b.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...i})))}function m8({page:e,matches:t,...i}){let s=Nr(),{future:o,manifest:c,routeModules:u}=og(),{basename:d}=Ab(),{loaderData:f,matches:g}=d8(),m=b.useMemo(()=>hR(e,t,g,c,s,"data"),[e,t,g,c,s]),h=b.useMemo(()=>hR(e,t,g,c,s,"assets"),[e,t,g,c,s]),x=b.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let C=new Set,E=!1;if(t.forEach(k=>{let O=c.routes[k.route.id];!O||!O.hasLoader||(!m.some(A=>A.route.id===k.route.id)&&k.route.id in f&&u[k.route.id]?.shouldRevalidate||O.hasClientLoader?E=!0:C.add(k.route.id))}),C.size===0)return[];let R=AO(e,d,o.v8_trailingSlashAwareDataRequests,"data");return E&&C.size>0&&R.searchParams.set("_routes",t.filter(k=>C.has(k.route.id)).map(k=>k.route.id).join(",")),[R.pathname+R.search]},[d,o.v8_trailingSlashAwareDataRequests,f,s,c,m,t,e,u]),S=b.useMemo(()=>o8(h,c),[h,c]),w=p8(h);return b.createElement(b.Fragment,null,x.map(C=>b.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...i})),S.map(C=>b.createElement("link",{key:C,rel:"modulepreload",href:C,...i})),w.map(({key:C,link:E})=>b.createElement("link",{key:C,nonce:i.nonce,...E,crossOrigin:E.crossOrigin??i.crossOrigin})))}function y8(...e){return t=>{e.forEach(i=>{typeof i=="function"?i(t):i!=null&&(i.current=t)})}}var v8=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{v8&&(window.__reactRouterVersion="7.18.5")}catch{}function b8(e,t){return B_({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:i_({window:t?.window}),hydrationData:x8(),routes:e,mapRouteProperties:F6,hydrationRouteProperties:B6,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function x8(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:S8(e.errors)}),e}function S8(e){if(!e)return null;let t=Object.entries(e),i={};for(let[s,o]of t)if(o&&o.__type==="RouteErrorResponse")i[s]=new fd(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&k_.includes(o.__subType)){let c=window[o.__subType];if(typeof c=="function")try{let u=new c(o.message);u.stack="",i[s]=u}catch{}}if(i[s]==null){let c=new Error(o.message);c.stack="",i[s]=c}}else i[s]=o;return i}var md=b.forwardRef(function({onClick:t,discover:i="render",prefetch:s="none",relative:o,reloadDocument:c,replace:u,mask:d,state:f,target:g,to:m,preventScrollReset:h,viewTransition:x,defaultShouldRevalidate:S,...w},C){let{basename:E,navigator:R,useTransitions:k}=b.useContext(bi),O=typeof m=="string"&&ng.test(m),A=sO(m,E);m=A.to;let N=b6(m,{relative:o}),j=Nr(),D=null;if(d){let U=dd(d,[],j.mask?j.mask.pathname:"/",!0);E!=="/"&&(U.pathname=U.pathname==="/"?E:Ii([E,U.pathname])),D=R.createHref(U)}let[M,_,L]=f8(s,w),q=R8(m,{replace:u,mask:d,state:f,target:g,preventScrollReset:h,relative:o,viewTransition:x,defaultShouldRevalidate:S,useTransitions:k});function X(U){t&&t(U),U.defaultPrevented||q(U)}let B=!(A.isExternal||c),H=b.createElement("a",{...w,...L,href:(B?D:void 0)||A.absoluteURL||N,onClick:B?X:t,ref:y8(C,_),target:g,"data-discover":!O&&i==="render"?"true":void 0});return M&&!O?b.createElement(b.Fragment,null,H,b.createElement(h8,{page:N})):H});md.displayName="Link";var Mu=b.forwardRef(function({"aria-current":t="page",caseSensitive:i=!1,className:s="",end:o=!1,style:c,to:u,viewTransition:d,children:f,...g},m){let h=gd(u,{relative:g.relative}),x=Nr(),S=b.useContext(pd),{navigator:w,basename:C}=b.useContext(bi),E=S!=null&&N8(h)&&d===!0,R=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,k=x.pathname,O=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(k=k.toLowerCase(),O=O?O.toLowerCase():null,R=R.toLowerCase()),O&&C&&(O=ei(O,C)||O);const A=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let N=k===R||!o&&k.startsWith(R)&&k.charAt(A)==="/",j=O!=null&&(O===R||!o&&O.startsWith(R)&&O.charAt(R.length)==="/"),D={isActive:N,isPending:j,isTransitioning:E},M=N?t:void 0,_;typeof s=="function"?_=s(D):_=[s,N?"active":null,j?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let L=typeof c=="function"?c(D):c;return b.createElement(md,{...g,"aria-current":M,className:_,ref:m,style:L,to:u,viewTransition:d},typeof f=="function"?f(D):f)});Mu.displayName="NavLink";var w8=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:i,reloadDocument:s,replace:o,state:c,method:u=Mh,action:d,onSubmit:f,relative:g,preventScrollReset:m,viewTransition:h,defaultShouldRevalidate:x,...S},w)=>{let{useTransitions:C}=b.useContext(bi),E=O8(),R=A8(d,{relative:g}),k=u.toLowerCase()==="get"?"get":"post",O=typeof d=="string"&&ng.test(d),A=N=>{if(f&&f(N),N.defaultPrevented)return;N.preventDefault();let j=N.nativeEvent.submitter,D=j?.getAttribute("formmethod")||u,M=()=>E(j||N.currentTarget,{fetcherKey:t,method:D,navigate:i,replace:o,state:c,relative:g,preventScrollReset:m,viewTransition:h,defaultShouldRevalidate:x});C&&i!==!1?b.startTransition(()=>M()):M()};return b.createElement("form",{ref:w,method:k,action:R,onSubmit:s?f:A,...S,"data-discover":!O&&e==="render"?"true":void 0})});w8.displayName="Form";function E8(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function MO(e){let t=b.useContext(Ho);return _t(t,E8(e)),t}function R8(e,{target:t,replace:i,mask:s,state:o,preventScrollReset:c,relative:u,viewTransition:d,defaultShouldRevalidate:f,useTransitions:g}={}){let m=Bo(),h=Nr(),x=gd(e,{relative:u});return b.useCallback(S=>{if(W6(S,t)){S.preventDefault();let w=i!==void 0?i:Fr(h)===Fr(x),C=()=>m(e,{replace:w,mask:s,state:o,preventScrollReset:c,relative:u,viewTransition:d,defaultShouldRevalidate:f});g?b.startTransition(()=>C()):C()}},[h,m,x,i,s,o,t,e,c,u,d,f,g])}function C8(e){Hn(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 t=b.useRef(ov(e)),i=b.useRef(!1),s=Nr(),o=b.useMemo(()=>e8(s.search,i.current?null:t.current),[s.search]),c=Bo(),u=b.useCallback((d,f)=>{const g=ov(typeof d=="function"?d(new URLSearchParams(o)):d);i.current=!0,c("?"+g,f)},[c,o]);return[o,u]}var T8=0,k8=()=>`__${String(++T8)}__`;function O8(){let{router:e}=MO("useSubmit"),{basename:t}=b.useContext(bi),i=D6(),s=e.fetch,o=e.navigate;return b.useCallback(async(c,u={})=>{let{action:d,method:f,encType:g,formData:m,body:h}=r8(c,t);if(u.navigate===!1){let x=u.fetcherKey||k8();await s(x,i,u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:m,body:h,formMethod:u.method||f,formEncType:u.encType||g,flushSync:u.flushSync})}else await o(u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:m,body:h,formMethod:u.method||f,formEncType:u.encType||g,replace:u.replace,state:u.state,fromRouteId:i,flushSync:u.flushSync,viewTransition:u.viewTransition})},[s,o,t,i])}function A8(e,{relative:t}={}){let{basename:i}=b.useContext(bi),s=b.useContext(zi);_t(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),c={...gd(e||".",{relative:t})},u=Nr();if(e==null){c.search=u.search;let d=new URLSearchParams(c.search),f=d.getAll("index");if(f.some(m=>m==="")){d.delete("index"),f.filter(h=>h).forEach(h=>d.append("index",h));let m=d.toString();c.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(c.pathname=c.pathname==="/"?i:Ii([i,c.pathname])),Fr(c)}function M8(e,t){let{capture:i}={};b.useEffect(()=>{let s=i!=null?{capture:i}:void 0;return window.addEventListener("beforeunload",e,s),()=>{window.removeEventListener("beforeunload",e,s)}},[e,i])}function N8(e,{relative:t}={}){let i=b.useContext(Eb);_t(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=MO("useViewTransitionState"),o=gd(e,{relative:t});if(!i.isTransitioning)return!1;let c=ei(i.currentLocation.pathname,s)||i.currentLocation.pathname,u=ei(i.nextLocation.pathname,s)||i.nextLocation.pathname;return Fu(o.pathname,u)!=null||Fu(o.pathname,c)!=null}function D8(e){return b.createElement(K6,{flushSync:fr.flushSync,...e})}function Js({controlled:e,default:t,name:i,state:s="value"}){const{current:o}=b.useRef(e!==void 0),[c,u]=b.useState(()=>t),d=o&&e!==void 0?e:c,f=b.useCallback(g=>{o||u(g)},[]);return[d,f]}function j8(e){const{open:t,defaultOpen:i=!1,onOpenChange:s,disabled:o}=e,[c,u]=Js({controlled:t,default:i,name:"Collapsible",state:"open"}),{mounted:d,setMounted:f,transitionStatus:g}=_o(c,!0,!0),m=ar(),[h,x]=b.useState(),S=h===null?void 0:h??m,w=Be(C=>{const E=!c,R=ut(Qi,C.nativeEvent);s(E,R),!R.isCanceled&&u(E)});return b.useMemo(()=>({defaultPanelId:m,disabled:o,handleTrigger:w,mounted:d,open:c,panelId:S,setMounted:f,setOpen:u,setPanelIdState:x,transitionStatus:g}),[m,o,w,d,c,S,f,u,x,g])}const NO=b.createContext(void 0);function DO(){const e=b.useContext(NO);if(e===void 0)throw new Error(gn(15));return e}const I8="data-open",P8="data-closed",fh=Ov,L8="data-panel-open",z8={[I8]:""},_8={[P8]:""},U8={open(e){return e?{[L8]:""}:null}},H8={open(e){return e?z8:_8}},jO={...H8,...ws},F8=b.forwardRef(function(t,i){const{render:s,className:o,defaultOpen:c=!1,disabled:u=!1,onOpenChange:d,open:f,style:g,...m}=t,h=Be(d),x=j8({open:f,defaultOpen:c,onOpenChange:h,disabled:u}),S=b.useMemo(()=>({open:x.open,disabled:x.disabled,transitionStatus:x.transitionStatus}),[x.open,x.disabled,x.transitionStatus]),w=b.useMemo(()=>({...x,onOpenChange:h,state:S}),[x,h,S]),C=kt("div",t,{state:S,ref:i,props:m,stateAttributesMapping:jO});return v.jsx(NO.Provider,{value:w,children:C})}),B8={...U8,...ws},V8=b.forwardRef(function(t,i){const{panelId:s,open:o,handleTrigger:c,state:u,disabled:d}=DO(),{className:f,disabled:g=d,render:m,nativeButton:h=!0,style:x,...S}=t,{getButtonProps:w,buttonRef:C}=vi({disabled:g,native:h});return kt("button",t,{state:u,ref:[i,C],props:[{"aria-controls":o?s:void 0,"aria-expanded":o,onClick:c},S,w],stateAttributesMapping:B8})}),jl={height:void 0,width:void 0};function K8(e){const{externalRef:t,hiddenUntilFound:i,id:s,keepMounted:o,mounted:c,onOpenChange:u,open:d,setMounted:f,setOpen:g,transitionStatus:m}=e,h=b.useRef(null),x=b.useRef(null),[S,w]=b.useState(jl),C=b.useRef(jl),E=b.useRef(!1),R=b.useRef(d),k=b.useRef(!1),[O,A]=b.useState(!1),N=b.useRef(null),j=Wr(t,h),D=Ln(d),M=Dp(h),_=!d&&!c,L=O?"idle":m,q=d&&(R.current||k.current),X=!d&&c&&x.current==="css-animation"&&S.height===void 0&&S.width===void 0?C.current:S,B=i&&_&&x.current!=="css-animation",H=Be((K,Y=!0)=>{Y&&(C.current=K),w(K)}),U=Be(()=>{N.current?.(),N.current=null}),z=Be(K=>{U(),N.current=()=>{N.current=null,K()}}),Q=Be(()=>{d&&c&&x.current==="css-animation"&&(k.current=!0)});_e(()=>{!O||m==="starting"||A(!1)},[O,m]),b.useEffect(()=>()=>{Q(),U()},[Q,U]),_e(()=>{d||(R.current=!1,k.current=!1);const K=h.current;if(!K)return;!d&&N.current&&U();const Y=q8(K,q);if(x.current=Y,d&&m==="idle"&&R.current&&Y==="css-animation"){C.current=Il(K);return}if(d&&m==="starting"){const oe=E.current;if(E.current=!1,Y==="none"){H(Il(K)),A(!0);return}if(Y==="css-transition"){const W=Y8(K);if(H(Il(K)),!oe)return W;const re=hh(K,"transition-duration","0s");return z(re),A(!0),W}H(Il(K));const I=hh(K,"animation-name","none");if(!oe){I();return}const V=hh(K,"animation-duration","0s");I(),z(V),A(!0);return}if(!d&&c&&(m==="idle"||m==="starting")){if(Y==="none"){H(jl,!1),f(!1);return}H(Il(K));return}if(m!=="ending")return;if(Y==="none"){f(!1);return}const ee=Il(K);if(!(ee.height>0||ee.width>0)){f(!1);return}H(ee),Y==="css-animation"&&hh(K,"animation-name","none")()},[c,d,U,H,f,z,q,m]),Li({enabled:d&&c&&L==="idle",open:!0,ref:h,onComplete(){d&&H(jl,!1)}}),b.useEffect(()=>{if(d||!c||L!=="ending")return;if(!h.current){f(!1),H(jl,!1);return}const Y=new AbortController;let ee=-1;function G(){D.current||(f(!1),H(jl,!1))}return ee=Or.request(()=>{M(G,Y.signal)}),()=>{Or.cancel(ee),Y.abort()}},[D,c,d,L,M,H,f]),_e(()=>{const K=h.current;!K||!i||!_||K.setAttribute("hidden","until-found")},[_,i]),b.useEffect(function(){const Y=h.current;if(!Y)return;const ee=Pi.create();let G=-1;const oe=(W,re)=>{ee.start(0,()=>{D.current||(G=Or.request(()=>{D.current||(W&&(E.current=!1),re&&Y.setAttribute(fh,""),Y.setAttribute("hidden","until-found"))}))})},V=Lt(Y,"beforematch",W=>{const re=ut(Mr,W);if(u(!0,re),re.isCanceled){oe(!1,!1);return}E.current=!0;const Ee=Y.hasAttribute(fh);Y.removeAttribute(fh),g(!0),oe(!0,Ee)});return()=>{ee.clear(),Or.cancel(G),V()}},[D,u,g]);const $=o||i||c||d;return{height:X.height,props:{...B?{[fh]:""}:void 0,hidden:_,id:s},ref:j,shouldPreventOpenAnimation:q,shouldRender:$,transitionStatus:L,width:X.width}}function Il(e){return{height:e.scrollHeight,width:e.scrollWidth}}function q8(e,t){const i=Rn(e).getComputedStyle(e),s=(i.animationName.split(",").map(c=>c.trim()).some(c=>c!==""&&c!=="none")||t)&&pR(i.animationDuration),o=pR(i.transitionDuration);return s&&o||o?"css-transition":s?"css-animation":"none"}function pR(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function hh(e,t,i){const s=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);return e.style.setProperty(t,i),()=>{if(s===""){e.style.removeProperty(t);return}e.style.setProperty(t,s,o)}}function Y8(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(o=>{e.style.setProperty(o,"initial","important")});function i(){Object.entries(t).forEach(([o,c])=>{if(c===""){e.style.removeProperty(o);return}e.style.setProperty(o,c)})}const s=Or.request(i);return()=>{Or.cancel(s),i()}}const G8="--collapsible-panel-height",$8="--collapsible-panel-width",Q8=b.forwardRef(function(t,i){const{className:s,hiddenUntilFound:o,keepMounted:c,render:u,id:d,style:f,...g}=t,{defaultPanelId:m,mounted:h,onOpenChange:x,open:S,setMounted:w,setPanelIdState:C,setOpen:E,state:R,transitionStatus:k}=DO(),O=o??!1,A=c??!1,N=d||void 0,j=N??m;_e(()=>(C(Q=>N??(Q===null?void 0:Q)),()=>{C(Q=>Q===N?null:Q)}),[N,C]);const{height:D,props:M,ref:_,shouldPreventOpenAnimation:L,shouldRender:q,transitionStatus:X,width:B}=K8({externalRef:i,hiddenUntilFound:O,id:j,keepMounted:A,mounted:h,onOpenChange:x,open:S,setMounted:w,setOpen:E,transitionStatus:k}),H={...R,transitionStatus:X},U=gC(f,H),z=kt("div",{...t,style:void 0},{state:H,ref:_,props:[M,{style:{[G8]:D===void 0?"auto":`${D}px`,[$8]:B===void 0?"auto":`${B}px`}},g,U?{style:U}:void 0,L?{style:{animationName:"none"}}:void 0],stateAttributesMapping:jO});return q?z:null});function X8({...e}){return v.jsx(F8,{"data-slot":"collapsible",...e})}function Z8({...e}){return v.jsx(V8,{"data-slot":"collapsible-trigger",...e})}function J8({...e}){return v.jsx(Q8,{"data-slot":"collapsible-content",...e})}const IO=b.createContext(void 0);function W8(e){const t=b.useContext(IO);if(t===void 0)throw new Error(gn(33));return t}const lg=b.createContext(void 0);function na(e){const t=b.useContext(lg);if(t===void 0&&!e)throw new Error(gn(36));return t}const PO=b.createContext(void 0);function cg(e=!0){const t=b.useContext(PO);if(t===void 0&&!e)throw new Error(gn(25));return t}const LO=b.createContext(null);function ug(e="root"){const t=b.useContext(LO),i=b.useContext(lg);return t===null||i===void 0?null:(e==="submenu-trigger"?i.virtualFocus||i.parentVirtualFocus:i.virtualFocus)?t:null}const eU={visible:!0,ref:null};function tU(){return eU}function zO(e,t,i="root"){const s=ug(i),c=((i==="submenu-trigger"?s?.useSubmenuTrigger:s?.useItem)??tU)({label:e.label,children:e.children,render:e.render}),u=Wr(t,c.ref);return{visible:c.visible,ref:u,props:c.props}}function nU(e){e.preventDefault()}function rU(e){const{closeOnClick:t,highlighted:i,id:s,nodeId:o,store:c,typingRef:u,itemRef:d,itemMetadata:f}=e,g=na(),m=cg(!0),h=f.type==="submenu-trigger",x=h?g.parentVirtualFocus:g.virtualFocus,w=(h&&g.parent.type==="menu"?g.parent.store:g.store).useState("webkitAriaSelected",i),{events:C}=c.useState("floatingTreeRoot"),E=c.useState("open"),R=m!==void 0,k=!x&&E&&i?0:-1;return b.useMemo(()=>({id:s,role:"menuitem",tabIndex:k,"aria-selected":w,onMouseDown:x?nU:void 0,onKeyDown(O){O.key===" "&&u?.current&&O.preventDefault()},onMouseMove(O){o&&C.emit("itemhover",{nodeId:o,target:O.currentTarget})},onClick(O){t&&C.emit("close",{domEvent:O.nativeEvent,reason:Mo})},onMouseUp(O){if(m){const A=m.initialCursorPointRef.current;if(m.initialCursorPointRef.current=null,R&&A&&Math.abs(O.clientX-A.x)<=1&&Math.abs(O.clientY-A.y)<=1||R&&!Sv&&O.button===2)return}d.current&&c.context.allowMouseUpTriggerRef.current&&(!R||O.button===2)&&f.type==="regular-item"&&No(d.current,O,{detail:1,pointerType:"mouse"})}}),[t,k,s,C,o,c.context.allowMouseUpTriggerRef,u,d,m,R,f.type,w,x])}const _O={type:"regular-item"};function UO(e){const{closeOnClick:t,disabled:i,highlighted:s,id:o,store:c,typingRef:u=c.context.typingRef,nativeButton:d,itemMetadata:f,nodeId:g}=e,m=b.useRef(null),{getButtonProps:h,buttonRef:x}=vi({disabled:i,focusableWhenDisabled:!0,native:d,composite:!0}),S=rU({closeOnClick:t,highlighted:s,id:o,nodeId:g,store:c,typingRef:u,itemRef:m,itemMetadata:f}),w=b.useCallback(E=>Ar(S,{onMouseEnter(R){f.type==="submenu-trigger"&&f.setActive(R.nativeEvent)}},E,h),[S,h,f]),C=Wr(m,x);return b.useMemo(()=>({getItemProps:w,itemRef:C}),[w,C])}const HO=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function iU(){return b.useContext(HO)}function dg(e={}){const{guess:t,label:i,metadata:s,textRef:o,index:c}=e,{register:u,unregister:d,subscribeMapChange:f,nextIndexRef:g}=iU(),m=b.useRef(-1),[h,x]=b.useState(c==null&&t?()=>{if(m.current===-1){const E=g.current;g.current+=1,m.current=E}return m.current}:-1),S=c??h,w=b.useRef(null),C=b.useCallback(E=>{const R=w.current;R&&d(R),w.current=E,E&&u(E,{metadata:s??null,index:c??null,label:i,textRef:o})},[c,u,d,s,i,o]);return _e(()=>{if(c==null)return f(E=>{const R=w.current?E.get(w.current)?.index:null;R!=null&&x(R)})},[c,f]),{ref:C,index:S}}const sU="data-checked",aU="data-unchecked",FO={checked(e){return e?{[sU]:""}:{[aU]:""}},...ws},Nb=b.createContext(void 0);function oU(){const e=b.useContext(Nb);if(e===void 0)throw new Error(gn(31));return e}const lU=b.forwardRef(function(t,i){const{render:s,className:o,style:c,...u}=t,[d,f]=b.useState(void 0),g=kt("div",t,{ref:i,props:{role:"group","aria-labelledby":d,...u}});return v.jsx(Nb.Provider,{value:f,children:g})}),cU=b.forwardRef(function(t,i){const s=ug()?.Group??lU;return v.jsx(s,{...t,ref:i})}),uU=b.forwardRef(function(t,i){const{render:s,className:o,style:c,id:u,...d}=t,f=ar(u),g=oU();return _e(()=>(g(f),()=>{g(m=>m===f?void 0:m)}),[g,f]),kt("div",t,{ref:i,props:{id:f,"aria-hidden":!0,...d}})}),dU=b.forwardRef(function(t,i){const{render:s,className:o,id:c,label:u,nativeButton:d=!1,disabled:f=!1,closeOnClick:g=!0,style:m,...h}=t,{store:x}=na(),S=dg({guess:!0,label:u}),w=ar(c),C=x.useState("disabled"),E=x.useState("isActive",S.index),R=x.useState("floatingNodeId"),k=x.useState("itemProps"),O=f||C,{getItemProps:A,itemRef:N}=UO({closeOnClick:g,disabled:O,highlighted:E,id:w,store:x,nativeButton:d,nodeId:R,itemMetadata:_O});return kt("div",t,{state:{disabled:O,highlighted:E},props:[k,h,A],ref:[N,i,S.ref]})}),BO=b.forwardRef(function(t,i){const s=zO(t,i);return s.visible?v.jsx(dU,{...t,ref:s.ref}):null}),fU=b.createContext(void 0);function hU(){return b.useContext(fU)}function pU(e,t){const i=zv(e.render);if(b.isValidElement(i)){const s=i.props;if(Object.hasOwn(s,"id"))return s.id??""}return e.id??t}function gU(e,t,i){const s=pU(e,t),o=s===t?void 0:s,c=b.useCallback(u=>i?.(u?o:void 0),[o,i]);return[s,c]}function mU(e,t,i){const s=zv(e.render),o=b.isValidElement(s)?s.props:void 0,c=e["aria-label"]??o?.["aria-label"];let u=e["aria-labelledby"]??o?.["aria-labelledby"];return u==null&&!c&&(u=t?t.id||void 0:i||void 0),u}const yU=b.forwardRef(function(t,i){const{render:s,className:o,style:c,finalFocus:u,id:d,initialFocus:f,...g}=t,{store:m,defaultFloatingId:h,setRenderedFloatingId:x,virtualFocus:S,orientation:w}=na(),C=hU(),{side:E,align:R}=W8(),k=tg()!=null,O=m.useState("open"),A=m.useState("transitionStatus"),N=m.useState("popupProps"),j=m.useState("mounted"),D=m.useState("instantType"),M=m.useState("activeTriggerElement"),_=m.useState("parent"),L=m.useState("lastOpenChangeReason"),q=m.useState("rootId"),X=m.useState("floatingRootContext"),B=m.useState("floatingTreeRoot"),H=m.useState("closeDelay"),U=m.useState("hoverEnabled"),z=m.useState("disabled"),Q=m.useState("openMethod"),$=m.useState("activeTriggerId"),K=m.useState("listElement"),[Y,ee]=gU(t,h,x),G=mU(t,M,$),oe=_.type==="menu"?C:void 0,I=_.type==="context-menu";let V=f??_.type!=="menu";f===void 0&&K&&_.type!=="menu"&&(V=()=>m.state.activeIndex!==null?!1:K),Li({open:O,ref:m.context.popupRef,onComplete(){O&&m.context.onOpenChangeComplete?.(!0)}}),b.useEffect(()=>{function ve(Pe){m.setOpen(!1,ut(Pe.reason,Pe.domEvent))}return B.events.on("close",ve),()=>{B.events.off("close",ve)}},[B.events,m]),Yv(X,{enabled:U&&!z&&!I&&_.type!=="menubar",closeDelay:H});const W=m.useStateSetter("popupElement"),re=b.useContext(LO)?.useParentHandoff??bU,{parentVirtualFocusRef:Ee,handleFocus:le}=re(m,_,O,S),me={transitionStatus:A,side:E,align:R,open:O,nested:_.type==="menu",instant:D},ge=kt("div",t,{state:me,ref:[i,m.context.popupRef,W,ee],stateAttributesMapping:Ep,props:[N,{id:Y,...K?{role:"presentation"}:{role:"menu","aria-orientation":w==="horizontal"?"horizontal":void 0,"aria-labelledby":G},onKeyDown(ve){oe?.onPopupKeyDown?.(ve),k&&cd.has(ve.key)&&ve.stopPropagation()},onFocus:le},ad(A),g,{"data-rootownerid":q}]});let ue=_.type===void 0||I;(M||_.type==="menubar"&&L!==Rp)&&(ue=!0);const Te=oe?.getReturnElement??Ee;return v.jsx(Mp,{context:X,openInteractionType:Q,modal:I,disabled:!j,returnFocus:u??Te??ue,explicitReturnFocus:u===void 0&&Te?!1:void 0,initialFocus:V,restoreFocus:!0,getInsideElements:_.type===void 0?()=>[m.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:_.type!=="menubar"?B:void 0,previousFocusableElement:M,nextFocusableElement:_.type===void 0?m.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:m.context.beforeContentFocusGuardRef,children:ge})}),vU={parentVirtualFocusRef:void 0,handleFocus:void 0};function bU(){return vU}const VO=b.forwardRef(function(t,i){const s=ug()?.Popup??yU;return v.jsx(s,{...t,ref:i})}),KO=b.createContext(void 0);function xU(){const e=b.useContext(KO);if(e===void 0)throw new Error(gn(32));return e}const qO=b.forwardRef(function(t,i){const{keepMounted:s=!1,...o}=t,{store:c,parent:u}=na();if(!(c.useState("mounted")||s))return null;const g=u.type==="menu"||u.type==="menubar"?"group":void 0;return v.jsx(KO.Provider,{value:s,children:v.jsx(Ap,{ref:i,...o,portalOwnerRole:g})})});function Db(e){const{children:t,elementsRef:i,labelsRef:s,onMapChange:o}=e,c=Be(o),[,u]=b.useState(0),d=er(wU).current,f=er(SU).current,g=b.useRef(0),m=b.useRef(!0),h=b.useRef(null),x=b.useRef(null),S=Be(()=>{m.current||(m.current=!0,u(N=>N+1))}),w=Be((N,j)=>{f.set(N,j),S()}),C=Be(N=>{f.delete(N),S()}),E=Be(N=>{const j=new Map;return i.current.length=0,s&&(s.current.length=0),N.forEach(D=>{j.set(D.element,{...D.registration.metadata??{},index:D.index}),i.current[D.index]=D.element,s&&(s.current[D.index]=D.registration.label!==void 0?D.registration.label:D.registration.textRef?.current?.textContent??D.element.textContent)}),g.current=i.current.length,j});function R(N){if(x.current?.disconnect(),x.current=null,typeof MutationObserver!="function"||N.length<2)return;const j=new MutationObserver(M=>{if(!CU(M))return;let _=null;for(const L of N)if(L.isConnected){if(_&&YO(_,L)>0){j.disconnect(),S();return}_=L}});x.current=j;const D=new Set;for(let M=1;M<N.length;M+=1){const _=RU(N[M-1],N[M]);_&&D.add(_)}D.forEach(M=>j.observe(M,{childList:!0}))}const k=Be(()=>{const[N,j]=EU(f),D=E(N),M=h.current,_=!M||M.length!==N.length||N.some((L,q)=>{const X=M[q];return L.index!==X.index||L.element!==X.element||L.registration.index!==X.registration.index||L.registration.metadata!==X.registration.metadata});R(j),h.current=N,m.current=!1,_&&(d.forEach(L=>L(D)),c(D))});_e(()=>(!m.current&&h.current&&E(h.current),()=>{i.current=[],s&&(s.current=[])}),[i,s,E]),_e(()=>{m.current&&k()}),_e(()=>()=>{x.current?.disconnect(),m.current=!0},[]);const O=Be(N=>(d.add(N),()=>{d.delete(N)})),A=b.useMemo(()=>({register:w,unregister:C,subscribeMapChange:O,nextIndexRef:g}),[w,C,O,g]);return v.jsx(HO.Provider,{value:A,children:t})}function SU(){return new Map}function wU(){return new Set}function EU(e){const t=new Set,i=[],s=[];e.forEach((c,u)=>{if(!u.isConnected)return;const d=c.index,f={index:d??-1,element:u,registration:c};d===null?s.push(f):d>=0&&(t.add(d),i.push(f))});let o=0;return s.sort((c,u)=>YO(c.element,u.element)),s.forEach(c=>{for(;t.has(o);)o+=1;c.index=o,i.push(c),o+=1}),t.size>0&&i.sort((c,u)=>c.index-u.index),[i,s.map(c=>c.element)]}function RU(e,t){let i=e.parentElement;for(;i&&!i.contains(t);)i=i.parentElement;return i}function CU(e){for(const t of e)for(let i=0;i<t.removedNodes.length;i+=1)if(t.removedNodes[i].isConnected)return!0;return!1}function YO(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const GO=b.forwardRef(function(t,i){const{anchor:s,positionMethod:o="absolute",className:c,render:u,side:d,align:f,sideOffset:g=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:x=5,arrowPadding:S=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:E=EC,style:R,...k}=t,{store:O,virtualFocus:A,syncHighlightedItem:N}=na(),j=xU(),D=cg(!0),M=O.useState("parent"),_=O.useState("floatingRootContext"),L=O.useState("floatingTreeRoot"),q=O.useState("mounted"),X=O.useState("open"),B=O.useState("modal"),H=O.useState("openMethod"),U=O.useState("activeTriggerElement"),z=O.useState("transitionStatus"),Q=O.useState("positionerElement"),$=O.useState("instantType"),K=O.useState("adaptiveOrigin"),Y=O.useState("lastOpenChangeReason"),ee=O.useState("floatingNodeId"),G=O.useState("floatingParentNodeId"),oe=_.useState("domReferenceElement");let I=s,V=g,W=m,re=f,Ee=E;M.type==="context-menu"&&(I=s??M.context?.anchor,re=re??"start",!d&&re!=="center"&&(W=t.alignOffset??2,V=t.sideOffset??-5));let le=d,me=re;M.type==="menu"?(le=le??"inline-end",me=me??"start",Ee=t.collisionAvoidance??Uv):M.type==="menubar"&&(le=le??(M.context.orientation==="vertical"?"inline-end":"bottom"),me=me??"start");const ge=M.type==="context-menu",ue=Yp({anchor:I,floatingRootContext:_,positionMethod:D?"fixed":o,mounted:q,side:le,sideOffset:V,align:me,alignOffset:W,arrowPadding:ge?0:S,collisionBoundary:h,collisionPadding:x,sticky:w,nodeId:ee,keepMounted:j,disableAnchorTracking:C,collisionAvoidance:Ee,shift:ge?{crossAxis:!("side"in Ee&&Ee.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:L,adaptiveOrigin:K,lazyFlip:A?"placement":!1});b.useEffect(()=>{function Ue(be){be.open&&(be.parentNodeId===ee&&O.set("hoverEnabled",!1),be.nodeId!==ee&&be.parentNodeId===O.select("floatingParentNodeId")&&O.setOpen(!1,ut(vu)))}return L.events.on("menuopenchange",Ue),()=>{L.events.off("menuopenchange",Ue)}},[O,L.events,ee]),b.useEffect(()=>{if(O.select("floatingParentNodeId")==null)return;function Ue(be){if(be.open||be.nodeId!==O.select("floatingParentNodeId"))return;const He=be.reason??vu;O.setOpen(!1,ut(He))}return L.events.on("menuopenchange",Ue),()=>{L.events.off("menuopenchange",Ue)}},[L.events,O]);const Te=Un();b.useEffect(()=>{X||Te.clear()},[X,Te]),b.useEffect(()=>{function Ue(be){if(!(!X||be.nodeId!==O.select("floatingParentNodeId")))if(be.target&&U&&U!==be.target){const He=O.select("closeDelay");He>0?Te.isStarted()||Te.start(He,()=>{O.setOpen(!1,ut(vu))}):O.setOpen(!1,ut(vu))}else Te.clear()}return L.events.on("itemhover",Ue),()=>{L.events.off("itemhover",Ue)}},[L.events,X,U,O,Te]),b.useEffect(()=>{const Ue={open:X,nodeId:ee,parentNodeId:G,reason:O.select("lastOpenChangeReason")};L.events.emit("menuopenchange",Ue)},[L.events,X,O,ee,G]),kk({store:O,domReference:oe,positionerElement:Q,open:X});const ve={open:X,side:ue.side,align:ue.align,anchorHidden:ue.anchorHidden,nested:M.type==="menu",instant:$},Pe=M.type==="menubar"&&M.context.modal;lb(X&&(Pe||B&&Y!==Kn),H==="touch",Q,U);const Le=Gp(t,ve,{styles:ue.positionerStyles,transitionStatus:z,props:k,refs:[i,O.useStateSetter("positionerElement")],hidden:!q,inert:!X}),Ve=q&&M.type!=="menu"&&(M.type!=="menubar"&&B&&Y!==Kn||M.type==="menubar"&&M.context.modal);let ke=null;return M.type==="menubar"?ke=M.context.contentElement:M.type===void 0&&(ke=U),v.jsxs(IO.Provider,{value:ue,children:[Ve&&v.jsx(Wp,{ref:M.type==="context-menu"||M.type==="nested-context-menu"?M.context.internalBackdropRef:null,inert:$p(!X),cutout:ke}),v.jsx(MC,{id:ee,children:v.jsx(Db,{elementsRef:O.context.itemDomElements,labelsRef:O.context.itemLabels,onMapChange:N,children:Le})})]})}),$O=b.createContext(void 0);function TU(){const e=b.useContext($O);if(e===void 0)throw new Error(gn(34));return e}const kU=b.forwardRef(function(t,i){const{render:s,className:o,value:c,defaultValue:u,onValueChange:d,disabled:f=!1,style:g,"aria-labelledby":m,...h}=t,[x,S]=b.useState(void 0),[w,C]=Js({controlled:c,default:u,name:"MenuRadioGroup"}),E=Be((A,N)=>{d?.(A,N),!N.isCanceled&&C(A)}),k=kt("div",t,{state:{disabled:f},ref:i,props:{role:"group","aria-labelledby":m??x,"aria-disabled":f||void 0,...h}}),O=b.useMemo(()=>({value:w,setValue:E,disabled:f}),[w,E,f]);return v.jsx(Nb.Provider,{value:S,children:v.jsx($O.Provider,{value:O,children:k})})}),OU=b.memo(b.forwardRef(function(t,i){const s=ug()?.RadioGroup??kU;return v.jsx(s,{...t,ref:i})})),QO=b.createContext(void 0);function AU(){const e=b.useContext(QO);if(e===void 0)throw new Error(gn(35));return e}const MU=b.forwardRef(function(t,i){const{render:s,className:o,id:c,label:u,nativeButton:d=!1,disabled:f=!1,closeOnClick:g=!1,value:m,style:h,...x}=t,{store:S}=na(),{value:w,setValue:C,disabled:E}=TU(),R=dg({guess:!0,label:u}),k=ar(c),O=S.useState("isActive",R.index),A=S.useState("floatingNodeId"),N=S.useState("itemProps"),j=S.useState("disabled"),D=f||E||j,M=w===m,{getItemProps:_,itemRef:L}=UO({closeOnClick:g,disabled:D,highlighted:O,id:k,store:S,nativeButton:d,nodeId:A,itemMetadata:_O}),q=b.useMemo(()=>({disabled:D,highlighted:O,checked:M}),[D,O,M]);function X(H){const U=ut(Mo,H.nativeEvent,void 0,{preventUnmountOnClose:En});C(m,U)}const B=kt("div",t,{state:q,stateAttributesMapping:FO,props:[N,{role:"menuitemradio","aria-checked":M,onClick:X},x,_],ref:[L,i,R.ref]});return v.jsx(QO.Provider,{value:q,children:B})}),NU=b.forwardRef(function(t,i){const s=zO(t,i);return s.visible?v.jsx(MU,{...t,ref:s.ref}):null}),DU=b.forwardRef(function(t,i){const{render:s,className:o,style:c,keepMounted:u=!1,...d}=t,f=AU(),g=b.useRef(null),{transitionStatus:m,mounted:h,setMounted:x}=_o(f.checked);Li({batch:!0,enabled:!f.checked,open:f.checked,ref:g,onComplete(){f.checked||x(!1)}});const S={checked:f.checked,disabled:f.disabled,highlighted:f.highlighted,transitionStatus:m};return kt("span",t,{state:S,stateAttributesMapping:FO,ref:[i,g],props:{"aria-hidden":!0,...d},enabled:u||h})}),jU=b.createContext(null);function XO(e){return b.useContext(jU)}function IU(e){return e==null?Mr:e.type.startsWith("key")?ZR:e.type.startsWith("mouse")||e.type.startsWith("pointer")?tj:Mr}const PU={...Ys,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,t)=>{const i=Ys.triggerPopupId(e,t);return i?e.listElement?.id||i:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Ss&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType==="trigger-change"&&!Ys.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 LU extends oc{constructor(t,i,s=!1){const o=new sd,c=_U(o,i,s,t);super(c,zU(o),PU),this.observe("parent",u=>{u.type==="menu"?this.context.allowMouseUpTriggerRef=u.store.context.allowMouseUpTriggerRef:u.type!==void 0&&(this.context.allowMouseUpTriggerRef=u.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){const t=this.state.parent;if(t.type!=="menu")return;let i=t.store.select("rootId"),s=t.store.select("floatingTreeRoot"),o=t.store.select("keyboardEventRelay");return t.store.subscribe(()=>{const c=t.store.select("rootId"),u=t.store.select("floatingTreeRoot"),d=t.store.select("keyboardEventRelay");i===c&&s===u&&o===d||(i=c,s=u,o=d,this.notifyAll())})}setOpen(t,i){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:i})}setActiveIndex(t,i,s){if(this.state.activeIndex!==t){const c=(t===null?void 0:this.context.itemDomElements.current[t])===this.context.reportedItem;this.context.highlightReason=c?"none":i,this.context.highlightEvent=c?void 0:s}this.set("activeIndex",t)}highlightItem(t,i,s){const o=this.context.itemDomElements.current.indexOf(t);o>-1&&this.setActiveIndex(o,i,s)}}function zU(e){return{positionerRef:b.createRef(),popupRef:b.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:b.createRef(),beforeTriggerFocusGuardRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function _U(e,t,i=!1,s){return{...Fp(e,t,i),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Xt,inputProps:Xt,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Hv,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Xt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...s}}const gR=b.createContext(null);function ZO(e,t){return(e===Qi||e===Mo)&&t?.detail===0}function UU(e,t){return e===Uh||ZO(e,t)}const HU=Qu(function(t){const{children:i,open:s,onOpenChange:o,onOpenChangeComplete:c,onItemHighlighted:u,defaultOpen:d=!1,disabled:f=!1,modal:g,loopFocus:m=!0,orientation:h="vertical",actionsRef:x,closeParentOnEsc:S=!1,handle:w,triggerId:C,defaultTriggerId:E=null,highlightItemOnHover:R=!0,isSubmenu:k=!1,virtualFocus:O=!1,virtualFocusRef:A,allowEscape:N=!0,resetOnPointerLeave:j=!0}=t,D=cg(!0),M=na(!0),_=XO(!0),L=M?.store,q=M?.virtualFocus??!1,X=b.useMemo(()=>k&&L?{type:"menu",store:L}:_?{type:"menubar",context:_}:D&&!L?{type:"context-menu",context:D}:{type:void 0},[D,L,_,k]),B=ar(),H=ar(),[U,z]=b.useState(void 0),Q=(U??H)||void 0,$=Ya(),K=X.type==="menu"?X.store:void 0,Y=(s??d)&&K?.state.transitionStatus==="starting",ee=er(()=>Y?K?.state.instantType:void 0).current,G=er(()=>{const Ie=new LU({open:d,openProp:s,activeTriggerId:E,triggerIdProp:C,parent:X,disabled:f,highlightItemOnHover:R,modal:X.type===void 0?g:void 0,rootId:B,instantType:ee},Q,$!=null);return Ie.context.virtualFocusRef=A,Ie}).current;G.useControlledProp("openProp",s),G.useControlledProp("triggerIdProp",C),G.useContextCallback("onOpenChangeComplete",c);const oe=G.useState("floatingTreeRoot"),I=Fv(oe),V=G.useState("open"),W=G.useState("activeTriggerElement"),re=G.useState("positionerElement"),Ee=G.useState("hoverEnabled"),le=G.useState("disabled"),me=G.useState("lastOpenChangeReason"),ge=G.useState("parent"),ue=G.useState("activeIndex"),Te=G.useState("keyboardOpen"),ve=G.useState("payload"),Pe=G.useState("floatingParentNodeId"),Oe=b.useRef(null),Le=b.useRef(ge.type!=="context-menu"),Ve=Un(),ke=b.useRef(!0),Ue=Un(),be=Pe!=null,{openMethod:He,triggerProps:Ze}=Rk(V);G.useSyncedValues({disabled:f,highlightItemOnHover:R,modal:ge.type===void 0?g:void 0,openMethod:He,rootId:B}),zp(G);const{forceUnmount:ot,transitionStatus:de}=_p(V,G,()=>{G.set("allowMouseEnter",!1)},Y),we=Dp(G.context.popupRef);b.useEffect(()=>{if(ee===void 0)return;const Ie=()=>{G.state.instantType===ee&&G.set("instantType",void 0)};if(!V){Ie();return}if(de!==void 0)return;if(G.context.popupRef.current==null){Ie();return}const ze=new AbortController;return we(Ie,ze.signal),()=>{ze.abort()}},[ee,V,de,we,G]),_e(()=>{D&&!M?G.update({parent:{type:"context-menu",context:D},floatingNodeId:I,floatingParentNodeId:$}):(M||!G.select("activeTriggerElement"))&&G.update({floatingNodeId:I,floatingParentNodeId:$})},[D,M,I,$,W,G]),b.useEffect(()=>{if(V||(Oe.current=null),ge.type==="context-menu"){if(!V){Ve.clear(),Le.current=!1;return}Ve.start(500,()=>{Le.current=!0})}},[Ve,V,ge.type]),_e(()=>{!V&&!Ee&&G.set("hoverEnabled",!0)},[V,Ee,G]);const Ge=Be((Ie,ze)=>{const $e=ze.reason;if(!Ie&&!G.select("open")||V===Ie&&ze.trigger===W&&me===$e)return;const et=Pp(ze);if(!Ie&&ze.trigger==null&&(ze.trigger=W??void 0),o?.(Ie,ze),ze.isCanceled)return;G.state.floatingRootContext.dispatchOpenChange(Ie,ze);const Tt=ze.event;if(Ie===!1&&$e!==Mo&&Tt?.type==="click"&&Tt.pointerType==="touch"&&!ke.current)return;Ie&&$e===Fl?(ke.current=!1,Ue.start(300,()=>{ke.current=!0})):(ke.current=!0,Ue.clear());const F=!Ie&&($e===ed||$e==null);Oe.current=ze.event;const J=Ip(G.state,Ie,ze.trigger,et());J.openChangeReason=$e,J.keyboardOpen=Ie&&UU($e,Tt),ge.type==="menubar"&&($e===Fl||$e===Ha||$e===Kn||$e===Uh||$e===vu)?J.instantType="group":ZO($e,Tt)?J.instantType="click":F?J.instantType="dismiss":J.instantType=void 0,G.update(J)}),Me=DC({popupStore:G,floatingRootContext:G.state.floatingRootContext,floatingId:Q,nested:$!=null,onOpenChange:Ge}),De=Me.context.events;_e(()=>{const Ie=({open:ze,eventDetails:$e})=>Ge(ze,$e);return De.on("setOpen",Ie),()=>{De?.off("setOpen",Ie)}},[De,Ge]),_e(()=>G.subscribeToParentMenu(),[G]);const bt=b.useCallback(()=>{G.setOpen(!1,ut(td))},[G]);b.useImperativeHandle(x,()=>({unmount:ot,close:bt}),[ot,bt]);let dt;ge.type==="context-menu"&&(dt=ge.context),b.useImperativeHandle(dt?.positionerRef,()=>re,[re]),b.useImperativeHandle(dt?.actionsRef,()=>({setOpen:Ge}),[Ge]);const pt=rd(Me,{enabled:!le,bubbles:{escapeKey:S&&ge.type==="menu"},outsidePress(){return ge.type!=="context-menu"||Oe.current?.type==="contextmenu"?!0:Le.current},externalTree:be?oe:void 0}),Nt=qp(),jt=BC(Me,{enabled:!le,listRef:G.context.itemDomElements,activeIndex:ue,virtual:O,nested:ge.type==="menubar"||!O&&ge.type!==void 0,parentOrientation:ge.type==="menubar"?ge.context.orientation:void 0,loopFocus:m,focusItemOnOpen:O?Te:void 0,allowEscape:O&&m&&N,orientation:h,triggerOrientation:O?"vertical":h,rtl:Nt==="rtl",disabledIndices:$i,onNavigate(Ie,ze){G.setActiveIndex(Ie,IU(ze),ze?.nativeEvent)},openOnArrowKeyDown:ge.type!=="context-menu"&&!(O&&k),externalTree:!O&&be?oe:void 0,nestedReturnFocusRef:K?.context.virtualFocusRef,focusItemOnHover:R,resetOnPointerLeave:j}),tn=b.useCallback(Ie=>{G.context.typingRef.current=Ie},[G]),an=VC(Me,{enabled:!le&&!O,listRef:G.context.itemLabels,elementsRef:G.context.itemDomElements,activeIndex:ue,resetMs:Yj,onMatch:(Ie,ze)=>{V&&Ie!==ue&&G.setActiveIndex(Ie,ZR,ze.nativeEvent)},onTyping:tn}),nn=Be(u),We=b.useRef(-1),wt=Be(()=>{const Ie=G.state.activeIndex,ze=Ie===null?void 0:G.context.itemDomElements.current[Ie]??void 0;if(ze?.isConnected===!1)return;const $e=ze===void 0?-1:Ie;if(We.current===$e&&G.context.reportedItem===ze)return;We.current=$e,G.context.reportedItem=ze,O&&G.set("highlightedItem",ze);const{highlightReason:et,highlightEvent:Tt}=G.context;G.context.highlightReason=Mr,G.context.highlightEvent=void 0,u&&nn(ze,ej(et,Tt,{label:ze===void 0?void 0:G.context.itemLabels.current[$e]??void 0}))});_e(()=>{wt()},[ue,wt]);const Zt=b.useMemo(()=>{if(!O)return jt.reference;if(!jt.trigger)return Xt;const{onFocus:Ie,...ze}=jt.trigger;return ze},[O,jt.reference,jt.trigger]);G.useSyncedValue("inputProps",O?jt.reference??Xt:Xt);const ht=b.useMemo(()=>{const Ie=Ar(an.reference,Zt,pt.reference,{onMouseMove(){G.set("allowMouseEnter",!0)}},Ze);return Ie["aria-haspopup"]="menu",Ie["aria-expanded"]=V,Ie},[G,an.reference,Zt,pt.reference,Ze,V]),xt=b.useMemo(()=>{const Ie=Ar(jt.trigger,pt.trigger,Ze);return Ie["aria-haspopup"]="menu",Ie["aria-expanded"]=!1,Ie},[jt.trigger,pt.trigger,Ze]);er(()=>(G.update({inactiveTriggerProps:xt}),null));const yt=b.useMemo(()=>Ar(id,{onMouseMove(){G.set("allowMouseEnter",!0),ge.type==="menu"&&G.set("hoverEnabled",!1)},onClick(){G.select("hoverEnabled")&&G.set("hoverEnabled",!1)},onKeyDown(Ie){const ze=G.select("keyboardEventRelay");ze&&!Ie.isPropagationStopped()&&ze(Ie)}},an.floating,jt.floating,pt.floating),[ge.type,G,an.floating,jt.floating,pt.floating]),Ut=jt.item??Xt;Up(G,{floatingRootContext:Me,activeTriggerProps:ht,inactiveTriggerProps:xt,popupProps:yt,itemProps:Ut});const un=b.useMemo(()=>({store:G,parent:X,orientation:h,loopFocus:m,allowEscape:N,defaultFloatingId:H,setRenderedFloatingId:z,virtualFocus:O,parentVirtualFocus:q,syncHighlightedItem:wt}),[G,X,h,m,N,H,O,q,wt]),je=typeof i=="function"?i({payload:ve}):i;let st=v.jsxs(lg.Provider,{value:un,children:[w&&v.jsx(jp,{handle:w,store:G}),je]});return(ge.type===void 0||ge.type==="context-menu")&&(st=v.jsx(NC,{externalTree:oe,children:st})),st});function JO(e){const t=b.useContext(gR);if(t===null)return v.jsx(HU,{...e});const i=t.Root;return v.jsx(gR.Provider,{value:null,children:v.jsx(i,{...t.options,...e})})}const ph=5;function WO(e,t){const i=FU(t);return e.clientX>=i.left-ph&&e.clientX<=i.right+ph&&e.clientY>=i.top-ph&&e.clientY<=i.bottom+ph}function FU(e){const t=e.getBoundingClientRect(),i=Rn(e);if(wv)return t;const s=i.getComputedStyle(e,"::before"),o=i.getComputedStyle(e,"::after");if(!(s.content!=="none"||o.content!=="none"))return t;const u=parseFloat(s.width)||0,d=parseFloat(s.height)||0,f=parseFloat(o.width)||0,g=parseFloat(o.height)||0,m=Math.max(t.width,u,f),h=Math.max(t.height,d,g),x=m-t.width,S=h-t.height;return{left:t.left-x/2,right:t.right+x/2,top:t.top-S/2,bottom:t.bottom+S/2}}function BU(e={}){const{highlightItemOnHover:t,highlightedIndex:i,onHighlightedIndexChange:s}=ab(),{ref:o,index:c}=dg(e),u=i===c,d=b.useRef(null),f=Wr(o,d);return{compositeProps:{tabIndex:u?0:-1,onFocus(){s(c)},onMouseMove(){const m=d.current;if(!t||!m)return;const h=m.hasAttribute("disabled")||m.ariaDisabled==="true";!u&&!h&&m.focus()}},compositeRef:f,index:c}}function jb(e){const{render:t,className:i,style:s,state:o=Xt,props:c=$i,refs:u=$i,metadata:d,stateAttributesMapping:f,tag:g="div",...m}=e,{compositeProps:h,compositeRef:x}=BU({metadata:d});return kt(g,e,{state:o,ref:[x,...u],props:[h,...c,m],stateAttributesMapping:f})}function Ib(e){if(bn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!$s(e))return Ib(Zs(e))}function VU(e){const{enabled:t=!0,mouseDownAction:i,open:s}=e,o=b.useRef(!1);return b.useMemo(()=>t?{onMouseDown:c=>{(i==="open"&&!s||i==="close"&&s)&&(o.current=!0,$t(c.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:c=>{o.current&&(o.current=!1,c.preventBaseUIHandler())}}:Xt,[t,i,s])}const KU=pp(function(t,i){const{render:s,className:o,style:c,disabled:u=!1,nativeButton:d=!0,id:f,openOnHover:g,delay:m=100,closeDelay:h=0,handle:x,payload:S,...w}=t,C=na(!0),R=Bp(x)??C?.store;if(!R)throw new Error(gn(85));const k=ar(f),O=R.useState("isTriggerActive",k),A=R.useState("floatingRootContext"),N=R.useState("isOpenedByTrigger",k),j=R.useState("triggerControlsId",k),D=b.useRef(null),M=YU(),_=ab(!0),L=Ga(),q=b.useMemo(()=>L??new Hv,[L]),X=Fv(q),B=Ya(),{registerTrigger:H,isMountedByThisTrigger:U}=Lp(k,D,R,{payload:S,closeDelay:h,parent:M,floatingTreeRoot:q,floatingNodeId:X,floatingParentNodeId:B,keyboardEventRelay:_?.relayKeyboardEvent}),z=M.type==="menubar",Q=R.useState("disabled"),$=u||Q||z&&M.context.disabled,{getButtonProps:K,buttonRef:Y}=vi({disabled:$,native:d});b.useEffect(()=>{!N&&M.type===void 0&&(R.context.allowMouseUpTriggerRef.current=!1)},[R,N,M.type]);const ee=b.useRef(null),G=Un(),oe=Be(Ue=>{if(!ee.current)return;G.clear(),R.context.allowMouseUpTriggerRef.current=!1;const be=Ue.target;it(ee.current,be)||it(R.select("positionerElement"),be)||be===ee.current||be!=null&&Ib(be)===R.select("rootId")||WO(Ue,ee.current)||q.events.emit("close",{domEvent:Ue,reason:Av})});b.useEffect(()=>{const Ue=$t(ee.current);if(N&&R.select("lastOpenChangeReason")===Kn)return Ue.addEventListener("mouseup",oe,{once:!0}),()=>{Ue.removeEventListener("mouseup",oe)}},[N,oe,R]);const I=z&&M.context.hasSubmenuOpen,W=Gv(A,{enabled:(g??I)&&!$&&(!z||I&&!U),handleClose:$v({blockPointerEvents:!z}),mouseOnly:!0,move:!1,restMs:M.type===void 0?m:void 0,delay:{close:h},triggerElementRef:D,externalTree:q,isActiveTrigger:O,isClosing:()=>R.select("transitionStatus")==="ending"}),re=qU(N,R.select("lastOpenChangeReason")),Ee=Np(A,{enabled:!$,event:N&&z?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:M.type===void 0?re:!1}),le=HC(A,{enabled:!$&&I}),me=VU({open:N,enabled:z,mouseDownAction:"open"}),ge=b.useMemo(()=>Ar(le.reference,Ee.reference),[le.reference,Ee.reference]),ue=R.useState("triggerProps",U),Te=R.useState("filterTriggerProps"),{handlePreFocusGuardFocus:ve,handleFocusTargetFocus:Pe}=Ek(R,D),Oe={disabled:$,open:N},Le=[ee,i,Y,H,D],Ve=[ge,W??Xt,ue,{"aria-haspopup":"menu","aria-controls":j,id:k,onMouseDown:Ue=>{if(R.select("open"))return;G.start(200,()=>{R.context.allowMouseUpTriggerRef.current=!0}),$t(Ue.currentTarget).addEventListener("mouseup",oe,{once:!0})}},Te,z?{role:"menuitem"}:{},me,w,K],ke=kt("button",t,{enabled:!z,stateAttributesMapping:zu,state:Oe,ref:Le,props:Ve});return z?v.jsx(jb,{tag:"button",render:s,className:o,style:c,state:Oe,refs:Le,props:Ve,stateAttributesMapping:zu}):N?v.jsxs(b.Fragment,{children:[v.jsx(Fa,{ref:R.context.beforeTriggerFocusGuardRef,onFocus:ve},`${k}-pre-focus-guard`),v.jsx(b.Fragment,{children:ke},k),v.jsx(Fa,{ref:R.context.triggerFocusTargetRef,onFocus:Pe},`${k}-post-focus-guard`)]}):v.jsx(b.Fragment,{children:ke},k)});function qU(e,t){const i=Un(),[s,o]=b.useState(!1);return _e(()=>{e&&t===Kn?(o(!0),i.start(wC,()=>{o(!1)})):e||(i.clear(),o(!1))},[e,t,i]),s}function YU(){const e=XO();return b.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}const GU=b.forwardRef(function(t,i){const{className:s,render:o,orientation:c="horizontal",style:u,...d}=t;return kt("div",t,{state:{orientation:c},ref:i,props:[{role:"separator","aria-orientation":c},d]})});function eA(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function np(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function $U(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}function tA(e){return $U(e?.[0])}function QU(e){return tA(e)?e.flatMap(t=>t.items):e}function XU(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(tA(t)){for(const i of t)for(const s of i.items)if(s&&s.value==null&&s.label!=null)return!0;return!1}for(const i of t)if(i&&i.value==null&&i.label!=null)return!0;return!1}function nA(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return np(e)}function Ul(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?np(e.value):np(e)}function rA(e,t,i){function s(){return nA(e,i)}if(i&&e!=null)return i(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??s();if(Array.isArray(t)){const c=QU(t);if(e==null||typeof e!="object"){const u=c.find(d=>d.value===e);return u&&u.label!=null?u.label:s()}if("value"in e){const u=c.find(d=>d&&d.value===e.value);if(u&&u.label!=null)return u.label}}return s()}function ZU(e,t,i){return e.reduce((s,o,c)=>(c>0&&s.push(", "),s.push(v.jsx(b.Fragment,{children:rA(o,t,i)},c)),s),[])}function Vo({...e}){return v.jsx(JO,{"data-slot":"dropdown-menu",...e})}function Ko({...e}){return v.jsx(KU,{"data-slot":"dropdown-menu-trigger",...e})}function qo({align:e="start",alignOffset:t=0,side:i="bottom",sideOffset:s=4,className:o,...c}){return v.jsx(qO,{children:v.jsx(GO,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:i,sideOffset:s,children:v.jsx(VO,{"data-slot":"dropdown-menu-content",className:Fe("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",o),...c})})})}function iA({...e}){return v.jsx(cU,{"data-slot":"dropdown-menu-group",...e})}function sA({className:e,inset:t,...i}){return v.jsx(uU,{"data-slot":"dropdown-menu-label","data-inset":t,className:Fe("px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5",e),...i})}function fc({className:e,inset:t,variant:i="default",...s}){return v.jsx(BO,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":i,className:Fe("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),...s})}function JU({...e}){return v.jsx(OU,{"data-slot":"dropdown-menu-radio-group",...e})}function WU({className:e,children:t,inset:i,...s}){return v.jsxs(NU,{"data-slot":"dropdown-menu-radio-item","data-inset":i,className:Fe("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),...s,children:[v.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:v.jsx(DU,{children:v.jsx(od,{})})}),t]})}function Pb(e){return kt(e.defaultTagName??"div",e,e)}const eH="data-valid",tH="data-invalid",nH={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},rH={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},iH={disabled:!1,...rH},hc={valid(e){return e===null?null:e?{[eH]:""}:{[tH]:""}}},sH={invalid:void 0,name:void 0,validityData:{state:nH,errors:[],error:"",value:"",initialValue:null},setValidityData:En,disabled:void 0,setTouched:En,setDirty:En,setFilled:En,setFocused:En,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:iH,registerFieldControl:En,validation:{getValidationProps:(e,t=Xt)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:En,getInputControl:()=>null,commit:async()=>{},change:En}},aH=b.createContext(sH);function ra(e=!0){const t=b.useContext(aH);if(t.setValidityData===En&&!e)throw new Error(gn(28));return t}const oH=b.createContext(void 0);function lH(e=!1){const t=b.useContext(oH);if(!t&&!e)throw new Error(gn(86));return t}const cH=b.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:En,validationMode:"onSubmit",submitCountRef:{current:0}});function yd(){return b.useContext(cH)}const uH=b.createContext({controlId:void 0,registerControlId:En,resetControlId:En,labelId:void 0,setLabelId:En,messageIds:[],setMessageIds:En,getDescriptionProps:e=>e});function Yo(){return b.useContext(uH)}function Lb(e,t,i,s=!0,o,c){const[u,d]=b.useState(),f=ar(o?`${o}-label`:void 0),g=!!c?.trim(),h=e??(g?void 0:t)??u;return _e(()=>{const x=e||t||g||!s?void 0:dH(i.current,f);u!==x&&d(x)}),h}function dH(e,t){const i=fH(e);if(i)return!i.id&&t&&(i.id=t),i.id||void 0}function fH(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const i=e.id;if(i){const o=e.nextElementSibling;if(o&&o.htmlFor===i)return o}const s=e.labels;return s&&s[0]}function pc(e={}){const{id:t,enabled:i=!0}=e,{controlId:s,registerControlId:o,resetControlId:c}=Yo(),u=ar(),d=er(()=>Symbol()),f=b.useRef(!1),g=b.useRef(!1),m=Be(()=>{!f.current||o===En||(f.current=!1,o(d.current,void 0))});return _e(()=>{if(!i||o===En){m();return}let h;if(t!==void 0)g.current=!0,h=t;else if(g.current)h=u;else{c();return}if(h===void 0){m();return}f.current=!0,o(d.current,h)},[t,i,o,c,u,d,m]),_e(()=>m,[m]),(i?s:void 0)??t??u}function hH(e,t){return e.matches(":disabled")?!1:!t||e.form===t?!0:e.form===null&&!e.hasAttribute("form")}const pH=b.createContext({disabled:!1});function aA(){return b.useContext(pH)}function vd(e,t,i){const{setFocused:s,focusOwnerRef:o}=ra(),c=Be(u=>{(u?!e:o.current===c)&&(o.current=u&&c,s(u))});return _e(()=>{const u=t.current;return u?.getRootNode()?.activeElement===u&&c(!0),()=>c(!1)},[e,t,c]),c}function bd(e,t,i,s,o=!0,c){const{registerFieldControl:u}=ra(),d=er(()=>Symbol());_e(()=>{const f=d.current;if(!o){u(f,void 0);return}u(f,{controlRef:e,getValue:s,id:t,name:c,value:i})},[e,o,s,t,c,u,d,i]),_e(()=>{const f=d.current;return()=>{u(f,void 0)}},[u,d])}const gH=b.forwardRef(function(t,i){const{render:s,className:o,id:c,name:u,value:d,disabled:f=!1,onValueChange:g,defaultValue:m,autoFocus:h=!1,style:x,...S}=t,{state:w,name:C,disabled:E,setTouched:R,setDirty:k,validityData:O,setFilled:A,validationMode:N,validation:j}=ra(),{clearErrors:D,elementRef:M,submitCountRef:_}=yd(),L=E||f,q=C??u,X={...w,disabled:L},{labelId:B}=Yo(),H=pc({id:c}),U=d!==void 0,z=d==null?void 0:String(d),Q=Be(()=>j.inputRef.current?.value);bd(j.inputRef,H,z,Q,!L,u),_e(()=>{const G=z??j.inputRef.current?.value;G!==void 0&&A(G!=="")},[z,m,j.inputRef,A]),cc(z,()=>{z!==void 0&&(D(q),k(z!==(O.initialValue??"")),j.change(z))});const $=b.useRef(null),K=vd(L,$),Y=Un();return kt("input",t,{ref:[i,$],state:X,props:[{id:H,disabled:L,name:q,ref:j.inputRef,"aria-labelledby":B,autoFocus:h,...U?{value:d}:{defaultValue:m},onChange(G){const oe=G.currentTarget.value,I=ut(Mr,G.nativeEvent);g?.(oe,I),!U&&(k(oe!==(O.initialValue??"")),A(oe!==""),!G.nativeEvent.defaultPrevented&&!I.isCanceled&&(D(q),j.change(oe)))},onFocus(){K(!0)},onBlur(G){if(R(!0),K(!1),N==="onBlur"){const oe=G.currentTarget.value;j.commit(oe),U&&queueMicrotask(()=>{const I=j.inputRef.current?.value;I!==void 0&&I!==oe&&I!==(O.initialValue??"")&&j.commit(I)})}},onKeyDown(G){if(G.currentTarget.tagName==="INPUT"&&G.key==="Enter"){R(!0);const oe=G.currentTarget.value,I=G.currentTarget.form;if(I&&I===M.current&&!G.defaultPrevented){const V=G.currentTarget,W=_.current;Y.start(0,()=>{_.current===W&&j.commit(V.value)})}else j.commit(oe)}}},S,G=>j.getValidationProps(L,G)],stateAttributesMapping:hc})}),mH=b.forwardRef(function(t,i){return v.jsx(gH,{ref:i,...t})});function xd({className:e,type:t,...i}){return v.jsx(mH,{type:t,"data-slot":"input",className:Fe("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),...i})}function oA({className:e,orientation:t="horizontal",...i}){return v.jsx(GU,{"data-slot":"separator",orientation:t,className:Fe("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...i})}const lA=b.createContext(void 0);function Qa(e){const t=b.useContext(lA);if(!e&&t===void 0)throw new Error(gn(27));return t}const cA=b.forwardRef(function(t,i){const{render:s,className:o,style:c,forceRender:u=!1,...d}=t,f=Qa(),g=f.useState("open"),m=f.useState("nested"),h=f.useState("mounted"),x=f.useState("transitionStatus");return kt("div",t,{state:{open:g,transitionStatus:x},ref:[f.context.backdropRef,i],stateAttributesMapping:Ep,props:[{role:"presentation",hidden:!h,style:{userSelect:"none",WebkitUserSelect:"none"}},d],enabled:u||!m})}),fg=b.forwardRef(function(t,i){const{render:s,className:o,style:c,disabled:u=!1,nativeButton:d=!0,...f}=t,g=Qa(),m=g.useState("open"),{getButtonProps:h,buttonRef:x}=vi({disabled:u,native:d}),S={disabled:u};function w(C){m&&g.setOpen(!1,ut(XR,C.nativeEvent))}return kt("button",t,{state:S,ref:[i,x],props:[{onClick:w},f,h]})}),uA=b.forwardRef(function(t,i){const{render:s,className:o,style:c,id:u,...d}=t,f=Qa(),g=ar(u);return f.useSyncedValueWithCleanup("descriptionElementId",g),kt("p",t,{ref:i,props:[{id:g},d]})}),dA=b.createContext(void 0);function yH(){const e=b.useContext(dA);if(e===void 0)throw new Error(gn(26));return e}const vH="--nested-dialogs",bH="data-nested-dialog-open",xH={...Ju,...ws,nestedDialogOpen(e){return e?{[bH]:""}:null}},fA=b.forwardRef(function(t,i){const{render:s,className:o,style:c,finalFocus:u,initialFocus:d,...f}=t,g=Qa(),m=g.useState("descriptionElementId"),h=g.useState("disablePointerDismissal"),x=g.useState("floatingRootContext"),S=g.useState("popupProps"),w=g.useState("modal"),C=g.useState("mounted"),E=g.useState("nested"),R=g.useState("nestedOpenDialogCount"),k=g.useState("open"),O=g.useState("openMethod"),A=g.useState("titleElementId"),N=g.useState("transitionStatus"),j=g.useState("role"),D=x.useState("floatingId");yH(),Li({open:k,ref:g.context.popupRef,onComplete(){k&&g.context.onOpenChangeComplete?.(!0)}});const M=d===void 0?IC(g.context.popupRef):d,_=R>0,L=g.useStateSetter("popupElement"),X=kt("div",t,{state:{open:k,nested:E,transitionStatus:N,nestedDialogOpen:_},props:[S,{id:D,"aria-labelledby":A,"aria-describedby":m,role:j,...id,hidden:!C,onKeyDown(B){cd.has(B.key)&&B.stopPropagation()},style:{[vH]:R}},f],ref:[i,g.context.popupRef,L],stateAttributesMapping:xH});return v.jsx(Mp,{context:x,openInteractionType:O,disabled:!C,closeOnFocusOut:!h,initialFocus:M,returnFocus:u,modal:w!==!1,restoreFocus:"popup",children:X})}),hA=b.forwardRef(function(t,i){const{keepMounted:s=!1,...o}=t,c=Qa(),u=c.useState("mounted"),d=c.useState("modal"),f=c.useState("open");return u||s?v.jsx(dA.Provider,{value:s,children:v.jsxs(Ap,{ref:i,...o,children:[u&&d===!0&&v.jsx(Wp,{ref:c.context.internalBackdropRef,inert:$p(!f)}),t.children]})}):null});function SH({store:e,parentContext:t,isDrawer:i}){const s=e.useState("open"),o=e.useState("mounted"),c=e.useState("disablePointerDismissal"),u=e.useState("modal"),d=e.useState("popupElement"),f=e.useState("floatingRootContext"),[g,m]=b.useState(0),[h,x]=b.useState(0),S=g===0,w=rd(f,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:u==="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 E=tr(C);if(S&&!c){if(u){const R=e.context.internalBackdropRef.current,k=e.context.backdropRef.current;return R||k?R===E||k===E||it(E,d)&&!E?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:S});return Ok(s&&u===!0,d),e.useContextCallback("onNestedDialogOpen",(C,E)=>{!e.select("open")&&!e.select("mounted")||(m(C),x(E))}),_e(()=>{!s&&!o&&(m(0),x(0))},[s,o]),_e(()=>(t?.onNestedDialogOpen&&s&&t.onNestedDialogOpen(g+1,h+(i?1:0)),()=>{t?.onNestedDialogOpen&&s&&t.onNestedDialogOpen(0,0)}),[i,s,g,h,t]),Up(e,{activeTriggerProps:w.reference,inactiveTriggerProps:w.trigger,popupProps:w.floating,nestedOpenDialogCount:g,nestedOpenDrawerCount:h}),null}const wH={...Ys,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 EH extends oc{constructor(t,i,s){const o=new sd,c=RH(t,o,i,s);super(c,CH(o),wH)}setOpen=(t,i)=>{i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,i),!i.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(t,i),this.update(Ip(this.state,t,i.trigger)))}}function RH(e,t,i,s=!1){return{...Fp(t,i,s),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function CH(e){return{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function TH(e,t){const{children:i,open:s,defaultOpen:o=!1,onOpenChange:c,onOpenChangeComplete:u,disablePointerDismissal:d=!1,modal:f=!0,actionsRef:g,handle:m,triggerId:h,defaultTriggerId:x=null}=t,S=e==="drawer",w=f,C=d,E="dialog",R=Qa(!0),k=R!=null,O={modal:w,disablePointerDismissal:C,nested:k,role:E},A=Vv((L,q)=>new EH({open:o,openProp:s,activeTriggerId:x,triggerIdProp:h,...O},L,q),!0);A.useControlledProp("openProp",s),A.useControlledProp("triggerIdProp",h),A.useSyncedValues(O),A.useContextCallback("onOpenChange",c),A.useContextCallback("onOpenChangeComplete",u);const N=A.useState("open"),j=A.useState("mounted"),D=A.useState("payload");PC(A,N),zp(A);const{forceUnmount:M}=_p(N,A);b.useImperativeHandle(g,()=>({unmount:M,close:()=>A.setOpen(!1,ut(td))}),[M,A]);const _=N||j||m!=null;return v.jsxs(lA.Provider,{value:A,children:[m&&v.jsx(jp,{handle:m,store:A}),_&&v.jsx(SH,{store:A,parentContext:R?.context,isDrawer:S}),typeof i=="function"?i({payload:D}):i]})}const pA=Qu(function(t){return TH("dialog",t)}),gA=b.forwardRef(function(t,i){const{render:s,className:o,style:c,id:u,...d}=t,f=Qa(),g=ar(u);return f.useSyncedValueWithCleanup("titleElementId",g),kt("h2",t,{ref:i,props:[{id:g},d]})}),kH=pp(function(t,i){const{render:s,className:o,style:c,disabled:u=!1,nativeButton:d=!0,id:f,payload:g,handle:m,...h}=t,x=Qa(!0),w=Bp(m)??x;if(!w)throw new Error(gn(79));const C=ar(f),E=w.useState("floatingRootContext"),R=w.useState("isOpenedByTrigger",C),k=w.useState("triggerPopupId",C),O=b.useRef(null),{registerTrigger:A,isMountedByThisTrigger:N}=Lp(C,O,w,{payload:g}),{getButtonProps:j,buttonRef:D}=vi({disabled:u,native:d}),M=Np(E),_=ob(()=>w.select("open"),X=>{w.set("openMethod",X)}),L={disabled:u,open:R},q=w.useState("triggerProps",N);return kt("button",t,{state:L,ref:[D,i,A,O],props:[M.reference,q,_,{[_v]:"",id:C,"aria-haspopup":"dialog","aria-expanded":R,"aria-controls":k},h,j],stateAttributesMapping:wp})});function mA({...e}){return v.jsx(pA,{"data-slot":"sheet",...e})}function OH({...e}){return v.jsx(kH,{"data-slot":"sheet-trigger",...e})}function AH({...e}){return v.jsx(hA,{"data-slot":"sheet-portal",...e})}function MH({className:e,...t}){return v.jsx(cA,{"data-slot":"sheet-overlay",className:Fe("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),...t})}function yA({className:e,children:t,side:i="right",showCloseButton:s=!0,...o}){const{t:c}=mt();return v.jsxs(AH,{children:[v.jsx(MH,{}),v.jsxs(fA,{"data-slot":"sheet-content","data-side":i,className:Fe("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),...o,children:[t,s&&v.jsxs(fg,{"data-slot":"sheet-close",render:v.jsx(at,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:c("a11y.close")})]})]})]})}function NH({className:e,...t}){return v.jsx("div",{"data-slot":"sheet-header",className:Fe("flex flex-col gap-1.5 p-6",e),...t})}function vA({className:e,...t}){return v.jsx(gA,{"data-slot":"sheet-title",className:Fe("font-heading text-sm font-medium text-foreground",e),...t})}function DH({className:e,...t}){return v.jsx(uA,{"data-slot":"sheet-description",className:Fe("text-xs/relaxed text-muted-foreground",e),...t})}function Er({className:e,...t}){return v.jsx("div",{"data-slot":"skeleton",className:Fe("animate-pulse rounded-md bg-muted",e),...t})}const jH="sidebar_state",IH=3600*24*7,PH="16rem",LH="18rem",zH="3rem",_H="b",bA=b.createContext(null);function gc(){const e=b.useContext(bA);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function UH({defaultOpen:e=!0,open:t,onOpenChange:i,className:s,style:o,children:c,...u}){const d=mb(),[f,g]=b.useState(!1),[m,h]=b.useState(e),x=t??m,S=b.useCallback(R=>{const k=typeof R=="function"?R(x):R;i?i(k):h(k),document.cookie=`${jH}=${k}; path=/; max-age=${IH}`},[i,x]),w=b.useCallback(()=>d?g(R=>!R):S(R=>!R),[d,S,g]);b.useEffect(()=>{const R=k=>{k.key===_H&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),w())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[w]);const C=x?"expanded":"collapsed",E=b.useMemo(()=>({state:C,open:x,setOpen:S,isMobile:d,openMobile:f,setOpenMobile:g,toggleSidebar:w}),[C,x,S,d,f,g,w]);return v.jsx(bA.Provider,{value:E,children:v.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":PH,"--sidebar-width-icon":zH,...o},className:Fe("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",s),...u,children:c})})}function HH({side:e="left",variant:t="sidebar",collapsible:i="offcanvas",className:s,children:o,dir:c,...u}){const{t:d}=mt(),{isMobile:f,state:g,openMobile:m,setOpenMobile:h}=gc();return i==="none"?v.jsx("div",{"data-slot":"sidebar",className:Fe("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",s),...u,children:o}):f?v.jsx(mA,{open:m,onOpenChange:h,...u,children:v.jsxs(yA,{dir:c,"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":LH},side:e,children:[v.jsxs(NH,{className:"sr-only",children:[v.jsx(vA,{children:d("a11y.sidebar")}),v.jsx(DH,{children:d("a11y.sidebarDescription")})]}),v.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):v.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":g,"data-collapsible":g==="collapsed"?i:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[v.jsx("div",{"data-slot":"sidebar-gap",className:Fe("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),v.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:Fe("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",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...u,children:v.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:o})})]})}function FH({className:e,onClick:t,...i}){const{t:s}=mt(),{toggleSidebar:o}=gc();return v.jsxs(at,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Fe(e),onClick:c=>{t?.(c),o()},...i,children:[v.jsx(vL,{}),v.jsx("span",{className:"sr-only",children:s("a11y.toggleSidebar")})]})}function BH({className:e,...t}){const{t:i}=mt(),{toggleSidebar:s}=gc();return v.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":i("a11y.toggleSidebar"),tabIndex:-1,onClick:s,title:i("a11y.toggleSidebar"),className:Fe("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),...t})}function VH({className:e,...t}){return v.jsx("main",{"data-slot":"sidebar-inset",className:Fe("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),...t})}function KH({className:e,...t}){return v.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Fe("flex flex-col gap-2 p-2",e),...t})}function qH({className:e,...t}){return v.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Fe("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function YH({className:e,...t}){return v.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Fe("relative flex w-full min-w-0 flex-col px-2 py-1",e),...t})}function xA({className:e,...t}){return v.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Fe("flex w-full min-w-0 flex-col gap-px",e),...t})}function Dh({className:e,...t}){return v.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Fe("group/menu-item relative",e),...t})}const GH=Uo("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 jh({render:e,isActive:t=!1,variant:i="default",size:s="default",tooltip:o,className:c,...u}){const{isMobile:d,state:f}=gc(),g=Pb({defaultTagName:"button",props:Ar({className:Fe(GH({variant:i,size:s}),c)},u),render:o?v.jsx(Xh,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:s,active:t}});return o?(typeof o=="string"&&(o={children:o}),v.jsxs(Qh,{children:[g,v.jsx(Zh,{side:"right",align:"center",hidden:f!=="collapsed"||d,...o})]})):g}function $H({className:e,...t}){return v.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:Fe("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),...t})}function QH({className:e,...t}){return v.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Fe("group/menu-sub-item relative",e),...t})}function XH({render:e,size:t="md",isActive:i=!1,className:s,...o}){return Pb({defaultTagName:"a",props:Ar({className:Fe("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",s)},o),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:i}})}function ZH({items:e}){const{t}=mt(),{pathname:i}=Nr(),{isMobile:s,state:o}=gc(),c=o==="collapsed"&&!s,u=d=>i===d||i.startsWith(`${d}/`);return v.jsx(YH,{children:v.jsx(xA,{children:e.map(d=>{const f=d.icon,g=d.items?.some(m=>u(m.url))??!1;return d.items?c?v.jsx(Dh,{children:v.jsxs(Vo,{children:[v.jsxs(Ko,{render:v.jsx(jh,{tooltip:t(d.titleKey),isActive:g}),children:[v.jsx(f,{}),v.jsx("span",{children:t(d.titleKey)})]}),v.jsx(qo,{className:"w-40",side:"right",align:"start",sideOffset:4,children:v.jsxs(iA,{children:[v.jsx(sA,{children:t(d.titleKey)}),d.items.map(m=>v.jsx(fc,{className:"cursor-pointer",render:v.jsx(Mu,{to:m.url}),children:v.jsx("span",{children:t(m.titleKey)})},m.titleKey))]})})]})},d.titleKey):v.jsxs(X8,{defaultOpen:g,className:"group/collapsible",render:v.jsx(Dh,{}),children:[v.jsxs(Z8,{render:v.jsx(jh,{tooltip:t(d.titleKey),isActive:g}),children:[v.jsx(f,{}),v.jsx("span",{children:t(d.titleKey)}),v.jsx(Zv,{className:`
50
- ml-auto transition-transform duration-200
51
- group-data-open/collapsible:rotate-90
52
- `})]}),v.jsx(J8,{children:v.jsx($H,{children:d.items.map(m=>v.jsx(QH,{children:v.jsx(XH,{isActive:u(m.url),render:v.jsx(Mu,{to:m.url}),children:v.jsx("span",{children:t(m.titleKey)})})},m.titleKey))})})]},`${d.titleKey}-${g?"active":"inactive"}`):v.jsx(Dh,{children:v.jsxs(jh,{tooltip:t(d.titleKey),isActive:i===d.url,render:v.jsx(Mu,{to:d.url??"/dashboard"}),children:[v.jsx(f,{}),v.jsx("span",{children:t(d.titleKey)})]})},d.titleKey)})})})}const zb=[{titleKey:"nav.dashboard",url:"/dashboard",icon:fL},{titleKey:"nav.library",icon:hL,items:[{titleKey:"nav.instructions",url:"/library/instructions"},{titleKey:"nav.skills",url:"/library/skills"}]},{titleKey:"nav.models",icon:cT,items:[{titleKey:"nav.genesis",url:"/models/genesis"},{titleKey:"nav.explorer",url:"/models/explorer"},{titleKey:"nav.quantum",url:"/models/quantum"}]}],JH=new Map([["/settings","nav.settings"],...zb.flatMap(e=>[...e.url?[[e.url,e.titleKey]]:[],...e.items?.map(t=>[t.url,t.titleKey])??[]])]);function SA(e){return e.startsWith("/library/skills/")?"nav.skills":JH.get(e)??"nav.dashboard"}const WH=zb.flatMap(e=>[...e.url?[e.url]:[],...e.items?.map(t=>t.url)??[]]),eF=WH;function tF({...e}){const{t}=mt(),{pathname:i}=Nr(),{isMobile:s,setOpenMobile:o}=gc();return b.useEffect(()=>{s&&o(!1)},[s,i,o]),v.jsxs(HH,{collapsible:"icon",...e,children:[v.jsx(qH,{children:v.jsx(ZH,{items:zb})}),v.jsx(KH,{children:v.jsx(xA,{children:v.jsx(Dh,{children:v.jsxs(jh,{tooltip:t("nav.settings"),render:v.jsx(Mu,{to:"/settings"}),children:[v.jsx(xL,{}),v.jsx("span",{children:t("nav.settings")})]})})})}),v.jsx(BH,{})]})}function nF({className:e,...t}){return v.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:Fe(e),...t})}function rF({className:e,...t}){return v.jsx("ol",{"data-slot":"breadcrumb-list",className:Fe("flex flex-wrap items-center gap-1.5 text-xs/relaxed wrap-break-word text-muted-foreground",e),...t})}function iF({className:e,...t}){return v.jsx("li",{"data-slot":"breadcrumb-item",className:Fe("inline-flex items-center gap-1",e),...t})}function sF({className:e,render:t,...i}){return Pb({defaultTagName:"a",props:Ar({className:Fe("transition-colors hover:text-foreground",e)},i),render:t,state:{slot:"breadcrumb-link"}})}function aF({className:e,...t}){return v.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Fe("font-normal text-foreground",e),...t})}function oF({children:e,className:t,...i}){return v.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Fe("[&>svg]:size-3.5",t),...i,children:e??v.jsx(Zv,{})})}function lF({items:e}){const{t}=mt();return v.jsx(nF,{"aria-label":t("a11y.breadcrumb"),className:"min-w-0",children:v.jsx(rF,{className:"flex-nowrap text-sm font-medium text-foreground",children:e.map((i,s)=>v.jsxs(b.Fragment,{children:[s>0&&v.jsx(oF,{}),v.jsx(iF,{className:i.to?"shrink-0":"min-w-0",children:i.to?v.jsx(sF,{render:v.jsx(md,{to:i.to}),className:"truncate",title:i.label,children:i.label}):v.jsx(aF,{className:"truncate font-medium",title:i.label,children:i.label})})]},i.to??i.label))})})}const hg=b.createContext(null);hg.displayName="PageHeaderActionsContext";function cF({children:e}){const[t,i]=b.useState(null);return v.jsx(hg,{value:{container:t,setContainer:i},children:e})}function uF(){const e=b.use(hg);if(!e)throw new Error("PageHeaderActionsSlot must be used within PageHeaderActionsProvider");const t=e.setContainer,i=b.useCallback(s=>{t(s)},[t]);return v.jsx("div",{ref:i,className:"ml-auto flex shrink-0 items-center gap-2 px-4"})}function wA({children:e}){const t=b.use(hg);return t?.container?fr.createPortal(e,t.container):null}function dF(){const{t:e}=mt(),{pathname:t}=Nr(),i=x6("/library/skills/:name");return v.jsx(cF,{children:v.jsxs(UH,{className:"h-svh pb-6",children:[v.jsx(tF,{className:"pb-6"}),v.jsxs(VH,{className:i?"h-full min-w-0 overflow-hidden":"min-w-0",children:[v.jsxs("header",{className:`
53
- flex h-16 shrink-0 items-center gap-2 transition-[width,height]
54
- ease-linear
55
- group-has-data-[collapsible=icon]/sidebar-wrapper:h-12
56
- `,children:[v.jsxs("div",{className:"flex min-w-0 items-center gap-2 px-4",children:[v.jsx(FH,{size:"icon",className:"-ml-1"}),v.jsx(oA,{orientation:"vertical",className:`
57
- mr-2
58
- data-vertical:h-4 data-vertical:self-auto
59
- `}),v.jsx(lF,{items:i?[{label:e("nav.skills"),to:"/library/skills"},{label:i.params.name??""}]:[{label:e(SA(t))}]})]}),v.jsx(uF,{})]}),v.jsx(OO,{})]})]})})}function fF(){const{t:e}=mt(),{pathname:t}=Nr(),i=j6(),s=Bo();let o;for(const u of i.toReversed())if(hF(u.handle)){o=u.handle.backTo;break}const c=()=>{if(o===void 0){s(-1);return}s(o)};return v.jsxs("div",{"data-slot":"full-screen-layout",className:"flex h-dvh flex-col overflow-hidden bg-background pb-6",children:[v.jsx("header",{className:`
60
- flex h-16 shrink-0 items-center gap-2 transition-[width,height]
61
- ease-linear
62
- `,children:v.jsxs("div",{className:"flex items-center gap-2 px-4",children:[v.jsxs(at,{variant:"ghost",size:"icon",className:"-ml-1",onClick:c,children:[v.jsx(tL,{}),v.jsx("span",{className:"sr-only",children:e("a11y.goBack")})]}),v.jsx(oA,{orientation:"vertical",className:`
63
- mr-2
64
- data-vertical:h-4 data-vertical:self-auto
65
- `}),v.jsx("span",{className:"text-sm font-medium",children:e(SA(t))})]})}),v.jsx("main",{className:"min-h-0 flex-1 overflow-hidden",children:v.jsx(OO,{})})]})}function hF(e){return typeof e=="object"&&e!==null&&"backTo"in e&&typeof e.backTo=="string"}function pF(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return b.useMemo(()=>s=>{t.forEach(o=>o(s))},t)}const pg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function mc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function _b(e){return"nodeType"in e}function Vr(e){var t,i;return e?mc(e)?e:_b(e)&&(t=(i=e.ownerDocument)==null?void 0:i.defaultView)!=null?t:window:window}function Ub(e){const{Document:t}=Vr(e);return e instanceof t}function Sd(e){return mc(e)?!1:e instanceof Vr(e).HTMLElement}function EA(e){return e instanceof Vr(e).SVGElement}function yc(e){return e?mc(e)?e.document:_b(e)?Ub(e)?e:Sd(e)||EA(e)?e.ownerDocument:document:document:document}const Xi=pg?b.useLayoutEffect:b.useEffect;function gg(e){const t=b.useRef(e);return Xi(()=>{t.current=e}),b.useCallback(function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return t.current==null?void 0:t.current(...s)},[])}function gF(){const e=b.useRef(null),t=b.useCallback((s,o)=>{e.current=setInterval(s,o)},[]),i=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,i]}function Vu(e,t){t===void 0&&(t=[e]);const i=b.useRef(e);return Xi(()=>{i.current!==e&&(i.current=e)},t),i}function wd(e,t){const i=b.useRef();return b.useMemo(()=>{const s=e(i.current);return i.current=s,s},[...t])}function rp(e){const t=gg(e),i=b.useRef(null),s=b.useCallback(o=>{o!==i.current&&t?.(o,i.current),i.current=o},[]);return[i,s]}function ip(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let by={};function Ed(e,t){return b.useMemo(()=>{if(t)return t;const i=by[e]==null?0:by[e]+1;return by[e]=i,e+"-"+i},[e,t])}function RA(e){return function(t){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return s.reduce((c,u)=>{const d=Object.entries(u);for(const[f,g]of d){const m=c[f];m!=null&&(c[f]=m+e*g)}return c},{...t})}}const Zl=RA(1),Ku=RA(-1);function mF(e){return"clientX"in e&&"clientY"in e}function mg(e){if(!e)return!1;const{KeyboardEvent:t}=Vr(e.target);return t&&e instanceof t}function yF(e){if(!e)return!1;const{TouchEvent:t}=Vr(e.target);return t&&e instanceof t}function sp(e){if(yF(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:i}=e.touches[0];return{x:t,y:i}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:i}=e.changedTouches[0];return{x:t,y:i}}}return mF(e)?{x:e.clientX,y:e.clientY}:null}const qa=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:i}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(i?Math.round(i):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:i}=e;return"scaleX("+t+") scaleY("+i+")"}},Transform:{toString(e){if(e)return[qa.Translate.toString(e),qa.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:i,easing:s}=e;return t+" "+i+"ms "+s}}}),mR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function vF(e){return e.matches(mR)?e:e.querySelector(mR)}const bF={display:"none"};function xF(e){let{id:t,value:i}=e;return Ne.createElement("div",{id:t,style:bF},i)}function SF(e){let{id:t,announcement:i,ariaLiveType:s="assertive"}=e;const o={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:t,style:o,role:"status","aria-live":s,"aria-atomic":!0},i)}function wF(){const[e,t]=b.useState("");return{announce:b.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const CA=b.createContext(null);function EF(e){const t=b.useContext(CA);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function RF(){const[e]=b.useState(()=>new Set),t=b.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[b.useCallback(s=>{let{type:o,event:c}=s;e.forEach(u=>{var d;return(d=u[o])==null?void 0:d.call(u,c)})},[e]),t]}const CF={draggable:`
66
- To pick up a draggable item, press the space bar.
67
- While dragging, use the arrow keys to move the item.
68
- Press space again to drop the item in its new position, or press escape to cancel.
69
- `},TF={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:i}=e;return i?"Draggable item "+t.id+" was moved over droppable area "+i.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:i}=e;return i?"Draggable item "+t.id+" was dropped over droppable area "+i.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function kF(e){let{announcements:t=TF,container:i,hiddenTextDescribedById:s,screenReaderInstructions:o=CF}=e;const{announce:c,announcement:u}=wF(),d=Ed("DndLiveRegion"),[f,g]=b.useState(!1);if(b.useEffect(()=>{g(!0)},[]),EF(b.useMemo(()=>({onDragStart(h){let{active:x}=h;c(t.onDragStart({active:x}))},onDragMove(h){let{active:x,over:S}=h;t.onDragMove&&c(t.onDragMove({active:x,over:S}))},onDragOver(h){let{active:x,over:S}=h;c(t.onDragOver({active:x,over:S}))},onDragEnd(h){let{active:x,over:S}=h;c(t.onDragEnd({active:x,over:S}))},onDragCancel(h){let{active:x,over:S}=h;c(t.onDragCancel({active:x,over:S}))}}),[c,t])),!f)return null;const m=Ne.createElement(Ne.Fragment,null,Ne.createElement(xF,{id:s,value:o.draggable}),Ne.createElement(SF,{id:d,announcement:u}));return i?fr.createPortal(m,i):m}var ir;(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"})(ir||(ir={}));function ap(){}function xy(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function OF(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return b.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const Zi=Object.freeze({x:0,y:0});function Hb(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function AF(e,t){const i=sp(e);if(!i)return"0 0";const s={x:(i.x-t.left)/t.width*100,y:(i.y-t.top)/t.height*100};return s.x+"% "+s.y+"%"}function Fb(e,t){let{data:{value:i}}=e,{data:{value:s}}=t;return i-s}function MF(e,t){let{data:{value:i}}=e,{data:{value:s}}=t;return s-i}function lv(e){let{left:t,top:i,height:s,width:o}=e;return[{x:t,y:i},{x:t+o,y:i},{x:t,y:i+s},{x:t+o,y:i+s}]}function TA(e,t){if(!e||e.length===0)return null;const[i]=e;return i[t]}function yR(e,t,i){return t===void 0&&(t=e.left),i===void 0&&(i=e.top),{x:t+e.width*.5,y:i+e.height*.5}}const NF=e=>{let{collisionRect:t,droppableRects:i,droppableContainers:s}=e;const o=yR(t,t.left,t.top),c=[];for(const u of s){const{id:d}=u,f=i.get(d);if(f){const g=Hb(yR(f),o);c.push({id:d,data:{droppableContainer:u,value:g}})}}return c.sort(Fb)},DF=e=>{let{collisionRect:t,droppableRects:i,droppableContainers:s}=e;const o=lv(t),c=[];for(const u of s){const{id:d}=u,f=i.get(d);if(f){const g=lv(f),m=o.reduce((x,S,w)=>x+Hb(g[w],S),0),h=Number((m/4).toFixed(4));c.push({id:d,data:{droppableContainer:u,value:h}})}}return c.sort(Fb)};function jF(e,t){const i=Math.max(t.top,e.top),s=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),c=Math.min(t.top+t.height,e.top+e.height),u=o-s,d=c-i;if(s<o&&i<c){const f=t.width*t.height,g=e.width*e.height,m=u*d,h=m/(f+g-m);return Number(h.toFixed(4))}return 0}const IF=e=>{let{collisionRect:t,droppableRects:i,droppableContainers:s}=e;const o=[];for(const c of s){const{id:u}=c,d=i.get(u);if(d){const f=jF(d,t);f>0&&o.push({id:u,data:{droppableContainer:c,value:f}})}}return o.sort(MF)};function PF(e,t){const{top:i,left:s,bottom:o,right:c}=t;return i<=e.y&&e.y<=o&&s<=e.x&&e.x<=c}const LF=e=>{let{droppableContainers:t,droppableRects:i,pointerCoordinates:s}=e;if(!s)return[];const o=[];for(const c of t){const{id:u}=c,d=i.get(u);if(d&&PF(s,d)){const g=lv(d).reduce((h,x)=>h+Hb(s,x),0),m=Number((g/4).toFixed(4));o.push({id:u,data:{droppableContainer:c,value:m}})}}return o.sort(Fb)};function zF(e,t,i){return{...e,scaleX:t&&i?t.width/i.width:1,scaleY:t&&i?t.height/i.height:1}}function kA(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Zi}function _F(e){return function(i){for(var s=arguments.length,o=new Array(s>1?s-1:0),c=1;c<s;c++)o[c-1]=arguments[c];return o.reduce((u,d)=>({...u,top:u.top+e*d.y,bottom:u.bottom+e*d.y,left:u.left+e*d.x,right:u.right+e*d.x}),{...i})}}const UF=_F(1);function OA(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function HF(e,t,i){const s=OA(t);if(!s)return e;const{scaleX:o,scaleY:c,x:u,y:d}=s,f=e.left-u-(1-o)*parseFloat(i),g=e.top-d-(1-c)*parseFloat(i.slice(i.indexOf(" ")+1)),m=o?e.width/o:e.width,h=c?e.height/c:e.height;return{width:m,height:h,top:g,right:f+m,bottom:g+h,left:f}}const FF={ignoreTransform:!1};function vc(e,t){t===void 0&&(t=FF);let i=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:m}=Vr(e).getComputedStyle(e);g&&(i=HF(i,g,m))}const{top:s,left:o,width:c,height:u,bottom:d,right:f}=i;return{top:s,left:o,width:c,height:u,bottom:d,right:f}}function vR(e){return vc(e,{ignoreTransform:!0})}function BF(e){const t=e.innerWidth,i=e.innerHeight;return{top:0,left:0,right:t,bottom:i,width:t,height:i}}function VF(e,t){return t===void 0&&(t=Vr(e).getComputedStyle(e)),t.position==="fixed"}function KF(e,t){t===void 0&&(t=Vr(e).getComputedStyle(e));const i=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const c=t[o];return typeof c=="string"?i.test(c):!1})}function yg(e,t){const i=[];function s(o){if(t!=null&&i.length>=t||!o)return i;if(Ub(o)&&o.scrollingElement!=null&&!i.includes(o.scrollingElement))return i.push(o.scrollingElement),i;if(!Sd(o)||EA(o)||i.includes(o))return i;const c=Vr(e).getComputedStyle(o);return o!==e&&KF(o,c)&&i.push(o),VF(o,c)?i:s(o.parentNode)}return e?s(e):i}function AA(e){const[t]=yg(e,1);return t??null}function Sy(e){return!pg||!e?null:mc(e)?e:_b(e)?Ub(e)||e===yc(e).scrollingElement?window:Sd(e)?e:null:null}function MA(e){return mc(e)?e.scrollX:e.scrollLeft}function NA(e){return mc(e)?e.scrollY:e.scrollTop}function cv(e){return{x:MA(e),y:NA(e)}}var dr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(dr||(dr={}));function DA(e){return!pg||!e?!1:e===document.scrollingElement}function jA(e){const t={x:0,y:0},i=DA(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-i.width,y:e.scrollHeight-i.height},o=e.scrollTop<=t.y,c=e.scrollLeft<=t.x,u=e.scrollTop>=s.y,d=e.scrollLeft>=s.x;return{isTop:o,isLeft:c,isBottom:u,isRight:d,maxScroll:s,minScroll:t}}const qF={x:.2,y:.2};function YF(e,t,i,s,o){let{top:c,left:u,right:d,bottom:f}=i;s===void 0&&(s=10),o===void 0&&(o=qF);const{isTop:g,isBottom:m,isLeft:h,isRight:x}=jA(e),S={x:0,y:0},w={x:0,y:0},C={height:t.height*o.y,width:t.width*o.x};return!g&&c<=t.top+C.height?(S.y=dr.Backward,w.y=s*Math.abs((t.top+C.height-c)/C.height)):!m&&f>=t.bottom-C.height&&(S.y=dr.Forward,w.y=s*Math.abs((t.bottom-C.height-f)/C.height)),!x&&d>=t.right-C.width?(S.x=dr.Forward,w.x=s*Math.abs((t.right-C.width-d)/C.width)):!h&&u<=t.left+C.width&&(S.x=dr.Backward,w.x=s*Math.abs((t.left+C.width-u)/C.width)),{direction:S,speed:w}}function GF(e){if(e===document.scrollingElement){const{innerWidth:c,innerHeight:u}=window;return{top:0,left:0,right:c,bottom:u,width:c,height:u}}const{top:t,left:i,right:s,bottom:o}=e.getBoundingClientRect();return{top:t,left:i,right:s,bottom:o,width:e.clientWidth,height:e.clientHeight}}function IA(e){return e.reduce((t,i)=>Zl(t,cv(i)),Zi)}function $F(e){return e.reduce((t,i)=>t+MA(i),0)}function QF(e){return e.reduce((t,i)=>t+NA(i),0)}function PA(e,t){if(t===void 0&&(t=vc),!e)return;const{top:i,left:s,bottom:o,right:c}=t(e);AA(e)&&(o<=0||c<=0||i>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const XF=[["x",["left","right"],$F],["y",["top","bottom"],QF]];class Bb{constructor(t,i){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 s=yg(i),o=IA(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[c,u,d]of XF)for(const f of u)Object.defineProperty(this,f,{get:()=>{const g=d(s),m=o[c]-g;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Nu{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(i=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...i)})},this.target=t}add(t,i,s){var o;(o=this.target)==null||o.addEventListener(t,i,s),this.listeners.push([t,i,s])}}function ZF(e){const{EventTarget:t}=Vr(e);return e instanceof t?e:yc(e)}function wy(e,t){const i=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(i**2+s**2)>t:"x"in t&&"y"in t?i>t.x&&s>t.y:"x"in t?i>t.x:"y"in t?s>t.y:!1}var Di;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Di||(Di={}));function bR(e){e.preventDefault()}function JF(e){e.stopPropagation()}var en;(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"})(en||(en={}));const LA={start:[en.Space,en.Enter],cancel:[en.Esc],end:[en.Space,en.Enter,en.Tab]},WF=(e,t)=>{let{currentCoordinates:i}=t;switch(e.code){case en.Right:return{...i,x:i.x+25};case en.Left:return{...i,x:i.x-25};case en.Down:return{...i,y:i.y+25};case en.Up:return{...i,y:i.y-25}}};class Vb{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:i}}=t;this.props=t,this.listeners=new Nu(yc(i)),this.windowListeners=new Nu(Vr(i)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Di.Resize,this.handleCancel),this.windowListeners.add(Di.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Di.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:i}=this.props,s=t.node.current;s&&PA(s),i(Zi)}handleKeyDown(t){if(mg(t)){const{active:i,context:s,options:o}=this.props,{keyboardCodes:c=LA,coordinateGetter:u=WF,scrollBehavior:d="smooth"}=o,{code:f}=t;if(c.end.includes(f)){this.handleEnd(t);return}if(c.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:g}=s.current,m=g?{x:g.left,y:g.top}:Zi;this.referenceCoordinates||(this.referenceCoordinates=m);const h=u(t,{active:i,context:s.current,currentCoordinates:m});if(h){const x=Ku(h,m),S={x:0,y:0},{scrollableAncestors:w}=s.current;for(const C of w){const E=t.code,{isTop:R,isRight:k,isLeft:O,isBottom:A,maxScroll:N,minScroll:j}=jA(C),D=GF(C),M={x:Math.min(E===en.Right?D.right-D.width/2:D.right,Math.max(E===en.Right?D.left:D.left+D.width/2,h.x)),y:Math.min(E===en.Down?D.bottom-D.height/2:D.bottom,Math.max(E===en.Down?D.top:D.top+D.height/2,h.y))},_=E===en.Right&&!k||E===en.Left&&!O,L=E===en.Down&&!A||E===en.Up&&!R;if(_&&M.x!==h.x){const q=C.scrollLeft+x.x,X=E===en.Right&&q<=N.x||E===en.Left&&q>=j.x;if(X&&!x.y){C.scrollTo({left:q,behavior:d});return}X?S.x=C.scrollLeft-q:S.x=E===en.Right?C.scrollLeft-N.x:C.scrollLeft-j.x,S.x&&C.scrollBy({left:-S.x,behavior:d});break}else if(L&&M.y!==h.y){const q=C.scrollTop+x.y,X=E===en.Down&&q<=N.y||E===en.Up&&q>=j.y;if(X&&!x.x){C.scrollTo({top:q,behavior:d});return}X?S.y=C.scrollTop-q:S.y=E===en.Down?C.scrollTop-N.y:C.scrollTop-j.y,S.y&&C.scrollBy({top:-S.y,behavior:d});break}}this.handleMove(t,Zl(Ku(h,this.referenceCoordinates),S))}}}handleMove(t,i){const{onMove:s}=this.props;t.preventDefault(),s(i)}handleEnd(t){const{onEnd:i}=this.props;t.preventDefault(),this.detach(),i()}handleCancel(t){const{onCancel:i}=this.props;t.preventDefault(),this.detach(),i()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Vb.activators=[{eventName:"onKeyDown",handler:(e,t,i)=>{let{keyboardCodes:s=LA,onActivation:o}=t,{active:c}=i;const{code:u}=e.nativeEvent;if(s.start.includes(u)){const d=c.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function xR(e){return!!(e&&"distance"in e)}function SR(e){return!!(e&&"delay"in e)}class Kb{constructor(t,i,s){var o;s===void 0&&(s=ZF(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=i;const{event:c}=t,{target:u}=c;this.props=t,this.events=i,this.document=yc(u),this.documentListeners=new Nu(this.document),this.listeners=new Nu(s),this.windowListeners=new Nu(Vr(u)),this.initialCoordinates=(o=sp(c))!=null?o:Zi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:i,bypassActivationConstraint:s}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Di.Resize,this.handleCancel),this.windowListeners.add(Di.DragStart,bR),this.windowListeners.add(Di.VisibilityChange,this.handleCancel),this.windowListeners.add(Di.ContextMenu,bR),this.documentListeners.add(Di.Keydown,this.handleKeydown),i){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(SR(i)){this.timeoutId=setTimeout(this.handleStart,i.delay),this.handlePending(i);return}if(xR(i)){this.handlePending(i);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,i){const{active:s,onPending:o}=this.props;o(s,t,this.initialCoordinates,i)}handleStart(){const{initialCoordinates:t}=this,{onStart:i}=this.props;t&&(this.activated=!0,this.documentListeners.add(Di.Click,JF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Di.SelectionChange,this.removeTextSelection),i(t))}handleMove(t){var i;const{activated:s,initialCoordinates:o,props:c}=this,{onMove:u,options:{activationConstraint:d}}=c;if(!o)return;const f=(i=sp(t))!=null?i:Zi,g=Ku(o,f);if(!s&&d){if(xR(d)){if(d.tolerance!=null&&wy(g,d.tolerance))return this.handleCancel();if(wy(g,d.distance))return this.handleStart()}if(SR(d)&&wy(g,d.tolerance))return this.handleCancel();this.handlePending(d,g);return}t.cancelable&&t.preventDefault(),u(f)}handleEnd(){const{onAbort:t,onEnd:i}=this.props;this.detach(),this.activated||t(this.props.active),i()}handleCancel(){const{onAbort:t,onCancel:i}=this.props;this.detach(),this.activated||t(this.props.active),i()}handleKeydown(t){t.code===en.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const e7={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class zA extends Kb{constructor(t){const{event:i}=t,s=yc(i.target);super(t,e7,s)}}zA.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:i}=e,{onActivation:s}=t;return!i.isPrimary||i.button!==0?!1:(s?.({event:i}),!0)}}];const t7={move:{name:"mousemove"},end:{name:"mouseup"}};var uv;(function(e){e[e.RightClick=2]="RightClick"})(uv||(uv={}));class _A extends Kb{constructor(t){super(t,t7,yc(t.event.target))}}_A.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:i}=e,{onActivation:s}=t;return i.button===uv.RightClick?!1:(s?.({event:i}),!0)}}];const Ey={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class UA extends Kb{constructor(t){super(t,Ey)}static setup(){return window.addEventListener(Ey.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ey.move.name,t)};function t(){}}}UA.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:i}=e,{onActivation:s}=t;const{touches:o}=i;return o.length>1?!1:(s?.({event:i}),!0)}}];var Du;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Du||(Du={}));var op;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(op||(op={}));function n7(e){let{acceleration:t,activator:i=Du.Pointer,canScroll:s,draggingRect:o,enabled:c,interval:u=5,order:d=op.TreeOrder,pointerCoordinates:f,scrollableAncestors:g,scrollableAncestorRects:m,delta:h,threshold:x}=e;const S=i7({delta:h,disabled:!c}),[w,C]=gF(),E=b.useRef({x:0,y:0}),R=b.useRef({x:0,y:0}),k=b.useMemo(()=>{switch(i){case Du.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Du.DraggableRect:return o}},[i,o,f]),O=b.useRef(null),A=b.useCallback(()=>{const j=O.current;if(!j)return;const D=E.current.x*R.current.x,M=E.current.y*R.current.y;j.scrollBy(D,M)},[]),N=b.useMemo(()=>d===op.TreeOrder?[...g].reverse():g,[d,g]);b.useEffect(()=>{if(!c||!g.length||!k){C();return}for(const j of N){if(s?.(j)===!1)continue;const D=g.indexOf(j),M=m[D];if(!M)continue;const{direction:_,speed:L}=YF(j,M,k,t,x);for(const q of["x","y"])S[q][_[q]]||(L[q]=0,_[q]=0);if(L.x>0||L.y>0){C(),O.current=j,w(A,u),E.current=L,R.current=_;return}}E.current={x:0,y:0},R.current={x:0,y:0},C()},[t,A,s,C,c,u,JSON.stringify(k),JSON.stringify(S),w,g,N,m,JSON.stringify(x)])}const r7={x:{[dr.Backward]:!1,[dr.Forward]:!1},y:{[dr.Backward]:!1,[dr.Forward]:!1}};function i7(e){let{delta:t,disabled:i}=e;const s=ip(t);return wd(o=>{if(i||!s||!o)return r7;const c={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[dr.Backward]:o.x[dr.Backward]||c.x===-1,[dr.Forward]:o.x[dr.Forward]||c.x===1},y:{[dr.Backward]:o.y[dr.Backward]||c.y===-1,[dr.Forward]:o.y[dr.Forward]||c.y===1}}},[i,t,s])}function s7(e,t){const i=t!=null?e.get(t):void 0,s=i?i.node.current:null;return wd(o=>{var c;return t==null?null:(c=s??o)!=null?c:null},[s,t])}function a7(e,t){return b.useMemo(()=>e.reduce((i,s)=>{const{sensor:o}=s,c=o.activators.map(u=>({eventName:u.eventName,handler:t(u.handler,s)}));return[...i,...c]},[]),[e,t])}var qu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(qu||(qu={}));var dv;(function(e){e.Optimized="optimized"})(dv||(dv={}));const wR=new Map;function o7(e,t){let{dragging:i,dependencies:s,config:o}=t;const[c,u]=b.useState(null),{frequency:d,measure:f,strategy:g}=o,m=b.useRef(e),h=E(),x=Vu(h),S=b.useCallback(function(R){R===void 0&&(R=[]),!x.current&&u(k=>k===null?R:k.concat(R.filter(O=>!k.includes(O))))},[x]),w=b.useRef(null),C=wd(R=>{if(h&&!i)return wR;if(!R||R===wR||m.current!==e||c!=null){const k=new Map;for(let O of e){if(!O)continue;if(c&&c.length>0&&!c.includes(O.id)&&O.rect.current){k.set(O.id,O.rect.current);continue}const A=O.node.current,N=A?new Bb(f(A),A):null;O.rect.current=N,N&&k.set(O.id,N)}return k}return R},[e,c,i,h,f]);return b.useEffect(()=>{m.current=e},[e]),b.useEffect(()=>{h||S()},[i,h]),b.useEffect(()=>{c&&c.length>0&&u(null)},[JSON.stringify(c)]),b.useEffect(()=>{h||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{S(),w.current=null},d))},[d,h,S,...s]),{droppableRects:C,measureDroppableContainers:S,measuringScheduled:c!=null};function E(){switch(g){case qu.Always:return!1;case qu.BeforeDragging:return i;default:return!i}}}function qb(e,t){return wd(i=>e?i||(typeof t=="function"?t(e):e):null,[t,e])}function l7(e,t){return qb(e,t)}function c7(e){let{callback:t,disabled:i}=e;const s=gg(t),o=b.useMemo(()=>{if(i||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:c}=window;return new c(s)},[s,i]);return b.useEffect(()=>()=>o?.disconnect(),[o]),o}function vg(e){let{callback:t,disabled:i}=e;const s=gg(t),o=b.useMemo(()=>{if(i||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:c}=window;return new c(s)},[i]);return b.useEffect(()=>()=>o?.disconnect(),[o]),o}function u7(e){return new Bb(vc(e),e)}function ER(e,t,i){t===void 0&&(t=u7);const[s,o]=b.useState(null);function c(){o(f=>{if(!e)return null;if(e.isConnected===!1){var g;return(g=f??i)!=null?g:null}const m=t(e);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const u=c7({callback(f){if(e)for(const g of f){const{type:m,target:h}=g;if(m==="childList"&&h instanceof HTMLElement&&h.contains(e)){c();break}}}}),d=vg({callback:c});return Xi(()=>{c(),e?(d?.observe(e),u?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),u?.disconnect())},[e]),s}function d7(e){const t=qb(e);return kA(e,t)}const RR=[];function f7(e){const t=b.useRef(e),i=wd(s=>e?s&&s!==RR&&e&&t.current&&e.parentNode===t.current.parentNode?s:yg(e):RR,[e]);return b.useEffect(()=>{t.current=e},[e]),i}function h7(e){const[t,i]=b.useState(null),s=b.useRef(e),o=b.useCallback(c=>{const u=Sy(c.target);u&&i(d=>d?(d.set(u,cv(u)),new Map(d)):null)},[]);return b.useEffect(()=>{const c=s.current;if(e!==c){u(c);const d=e.map(f=>{const g=Sy(f);return g?(g.addEventListener("scroll",o,{passive:!0}),[g,cv(g)]):null}).filter(f=>f!=null);i(d.length?new Map(d):null),s.current=e}return()=>{u(e),u(c)};function u(d){d.forEach(f=>{const g=Sy(f);g?.removeEventListener("scroll",o)})}},[o,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((c,u)=>Zl(c,u),Zi):IA(e):Zi,[e,t])}function CR(e,t){t===void 0&&(t=[]);const i=b.useRef(null);return b.useEffect(()=>{i.current=null},t),b.useEffect(()=>{const s=e!==Zi;s&&!i.current&&(i.current=e),!s&&i.current&&(i.current=null)},[e]),i.current?Ku(e,i.current):Zi}function p7(e){b.useEffect(()=>{if(!pg)return;const t=e.map(i=>{let{sensor:s}=i;return s.setup==null?void 0:s.setup()});return()=>{for(const i of t)i?.()}},e.map(t=>{let{sensor:i}=t;return i}))}function g7(e,t){return b.useMemo(()=>e.reduce((i,s)=>{let{eventName:o,handler:c}=s;return i[o]=u=>{c(u,t)},i},{}),[e,t])}function HA(e){return b.useMemo(()=>e?BF(e):null,[e])}const TR=[];function m7(e,t){t===void 0&&(t=vc);const[i]=e,s=HA(i?Vr(i):null),[o,c]=b.useState(TR);function u(){c(()=>e.length?e.map(f=>DA(f)?s:new Bb(t(f),f)):TR)}const d=vg({callback:u});return Xi(()=>{d?.disconnect(),u(),e.forEach(f=>d?.observe(f))},[e]),o}function FA(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Sd(t)?t:e}function y7(e){let{measure:t}=e;const[i,s]=b.useState(null),o=b.useCallback(g=>{for(const{target:m}of g)if(Sd(m)){s(h=>{const x=t(m);return h?{...h,width:x.width,height:x.height}:x});break}},[t]),c=vg({callback:o}),u=b.useCallback(g=>{const m=FA(g);c?.disconnect(),m&&c?.observe(m),s(m?t(m):null)},[t,c]),[d,f]=rp(u);return b.useMemo(()=>({nodeRef:d,rect:i,setRef:f}),[i,d,f])}const v7=[{sensor:zA,options:{}},{sensor:Vb,options:{}}],b7={current:{}},Ih={draggable:{measure:vR},droppable:{measure:vR,strategy:qu.WhileDragging,frequency:dv.Optimized},dragOverlay:{measure:vc}};class ju extends Map{get(t){var i;return t!=null&&(i=super.get(t))!=null?i:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:i}=t;return!i})}getNodeFor(t){var i,s;return(i=(s=this.get(t))==null?void 0:s.node.current)!=null?i:void 0}}const x7={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ju,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ap},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ih,measureDroppableContainers:ap,windowRect:null,measuringScheduled:!1},BA={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ap,draggableNodes:new Map,over:null,measureDroppableContainers:ap},Rd=b.createContext(BA),VA=b.createContext(x7);function S7(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ju}}}function w7(e,t){switch(t.type){case ir.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ir.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ir.DragEnd:case ir.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ir.RegisterDroppable:{const{element:i}=t,{id:s}=i,o=new ju(e.droppable.containers);return o.set(s,i),{...e,droppable:{...e.droppable,containers:o}}}case ir.SetDroppableDisabled:{const{id:i,key:s,disabled:o}=t,c=e.droppable.containers.get(i);if(!c||s!==c.key)return e;const u=new ju(e.droppable.containers);return u.set(i,{...c,disabled:o}),{...e,droppable:{...e.droppable,containers:u}}}case ir.UnregisterDroppable:{const{id:i,key:s}=t,o=e.droppable.containers.get(i);if(!o||s!==o.key)return e;const c=new ju(e.droppable.containers);return c.delete(i),{...e,droppable:{...e.droppable,containers:c}}}default:return e}}function E7(e){let{disabled:t}=e;const{active:i,activatorEvent:s,draggableNodes:o}=b.useContext(Rd),c=ip(s),u=ip(i?.id);return b.useEffect(()=>{if(!t&&!s&&c&&u!=null){if(!mg(c)||document.activeElement===c.target)return;const d=o.get(u);if(!d)return;const{activatorNode:f,node:g}=d;if(!f.current&&!g.current)return;requestAnimationFrame(()=>{for(const m of[f.current,g.current]){if(!m)continue;const h=vF(m);if(h){h.focus();break}}})}},[s,t,o,u,c]),null}function KA(e,t){let{transform:i,...s}=t;return e!=null&&e.length?e.reduce((o,c)=>c({transform:o,...s}),i):i}function R7(e){return b.useMemo(()=>({draggable:{...Ih.draggable,...e?.draggable},droppable:{...Ih.droppable,...e?.droppable},dragOverlay:{...Ih.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function C7(e){let{activeNode:t,measure:i,initialRect:s,config:o=!0}=e;const c=b.useRef(!1),{x:u,y:d}=typeof o=="boolean"?{x:o,y:o}:o;Xi(()=>{if(!u&&!d||!t){c.current=!1;return}if(c.current||!s)return;const g=t?.node.current;if(!g||g.isConnected===!1)return;const m=i(g),h=kA(m,s);if(u||(h.x=0),d||(h.y=0),c.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const x=AA(g);x&&x.scrollBy({top:h.y,left:h.x})}},[t,u,d,s,i])}const bg=b.createContext({...Zi,scaleX:1,scaleY:1});var Ia;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ia||(Ia={}));const T7=b.memo(function(t){var i,s,o,c;let{id:u,accessibility:d,autoScroll:f=!0,children:g,sensors:m=v7,collisionDetection:h=IF,measuring:x,modifiers:S,...w}=t;const C=b.useReducer(w7,void 0,S7),[E,R]=C,[k,O]=RF(),[A,N]=b.useState(Ia.Uninitialized),j=A===Ia.Initialized,{draggable:{active:D,nodes:M,translate:_},droppable:{containers:L}}=E,q=D!=null?M.get(D):null,X=b.useRef({initial:null,translated:null}),B=b.useMemo(()=>{var xt;return D!=null?{id:D,data:(xt=q?.data)!=null?xt:b7,rect:X}:null},[D,q]),H=b.useRef(null),[U,z]=b.useState(null),[Q,$]=b.useState(null),K=Vu(w,Object.values(w)),Y=Ed("DndDescribedBy",u),ee=b.useMemo(()=>L.getEnabled(),[L]),G=R7(x),{droppableRects:oe,measureDroppableContainers:I,measuringScheduled:V}=o7(ee,{dragging:j,dependencies:[_.x,_.y],config:G.droppable}),W=s7(M,D),re=b.useMemo(()=>Q?sp(Q):null,[Q]),Ee=ht(),le=l7(W,G.draggable.measure);C7({activeNode:D!=null?M.get(D):null,config:Ee.layoutShiftCompensation,initialRect:le,measure:G.draggable.measure});const me=ER(W,G.draggable.measure,le),ge=ER(W?W.parentElement:null),ue=b.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:oe,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Te=L.getNodeFor((i=ue.current.over)==null?void 0:i.id),ve=y7({measure:G.dragOverlay.measure}),Pe=(s=ve.nodeRef.current)!=null?s:W,Oe=j?(o=ve.rect)!=null?o:me:null,Le=!!(ve.nodeRef.current&&ve.rect),Ve=d7(Le?null:me),ke=HA(Pe?Vr(Pe):null),Ue=f7(j?Te??W:null),be=m7(Ue),He=KA(S,{transform:{x:_.x-Ve.x,y:_.y-Ve.y,scaleX:1,scaleY:1},activatorEvent:Q,active:B,activeNodeRect:me,containerNodeRect:ge,draggingNodeRect:Oe,over:ue.current.over,overlayNodeRect:ve.rect,scrollableAncestors:Ue,scrollableAncestorRects:be,windowRect:ke}),Ze=re?Zl(re,_):null,ot=h7(Ue),de=CR(ot),we=CR(ot,[me]),Ge=Zl(He,de),Me=Oe?UF(Oe,He):null,De=B&&Me?h({active:B,collisionRect:Me,droppableRects:oe,droppableContainers:ee,pointerCoordinates:Ze}):null,bt=TA(De,"id"),[dt,pt]=b.useState(null),Nt=Le?He:Zl(He,we),jt=zF(Nt,(c=dt?.rect)!=null?c:null,me),tn=b.useRef(null),an=b.useCallback((xt,yt)=>{let{sensor:Ut,options:un}=yt;if(H.current==null)return;const je=M.get(H.current);if(!je)return;const st=xt.nativeEvent,Ie=new Ut({active:H.current,activeNode:je,event:st,options:un,context:ue,onAbort($e){if(!M.get($e))return;const{onDragAbort:Tt}=K.current,F={id:$e};Tt?.(F),k({type:"onDragAbort",event:F})},onPending($e,et,Tt,F){if(!M.get($e))return;const{onDragPending:ne}=K.current,ye={id:$e,constraint:et,initialCoordinates:Tt,offset:F};ne?.(ye),k({type:"onDragPending",event:ye})},onStart($e){const et=H.current;if(et==null)return;const Tt=M.get(et);if(!Tt)return;const{onDragStart:F}=K.current,J={activatorEvent:st,active:{id:et,data:Tt.data,rect:X}};fr.unstable_batchedUpdates(()=>{F?.(J),N(Ia.Initializing),R({type:ir.DragStart,initialCoordinates:$e,active:et}),k({type:"onDragStart",event:J}),z(tn.current),$(st)})},onMove($e){R({type:ir.DragMove,coordinates:$e})},onEnd:ze(ir.DragEnd),onCancel:ze(ir.DragCancel)});tn.current=Ie;function ze($e){return async function(){const{active:Tt,collisions:F,over:J,scrollAdjustedTranslate:ne}=ue.current;let ye=null;if(Tt&&ne){const{cancelDrop:xe}=K.current;ye={activatorEvent:st,active:Tt,collisions:F,delta:ne,over:J},$e===ir.DragEnd&&typeof xe=="function"&&await Promise.resolve(xe(ye))&&($e=ir.DragCancel)}H.current=null,fr.unstable_batchedUpdates(()=>{R({type:$e}),N(Ia.Uninitialized),pt(null),z(null),$(null),tn.current=null;const xe=$e===ir.DragEnd?"onDragEnd":"onDragCancel";if(ye){const qe=K.current[xe];qe?.(ye),k({type:xe,event:ye})}})}}},[M]),nn=b.useCallback((xt,yt)=>(Ut,un)=>{const je=Ut.nativeEvent,st=M.get(un);if(H.current!==null||!st||je.dndKit||je.defaultPrevented)return;const Ie={active:st};xt(Ut,yt.options,Ie)===!0&&(je.dndKit={capturedBy:yt.sensor},H.current=un,an(Ut,yt))},[M,an]),We=a7(m,nn);p7(m),Xi(()=>{me&&A===Ia.Initializing&&N(Ia.Initialized)},[me,A]),b.useEffect(()=>{const{onDragMove:xt}=K.current,{active:yt,activatorEvent:Ut,collisions:un,over:je}=ue.current;if(!yt||!Ut)return;const st={active:yt,activatorEvent:Ut,collisions:un,delta:{x:Ge.x,y:Ge.y},over:je};fr.unstable_batchedUpdates(()=>{xt?.(st),k({type:"onDragMove",event:st})})},[Ge.x,Ge.y]),b.useEffect(()=>{const{active:xt,activatorEvent:yt,collisions:Ut,droppableContainers:un,scrollAdjustedTranslate:je}=ue.current;if(!xt||H.current==null||!yt||!je)return;const{onDragOver:st}=K.current,Ie=un.get(bt),ze=Ie&&Ie.rect.current?{id:Ie.id,rect:Ie.rect.current,data:Ie.data,disabled:Ie.disabled}:null,$e={active:xt,activatorEvent:yt,collisions:Ut,delta:{x:je.x,y:je.y},over:ze};fr.unstable_batchedUpdates(()=>{pt(ze),st?.($e),k({type:"onDragOver",event:$e})})},[bt]),Xi(()=>{ue.current={activatorEvent:Q,active:B,activeNode:W,collisionRect:Me,collisions:De,droppableRects:oe,draggableNodes:M,draggingNode:Pe,draggingNodeRect:Oe,droppableContainers:L,over:dt,scrollableAncestors:Ue,scrollAdjustedTranslate:Ge},X.current={initial:Oe,translated:Me}},[B,W,De,Me,M,Pe,Oe,oe,L,dt,Ue,Ge]),n7({...Ee,delta:_,draggingRect:Me,pointerCoordinates:Ze,scrollableAncestors:Ue,scrollableAncestorRects:be});const wt=b.useMemo(()=>({active:B,activeNode:W,activeNodeRect:me,activatorEvent:Q,collisions:De,containerNodeRect:ge,dragOverlay:ve,draggableNodes:M,droppableContainers:L,droppableRects:oe,over:dt,measureDroppableContainers:I,scrollableAncestors:Ue,scrollableAncestorRects:be,measuringConfiguration:G,measuringScheduled:V,windowRect:ke}),[B,W,me,Q,De,ge,ve,M,L,oe,dt,I,Ue,be,G,V,ke]),Zt=b.useMemo(()=>({activatorEvent:Q,activators:We,active:B,activeNodeRect:me,ariaDescribedById:{draggable:Y},dispatch:R,draggableNodes:M,over:dt,measureDroppableContainers:I}),[Q,We,B,me,R,Y,M,dt,I]);return Ne.createElement(CA.Provider,{value:O},Ne.createElement(Rd.Provider,{value:Zt},Ne.createElement(VA.Provider,{value:wt},Ne.createElement(bg.Provider,{value:jt},g)),Ne.createElement(E7,{disabled:d?.restoreFocus===!1})),Ne.createElement(kF,{...d,hiddenTextDescribedById:Y}));function ht(){const xt=U?.autoScrollEnabled===!1,yt=typeof f=="object"?f.enabled===!1:f===!1,Ut=j&&!xt&&!yt;return typeof f=="object"?{...f,enabled:Ut}:{enabled:Ut}}}),k7=b.createContext(null),kR="button",O7="Draggable";function qA(e){let{id:t,data:i,disabled:s=!1,attributes:o}=e;const c=Ed(O7),{activators:u,activatorEvent:d,active:f,activeNodeRect:g,ariaDescribedById:m,draggableNodes:h,over:x}=b.useContext(Rd),{role:S=kR,roleDescription:w="draggable",tabIndex:C=0}=o??{},E=f?.id===t,R=b.useContext(E?bg:k7),[k,O]=rp(),[A,N]=rp(),j=g7(u,t),D=Vu(i);Xi(()=>(h.set(t,{id:t,key:c,node:k,activatorNode:A,data:D}),()=>{const _=h.get(t);_&&_.key===c&&h.delete(t)}),[h,t]);const M=b.useMemo(()=>({role:S,tabIndex:C,"aria-disabled":s,"aria-pressed":E&&S===kR?!0:void 0,"aria-roledescription":w,"aria-describedby":m.draggable}),[s,S,C,E,w,m.draggable]);return{active:f,activatorEvent:d,activeNodeRect:g,attributes:M,isDragging:E,listeners:s?void 0:j,node:k,over:x,setNodeRef:O,setActivatorNodeRef:N,transform:R}}function YA(){return b.useContext(VA)}const A7="Droppable",M7={timeout:25};function GA(e){let{data:t,disabled:i=!1,id:s,resizeObserverConfig:o}=e;const c=Ed(A7),{active:u,dispatch:d,over:f,measureDroppableContainers:g}=b.useContext(Rd),m=b.useRef({disabled:i}),h=b.useRef(!1),x=b.useRef(null),S=b.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:E}={...M7,...o},R=Vu(C??s),k=b.useCallback(()=>{if(!h.current){h.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{g(Array.isArray(R.current)?R.current:[R.current]),S.current=null},E)},[E]),O=vg({callback:k,disabled:w||!u}),A=b.useCallback((M,_)=>{O&&(_&&(O.unobserve(_),h.current=!1),M&&O.observe(M))},[O]),[N,j]=rp(A),D=Vu(t);return b.useEffect(()=>{!O||!N.current||(O.disconnect(),h.current=!1,O.observe(N.current))},[N,O]),b.useEffect(()=>(d({type:ir.RegisterDroppable,element:{id:s,key:c,disabled:i,node:N,rect:x,data:D}}),()=>d({type:ir.UnregisterDroppable,key:c,id:s})),[s]),b.useEffect(()=>{i!==m.current.disabled&&(d({type:ir.SetDroppableDisabled,id:s,key:c,disabled:i}),m.current.disabled=i)},[s,c,i,d]),{active:u,rect:x,isOver:f?.id===s,node:N,over:f,setNodeRef:j}}function N7(e){let{animation:t,children:i}=e;const[s,o]=b.useState(null),[c,u]=b.useState(null),d=ip(i);return!i&&!s&&d&&o(d),Xi(()=>{if(!c)return;const f=s?.key,g=s?.props.id;if(f==null||g==null){o(null);return}Promise.resolve(t(g,c)).then(()=>{o(null)})},[t,s,c]),Ne.createElement(Ne.Fragment,null,i,s?b.cloneElement(s,{ref:u}):null)}const D7={x:0,y:0,scaleX:1,scaleY:1};function j7(e){let{children:t}=e;return Ne.createElement(Rd.Provider,{value:BA},Ne.createElement(bg.Provider,{value:D7},t))}const I7={position:"fixed",touchAction:"none"},P7=e=>mg(e)?"transform 250ms ease":void 0,L7=b.forwardRef((e,t)=>{let{as:i,activatorEvent:s,adjustScale:o,children:c,className:u,rect:d,style:f,transform:g,transition:m=P7}=e;if(!d)return null;const h=o?g:{...g,scaleX:1,scaleY:1},x={...I7,width:d.width,height:d.height,top:d.top,left:d.left,transform:qa.Transform.toString(h),transformOrigin:o&&s?AF(s,d):void 0,transition:typeof m=="function"?m(s):m,...f};return Ne.createElement(i,{className:u,style:x,ref:t},c)}),z7=e=>t=>{let{active:i,dragOverlay:s}=t;const o={},{styles:c,className:u}=e;if(c!=null&&c.active)for(const[d,f]of Object.entries(c.active))f!==void 0&&(o[d]=i.node.style.getPropertyValue(d),i.node.style.setProperty(d,f));if(c!=null&&c.dragOverlay)for(const[d,f]of Object.entries(c.dragOverlay))f!==void 0&&s.node.style.setProperty(d,f);return u!=null&&u.active&&i.node.classList.add(u.active),u!=null&&u.dragOverlay&&s.node.classList.add(u.dragOverlay),function(){for(const[f,g]of Object.entries(o))i.node.style.setProperty(f,g);u!=null&&u.active&&i.node.classList.remove(u.active)}},_7=e=>{let{transform:{initial:t,final:i}}=e;return[{transform:qa.Transform.toString(t)},{transform:qa.Transform.toString(i)}]},U7={duration:250,easing:"ease",keyframes:_7,sideEffects:z7({styles:{active:{opacity:"0"}}})};function H7(e){let{config:t,draggableNodes:i,droppableContainers:s,measuringConfiguration:o}=e;return gg((c,u)=>{if(t===null)return;const d=i.get(c);if(!d)return;const f=d.node.current;if(!f)return;const g=FA(u);if(!g)return;const{transform:m}=Vr(u).getComputedStyle(u),h=OA(m);if(!h)return;const x=typeof t=="function"?t:F7(t);return PA(f,o.draggable.measure),x({active:{id:c,data:d.data,node:f,rect:o.draggable.measure(f)},draggableNodes:i,dragOverlay:{node:u,rect:o.dragOverlay.measure(g)},droppableContainers:s,measuringConfiguration:o,transform:h})})}function F7(e){const{duration:t,easing:i,sideEffects:s,keyframes:o}={...U7,...e};return c=>{let{active:u,dragOverlay:d,transform:f,...g}=c;if(!t)return;const m={x:d.rect.left-u.rect.left,y:d.rect.top-u.rect.top},h={scaleX:f.scaleX!==1?u.rect.width*f.scaleX/d.rect.width:1,scaleY:f.scaleY!==1?u.rect.height*f.scaleY/d.rect.height:1},x={x:f.x-m.x,y:f.y-m.y,...h},S=o({...g,active:u,dragOverlay:d,transform:{initial:f,final:x}}),[w]=S,C=S[S.length-1];if(JSON.stringify(w)===JSON.stringify(C))return;const E=s?.({active:u,dragOverlay:d,...g}),R=d.node.animate(S,{duration:t,easing:i,fill:"forwards"});return new Promise(k=>{R.onfinish=()=>{E?.(),k()}})}}let OR=0;function B7(e){return b.useMemo(()=>{if(e!=null)return OR++,OR},[e])}const V7=Ne.memo(e=>{let{adjustScale:t=!1,children:i,dropAnimation:s,style:o,transition:c,modifiers:u,wrapperElement:d="div",className:f,zIndex:g=999}=e;const{activatorEvent:m,active:h,activeNodeRect:x,containerNodeRect:S,draggableNodes:w,droppableContainers:C,dragOverlay:E,over:R,measuringConfiguration:k,scrollableAncestors:O,scrollableAncestorRects:A,windowRect:N}=YA(),j=b.useContext(bg),D=B7(h?.id),M=KA(u,{activatorEvent:m,active:h,activeNodeRect:x,containerNodeRect:S,draggingNodeRect:E.rect,over:R,overlayNodeRect:E.rect,scrollableAncestors:O,scrollableAncestorRects:A,transform:j,windowRect:N}),_=qb(x),L=H7({config:s,draggableNodes:w,droppableContainers:C,measuringConfiguration:k}),q=_?E.setRef:void 0;return Ne.createElement(j7,null,Ne.createElement(N7,{animation:L},h&&D?Ne.createElement(L7,{key:D,id:h.id,ref:q,as:d,activatorEvent:m,adjustScale:t,className:f,transition:c,rect:_,style:{zIndex:g,...o},transform:M},i):null))});function Yb(e,t,i){const s=e.slice();return s.splice(i<0?s.length+i:i,0,s.splice(t,1)[0]),s}function K7(e,t){return e.reduce((i,s,o)=>{const c=t.get(s);return c&&(i[o]=c),i},Array(e.length))}function gh(e){return e!==null&&e>=0}function q7(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}function Y7(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const $A=e=>{let{rects:t,activeIndex:i,overIndex:s,index:o}=e;const c=Yb(t,s,i),u=t[o],d=c[o];return!d||!u?null:{x:d.left-u.left,y:d.top-u.top,scaleX:d.width/u.width,scaleY:d.height/u.height}},mh={scaleX:1,scaleY:1},G7=e=>{var t;let{activeIndex:i,activeNodeRect:s,index:o,rects:c,overIndex:u}=e;const d=(t=c[i])!=null?t:s;if(!d)return null;if(o===i){const g=c[u];return g?{x:0,y:i<u?g.top+g.height-(d.top+d.height):g.top-d.top,...mh}:null}const f=$7(c,o,i);return o>i&&o<=u?{x:0,y:-d.height-f,...mh}:o<i&&o>=u?{x:0,y:d.height+f,...mh}:{x:0,y:0,...mh}};function $7(e,t,i){const s=e[t],o=e[t-1],c=e[t+1];return s?i<t?o?s.top-(o.top+o.height):c?c.top-(s.top+s.height):0:c?c.top-(s.top+s.height):o?s.top-(o.top+o.height):0:0}const QA="Sortable",XA=Ne.createContext({activeIndex:-1,containerId:QA,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$A,disabled:{draggable:!1,droppable:!1}});function Q7(e){let{children:t,id:i,items:s,strategy:o=$A,disabled:c=!1}=e;const{active:u,dragOverlay:d,droppableRects:f,over:g,measureDroppableContainers:m}=YA(),h=Ed(QA,i),x=d.rect!==null,S=b.useMemo(()=>s.map(j=>typeof j=="object"&&"id"in j?j.id:j),[s]),w=u!=null,C=u?S.indexOf(u.id):-1,E=g?S.indexOf(g.id):-1,R=b.useRef(S),k=!q7(S,R.current),O=E!==-1&&C===-1||k,A=Y7(c);Xi(()=>{k&&w&&m(S)},[k,S,w,m]),b.useEffect(()=>{R.current=S},[S]);const N=b.useMemo(()=>({activeIndex:C,containerId:h,disabled:A,disableTransforms:O,items:S,overIndex:E,useDragOverlay:x,sortedRects:K7(S,f),strategy:o}),[C,h,A.draggable,A.droppable,O,S,E,f,x,o]);return Ne.createElement(XA.Provider,{value:N},t)}const X7=e=>{let{id:t,items:i,activeIndex:s,overIndex:o}=e;return Yb(i,s,o).indexOf(t)},Z7=e=>{let{containerId:t,isSorting:i,wasDragging:s,index:o,items:c,newIndex:u,previousItems:d,previousContainerId:f,transition:g}=e;return!g||!s||d!==c&&o===u?!1:i?!0:u!==o&&t===f},J7={duration:200,easing:"ease"},ZA="transform",W7=qa.Transition.toString({property:ZA,duration:0,easing:"linear"}),e9={roleDescription:"sortable"};function t9(e){let{disabled:t,index:i,node:s,rect:o}=e;const[c,u]=b.useState(null),d=b.useRef(i);return Xi(()=>{if(!t&&i!==d.current&&s.current){const f=o.current;if(f){const g=vc(s.current,{ignoreTransform:!0}),m={x:f.left-g.left,y:f.top-g.top,scaleX:f.width/g.width,scaleY:f.height/g.height};(m.x||m.y)&&u(m)}}i!==d.current&&(d.current=i)},[t,i,s,o]),b.useEffect(()=>{c&&u(null)},[c]),c}function n9(e){let{animateLayoutChanges:t=Z7,attributes:i,disabled:s,data:o,getNewIndex:c=X7,id:u,strategy:d,resizeObserverConfig:f,transition:g=J7}=e;const{items:m,containerId:h,activeIndex:x,disabled:S,disableTransforms:w,sortedRects:C,overIndex:E,useDragOverlay:R,strategy:k}=b.useContext(XA),O=r9(s,S),A=m.indexOf(u),N=b.useMemo(()=>({sortable:{containerId:h,index:A,items:m},...o}),[h,o,A,m]),j=b.useMemo(()=>m.slice(m.indexOf(u)),[m,u]),{rect:D,node:M,isOver:_,setNodeRef:L}=GA({id:u,data:N,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...f}}),{active:q,activatorEvent:X,activeNodeRect:B,attributes:H,setNodeRef:U,listeners:z,isDragging:Q,over:$,setActivatorNodeRef:K,transform:Y}=qA({id:u,data:N,attributes:{...e9,...i},disabled:O.draggable}),ee=pF(L,U),G=!!q,oe=G&&!w&&gh(x)&&gh(E),I=!R&&Q,V=I&&oe?Y:null,re=oe?V??(d??k)({rects:C,activeNodeRect:B,activeIndex:x,overIndex:E,index:A}):null,Ee=gh(x)&&gh(E)?c({id:u,items:m,activeIndex:x,overIndex:E}):A,le=q?.id,me=b.useRef({activeId:le,items:m,newIndex:Ee,containerId:h}),ge=m!==me.current.items,ue=t({active:q,containerId:h,isDragging:Q,isSorting:G,id:u,index:A,items:m,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:g,wasDragging:me.current.activeId!=null}),Te=t9({disabled:!ue,index:A,node:M,rect:D});return b.useEffect(()=>{G&&me.current.newIndex!==Ee&&(me.current.newIndex=Ee),h!==me.current.containerId&&(me.current.containerId=h),m!==me.current.items&&(me.current.items=m)},[G,Ee,h,m]),b.useEffect(()=>{if(le===me.current.activeId)return;if(le!=null&&me.current.activeId==null){me.current.activeId=le;return}const Pe=setTimeout(()=>{me.current.activeId=le},50);return()=>clearTimeout(Pe)},[le]),{active:q,activeIndex:x,attributes:H,data:N,rect:D,index:A,newIndex:Ee,items:m,isOver:_,isSorting:G,isDragging:Q,listeners:z,node:M,overIndex:E,over:$,setNodeRef:ee,setActivatorNodeRef:K,setDroppableNodeRef:L,setDraggableNodeRef:U,transform:Te??re,transition:ve()};function ve(){if(Te||ge&&me.current.newIndex===A)return W7;if(!(I&&!mg(X)||!g)&&(G||ue))return qa.Transition.toString({...g,property:ZA})}}function r9(e,t){var i,s;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(i=e?.draggable)!=null?i:t.draggable,droppable:(s=e?.droppable)!=null?s:t.droppable}}function lp(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const i9=[en.Down,en.Right,en.Up,en.Left],s9=(e,t)=>{let{context:{active:i,collisionRect:s,droppableRects:o,droppableContainers:c,over:u,scrollableAncestors:d}}=t;if(i9.includes(e.code)){if(e.preventDefault(),!i||!s)return;const f=[];c.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const x=o.get(h.id);if(x)switch(e.code){case en.Down:s.top<x.top&&f.push(h);break;case en.Up:s.top>x.top&&f.push(h);break;case en.Left:s.left>x.left&&f.push(h);break;case en.Right:s.left<x.left&&f.push(h);break}});const g=DF({collisionRect:s,droppableRects:o,droppableContainers:f});let m=TA(g,"id");if(m===u?.id&&g.length>1&&(m=g[1].id),m!=null){const h=c.get(i.id),x=c.get(m),S=x?o.get(x.id):null,w=x?.node.current;if(w&&S&&h&&x){const E=yg(w).some((j,D)=>d[D]!==j),R=JA(h,x),k=a9(h,x),O=E||!R?{x:0,y:0}:{x:k?s.width-S.width:0,y:k?s.height-S.height:0},A={x:S.left,y:S.top};return O.x&&O.y?A:Ku(A,O)}}}};function JA(e,t){return!lp(e)||!lp(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function a9(e,t){return!lp(e)||!lp(t)||!JA(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Gs({className:e,size:t="default",...i}){return v.jsx("div",{"data-slot":"card","data-size":t,className:Fe("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),...i})}function o9({className:e,...t}){return v.jsx("div",{"data-slot":"card-header",className:Fe("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),...t})}function l9({className:e,...t}){return v.jsx("div",{"data-slot":"card-content",className:Fe("px-(--card-spacing)",e),...t})}const WA=b.createContext(void 0);function c9(){const e=b.useContext(WA);if(e===void 0)throw new Error(gn(63));return e}const u9="data-checked",d9="data-unchecked",eM={...hc,checked(e){return e?{[u9]:""}:{[d9]:""}}},f9=b.forwardRef(function(t,i){const{checked:s,className:o,defaultChecked:c,"aria-labelledby":u,form:d,id:f,inputRef:g,name:m,nativeButton:h=!1,onCheckedChange:x,readOnly:S=!1,required:w=!1,disabled:C=!1,render:E,uncheckedValue:R,value:k,style:O,...A}=t,{clearErrors:N}=yd(),{state:j,setTouched:D,setDirty:M,validityData:_,setFilled:L,validationMode:q,disabled:X,name:B,validation:H}=ra(),{labelId:U}=Yo(),z=X||C,Q=B??m,$=b.useRef(null),K=Wr($,g,H.inputRef),Y=b.useRef(null),ee=vd(z,Y),G=ar(),oe=pc({id:f}),I=h?void 0:oe,[V,W]=Js({controlled:s,default:!!c,name:"Switch",state:"checked"});bd(Y,G,V,void 0,!z,m),_e(()=>{L(V)},[V,L]),cc(V,()=>{N(Q),M(V!==_.initialValue),H.change(V)});const{getButtonProps:re,buttonRef:Ee}=vi({disabled:z,native:h}),le=Lb(u,U,$,!h,I,A["aria-label"]),me={id:h?oe:G,role:"switch","aria-checked":V,"aria-readonly":S||void 0,"aria-required":w||void 0,"aria-labelledby":le,onFocus(){ee(!0)},onBlur(){const ve=$.current;!ve||z||(D(!0),ee(!1),q==="onBlur"&&H.commit(ve.checked))},onClick(ve){if(S||z)return;ve.preventDefault();const Pe=$.current;Pe&&No(Pe,ve)}},ge={...H.getValidationProps(z),checked:V,disabled:z,form:d,id:I,name:Q,required:w,style:Q?Cp:nd,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:K,onChange(ve){if(ve.nativeEvent.defaultPrevented)return;if(S){ve.preventDefault();return}const Pe=ve.currentTarget.checked,Oe=ut(Mr,ve.nativeEvent);x?.(Pe,Oe),!Oe.isCanceled&&W(Pe)},onClick(ve){ve.stopPropagation()},onFocus(){Y.current?.focus()},...k!==void 0?{value:k}:Xt},ue=b.useMemo(()=>({...j,checked:V,disabled:z,readOnly:S,required:w}),[j,V,z,S,w]),Te=kt("span",t,{state:ue,ref:[i,Y,Ee],props:[me,A,re,ve=>H.getValidationProps(z,ve)],stateAttributesMapping:eM});return v.jsxs(WA.Provider,{value:ue,children:[Te,!V&&Q&&R!==void 0&&v.jsx("input",{type:"hidden",form:d,name:Q,value:R,disabled:z}),v.jsx("input",{...ge,suppressHydrationWarning:!0})]})}),h9=b.forwardRef(function(t,i){const{render:s,className:o,style:c,...u}=t,d=c9();return kt("span",t,{state:d,ref:i,stateAttributesMapping:eM,props:u})});function p9({className:e,...t}){return v.jsx(f9,{"data-slot":"switch",className:Fe(`
70
- peer relative inline-flex h-4 w-7 shrink-0 items-center rounded-full
71
- border border-transparent bg-input p-0.5 transition-colors outline-none
72
- focus-visible:border-ring focus-visible:ring-2
73
- focus-visible:ring-ring/30 disabled:cursor-not-allowed
74
- disabled:opacity-50 data-checked:bg-primary
75
- `,e),...t,children:v.jsx(h9,{"data-slot":"switch-thumb",className:`
76
- pointer-events-none block size-3 rounded-full bg-background shadow-sm
77
- transition-transform data-checked:translate-x-3
78
- `})})}function g9(e){return`library:${e}`}function tM(e,t){return`assigned:${e}:${t}`}function nM(e){return`agent:${e}`}function m9(e){return String(e).startsWith("assigned:")}function fv(e){return Gb(e)&&e.type==="library-instruction"&&typeof e.instructionId=="string"}function Jl(e){return Gb(e)&&e.type==="assigned-instruction"&&typeof e.agentId=="string"&&typeof e.instructionId=="string"}function AR(e){return Gb(e)&&e.type==="agent"&&typeof e.agentId=="string"}function Gb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const y9="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",v9='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenAI</title><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></svg>',b9="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",x9='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Claude Code</title><path clip-rule="evenodd" d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z"></path></svg>',S9={openai:{src:y9,monochromeSvg:v9,invertInDark:!0},claudecode:{src:b9,monochromeSvg:x9,invertInDark:!1}};function rM({icon:e,monochrome:t=!1,className:i}){const s=S9[e];return v.jsx("div",{"aria-hidden":"true",className:Fe(`
79
- flex size-8 shrink-0 items-center justify-center rounded-md bg-muted
80
- text-foreground
81
- `,t&&"text-muted-foreground",i),children:s?v.jsxs(v.Fragment,{children:[v.jsx("span",{hidden:!t,className:`
82
- size-4
83
- [&_svg]:size-full
84
- `,dangerouslySetInnerHTML:{__html:s.monochromeSvg}}),v.jsx("img",{hidden:t,src:s.src,alt:"",draggable:!1,className:Fe("size-4",s.invertInDark&&"dark:invert")})]}):v.jsx(cT,{className:"size-4"})})}function w9({agent:e,instructionsById:t,isInstructionsLoading:i,isPending:s,isReapplying:o,onRemoveInstruction:c,onToggle:u,onReapply:d,onOpenFile:f}){const{t:g}=mt(),{isOver:m,setNodeRef:h}=GA({id:nM(e.id),data:{type:"agent",agentId:e.id},disabled:s}),x=e.enabled||e.instructionIds.length>0,S=e.enabled?g("agents.reapplyHint"):g("agents.reapplyDisabledHint"),w=g(x?e.enabled?"agents.toggleOnHint":"agents.toggleOffHint":"agents.enableRequiresInstruction");return v.jsxs(Gs,{"data-agent-id":e.id,ref:h,className:Fe("gap-0 py-0 transition-shadow",m&&"ring-2 ring-ring/40"),children:[v.jsxs("div",{className:"flex items-center gap-3 p-3",children:[v.jsx(rM,{icon:e.icon}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),v.jsx("button",{type:"button",className:`
85
- block max-w-full truncate font-mono text-[11px]
86
- text-muted-foreground
87
- hover:text-foreground hover:underline
88
- `,"aria-label":g("agents.openFileAria",{name:e.name}),onClick:()=>{f(e.id)},children:e.instructionFile})]}),v.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[v.jsxs(Qh,{children:[v.jsx(Xh,{render:v.jsx("span",{className:"inline-flex"}),children:v.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":g("agents.reapplyAria",{name:e.name}),disabled:s||!e.enabled,onClick:()=>{d(e.id)},children:v.jsx(bL,{className:Fe(o&&"animate-spin")})})}),v.jsx(Zh,{children:S})]}),v.jsxs(Qh,{children:[v.jsx(Xh,{render:v.jsx("span",{className:"inline-flex"}),children:v.jsx(p9,{checked:e.enabled,disabled:s||!x,"aria-label":g("agents.toggleAria",{name:e.name}),onCheckedChange:C=>{u(e.id,C)}})}),v.jsx(Zh,{children:w})]})]})]}),v.jsx("div",{className:"border-t border-border/60 p-3",children:e.instructionIds.length===0?v.jsx("div",{className:`
89
- flex min-h-20 items-center justify-center rounded-md border
90
- border-dashed border-border px-4 text-center text-xs
91
- text-muted-foreground
92
- `,children:g("agents.emptyAssigned")}):v.jsx(Q7,{items:e.instructionIds.map(C=>tM(e.id,C)),strategy:G7,children:v.jsx("ol",{className:"flex flex-col gap-1",children:e.instructionIds.map((C,E)=>{const R=t.get(C),k=R?.name??C;return v.jsx(E9,{agentId:e.id,index:E,instructionId:C,instructionName:i&&!R?g("agents.loadingInstruction"):k,isPending:s,onRemove:c},C)})})})})]})}function E9({agentId:e,index:t,instructionId:i,instructionName:s,isPending:o,onRemove:c}){const{t:u}=mt(),{attributes:d,isDragging:f,isOver:g,listeners:m,setNodeRef:h,transform:x,transition:S}=n9({id:tM(e,i),animateLayoutChanges:()=>!1,data:{type:"assigned-instruction",agentId:e,instructionId:i},disabled:o});return v.jsxs("li",{...d,...m,ref:h,"data-instruction-id":i,style:{transform:qa.Transform.toString(x),transition:S},className:Fe(`
93
- group flex items-center gap-2 rounded-md border border-transparent
94
- bg-muted/40 px-2 py-1.5
95
- `,g&&"border-ring bg-muted",f&&"z-10",o?"cursor-default":`
96
- cursor-grab
97
- active:cursor-grabbing
98
- `),children:[v.jsx(eb,{"aria-hidden":"true",className:`
99
- size-3.5 shrink-0 text-muted-foreground
100
- group-active:cursor-grabbing
101
- `}),v.jsx("span",{className:`
102
- w-4 shrink-0 text-center font-mono text-[10px] text-muted-foreground
103
- `,children:t+1}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:s}),v.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":u("agents.removeInstructionAria",{name:s}),disabled:o,onClick:()=>{c(e,i)},onKeyDown:w=>{w.stopPropagation()},onPointerDown:w=>{w.stopPropagation()},children:v.jsx(ta,{})})]})}const iM="/api/agents";class sM extends Error{constructor(t,i){super(i),this.code=t,this.name="AgentApiError"}code}function R9(e){return Cd(iM,{signal:e})}function C9(e,t){return Cd(xg(e,"instructions"),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({instructionIds:t})})}function T9(e,t){return Cd(xg(e,"enabled"),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})})}function k9(e){return Cd(xg(e,"reapply"),{method:"POST"})}function O9(e){return Cd(xg(e,"open-file"),{method:"POST"})}function xg(e,t){return`${iM}/${encodeURIComponent(e)}/${t}`}async function Cd(e,t){const i=await fetch(e,t);if(!i.ok){const s=await A9(i);throw new sM(s.code,s.message)}return i.json()}async function A9(e){try{const t=await e.json();return{code:t.error?.code??"AGENT_REQUEST_FAILED",message:t.error?.message??`Request failed with status ${e.status}`}}catch{return{code:"AGENT_REQUEST_FAILED",message:`Request failed with status ${e.status}`}}}const Ur=["agents"],yh=["agents","update"];function M9(){const{t:e}=mt(),t=Br(),i=$a({queryKey:Ur,queryFn:({signal:h})=>R9(h),retry:!1});function s(h){t.setQueryData(Ur,x=>x?.map(S=>S.id===h.id?h:S))}const o=sr({mutationKey:yh,mutationFn:({agentId:h,instructionIds:x})=>C9(h,x),onMutate:async({previous:h})=>(await t.cancelQueries({queryKey:Ur}),{previous:h}),onError:(h,x,S)=>{S?.previous&&t.setQueryData(Ur,S.previous),Qt.error(e("agents.updateError"))},onSuccess:s,onSettled:()=>t.invalidateQueries({queryKey:Ur})}),c=sr({mutationKey:yh,mutationFn:({agentId:h,enabled:x})=>T9(h,x),onMutate:async({agentId:h,enabled:x})=>{await t.cancelQueries({queryKey:Ur});const S=t.getQueryData(Ur);return t.setQueryData(Ur,w=>w?.map(C=>C.id===h?{...C,enabled:x}:C)),{previous:S}},onError:(h,x,S)=>{S?.previous&&t.setQueryData(Ur,S.previous),Qt.error(e("agents.enableError"))},onSuccess:h=>{s(h),Qt.success(e(h.enabled?"agents.applied":"agents.removed"))},onSettled:()=>t.invalidateQueries({queryKey:Ur})}),u=sr({mutationKey:yh,mutationFn:h=>k9(h),onSuccess:h=>{s(h),Qt.success(e("agents.reapplied"))},onError:()=>{Qt.error(e("agents.reapplyError"))},onSettled:()=>t.invalidateQueries({queryKey:Ur})}),d=sr({mutationKey:yh,mutationFn:h=>O9(h),onError:h=>{Qt.error(e(h instanceof sM&&h.code==="AGENT_FILE_NOT_FOUND"?"agents.fileMissing":"agents.openFileError"))}}),f=[o,c,u,d],g=new Set;for(const h of f){if(!h.isPending)continue;const x=N9(h.variables);x&&g.add(x)}const m=new Set(u.isPending&&typeof u.variables=="string"?[u.variables]:[]);return{agents:i.data??[],isLoading:i.isPending,isError:i.isError&&i.data===void 0,retry:i.refetch,pendingAgentIds:g,reapplyingAgentIds:m,updateInstructions:(h,x)=>{const S=t.getQueryData(Ur);t.setQueryData(Ur,w=>w?.map(C=>C.id===h?{...C,instructionIds:x,enabled:x.length>0&&C.enabled}:C)),o.mutate({agentId:h,instructionIds:x,previous:S})},setEnabled:(h,x)=>{c.mutate({agentId:h,enabled:x})},reapply:h=>{u.mutate(h)},openFile:h=>{d.mutate(h)}}}function N9(e){if(typeof e=="string")return e;if(e&&typeof e=="object"&&"agentId"in e){const t=e.agentId;return typeof t=="string"?t:void 0}}function Yu({className:e,description:t,icon:i,title:s}){let o=null;return t!=null&&(o=v.jsx("p",{className:"max-w-64 text-xs/relaxed text-muted-foreground",children:t})),v.jsxs("div",{"data-slot":"empty",className:Fe(`
104
- flex w-full flex-1 flex-col items-center justify-center gap-2 px-4
105
- py-10 text-center
106
- `,e),children:[i&&v.jsx("div",{className:`
107
- flex size-8 items-center justify-center rounded-md bg-muted
108
- text-muted-foreground
109
- `,children:v.jsx(i,{"aria-hidden":"true",className:"size-4"})}),v.jsx("div",{className:"text-sm font-medium",children:s}),o]})}function D9(e){const[t,i]=b.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),s=b.useRef(null),o=b.useRef(null),c=b.useRef(null),u=b.useRef(null),d=b.useRef(!0),f=b.useRef(null),g=ac(),m=b.useMemo(()=>({anchor:t,setAnchor:i,actionsRef:c,backdropRef:s,internalBackdropRef:o,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:g}),[t,g]);return v.jsx(PO.Provider,{value:m,children:v.jsx(lg.Provider,{value:void 0,children:v.jsx(JO,{...e})})})}const MR=500,j9=b.forwardRef(function(t,i){const{render:s,className:o,style:c,...u}=t,{setAnchor:d,actionsRef:f,internalBackdropRef:g,backdropRef:m,positionerRef:h,allowMouseUpTriggerRef:x,initialCursorPointRef:S,rootId:w}=cg(!1),{store:C}=na(!1),E=C.useState("open"),R=C.useState("disabled"),k=b.useRef(null),O=b.useRef(null),A=Un(),N=Un(),j=b.useRef(!1),D=b.useRef(null);function M(U,z,Q){const $=Q.type.startsWith("touch");S.current={x:U,y:z},d({getBoundingClientRect(){return DOMRect.fromRect({width:$?10:0,height:$?10:0,x:U,y:z})}}),j.current=!1,f.current?.setOpen(!0,ut(Qi,Q)),N.start(MR,()=>{j.current=!0})}function _(U){if(R)return;x.current=!0,Yi(U),M(U.clientX,U.clientY,U.nativeEvent);const z=$t(k.current);D.current?.abort();const Q=new AbortController;D.current=Q,z.addEventListener("mouseup",$=>{if(x.current=!1,!j.current)return;N.clear(),j.current=!1;const K=tr($);it(h.current,K)||w&&K&&Ib(K)===w||f.current?.setOpen(!1,ut(Av,$))},{once:!0,signal:Q.signal})}function L(){A.clear(),O.current=null}function q(U){if(R){L();return}if(x.current=!1,U.touches.length!==1){L();return}U.stopPropagation();const z=U.touches[0],Q={x:z.clientX,y:z.clientY};O.current=Q,A.start(MR,()=>{M(Q.x,Q.y,U.nativeEvent)})}function X(U){if(U.touches.length!==1){L();return}if(A.isStarted()&&O.current){const z=U.touches[0],Q=10,$=Math.abs(z.clientX-O.current.x),K=Math.abs(z.clientY-O.current.y);($>Q||K>Q)&&L()}}return b.useEffect(()=>()=>{D.current?.abort()},[]),b.useEffect(()=>{function U(Q){if(R)return;const K=tr(Q);(it(k.current,K)||it(g.current,K)||it(m.current,K))&&Q.preventDefault()}const z=$t(k.current);return Lt(z,"contextmenu",U)},[m,R,g]),kt("div",t,{state:{open:E},ref:[k,i],props:[{onContextMenu:_,onTouchStart:q,onTouchMove:X,onTouchEnd:L,onTouchCancel:L,style:{WebkitTouchCallout:"none"}},u],stateAttributesMapping:zu})}),I9=GO;function Sg({...e}){return v.jsx(D9,{"data-slot":"context-menu",...e})}function wg({className:e,...t}){return v.jsx(j9,{"data-slot":"context-menu-trigger",className:Fe("select-none",e),...t})}function Eg({className:e,align:t="start",alignOffset:i=4,side:s="right",sideOffset:o=0,...c}){return v.jsx(qO,{children:v.jsx(I9,{className:"isolate z-50 outline-none",align:t,alignOffset:i,side:s,sideOffset:o,children:v.jsx(VO,{"data-slot":"context-menu-content",className:Fe("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),...c})})})}function Rg({className:e,inset:t,variant:i="default",...s}){return v.jsx(BO,{"data-slot":"context-menu-item","data-inset":t,"data-variant":i,className:Fe("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),...s})}function P9({instructions:e,isLoading:t,isError:i,onRetry:s,onEdit:o,onDelete:c,onPreload:u}){const{t:d}=mt();return t?v.jsx(Gs,{className:"gap-0 py-0",children:v.jsx("div",{className:"divide-y",children:[0,1,2].map(f=>v.jsxs("div",{className:"flex items-center gap-2 p-3",children:[v.jsx(Er,{className:"size-3.5 rounded-sm"}),v.jsx(Er,{className:"h-4 w-2/3"})]},f))})}):i?v.jsxs(Gs,{className:"items-start gap-3 p-4",children:[v.jsx("p",{className:"text-xs text-muted-foreground",children:d("instructions.loadError")}),v.jsxs(at,{type:"button",variant:"outline",onClick:s,children:[v.jsx(JT,{}),v.jsx("span",{children:d("common.retry")})]})]}):e.length===0?v.jsx(Gs,{className:"gap-0 py-0",children:v.jsx(Yu,{icon:Wv,title:d("instructions.emptyTitle"),description:d("instructions.emptyDescription")})}):v.jsx(Gs,{className:"gap-0 py-0",children:v.jsx("ul",{"aria-label":d("instructions.listAria"),className:"divide-y",children:e.map(f=>v.jsx(L9,{instruction:f,onRequestDelete:()=>c(f),onEdit:()=>{o(f)},onPreload:u},f.id))})})}function L9({instruction:e,onEdit:t,onPreload:i,onRequestDelete:s}){const{t:o}=mt(),{attributes:c,isDragging:u,listeners:d,setNodeRef:f}=qA({id:g9(e.id),data:{type:"library-instruction",instructionId:e.id}});return v.jsxs(Sg,{children:[v.jsxs(wg,{ref:f,render:v.jsx("li",{...d,"data-instruction-id":e.id,className:Fe(`
110
- group flex cursor-grab items-center gap-2 py-2.5 pr-1 pl-3
111
- hover:bg-muted/40
112
- active:cursor-grabbing
113
- `,u&&"opacity-40")}),children:[v.jsx(eb,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),v.jsx("button",{...c,type:"button",className:`
114
- flex min-w-0 flex-1 cursor-grab items-center gap-2 text-left text-xs
115
- outline-none
116
- focus-visible:underline focus-visible:underline-offset-3
117
- active:cursor-grabbing
118
- `,onClick:t,onFocus:i,onPointerEnter:i,children:v.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.name})}),v.jsxs(Vo,{children:[v.jsx(Ko,{render:v.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":o("instructions.actionsAria",{name:e.name}),className:`
119
- -my-1.5 shrink-0 text-muted-foreground opacity-0
120
- transition-opacity
121
- group-hover:opacity-100
122
- focus-visible:opacity-100
123
- data-popup-open:opacity-100
124
- [@media(hover:none)]:opacity-100
125
- `,onKeyDown:g=>{g.stopPropagation()},onMouseDown:g=>{g.stopPropagation()},onPointerDown:g=>{g.stopPropagation()},onTouchStart:g=>{g.stopPropagation()}}),children:v.jsx(Jv,{})}),v.jsx(qo,{align:"end",className:"w-40",children:v.jsx(NR,{Item:fc,onDelete:s,onEdit:t})})]})]}),v.jsx(Eg,{children:v.jsx(NR,{Item:Rg,onDelete:s,onEdit:t})})]})}function NR({Item:e,onEdit:t,onDelete:i}){const{t:s}=mt();return v.jsxs(v.Fragment,{children:[v.jsxs(e,{onClick:t,children:[v.jsx($T,{}),v.jsx("span",{children:s("instructions.edit")})]}),v.jsxs(e,{variant:"destructive",onClick:i,children:[v.jsx(nb,{}),v.jsx("span",{children:s("instructions.delete")})]})]})}function aM({className:e,...t}){return v.jsx("label",{"data-slot":"label",className:Fe("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),...t})}function Ws({children:e,className:t,...i}){return v.jsxs(aM,{className:Fe("gap-1",t),...i,children:[e,v.jsx("span",{"aria-hidden":"true",className:"text-destructive",children:"*"})]})}function Rs({...e}){return v.jsx(pA,{"data-slot":"dialog",...e})}function z9({...e}){return v.jsx(hA,{"data-slot":"dialog-portal",...e})}function Td({...e}){return v.jsx(fg,{"data-slot":"dialog-close",...e})}function _9({className:e,...t}){return v.jsx(cA,{"data-slot":"dialog-overlay",className:Fe("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),...t})}function Cs({className:e,children:t,showCloseButton:i=!0,...s}){return v.jsxs(z9,{children:[v.jsx(_9,{}),v.jsxs(fA,{"data-slot":"dialog-content",className:Fe("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),...s,children:[t,i&&v.jsxs(fg,{"data-slot":"dialog-close",render:v.jsx(at,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ji({className:e,...t}){return v.jsx("div",{"data-slot":"dialog-header",className:Fe("flex flex-col gap-1",e),...t})}function bs({className:e,showCloseButton:t=!1,children:i,...s}){return v.jsxs("div",{"data-slot":"dialog-footer",className:Fe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...s,children:[i,t&&v.jsx(fg,{render:v.jsx(at,{variant:"outline"}),children:"Close"})]})}function Wi({className:e,...t}){return v.jsx(gA,{"data-slot":"dialog-title",className:Fe("font-heading text-sm font-medium",e),...t})}function xs({className:e,...t}){return v.jsx(uA,{"data-slot":"dialog-description",className:Fe("text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const $b="/api/instructions";class oM extends Error{constructor(t,i){super(i),this.code=t,this.name="InstructionApiError"}code}function U9(e){return Qb($b,{signal:e})}function H9(e){return Qb($b,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function F9(e,t){return Qb(lM(e),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}async function B9(e){const t=await fetch(lM(e),{method:"DELETE"});if(t.ok)return;const i=await cM(t);throw new oM(i.code,i.message)}async function Qb(e,t){const i=await fetch(e,t);if(!i.ok){const s=await cM(i);throw new oM(s.code,s.message)}return i.json()}function lM(e){return`${$b}/${encodeURIComponent(e)}`}async function cM(e){try{const t=await e.json();return{code:t.error?.code??"INSTRUCTION_REQUEST_FAILED",message:t.error?.message??`Request failed with status ${e.status}`}}catch{return{code:"INSTRUCTION_REQUEST_FAILED",message:`Request failed with status ${e.status}`}}}const Gu=["instructions"];function V9(){const e=$a({queryKey:Gu,queryFn:({signal:t})=>U9(t),retry:!1});return{instructions:e.data??[],isLoading:e.isPending,isError:e.isError&&e.data===void 0,retry:e.refetch}}const K9="modulepreload",q9=function(e){return"/"+e},DR={},Y9=function(t,i,s){let o=Promise.resolve();if(i&&i.length>0){let f=function(g){return Promise.all(g.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=u?.nonce||u?.getAttribute("nonce");o=f(i.map(g=>{if(g=q9(g),g in DR)return;DR[g]=!0;const m=g.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${h}`))return;const x=document.createElement("link");if(x.rel=m?"stylesheet":K9,m||(x.as="script"),x.crossOrigin="",x.href=g,d&&x.setAttribute("nonce",d),document.head.appendChild(x),m)return new Promise((S,w)=>{x.addEventListener("load",S),x.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${g}`)))})}))}function c(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return o.then(u=>{for(const d of u||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})},uM=()=>Y9(()=>import("./code-editor-YDVCfCfS.js").then(e=>e.j2),__vite__mapDeps([0,1]));function Ry(){uM()}const G9=b.lazy(async()=>({default:(await uM()).CodeEditor}));function dM(e){const{t}=mt();return v.jsx(b.Suspense,{fallback:v.jsx("div",{style:{height:e.height??"16rem"},className:`
126
- flex items-center justify-center text-xs text-muted-foreground
127
- `,children:t("editor.loading")}),children:v.jsx(G9,{...e})})}const $9="16rem";function jR({instruction:e,onClose:t}){const{t:i}=mt(),s=Br(),o=b.useId(),c=b.useId(),u=e!==void 0,[d,f]=b.useState(e?.name??""),[g,m]=b.useState(e?.content??""),h=sr({mutationFn:O=>e?F9(e.id,O):H9(O),onSuccess:O=>{s.setQueryData(Gu,A=>[...(A??[]).filter(N=>N.id!==O.id),O].toSorted((N,j)=>j.updatedAt-N.updatedAt)),s.invalidateQueries({queryKey:Gu}),Qt.success(i(u?"instructions.updated":"instructions.created")),t()},onError:()=>{Qt.error(i(u?"instructions.updateError":"instructions.error"))}}),x=h.isPending,S=!!(d.trim()&&g.trim())&&!x,w=u?"instructions.editTitle":"instructions.createTitle",C=u?"instructions.updating":"instructions.creating",E=u?"instructions.updateSave":"instructions.save",R=u?tb:lc;function k(){x||t()}return v.jsx(Rs,{open:!0,onOpenChange:O=>{O||k()},children:v.jsxs(Cs,{showCloseButton:!1,className:`
128
- grid max-h-[calc(100vh-2rem)] grid-rows-[auto_minmax(0,1fr)_auto]
129
- overflow-hidden
130
- sm:max-w-3xl
131
- `,children:[v.jsxs("form",{className:"contents","aria-busy":x,onSubmit:O=>{O.preventDefault(),S&&h.mutate({name:d.trim(),content:g})},children:[v.jsx(Ji,{className:"pr-8",children:v.jsx(Wi,{children:i(w)})}),v.jsxs("div",{className:"flex min-h-0 flex-col gap-3 overflow-y-auto pr-1",children:[v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ws,{htmlFor:o,children:i("instructions.name")}),v.jsx(xd,{id:o,autoFocus:!0,required:!0,maxLength:200,value:d,disabled:x,placeholder:i("instructions.namePlaceholder"),onChange:O=>{f(O.target.value)}})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ws,{id:c,children:i("instructions.content")}),v.jsx("div",{role:"group","aria-labelledby":c,"aria-required":"true",className:`
132
- overflow-hidden rounded-md border border-input bg-input/20
133
- focus-within:border-ring focus-within:ring-2
134
- focus-within:ring-ring/30
135
- `,children:v.jsx(dM,{height:$9,value:g,ariaLabel:i("instructions.content"),placeholder:i("instructions.contentPlaceholder"),readOnly:x,onChange:m})})]})]}),v.jsxs(bs,{children:[v.jsx(at,{type:"button",variant:"ghost",disabled:x,onClick:k,children:i("common.cancel")}),v.jsxs(at,{type:"submit",disabled:!S,children:[x?v.jsx(yi,{className:"animate-spin"}):v.jsx(R,{}),v.jsx("span",{children:i(x?C:E)})]})]})]}),v.jsxs(Td,{disabled:x,render:v.jsx(at,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:i("a11y.close")})]})]})})}function Q9({instruction:e,onClose:t}){const{t:i}=mt(),s=Br(),o=sr({mutationFn:()=>B9(e.id),onSuccess:()=>{s.setQueryData(Gu,u=>u?.filter(({id:d})=>d!==e.id)),s.setQueryData(Ur,u=>u?.map(d=>{const f=d.instructionIds.filter(g=>g!==e.id);return{...d,instructionIds:f,enabled:f.length>0&&d.enabled}})),s.invalidateQueries({queryKey:Gu}),s.invalidateQueries({queryKey:Ur}),Qt.success(i("instructions.deleted")),t()},onError:()=>Qt.error(i("instructions.deleteError"))}),c=()=>{o.isPending||t()};return v.jsx(Rs,{open:!0,onOpenChange:u=>{u||c()},children:v.jsxs(Cs,{showCloseButton:!1,children:[v.jsxs(Ji,{children:[v.jsx(Wi,{children:i("instructions.deleteConfirmTitle")}),v.jsx(xs,{children:i("instructions.deleteConfirmDescription",{name:e.name})})]}),v.jsxs(bs,{children:[v.jsx(at,{type:"button",variant:"ghost",disabled:o.isPending,onClick:c,children:i("common.cancel")}),v.jsxs(at,{type:"button",variant:"destructive",disabled:o.isPending,onClick:()=>o.mutate(),children:[o.isPending&&v.jsx(yi,{className:"animate-spin"}),v.jsx("span",{children:i("instructions.delete")})]})]})]})})}const X9=e=>{const t=e.active.data.current;if(Jl(t))return Z9(e,t.agentId);const i=e.pointerCoordinates?LF(e):NF(e),s=i.filter(({id:o})=>m9(o));return s.length>0?s:i};function Z9(e,t){const i=e.collisionRect.left+e.collisionRect.width/2,s=e.collisionRect.top+e.collisionRect.height/2,o=e.droppableRects.get(nM(t));if(o&&(i<o.left||i>o.left+o.width||s<o.top||s>o.top+o.height))return[];let c;for(const u of e.droppableContainers){const d=u.data.current;if(!Jl(d)||d.agentId!==t)continue;const f=e.droppableRects.get(u.id);if(!f)continue;const g=(f.left+f.width/2-i)**2+(f.top+f.height/2-s)**2;(!c||g<c.distance)&&(c={id:u.id,distance:g})}return c?[{id:c.id}]:[]}function J9(){const{t:e}=mt(),[t,i]=b.useState(null),[s,o]=b.useState(!1),[c,u]=b.useState(null),[d,f]=b.useState(null),g=V9(),m=M9(),h=OF(xy(_A,{activationConstraint:{distance:4}}),xy(UA,{activationConstraint:{delay:200,tolerance:8}}),xy(Vb,{coordinateGetter:s9})),x=b.useMemo(()=>new Map(g.instructions.map(N=>[N.id,N])),[g.instructions]),S=d?g.instructions.find(({id:N})=>N===d):void 0,w=t?.data.current,C=W9(w),E=C?x.get(C)?.name??C:"",R=t?.rect.current.initial?.width;function k(N,j,D){const M=m.agents.find(({id:q})=>q===N);if(!M||m.pendingAgentIds.has(N))return;if(M.instructionIds.includes(j)){Qt.error(e("agents.duplicateError"));return}const _=[...M.instructionIds],L=D?_.indexOf(D):-1;_.splice(L<0?_.length:L,0,j),m.updateInstructions(N,_)}function O(N,j){const D=m.agents.find(({id:M})=>M===N);!D||m.pendingAgentIds.has(N)||m.updateInstructions(N,D.instructionIds.filter(M=>M!==j))}function A({active:N,over:j}){if(i(null),!j)return;const D=N.data.current,M=j.data.current;if(fv(D)){if(AR(M)){k(M.agentId,D.instructionId);return}Jl(M)&&k(M.agentId,D.instructionId,M.instructionId);return}if(!Jl(D))return;const _=m.agents.find(({id:H})=>H===D.agentId);if(!_||m.pendingAgentIds.has(_.id))return;const L=_.instructionIds,q=L.indexOf(D.instructionId),X=Jl(M)&&M.agentId===D.agentId?L.indexOf(M.instructionId):AR(M)&&M.agentId===D.agentId?L.length-1:-1;if(q===X||q===-1||X===-1)return;const B=Yb([...L],q,X);B.length===L.length&&B.every((H,U)=>H===L[U])||m.updateInstructions(_.id,B)}return v.jsxs(T7,{sensors:h,collisionDetection:X9,onDragStart:({active:N})=>{i(N)},onDragCancel:()=>{i(null)},onDragEnd:A,children:[v.jsxs("div",{className:`
136
- grid min-h-0 flex-1 gap-4 overflow-hidden p-4
137
- max-md:overflow-y-auto
138
- md:grid-cols-2
139
- `,children:[v.jsx(wA,{children:v.jsxs(at,{type:"button",onFocus:Ry,onPointerEnter:Ry,onClick:()=>{o(!0)},children:[v.jsx(lc,{}),v.jsx("span",{children:e("instructions.create")})]})}),v.jsxs("section",{className:"flex min-h-0 flex-col gap-2",children:[v.jsxs("div",{className:"flex items-baseline justify-between gap-3 px-1",children:[v.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:e("nav.instructions")}),v.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:e("instructions.dragHint")})]}),v.jsx("div",{className:`
140
- min-h-0 flex-1 overflow-y-auto p-1
141
- max-md:max-h-64
142
- `,children:v.jsx(P9,{instructions:g.instructions,isLoading:g.isLoading,isError:g.isError,onRetry:()=>{g.retry()},onEdit:N=>{f(N.id)},onDelete:N=>{u(N)},onPreload:Ry})})]}),v.jsxs("section",{className:"flex min-h-0 flex-col gap-2",children:[v.jsxs("div",{className:"flex items-baseline justify-between gap-3 px-1",children:[v.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:e("agents.title")}),v.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:e("agents.orderHint")})]}),v.jsxs("div",{className:`
143
- flex min-h-0 flex-1 flex-col gap-3 p-1
144
- max-md:pb-2
145
- md:overflow-y-auto
146
- `,children:[m.isLoading&&v.jsx(eB,{}),!m.isLoading&&m.isError&&v.jsxs(Gs,{className:"items-start gap-3 p-4",children:[v.jsx("p",{className:"text-xs text-muted-foreground",children:e("agents.loadError")}),v.jsxs(at,{type:"button",variant:"outline",onClick:()=>{m.retry()},children:[v.jsx(JT,{}),v.jsx("span",{children:e("common.retry")})]})]}),!m.isLoading&&!m.isError&&m.agents.map(N=>v.jsx(w9,{agent:N,instructionsById:x,isInstructionsLoading:g.isLoading,isPending:m.pendingAgentIds.has(N.id),isReapplying:m.reapplyingAgentIds.has(N.id),onRemoveInstruction:O,onToggle:(j,D)=>{m.setEnabled(j,D)},onReapply:j=>{m.reapply(j)},onOpenFile:j=>{m.openFile(j)}},N.id))]})]}),c&&v.jsx(Q9,{instruction:c,onClose:()=>u(null)}),s&&v.jsx(jR,{onClose:()=>{o(!1)}}),S&&v.jsx(jR,{instruction:S,onClose:()=>{f(null)}})]}),fv(w)&&v.jsx(V7,{dropAnimation:null,children:E&&v.jsxs("div",{style:{width:R},className:"flex items-center gap-2 bg-card px-3 py-2.5 text-xs",children:[v.jsx(eb,{className:"size-3.5 text-muted-foreground"}),v.jsx("span",{className:"truncate",children:E})]})})]})}function W9(e){if(fv(e)||Jl(e))return e.instructionId}function eB(){return v.jsx(v.Fragment,{children:[0,1].map(e=>v.jsxs(Gs,{className:"gap-0 py-0",children:[v.jsxs("div",{className:"flex items-center gap-3 p-3",children:[v.jsx(Er,{className:"size-8 rounded-md"}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx(Er,{className:"h-4 w-24"}),v.jsx(Er,{className:"mt-2 h-3 w-40"})]}),v.jsx(Er,{className:"h-4 w-7 rounded-full"})]}),v.jsx("div",{className:"border-t border-border/60 p-3",children:v.jsx(Er,{className:"h-20 w-full"})})]},e))})}class Lo extends Error{constructor(t,i){super(i),this.code=t,this.name="SkillApiError"}code}async function Ts(e,t){const i=await fetch(e,t);if(!i.ok){const s=await i.json();throw new Lo(s.error?.code??"SKILL_REQUEST_FAILED",s.error?.message??`Request failed with status ${i.status}`)}return i.status===204?void 0:i.json()}function tB(e){return Ts("/api/skills",{signal:e})}function nB(e,t){return Ts(`/api/skills/${encodeURIComponent(e)}`,{signal:t})}function rB(e){return Ts("/api/skills",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function iB(e){return Ts("/api/skills/import/local",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function sB(e){return Ts("/api/skills/import/url",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function aB(e,t){return Ts(`/api/skills/${encodeURIComponent(e)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}function oB(e){return Ts(`/api/skills/${encodeURIComponent(e)}`,{method:"DELETE"})}function lB(e){return Ts("/api/skills/agents/assignments",{signal:e})}function cB(e,t,i){return Ts(`/api/skills/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({assigned:i})})}const kd=["skills"],Wl=e=>["skills",e],Cy=["skills","agents","assignments"];function uB(e,t){return Ts(`/api/skills/${encodeURIComponent(e)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({files:t})})}const dB=["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"],fB=["America/Los_Angeles","America/New_York","Asia/Shanghai","Asia/Taipei","Asia/Tokyo","UTC"],hB=1,pB="settings.changed",gB=64,mB=1024,yB=/^[\p{L}\p{N}]+(?:-[\p{L}\p{N}]+)*$/u;function fM(e){return e.trim().normalize("NFKC")}function vB(e){const t=fM(e);return[...t].length<=gB&&t===t.toLowerCase()&&yB.test(t)}function bB(e){return e.length>0&&e.length<=1024&&e.split("/").every(t=>t.length>0&&t.length<=255&&t!=="."&&t!==".."&&!/[\\<>:"|?*]/u.test(t)&&!new RegExp("\\p{Cc}","u").test(t)&&!/[. ]$/u.test(t)&&!/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/iu.test(t))}function xB({className:e,...t}){return v.jsx("textarea",{"data-slot":"textarea",className:Fe("flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground 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 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}function hv({skill:e,onClose:t,onSaved:i}){const{t:s}=mt(),o=Bo(),c=Br(),u=b.useId(),d=b.useId(),f=e!==void 0,[g,m]=b.useState(e?.name??""),[h,x]=b.useState(e?.description??""),S=sr({mutationFn:R=>e?aB(e.name,R):rB(R),onSuccess:R=>{const k=e?c.getQueryData(Wl(e.name)):void 0;e&&e.name!==R.name&&c.removeQueries({queryKey:Wl(e.name),exact:!0}),k?.files&&c.setQueryData(Wl(R.name),{...k,...R}),c.invalidateQueries({queryKey:kd}),Qt.success(s(f?"skills.updated":"skills.created")),t(),i?.(R),f||o(`/library/skills/${encodeURIComponent(R.name)}`)},onError:R=>{R instanceof Lo&&R.code==="SKILL_LINK_CONFLICT"?Qt.error(s("skills.linkConflict")):R instanceof Lo&&R.code==="SKILL_NAME_CONFLICT"?Qt.error(s("skills.nameConflict")):Qt.error(s(f?"skills.updateError":"skills.createError"))}}),w=S.isPending,C=vB(g)&&!!h.trim()&&!w;function E(){w||t()}return v.jsx(Rs,{open:!0,onOpenChange:R=>{R||E()},children:v.jsxs(Cs,{showCloseButton:!1,className:`
147
- max-h-[calc(100vh-2rem)] overflow-y-auto
148
- sm:max-w-120
149
- `,children:[v.jsxs("form",{className:"flex flex-col gap-4","aria-busy":w,onSubmit:R=>{R.preventDefault(),C&&S.mutate({name:fM(g),description:h.trim()})},children:[v.jsxs(Ji,{className:"pr-8",children:[v.jsx(Wi,{children:s(f?"skills.editTitle":"skills.createManually")}),v.jsx(xs,{children:s(f?"skills.editDescription":"skills.createManuallyDescription")})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ws,{htmlFor:u,children:s("skills.name")}),v.jsx(xd,{id:u,autoFocus:!0,required:!0,"aria-describedby":`${u}-hint`,placeholder:s("skills.namePlaceholder"),value:g,disabled:w,onChange:R=>{m(R.target.value)}}),v.jsx("p",{id:`${u}-hint`,className:"text-xs text-muted-foreground",children:s("skills.nameHint")})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ws,{htmlFor:d,children:s("skills.description")}),v.jsx(xB,{id:d,required:!0,rows:3,maxLength:mB,placeholder:s("skills.descriptionPlaceholder"),value:h,disabled:w,onChange:R=>{x(R.target.value)}})]}),v.jsxs(bs,{children:[v.jsx(at,{type:"button",variant:"ghost",disabled:w,onClick:E,children:s("common.cancel")}),v.jsxs(at,{type:"submit",disabled:!C,children:[w?v.jsx(yi,{className:"animate-spin"}):f?v.jsx(tb,{}):v.jsx(lc,{}),v.jsx("span",{children:s(w?f?"skills.updating":"skills.creating":f?"skills.saveChanges":"skills.create")})]})]})]}),v.jsxs(Td,{disabled:w,render:v.jsx(at,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:s("a11y.close")})]})]})})}class pv extends Error{constructor(t,i){super(i),this.code=t}code}async function SB(e){const t=await fetch("/api/file-picker",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const i=await t.json();throw new pv(i.error?.code??"FILE_PICKER_FAILED",i.error?.message??"Unable to open file picker")}return(await t.json()).path}function wB({isPending:e,onClose:t,onImport:i}){const{t:s}=mt(),o=b.useId(),[c,u]=b.useState("");let d=!1;try{const g=new URL(c.trim());d=["http:","https:"].includes(g.protocol)&&!g.username&&!g.password}catch{}function f(){e||t()}return v.jsx(Rs,{open:!0,onOpenChange:g=>{g||f()},children:v.jsxs(Cs,{showCloseButton:!1,className:`
150
- max-h-[calc(100vh-2rem)] overflow-y-auto
151
- sm:max-w-120
152
- `,children:[v.jsxs("form",{className:"flex flex-col gap-4","aria-busy":e,onSubmit:g=>{g.preventDefault(),d&&!e&&i(c.trim())},children:[v.jsxs(Ji,{className:"pr-8",children:[v.jsx(Wi,{children:s("skills.importUrl")}),v.jsx(xs,{children:s("skills.importUrlDescription")})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ws,{htmlFor:o,children:s("skills.url")}),v.jsx(xd,{id:o,autoFocus:!0,required:!0,type:"url",placeholder:s("skills.importUrlHint"),autoComplete:"off",spellCheck:!1,value:c,disabled:e,onChange:g=>u(g.target.value)})]}),v.jsxs(bs,{children:[v.jsx(at,{type:"button",variant:"ghost",disabled:e,onClick:f,children:s("common.cancel")}),v.jsxs(at,{type:"submit",disabled:!d||e,children:[e?v.jsx(yi,{className:"animate-spin"}):v.jsx(Xp,{}),v.jsx("span",{children:s(e?"skills.importing":"skills.importSubmit")})]})]})]}),v.jsxs(Td,{disabled:e,render:v.jsx(at,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:s("a11y.close")})]})]})})}const EB=[{titleKey:"skills.createManually",descriptionKey:"skills.createManuallyDescription",icon:lc},{titleKey:"skills.importLocal",descriptionKey:"skills.importLocalDescription",icon:DT},{titleKey:"skills.importUrl",descriptionKey:"skills.importUrlDescription",icon:Xp}],IR={SKILL_IMPORT_INVALID_URL:"skills.importInvalidUrl",SKILL_IMPORT_UNSUPPORTED_URL_FILE:"skills.importUnsupportedUrlFile",SKILL_IMPORT_DOWNLOAD_FAILED:"skills.importDownloadFailed",SKILL_IMPORT_DOWNLOAD_TIMEOUT:"skills.importDownloadTimeout",SKILL_NAME_CONFLICT:"skills.importNameConflict",SKILL_IMPORT_TOO_LARGE:"skills.importTooLarge",SKILL_IMPORT_READ_FAILED:"skills.importReadError",SKILL_IMPORT_INVALID_SOURCE:"skills.importInvalidSource",SKILL_IMPORT_SYMLINK_SOURCE:"skills.importSymlinkSource",SKILL_IMPORT_MISSING_SKILL_MD:"skills.importMissingSkillMd",SKILL_IMPORT_INVALID_METADATA:"skills.importInvalidMetadata",SKILL_IMPORT_INVALID_PATH:"skills.importInvalidPath",SKILL_IMPORT_DUPLICATE_PATH:"skills.importDuplicatePath",SKILL_IMPORT_INVALID_ENCODING:"skills.importInvalidEncoding",SKILL_IMPORT_UNSUPPORTED_ENTRIES:"skills.importUnsupportedEntries",SKILL_IMPORT_TOO_MANY_ENTRIES:"skills.importTooManyEntries",SKILL_IMPORT_SKILL_MD_TOO_LARGE:"skills.importSkillMdTooLarge",SKILL_IMPORT_INVALID_ARCHIVE:"skills.importInvalidArchive",SKILL_IMPORT_NO_SKILLS:"skills.importNoSkills",INVALID_SKILL_INPUT:"skills.importInvalid"};function RB({onCreateManually:e}){const{t}=mt(),i=Br(),s=Bo(),[o,c]=b.useState(!1),u=sr({mutationFn:m=>"url"in m?sB(m):iB(m),onSuccess:m=>{c(!1),i.invalidateQueries({queryKey:kd});const h=t("skills.importSummary",{imported:m.imported.length,skipped:m.skipped.length});m.skipped.length>0?Qt.warning(h,{description:v.jsx("ul",{className:"max-h-40 overflow-y-auto",children:m.skipped.map(x=>v.jsxs("li",{className:"wrap-break-word",children:[x.source,":",t(x.code==="SKILL_NAME_CONFLICT"?"skills.importSkippedConflict":IR[x.code]??"skills.importSkippedInvalid")]},x.source))})}):Qt.success(h),m.imported.length===1&&m.skipped.length===0&&s(`/library/skills/${encodeURIComponent(m.imported[0].name)}`)},onError:m=>{const h=m instanceof Lo?IR[m.code]:void 0;Qt.error(t(h??"skills.importError"))}}),d=sr({mutationFn:()=>SB({kind:"file-or-directory",title:t("skills.importLocal"),extensions:["skill","zip"]}),onSuccess:m=>{m!==null&&u.mutate({path:m})},onError:m=>{let h="filePicker.error";m instanceof pv&&m.code==="FILE_PICKER_UNAVAILABLE"?h="filePicker.unavailable":m instanceof pv&&m.code==="FILE_PICKER_BUSY"&&(h="filePicker.busy"),Qt.error(t(h))}}),f=d.isPending||u.isPending;let g="skills.new";return d.isPending?g="filePicker.selecting":u.isPending&&(g="skills.importing"),v.jsxs(v.Fragment,{children:[v.jsxs(Vo,{children:[v.jsxs(Ko,{render:v.jsx(at,{type:"button",disabled:f}),children:[f?v.jsx(yi,{className:"animate-spin"}):v.jsx(lc,{}),v.jsx("span",{children:t(g)}),v.jsx(Xv,{})]}),v.jsx(qo,{align:"end",className:"w-max max-w-[min(20rem,calc(100vw-2rem))]",children:EB.map(({titleKey:m,descriptionKey:h,icon:x})=>v.jsxs(fc,{className:"items-start gap-2 p-2",onClick:()=>{m==="skills.createManually"?e():m==="skills.importLocal"?d.mutate():c(!0)},children:[v.jsx(x,{"aria-hidden":"true",className:"mt-0.5 size-4"}),v.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5 whitespace-normal",children:[v.jsx("span",{className:"text-sm",children:t(m)}),v.jsx("span",{className:"text-xs text-muted-foreground",children:t(h)})]})]},m))})]}),o&&v.jsx(wB,{isPending:u.isPending,onClose:()=>c(!1),onImport:m=>u.mutate({url:m})})]})}const hM=b.createContext(void 0);function CB(){return b.useContext(hM)}const TB=b.forwardRef(function(t,i){const{className:s,defaultPressed:o=!1,disabled:c=!1,form:u,onPressedChange:d,pressed:f,render:g,type:m,value:h,nativeButton:x=!0,style:S,...w}=t,C=ar(h||void 0),E=CB(),R=E?.value??[],k=(c||E?.disabled)??!1,[O,A]=Js({controlled:E?C!==void 0&&R.indexOf(C)>-1:f,default:o,name:"Toggle",state:"pressed"}),{getButtonProps:N,buttonRef:j}=vi({disabled:k,native:x}),D={disabled:k,pressed:O},M=[j,i],_=[{"aria-pressed":O,onClick(X){const B=!O,H=ut(Mr,X.nativeEvent);d?.(B,H),!H.isCanceled&&(C&&E?.setGroupValue?.(C,B,H),!H.isCanceled&&A(B))}},w,N],L=kt("button",t,{enabled:!E,state:D,ref:M,props:_}),q=b.useMemo(()=>({disabled:k,focusableWhenDisabled:!1}),[k]);return E?v.jsx(jb,{tag:"button",render:g,className:s,style:S,metadata:q,state:D,refs:M,props:_}):L}),Xb="data-composite-item-active";function kB(e){const{loopFocus:t=!0,orientation:i="both",grid:s,onLoop:o,direction:c,highlightedIndex:u,onHighlightedIndexChange:d,rootRef:f,enableHomeAndEndKeys:g=!1,stopEventPropagation:m,disabledIndices:h,modifierKeys:x=$i}=e,[S,w]=b.useState(0),C=s!=null,E=b.useRef(null),R=Wr(E,f),k=b.useRef([]),O=b.useRef(!1),A=b.useRef(null),N=u??S,j=Be((q,X=!1)=>{if(A.current=k.current[q]??null,(d??w)(q),X){const B=k.current[q];kE(E.current,B,c,i)}}),D=Be(q=>{if(q.size===0)return;if(O.current){const U=k.current,z=U.indexOf(A.current);if(z===-1){const Q=U[N];!Q||Kl(U,N,h)?j(OB(U,h)):A.current=Q}else z!==N&&j(z);return}O.current=!0;const X=Array.from(q.keys()),B=X.find(U=>U?.hasAttribute(Xb))??null,H=B?q.get(B)?.index??-1:-1;if(H!==-1)j(H);else if(Kl(X,N,h)){const U=Vl(X,{disabledIndices:h});Bl(X,U)||j(U)}kE(E.current,B,c,i)});_e(()=>{if(h==null||u!=null||!O.current)return;const q=k.current;if(Kl(q,N,h)){const X=Vl(q,{disabledIndices:h});Bl(q,X)||j(X)}},[h,u,N,k,j]);const M=Be((q,X,B)=>o?o(q,X,B,k):B),_=Be(q=>{const X=q.key===Xy||q.key===Zy;if(!cd.has(q.key)||!g&&X||AB(q,x)||!E.current)return;const H=c==="rtl",U=H?$y:Qy,z=H?Qy:$y,Q=i==="vertical"?Gy:U,$=i==="vertical"?Yy:z,K=tr(q.nativeEvent);if(K!=null&&TE(K)&&!eA(K)){const V=K.selectionStart,W=K.selectionEnd,re=K.value;if(V==null||q.shiftKey||V!==W||q.key!==$&&V<re.length||q.key!==Q&&V>0)return}let Y=N;const ee=Sh(k,h),G=Py(k,h);s!=null&&(Y=s({disabledIndices:h,elementsRef:k,event:q,highlightedIndex:N,loopFocus:t,maxIndex:G,minIndex:ee,onLoop:M,orientation:i,rtl:H}));const oe=i!=="vertical"&&q.key===U||i!=="horizontal"&&q.key===Gy,I=i!=="vertical"&&q.key===z||i!=="horizontal"&&q.key===Yy;g&&(q.key===Xy?Y=ee:q.key===Zy&&(Y=G)),Y===N&&(oe||I)&&(t&&Y===G&&oe?(Y=ee,o&&(Y=o(q,N,Y,k))):t&&Y===ee&&I?(Y=G,o&&(Y=o(q,N,Y,k))):Y=Vl(k.current,{startingIndex:Y,decrement:I,disabledIndices:h})),Y!==N&&!Bl(k.current,Y)&&(m&&q.stopPropagation(),(C||X||oe||I)&&q.preventDefault(),j(Y,!0),queueMicrotask(()=>{k.current[Y]?.focus()}))});return{props:{ref:R,onFocus(q){const X=E.current,B=tr(q.nativeEvent);!X||B==null||!TE(B)||B.setSelectionRange(0,B.value.length)},onKeyDown:_},highlightedIndex:N,onHighlightedIndexChange:j,elementsRef:k,onMapChange:D,relayKeyboardEvent:_}}function OB(e,t){let i=-1;for(let s=0;s<e.length;s+=1){const o=e[s];if(!(!o||Kl(e,s,t))){if(o.hasAttribute(Xb))return s;i===-1&&(i=s)}}return Math.max(i,0)}function AB(e,t){for(const i of W5)if(!t.includes(i)&&e.getModifierState(i))return!0;return!1}function pM(e){const{render:t,className:i,style:s,refs:o=$i,props:c=$i,state:u=Xt,stateAttributesMapping:d,highlightedIndex:f,onHighlightedIndexChange:g,orientation:m,grid:h,loopFocus:x,onLoop:S,enableHomeAndEndKeys:w,onMapChange:C,stopEventPropagation:E=!0,rootRef:R,disabledIndices:k,modifierKeys:O,highlightItemOnHover:A=!1,tag:N="div",...j}=e,D=qp(),{props:M,highlightedIndex:_,onHighlightedIndexChange:L,elementsRef:q,onMapChange:X,relayKeyboardEvent:B}=kB({grid:h,loopFocus:x,onLoop:S,orientation:m,highlightedIndex:f,onHighlightedIndexChange:g,rootRef:R,stopEventPropagation:E,enableHomeAndEndKeys:w,direction:D,disabledIndices:k,modifierKeys:O}),H=kt(N,e,{state:u,ref:o,props:[M,...c,j],stateAttributesMapping:d}),U=b.useMemo(()=>({highlightedIndex:_,onHighlightedIndexChange:L,highlightItemOnHover:A,relayKeyboardEvent:B}),[_,L,A,B]);return v.jsx(xk.Provider,{value:U,children:v.jsx(Db,{elementsRef:q,onMapChange:z=>{C?.(z),X(z)},children:H})})}const MB=b.createContext(void 0);function NB(){return b.useContext(MB)}const DB=b.forwardRef(function(t,i){const{defaultValue:s,disabled:o=!1,loopFocus:c=!0,onValueChange:u,orientation:d="horizontal",multiple:f=!1,value:g,className:m,render:h,style:x,...S}=t,w=tg(),C=NB(),E=s??$i,R=g!==void 0||s!==void 0,k=(w?.disabled??!1)||(C?.disabled??!1)||o,[O,A]=Js({controlled:g,default:E,name:"ToggleGroup",state:"value"}),N=Be((L,q,X)=>{let B;f?(B=O.slice(),q?B.push(L):B.splice(O.indexOf(L),1)):B=q?[L]:[],u?.(B,X),!X.isCanceled&&A(B)}),j={disabled:k,multiple:f,orientation:d},D=b.useMemo(()=>({disabled:k,setGroupValue:N,value:O,isValueInitialized:R}),[k,N,O,R]),M={role:"group"},_=kt("div",t,{enabled:!!w,state:j,ref:i,props:[M,S]});return v.jsx(hM.Provider,{value:D,children:w?_:v.jsx(pM,{render:h,className:m,style:x,state:j,refs:[i],props:[M,S],loopFocus:c,enableHomeAndEndKeys:!0,orientation:d})})}),jB=Uo("group/toggle inline-flex items-center justify-center gap-1 rounded-md text-xs font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-7 min-w-7 px-2 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",sm:"h-6 min-w-6 rounded-[min(var(--radius-md),8px)] 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-3",lg:"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"}},defaultVariants:{variant:"default",size:"default"}}),gM=b.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal"});function IB({className:e,variant:t,size:i,spacing:s=2,orientation:o="horizontal",children:c,...u}){return v.jsx(DB,{"data-slot":"toggle-group","data-variant":t,"data-size":i,"data-spacing":s,"data-orientation":o,style:{"--gap":s},className:Fe("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] data-vertical:flex-col data-vertical:items-stretch",e),...u,children:v.jsx(gM.Provider,{value:{variant:t,size:i,spacing:s,orientation:o},children:c})})}function PB({className:e,children:t,variant:i="default",size:s="default",...o}){const c=b.useContext(gM);return v.jsx(TB,{"data-slot":"toggle-group-item","data-variant":c.variant||i,"data-size":c.size||s,"data-spacing":c.spacing,className:Fe("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",jB({variant:c.variant||i,size:c.size||s}),e),...o,children:t})}function mM({name:e}){const{t}=mt(),i=Br(),s=$a({queryKey:Cy,queryFn:({signal:f})=>lB(f)}),o=["skill-assignment",e],c=Vk({mutationKey:o})>0,u=sr({mutationKey:o,mutationFn:({id:f,assigned:g})=>cB(e,f,g),onSuccess:f=>{i.setQueryData(Cy,g=>g&&{...g,skills:g.skills.map(m=>m.name===f.name?f:m)})},onError:f=>{Qt.error(t(f instanceof Lo&&f.code==="SKILL_LINK_CONFLICT"?"skills.linkConflict":"skills.assignmentError"))},onSettled:()=>i.invalidateQueries({queryKey:Cy})});if(s.isPending)return v.jsx(Er,{className:"h-7 w-16"});if(s.isError)return v.jsx(at,{variant:"ghost",onClick:()=>{s.refetch()},children:t("common.retry")});if(s.data.agents.length===0)return v.jsx("span",{className:"text-xs text-muted-foreground",children:t("skills.noAgents")});const d=s.data.skills.find(f=>f.name===e)?.agentIds??[];return v.jsx(IB,{multiple:!0,value:d,disabled:c,"aria-busy":c,"aria-label":t("skills.assignTitle",{name:e}),onValueChange:f=>{const g=s.data.agents.find(m=>f.includes(m.id)!==d.includes(m.id))?.id;g&&!c&&u.mutate({id:g,assigned:f.includes(g)})},children:s.data.agents.map(f=>v.jsx(PB,{value:f.id,"aria-label":t("skills.assignAgentAria",{agent:f.name,name:e}),className:`
153
- size-7 p-0
154
- disabled:opacity-100
155
- `,children:v.jsx(rM,{icon:f.icon,monochrome:!d.includes(f.id),className:"size-4 rounded-none bg-transparent"})},f.id))})}function LB({skill:e,onEdit:t,onDelete:i,onAssign:s}){const{t:o}=mt();return v.jsxs(Sg,{children:[v.jsxs(wg,{render:v.jsx("div",{role:"listitem",className:`
156
- group flex h-9 items-center rounded-md px-2 transition-colors
157
- hover:bg-muted/50
158
- has-aria-expanded:bg-muted/50
159
- `}),children:[v.jsxs(md,{to:`/library/skills/${encodeURIComponent(e.name)}`,className:`
160
- flex min-w-0 flex-1 items-center gap-2 rounded-sm text-sm
161
- focus-visible:outline-2 focus-visible:outline-ring
162
- `,children:[v.jsx("span",{className:"min-w-0 truncate font-medium",children:e.name}),v.jsx("span",{className:"min-w-0 flex-1 basis-0 truncate text-muted-foreground",children:e.description})]}),v.jsx("div",{className:`
163
- ml-2 hidden shrink-0
164
- md:block
165
- `,children:v.jsx(mM,{name:e.name})}),v.jsx("div",{className:`
166
- flex w-9 shrink-0 justify-end overflow-hidden
167
- md:w-0
168
- md:group-focus-within:w-9
169
- md:group-hover:w-9
170
- md:group-has-aria-expanded:w-9
171
- [@media(hover:none)]:w-9
172
- `,children:v.jsxs(Vo,{children:[v.jsx(Ko,{render:v.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":o("skills.actionsAria",{name:e.name}),className:"shrink-0 text-muted-foreground"}),children:v.jsx(Jv,{})}),v.jsx(qo,{align:"end",className:"w-40",children:v.jsx(PR,{Item:fc,onEdit:t,onDelete:i,onAssign:s})})]})})]}),v.jsx(Eg,{children:v.jsx(PR,{Item:Rg,onEdit:t,onDelete:i,onAssign:s})})]})}function PR({Item:e,onEdit:t,onDelete:i,onAssign:s}){const{t:o}=mt();return v.jsxs(v.Fragment,{children:[v.jsxs(e,{onClick:s,children:[v.jsx(wL,{}),v.jsx("span",{children:o("skills.assign")})]}),v.jsxs(e,{onClick:t,children:[v.jsx($T,{}),v.jsx("span",{children:o("skills.edit")})]}),v.jsxs(e,{variant:"destructive",onClick:i,children:[v.jsx(nb,{}),v.jsx("span",{children:o("skills.delete")})]})]})}function zB({skill:e,onClose:t}){const{t:i}=mt(),s=Br(),o=sr({mutationFn:()=>oB(e.name),onSuccess:()=>{s.removeQueries({queryKey:Wl(e.name),exact:!0}),s.invalidateQueries({queryKey:kd}),Qt.success(i("skills.deleted")),t()},onError:()=>Qt.error(i("skills.deleteError"))}),c=()=>{o.isPending||t()};return v.jsx(Rs,{open:!0,onOpenChange:u=>{u||c()},children:v.jsxs(Cs,{showCloseButton:!1,children:[v.jsxs(Ji,{children:[v.jsx(Wi,{children:i("skills.deleteConfirmTitle")}),v.jsx(xs,{children:v.jsx(Jp,{i18nKey:"skills.deleteConfirmDescription",values:{name:e.name},components:{skillName:v.jsx("code",{className:`
173
- rounded-sm bg-muted px-1 py-0.5 font-mono wrap-anywhere
174
- `})}})})]}),v.jsxs(bs,{children:[v.jsx(at,{type:"button",variant:"ghost",disabled:o.isPending,onClick:c,children:i("common.cancel")}),v.jsxs(at,{type:"button",variant:"destructive",disabled:o.isPending,onClick:()=>o.mutate(),children:[o.isPending&&v.jsx(yi,{className:"animate-spin"}),v.jsx("span",{children:i("skills.delete")})]})]})]})})}function _B({skill:e,onClose:t}){const{t:i}=mt();return v.jsx(Rs,{open:!0,onOpenChange:s=>{s||t()},children:v.jsxs(Cs,{children:[v.jsxs(Ji,{children:[v.jsx(Wi,{className:"pr-6 leading-relaxed",children:v.jsx(Jp,{i18nKey:"skills.assignDialogTitle",values:{name:e.name},components:{skillName:v.jsx("code",{className:`
175
- rounded-sm bg-muted px-1 py-0.5 font-mono text-sm
176
- wrap-anywhere
177
- `})}})}),v.jsx(xs,{children:i("skills.assignDescription")})]}),v.jsx(mM,{name:e.name})]})})}function UB(){const{t:e}=mt(),[t,i]=b.useState(!1),[s,o]=b.useState(null),[c,u]=b.useState(null),[d,f]=b.useState(null),g=$a({queryKey:kd,queryFn:({signal:m})=>tB(m)});return v.jsxs(v.Fragment,{children:[v.jsx(wA,{children:v.jsx(RB,{onCreateManually:()=>{i(!0)}})}),v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-4",children:[g.isPending&&v.jsx(Er,{className:"h-16 w-full"}),g.isError&&v.jsxs("div",{role:"alert",className:"flex flex-1 flex-col items-center justify-center",children:[v.jsx(Yu,{icon:Fy,title:e("skills.loadError"),className:"flex-none"}),v.jsx(at,{variant:"outline",onClick:()=>{g.refetch()},children:e("common.retry")})]}),g.isSuccess&&g.data.length===0&&v.jsx(Yu,{icon:Fy,title:e("skills.emptyTitle"),description:e("skills.emptyDescription")}),g.isSuccess&&g.data.length>0&&v.jsx("div",{role:"list",children:g.data.map(m=>v.jsx(LB,{skill:m,onEdit:()=>o(m),onDelete:()=>u(m),onAssign:()=>f(m)},m.name))})]}),t&&v.jsx(hv,{onClose:()=>{i(!1)}}),s&&v.jsx(hv,{skill:s,onClose:()=>o(null)}),c&&v.jsx(zB,{skill:c,onClose:()=>u(null)}),d&&v.jsx(_B,{skill:d,onClose:()=>f(null)})]})}function cp(e,t){for(const i of e){if(i.path===t)return i;if(!i.children)continue;const s=cp(i.children,t);if(s)return s}}function up(e,t,i){return e.flatMap(s=>{if(s.path===t){const o=i(s);return o?[o]:[]}return s.children?[{...s,children:up(s.children,t,i)}]:[s]})}function HB(e,t,i){return t?up(e,t,s=>s.children?{...s,children:[...s.children,i]}:s):[...e,i]}function FB({files:e,parent:t,kind:i,onCreate:s,onCancel:o}){const{t:c}=mt(),[u,d]=b.useState(""),[f,g]=b.useState(!1),m=b.useRef(null),h=b.useRef(!1),x=b.useId(),S=u.trim(),w=t?`${t}/${S}`:S,C=bB(S)&&!S.includes("/"),E=S!==""&&cp(e,w)!==void 0,R=E?c("skills.fileConflict"):f&&!C?c("skills.invalidEntryName"):null;b.useEffect(()=>{const O=requestAnimationFrame(()=>m.current?.focus());return()=>cancelAnimationFrame(O)},[]);const k=()=>{h.current||(g(!0),!(!C||E)&&(h.current=!0,s(i==="directory"?{path:w,children:[]}:{path:w,content:""})))};return v.jsxs("form",{onSubmit:O=>{O.preventDefault(),k()},onKeyDown:O=>{O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),h.current=!0,o())},children:[v.jsxs("div",{className:`
178
- flex h-7 min-w-0 items-center gap-1.5 border-x border-transparent pl-2
179
- `,children:[v.jsx("span",{className:"size-3 shrink-0"}),i==="directory"?v.jsx(PT,{className:"size-3.5 shrink-0"}):v.jsx(Wv,{className:"size-3.5 shrink-0"}),v.jsx(xd,{ref:m,required:!0,"aria-label":c(i==="directory"?"skills.newFolder":"skills.newFile"),"aria-invalid":!!R,"aria-describedby":R?x:void 0,maxLength:255,value:u,className:"min-w-0 flex-1",onKeyDown:O=>{O.key==="Enter"&&O.nativeEvent.isComposing&&O.preventDefault()},onChange:O=>d(O.target.value),onBlur:()=>{S===""&&!h.current?(h.current=!0,o()):k()}})]}),R&&v.jsx("p",{id:x,role:"alert",className:"mt-1 px-2 text-xs text-destructive",children:R})]})}function BB({entry:e,anchor:t,isOpen:i,onOpenChange:s,onConfirm:o}){const{t:c}=mt(),u=b.useId(),d=b.useId();return v.jsx(Mk,{open:i,onOpenChange:s,children:v.jsx(Nk,{anchor:t,align:"start","aria-labelledby":u,"aria-describedby":d,finalFocus:()=>t.current?.querySelector("button")??!1,className:"max-w-[calc(100vw-1.5rem)]",children:v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx("h2",{id:u,className:"text-sm font-medium",children:c("skills.delete")}),v.jsx("p",{id:d,className:"text-xs wrap-anywhere text-muted-foreground",children:v.jsx(Jp,{i18nKey:"skills.deleteEntryDescription",values:{path:e.path},components:{entryPath:v.jsx("code",{className:`
180
- rounded-sm bg-muted px-1 py-0.5 font-mono wrap-anywhere
181
- `})}})}),v.jsxs("div",{className:"flex justify-end gap-2",children:[v.jsx(at,{variant:"ghost",onClick:()=>s(!1),children:c("common.cancel")}),v.jsx(at,{variant:"destructive",onClick:o,children:c("skills.delete")})]})]})})})}function dp({entry:e,Item:t,onAction:i}){const{t:s}=mt(),o=e?.path??"";return v.jsxs(v.Fragment,{children:[(!e||e.children)&&v.jsxs(v.Fragment,{children:[v.jsxs(t,{onClick:()=>i({type:"create",parent:o,kind:"file"}),children:[v.jsx(oL,{}),s("skills.newFile")]}),v.jsxs(t,{onClick:()=>i({type:"create",parent:o,kind:"directory"}),children:[v.jsx(cL,{}),s("skills.newFolder")]})]}),e&&e.path!=="SKILL.md"&&v.jsxs(t,{variant:"destructive",onClick:()=>i({type:"delete",entry:e}),children:[v.jsx(nb,{}),s("skills.delete")]})]})}function VB({entry:e,onAction:t,children:i,isActive:s=!1}){const{t:o}=mt(),c=b.useRef(null),[u,d]=b.useState(!1),f=m=>{m.type==="delete"?d(!0):t(m)},g=Fe(Sk({variant:"ghost"}),`
182
- group/file relative flex w-full min-w-0 justify-start p-0
183
- data-active:bg-muted data-active:text-foreground
184
- `);return e?.path==="SKILL.md"?v.jsx("div",{className:g,"data-active":s||void 0,children:i}):v.jsxs(v.Fragment,{children:[v.jsxs(Sg,{children:[v.jsxs(wg,{render:v.jsx("div",{ref:c,className:g,"data-active":s||void 0}),children:[i,v.jsxs(Vo,{children:[v.jsx(Ko,{render:v.jsx(at,{variant:"link",size:"icon","aria-label":o("skills.fileActions",{path:e?.path??o("skills.files")}),className:`
185
- absolute right-0 shrink-0 text-inherit
186
- data-popup-open:opacity-100
187
- md:opacity-0
188
- md:group-focus-within/file:opacity-100
189
- md:group-hover/file:opacity-100
190
- [@media(hover:none)]:opacity-100
191
- `}),children:v.jsx(Jv,{})}),v.jsx(qo,{align:"end",children:v.jsx(dp,{Item:fc,entry:e,onAction:f})})]})]}),v.jsx(Eg,{children:v.jsx(dp,{Item:Rg,entry:e,onAction:f})})]}),e&&v.jsx(BB,{entry:e,anchor:c,isOpen:u,onOpenChange:d,onConfirm:()=>{d(!1),t({type:"delete",entry:e})}})]})}const Zb=b.createContext({creation:null,render:()=>null});Zb.displayName="InlineEntryContext";function KB({files:e,selectedPath:t,onSelect:i,onOverview:s,onAction:o,onCreate:c,overviewDisabled:u=!1}){const{t:d}=mt(),[f,g]=b.useState(!1),[m,h]=b.useState(null),x=mb(),S=R=>{u||(R.type==="create"?h(R):(h(null),o(R)))},w=v.jsxs(at,{variant:"ghost",className:`
192
- shrink-0 justify-start
193
- md:gap-1.5 md:pl-6.5
194
- `,"aria-haspopup":"dialog",disabled:u,onClick:()=>{g(!1),s()},children:[v.jsx(nk,{}),v.jsx("span",{children:d("skills.overview")})]}),C=()=>m&&v.jsx(FB,{files:e,parent:m.parent,kind:m.kind,onCancel:()=>h(null),onCreate:R=>{c(R,m.parent),h(null),R.children||g(!1)}},`${m.parent}/${m.kind}`),E=v.jsxs(v.Fragment,{children:[v.jsx(Zb,{value:{creation:m,render:C},children:v.jsx(yM,{parent:"",entries:e,selectedPath:t,onSelect:R=>{g(!1),i(R)},onAction:S})}),v.jsxs(Sg,{children:[v.jsx(wg,{render:v.jsx("div",{className:"min-h-16 flex-1"})}),v.jsx(Eg,{children:v.jsx(dp,{Item:Rg,onAction:S})})]})]});return v.jsxs(v.Fragment,{children:[v.jsxs("nav",{"aria-label":d("skills.fileNavigation"),className:`
195
- hidden w-56 shrink-0 flex-col gap-2 overflow-y-auto border-r p-3
196
- md:flex
197
- `,children:[w,!x&&E]}),v.jsxs("div",{className:`
198
- flex shrink-0 items-center gap-2 border-b p-2
199
- md:hidden
200
- `,children:[w,v.jsxs(mA,{open:f,onOpenChange:R=>{g(R),R||h(null)},children:[v.jsxs(OH,{render:v.jsx(at,{variant:"outline"}),children:[v.jsx(lL,{}),v.jsx("span",{children:d("skills.files")})]}),v.jsxs(yA,{side:"left","aria-describedby":void 0,children:[v.jsx(vA,{className:"sr-only",children:d("skills.fileNavigation")}),v.jsxs("nav",{"aria-label":d("skills.fileNavigation"),className:`
201
- flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-3 pt-14
202
- pb-3
203
- `,children:[v.jsxs(Vo,{children:[v.jsxs(Ko,{render:v.jsx(at,{variant:"outline",className:"w-full shrink-0 justify-start"}),children:[v.jsx(lc,{}),v.jsx("span",{children:d("skills.newEntry")})]}),v.jsx(qo,{align:"start",children:v.jsx(dp,{Item:fc,onAction:S})})]}),E]})]})]})]})]})}function yM({entries:e,parent:t,selectedPath:i,onSelect:s,onAction:o}){const c=b.use(Zb),u=e.toSorted((d,f)=>!!d.children==!!f.children?d.path.localeCompare(f.path):d.children?-1:1);return v.jsxs("ul",{className:"min-w-0 shrink-0",children:[c.creation?.parent===t&&v.jsx("li",{children:c.render()}),u.map(d=>v.jsx(qB,{entry:d,selectedPath:i,onSelect:s,onAction:o},d.path))]})}function qB({entry:e,selectedPath:t,onSelect:i,onAction:s}){const[o,c]=b.useState(!0),u=e.children!==void 0;return v.jsxs("li",{className:"min-w-0",children:[v.jsx(VB,{entry:e,isActive:t===e.path,onAction:d=>{d.type==="create"&&c(!0),s(d)},children:v.jsxs("button",{type:"button","aria-current":!u&&t===e.path?"page":void 0,"aria-expanded":u?o:void 0,className:`
204
- flex h-7 w-full min-w-0 flex-1 items-center gap-1.5 rounded-md pr-9
205
- pl-2 text-left text-xs font-normal outline-none
206
- focus-visible:ring-2 focus-visible:ring-ring
207
- `,onClick:()=>{u?c(!o):i(e.path)},children:[v.jsx("span",{className:"flex size-3 shrink-0 items-center justify-center",children:u&&v.jsx(Zv,{className:Fe("size-3 transition-transform",o&&`
208
- rotate-90
209
- `)})}),u?v.jsx(PT,{className:"size-3.5 shrink-0"}):v.jsx(Wv,{className:"size-3.5 shrink-0"}),v.jsx("span",{className:"truncate",title:e.path,children:e.path.split("/").at(-1)})]})}),u&&o&&v.jsx("div",{className:"ml-3 border-l pl-1",children:v.jsx(yM,{parent:e.path,entries:e.children,selectedPath:t,onSelect:i,onAction:s})})]})}function YB({skill:e}){const{t}=mt(),i=Bo(),s=Br(),[o,c]=b.useState(!1),[u,d]=b.useState("SKILL.md"),[f,g]=b.useState(e.files),[m,h]=b.useState(e.files),[x,S]=b.useState(!1),w=cp(f,u),C=w?.content??"",E=JSON.stringify(f)!==JSON.stringify(m),R=sr({mutationFn:()=>uB(e.name,f),onSuccess:A=>{g(A.files),h(A.files),s.setQueryData(Wl(e.name),A),s.invalidateQueries({queryKey:kd}),Qt.success(t("skills.contentSaved"))},onError:()=>Qt.error(t("skills.contentSaveError"))}),k=L6(E||R.isPending);M8(b.useCallback(A=>{(E||R.isPending)&&A.preventDefault()},[E,R.isPending]));const O=()=>{E&&!R.isPending&&R.mutate()};return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:`
210
- flex min-h-0 flex-1 flex-col border-t
211
- md:flex-row
212
- `,children:[v.jsx(KB,{files:f,overviewDisabled:R.isPending,selectedPath:u,onSelect:d,onCreate:(A,N)=>{R.isPending||(g(j=>HB(j,N,A)),A.children||d(A.path))},onAction:A=>{if(R.isPending||A.type!=="delete")return;const N=A.entry.path;g(j=>up(j,N,()=>null)),(u===N||u.startsWith(`${N}/`))&&d("SKILL.md")},onOverview:()=>{E?S(!0):c(!0)}}),v.jsxs("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col","aria-labelledby":"skill-file-title",children:[v.jsxs("header",{className:`
213
- flex h-10 shrink-0 items-center justify-between gap-2 border-b
214
- px-4
215
- `,children:[v.jsx("h1",{id:"skill-file-title",className:"min-w-0 truncate font-mono text-xs font-medium",title:u,children:u}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{role:"status",className:"text-xs text-muted-foreground",children:t(R.isPending?"skills.contentSaving":E?"skills.unsavedChanges":"skills.allChangesSaved")}),v.jsxs(at,{disabled:!E||R.isPending,onClick:O,children:[R.isPending?v.jsx(yi,{className:"animate-spin"}):v.jsx(tb,{}),v.jsx("span",{children:t("skills.saveContent")})]})]})]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:w?.content===null?v.jsx(Yu,{title:t("skills.fileNotEditable")}):v.jsx(dM,{height:"100%",path:`foundry://skills/${encodeURIComponent(e.name)}/${u.split("/").map(A=>encodeURIComponent(A)).join("/")}`,value:C,ariaLabel:t("skills.fileEditor",{file:u}),placeholder:u==="SKILL.md"?t("skills.contentPlaceholder"):"",readOnly:R.isPending,showLineNumbers:!0,onChange:A=>g(N=>up(N,u,j=>({path:j.path,content:A}))),onSave:O},u)})]})]}),o&&v.jsx(hv,{skill:e,onClose:()=>c(!1),onSaved:A=>{A.name!==e.name&&i(`/library/skills/${encodeURIComponent(A.name)}`,{replace:!0})}}),v.jsx(Rs,{open:k.state==="blocked"||x,onOpenChange:A=>{A||(k.reset?.(),S(!1))},children:v.jsxs(Cs,{showCloseButton:!1,children:[v.jsxs(Ji,{children:[v.jsx(Wi,{children:t("skills.leaveTitle")}),v.jsx(xs,{children:t("skills.leaveDescription")})]}),v.jsxs(bs,{children:[v.jsx(at,{variant:"ghost",onClick:()=>{k.reset?.(),S(!1)},children:t("skills.keepEditing")}),v.jsx(at,{variant:"destructive",disabled:R.isPending,onClick:()=>{g(m),cp(m,u)||d("SKILL.md"),x?(c(!0),S(!1)):k.proceed?.()},children:t("skills.discardChanges")})]})]})})]})}function GB(){const{t:e}=mt(),{name:t=""}=R6(),i=$a({queryKey:Wl(t),queryFn:({signal:s})=>nB(t,s),retry:(s,o)=>!(o instanceof Lo&&o.code==="SKILL_NOT_FOUND")&&s<2});if(i.isPending)return v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 p-4","aria-busy":"true",children:[v.jsx(Er,{className:"h-7 w-48"}),v.jsx(Er,{className:"min-h-24 flex-1"})]});if(i.isError&&i.data===void 0){const s=i.error instanceof Lo&&i.error.code==="SKILL_NOT_FOUND";return v.jsxs("div",{role:"alert",className:"flex flex-1 flex-col items-center justify-center p-4",children:[v.jsx(Yu,{icon:Fy,title:e(s?"skills.notFound":"skills.loadError"),className:"flex-none"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx(at,{variant:"outline",render:v.jsx(md,{to:"/library/skills"}),children:e("skills.backToSkills")}),!s&&v.jsx(at,{onClick:()=>{i.refetch()},children:e("common.retry")})]})]})}return v.jsx(YB,{skill:i.data},i.data.name)}function Xa({label:e,description:t,children:i,className:s,controlClassName:o}){return v.jsxs("div",{className:Fe(`
216
- flex flex-col items-start gap-3 p-4
217
- min-[680px]:min-h-16 min-[680px]:flex-row min-[680px]:items-center
218
- min-[680px]:justify-between min-[680px]:gap-8
219
- `,s),children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx("div",{className:"text-sm font-medium",children:e}),t&&v.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t})]}),v.jsx("div",{className:Fe(`
220
- min-w-0
221
- max-[680px]:w-full
222
- min-[680px]:shrink-0
223
- `,o),children:i})]})}function $B({configFolder:e}){const{t}=mt(),i=b.useRef(null),s=sr({mutationFn:async f=>{await navigator.clipboard.writeText(f)},onSuccess:()=>{Qt.success(t("settings.configFolderCopied"))},onError:()=>{Qt.error(t("settings.errors.copyConfigFolder"))}}),o=sr({mutationFn:Gz,onError:()=>{Qt.error(t("settings.errors.openConfigFolder"))}}),c=s.isSuccess&&s.variables===e,u=!e||s.isPending||o.isPending,d=t(c?"settings.configFolderCopied":"settings.copyConfigFolder");return v.jsx(Xa,{label:t("settings.configFolder"),controlClassName:"min-[680px]:shrink",children:v.jsxs("div",{className:`
224
- flex min-w-0 items-center justify-end gap-2
225
- max-[680px]:justify-start
226
- `,children:[e&&v.jsx("span",{className:`
227
- min-w-0 font-mono text-xs break-all text-muted-foreground
228
- select-text
229
- `,children:e}),v.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":d,title:d,disabled:u,"aria-busy":s.isPending,onClick:()=>{!e||u||(i.current&&clearTimeout(i.current),s.mutate(e,{onSuccess:()=>{i.current=setTimeout(()=>s.reset(),2e3)}}))},children:c?v.jsx(od,{}):v.jsx(bT,{})}),v.jsxs(at,{type:"button",variant:"outline",disabled:u,"aria-busy":o.isPending,onClick:()=>{u||o.mutate()},children:[o.isPending?v.jsx(yi,{className:"animate-spin"}):v.jsx(DT,{}),v.jsx("span",{children:t("settings.openFolder")})]})]})})}function QB(e){if(!e)return null;for(const t of e.elements){const i=t.tagName;if(i==="BUTTON"||i==="INPUT"){const s=t;if(s.type==="submit")return s}}return null}const XB="data-checked",ZB="data-unchecked";function vM(e){return{checked(t){return e.indeterminate?{}:t?{[XB]:""}:{[ZB]:""}},...hc}}const JB=b.createContext(void 0);function WB(){return b.useContext(JB)}const bM=b.createContext(void 0);function eV(){const e=b.useContext(bM);if(e===void 0)throw new Error(gn(14));return e}const tV="data-parent",nV=b.forwardRef(function(t,i){const{checked:s,className:o,defaultChecked:c=!1,"aria-labelledby":u,disabled:d=!1,form:f,id:g,indeterminate:m=!1,inputRef:h,name:x,onCheckedChange:S,parent:w=!1,readOnly:C=!1,render:E,required:R=!1,uncheckedValue:k,value:O,nativeButton:A=!1,style:N,...j}=t,{clearErrors:D}=yd(),{disabled:M,name:_,setDirty:L,setFilled:q,setTouched:X,state:B,validationMode:H,validityData:U,validation:z}=ra(),Q=aA(),{labelId:$,registerControlId:K,getDescriptionProps:Y}=Yo(),ee=WB(),G=ee?.allValues===void 0?void 0:ee.parent,oe=G!==void 0,I=M||Q.disabled||ee?.disabled||d,V=_??x,W=O??V,re=ar(),Ee=ee?.registerControlId!==K,le=pc({id:g||void 0,enabled:Ee}),me=A?le:re;let ge={};oe&&(w?ge=G.getParentProps():W!==void 0&&(ge=G.getChildProps(W)));const{checked:ue=s,indeterminate:Te=m,onCheckedChange:ve,...Pe}=ge,Oe=ee?.value,Le=b.useRef(null),Ve=vd(I,Le),{getButtonProps:ke,buttonRef:Ue}=vi({disabled:I,native:A}),be=ee?.validation??z,[He,Ze]=Js({controlled:W!==void 0&&Oe!==void 0&&!w?Oe.includes(W):ue,default:c,name:"Checkbox",state:"checked"}),ot=oe?!!ue:He,de=oe&&Te||m;bd(Le,re,He,void 0,!ee&&!I,x);const we=G?.registerChildId,Ge=b.useRef(null),Me=be.registerInput,De=ee?W:void 0,bt=b.useCallback(We=>Me(We,{controlRef:Le,value:De}),[Me,De]),dt=Wr(h,Ge,w?void 0:bt),pt=Lb(u,$,Ge,!A,le,j["aria-label"]);_e(()=>{Ge.current&&(Ge.current.indeterminate=de),ee||q(He)},[He,de,ee,q]),cc(He,()=>{ee||(D(V),L(He!==U.initialValue),be.change(He))});const Nt=Ar({checked:He,disabled:I,form:f,name:w?void 0:V,id:A?void 0:le,required:R,ref:dt,style:V?Cp:nd,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(We){if(We.nativeEvent.defaultPrevented)return;if(C){We.preventDefault();return}const wt=We.currentTarget.checked,Zt=ut(Mr,We.nativeEvent);if(S?.(wt,Zt),!Zt.isCanceled&&(ve?.(wt,Zt),!Zt.isCanceled&&(Ze(wt),W!==void 0&&ee!==void 0&&!w&&!oe))){const ht=wt?[...ee.value,W]:ee.value.filter(xt=>xt!==W);ee.setValue(ht,Zt)}},onClick(We){We.stopPropagation()},onFocus(){Le.current?.focus()}},O!==void 0?{value:(ee?He&&O:O)||""}:Xt,Y,We=>be.getValidationProps(I,We));b.useEffect(()=>{if(!G||W===void 0)return;const We=G.disabledStatesRef.current;return We.set(W,I),()=>{We.delete(W)}},[G,I,W]);const jt=b.useMemo(()=>({...B,checked:ot,disabled:I,readOnly:C,required:R,indeterminate:de}),[B,ot,I,C,R,de]),tn=vM(jt),an=kt("span",t,{state:jt,ref:[Ue,Le,i],props:[{id:me,role:"checkbox","aria-checked":de?"mixed":ot,"aria-readonly":C||void 0,"aria-required":R||void 0,"aria-labelledby":pt,[tV]:w?"":void 0,onFocus(){Ve(!0)},onBlur(){const We=Ge.current;We&&(X(!0),Ve(!1),H==="onBlur"&&be.commit(ee?Oe:We.checked))},onKeyDown(We){if(We.key!=="Enter"||(We.preventBaseUIHandler(),We.defaultPrevented))return;const wt=Ge.current?.form??null,Zt=We.currentTarget,ht=We.nativeEvent,xt=We.preventDefault,yt=ht.preventDefault;let Ut=!1;We.preventDefault=()=>{Ut=!0,xt.call(We)},ht.preventDefault=()=>{Ut=!0,yt.call(ht)},yt.call(ht),Rn(Zt).queueMicrotask(()=>{We.preventDefault=xt,ht.preventDefault=yt,Ut||QB(wt)?.click()})},onClick(We){if(C||I)return;We.preventDefault();const wt=Ge.current;wt&&No(wt,We)}},j,Pe,ke,Y,We=>be.getValidationProps(I,We)],stateAttributesMapping:tn}),nn=an.props.id;return _e(()=>{if(!(!we||w||W===void 0||nn===void 0))return we(W,nn)},[we,w,W,nn]),v.jsxs(bM.Provider,{value:jt,children:[an,!He&&!ee&&V&&!w&&k!==void 0&&v.jsx("input",{type:"hidden",form:f,name:V,value:k,disabled:I}),v.jsx("input",{...Nt,suppressHydrationWarning:!0})]})}),rV=b.forwardRef(function(t,i){const{render:s,className:o,style:c,keepMounted:u=!1,...d}=t,f=eV(),g=f.checked||f.indeterminate,{mounted:m,transitionStatus:h,setMounted:x}=_o(g),S=b.useRef(null),w={...f,transitionStatus:h};Li({batch:!0,enabled:!g,open:g,ref:S,onComplete(){g||x(!1)}});const E={...vM(f),...ws},R=u||m,k=kt("span",t,{ref:[i,S],state:w,stateAttributesMapping:E,props:d});return R?k:null});function iV({className:e,...t}){return v.jsx(nV,{"data-slot":"checkbox",className:Fe("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),...t,children:v.jsx(rV,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:v.jsx(od,{})})})}function sV({onClose:e}){const{t}=mt(),i=Br(),s=b.useId(),[o,c]=b.useState(["agents"]),u=$a({queryKey:["skill-targets"],queryFn:({signal:f})=>$z(f),retry:!1}),d=sr({mutationFn:Qz,onSuccess:()=>{i.invalidateQueries({queryKey:Kk}),Qt.success(t("settings.skillDownloaded")),e()},onError:()=>Qt.error(t("settings.errors.downloadSkill"))});return v.jsx(Rs,{open:!0,onOpenChange:f=>{!f&&!d.isPending&&e()},children:v.jsxs(Cs,{showCloseButton:!1,children:[v.jsxs("form",{className:"flex flex-col gap-4","aria-busy":d.isPending,onSubmit:f=>{f.preventDefault(),o.length>0&&u.isSuccess&&!d.isPending&&d.mutate({targets:o})},children:[v.jsxs(Ji,{children:[v.jsx(Wi,{children:t("settings.downloadSkill")}),v.jsx(xs,{children:t("settings.downloadSkillDescription")})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ws,{id:s,children:t("settings.skillTargets")}),u.isPending&&v.jsxs("div",{className:"space-y-2",children:[v.jsx(Er,{className:"h-12 w-full"}),v.jsx(Er,{className:"h-12 w-full"})]}),u.isError&&v.jsx(at,{type:"button",variant:"outline",disabled:u.isFetching,onClick:()=>{u.refetch()},children:t("common.retry")}),u.data&&v.jsx("div",{role:"group","aria-labelledby":s,"aria-required":"true",className:"flex flex-col gap-2",children:u.data.targets.map(({target:f,destination:g})=>v.jsxs(aM,{className:"flex items-start gap-3 rounded-lg border p-3",children:[v.jsx(iV,{checked:o.includes(f),disabled:d.isPending,onCheckedChange:m=>{c(h=>m?[...h,f]:h.filter(x=>x!==f))}}),v.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[v.jsx("span",{children:f==="agents"?".agents":".claude"}),v.jsx("span",{className:`
230
- font-mono text-xs font-normal break-all
231
- text-muted-foreground
232
- `,children:g})]})]},f))})]}),v.jsxs(bs,{children:[v.jsx(at,{type:"button",variant:"ghost",disabled:d.isPending,onClick:e,children:t("common.cancel")}),v.jsxs(at,{type:"submit",disabled:o.length===0||!u.isSuccess||d.isPending,children:[d.isPending?v.jsx(yi,{className:"animate-spin"}):v.jsx(Xp,{}),v.jsx("span",{children:t(d.isPending?"settings.downloadingSkill":"settings.downloadSkill")})]})]})]}),v.jsxs(Td,{disabled:d.isPending,render:v.jsx(at,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:t("a11y.close")})]})]})})}function aV({disabled:e=!1}){const{t}=mt(),[i,s]=b.useState(!1);return v.jsxs(Xa,{label:v.jsxs("span",{className:"flex items-center gap-1",children:[t("settings.downloadSkill"),v.jsxs(Qh,{children:[v.jsx(Xh,{render:v.jsx(at,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground","aria-label":t("settings.aboutFoundrySkill")}),children:v.jsx(rL,{})}),v.jsx(Zh,{children:t("settings.foundrySkillHint")})]})]}),children:[v.jsxs(at,{type:"button",variant:"outline",disabled:e,onClick:()=>s(!0),children:[v.jsx(Xp,{}),t("settings.downloadSkill")]}),i&&v.jsx(sV,{onClose:()=>s(!1)})]})}function oV({className:e,...t}){return v.jsx("div",{"data-slot":"input-group",role:"group",className:Fe("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),...t})}const lV=Uo("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 cV({className:e,align:t="inline-start",...i}){return v.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:Fe(lV({align:t}),e),onClick:s=>{s.target.closest("button")||s.currentTarget.parentElement?.querySelector("input")?.focus()},...i})}const uV=Uo("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 dV({className:e,type:t="button",variant:i="ghost",size:s="xs",...o}){return v.jsx(at,{type:t,"data-size":s,variant:i,className:Fe(uV({size:s}),e),...o})}function fV({className:e,...t}){return v.jsx(xd,{"data-slot":"input-group-control",className:Fe("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",e),...t})}function gv({id:e,disabled:t,...i}){const{t:s}=mt(),o=b.useId(),c=e??o,[u,d]=b.useState(!1),f=s(u?"a11y.hidePassword":"a11y.showPassword");return v.jsxs(oV,{"data-disabled":t,children:[v.jsx(fV,{...i,id:c,type:u?"text":"password",disabled:t}),v.jsx(cV,{align:"inline-end",children:v.jsx(dV,{type:"button",size:"icon-xs","aria-label":f,"aria-controls":c,title:f,disabled:t,onClick:()=>d(g=>!g),children:u?v.jsx(sL,{}):v.jsx(aL,{})})})]})}function hV(e,t){const i=URL.createObjectURL(e),s=document.createElement("a");s.href=i,s.download=t,document.body.append(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}async function pV(e){const t=await fetch("/api/data-export",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error("Unable to export data");const i=t.headers.get("content-disposition")??"",s=/filename="([^"]+)"/u.exec(i)?.[1]??"foundry.foundry-backup";hV(await t.blob(),s)}function gV({onClose:e}){const{t}=mt(),i=b.useId(),s=b.useId(),[o,c]=b.useState(""),[u,d]=b.useState(""),f=sr({mutationFn:pV,onSuccess:()=>{Qt.success(t("dataExport.exported")),e()},onError:()=>{Qt.error(t("dataExport.error"))}});return v.jsx(Rs,{open:!0,onOpenChange:g=>{!g&&!f.isPending&&e()},children:v.jsxs(Cs,{showCloseButton:!1,children:[v.jsxs("form",{className:"flex flex-col gap-4","aria-busy":f.isPending,onSubmit:g=>{if(g.preventDefault(),!(!o||!u||f.isPending)){if(o!==u){Qt.error(t("dataExport.passphraseMismatch"));return}f.mutate({passphrase:o})}},children:[v.jsxs(Ji,{children:[v.jsx(Wi,{children:t("dataExport.title")}),v.jsx(xs,{children:t("dataExport.description")})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ws,{htmlFor:i,children:t("dataExport.passphrase")}),v.jsx(gv,{id:i,autoComplete:"new-password",required:!0,value:o,disabled:f.isPending,onChange:g=>c(g.target.value)})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ws,{htmlFor:s,children:t("dataExport.confirmPassphrase")}),v.jsx(gv,{id:s,autoComplete:"new-password",required:!0,value:u,disabled:f.isPending,"aria-invalid":u.length>0&&o!==u,onChange:g=>d(g.target.value)})]}),v.jsxs("p",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[v.jsx(pL,{className:"size-4 shrink-0"}),v.jsx("span",{children:t("dataExport.passphraseHint")})]}),v.jsxs(bs,{children:[v.jsx(at,{type:"button",variant:"ghost",disabled:f.isPending,onClick:e,children:t("common.cancel")}),v.jsxs(at,{type:"submit",disabled:!o||!u||f.isPending,children:[f.isPending?v.jsx(yi,{className:"animate-spin"}):v.jsx(kT,{}),v.jsx("span",{children:t(f.isPending?"dataExport.exporting":"dataExport.action")})]})]})]}),v.jsxs(Td,{disabled:f.isPending,render:v.jsx(at,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:t("a11y.close")})]})]})})}function mV({disabled:e=!1}){const{t}=mt(),[i,s]=b.useState(!1);return v.jsxs(Xa,{label:t("settings.export"),children:[v.jsxs(at,{type:"button",variant:"outline",disabled:e,onClick:()=>s(!0),children:[v.jsx(kT,{}),t("settings.export")]}),i&&v.jsx(gV,{onClose:()=>s(!1)})]})}class Jb extends Error{constructor(t){super(t),this.code=t}code}async function yV(e,t){const i=await fetch("/api/data-import",{method:"POST",headers:{"content-type":"application/octet-stream","x-foundry-passphrase":encodeURIComponent(t)},body:e});return await xM(i),i.json()}async function vV(e){const t=await fetch("/api/data-import/agents",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});await xM(t)}async function xM(e){if(e.ok)return;let t="IMPORT_FAILED";try{const s=(await e.json()).error?.code;(s==="INVALID_BACKUP"||s==="INVALID_PASSPHRASE"||s==="IMPORT_CHANGED"||s==="AGENT_APPLY_FAILED")&&(t=s)}catch{}throw new Jb(t)}function bV({file:e,onClose:t}){const{t:i}=mt(),s=b.useId(),[o,c]=b.useState(""),u=sr({mutationFn:()=>yV(e,o),onSuccess:()=>c(""),onError:h=>Qt.error(i(Ty(h)))}),d=sr({mutationFn:h=>vV({apply:h,agentRevision:u.data.agentRevision}),onSuccess:()=>location.replace(`${location.pathname}${location.search}`),onError:h=>Qt.error(i(Ty(h)))}),f=u.isPending||d.isPending||d.isSuccess,g=d.error instanceof Jb&&d.error.code==="IMPORT_CHANGED",m=()=>{f||(g?location.replace(`${location.pathname}${location.search}`):u.isSuccess?d.mutate(!1):t())};return v.jsx(Rs,{open:!0,onOpenChange:h=>{h||m()},children:v.jsxs(Cs,{showCloseButton:!1,children:[u.isSuccess?v.jsxs("div",{className:"flex flex-col gap-4","aria-busy":f,children:[v.jsxs(Ji,{children:[v.jsx(Wi,{children:i("dataImport.applyTitle")}),v.jsx(xs,{children:i("dataImport.applyDescription")})]}),d.isError&&v.jsx("p",{role:"alert",className:"text-sm text-destructive",children:i(Ty(d.error))}),v.jsxs(bs,{children:[v.jsx(at,{type:"button",variant:"ghost",disabled:f,onClick:m,children:i("dataImport.skipAgents")}),v.jsxs(at,{type:"button",disabled:f||g,onClick:()=>d.mutate(!0),children:[d.isPending&&v.jsx(yi,{className:"animate-spin"}),v.jsx("span",{children:i("dataImport.applyAgents")})]})]})]}):v.jsxs("form",{className:"flex flex-col gap-4","aria-busy":f,onSubmit:h=>{h.preventDefault(),!f&&o&&u.mutate()},children:[v.jsxs(Ji,{children:[v.jsx(Wi,{children:i("dataImport.title")}),v.jsx(xs,{className:"break-all",children:e.name})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ws,{htmlFor:s,children:i("dataImport.passphrase")}),v.jsx(gv,{id:s,autoComplete:"current-password",required:!0,value:o,disabled:f,onChange:h=>c(h.target.value)})]}),v.jsx("p",{className:"text-xs text-muted-foreground",children:i("dataImport.replaceWarning")}),v.jsxs(bs,{children:[v.jsx(at,{type:"button",variant:"ghost",disabled:f,onClick:m,children:i("common.cancel")}),v.jsxs(at,{type:"submit",variant:"destructive",disabled:f||!o,children:[f?v.jsx(yi,{className:"animate-spin"}):v.jsx(CT,{}),v.jsx("span",{children:i("dataImport.replaceAction")})]})]})]}),v.jsxs(at,{type:"button",disabled:f,onClick:m,variant:"ghost",size:"icon",className:"absolute top-2 right-2",children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:i("a11y.close")})]})]})})}function Ty(e){if(e instanceof Jb)switch(e.code){case"IMPORT_CHANGED":return"dataImport.changed";case"AGENT_APPLY_FAILED":return"dataImport.applyError";case"INVALID_BACKUP":return"dataImport.invalidBackup";case"INVALID_PASSPHRASE":return"dataImport.invalidPassphrase"}return"dataImport.error"}function xV({disabled:e=!1}){const{t}=mt(),i=b.useRef(null),[s,o]=b.useState(null);return v.jsxs(Xa,{label:t("settings.import"),children:[v.jsx("input",{ref:i,type:"file",accept:".foundry-backup,application/octet-stream",hidden:!0,onChange:c=>{o(c.target.files?.[0]??null),c.target.value=""}}),v.jsxs(at,{type:"button",variant:"outline",disabled:e,onClick:()=>i.current?.click(),children:[v.jsx(CT,{}),t("settings.import")]}),s&&v.jsx(bV,{file:s,onClose:()=>o(null)})]})}const SV="data-checked",wV="data-unchecked",mv={checked(e){return e?{[SV]:""}:{[wV]:""}},...ws,...hc},SM=b.createContext(void 0);function EV(){return b.useContext(SM)}const wM=b.createContext(void 0);function RV(){const e=b.useContext(wM);if(e===void 0)throw new Error(gn(52));return e}const CV=b.forwardRef(function(t,i){const{render:s,className:o,disabled:c=!1,readOnly:u=!1,required:d=!1,"aria-labelledby":f,value:g,inputRef:m,nativeButton:h=!1,id:x,style:S,...w}=t,C=EV(),{disabled:E,readOnly:R,required:k,form:O,checkedValue:A,touched:N=!1,validation:j,name:D,setCheckedValue:M=En,setTouched:_=En,registerInputRef:L=En}=C??{},{setTouched:q,setFilled:X,state:B,disabled:H}=ra(),U=aA(),{labelId:z,getDescriptionProps:Q}=Yo(),$=H||U.disabled||E||c,K=R||u,Y=k||d,ee=O,G=C?A===g:g==="",oe=b.useRef(null),I=vd($,oe),V=b.useRef(null),W=j?.registerInput,re=b.useCallback(Ze=>W?.(Ze,{controlRef:oe,value:void 0}),[W]),Ee=Wr(m,V,L,re);_e(()=>{V.current?.checked&&X(!0)},[X]),_e(()=>{if(V.current){if($&&G){L(null);return}L(V.current)}},[G,$,L]);const le=ar(),me=pc({id:x}),ge=h?void 0:me,ue=Lb(f,z,V,!h,ge,w["aria-label"]),Te={role:"radio","aria-checked":G,"aria-labelledby":ue,[Xb]:G?"":void 0,id:h?me:le,onKeyDown(Ze){Ze.key==="Enter"&&Ze.preventDefault()},onClick(Ze){if(Ze.defaultPrevented||$||K)return;Ze.preventDefault();const ot=V.current;ot&&No(ot,Ze)},onFocus(Ze){I(!0),!(Ze.defaultPrevented||$||K||!N)&&(V.current?.click(),_(!1))},onBlur(){C||I(!1)}},{getButtonProps:ve,buttonRef:Pe}=vi({disabled:$,native:h,composite:!1}),Oe={type:"radio",ref:Ee,form:ee,id:ge,name:D,tabIndex:-1,style:D?Cp:nd,"aria-hidden":!0,...g!==void 0?{value:np(g)}:Xt,disabled:$,checked:G,required:Y,readOnly:K,onChange(Ze){if(Ze.nativeEvent.defaultPrevented||$||K||g===void 0)return;const ot=ut(Mr,Ze.nativeEvent);M(g,ot),!ot.isCanceled&&q(!0)},onClick(Ze){Ze.stopPropagation()},onFocus(){oe.current?.focus()}},Le=b.useMemo(()=>({...B,required:Y,disabled:$,readOnly:K,checked:G}),[B,$,K,G,Y]),Ve=Le,ke=C!==void 0,Ue=[i,oe,Pe],be=[Te,w,ve,Q,j?Ze=>j.getValidationProps($,Ze):Xt],He=kt("span",t,{enabled:!ke,state:Le,ref:Ue,props:be,stateAttributesMapping:mv});return v.jsxs(wM.Provider,{value:Ve,children:[ke?v.jsx(jb,{tag:"span",render:s,className:o,style:S,state:Le,refs:Ue,props:be,stateAttributesMapping:mv}):He,v.jsx("input",{...Oe,suppressHydrationWarning:!0})]})}),TV=b.forwardRef(function(t,i){const{render:s,className:o,style:c,keepMounted:u=!1,...d}=t,f=RV(),g=f.checked,{mounted:m,transitionStatus:h,setMounted:x}=_o(g),S={...f,transitionStatus:h},w=b.useRef(null),C=u||m,E=kt("span",t,{ref:[i,w],state:S,props:d,stateAttributesMapping:mv});return Li({batch:!0,enabled:!g,open:g,ref:w,onComplete(){g||x(!1)}}),C?E:null}),kV=[Ak],OV=b.forwardRef(function(t,i){const{render:s,className:o,disabled:c,readOnly:u,required:d,onValueChange:f,value:g,defaultValue:m,form:h,name:x,inputRef:S,id:w,style:C,...E}=t,{setTouched:R,setFocused:k,validationMode:O,name:A,disabled:N,state:j,validation:D,setDirty:M,setFilled:_,validityData:L}=ra(),{labelId:q}=Yo(),{clearErrors:X,elementRef:B}=yd(),H=lH(!0),U=N||c,z=A??x,Q=ar(w),[$,K]=Js({controlled:g,default:m,name:"RadioGroup",state:"value"}),[Y,ee]=b.useState(!1),G=Be((Oe,Le)=>{f?.(Oe,Le),!Le.isCanceled&&K(Oe)}),oe=D.getInputControl,I=b.useMemo(()=>({get current(){return oe()}}),[oe]),V=b.useRef(null),W=b.useRef(null),re=Wr(V,S),Ee=b.useRef(re),le=Be(Oe=>{V.current===Oe&&Ee.current===re||(Ee.current=re,re?.(Oe))});_e(()=>{le(V.current)},[re,le]);const me=Be(Oe=>{if(Oe){if(!Oe.disabled){W.current||(W.current=Oe);const Le=V.current;(Oe.checked||Le==null||Le.disabled)&&le(Oe)}return()=>{W.current===Oe&&(W.current=null),V.current===Oe&&le(null)}}}),ge=Be(()=>{const Oe=B.current;if(!Oe)return $??null;for(const Le of D.registeredInputs.keys())if(Le.checked&&hH(Le,Oe))return $??null;return null});bd(I,Q,$??null,ge,!U,x),cc($,()=>{X(z),M($!==L.initialValue),_($!=null),D.change($);const Oe=W.current;$==null&&Oe&&!Oe.disabled&&le(Oe)});const ue=q??H?.legendId,Te={...j,disabled:U??!1,required:d??!1,readOnly:u??!1},ve=b.useMemo(()=>({checkedValue:$,disabled:U,form:h,validation:D,name:z,readOnly:u,registerInputRef:me,required:d,setCheckedValue:G,setTouched:ee,touched:Y}),[$,U,h,D,z,u,me,d,G,ee,Y]),Pe={id:w,role:"radiogroup","aria-required":d||void 0,"aria-disabled":U||void 0,"aria-readonly":u||void 0,"aria-labelledby":ue,onBlur(Oe){it(Oe.currentTarget,Oe.relatedTarget)||(ee(!1),R(!0),k(!1),O==="onBlur"&&D.commit($))},onKeyDownCapture(Oe){Oe.key.startsWith("Arrow")&&ee(!0)}};return v.jsx(SM.Provider,{value:ve,children:v.jsx(pM,{render:s,className:o,style:C,state:Te,props:[Pe,E,Oe=>D.getValidationProps(U??!1,Oe)],refs:[i],stateAttributesMapping:hc,enableHomeAndEndKeys:!1,modifierKeys:kV})})});function AV({className:e,...t}){return v.jsx(OV,{"data-slot":"radio-group",className:Fe("grid w-full gap-3",e),...t})}function MV({className:e,...t}){return v.jsx(CV,{"data-slot":"radio-group-item",className:Fe("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),...t,children:v.jsx(TV,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:v.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 NV=[{value:"system",labelKey:"common.system"},{value:"light",labelKey:"theme.light"},{value:"dark",labelKey:"theme.dark"}];function DV({value:e,onValueChange:t,disabled:i=!1}){const{t:s}=mt();return v.jsx(Xa,{label:s("settings.colorTheme"),children:v.jsx(AV,{"aria-label":s("settings.colorTheme"),value:e,onValueChange:t,disabled:i,"aria-busy":i,className:"flex w-auto flex-row flex-wrap items-center gap-x-6 gap-y-2",children:NV.map(o=>v.jsxs("label",{className:Fe("flex items-center gap-2 text-sm select-none",o.value===e?"font-medium text-foreground":"text-muted-foreground",i?"cursor-not-allowed opacity-60":"cursor-pointer"),children:[v.jsx(MV,{value:o.value,disabled:i}),v.jsx("span",{children:s(o.labelKey)})]},o.value))})})}function jV(e){const t=b.useRef(!0);t.current&&(t.current=!1,e())}const EM=b.createContext(void 0),RM=b.createContext(void 0);function ks(){const e=b.useContext(EM);if(e===void 0)throw new Error(gn(60));return e}function CM(){const e=b.useContext(RM);if(e===void 0)throw new Error(gn(61));return e}function IV(e,t,i=Object.is){const{length:s}=e;if(s!==t.length)return!1;for(let o=0;o<s;o+=1)if(!i(e[o],t[o]))return!1;return!0}const TM=(e,t)=>Object.is(e,t);function zo(e,t,i){return e==null||t==null?Object.is(e,t):i(e,t)}function PV(e,t,i){return Array.isArray(e)&&Array.isArray(t)?!IV(e,t,(s,o)=>zo(s,o,i)):e!==t}function yv(e,t,i){return e?e.some(s=>s===void 0?!1:zo(t,s,i)):!1}function Ph(e,t,i){return e?e.findIndex(s=>s===void 0?!1:zo(s,t,i)):-1}function LV(e,t){if(t!==TM)return s=>yv(e,s,t);const i=new Set(e);return i.delete(void 0),s=>i.has(s)&&(s!==0||e.some(o=>Object.is(s,o)))}function kM(e,t,i,s){const o=s&&Array.isArray(t)?e.findIndex(LV(t,i)):Ph(e,t,i);return o===-1?null:o}function zV(e,t,i,s,o,c){return yv(s,t,o)?c!=null&&e>c&&yv(s,i[c],o)?c:e:e===c?kM(i,s,o,!0):c}function _V(e,t,i){return e.filter(s=>!zo(t,s,i))}const UV={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:t,multiple:i,itemToStringValue:s}=e;return t==null?!1:i&&Array.isArray(t)?t.length>0:Ul(t,s)!==""},hasNullItemLabel:(e,t)=>t?XU(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,t)=>e.activeIndex===t,isSelected:(e,t)=>{const i=e.isItemEqualToValue,s=e.value;return e.multiple?Array.isArray(s)&&s.some(o=>zo(t,o,i)):zo(t,s,i)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,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 Ru(e,t=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,i))}const Gi=1;function Wb(e,t){return Math.max(0,e-t)}function fp(e,t){if(t<=0)return 0;const i=Ru(e,0,t),s=i,o=t-i,c=s<=Gi,u=o<=Gi;return c&&u?s<=o?0:t:c?0:u?t:i}function HV(e){const{id:t,value:i,defaultValue:s=null,onValueChange:o,open:c,defaultOpen:u=!1,onOpenChange:d,name:f,form:g,autoComplete:m,disabled:h=!1,readOnly:x=!1,required:S=!1,modal:w=!0,actionsRef:C,inputRef:E,onOpenChangeComplete:R,items:k,multiple:O=!1,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:j=TM,highlightItemOnHover:D=!0,children:M}=e,{clearErrors:_}=yd(),{setDirty:L,setTouched:q,setFocused:X,validityData:B,setFilled:H,name:U,disabled:z,validation:Q,validationMode:$}=ra(),K=pc({id:t}),Y=z||h,ee=U??f,[G,oe]=Js({controlled:i,default:O?s??$i:s,name:"Select",state:"value"}),[I,V]=Js({controlled:c,default:u,name:"Select",state:"open"}),W=b.useRef([]),re=b.useRef([]),Ee=b.useRef(null),le=b.useRef(null),me=b.useRef(0),ge=b.useRef(null),ue=b.useRef([]),Te=b.useRef(!1),ve=b.useRef(null),Pe=b.useRef(null),Oe=b.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Le=b.useRef(!1),Ve=b.useRef(G),{openMethod:ke,triggerProps:Ue}=Rk(I),be=er(()=>new oc({id:K,labelId:void 0,modal:w,multiple:O,disabled:Y,readOnly:x,required:S,highlightItemOnHover:D,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:j,value:G,open:I,mounted:I,transitionStatus:void 0,items:k,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Xt,triggerProps:Xt,itemRoot:{props:Xt,multiple:O,disabled:Y,readOnly:x,isItemEqualToValue:j},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:En,setOpen:En,handleScrollArrowVisibility:En,onOpenChangeComplete:En,listRef:W,popupRef:Ee,scrollHandlerRef:le,scrollArrowsMountedCountRef:me,valueRef:ge,valuesRef:ue,labelsRef:re,typingRef:Te,selectionRef:Oe,firstItemTextRef:ve,selectedItemTextRef:Pe,alignItemWithTriggerActiveRef:Le,initialValueRef:Ve},UV)).current,[He,Ze]=b.useState(!1),{mounted:ot,transitionStatus:de,forceUnmount:we}=jC({open:I,ref:Ee,preventUnmountOnClose:He,setPreventUnmountOnClose:Ze,onUnmount(){be.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),R?.(!1)}}),Ge=be.useState("activeIndex"),Me=be.useState("selectedIndex"),De=be.useState("triggerElement"),bt=be.useState("positionerElement"),dt=P3(ke),pt=ke??dt,Nt=b.useMemo(()=>O?"":Ul(G,N),[O,G,N]),jt=b.useMemo(()=>O&&Array.isArray(G)?G.map(F=>Ul(F,N)):Ul(G,N),[O,G,N]),tn=Ln(De),an=Be(()=>jt);bd(tn,K,G,an,!Y,f);const nn=O?Array.isArray(G)&&G.length>0:G!=null&&Nt!=="";_e(()=>{H(nn)},[nn,H]),_e(function(){const J=kM(ue.current,G,j,O);J===null&&(Pe.current=null),!I&&be.set("selectedIndex",J)},[O,I,G,j,be]),cc(G,()=>{_(ee),L(PV(G,B.initialValue,j)),Q.change(G)});const We=Be((F,J)=>{const ne=J,ye=Pp(ne);d?.(F,ne),!J.isCanceled&&(F||Ze(ye()),V(F),!F&&(J.reason===Ha||J.reason===Rp)&&(q(!0),X(!1),$==="onBlur"&&Q.commit(G)))});b.useImperativeHandle(C,()=>({unmount:we,close:()=>{be.state.open&&We(!1,ut(td))}}),[we,We,be]);const wt=Be((F,J)=>{o?.(F,J),!J.isCanceled&&oe(F)}),Zt=Be(F=>{const J=Wb(F.scrollHeight,F.clientHeight),ne=fp(F.scrollTop,J),ye=ne>0,xe=ne<J;be.set("scrollUpArrowVisible",ye),be.set("scrollDownArrowVisible",xe)}),ht=yI({open:I,onOpenChange:We,elements:{reference:De,floating:bt}}),xt=Np(ht,{enabled:!Y,event:"mousedown"}),yt=rd(ht),Ut=BC(ht,{enabled:!Y,listRef:W,activeIndex:Ge,selectedIndex:Me,disabledIndices:$i,onNavigate(F){F===null&&!I||be.set("activeIndex",F)},focusItemOnHover:D}),un=VC(ht,{enabled:!Y&&(I||!x&&!O),listRef:re,activeIndex:Ge,selectedIndex:Me,disabledIndices:F=>eA(W.current[F]),onMatch(F){I?be.set("activeIndex",F):wt(ue.current[F],ut(Mr))},onTyping(F){Te.current=F}}),je=b.useMemo(()=>Ar(un.reference,Ut.reference,yt.reference,xt.reference,Ue),[xt.reference,un.reference,Ut.reference,yt.reference,Ue]),st=b.useMemo(()=>Ar(id,un.floating,Ut.floating,yt.floating),[un.floating,Ut.floating,yt.floating]),Ie=Ut.item??Xt,ze=b.useMemo(()=>({props:Ie,multiple:O,disabled:Y,readOnly:x,isItemEqualToValue:j}),[Ie,O,Y,x,j]);be.useContextCallback("setValue",wt),be.useContextCallback("setOpen",We),be.useContextCallback("handleScrollArrowVisibility",Zt),be.useContextCallback("onOpenChangeComplete",R),jV(()=>{be.update({popupProps:st,triggerProps:je,itemRoot:ze})}),be.useSyncedValues({id:K,modal:w,multiple:O,disabled:Y,readOnly:x,required:S,highlightItemOnHover:D,value:G,open:I,mounted:ot,transitionStatus:de,popupProps:st,triggerProps:je,itemRoot:ze,items:k,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:j,openMethod:pt});const $e=Wr(E,Q.inputRef),et=O?void 0:ee,Tt=b.useMemo(()=>!O||!Array.isArray(G)||!ee?null:G.map(F=>{const J=Ul(F,N);return v.jsx("input",{type:"hidden",form:g,name:ee,value:J,disabled:Y},J)}),[O,G,g,ee,N,Y]);return v.jsxs(EM.Provider,{value:be,children:[v.jsx(RM.Provider,{value:ht,children:M}),v.jsx("input",{...Q.getValidationProps(Y,{onFocus(){be.state.triggerElement?.focus({focusVisible:!0})},onChange(F){if(F.nativeEvent.defaultPrevented||Y||x)return;const J=F.currentTarget.value,ne=ut(Mr,F.nativeEvent);function ye(){if(O)return;const xe=J.toLowerCase();let qe=ue.current.findIndex(Xe=>Ul(Xe,N).toLowerCase()===xe||nA(Xe,A).toLowerCase()===xe);qe===-1&&(qe=ue.current.findIndex((Xe,Qe)=>{const lt=re.current[Qe];return lt!=null&&lt.toLowerCase()===xe}));const Ke=ue.current[qe];Ke!=null&&wt(Ke,ne)}be.set("forceMount",!0),queueMicrotask(ye)}}),id:K&&et==null?`${K}-hidden-input`:void 0,form:g,name:et,autoComplete:m,value:Nt,disabled:Y,required:S&&!(O&&nn),readOnly:x,ref:$e,style:ee?Cp:nd,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tt]})}function FV(e,t){return e??t}const BV="data-popup-side",VV=400,KV={...zu,...hc,popupSide:e=>e?{[BV]:e}:null,value:()=>null},qV=b.forwardRef(function(t,i){const{render:s,className:o,id:c,disabled:u=!1,nativeButton:d=!0,style:f,...g}=t,{setTouched:m,validationMode:h,validation:x,state:S,disabled:w}=ra(),{labelId:C}=Yo(),E=ks(),R=E.useState("readOnly"),k=E.useState("required"),O=E.useState("disabled"),A=w||O||u,N=E.useState("open"),j=E.useState("mounted"),D=E.useState("value"),M=E.useState("triggerProps"),_=E.useState("positionerElement"),L=E.useState("listElement"),q=E.useState("popupSide"),X=E.useState("id"),B=E.useState("labelId"),H=E.useState("hasSelectedValue"),U=j&&_?q:null,z=c??X,Q=FV(C,B);pc({id:c});const $=Ln(_),K=b.useRef(null),Y=vd(A,K),{getButtonProps:ee,buttonRef:G}=vi({disabled:A,native:d}),oe=E.useStateSetter("triggerElement"),I=Un(),V=Un(),W=Un();b.useEffect(()=>{if(N)return W.start(VV,()=>{E.context.selectionRef.current.allowUnselectedMouseUp=!0,E.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{W.clear()};E.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},V.clear()},[N,E,V,W]);const re=Ar(M,{id:z,role:"combobox","aria-expanded":N,"aria-haspopup":"listbox","aria-controls":N?L?.id??_h(_)?.id:void 0,"aria-labelledby":Q,"aria-readonly":R||void 0,"aria-required":k||void 0,tabIndex:A?-1:0,onFocus(me){Y(!0),N&&E.context.alignItemWithTriggerActiveRef.current&&E.context.setOpen(!1,ut(Mr,me.nativeEvent)),I.start(0,()=>{E.set("forceMount",!0)})},onBlur(me){it(_,me.relatedTarget)||(m(!0),Y(!1),h==="onBlur"&&x.commit(D))},onMouseDown(me){if(N)return;const ge=$t(me.currentTarget);function ue(Te){if(!K.current)return;const ve=Te.target;it(K.current,ve)||it($.current,ve)||WO(Te,K.current)||E.context.setOpen(!1,ut(Av,Te))}V.start(0,()=>{ge.addEventListener("mouseup",ue,{once:!0})})}},g,ee),Ee=x.getValidationProps(A,re);Ee.role="combobox";const le={...S,open:N,disabled:A,value:D,readOnly:R,popupSide:U,placeholder:!H};return kt("button",t,{ref:[i,K,G,oe],state:le,stateAttributesMapping:KV,props:Ee})}),YV={value:()=>null},GV=b.forwardRef(function(t,i){const{className:s,render:o,children:c,placeholder:u,style:d,...f}=t,g=ks(),m=g.useState("value"),h=g.useState("items"),x=g.useState("itemToStringLabel"),S=g.useState("hasSelectedValue"),w=!S&&u!=null&&c==null,C=g.useState("hasNullItemLabel",w),E={value:m,placeholder:!S};let R=null;return typeof c=="function"?R=c(m):c!=null?R=c:w&&!C?R=u:Array.isArray(m)?R=ZU(m,h,x):R=rA(m,h,x),kt("span",t,{state:E,ref:[i,g.context.valueRef],props:[{children:R},f],stateAttributesMapping:YV})}),$V=b.forwardRef(function(t,i){const{render:s,className:o,style:c,...u}=t,g={open:ks().useState("open")};return kt("span",t,{state:g,ref:i,props:[{"aria-hidden":!0,children:"▼"},u],stateAttributesMapping:wp})}),QV=b.forwardRef(function(t,i){const s=ks(),o=s.useState("mounted"),c=s.useState("forceMount");return o||c?v.jsx(Ap,{ref:i,...t}):null}),OM=b.createContext(void 0);function ex(){const e=b.useContext(OM);if(!e)throw new Error(gn(59));return e}function hp(e,t){e&&Object.assign(e.style,t)}const AM={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},XV={position:"fixed"},ZV=b.forwardRef(function(t,i){const{anchor:s,className:o,render:c,positionMethod:u,side:d,align:f,sideOffset:g,alignOffset:m,collisionBoundary:h="clipping-ancestors",collisionPadding:x,arrowPadding:S,sticky:w,disableAnchorTracking:C,alignItemWithTrigger:E=!0,collisionAvoidance:R=EC,style:k,...O}=t,A=ks(),N=CM(),j=A.useState("open"),D=A.useState("mounted"),M=A.useState("modal"),_=A.useState("value"),L=A.useState("openMethod"),q=A.useState("positionerElement"),X=A.useState("triggerElement"),B=A.useState("isItemEqualToValue"),H=A.useState("transitionStatus"),U=b.useRef(null),z=b.useRef(null),[Q,$]=b.useState(E),K=D&&Q&&L!=="touch";!D&&Q!==E&&$(E),b.useImperativeHandle(A.context.alignItemWithTriggerActiveRef,()=>K),lb((K||M)&&j,L==="touch",q,X);const Y=Yp({anchor:s,floatingRootContext:N,positionMethod:u,mounted:D,side:d,sideOffset:g,align:f,alignOffset:m,arrowPadding:S,collisionBoundary:h,collisionPadding:x,sticky:w,disableAnchorTracking:C??K,collisionAvoidance:R,keepMounted:!0}),ee=K?"none":Y.side,G=K?XV:Y.positionerStyles,oe={open:j,side:ee,align:Y.align,anchorHidden:Y.anchorHidden};_e(()=>{A.set("popupSide",Y.side)},[A,Y.side]);const I=A.useStateSetter("positionerElement"),V=Gp(t,oe,{styles:G,transitionStatus:H,props:O,refs:[i,I],hidden:!D,inert:!j}),W=b.useRef(0),re=Be(le=>{if(A.context.valuesRef.current.length===0)return;const me=W.current;W.current=le.size;const ge=ut(Mr);if(me!==0&&!A.state.multiple&&_!==null&&Ph(A.context.valuesRef.current,_,B)===-1){const Te=A.context.initialValueRef.current,Pe=Te!=null&&Ph(A.context.valuesRef.current,Te,B)!==-1?Te:null;A.context.setValue(Pe,ge),Pe===null&&(A.set("selectedIndex",null),A.context.selectedItemTextRef.current=null)}if(me!==0&&A.state.multiple&&Array.isArray(_)){const ue=_.filter(Te=>Ph(A.context.valuesRef.current,Te,B)!==-1);ue.length!==_.length&&(A.context.setValue(ue,ge),ue.length===0&&(A.set("selectedIndex",null),A.context.selectedItemTextRef.current=null))}if(j&&K){A.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ue={height:""};hp(q,ue),hp(A.context.popupRef.current,ue)}}),Ee=b.useMemo(()=>({...Y,side:ee,alignItemWithTriggerActive:K,setControlledAlignItemWithTrigger:$,scrollUpArrowRef:U,scrollDownArrowRef:z}),[Y,ee,K,$]);return v.jsx(Db,{elementsRef:A.context.listRef,labelsRef:A.context.labelsRef,onMapChange:re,children:v.jsxs(OM.Provider,{value:Ee,children:[D&&M&&v.jsx(Wp,{inert:$p(!j),cutout:X}),V]})})}),vh="base-ui-disable-scrollbar",vv={className:vh,getElement(e){return v.jsx("style",{nonce:e,href:vh,precedence:"base-ui:low",children:`.${vh}{scrollbar-width:none}.${vh}::-webkit-scrollbar{display:none}`})}},JV=b.createContext(void 0),WV={disableStyleElements:!1};function eK(){return b.useContext(JV)??WV}const LR="--transform-origin",tK={...Ju,...ws},nK=b.forwardRef(function(t,i){const{render:s,className:o,style:c,finalFocus:u,...d}=t,f=ks(),g=f.useState("multiple"),m=f.useState("readOnly"),h=f.useState("highlightItemOnHover"),x=CM(),{side:S,align:w,alignItemWithTriggerActive:C,isPositioned:E,setControlledAlignItemWithTrigger:R}=ex(),k=tg()!=null,O=qp(),{nonce:A,disableStyleElements:N}=eK(),j=f.useState("id"),D=f.useState("open"),M=f.useState("openMethod"),_=f.useState("mounted"),L=f.useState("popupProps"),q=f.useState("transitionStatus"),X=f.useState("triggerElement"),B=f.useState("positionerElement"),H=f.useState("listElement"),U=b.useRef(!1),z=b.useRef(!1),Q=b.useRef({}),$=tc(),K=Be(oe=>{if(!B||!f.context.popupRef.current||!z.current)return;const I=B.style.top==="0px",V=B.style.bottom==="0px";if(U.current||!C||!I&&!V){f.context.handleScrollArrowVisibility(oe);return}const W=_R(B),re=Cu(B.getBoundingClientRect().height,"y",W),Ee=$t(B),le=Rn(B),me=le.getComputedStyle(B),ge=parseFloat(me.marginTop),ue=parseFloat(me.marginBottom),Te=zR(le.getComputedStyle(f.context.popupRef.current)),ve=Math.min(Ee.documentElement.clientHeight-ge-ue,Te),Pe=oe.scrollTop,Oe=bh(oe);let Le=null;const Ve=He=>{B.style.height=`${He}px`},ke=I?Oe-Pe:Pe,Ue=Math.min(re+ke,ve);if(ke<=Gi){const He=Ru(ke,0,ve-re);He>0&&Ve(re+He),oe.scrollTop=I?Oe:0,ve-(re+He)<=Gi&&(U.current=!0),f.context.handleScrollArrowVisibility(oe);return}if(ve-Ue>Gi)Le=I?1/0:0;else if(V&&Pe<Oe){const He=re+ke-ve;Le=Pe-(ke-He)}const be=Math.ceil(Ue);if(be!==0&&Ve(be),Le!=null){const He=Ru(Le,0,bh(oe));Math.abs(oe.scrollTop-He)>Gi&&(oe.scrollTop=He)}be>=ve-Gi&&(U.current=!0),f.context.handleScrollArrowVisibility(oe)});b.useImperativeHandle(f.context.scrollHandlerRef,()=>K,[K]),Li({open:D,ref:f.context.popupRef,onComplete(){D&&f.context.onOpenChangeComplete(!0)}});const Y={open:D,transitionStatus:q,side:S,align:w};_e(()=>{!B||!f.context.popupRef.current||Object.keys(Q.current).length||(Q.current={top:B.style.top||"0",left:B.style.left||"0",right:B.style.right,height:B.style.height,bottom:B.style.bottom,minHeight:B.style.minHeight,maxHeight:B.style.maxHeight,marginTop:B.style.marginTop,marginBottom:B.style.marginBottom})},[f,B]),_e(()=>{D||C||(z.current=!1,U.current=!1,hp(B,Q.current))},[D,C,B]),_e(()=>{const oe=f.context.popupRef.current;if(!D||!X||!B||!oe||C&&!E||f.state.transitionStatus==="ending")return;if(z.current=!0,oe.style.removeProperty(LR),!C){$.request(()=>f.context.handleScrollArrowVisibility(H||oe));return}const I=rK(oe);try{let V=f.context.selectedItemTextRef.current;V?.isConnected||(V=!f.select("hasSelectedValue")&&f.context.firstItemTextRef.current?.isConnected?f.context.firstItemTextRef.current:null);const W=f.context.valueRef.current,re=Rn(B),Ee=re.getComputedStyle(B),le=re.getComputedStyle(oe),me=$t(X),ge=_R(X),ue=xh(X.getBoundingClientRect(),ge),Te=xh(B.getBoundingClientRect(),ge),ve=ue.height,Pe=H||oe,Oe=Pe.scrollHeight,Le=parseFloat(le.borderBottomWidth),Ve=parseFloat(Ee.marginTop)||10,ke=parseFloat(Ee.marginBottom)||10,Ue=parseFloat(Ee.minHeight)||100,be=zR(le),He=5,Ze=5,ot=20,de=me.documentElement.clientHeight-Ve-ke,we=me.documentElement.clientWidth,Ge=de-ue.bottom+ve;let Me,De=O==="rtl"?ue.right-Te.width:ue.left,bt=0;if(V&&W){const ht=xh(W.getBoundingClientRect(),ge);Me=xh(V.getBoundingClientRect(),ge),De=Te.left+(O==="rtl"?ht.right-Me.right:ht.left-Me.left);const xt=ht.top-ue.top+ht.height/2;bt=Me.top-Te.top+Me.height/2-xt}const dt=Ge+bt+ke+Le;let pt=Math.min(de,dt);const Nt=de-Ve-ke,jt=dt-pt,tn=we-Ze;B.style.left=`${Ru(De,He,tn-Te.width)}px`,B.style.height=`${pt}px`,B.style.maxHeight="none",B.style.marginTop=`${Ve}px`,B.style.marginBottom=`${ke}px`,oe.style.height="100%";const an=bh(Pe),nn=jt>=an-Gi;nn&&(pt=Math.min(de,Te.height)-(jt-an));const We=ue.top<ot||ue.bottom>de-ot||Math.ceil(pt)+Gi<Math.min(Oe,Ue),wt=(re.visualViewport?.scale??1)!==1&&Ss;if(We||wt){hp(B,Q.current),R(!1);return}const Zt=Math.max(Ue,pt);if(nn){const ht=Math.max(0,de-dt);B.style.top=Te.height>=Nt?"0":`${ht}px`,B.style.height=`${pt}px`,Pe.scrollTop=bh(Pe)}else B.style.bottom="0",Pe.scrollTop=jt;if(Me){const ht=Te.top,xt=Te.height,yt=Me.top+Me.height/2,Ut=Ru(xt>0?(yt-ht)/xt*100:50,0,100);oe.style.setProperty(LR,`50% ${Ut}%`)}(Zt===de||pt>=be)&&(U.current=!0),f.context.handleScrollArrowVisibility(Pe),h&&f.state.selectedIndex===null&&f.state.activeIndex===null&&f.context.listRef.current[0]!=null&&f.set("activeIndex",0)}finally{I()}},[f,D,B,X,C,R,$,H,h,O,E]),b.useEffect(()=>{if(!C||!B||!D)return;const oe=Rn(B);function I(V){f.context.setOpen(!1,ut(rj,V))}return Lt(oe,"resize",I)},[f,C,B,D]);const ee={...H?{role:"presentation"}:{role:"listbox","aria-multiselectable":g||void 0,"aria-readonly":m||void 0,id:`${j}-list`},onKeyDown(oe){k&&cd.has(oe.key)&&oe.stopPropagation()},onScroll(oe){H||K(oe.currentTarget)},...C&&{style:H?{height:"100%"}:AM},className:!H&&C?vv.className:void 0},G=kt("div",t,{ref:[i,f.context.popupRef],state:Y,stateAttributesMapping:tK,props:[L,ee,ad(q),d]});return v.jsxs(b.Fragment,{children:[!N&&vv.getElement(A),v.jsx(Mp,{context:x,modal:!1,disabled:!_,openInteractionType:M,returnFocus:u,restoreFocus:!0,children:G})]})});function zR(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function bh(e){return Wb(e.scrollHeight,e.clientHeight)}function _R(e){return QC.getScale(e)}function Cu(e,t,i){return e/i[t]}function xh(e,t){return _u({x:Cu(e.x,"x",t),y:Cu(e.y,"y",t),width:Cu(e.width,"x",t),height:Cu(e.height,"y",t)})}const UR=[["transform","none"],["scale","1"],["translate","0 0"]];function rK(e){const{style:t}=e,i={};for(const[s,o]of UR)i[s]=t.getPropertyValue(s),t.setProperty(s,o,"important");return()=>{for(const[s]of UR){const o=i[s];o?t.setProperty(s,o):t.removeProperty(s)}}}const iK=b.forwardRef(function(t,i){const{render:s,className:o,style:c,...u}=t,d=ks(),f=d.useState("multiple"),g=d.useState("readOnly"),{alignItemWithTriggerActive:m}=ex(),h=d.useState("hasScrollArrows"),x=d.useState("openMethod"),w={id:`${d.useState("id")}-list`,role:"listbox","aria-multiselectable":f||void 0,"aria-readonly":g||void 0,onScroll(E){d.context.scrollHandlerRef.current?.(E.currentTarget)},...m&&{style:AM},className:h&&x!=="touch"?vv.className:void 0},C=d.useStateSetter("listElement");return kt("div",t,{ref:[i,C],props:[w,u]})}),MM=b.createContext(void 0);function NM(){const e=b.useContext(MM);if(!e)throw new Error(gn(57));return e}const sK=b.memo(b.forwardRef(function(t,i){const{render:s,className:o,style:c,value:u=null,label:d,disabled:f=!1,nativeButton:g=!1,...m}=t,h=b.useRef(null),x=dg({guess:!0,label:d,textRef:h}),S=ks(),{props:w,multiple:C,disabled:E,readOnly:R,isItemEqualToValue:k}=S.useState("itemRoot"),O=E||f,A=S.useState("isActive",x.index),N=S.useState("open"),j=S.useState("isSelected",u),D=S.useState("isSelectedByFocus",x.index),M=x.index,_=b.useRef(null);_e(()=>{const Y=S.context.valuesRef.current;return Y[M]=u,()=>{delete Y[M]}},[M,u,S]),_e(()=>{const Y=S.state.value,ee=S.state.selectedIndex;let G=ee,oe;C&&Array.isArray(Y)?(G=zV(M,u,S.context.valuesRef.current,Y,k,ee),oe=G===M,M===ee&&!oe&&(S.context.selectedItemTextRef.current=null)):(oe=Y!==void 0&&zo(u,Y,k),oe&&(G=M)),S.set("selectedIndex",G),oe&&h.current&&(S.context.selectedItemTextRef.current=h.current)},[M,C,k,S,u]);const L=b.useRef("mouse"),q=b.useRef(!1),{getButtonProps:X,buttonRef:B}=vi({disabled:O,focusableWhenDisabled:!0,native:g,composite:!0}),H={disabled:O,selected:j,highlighted:A};function U(Y){if(E||R)return;const ee=S.state.value;if(C){const G=Array.isArray(ee)?ee:[],oe=j?_V(G,u,k):[...G,u];S.context.setValue(oe,ut(Mo,Y))}else S.context.setValue(u,ut(Mo,Y)),S.context.setOpen(!1,ut(Mo,Y))}function z(){S.context.selectionRef.current.dragY=0}const Q={role:"option","aria-selected":j,tabIndex:N&&A?0:-1,onKeyDown(Y){S.set("activeIndex",M),Y.key===" "&&S.context.typingRef.current&&Y.preventDefault()},onClick(Y){const ee=L.current!=="touch",G=Y.nativeEvent.pointerType,oe=ee&&ec(Y.nativeEvent)&&(G!==void 0||A),I=ee&&!oe&&!q.current;q.current=!1,!(O||I)&&U(Y.nativeEvent)},onPointerEnter(Y){L.current=Y.pointerType},onPointerMove(Y){if(Y.pointerType==="mouse"&&Y.buttons===1){const ee=S.context.selectionRef.current;ee.dragY+=Y.movementY,ee.dragY**2>=64&&(ee.allowUnselectedMouseUp=!0)}},onPointerDown(Y){L.current=Y.pointerType,q.current=!0,z()},onMouseUp(){if(z(),O||L.current==="touch"||q.current)return;const Y=!S.context.selectionRef.current.allowSelectedMouseUp&&j,ee=!S.context.selectionRef.current.allowUnselectedMouseUp&&!j;Y||ee||(q.current=!0,_.current?.click(),q.current=!1)}},$=kt("div",t,{ref:[B,i,x.ref,_],state:H,props:[w,Q,m,X]}),K=b.useMemo(()=>({selected:j,index:M,textRef:h,selectedByFocus:D}),[j,M,h,D]);return v.jsx(MM.Provider,{value:K,children:$})})),aK=b.memo(b.forwardRef(function(t,i){const{render:s,className:o,style:c,keepMounted:u,selected:d,...f}=t,g=b.useRef(null),{transitionStatus:m,setMounted:h}=_o(d),S=kt("span",t,{ref:[i,g],state:{selected:d,transitionStatus:m},props:[{"aria-hidden":!0,children:"✔️"},f],stateAttributesMapping:ws});return Li({batch:!0,enabled:!d,open:d,ref:g,onComplete(){d||h(!1)}}),S})),oK=b.forwardRef(function(t,i){const{selected:s}=NM();return t.keepMounted||s?v.jsx(aK,{...t,selected:s,ref:i}):null}),lK=b.memo(b.forwardRef(function(t,i){const{index:s,textRef:o,selectedByFocus:c}=NM(),u=ks(),{render:d,className:f,style:g,...m}=t,h=b.useCallback(S=>{S&&(s===0&&(u.context.firstItemTextRef.current=S),c&&(u.context.selectedItemTextRef.current=S))},[u,s,c]);return kt("div",t,{ref:[h,i,o],props:m})})),DM=b.forwardRef(function(t,i){const{render:s,className:o,style:c,direction:u,keepMounted:d,...f}=t,g=u==="up",m=ks(),{side:h,scrollDownArrowRef:x,scrollUpArrowRef:S}=ex(),w=g?"scrollUpArrowVisible":"scrollDownArrowVisible",C=m.useState(w),E=m.useState("openMethod"),R=C&&E!=="touch",k=Un(),O=g?S:x,{mounted:A,transitionStatus:N,setMounted:j}=_o(R);_e(()=>(m.context.scrollArrowsMountedCountRef.current+=1,m.set("hasScrollArrows",!0),()=>{m.context.scrollArrowsMountedCountRef.current=Math.max(0,m.context.scrollArrowsMountedCountRef.current-1),m.context.scrollArrowsMountedCountRef.current===0&&m.set("hasScrollArrows",!1)}),[m]),Li({open:R,ref:O,onComplete(){R||j(!1)}});const _=kt("div",t,{ref:[i,O],state:{direction:u,visible:R,side:h,transitionStatus:N},props:[{"aria-hidden":!0,children:g?"▲":"▼",style:{position:"absolute"},onMouseMove(q){if(q.movementX===0&&q.movementY===0||k.isStarted())return;m.set("activeIndex",null);function X(){const B=m.state.listElement??m.context.popupRef.current;if(!B)return;m.set("activeIndex",null),m.context.handleScrollArrowVisibility(B);const H=Wb(B.scrollHeight,B.clientHeight),U=fp(B.scrollTop,H),z=U===(g?0:H),Q=m.context.listRef.current;if(U!==B.scrollTop&&(B.scrollTop=U),z){k.clear();return}if(Q.length>0){const $=O.current?.offsetHeight||0;B.scrollTop=cK(Q,g,U,B.clientHeight,$,H)}k.start(40,X)}k.start(40,X)},onMouseLeave(){k.clear()}},f],stateAttributesMapping:ws});return A||d?_:null});function cK(e,t,i,s,o,c){if(t){let m=0;const h=i+o-Gi;for(let w=0;w<e.length;w+=1){const C=e[w];if(C&&C.offsetTop>=h){m=w;break}}const x=Math.max(0,m-1),S=e[x];return x<m&&S?fp(S.offsetTop-o,c):0}let u=e.length-1;const d=i+s-o+Gi;for(let m=0;m<e.length;m+=1){const h=e[m];if(h&&h.offsetTop+h.offsetHeight>d){u=Math.max(0,m-1);break}}const f=Math.min(e.length-1,u+1),g=e[f];return f>u&&g?fp(g.offsetTop+g.offsetHeight-s+o,c):c}const uK=b.forwardRef(function(t,i){return v.jsx(DM,{...t,ref:i,direction:"down"})}),dK=b.forwardRef(function(t,i){return v.jsx(DM,{...t,ref:i,direction:"up"})}),tx=HV;function nx({className:e,...t}){return v.jsx(GV,{"data-slot":"select-value",className:Fe("flex flex-1 text-left",e),...t})}function rx({className:e,size:t="default",children:i,...s}){return v.jsxs(qV,{"data-slot":"select-trigger","data-size":t,className:Fe("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),...s,children:[i,v.jsx($V,{render:v.jsx(Xv,{className:"pointer-events-none size-3.5 text-muted-foreground"})})]})}function ix({className:e,children:t,side:i="bottom",sideOffset:s=4,align:o="center",alignOffset:c=0,alignItemWithTrigger:u=!0,...d}){return v.jsx(QV,{children:v.jsx(ZV,{side:i,sideOffset:s,align:o,alignOffset:c,alignItemWithTrigger:u,className:"isolate z-50",children:v.jsxs(nK,{"data-slot":"select-content","data-align-trigger":u,className:Fe("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:[v.jsx(fK,{}),v.jsx(iK,{children:t}),v.jsx(hK,{})]})})})}function sx({className:e,children:t,...i}){return v.jsxs(sK,{"data-slot":"select-item",className:Fe("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),...i,children:[v.jsx(lK,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),v.jsx(oK,{render:v.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:v.jsx(od,{className:"pointer-events-none"})})]})}function fK({className:e,...t}){return v.jsx(dK,{"data-slot":"select-scroll-up-button",className:Fe("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),...t,children:v.jsx(nL,{})})}function hK({className:e,...t}){return v.jsx(uK,{"data-slot":"select-scroll-down-button",className:Fe("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),...t,children:v.jsx(Xv,{})})}const jM=["en-US","zh-CN","zh-TW","ja-JP"],pK={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語"},gK={"skills.invalidEntryName":"Enter a valid file or folder name without slashes.","skills.newEntry":"New","skills.newFile":"New file","skills.newFolder":"New folder","skills.fileActions":"Actions for {{path}}","skills.fileConflict":"A file or folder with this name already exists.","skills.fileOperationError":"Unable to update skill files. Please try again.","skills.deleteEntryDescription":"Remove <entryPath>{{path}}</entryPath> and its contents. Deletion takes effect when you save the skill.","skills.createEntryDescription":"Create in {{path}}. Enter a single file or folder name.","skills.entryName":"Name","skills.fileWorking":"Working…","skills.createEntry":"Create","skills.fileNotEditable":"This file is binary or exceeds the 2 MiB editing limit.","skills.fileLoadError":"Unable to load this file.","editor.loading":"Loading editor…","skills.saveContent":"Save","skills.contentSaving":"Saving…","skills.contentSaved":"Content saved.","skills.contentSaveError":"Unable to save content. Please try again.","skills.unsavedChanges":"Unsaved changes","skills.allChangesSaved":"All changes saved","skills.contentPlaceholder":"Write skill instructions in Markdown.","skills.fileEditor":"Edit {{file}}","skills.leaveTitle":"Discard unsaved changes?","skills.leaveDescription":"Your changes have not been saved. Save them before leaving, or discard them to continue.","skills.keepEditing":"Keep editing","skills.discardChanges":"Discard changes","skills.overview":"Overview","skills.files":"Files","skills.fileNavigation":"Skill files","skills.assign":"Assign","skills.assignTitle":"Assign {{name}}","skills.assignDialogTitle":"Assign <skillName>{{name}}</skillName>","skills.assignDescription":"Select agents to create skill links. Deselect an agent to remove its link. Changes apply immediately.","skills.assignAgentAria":"Assign {{name}} to {{agent}}","skills.assignmentError":"Unable to update skill assignment. Please try again.","skills.noAgents":"No agents available.","skills.linkConflict":"An unrelated skill entry exists in an agent folder. Resolve the conflict and retry.","skills.edit":"Edit","skills.editTitle":"Edit skill","skills.editDescription":"Update the name and description. Changes also sync to agents this skill is assigned to.","skills.saveChanges":"Save changes","skills.updating":"Saving…","skills.updated":"Skill updated.","skills.updateError":"Unable to update the skill. Please try again.","skills.delete":"Delete","skills.deleted":"Skill deleted.","skills.deleteError":"Unable to delete the skill. Please try again.","skills.deleteConfirmTitle":"Delete skill","skills.deleteConfirmDescription":"<skillName>{{name}}</skillName> and all files in its folder will be permanently deleted. The skill will also be removed from assigned agents.","skills.actionsAria":"Actions for {{name}}","nav.dashboard":"Dashboard","nav.library":"Library","nav.skills":"Skills","skills.name":"Name","skills.namePlaceholder":"e.g. knowledge-wiki","skills.nameHint":"Unique in your skill library. Use 1–64 Unicode letters or digits, lowercase where applicable, with single hyphens between words.","skills.description":"Description","skills.descriptionPlaceholder":"Describe when an agent should use this skill.","skills.create":"Create skill","skills.creating":"Creating…","skills.created":"Skill created.","skills.createError":"Unable to create the skill. Please try again.","skills.nameConflict":"A skill with this name already exists. Choose a different name.","skills.loadError":"Unable to load skills. Please try again.","skills.emptyTitle":"No skills yet","skills.emptyDescription":"Create a skill to start building your library.","skills.notFound":"Skill not found","skills.backToSkills":"Back to Skills","skills.content":"Content","skills.noContent":"No content yet","skills.new":"New skill","skills.createManually":"Create manually","skills.createManuallyDescription":"Start from a blank SKILL.md.","skills.importLocal":"Import from local","skills.importLocalDescription":"Pick one skill folder or one .skill / .zip archive.","skills.importing":"Importing…","skills.importSummary":"Imported {{imported}} skills; skipped {{skipped}}.","skills.importSkippedInvalid":"Invalid skill folder.","skills.importSkippedConflict":"Name already exists.","filePicker.selecting":"Selecting…","filePicker.error":"Unable to open the file picker. Please try again.","filePicker.unavailable":"Native file selection is unavailable on this computer.","filePicker.busy":"A file picker is already open.","skills.importReadError":"Unable to read the selected path. Check that it exists and is accessible.","skills.importInvalid":"Invalid skill.","skills.importInvalidSource":"Select one skill folder or one .skill / .zip archive.","skills.importSymlinkSource":"Symbolic-link skill sources are not supported. Select the original skill folder or archive.","skills.importMissingSkillMd":"The selected skill must contain SKILL.md at its root.","skills.importInvalidMetadata":"SKILL.md must be UTF-8 Markdown with a valid name and description in YAML frontmatter.","skills.importInvalidPath":"The skill contains an unsafe or conflicting file path.","skills.importDuplicatePath":"The skill contains duplicate file paths.","skills.importInvalidEncoding":"The skill contains a file with invalid encoding.","skills.importUnsupportedEntries":"The skill contains symbolic links or unsupported entries.","skills.importTooManyEntries":"A skill can contain at most 5,000 entries.","skills.importSkillMdTooLarge":"SKILL.md must be at most 2 MiB.","skills.importInvalidArchive":"The selected .skill or .zip archive is invalid.","skills.importNoSkills":"The source contains no skill folders.","skills.importTooLarge":"Skills must be at most 32 MiB.","skills.importNameConflict":"A skill with this name already exists. The existing skill was not overwritten.","skills.importError":"Unable to import the skill. Please try again.","skills.importUrl":"Import from URL","skills.importUrlDescription":"Fetch a published skill by URL.","skills.url":"URL","skills.importSubmit":"Import","skills.importUrlHint":"Enter a direct .skill, .zip, or SKILL.md file URL.","skills.importInvalidUrl":"Enter an HTTP or HTTPS URL without embedded credentials.","skills.importUnsupportedUrlFile":"Use a direct .skill, .zip, or SKILL.md file link. Folder and HTML pages are not supported.","skills.importDownloadFailed":"Unable to download the file. Check the URL and try again.","skills.importDownloadTimeout":"The download timed out. Try again or import the file locally.","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.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 replaces local settings, Instructions, Skills, and Agent configuration with this backup. Existing data will not be merged. Agent files and links are updated only if you choose Apply after import.","dataImport.applyTitle":"Import complete. Apply Agent configuration?","dataImport.applyDescription":"Apply the imported configuration to this machine’s Agent instructions and Skill links. Choosing not to apply clears Agent configuration in Foundry and leaves existing Agent files and links in place.","dataImport.skipAgents":"Do not apply","dataImport.applyAgents":"Apply configuration","dataImport.changed":"Agent configuration has changed since this import. Close this dialog to reload the current data.","dataImport.applyError":"Data was imported, but Agent configuration could not be applied. Check file access and Skill destination conflicts, then retry.","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","statusBar.foundry":"Foundry","statusBar.foundryVersion":"Foundry v{{version}}","statusBar.skill":"Skill","statusBar.skillStatus":"Foundry skill status","statusBar.skillChecking":"Checking skill…","statusBar.skillUnavailable":"Skill status unavailable","statusBar.skillRefreshHint":"Copy the command below into your terminal, or open <settings>Advanced settings</settings> to download the Skill again.","statusBar.copyCommand":"Copy command","statusBar.terminal":"Terminal","statusBar.targetAgents":"ChatGPT","statusBar.targetClaude":"Claude Code","statusBar.statusMissing":"Not installed","statusBar.statusOutdated":"Differs from the bundled skill","statusBar.statusCurrent":"Up to date","a11y.breadcrumb":"Breadcrumb","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"},mK={"skills.invalidEntryName":"请输入有效的文件或文件夹名称,不包含斜杠。","skills.newEntry":"新建","skills.newFile":"新增文件","skills.newFolder":"新增文件夹","skills.fileActions":"{{path}} 的操作","skills.fileConflict":"已存在同名文件或文件夹。","skills.fileOperationError":"无法修改技能文件,请重试。","skills.deleteEntryDescription":"移除 <entryPath>{{path}}</entryPath> 及其中的所有内容,保存技能后才会删除并同步到 Agent。","skills.createEntryDescription":"在 {{path}} 中创建,请输入单个文件或文件夹名称。","skills.entryName":"名称","skills.fileWorking":"处理中…","skills.createEntry":"创建","skills.fileNotEditable":"此文件为二进制文件,或超过 2 MiB 编辑上限。","skills.fileLoadError":"无法加载此文件。","editor.loading":"正在加载编辑器…","skills.saveContent":"保存","skills.contentSaving":"保存中…","skills.contentSaved":"内容已保存。","skills.contentSaveError":"无法保存内容,请重试。","skills.unsavedChanges":"未保存的修改","skills.allChangesSaved":"已全部保存","skills.contentPlaceholder":"使用 Markdown 编写技能指令。","skills.fileEditor":"编辑 {{file}}","skills.leaveTitle":"放弃未保存的修改?","skills.leaveDescription":"当前修改尚未保存。请先保存,或放弃修改后继续。","skills.keepEditing":"继续编辑","skills.discardChanges":"放弃修改","skills.overview":"概览","skills.files":"文件","skills.fileNavigation":"技能文件","skills.assign":"分配","skills.assignTitle":"分配 {{name}}","skills.assignDialogTitle":"分配 <skillName>{{name}}</skillName>","skills.assignDescription":"选择 Agent 创建技能链接,取消选择则解除链接。更改立即生效。","skills.assignAgentAria":"将 {{name}} 分配给 {{agent}}","skills.assignmentError":"无法更新技能分配,请重试。","skills.noAgents":"暂无可用的 Agent。","skills.linkConflict":"Agent 技能目录中存在同名的其他内容,请处理冲突后重试。","skills.edit":"修改","skills.editTitle":"修改技能","skills.editDescription":"更新名称和描述,已分配给 Agent 的技能也会同步更新。","skills.saveChanges":"保存修改","skills.updating":"保存中…","skills.updated":"技能已更新。","skills.updateError":"无法修改技能,请重试。","skills.delete":"删除","skills.deleted":"技能已删除。","skills.deleteError":"无法删除技能,请重试。","skills.deleteConfirmTitle":"删除技能","skills.deleteConfirmDescription":"<skillName>{{name}}</skillName> 及其文件夹中的所有文件将被永久删除。已分配给 Agent 的技能也会同步移除。","skills.actionsAria":"{{name}} 的操作","nav.dashboard":"仪表盘","nav.library":"资料库","nav.skills":"技能","skills.name":"名称","skills.namePlaceholder":"例如:knowledge-wiki","skills.nameHint":"名称在技能库中必须唯一。使用 1–64 个 Unicode 字母或数字,字母有大小写时使用小写,单个连字符可用于分隔单词。","skills.description":"描述","skills.descriptionPlaceholder":"描述 Agent 应在什么情况下使用此技能。","skills.create":"创建技能","skills.creating":"创建中…","skills.created":"技能已创建。","skills.createError":"无法创建技能,请重试。","skills.nameConflict":"已存在同名技能,请使用其他名称。","skills.loadError":"无法加载技能,请重试。","skills.emptyTitle":"暂无技能","skills.emptyDescription":"创建一个技能,开始构建你的技能库。","skills.notFound":"未找到技能","skills.backToSkills":"返回技能库","skills.content":"内容","skills.noContent":"暂无内容","skills.new":"新建技能","skills.createManually":"手动创建","skills.createManuallyDescription":"从空白的 SKILL.md 开始。","skills.importLocal":"从本地导入","skills.importLocalDescription":"选择一个技能文件夹或一个 .skill / .zip 压缩包。","skills.importing":"正在导入…","skills.importSummary":"已导入 {{imported}} 个技能,跳过 {{skipped}} 项。","skills.importSkippedInvalid":"技能文件夹不符合规范。","skills.importSkippedConflict":"技能名称已存在。","filePicker.selecting":"正在选择…","filePicker.error":"无法打开文件选择器,请重试。","filePicker.unavailable":"当前电脑无法使用原生文件选择器。","filePicker.busy":"已有文件选择器打开,请先完成选择。","skills.importReadError":"无法读取所选路径,请确认文件存在且具有访问权限。","skills.importInvalid":"技能格式无效。","skills.importInvalidSource":"请选择一个技能文件夹或一个 .skill / .zip 压缩包。","skills.importSymlinkSource":"不支持导入符号链接形式的技能来源,请选择原始技能文件夹或压缩包。","skills.importMissingSkillMd":"所选技能必须在根目录包含 SKILL.md。","skills.importInvalidMetadata":"SKILL.md 必须是 UTF-8 Markdown,并在 YAML 元数据中包含有效的 name 和 description。","skills.importInvalidPath":"技能包含不安全或冲突的文件路径。","skills.importDuplicatePath":"技能包含重复的文件路径。","skills.importInvalidEncoding":"技能包含编码无效的文件。","skills.importUnsupportedEntries":"技能包含符号链接或不支持的条目。","skills.importTooManyEntries":"技能最多包含 5,000 个条目。","skills.importSkillMdTooLarge":"SKILL.md 不能超过 2 MiB。","skills.importInvalidArchive":"所选 .skill 或 .zip 压缩包无效。","skills.importNoSkills":"所选来源中没有技能文件夹。","skills.importTooLarge":"技能总大小不能超过 32 MiB。","skills.importNameConflict":"已存在同名技能,现有技能不会被覆盖。","skills.importError":"无法导入技能,请重试。","skills.importUrl":"从 URL 导入","skills.importUrlDescription":"通过 URL 获取已发布的技能。","skills.url":"URL","skills.importSubmit":"导入","skills.importUrlHint":"请输入 .skill、.zip 或 SKILL.md 文件直链。","skills.importInvalidUrl":"请输入不含账号密码的 HTTP 或 HTTPS URL。","skills.importUnsupportedUrlFile":"请使用 .skill、.zip 或 SKILL.md 文件直链,不支持文件夹和 HTML 网页。","skills.importDownloadFailed":"文件下载失败,请检查链接后重试。","skills.importDownloadTimeout":"下载超时,请重试或下载后从本地导入。","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.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":"导入会用备份替换本地设置、Instructions、Skills 和 Agent 配置,不会合并现有数据。导入后选择应用配置,才会更新本机 Agent 文件和链接。","dataImport.applyTitle":"导入完成,是否应用 Agent 配置?","dataImport.applyDescription":"应用后,将根据导入的配置更新本机 Agent 的 Instructions 和 Skill 链接。选择不应用将清空 Foundry 中的 Agent 配置,保留本机现有 Agent 文件和链接。","dataImport.skipAgents":"不应用","dataImport.applyAgents":"应用配置","dataImport.changed":"Agent 配置在本次导入后已发生变化。请关闭弹窗,重新加载当前数据。","dataImport.applyError":"数据已导入,但 Agent 配置未能应用。请检查文件访问权限和 Skill 目标位置冲突后重试。","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":"深色","statusBar.foundry":"Foundry","statusBar.foundryVersion":"Foundry v{{version}}","statusBar.skill":"Skill","statusBar.skillStatus":"Foundry Skill 状态","statusBar.skillChecking":"正在检查 Skill…","statusBar.skillUnavailable":"无法获取 Skill 状态","statusBar.skillRefreshHint":"复制下面的命令到终端执行,或前往 <settings>高级设置</settings> 重新下载 Skill。","statusBar.copyCommand":"复制命令","statusBar.terminal":"终端","statusBar.targetAgents":"ChatGPT","statusBar.targetClaude":"Claude Code","statusBar.statusMissing":"未安装","statusBar.statusOutdated":"与当前 Foundry 版本不一致","statusBar.statusCurrent":"已是最新","a11y.breadcrumb":"面包屑导航","a11y.goBack":"返回","a11y.close":"关闭","a11y.showPassword":"显示密码","a11y.hidePassword":"隐藏密码","a11y.sidebar":"侧边栏","a11y.sidebarDescription":"显示移动端侧边栏。","a11y.toggleSidebar":"切换侧边栏"},yK={"skills.invalidEntryName":"請輸入有效的檔案或資料夾名稱,不包含斜線。","skills.newEntry":"新增","skills.newFile":"新增檔案","skills.newFolder":"新增資料夾","skills.fileActions":"{{path}} 的操作","skills.fileConflict":"已存在同名檔案或資料夾。","skills.fileOperationError":"無法修改技能檔案,請重試。","skills.deleteEntryDescription":"移除 <entryPath>{{path}}</entryPath> 及其中的所有內容,儲存技能後才會刪除並同步至 Agent。","skills.createEntryDescription":"在 {{path}} 中建立,請輸入單一檔案或資料夾名稱。","skills.entryName":"名稱","skills.fileWorking":"處理中…","skills.createEntry":"建立","skills.fileNotEditable":"此檔案為二進位檔案,或超過 2 MiB 編輯上限。","skills.fileLoadError":"無法載入此檔案。","editor.loading":"正在載入編輯器…","skills.saveContent":"儲存","skills.contentSaving":"儲存中…","skills.contentSaved":"內容已儲存。","skills.contentSaveError":"無法儲存內容,請重試。","skills.unsavedChanges":"未儲存的修改","skills.allChangesSaved":"已全部儲存","skills.contentPlaceholder":"使用 Markdown 編寫技能指令。","skills.fileEditor":"編輯 {{file}}","skills.leaveTitle":"放棄未儲存的修改?","skills.leaveDescription":"目前修改尚未儲存。請先儲存,或放棄修改後繼續。","skills.keepEditing":"繼續編輯","skills.discardChanges":"放棄修改","skills.overview":"概覽","skills.files":"檔案","skills.fileNavigation":"技能檔案","skills.assign":"分配","skills.assignTitle":"分配 {{name}}","skills.assignDialogTitle":"分配 <skillName>{{name}}</skillName>","skills.assignDescription":"選擇 Agent 建立技能連結,取消選擇則解除連結。變更立即生效。","skills.assignAgentAria":"將 {{name}} 分配給 {{agent}}","skills.assignmentError":"無法更新技能分配,請重試。","skills.noAgents":"暫無可用的 Agent。","skills.linkConflict":"Agent 技能目錄中存在同名的其他內容,請處理衝突後重試。","skills.edit":"修改","skills.editTitle":"修改技能","skills.editDescription":"更新名稱和描述,已分配給 Agent 的技能也會同步更新。","skills.saveChanges":"儲存修改","skills.updating":"儲存中…","skills.updated":"技能已更新。","skills.updateError":"無法修改技能,請重試。","skills.delete":"刪除","skills.deleted":"技能已刪除。","skills.deleteError":"無法刪除技能,請重試。","skills.deleteConfirmTitle":"刪除技能","skills.deleteConfirmDescription":"<skillName>{{name}}</skillName> 及其資料夾中的所有檔案將被永久刪除。已分配給 Agent 的技能也會同步移除。","skills.actionsAria":"{{name}} 的操作","nav.dashboard":"儀表板","nav.library":"資料庫","nav.skills":"技能","skills.name":"名稱","skills.namePlaceholder":"例如:knowledge-wiki","skills.nameHint":"名稱在技能庫中必須唯一。使用 1–64 個 Unicode 字母或數字,字母有大小寫時使用小寫,單一連字號可用於分隔單字。","skills.description":"描述","skills.descriptionPlaceholder":"描述 Agent 應在什麼情況下使用此技能。","skills.create":"建立技能","skills.creating":"建立中…","skills.created":"技能已建立。","skills.createError":"無法建立技能,請重試。","skills.nameConflict":"已存在同名技能,請使用其他名稱。","skills.loadError":"無法載入技能,請重試。","skills.emptyTitle":"尚無技能","skills.emptyDescription":"建立一個技能,開始建構你的技能庫。","skills.notFound":"找不到技能","skills.backToSkills":"返回技能庫","skills.content":"內容","skills.noContent":"尚無內容","skills.new":"新增技能","skills.createManually":"手動建立","skills.createManuallyDescription":"從空白的 SKILL.md 開始。","skills.importLocal":"從本機匯入","skills.importLocalDescription":"選擇一個技能資料夾或一個 .skill / .zip 壓縮檔。","skills.importing":"正在匯入…","skills.importSummary":"已匯入 {{imported}} 個技能,略過 {{skipped}} 項。","skills.importSkippedInvalid":"技能資料夾不符合規範。","skills.importSkippedConflict":"技能名稱已存在。","filePicker.selecting":"正在選擇…","filePicker.error":"無法開啟檔案選擇器,請重試。","filePicker.unavailable":"目前電腦無法使用原生檔案選擇器。","filePicker.busy":"已有檔案選擇器開啟,請先完成選擇。","skills.importReadError":"無法讀取所選路徑,請確認檔案存在且具有存取權限。","skills.importInvalid":"技能格式無效。","skills.importInvalidSource":"請選擇一個技能資料夾或一個 .skill / .zip 壓縮檔。","skills.importSymlinkSource":"不支援匯入符號連結形式的技能來源,請選擇原始技能資料夾或壓縮檔。","skills.importMissingSkillMd":"所選技能必須在根目錄包含 SKILL.md。","skills.importInvalidMetadata":"SKILL.md 必須是 UTF-8 Markdown,並在 YAML 中繼資料中包含有效的 name 與 description。","skills.importInvalidPath":"技能包含不安全或衝突的檔案路徑。","skills.importDuplicatePath":"技能包含重複的檔案路徑。","skills.importInvalidEncoding":"技能包含編碼無效的檔案。","skills.importUnsupportedEntries":"技能包含符號連結或不支援的項目。","skills.importTooManyEntries":"技能最多包含 5,000 個項目。","skills.importSkillMdTooLarge":"SKILL.md 不能超過 2 MiB。","skills.importInvalidArchive":"所選 .skill 或 .zip 壓縮檔無效。","skills.importNoSkills":"所選來源中沒有技能資料夾。","skills.importTooLarge":"技能總大小不能超過 32 MiB。","skills.importNameConflict":"已存在同名技能,現有技能不會被覆蓋。","skills.importError":"無法匯入技能,請重試。","skills.importUrl":"從 URL 匯入","skills.importUrlDescription":"透過 URL 取得已發布的技能。","skills.url":"URL","skills.importSubmit":"匯入","skills.importUrlHint":"請輸入 .skill、.zip 或 SKILL.md 檔案直連。","skills.importInvalidUrl":"請輸入不含帳號密碼的 HTTP 或 HTTPS URL。","skills.importUnsupportedUrlFile":"請使用 .skill、.zip 或 SKILL.md 檔案直連,不支援資料夾和 HTML 網頁。","skills.importDownloadFailed":"檔案下載失敗,請檢查連結後重試。","skills.importDownloadTimeout":"下載逾時,請重試或下載後從本機匯入。","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.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":"匯入會以備份替換本機設定、Instructions、Skills 和 Agent 設定,不會合併現有資料。匯入後選擇套用設定,才會更新本機 Agent 檔案和連結。","dataImport.applyTitle":"匯入完成,是否套用 Agent 設定?","dataImport.applyDescription":"套用後,將依匯入的設定更新本機 Agent 的 Instructions 和 Skill 連結。選擇不套用將清空 Foundry 中的 Agent 設定,保留本機現有 Agent 檔案和連結。","dataImport.skipAgents":"不套用","dataImport.applyAgents":"套用設定","dataImport.changed":"Agent 設定在本次匯入後已變更。請關閉對話框,重新載入目前資料。","dataImport.applyError":"資料已匯入,但無法套用 Agent 設定。請檢查檔案存取權限與 Skill 目標位置衝突後重試。","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":"深色","statusBar.foundry":"Foundry","statusBar.foundryVersion":"Foundry v{{version}}","statusBar.skill":"Skill","statusBar.skillStatus":"Foundry Skill 狀態","statusBar.skillChecking":"正在檢查 Skill…","statusBar.skillUnavailable":"無法取得 Skill 狀態","statusBar.skillRefreshHint":"複製下方指令到終端機執行,或前往 <settings>進階設定</settings> 重新下載 Skill。","statusBar.copyCommand":"複製指令","statusBar.terminal":"終端機","statusBar.targetAgents":"ChatGPT","statusBar.targetClaude":"Claude Code","statusBar.statusMissing":"未安裝","statusBar.statusOutdated":"與目前 Foundry 版本不一致","statusBar.statusCurrent":"已是最新","a11y.breadcrumb":"麵包屑導覽","a11y.goBack":"返回","a11y.close":"關閉","a11y.showPassword":"顯示密碼","a11y.hidePassword":"隱藏密碼","a11y.sidebar":"側邊欄","a11y.sidebarDescription":"顯示行動版側邊欄。","a11y.toggleSidebar":"切換側邊欄"},vK={"skills.invalidEntryName":"スラッシュを含まない有効なファイル名またはフォルダー名を入力してください。","skills.newEntry":"新規","skills.newFile":"新規ファイル","skills.newFolder":"新規フォルダー","skills.fileActions":"{{path}} の操作","skills.fileConflict":"同じ名前のファイルまたはフォルダーが存在します。","skills.fileOperationError":"スキルファイルを更新できませんでした。もう一度お試しください。","skills.deleteEntryDescription":"<entryPath>{{path}}</entryPath> とその内容を削除します。スキルを保存すると削除が反映されます。","skills.createEntryDescription":"{{path}} に作成します。ファイルまたはフォルダーの名前を入力してください。","skills.entryName":"名前","skills.fileWorking":"処理中…","skills.createEntry":"作成","skills.fileNotEditable":"バイナリファイル、または編集上限の 2 MiB を超えています。","skills.fileLoadError":"ファイルを読み込めませんでした。","editor.loading":"エディターを読み込み中…","skills.saveContent":"保存","skills.contentSaving":"保存中…","skills.contentSaved":"内容を保存しました。","skills.contentSaveError":"内容を保存できませんでした。もう一度お試しください。","skills.unsavedChanges":"未保存の変更","skills.allChangesSaved":"すべて保存済み","skills.contentPlaceholder":"Markdown でスキルの指示を記述します。","skills.fileEditor":"{{file}} を編集","skills.leaveTitle":"未保存の変更を破棄しますか?","skills.leaveDescription":"変更はまだ保存されていません。保存するか、変更を破棄して続行してください。","skills.keepEditing":"編集を続ける","skills.discardChanges":"変更を破棄","skills.overview":"概要","skills.files":"ファイル","skills.fileNavigation":"スキルファイル","skills.assign":"割り当て","skills.assignTitle":"{{name}} の割り当て","skills.assignDialogTitle":"<skillName>{{name}}</skillName> の割り当て","skills.assignDescription":"エージェントを選択するとスキルへのリンクを作成し、選択を解除するとリンクを削除します。変更はすぐに反映されます。","skills.assignAgentAria":"{{name}} を {{agent}} に割り当て","skills.assignmentError":"スキルの割り当てを更新できませんでした。もう一度お試しください。","skills.noAgents":"利用可能なエージェントがありません。","skills.linkConflict":"エージェントのスキルフォルダーに別の同名項目があります。競合を解消して再試行してください。","skills.edit":"編集","skills.editTitle":"スキルを編集","skills.editDescription":"名前と説明を更新します。このスキルが割り当てられているエージェントにも変更が反映されます。","skills.saveChanges":"変更を保存","skills.updating":"保存中…","skills.updated":"スキルを更新しました。","skills.updateError":"スキルを更新できません。再試行してください。","skills.delete":"削除","skills.deleted":"スキルを削除しました。","skills.deleteError":"スキルを削除できません。再試行してください。","skills.deleteConfirmTitle":"スキルを削除","skills.deleteConfirmDescription":"<skillName>{{name}}</skillName> とフォルダー内のすべてのファイルが完全に削除されます。割り当て済みのエージェントからもスキルが削除されます。","skills.actionsAria":"{{name}} の操作","nav.dashboard":"ダッシュボード","nav.library":"ライブラリ","nav.skills":"スキル","skills.name":"名前","skills.namePlaceholder":"例:knowledge-wiki","skills.nameHint":"スキルライブラリ内で一意の名前にしてください。1〜64 文字の Unicode 文字または数字を使用し、大文字・小文字がある場合は小文字にしてください。単語は単一のハイフンで区切れます。","skills.description":"説明","skills.descriptionPlaceholder":"エージェントがこのスキルを使う場面を説明してください。","skills.create":"スキルを作成","skills.creating":"作成中…","skills.created":"スキルを作成しました。","skills.createError":"スキルを作成できませんでした。もう一度お試しください。","skills.nameConflict":"同じ名前のスキルが存在します。別の名前を指定してください。","skills.loadError":"スキルを読み込めませんでした。もう一度お試しください。","skills.emptyTitle":"スキルはまだありません","skills.emptyDescription":"スキルを作成してライブラリを構築しましょう。","skills.notFound":"スキルが見つかりません","skills.backToSkills":"スキル一覧に戻る","skills.content":"内容","skills.noContent":"内容はまだありません","skills.new":"新規スキル","skills.createManually":"手動で作成","skills.createManuallyDescription":"空の SKILL.md から始めます。","skills.importLocal":"ローカルからインポート","skills.importLocalDescription":"スキルフォルダーまたは .skill / .zip アーカイブを1つ選択します。","skills.importing":"インポート中…","skills.importSummary":"{{imported}} 個のスキルをインポートし、{{skipped}} 件をスキップしました。","skills.importSkippedInvalid":"無効なスキルフォルダーです。","skills.importSkippedConflict":"同名のスキルが存在します。","filePicker.selecting":"選択中…","filePicker.error":"ファイル選択ダイアログを開けませんでした。もう一度お試しください。","filePicker.unavailable":"このコンピューターではネイティブファイル選択を利用できません。","filePicker.busy":"ファイル選択ダイアログが既に開いています。","skills.importReadError":"選択したパスを読み取れません。存在とアクセス権を確認してください。","skills.importInvalid":"スキルの形式が無効です。","skills.importInvalidSource":"スキルフォルダーまたは .skill / .zip アーカイブを1つ選択してください。","skills.importSymlinkSource":"シンボリックリンクのスキルソースはインポートできません。元のスキルフォルダーまたはアーカイブを選択してください。","skills.importMissingSkillMd":"選択したスキルのルートに SKILL.md が必要です。","skills.importInvalidMetadata":"SKILL.md は UTF-8 の Markdown で、YAML に有効な name と description が必要です。","skills.importInvalidPath":"スキルに安全でない、または競合するファイルパスがあります。","skills.importDuplicatePath":"スキルに重複したファイルパスがあります。","skills.importInvalidEncoding":"スキルにエンコーディングが無効なファイルがあります。","skills.importUnsupportedEntries":"スキルにシンボリックリンクまたは未対応の項目があります。","skills.importTooManyEntries":"スキルに含められる項目は最大 5,000 件です。","skills.importSkillMdTooLarge":"SKILL.md は 2 MiB 以下にしてください。","skills.importInvalidArchive":"選択した .skill または .zip アーカイブが無効です。","skills.importNoSkills":"選択したソースにスキルフォルダーがありません。","skills.importTooLarge":"スキルの合計サイズは 32 MiB 以下にしてください。","skills.importNameConflict":"同じ名前のスキルが既に存在します。既存のスキルは上書きされません。","skills.importError":"スキルをインポートできませんでした。もう一度お試しください。","skills.importUrl":"URL からインポート","skills.importUrlDescription":"URL から公開済みのスキルを取得します。","skills.url":"URL","skills.importSubmit":"インポート","skills.importUrlHint":".skill、.zip、または SKILL.md の直接リンクを入力してください。","skills.importInvalidUrl":"認証情報を含まない HTTP または HTTPS URL を入力してください。","skills.importUnsupportedUrlFile":".skill、.zip、または SKILL.md の直接リンクを使用してください。フォルダーや HTML ページには対応していません。","skills.importDownloadFailed":"ダウンロードできませんでした。URL を確認して再試行してください。","skills.importDownloadTimeout":"ダウンロードがタイムアウトしました。再試行するか、ローカルからインポートしてください。","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.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":"バックアップでローカルの設定、Instructions、Skills、Agent 設定を置き換えます。既存データとの結合は行われません。Agent のファイルとリンクは、インポート後に適用を選んだ場合にのみ更新されます。","dataImport.applyTitle":"インポート完了。Agent 設定を適用しますか?","dataImport.applyDescription":"インポートした設定で、このマシンの Agent の Instructions と Skill リンクを更新します。適用しない場合は Foundry の Agent 設定を空にし、既存の Agent ファイルとリンクを保持します。","dataImport.skipAgents":"適用しない","dataImport.applyAgents":"設定を適用","dataImport.changed":"インポート後に Agent 設定が変更されました。このダイアログを閉じて現在のデータを再読み込みしてください。","dataImport.applyError":"データはインポートされましたが、Agent 設定を適用できませんでした。ファイルへのアクセス権限と Skill の配置先の競合を確認して再試行してください。","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":"ダーク","statusBar.foundry":"Foundry","statusBar.foundryVersion":"Foundry v{{version}}","statusBar.skill":"Skill","statusBar.skillStatus":"Foundry Skill の状態","statusBar.skillChecking":"Skill を確認中…","statusBar.skillUnavailable":"Skill の状態を取得できません","statusBar.skillRefreshHint":"下のコマンドをターミナルで実行するか、<settings>詳細設定</settings> に移動して Skill を再ダウンロードしてください。","statusBar.copyCommand":"コマンドをコピー","statusBar.terminal":"ターミナル","statusBar.targetAgents":"ChatGPT","statusBar.targetClaude":"Claude Code","statusBar.statusMissing":"未インストール","statusBar.statusOutdated":"同梱の Skill と一致しません","statusBar.statusCurrent":"最新です","a11y.breadcrumb":"パンくずリスト","a11y.goBack":"戻る","a11y.close":"閉じる","a11y.showPassword":"パスワードを表示","a11y.hidePassword":"パスワードを非表示","a11y.sidebar":"サイドバー","a11y.sidebarDescription":"モバイル用サイドバーを表示します。","a11y.toggleSidebar":"サイドバーを切り替える"},bK={"en-US":{translation:gK},"zh-CN":{translation:mK},"zh-TW":{translation:yK},"ja-JP":{translation:vK}};function xK({value:e,onValueChange:t,disabled:i=!1}){const{t:s}=mt(),o=[{value:"system",label:s("common.system")},...jM.map(c=>({value:c,label:pK[c]}))];return v.jsx(Xa,{label:s("settings.language"),children:v.jsxs(tx,{items:o,value:e,onValueChange:c=>{c&&t(c)},disabled:i,children:[v.jsx(rx,{"aria-label":s("settings.language"),className:"w-52",children:v.jsx(nx,{})}),v.jsx(ix,{children:o.map(c=>v.jsx(sx,{value:c.value,children:c.label},c.value))})]})})}const HR=dB.map(e=>({value:e,label:e}));function SK({value:e,onValueChange:t,disabled:i=!1}){const{t:s}=mt();return v.jsx(Xa,{label:s("settings.timeFormat"),children:v.jsxs(tx,{items:HR,value:e,onValueChange:o=>{o&&t(o)},disabled:i,children:[v.jsx(rx,{"aria-label":s("settings.timeFormat"),className:"w-52",children:v.jsx(nx,{})}),v.jsx(ix,{children:HR.map(o=>v.jsx(sx,{value:o.value,children:o.label},o.value))})]})})}const wK={"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 EK({value:e,onValueChange:t,disabled:i=!1}){const{t:s}=mt(),o=fB.map(c=>({value:c,label:s(wK[c])}));return v.jsx(Xa,{label:s("settings.timeZone"),children:v.jsxs(tx,{items:o,value:e,onValueChange:c=>{c&&t(c)},disabled:i,children:[v.jsx(rx,{"aria-label":s("settings.timeZone"),className:"w-52",children:v.jsx(nx,{})}),v.jsx(ix,{children:o.map(c=>v.jsx(sx,{value:c.value,children:c.label},c.value))})]})})}const ja=["settings"],Lh=["settings","update"];function ax(){const{t:e}=mt(),t=Br(),i=Vk({mutationKey:Lh})>0,s=$a({queryKey:ja,queryFn:({signal:h})=>qz(h),staleTime:1/0,retry:!1}),o=sr({mutationKey:Lh,mutationFn:Yz,onMutate:async h=>{await t.cancelQueries({queryKey:ja});const x=t.getQueryData(ja);return x&&t.setQueryData(ja,RK(x,h)),{previous:x}},onSuccess:h=>{t.setQueryData(ja,h)},onError:(h,x,S)=>{S?.previous&&t.setQueryData(ja,S.previous),Qt.error(e(CK(x)))},onSettled:()=>t.invalidateQueries({queryKey:ja})}),c=s.data??null,u=c?.workspace.appearance["color-theme"]??"system",d=c?.workspace["language-region"].language??"system",f=c?.workspace["language-region"]["time-format"]??"YYYY-MM-DD HH:mm:ss",g=c?.workspace["language-region"]["time-zone"]??"America/Los_Angeles";function m(h){!c||t.isMutating({mutationKey:Lh})>0||o.mutate(h)}return{settings:c,theme:u,language:d,timeFormat:f,timeZone:g,isLoading:s.isPending,isUpdating:i,setTheme:h=>{h!==u&&m({theme:h})},setLanguage:h=>{h!==d&&m({language:h})},setTimeFormat:h=>{h!==f&&m({timeFormat:h})},setTimeZone:h=>{h!==g&&m({timezone:h})}}}function RK(e,t){const i=e.workspace,s=i["language-region"];return{...e,workspace:{appearance:{"color-theme":t.theme??i.appearance["color-theme"]},"language-region":{language:t.language??s.language,"time-format":t.timeFormat??s["time-format"],"time-zone":t.timezone??s["time-zone"]}}}}function CK(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 ko=[{id:"appearance",labelKey:"settings.appearance",ariaKey:"settings.appearanceAria",icon:yL},{id:"language-region",labelKey:"settings.languageRegion",ariaKey:"settings.languageRegionAria",icon:dL},{id:"advanced",labelKey:"settings.advanced",ariaKey:"settings.advancedAria",icon:nk}];function TK(){const{t:e}=mt(),[t,i]=C8(),s=ko.find(({id:k})=>k===t.get("panel"))?.id??ko[0].id,o=k=>{i(O=>{const A=new URLSearchParams(O);return A.set("panel",k),A})},{settings:c,theme:u,language:d,timeFormat:f,timeZone:g,isLoading:m,isUpdating:h,setTheme:x,setLanguage:S,setTimeFormat:w,setTimeZone:C}=ax(),E=ko.find(k=>k.id===s)?.ariaKey??"settings.appearanceAria",R=ko.find(k=>k.id===s)?.labelKey??"settings.appearance";return v.jsxs("div",{className:`
233
- grid h-full min-h-0 grid-cols-[260px_minmax(0,1fr)]
234
- max-[680px]:grid-cols-1
235
- `,children:[v.jsx("aside",{className:`
236
- hidden min-h-0 overflow-y-auto p-4
237
- min-[680px]:block
238
- `,children:v.jsx(kK,{activeSection:s,onSectionChange:o})}),v.jsxs("section",{"aria-label":e(E),className:"min-h-0 overflow-y-auto p-4",children:[v.jsxs("div",{className:`
239
- mb-3 flex items-center gap-3
240
- min-[680px]:hidden
241
- `,children:[v.jsxs(Vo,{children:[v.jsx(Ko,{render:v.jsx(at,{type:"button",variant:"outline",size:"icon","aria-label":e("settings.openNavigation")}),children:v.jsx(gL,{})}),v.jsx(qo,{side:"bottom",align:"start",sideOffset:8,"aria-label":e("settings.navigation"),className:"w-56",children:v.jsxs(iA,{children:[v.jsx(sA,{children:e("settings.workspace")}),v.jsx(JU,{value:s,onValueChange:k=>{const O=ko.find(({id:A})=>A===k);O&&o(O.id)},children:ko.map(({id:k,labelKey:O,icon:A})=>v.jsxs(WU,{value:k,closeOnClick:!0,children:[v.jsx(A,{}),e(O)]},k))})]})})]}),v.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:e(R)})]}),v.jsxs(Gs,{className:"gap-0 py-0",children:[m&&v.jsxs("div",{className:`
242
- flex flex-col items-start gap-3 p-4
243
- min-[680px]:min-h-16 min-[680px]:flex-row
244
- min-[680px]:items-center min-[680px]:justify-between
245
- min-[680px]:gap-8
246
- `,children:[v.jsx(Er,{className:"h-4 w-24"}),v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(Er,{className:"h-4 w-16"}),v.jsx(Er,{className:"h-4 w-10"}),v.jsx(Er,{className:"h-4 w-10"})]})]}),!m&&s==="appearance"&&v.jsx(DV,{value:u,onValueChange:k=>{x(k)},disabled:h||!c}),!m&&s==="language-region"&&v.jsxs("div",{className:"divide-y",children:[v.jsx(xK,{value:d,onValueChange:k=>{S(k)},disabled:h||!c}),v.jsx(EK,{value:g,onValueChange:k=>{C(k)},disabled:h||!c}),v.jsx(SK,{value:f,onValueChange:k=>{w(k)},disabled:h||!c})]}),!m&&s==="advanced"&&v.jsxs("div",{className:"divide-y",children:[v.jsx(mV,{disabled:h||!c}),v.jsx(xV,{disabled:h||!c}),v.jsx($B,{configFolder:c?.configFolder}),v.jsx(aV,{disabled:h||!c})]})]})]})]})}function kK({activeSection:e,onSectionChange:t}){const{t:i}=mt();return v.jsx("nav",{"aria-label":i("settings.navigation"),children:v.jsxs(Gs,{size:"sm",children:[v.jsx(o9,{children:v.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:i("settings.workspace")})}),v.jsx(l9,{className:"flex flex-col gap-1",children:ko.map(({id:s,labelKey:o,icon:c})=>{const u=s===e;return v.jsxs(at,{type:"button",variant:u?"secondary":"ghost","aria-current":u?"page":void 0,onClick:()=>{t(s)},className:"w-full justify-start gap-2",children:[v.jsx(c,{className:u?void 0:"text-muted-foreground"}),v.jsx("span",{children:i(o)})]},s)})})]})})}hr.use(p5).init({resources:bK,lng:IM(),fallbackLng:"en-US",supportedLngs:[...jM],keySeparator:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1}});function IM(){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 OK(){const e=Br();b.useEffect(()=>{const t=new EventSource("/api/events"),i=()=>{e.invalidateQueries({queryKey:ja,refetchType:e.isMutating({mutationKey:Lh})>0?"none":"active"})},s=o=>{try{const c=JSON.parse(o.data);typeof c=="object"&&c!==null&&"version"in c&&c.version===hB&&"type"in c&&c.type===pB&&i()}catch{}};return t.addEventListener("open",i),t.addEventListener("foundry",s),()=>{t.removeEventListener("open",i),t.removeEventListener("foundry",s),t.close()}},[e])}const bv=matchMedia("(prefers-color-scheme: dark)");function AK(e){return bv.addEventListener("change",e),()=>bv.removeEventListener("change",e)}function MK(){return bv.matches?"dark":"light"}function NK({children:e}){OK();const{theme:t,language:i}=ax(),s=b.useSyncExternalStore(AK,MK),o=t==="system"?s:t,c=i==="system"?IM():i;return b.useLayoutEffect(()=>{const u=document.documentElement;u.classList.toggle("dark",o==="dark"),u.style.colorScheme=o},[o]),b.useLayoutEffect(()=>{hr.changeLanguage(c),document.documentElement.lang=c},[c]),e}const DK=new Nz({queryCache:new Fk({onError:(e,t)=>{t.queryKey[0]==="skill-targets"?Qt.error(hr.t("settings.errors.skillTargets")):t.queryKey[0]==="settings"&&Qt.error(hr.t("settings.errors.load"))}})});function jK(){return null}function IK(e){switch(e){case"/library/instructions":return v.jsx(J9,{});case"/library/skills":return v.jsx(UB,{});default:return v.jsx(jK,{})}}const PK=b8([{element:v.jsx(dF,{}),children:[...eF.map(e=>({path:e,element:IK(e)})),{path:"/library/skills/:name",element:v.jsx(GB,{})}]},{element:v.jsx(fF,{}),children:[{path:"/settings",element:v.jsx(TK,{}),handle:{backTo:"/dashboard"}}]},{path:"*",element:v.jsx(G6,{to:"/dashboard",replace:!0})}]);function LK(){return v.jsx(az,{client:DK,children:v.jsx(dP,{children:v.jsx(NK,{children:v.jsx(zK,{})})})})}function zK(){const{theme:e}=ax();return v.jsxs(v.Fragment,{children:[v.jsx(D8,{router:PK}),v.jsx(t_,{}),v.jsx(EL,{theme:e,position:"top-center"})]})}b4.createRoot(document.getElementById("root")).render(v.jsx(b.StrictMode,{children:v.jsx(LK,{})}));export{Ne as W,Y9 as _,v as j,b as r,mt as u};