@dhzh/foundry 11.5.1 → 11.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/dist/index.mjs +5 -5
- package/dist/skills/foundry/SKILL.md +2 -2
- package/dist/skills/foundry/references/agents.md +129 -21
- package/dist/skills/foundry/references/skills.md +31 -78
- package/dist/web/assets/{code-editor-nn2D110F.js → code-editor-Cs6a-0ig.js} +3 -3
- package/dist/web/assets/{freemarker2-C0DlFq0Z.js → freemarker2-BpBPB7E3.js} +1 -1
- package/dist/web/assets/{handlebars-ICSTPlqj.js → handlebars-BEeeKxpi.js} +1 -1
- package/dist/web/assets/{html-hlKGfPYK.js → html-NkLl_qlU.js} +1 -1
- package/dist/web/assets/{index-C9k9C12g.css → index-CHiuetZP.css} +1 -1
- package/dist/web/assets/index-v9mUyx6S.js +291 -0
- package/dist/web/assets/{javascript-2HfRMbS_.js → javascript-BP3m1VQb.js} +1 -1
- package/dist/web/assets/{jsonMode-DAop1PNv.js → jsonMode-DNCpqnxj.js} +1 -1
- package/dist/web/assets/{liquid-lRNuekvj.js → liquid-BgB7kTD2.js} +1 -1
- package/dist/web/assets/{mdx-DBlq15YD.js → mdx-UKT2ogfX.js} +1 -1
- package/dist/web/assets/{python-CXN38-Q4.js → python-C1Esqys5.js} +1 -1
- package/dist/web/assets/{razor-QMN8xuKc.js → razor-DmCJ1jYQ.js} +1 -1
- package/dist/web/assets/{typescript-bH12XFQi.js → typescript-BdVQlQRY.js} +1 -1
- package/dist/web/assets/{xml-Bj_GdhAg.js → xml-C3qO-PR9.js} +1 -1
- package/dist/web/assets/{yaml-CbA76NSe.js → yaml-CytPlQ9M.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-BmCSMu5X.js +0 -279
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-editor-nn2D110F.js","assets/code-editor-DMeNDIaI.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
function zj(e,t){for(var s=0;s<t.length;s++){const i=t[s];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(i,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>i[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"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function s(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=s(o);fetch(o.href,l)}})();function oC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X0={exports:{}},mu={};var vw;function _j(){if(vw)return mu;vw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(i,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:i,key:u,ref:o!==void 0?o:null,props:l}}return mu.Fragment=t,mu.jsx=s,mu.jsxs=s,mu}var bw;function Uj(){return bw||(bw=1,X0.exports=_j()),X0.exports}var y=Uj(),Z0={exports:{}},Mt={};var xw;function Hj(){if(xw)return Mt;xw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=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 O(I,F,Z){this.props=I,this.context=F,this.refs=R,this.updater=Z||C}O.prototype.isReactComponent={},O.prototype.setState=function(I,F){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,F,"setState")},O.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function T(){}T.prototype=O.prototype;function A(I,F,Z){this.props=I,this.context=F,this.refs=R,this.updater=Z||C}var N=A.prototype=new T;N.constructor=A,E(N,O.prototype),N.isPureReactComponent=!0;var j=Array.isArray;function D(){}var M={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function L(I,F,Z){var ne=Z.ref;return{$$typeof:e,type:I,key:F,ref:ne!==void 0?ne:null,props:Z}}function K(I,F){return L(I.type,F,I.props)}function X(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function B(I){var F={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Z){return F[Z]})}var H=/\/+/g;function U(I,F){return typeof I=="object"&&I!==null&&I.key!=null?B(""+I.key):F.toString(36)}function _(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(F){I.status==="pending"&&(I.status="fulfilled",I.value=F)},function(F){I.status==="pending"&&(I.status="rejected",I.reason=F)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function Q(I,F,Z,ne,ye){var se=typeof I;(se==="undefined"||se==="boolean")&&(I=null);var ge=!1;if(I===null)ge=!0;else switch(se){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(I.$$typeof){case e:case t:ge=!0;break;case m:return ge=I._init,Q(ge(I._payload),F,Z,ne,ye)}}if(ge)return ye=ye(I),ge=ne===""?"."+U(I,0):ne,j(ye)?(Z="",ge!=null&&(Z=ge.replace(H,"$&/")+"/"),Q(ye,F,Z,"",function(Re){return Re})):ye!=null&&(X(ye)&&(ye=K(ye,Z+(ye.key==null||I&&I.key===ye.key?"":(""+ye.key).replace(H,"$&/")+"/")+ge)),F.push(ye)),1;ge=0;var fe=ne===""?".":ne+":";if(j(I))for(var ce=0;ce<I.length;ce++)ne=I[ce],se=fe+U(ne,ce),ge+=Q(ne,F,Z,se,ye);else if(ce=w(I),typeof ce=="function")for(I=ce.call(I),ce=0;!(ne=I.next()).done;)ne=ne.value,se=fe+U(ne,ce++),ge+=Q(ne,F,Z,se,ye);else if(se==="object"){if(typeof I.then=="function")return Q(_(I),F,Z,ne,ye);throw F=String(I),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return ge}function G(I,F,Z){if(I==null)return I;var ne=[],ye=0;return Q(I,ne,"","",function(se){return F.call(Z,se,ye++)}),ne}function q(I){if(I._status===-1){var F=I._result,Z=F();Z.then(function(ne){(I._status===0||I._status===-1)&&(I._status=1,I._result=ne,Z.status===void 0&&(Z.status="fulfilled",Z.value=ne))},function(ne){(I._status===0||I._status===-1)&&(I._status=2,I._result=ne,Z.status===void 0&&(Z.status="rejected",Z.reason=ne))}),I._status===-1&&(I._status=0,I._result=Z)}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 F=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(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)};function ee(I){var F=M.T,Z={};Z.types=F!==null?F.types:null,M.T=Z;try{var ne=I(),ye=M.S;ye!==null&&ye(Z,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(D,Y)}catch(se){Y(se)}finally{F!==null&&Z.types!==null&&(F.types=Z.types),M.T=F}}function $(I){var F=M.T;if(F!==null){var Z=F.types;Z===null?F.types=[I]:Z.indexOf(I)===-1&&Z.push(I)}else ee($.bind(null,I))}var ae={map:G,forEach:function(I,F,Z){G(I,function(){F.apply(this,arguments)},Z)},count:function(I){var F=0;return G(I,function(){F++}),F},toArray:function(I){return G(I,function(F){return F})||[]},only:function(I){if(!X(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Mt.Activity=h,Mt.Children=ae,Mt.Component=O,Mt.Fragment=s,Mt.Profiler=o,Mt.PureComponent=A,Mt.StrictMode=i,Mt.Suspense=f,Mt.ViewTransition=x,Mt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Mt.__COMPILER_RUNTIME={__proto__:null,c:function(I){return M.H.useMemoCache(I)}},Mt.addTransitionType=$,Mt.cache=function(I){return function(){return I.apply(null,arguments)}},Mt.cacheSignal=function(){return null},Mt.cloneElement=function(I,F,Z){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var ne=E({},I.props),ye=I.key;if(F!=null)for(se in F.key!==void 0&&(ye=""+F.key),F)!z.call(F,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&F.ref===void 0||(ne[se]=F[se]);var se=arguments.length-2;if(se===1)ne.children=Z;else if(1<se){for(var ge=Array(se),fe=0;fe<se;fe++)ge[fe]=arguments[fe+2];ne.children=ge}return L(I.type,ye,ne)},Mt.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:l,_context:I},I},Mt.createElement=function(I,F,Z){var ne,ye={},se=null;if(F!=null)for(ne in F.key!==void 0&&(se=""+F.key),F)z.call(F,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(ye[ne]=F[ne]);var ge=arguments.length-2;if(ge===1)ye.children=Z;else if(1<ge){for(var fe=Array(ge),ce=0;ce<ge;ce++)fe[ce]=arguments[ce+2];ye.children=fe}if(I&&I.defaultProps)for(ne in ge=I.defaultProps,ge)ye[ne]===void 0&&(ye[ne]=ge[ne]);return L(I,se,ye)},Mt.createRef=function(){return{current:null}},Mt.forwardRef=function(I){return{$$typeof:d,render:I}},Mt.isValidElement=X,Mt.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:q}},Mt.memo=function(I,F){return{$$typeof:g,type:I,compare:F===void 0?null:F}},Mt.startTransition=ee,Mt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Mt.use=function(I){return M.H.use(I)},Mt.useActionState=function(I,F,Z){return M.H.useActionState(I,F,Z)},Mt.useCallback=function(I,F){return M.H.useCallback(I,F)},Mt.useContext=function(I){return M.H.useContext(I)},Mt.useDebugValue=function(){},Mt.useDeferredValue=function(I,F){return M.H.useDeferredValue(I,F)},Mt.useEffect=function(I,F){return M.H.useEffect(I,F)},Mt.useEffectEvent=function(I){return M.H.useEffectEvent(I)},Mt.useId=function(){return M.H.useId()},Mt.useImperativeHandle=function(I,F,Z){return M.H.useImperativeHandle(I,F,Z)},Mt.useInsertionEffect=function(I,F){return M.H.useInsertionEffect(I,F)},Mt.useLayoutEffect=function(I,F){return M.H.useLayoutEffect(I,F)},Mt.useMemo=function(I,F){return M.H.useMemo(I,F)},Mt.useOptimistic=function(I,F){return M.H.useOptimistic(I,F)},Mt.useReducer=function(I,F,Z){return M.H.useReducer(I,F,Z)},Mt.useRef=function(I){return M.H.useRef(I)},Mt.useState=function(I){return M.H.useState(I)},Mt.useSyncExternalStore=function(I,F,Z){return M.H.useSyncExternalStore(I,F,Z)},Mt.useTransition=function(){return M.H.useTransition()},Mt.version="19.3.1",Mt}var Sw;function ed(){return Sw||(Sw=1,Z0.exports=Hj()),Z0.exports}var b=ed();const Ne=oC(b),lC=zj({__proto__:null,default:Ne},[b]);var J0={exports:{}},yu={},W0={exports:{}},ey={};var ww;function Fj(){return ww||(ww=1,(function(e){function t(_,Q){var G=_.length;_.push(Q);e:for(;0<G;){var q=G-1>>>1,Y=_[q];if(0<o(Y,Q))_[q]=Q,_[G]=Y,G=q;else break e}}function s(_){return _.length===0?null:_[0]}function i(_){if(_.length===0)return null;var Q=_[0],G=_.pop();if(G!==Q){_[0]=G;e:for(var q=0,Y=_.length,ee=Y>>>1;q<ee;){var $=2*(q+1)-1,ae=_[$],I=$+1,F=_[I];if(0>o(ae,G))I<Y&&0>o(F,ae)?(_[q]=F,_[I]=G,q=I):(_[q]=ae,_[$]=G,q=$);else if(I<Y&&0>o(F,G))_[q]=F,_[I]=G,q=I;else break e}}return Q}function o(_,Q){var G=_.sortIndex-Q.sortIndex;return G!==0?G:_.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.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,O=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(_){for(var Q=s(g);Q!==null;){if(Q.callback===null)i(g);else if(Q.startTime<=_)i(g),Q.sortIndex=Q.expirationTime,t(f,Q);else break;Q=s(g)}}function N(_){if(C=!1,A(_),!w)if(s(f)!==null)w=!0,j||(j=!0,X());else{var Q=s(g);Q!==null&&U(N,Q.startTime-_)}}var j=!1,D=-1,M=5,z=-1;function L(){return E?!0:!(e.unstable_now()-z<M)}function K(){if(E=!1,j){var _=e.unstable_now();z=_;var Q=!0;try{e:{w=!1,C&&(C=!1,O(D),D=-1),S=!0;var G=x;try{t:{for(A(_),h=s(f);h!==null&&!(h.expirationTime>_&&L());){var q=h.callback;if(typeof q=="function"){h.callback=null,x=h.priorityLevel;var Y=q(h.expirationTime<=_);if(_=e.unstable_now(),typeof Y=="function"){h.callback=Y,A(_),Q=!0;break t}h===s(f)&&i(f),A(_)}else i(f);h=s(f)}if(h!==null)Q=!0;else{var ee=s(g);ee!==null&&U(N,ee.startTime-_),Q=!1}}break e}finally{h=null,x=G,S=!1}Q=void 0}}finally{Q?X():j=!1}}}var X;if(typeof T=="function")X=function(){T(K)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,H=B.port2;B.port1.onmessage=K,X=function(){H.postMessage(null)}}else X=function(){R(K,0)};function U(_,Q){D=R(function(){_(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(_){_.callback=null},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(_){switch(x){case 1:case 2:case 3:var Q=3;break;default:Q=x}var G=x;x=Q;try{return _()}finally{x=G}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(_,Q){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var G=x;x=_;try{return Q()}finally{x=G}},e.unstable_scheduleCallback=function(_,Q,G){var q=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?q+G:q):G=q,_){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=G+Y,_={id:m++,callback:Q,priorityLevel:_,startTime:G,expirationTime:Y,sortIndex:-1},G>q?(_.sortIndex=G,t(g,_),s(f)===null&&_===s(g)&&(C?(O(D),D=-1):C=!0,U(N,G-q))):(_.sortIndex=Y,t(f,_),w||S||(w=!0,j||(j=!0,X()))),_},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(_){var Q=x;return function(){var G=x;x=Q;try{return _.apply(this,arguments)}finally{x=G}}}})(ey)),ey}var Ew;function Bj(){return Ew||(Ew=1,W0.exports=Fj()),W0.exports}var ty={exports:{}},Rr={};var Rw;function Vj(){if(Rw)return Rr;Rw=1;var e=ed();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 s(){}var i={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal"),l=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 Rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Rr.browser=function(m){return{$$typeof:l,_reason:m}},Rr.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)},Rr.flushSync=function(m){var h=f.T,x=i.p;try{if(f.T=null,i.p=2,m)return m()}finally{f.T=h,i.p=x,i.d.f()}},Rr.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(m,h))},Rr.prefetchDNS=function(m){typeof m=="string"&&i.d.D(m)},Rr.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"?i.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:S,integrity:w,fetchPriority:C}):x==="script"&&i.d.X(m,{crossOrigin:S,integrity:w,fetchPriority:C,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Rr.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);i.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&&i.d.M(m)},Rr.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);i.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})}},Rr.preloadModule=function(m,h){if(typeof m=="string")if(h){var x=g(h.as,h.crossOrigin);i.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 i.d.m(m)},Rr.requestFormReset=function(m){i.d.r(m)},Rr.unstable_batchedUpdates=function(m,h){return m(h)},Rr.useFormState=function(m,h,x){return f.H.useFormState(m,h,x)},Rr.useFormStatus=function(){return f.H.useHostTransitionStatus()},Rr.version="19.3.1",Rr}var Cw;function cC(){if(Cw)return ty.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(),ty.exports=Vj(),ty.exports}var Tw;function Kj(){if(Tw)return yu;Tw=1;var e=Bj(),t=ed(),s=cC();function i(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 l(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(l(n)!==n)throw Error(i(188))}function g(n){var r=n.alternate;if(!r){if(r=l(n),r===null)throw Error(i(188));return r!==n?null:n}for(var a=n,c=r;;){var p=a.return;if(p===null)break;var v=p.alternate;if(v===null){if(c=p.return,c!==null){a=c;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===a)return f(p),n;if(v===c)return f(p),r;v=v.sibling}throw Error(i(188))}if(a.return!==c.return)a=p,c=v;else{for(var k=!1,P=p.child;P;){if(P===a){k=!0,a=p,c=v;break}if(P===c){k=!0,c=p,a=v;break}P=P.sibling}if(!k){for(P=v.child;P;){if(P===a){k=!0,a=v,c=p;break}if(P===c){k=!0,c=v,a=p;break}P=P.sibling}if(!k)throw Error(i(189))}}if(a.alternate!==c)throw Error(i(190))}if(a.tag!==3)throw Error(i(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,c,p,v){for(;n!==null;){if((n.tag===5||n.tag===27||n.tag===6)&&a(n,c,p,v)||(n.tag!==22||n.memoizedState===null)&&(r||n.tag!==5&&n.tag!==27)&&h(n.child,r,a,c,p,v))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,c){for(;a!==null;){if(a===r)c.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(c.foundSelf)return n[1]=a,!0;n[0]=a}else if((a.tag!==22||a.memoizedState===null)&&C(n,r,a.child,c))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(i(559))}}var R=null,O=null;function T(n,r,a){return n===a?!0:n===r?(R=n,!0):!1}function A(n,r,a){return n===a?(O=n,!1):n===r?(O!==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 c=0,p=n;p;p=a(p))c++;p=0;for(var v=r;v;v=a(v))p++;for(;0<c-p;)n=a(n),c--;for(;0<p-c;)r=a(r),p--;for(;c--;){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"),z=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),K=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"),_=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),$=Symbol.for("react.legacy_hidden"),ae=Symbol.for("react.memo_cache_sentinel"),I=Symbol.for("react.view_transition"),F=Symbol.for("react.recoverable"),Z=Symbol.iterator;function ne(n){return n===null||typeof n!="object"?null:(n=Z&&n[Z]||n["@@iterator"],typeof n=="function"?n:null)}var ye=Symbol.for("react.client.reference");function se(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ye?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case K:return"Fragment";case B:return"Profiler";case X:return"StrictMode";case Q:return"Suspense";case G: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 _:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case q:return r=n.displayName||null,r!==null?r:se(n.type)||"Memo";case Y:r=n._payload,n=n._init;try{return se(n(r))}catch{}}return null}var ge=Array.isArray,fe=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Re={pending:!1,data:null,method:null,action:null},be=[],Le=-1;function Oe(n){return{current:n}}function ze(n){0>Le||(n.current=be[Le],be[Le]=null,Le--)}function Ve(n,r){Le++,be[Le]=n.current,n.current=r}var ke=Oe(null),Ue=Oe(null),xe=Oe(null),Fe=Oe(null);function Je(n,r){switch(Ve(xe,r),Ve(Ue,n),Ve(ke,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?kS(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=kS(r),n=OS(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}ze(ke),Ve(ke,n)}function ot(){ze(ke),ze(Ue),ze(xe)}function de(n){var r=n.memoizedState;r!==null&&(Pl._currentValue=r.memoizedState,Ve(Fe,n)),r=ke.current;var a=OS(r,n.type);r!==a&&(Ve(Ue,n),Ve(ke,a))}function Ee(n){Ue.current===n&&(ze(ke),ze(Ue)),Fe.current===n&&(ze(Fe),Pl._currentValue=Re)}var $e,Me;function De(n){if($e===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);$e=r&&r[1]||"",Me=-1<a.stack.indexOf(`
|
|
3
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
-
`+$e+n+Me}var xt=!1;function dt(n,r){if(!n||xt)return"";xt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(Ye){var ie=Ye}Reflect.construct(n,[],Te)}else{try{Te.call()}catch(Ye){ie=Ye}Te=!1;try{var he=Object.getOwnPropertyDescriptor(n.prototype,"props");Object.defineProperty(n.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Te=!0,new n}finally{Te&&(he!==void 0?Object.defineProperty(n.prototype,"props",he):delete n.prototype.props)}}}else{try{throw Error()}catch(Ye){ie=Ye}(Te=n())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(Ye){if(Ye&&ie&&typeof Ye.stack=="string")return[Ye.stack,ie.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),k=v[0],P=v[1];if(k&&P){var J=k.split(`
|
|
5
|
-
`),le=P.split(`
|
|
6
|
-
`);for(p=c=0;c<J.length&&!J[c].includes("DetermineComponentFrameRoot");)c++;for(;p<le.length&&!le[p].includes("DetermineComponentFrameRoot");)p++;if(c===J.length||p===le.length)for(c=J.length-1,p=le.length-1;1<=c&&0<=p&&J[c]!==le[p];)p--;for(;1<=c&&0<=p;c--,p--)if(J[c]!==le[p]){if(c!==1||p!==1)do if(c--,p--,0>p||J[c]!==le[p]){var me=`
|
|
7
|
-
`+J[c].replace(" at new "," at ");return n.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",n.displayName)),me}while(1<=c&&0<=p);break}}}finally{xt=!1,Error.prepareStackTrace=a}return(a=n?n.displayName||n.name:"")?De(a):""}function gt(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 Dt(n){try{var r="",a=null;do r+=gt(n,a),a=n,n=n.return;while(n);return r}catch(c){return`
|
|
8
|
-
Error generating stack: `+c.message+`
|
|
9
|
-
`+c.stack}}var It=Object.prototype.hasOwnProperty,tn=e.unstable_scheduleCallback,an=e.unstable_cancelCallback,nn=e.unstable_shouldYield,et=e.unstable_requestPaint,Et=e.unstable_now,Zt=e.unstable_getCurrentPriorityLevel,pt=e.unstable_ImmediatePriority,St=e.unstable_UserBlockingPriority,yt=e.unstable_NormalPriority,Ht=e.unstable_LowPriority,dn=e.unstable_IdlePriority,je=e.log,at=e.unstable_setDisableYieldValue,Ie=null,_e=null;function Ge(n){if(typeof je=="function"&&at(n),_e&&typeof _e.setStrictMode=="function")try{_e.setStrictMode(Ie,n)}catch{}}var tt=Math.clz32?Math.clz32:W,kt=Math.log,V=Math.LN2;function W(n){return n>>>=0,n===0?32:31-(kt(n)/V|0)|0}var re=256,ve=262144,Se=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 c=n.pendingLanes;if(c===0)return 0;var p=0,v=n.suspendedLanes,k=n.pingedLanes;n=n.warmLanes;var P=c&134217727;return P!==0?(c=P&~v,c!==0?p=qe(c):(k&=P,k!==0?p=qe(k):a||(a=P&~n,a!==0&&(p=qe(a))))):(P=c&~v,P!==0?p=qe(P):k!==0?p=qe(k):a||(a=c&~n,a!==0&&(p=qe(a)))),p===0?0:r!==0&&r!==p&&(r&v)===0&&(v=p&-p,a=r&-r,v>=a||v===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 c=31-tt(a),p=1<<c;r|=n[c],a&=~p}return r}function ct(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 nt(){var n=Se;return Se<<=1,(Se&62914560)===0&&(Se=4194304),n}function Rt(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 Yt(n,r,a,c,p,v){var k=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,J=n.expirationTimes,le=n.hiddenUpdates;for(a=k&~a;0<a;){var me=31-tt(a),Te=1<<me;P[me]=0,J[me]=-1;var ie=le[me];if(ie!==null)for(le[me]=null,me=0;me<ie.length;me++){var he=ie[me];he!==null&&(he.lane&=-536870913)}a&=~Te}c!==0&&Bt(n,c,0),v!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=v&~(k&~r))}function Bt(n,r,a){n.pendingLanes|=r,n.suspendedLanes&=~r;var c=31-tt(r);n.entangledLanes|=r,n.entanglements[c]=n.entanglements[c]|1073741824|a&261930}function On(n,r){var a=n.entangledLanes|=r;for(n=n.entanglements;a;){var c=31-tt(a),p=1<<c;p&r|n[c]&r&&(n[c]|=r),a&=~p}}function $t(n,r){var a=r&-r;return a=(a&42)!==0?1:Vt(a),(a&(n.suspendedLanes|r))!==0?0:a}function Vt(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=ce.p;return n!==0?n:(n=window.event,n===void 0?32:dw(n.type))}function rs(n,r){var a=ce.p;try{return ce.p=n,r()}finally{ce.p=a}}var fn=Math.random().toString(36).slice(2),hn="__reactFiber$"+fn,An="__reactProps$"+fn,jn="__reactContainer$"+fn,Mi="__reactEvents$"+fn,Lr="__reactListeners$"+fn,Fs="__reactHandles$"+fn,ss="__reactResources$"+fn,Ss="__reactMarker$"+fn,_t="__reactLoad$"+fn;function Yn(n){delete n[hn],delete n[An],delete n[Lr],delete n[Fs]}function Bn(n){var r;if(r=n[hn])return r;for(var a=n.parentNode;a;){if(r=a[jn]||a[hn]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(n=qS(n);n!==null;){if(a=n[hn])return a;n=qS(n)}return r}n=a,a=n.parentNode}return null}function mr(n){if(n=n[hn]||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 pe(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(i(33))}function Ae(n){var r=n[ss];return r||(r=n[ss]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function we(n){n[Ss]=!0}function rt(n){n[_t]=void 0}var At=new Set,Ct={};function Ft(n,r){xn(n,r),xn(n+"Capture",r)}function xn(n,r){for(Ct[n]=r,n=0;n<r.length;n++)At.add(r[n])}var pn=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={},jt={};function on(n){return It.call(jt,n)?!0:It.call(vt,n)?!1:pn.test(n)?jt[n]=!0:(vt[n]=!0,!1)}var mt=!1;function ir(){var n=mt;return mt=!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 c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,a)}}function is(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 Xn(n,r,a,c){if(c===null)n.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttributeNS(r,a,c)}}function Zn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Wo(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Cc(n,r,a){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,v=c.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return p.call(this)},set:function(k){a=""+k,v.call(this,k)}}),Object.defineProperty(n,r,{enumerable:c.enumerable}),{getValue:function(){return a},setValue:function(k){a=""+k},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function Ni(n){if(!n._valueTracker){var r=Wo(n)?"checked":"value";n._valueTracker=Cc(n,r,""+n[r])}}function el(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var a=r.getValue(),c="";return n&&(c=Wo(n)?n.checked?"true":"false":n.value),n=c,n!==a?(r.setValue(n),!0):!1}var _d=/[\n"\\]/g;function Dn(n){return n.replace(_d,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Ar(n,r,a,c,p,v,k,P){n.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.type=k:n.removeAttribute("type"),r!=null?k==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+Zn(r)):n.value!==""+Zn(r)&&(n.value=""+Zn(r)):k!=="submit"&&k!=="reset"||n.removeAttribute("value"),r!=null?k==="number"&&n.value==r?tl(n,Zn(n.value)):tl(n,Zn(r)):a!=null?tl(n,Zn(a)):c!=null&&n.removeAttribute("value"),p==null&&v!=null&&(n.defaultChecked=!!v),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?n.name=""+Zn(P):n.removeAttribute("name")}function aa(n,r,a,c,p,v,k,P){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.type=v),r!=null||a!=null){if(!(v!=="submit"&&v!=="reset"||r!=null)){Ni(n);return}a=a!=null?""+Zn(a):"",r=r!=null?""+Zn(r):a,P||r===n.value||(n.value=r),n.defaultValue=r}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=P?n.checked:!!c,n.defaultChecked=!!c,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(n.name=k),Ni(n)}function tl(n,r){n.defaultValue!==""+r&&(n.defaultValue=""+r)}function Yr(n,r,a,c){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&&c&&(n[a].defaultSelected=!0)}else{for(a=""+Zn(a),r=null,p=0;p<n.length;p++){if(n[p].value===a){n[p].selected=!0,c&&(n[p].defaultSelected=!0);return}r!==null||n[p].disabled||(r=n[p])}r!==null&&(r.selected=!0)}}function nl(n,r,a){if(r!=null&&(r=""+Zn(r),r!==n.value&&(n.value=r),a==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=a!=null?""+Zn(a):""}function as(n,r,a,c){if(r==null){if(c!=null){if(a!=null)throw Error(i(92));if(ge(c)){if(1<c.length)throw Error(i(93));c=c[0]}a=c}a==null&&(a=""),r=a}a=Zn(r),n.defaultValue=a,c=n.textContent,c===a&&c!==""&&c!==null&&(n.value=c),Ni(n)}function zr(n,r){if(r){var a=n.firstChild;if(a&&a===n.lastChild&&a.nodeType===3){a.nodeValue=r;return}}n.textContent=r}var oa=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 Tc(n,r,a){var c=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?c?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":c?n.setProperty(r,a):typeof a!="number"||a===0||oa.has(r)?r==="float"?n.cssFloat=a:n[r]=(""+a).trim():n[r]=a+"px"}function os(n,r,a){if(r!=null&&typeof r!="object")throw Error(i(62));if(n=n.style,a!=null){for(var c in a)!a.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="",mt=!0);for(var p in r)c=r[p],r.hasOwnProperty(p)&&a[p]!==c&&(Tc(n,p,c),mt=!0)}else for(var v in r)r.hasOwnProperty(v)&&Tc(n,v,r[v])}function so(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 kc=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"]]),Oc=/^[\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 yr(n){return Oc.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function _r(){}var io=null;function ao(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var rn=null,lr=null;function ws(n){var r=mr(n);if(r&&(n=r.stateNode)){var a=n[An]||null;e:switch(n=r.stateNode,r.type){case"input":if(Ar(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 c=a[r];if(c!==n&&c.form===n.form){var p=c[An]||null;if(!p)throw Error(i(90));Ar(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<a.length;r++)c=a[r],c.form===n.form&&el(c)}break e;case"textarea":nl(n,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&Yr(n,!!a.multiple,r,!1)}}}var ls=!1;function oo(n,r,a){if(ls)return n(r,a);ls=!0;try{var c=n(r);return c}finally{if(ls=!1,(rn!==null||lr!==null)&&(Uf(),rn&&(r=rn,n=lr,lr=rn=null,ws(r),n)))for(r=0;r<n.length;r++)ws(n[r])}}function Di(n,r){var a=n.stateNode;if(a===null)return null;var c=a[An]||null;if(c===null)return null;a=c[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":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(a&&typeof a!="function")throw Error(i(231,r,typeof a));return a}var vr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lo=!1;if(vr)try{var Ac={};Object.defineProperty(Ac,"passive",{get:function(){lo=!0}}),window.addEventListener("test",Ac,Ac),window.removeEventListener("test",Ac,Ac)}catch{lo=!1}var la=null,Ig=null,Ud=null;function Ex(){if(Ud)return Ud;var n,r=Ig,a=r.length,c,p="value"in la?la.value:la.textContent,v=p.length;for(n=0;n<a&&r[n]===p[n];n++);var k=a-n;for(c=1;c<=k&&r[a-c]===p[v-c];c++);return Ud=p.slice(n,1<c?1-c:void 0)}function Hd(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 Fd(){return!0}function Rx(){return!1}function Ur(n){function r(a,c,p,v,k){this._reactName=a,this._targetInst=p,this.type=c,this.nativeEvent=v,this.target=k,this.currentTarget=null;for(var P in n)n.hasOwnProperty(P)&&(a=n[P],this[P]=a?a(v):v[P]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Fd:Rx,this.isPropagationStopped=Rx,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=Fd)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Fd)},persist:function(){},isPersistent:Fd}),r}var ca={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bd=Ur(ca),Mc=D({},ca,{view:0,detail:0}),lN=Ur(Mc),Pg,Lg,Nc,Vd=D({},Mc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_g,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!==Nc&&(Nc&&n.type==="mousemove"?(Pg=n.screenX-Nc.screenX,Lg=n.screenY-Nc.screenY):Lg=Pg=0,Nc=n),Pg)},movementY:function(n){return"movementY"in n?n.movementY:Lg}}),Cx=Ur(Vd),cN=D({},Vd,{dataTransfer:0}),uN=Ur(cN),dN=D({},Mc,{relatedTarget:0}),zg=Ur(dN),fN=D({},ca,{animationName:0,elapsedTime:0,pseudoElement:0}),hN=Ur(fN),pN=D({},ca,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),gN=Ur(pN),mN=D({},ca,{data:0}),Tx=Ur(mN),yN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vN={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"},bN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xN(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=bN[n])?!!r[n]:!1}function _g(){return xN}var SN=D({},Mc,{key:function(n){if(n.key){var r=yN[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=Hd(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?vN[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_g,charCode:function(n){return n.type==="keypress"?Hd(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Hd(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),wN=Ur(SN),EN=D({},Vd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kx=Ur(EN),RN=D({},ca,{submitter:0}),CN=Ur(RN),TN=D({},Mc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_g}),kN=Ur(TN),ON=D({},ca,{propertyName:0,elapsedTime:0,pseudoElement:0}),AN=Ur(ON),MN=D({},Vd,{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}),NN=Ur(MN),DN=D({},ca,{newState:0,oldState:0,source:0}),jN=Ur(DN),IN=[9,13,27,32],Ug=vr&&"CompositionEvent"in window,Dc=null;vr&&"documentMode"in document&&(Dc=document.documentMode);var PN=vr&&"TextEvent"in window&&!Dc,Ox=vr&&(!Ug||Dc&&8<Dc&&11>=Dc),Ax=" ",Mx=!1;function Nx(n,r){switch(n){case"keyup":return IN.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dx(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var rl=!1;function LN(n,r){switch(n){case"compositionend":return Dx(r);case"keypress":return r.which!==32?null:(Mx=!0,Ax);case"textInput":return n=r.data,n===Ax&&Mx?null:n;default:return null}}function zN(n,r){if(rl)return n==="compositionend"||!Ug&&Nx(n,r)?(n=Ex(),Ud=Ig=la=null,rl=!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 Ox&&r.locale!=="ko"?null:r.data;default:return null}}var _N={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 jx(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!_N[n.type]:r==="textarea"}function Ix(n,r,a,c){rn?lr?lr.push(c):lr=[c]:rn=c,r=qf(r,"onChange"),0<r.length&&(a=new Bd("onChange","change",null,a,c),n.push({event:a,listeners:r}))}var jc=null,Ic=null;function UN(n){SS(n,0)}function Kd(n){var r=pe(n);if(el(r))return n}function Px(n,r){if(n==="change")return r}var Lx=!1;if(vr){var Hg;if(vr){var Fg="oninput"in document;if(!Fg){var zx=document.createElement("div");zx.setAttribute("oninput","return;"),Fg=typeof zx.oninput=="function"}Hg=Fg}else Hg=!1;Lx=Hg&&(!document.documentMode||9<document.documentMode)}function _x(){jc&&(jc.detachEvent("onpropertychange",Ux),Ic=jc=null)}function Ux(n){if(n.propertyName==="value"&&Kd(Ic)){var r=[];Ix(r,Ic,n,ao(n)),oo(UN,r)}}function HN(n,r,a){n==="focusin"?(_x(),jc=r,Ic=a,jc.attachEvent("onpropertychange",Ux)):n==="focusout"&&_x()}function FN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Kd(Ic)}function BN(n,r){if(n==="click")return Kd(r)}function VN(n,r){if(n==="input"||n==="change")return Kd(r)}function KN(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var cs=typeof Object.is=="function"?Object.is:KN;function Pc(n,r){if(cs(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var a=Object.keys(n),c=Object.keys(r);if(a.length!==c.length)return!1;for(c=0;c<a.length;c++){var p=a[c];if(!It.call(r,p)||!cs(n[p],r[p]))return!1}return!0}function Bg(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 Hx(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Fx(n,r){var a=Hx(n);n=0;for(var c;a;){if(a.nodeType===3){if(c=n+a.textContent.length,n<=r&&c>=r)return{node:a,offset:r-n};n=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Hx(a)}}function Bx(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Bx(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Vx(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=Bg(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=Bg(n.document)}return r}function Vg(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 qN=vr&&"documentMode"in document&&11>=document.documentMode,sl=null,Kg=null,Lc=null,qg=!1;function Kx(n,r,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;qg||sl==null||sl!==Bg(c)||(c=sl,"selectionStart"in c&&Vg(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Lc&&Pc(Lc,c)||(Lc=c,c=qf(Kg,"onSelect"),0<c.length&&(r=new Bd("onSelect","select",null,r,a),n.push({event:r,listeners:c}),r.target=sl)))}function co(n,r){var a={};return a[n.toLowerCase()]=r.toLowerCase(),a["Webkit"+n]="webkit"+r,a["Moz"+n]="moz"+r,a}var il={animationend:co("Animation","AnimationEnd"),animationiteration:co("Animation","AnimationIteration"),animationstart:co("Animation","AnimationStart"),transitionrun:co("Transition","TransitionRun"),transitionstart:co("Transition","TransitionStart"),transitioncancel:co("Transition","TransitionCancel"),transitionend:co("Transition","TransitionEnd")},Yg={},qx={};vr&&(qx=document.createElement("div").style,"AnimationEvent"in window||(delete il.animationend.animation,delete il.animationiteration.animation,delete il.animationstart.animation),"TransitionEvent"in window||delete il.transitionend.transition);function uo(n){if(Yg[n])return Yg[n];if(!il[n])return n;var r=il[n],a;for(a in r)if(r.hasOwnProperty(a)&&a in qx)return Yg[n]=r[a];return n}var Yx=uo("animationend"),$x=uo("animationiteration"),Gx=uo("animationstart"),YN=uo("transitionrun"),$N=uo("transitionstart"),GN=uo("transitioncancel"),Qx=uo("transitionend"),Xx=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 Bs(n,r){Xx.set(n,r),Ft(r,[n])}var QN=0;function ji(n,r){if(n.name!=null&&n.name!=="auto")return n.name;if(r.autoName!==null)return r.autoName;n=Ys.identifierPrefix;var a=QN++;return n="_"+n+"t_"+a.toString(32)+"_",r.autoName=n}function Zx(n){if(n==null||typeof n=="string")return n;var r=null,a=Cl;if(a!==null)for(var c=0;c<a.length;c++){var p=n[a[c]];if(p!=null){if(p==="none")return"none";r=r==null?p:r+(" "+p)}}return r??n.default}function Ii(n,r){return n=Zx(n),r=Zx(r),r==null?n==="auto"?null:n:r==="auto"?null:r}var qd=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)},Es=[],al=0,Gg=0;function Yd(){for(var n=al,r=Gg=al=0;r<n;){var a=Es[r];Es[r++]=null;var c=Es[r];Es[r++]=null;var p=Es[r];Es[r++]=null;var v=Es[r];if(Es[r++]=null,c!==null&&p!==null){var k=c.pending;k===null?p.next=p:(p.next=k.next,k.next=p),c.pending=p}v!==0&&Jx(a,p,v)}}function $d(n,r,a,c){Es[al++]=n,Es[al++]=r,Es[al++]=a,Es[al++]=c,Gg|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function Qg(n,r,a,c){return $d(n,r,a,c),Gd(n)}function fo(n,r){return $d(n,null,null,r),Gd(n)}function Jx(n,r,a){n.lanes|=a;var c=n.alternate;c!==null&&(c.lanes|=a);for(var p=!1,v=n.return;v!==null;)v.childLanes|=a,c=v.alternate,c!==null&&(c.childLanes|=a),v.tag===22&&(n=v.stateNode,n===null||n._visibility&1||(p=!0)),n=v,v=v.return;return n.tag===3?(v=n.stateNode,p&&r!==null&&(p=31-tt(a),n=v.hiddenUpdates,c=n[p],c===null?n[p]=[r]:c.push(r),r.lane=a|536870912),v):null}function Gd(n){if(50<su)throw su=0,_f=null,Error(i(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var ol={};function XN(n,r,a,c){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=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $r(n,r,a,c){return new XN(n,r,a,c)}function Xg(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Pi(n,r){var a=n.alternate;return a===null?(a=$r(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 Wx(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 Qd(n,r,a,c,p,v){var k=0;if(c=n,typeof c=="function")Xg(c)&&(k=1);else if(typeof c=="string")k=Rj(n,a,ke.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(c){case ee:return n=$r(31,a,r,p),n.elementType=ee,n.lanes=v,n;case K:return ho(a.children,p,v,r);case X:k=8,p|=24;break;case B:return n=$r(12,a,r,p|2),n.elementType=B,n.lanes=v,n;case Q:return n=$r(13,a,r,p),n.elementType=Q,n.lanes=v,n;case G:return n=$r(19,a,r,p),n.elementType=G,n.lanes=v,n;case $:case I:return n=p|32,n=$r(30,a,r,n),n.elementType=I,n.lanes=v,n.stateNode={autoName:null,paired:null,clones:null,ref:null},n;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case U:k=10;break e;case H:k=9;break e;case _:k=11;break e;case q:k=14;break e;case Y:k=16,c=null;break e}k=29,a=Error(i(130,n===null?"null":typeof n,"")),c=null}return r=$r(k,a,r,p),r.elementType=n,r.type=c,r.lanes=v,r}function ho(n,r,a,c){return n=$r(7,n,c,r),n.lanes=a,n}function Zg(n,r,a){return n=$r(6,n,null,r),n.lanes=a,n}function e2(n){var r=$r(18,null,null,0);return r.stateNode=n,r}function Jg(n,r,a){return r=$r(4,n.children!==null?n.children:[],n.key,r),r.lanes=a,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var t2=new WeakMap;function Rs(n,r){if(typeof n=="object"&&n!==null){var a=t2.get(n);return a!==void 0?a:(r={value:n,source:r,stack:Dt(r)},t2.set(n,r),r)}return{value:n,source:r,stack:Dt(r)}}var ll=[],cl=0,Xd=null,zc=0,Cs=[],Ts=0,ua=null,oi=1,li="";function Li(n,r){ll[cl++]=zc,ll[cl++]=Xd,Xd=n,zc=r}function n2(n,r,a){Cs[Ts++]=oi,Cs[Ts++]=li,Cs[Ts++]=ua,ua=n;var c=oi;n=li;var p=32-tt(c)-1;c&=~(1<<p),a+=1;var v=32-tt(r)+p;if(30<v){var k=p-p%5;v=(c&(1<<k)-1).toString(32),c>>=k,p-=k,oi=1<<32-tt(r)+p|a<<p|c,li=v+n}else oi=1<<v|a<<p|c,li=n}function Zd(n){n.return!==null&&(Li(n,1),n2(n,1,0))}function Wg(n){for(;n===Xd;)Xd=ll[--cl],ll[cl]=null,zc=ll[--cl],ll[cl]=null;for(;n===ua;)ua=Cs[--Ts],Cs[Ts]=null,li=Cs[--Ts],Cs[Ts]=null,oi=Cs[--Ts],Cs[Ts]=null}function r2(n,r){Cs[Ts++]=oi,Cs[Ts++]=li,Cs[Ts++]=ua,oi=r.id,li=r.overflow,ua=n}var cr=null,Mn=null,Kt=!1,da=null,ks=!1,em=Error(i(519));function fa(n){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _c(Rs(r,n)),em}function s2(n){var r=n.stateNode,a=n.type,c=n.memoizedProps;switch(r[hn]=n,r[An]=c,a){case"dialog":Qt("cancel",r),Qt("close",r);break;case"iframe":case"object":case"embed":Qt("load",r);break;case"video":case"audio":for(a=0;a<au.length;a++)Qt(au[a],r);break;case"source":Qt("error",r);break;case"img":case"image":case"link":Qt("error",r),Qt("load",r);break;case"details":Qt("toggle",r);break;case"input":Qt("invalid",r),aa(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Qt("invalid",r);break;case"textarea":Qt("invalid",r),as(r,c.value,c.defaultValue,c.children)}a=c.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||c.suppressHydrationWarning===!0||CS(r.textContent,a)?(c.popover!=null&&(Qt("beforetoggle",r),Qt("toggle",r)),c.onScroll!=null&&Qt("scroll",r),c.onScrollEnd!=null&&Qt("scrollend",r),c.onClick!=null&&(r.onclick=_r),r=!0):r=!1,r||fa(n,!0)}function Jd(n){for(cr=n.return;cr;)switch(cr.tag){case 5:case 31:case 13:ks=!1;return;case 27:case 3:ks=!0;return;default:cr=cr.return}}function ul(n){if(n!==cr)return!1;if(!Kt)return Jd(n),Kt=!0,!1;var r=n.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=n.type,a=!(a!=="form"&&a!=="button")||M0(n.type,n.memoizedProps)),a=!a),a&&Mn&&fa(n),Jd(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Mn=KS(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Mn=KS(n)}else r===27?(r=Mn,Oa(n.type)?(n=U0,U0=null,Mn=n):Mn=r):Mn=cr?As(n.stateNode.nextSibling):null;return!0}function po(){Mn=cr=null,Kt=!1}function tm(){var n=da;return n!==null&&(Xr===null?Xr=n:Xr.push.apply(Xr,n),da=null),n}function _c(n){da===null?da=[n]:da.push(n)}var nm=Oe(null),go=null,zi=null;function ha(n,r,a){Ve(nm,r._currentValue),r._currentValue=a}function _i(n){n._currentValue=nm.current,ze(nm)}function Wd(n,r,a){for(;n!==null;){var c=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),n===a)break;n=n.return}}function rm(n,r,a,c){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var v=p.dependencies;if(v!==null){var k=p.child;v=v.firstContext;e:for(;v!==null;){var P=v;v=p;for(var J=0;J<r.length;J++)if(P.context===r[J]){v.lanes|=a,P=v.alternate,P!==null&&(P.lanes|=a),Wd(v.return,a,n),c||(k=null);break e}v=P.next}}else if(p.tag===18){if(k=p.return,k===null)throw Error(i(341));k.lanes|=a,v=k.alternate,v!==null&&(v.lanes|=a),Wd(k,a,n),k=null}else p.tag===13&&p.memoizedState!==null&&p.memoizedState.dehydrated===null?(p.lanes|=a,k=p.alternate,k!==null&&(k.lanes|=a),Wd(p.return,a,n),k=p.child,k=k!==null?k.sibling:null):k=p.child;if(k!==null)k.return=p;else for(k=p;k!==null;){if(k===n){k=null;break}if(p=k.sibling,p!==null){p.return=k.return,k=p;break}k=k.return}p=k}}function mo(n,r,a,c){n=null;for(var p=r,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var k=p.alternate;if(k===null)throw Error(i(387));if(k=k.memoizedProps,k!==null){var P=p.type;cs(p.pendingProps.value,k.value)||(n!==null?n.push(P):n=[P])}}else if(p===Fe.current){if(k=p.alternate,k===null)throw Error(i(387));k.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(Pl):n=[Pl])}p=p.return}return n!==null&&rm(r,n,a,c),r.flags|=262144,n!==null}function ef(n){for(n=n.firstContext;n!==null;){if(!cs(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function yo(n){go=n,zi=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function br(n){return i2(go,n)}function tf(n,r){return go===null&&yo(n),i2(n,r)}function i2(n,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},zi===null){if(n===null)throw Error(i(308));zi=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else zi=zi.next=r;return a}var ZN=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(a,c){n.push(c)}};this.abort=function(){r.aborted=!0,n.forEach(function(a){return a()})}},JN=e.unstable_scheduleCallback,WN=e.unstable_NormalPriority,Jn={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sm(){return{controller:new ZN,data:new Map,refCount:0}}function Uc(n){n.refCount--,n.refCount===0&&JN(WN,function(){n.controller.abort()})}function a2(n,r){if((n.pendingLanes&4194048)!==0){var a=n.transitionTypes;for(a===null&&(a=n.transitionTypes=[]),n=0;n<r.length;n++){var c=r[n];a.indexOf(c)===-1&&a.push(c)}}}var Hc=null;function eD(n){var r=n.transitionTypes;return n.transitionTypes=null,r}var Fc=null,im=0,vo=0,dl=null;function tD(n,r){if(Fc===null){var a=Fc=[];im=0,vo=S0(),dl={status:"pending",value:void 0,then:function(c){a.push(c)}}}return im++,r.then(o2,o2),r}function o2(){if(--im===0&&(Hc=null,Fc!==null)){dl!==null&&(dl.status="fulfilled");var n=Fc;Fc=null,vo=0,dl=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function nD(n,r){var a=[],c={status:"pending",value:null,reason:null,then:function(p){a.push(p)}};return n.then(function(){c.status="fulfilled",c.value=r;for(var p=0;p<a.length;p++)(0,a[p])(r)},function(p){for(c.status="rejected",c.reason=p,p=0;p<a.length;p++)(0,a[p])(void 0)}),c}var l2=fe.S;fe.S=function(n,r){if(eS=Et(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&tD(n,r),Hc!==null)for(var a=Al;a!==null;)a2(a,Hc),a=a.next;if(a=n.types,a!==null){for(var c=Al;c!==null;)a2(c,a),c=c.next;if(vo!==0){c=Hc,c===null&&(c=Hc=[]);for(var p=0;p<a.length;p++){var v=a[p];c.indexOf(v)===-1&&c.push(v)}}}l2!==null&&l2(n,r)};var bo=Oe(null);function am(){var n=bo.current;return n!==null?n:kn.pooledCache}function nf(n,r){r===null?Ve(bo,bo.current):Ve(bo,r.pool)}function c2(){var n=am();return n===null?null:{parent:Jn._currentValue,pool:n}}var fl=Error(i(460)),om=Error(i(474)),rf=Error(i(542)),sf={then:function(){}};function u2(n){return n=n.status,n==="fulfilled"||n==="rejected"}function d2(n,r,a){switch(a=n[a],a===void 0?n.push(r):a!==r&&(r.then(_r,_r),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,h2(n),n===void 0&&!("reason"in r)?Error(i(600)):n;default:if(typeof r.status=="string")r.then(_r,_r);else{if(n=kn,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=r,n.status="pending",n.then(function(c){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=c}},function(c){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,h2(n),n}throw So=r,fl}}function xo(n){try{var r=n._init;return r(n._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(So=a,fl):a}}var So=null;function f2(){if(So===null)throw Error(i(459));var n=So;return So=null,n}function h2(n){if(n===fl||n===rf)throw Error(i(483))}var hl=null,Bc=0;function af(n){var r=Bc;return Bc+=1,hl===null&&(hl=[]),d2(hl,n,r)}function pa(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function of(n,r){throw r.$$typeof===M?Error(i(525)):(n=Object.prototype.toString.call(r),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function p2(n){function r(oe,te){if(n){var ue=oe.deletions;ue===null?(oe.deletions=[te],oe.flags|=16):ue.push(te)}}function a(oe,te){if(!n)return null;for(;te!==null;)r(oe,te),te=te.sibling;return null}function c(oe){for(var te=new Map;oe!==null;)oe.key===null?te.set(oe.index,oe):te.set(oe.key,oe),oe=oe.sibling;return te}function p(oe,te){return oe=Pi(oe,te),oe.index=0,oe.sibling=null,oe}function v(oe,te,ue){return oe.index=ue,n?(ue=oe.alternate,ue!==null?(ue=ue.index,ue<te?(oe.flags|=2,te):ue):(oe.flags|=134217730,te)):(oe.flags|=1048576,te)}function k(oe){return n&&oe.alternate===null&&(oe.flags|=134217730),oe}function P(oe,te,ue,Ce){return te===null||te.tag!==6?(te=Zg(ue,oe.mode,Ce),te.return=oe,te):(te=p(te,ue),te.return=oe,te)}function J(oe,te,ue,Ce){var We=ue.type;return We===K?(oe=me(oe,te,ue.props.children,Ce,ue.key),pa(oe,ue),oe):te!==null&&(te.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===Y&&xo(We)===te.type)?(te=p(te,ue.props),pa(te,ue),te.return=oe,te):(te=Qd(ue.type,ue.key,ue.props,null,oe.mode,Ce),pa(te,ue),te.return=oe,te)}function le(oe,te,ue,Ce){return te===null||te.tag!==4||te.stateNode.containerInfo!==ue.containerInfo||te.stateNode.implementation!==ue.implementation?(te=Jg(ue,oe.mode,Ce),te.return=oe,te):(te=p(te,ue.children||[]),te.return=oe,te)}function me(oe,te,ue,Ce,We){return te===null||te.tag!==7?(te=ho(ue,oe.mode,Ce,We),te.return=oe,te):(te=p(te,ue),te.return=oe,te)}function Te(oe,te,ue){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Zg(""+te,oe.mode,ue),te.return=oe,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case z:return ue=Qd(te.type,te.key,te.props,null,oe.mode,ue),pa(ue,te),ue.return=oe,ue;case L:return te=Jg(te,oe.mode,ue),te.return=oe,te;case Y:return te=xo(te),Te(oe,te,ue)}if(ge(te)||ne(te))return te=ho(te,oe.mode,ue,null),te.return=oe,te;if(typeof te.then=="function")return Te(oe,af(te),ue);if(te.$$typeof===U)return Te(oe,tf(oe,te),ue);of(oe,te)}return null}function ie(oe,te,ue,Ce){var We=te!==null?te.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return We!==null?null:P(oe,te,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case z:return ue.key===We?J(oe,te,ue,Ce):null;case L:return ue.key===We?le(oe,te,ue,Ce):null;case Y:return ue=xo(ue),ie(oe,te,ue,Ce)}if(ge(ue)||ne(ue))return We!==null?null:me(oe,te,ue,Ce,null);if(typeof ue.then=="function")return ie(oe,te,af(ue),Ce);if(ue.$$typeof===U)return ie(oe,te,tf(oe,ue),Ce);of(oe,ue)}return null}function he(oe,te,ue,Ce,We){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return oe=oe.get(ue)||null,P(te,oe,""+Ce,We);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case z:return oe=oe.get(Ce.key===null?ue:Ce.key)||null,J(te,oe,Ce,We);case L:return oe=oe.get(Ce.key===null?ue:Ce.key)||null,le(te,oe,Ce,We);case Y:return Ce=xo(Ce),he(oe,te,ue,Ce,We)}if(ge(Ce)||ne(Ce))return oe=oe.get(ue)||null,me(te,oe,Ce,We,null);if(typeof Ce.then=="function")return he(oe,te,ue,af(Ce),We);if(Ce.$$typeof===U)return he(oe,te,ue,tf(te,Ce),We);of(te,Ce)}return null}function Ye(oe,te,ue,Ce){for(var We=null,Wt=null,ut=te,wt=te=0,tr=null;ut!==null&&wt<ue.length;wt++){ut.index>wt?(tr=ut,ut=null):tr=ut.sibling;var sn=ie(oe,ut,ue[wt],Ce);if(sn===null){ut===null&&(ut=tr);break}n&&ut&&sn.alternate===null&&r(oe,ut),te=v(sn,te,wt),Wt===null?We=sn:Wt.sibling=sn,Wt=sn,ut=tr}if(wt===ue.length)return a(oe,ut),Kt&&Li(oe,wt),We;if(ut===null){for(;wt<ue.length;wt++)ut=Te(oe,ue[wt],Ce),ut!==null&&(te=v(ut,te,wt),Wt===null?We=ut:Wt.sibling=ut,Wt=ut);return Kt&&Li(oe,wt),We}for(ut=c(ut);wt<ue.length;wt++)tr=he(ut,oe,wt,ue[wt],Ce),tr!==null&&(n&&(sn=tr.alternate,sn!==null&&ut.delete(sn.key===null?wt:sn.key)),te=v(tr,te,wt),Wt===null?We=tr:Wt.sibling=tr,Wt=tr);return n&&ut.forEach(function(ja){return r(oe,ja)}),Kt&&Li(oe,wt),We}function it(oe,te,ue,Ce){if(ue==null)throw Error(i(151));for(var We=null,Wt=null,ut=te,wt=te=0,tr=null,sn=ue.next();ut!==null&&!sn.done;wt++,sn=ue.next()){ut.index>wt?(tr=ut,ut=null):tr=ut.sibling;var ja=ie(oe,ut,sn.value,Ce);if(ja===null){ut===null&&(ut=tr);break}n&&ut&&ja.alternate===null&&r(oe,ut),te=v(ja,te,wt),Wt===null?We=ja:Wt.sibling=ja,Wt=ja,ut=tr}if(sn.done)return a(oe,ut),Kt&&Li(oe,wt),We;if(ut===null){for(;!sn.done;wt++,sn=ue.next())sn=Te(oe,sn.value,Ce),sn!==null&&(te=v(sn,te,wt),Wt===null?We=sn:Wt.sibling=sn,Wt=sn);return Kt&&Li(oe,wt),We}for(ut=c(ut);!sn.done;wt++,sn=ue.next())sn=he(ut,oe,wt,sn.value,Ce),sn!==null&&(n&&(tr=sn.alternate,tr!==null&&ut.delete(tr.key===null?wt:tr.key)),te=v(sn,te,wt),Wt===null?We=sn:Wt.sibling=sn,Wt=sn);return n&&ut.forEach(function(Lj){return r(oe,Lj)}),Kt&&Li(oe,wt),We}function Lt(oe,te,ue,Ce){if(typeof ue=="object"&&ue!==null&&ue.type===K&&ue.key===null&&ue.props.ref===void 0&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case z:e:{for(var We=ue.key;te!==null;){if(te.key===We){if(We=ue.type,We===K){if(te.tag===7){a(oe,te.sibling),Ce=p(te,ue.props.children),pa(Ce,ue),Ce.return=oe,oe=Ce;break e}}else if(te.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===Y&&xo(We)===te.type){a(oe,te.sibling),Ce=p(te,ue.props),pa(Ce,ue),Ce.return=oe,oe=Ce;break e}a(oe,te);break}else r(oe,te);te=te.sibling}ue.type===K?(Ce=ho(ue.props.children,oe.mode,Ce,ue.key),pa(Ce,ue),Ce.return=oe,oe=Ce):(Ce=Qd(ue.type,ue.key,ue.props,null,oe.mode,Ce),pa(Ce,ue),Ce.return=oe,oe=Ce)}return k(oe);case L:e:{for(We=ue.key;te!==null;){if(te.key===We)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){a(oe,te.sibling),Ce=p(te,ue.children||[]),Ce.return=oe,oe=Ce;break e}else{a(oe,te);break}else r(oe,te);te=te.sibling}Ce=Jg(ue,oe.mode,Ce),Ce.return=oe,oe=Ce}return k(oe);case Y:return ue=xo(ue),Lt(oe,te,ue,Ce)}if(ge(ue))return Ye(oe,te,ue,Ce);if(ne(ue)){if(We=ne(ue),typeof We!="function")throw Error(i(150));return ue=We.call(ue),it(oe,te,ue,Ce)}if(typeof ue.then=="function")return Lt(oe,te,af(ue),Ce);if(ue.$$typeof===U)return Lt(oe,te,tf(oe,ue),Ce);of(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(a(oe,te.sibling),Ce=p(te,ue),Ce.return=oe,oe=Ce):(a(oe,te),Ce=Zg(ue,oe.mode,Ce),Ce.return=oe,oe=Ce),k(oe)):a(oe,te)}return function(oe,te,ue,Ce){try{Bc=0;var We=Lt(oe,te,ue,Ce);return hl=null,We}catch(ut){if(ut===fl||ut===rf)throw ut;var Wt=$r(29,ut,null,oe.mode);return Wt.lanes=Ce,Wt.return=oe,Wt}}}var wo=p2(!0),g2=p2(!1),ga=!1;function lm(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cm(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 ma(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function ya(n,r,a){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(un&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,r=Gd(n),Jx(n,null,a),r}return $d(n,c,r,a),Gd(n)}function Vc(n,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var c=r.lanes;c&=n.pendingLanes,a|=c,r.lanes=a,On(n,a)}}function um(n,r){var a=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var p=null,v=null;if(a=a.firstBaseUpdate,a!==null){do{var k={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};v===null?p=v=k:v=v.next=k,a=a.next}while(a!==null);v===null?p=v=r:v=v.next=r}else p=v=r;a={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},n.updateQueue=a;return}n=a.lastBaseUpdate,n===null?a.firstBaseUpdate=r:n.next=r,a.lastBaseUpdate=r}var dm=!1;function Kc(){if(dm){var n=dl;if(n!==null)throw n}}function qc(n,r,a,c){dm=!1;var p=n.updateQueue;ga=!1;var v=p.firstBaseUpdate,k=p.lastBaseUpdate,P=p.shared.pending;if(P!==null){p.shared.pending=null;var J=P,le=J.next;J.next=null,k===null?v=le:k.next=le,k=J;var me=n.alternate;me!==null&&(me=me.updateQueue,P=me.lastBaseUpdate,P!==k&&(P===null?me.firstBaseUpdate=le:P.next=le,me.lastBaseUpdate=J))}if(v!==null){var Te=p.baseState;k=0,me=le=J=null,P=v;do{var ie=P.lane&-536870913,he=ie!==P.lane;if(he?(Jt&ie)===ie:(c&ie)===ie){ie!==0&&ie===vo&&(dm=!0),me!==null&&(me=me.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ye=n,it=P;ie=r;var Lt=a;switch(it.tag){case 1:if(Ye=it.payload,typeof Ye=="function"){Te=Ye.call(Lt,Te,ie);break e}Te=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=it.payload,ie=typeof Ye=="function"?Ye.call(Lt,Te,ie):Ye,ie==null)break e;Te=D({},Te,ie);break e;case 2:ga=!0}}ie=P.callback,ie!==null&&(n.flags|=64,he&&(n.flags|=8192),he=p.callbacks,he===null?p.callbacks=[ie]:he.push(ie))}else he={lane:ie,tag:P.tag,payload:P.payload,callback:P.callback,next:null},me===null?(le=me=he,J=Te):me=me.next=he,k|=ie;if(P=P.next,P===null){if(P=p.shared.pending,P===null)break;he=P,P=he.next,he.next=null,p.lastBaseUpdate=he,p.shared.pending=null}}while(!0);me===null&&(J=Te),p.baseState=J,p.firstBaseUpdate=le,p.lastBaseUpdate=me,v===null&&(p.shared.lanes=0),Ra|=k,n.lanes=k,n.memoizedState=Te}}function m2(n,r){if(typeof n!="function")throw Error(i(191,n));n.call(r)}function y2(n,r){var a=n.callbacks;if(a!==null)for(n.callbacks=null,n=0;n<a.length;n++)m2(a[n],r)}var va=Oe(null),lf=Oe(0);function v2(n,r){n=Vi,Ve(lf,n),Ve(va,r),Vi=n|r.baseLanes}function fm(){Ve(lf,Vi),Ve(va,va.current)}function hm(){Vi=lf.current,ze(va),ze(lf)}var xr=Oe(null),Mr=null;function ba(n){var r=n.alternate;Ve(Sr,Sr.current&1),Ve(xr,n),Mr===null&&(r===null||va.current!==null||r.memoizedState!==null)&&(Mr=n)}function pm(n){Ve(Sr,Sr.current),Ve(xr,n),Mr===null&&(Mr=n)}function b2(n){n.tag===22?(Ve(Sr,Sr.current),Ve(xr,n),Mr===null&&(Mr=n)):xa()}function xa(){Ve(Sr,Sr.current),Ve(xr,xr.current)}function us(n){ze(xr),Mr===n&&(Mr=null),ze(Sr)}var Sr=Oe(0);function Yc(n,r){Ve(xr,xr.current),Ve(Sr,r)}function gm(n){ze(Sr),ze(xr),Mr===n&&(Mr=null)}function cf(n){for(var r=n;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||z0(a)||_0(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 Ui=0,Pt=null,Sn=null,Wn=null,uf=!1,pl=!1,Eo=!1,df=0,$c=0,gl=null,rD=0;function Vn(){throw Error(i(321))}function mm(n,r){if(r===null)return!1;for(var a=0;a<r.length&&a<n.length;a++)if(!cs(n[a],r[a]))return!1;return!0}function ym(n,r,a,c,p,v){return Ui=v,Pt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,fe.H=n===null||n.memoizedState===null?n1:r1,Eo=!1,v=a(c,p),Eo=!1,pl&&(v=S2(r,a,c,p)),x2(n),v}function x2(n){fe.H=vf;var r=Sn!==null&&Sn.next!==null;if(Ui=0,Wn=Sn=Pt=null,uf=!1,$c=0,gl=null,r)throw Error(i(300));n===null||er||(n=n.dependencies,n!==null&&ef(n)&&(er=!0))}function S2(n,r,a,c){Pt=n;var p=0;do{if(pl&&(gl=null),$c=0,pl=!1,25<=p)throw Error(i(301));if(p+=1,Wn=Sn=null,n.updateQueue!=null){var v=n.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}fe.H=dD,v=r(a,c)}while(pl);return v}function sD(){var n=fe.H,r=n.useState()[0];return r=typeof r.then=="function"?Gc(r):r,n=n.useState()[0],(Sn!==null?Sn.memoizedState:null)!==n&&(Pt.flags|=1024),r}function vm(){var n=df!==0;return df=0,n}function bm(n,r,a){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~a}function xm(n){if(uf){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}uf=!1}Ui=0,Wn=Sn=Pt=null,pl=!1,$c=df=0,gl=null}function Hr(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wn===null?Pt.memoizedState=Wn=n:Wn=Wn.next=n,Wn}function $n(){if(Sn===null){var n=Pt.alternate;n=n!==null?n.memoizedState:null}else n=Sn.next;var r=Wn===null?Pt.memoizedState:Wn.next;if(r!==null)Wn=r,Sn=n;else{if(n===null)throw Pt.alternate===null?Error(i(467)):Error(i(310));Sn=n,n={memoizedState:Sn.memoizedState,baseState:Sn.baseState,baseQueue:Sn.baseQueue,queue:Sn.queue,next:null},Wn===null?Pt.memoizedState=Wn=n:Wn=Wn.next=n}return Wn}function ff(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gc(n){var r=$c;return $c+=1,gl===null&&(gl=[]),n=d2(gl,n,r),r=Pt,(Wn===null?r.memoizedState:Wn.next)===null&&(r=r.alternate,fe.H=r===null||r.memoizedState===null?n1:r1),n}function hf(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Gc(n);if(n.$$typeof===F)return;if(n.$$typeof===U)return br(n)}throw Error(i(438,String(n)))}function Sm(n){var r=null,a=Pt.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var c=Pt.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=ff(),Pt.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(n),c=0;c<n;c++)a[c]=ae;return r.index++,a}function Hi(n,r){return typeof r=="function"?r(n):r}function pf(n){var r=$n();return wm(r,Sn,n)}function wm(n,r,a){var c=n.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=a;var p=n.baseQueue,v=c.pending;if(v!==null){if(p!==null){var k=p.next;p.next=v.next,v.next=k}r.baseQueue=p=v,c.pending=null}if(v=n.baseState,p===null)n.memoizedState=v;else{r=p.next;var P=k=null,J=null,le=r,me=!1;do{var Te=le.lane&-536870913;if(Te!==le.lane?(Jt&Te)===Te:(Ui&Te)===Te){var ie=le.revertLane;if(ie===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),Te===vo&&(me=!0);else if((Ui&ie)===ie){le=le.next,ie===vo&&(me=!0);continue}else Te={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},J===null?(P=J=Te,k=v):J=J.next=Te,Pt.lanes|=ie,Ra|=ie;Te=le.action,Eo&&a(v,Te),v=le.hasEagerState?le.eagerState:a(v,Te)}else ie={lane:Te,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},J===null?(P=J=ie,k=v):J=J.next=ie,Pt.lanes|=Te,Ra|=Te;le=le.next}while(le!==null&&le!==r);if(J===null?k=v:J.next=P,!cs(v,n.memoizedState)&&(er=!0,me&&(a=dl,a!==null)))throw a;n.memoizedState=v,n.baseState=k,n.baseQueue=J,c.lastRenderedState=v}return p===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function Em(n){var r=$n(),a=r.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=n;var c=a.dispatch,p=a.pending,v=r.memoizedState;if(p!==null){a.pending=null;var k=p=p.next;do v=n(v,k.action),k=k.next;while(k!==p);cs(v,r.memoizedState)||(er=!0),r.memoizedState=v,r.baseQueue===null&&(r.baseState=v),a.lastRenderedState=v}return[v,c]}function w2(n,r,a){var c=Pt,p=$n(),v=Kt;if(v){if(a===void 0)throw Error(i(407));a=a()}else a=r();var k=!cs((Sn||p).memoizedState,a);if(k&&(p.memoizedState=a,er=!0),p=p.queue,Tm(C2.bind(null,c,p,n),[n]),n=p.getSnapshot!==r||k||Wn!==null&&(Wn.memoizedState.tag&1)!==0,ml(n?9:8,{destroy:void 0},R2.bind(null,c,p,a,r),null),n){if(c.flags|=2048,kn===null)throw Error(i(349));v||(Ui&127)!==0||E2(c,r,a)}return a}function E2(n,r,a){n.flags|=16384,n={getSnapshot:r,value:a},r=Pt.updateQueue,r===null?(r=ff(),Pt.updateQueue=r,r.stores=[n]):(a=r.stores,a===null?r.stores=[n]:a.push(n))}function R2(n,r,a,c){r.value=a,r.getSnapshot=c,T2(r)&&k2(n)}function C2(n,r,a){return a(function(){T2(r)&&k2(n)})}function T2(n){var r=n.getSnapshot;n=n.value;try{var a=r();return!cs(n,a)}catch{return!0}}function k2(n){var r=fo(n,2);r!==null&&Zr(r,n,2)}function Rm(n){var r=Hr();if(typeof n=="function"){var a=n;if(n=a(),Eo){Ge(!0);try{a()}finally{Ge(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:n},r}function O2(n,r,a,c){return n.baseState=a,wm(n,Sn,typeof c=="function"?c:Hi)}function iD(n,r,a,c,p){if(yf(n))throw Error(i(485));if(n=r.action,n!==null){var v={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){v.listeners.push(k)}};fe.T!==null?a(!0):v.isTransition=!1,c(v),a=r.pending,a===null?(v.next=r.pending=v,A2(r,v)):(v.next=a.next,r.pending=a.next=v)}}function A2(n,r){var a=r.action,c=r.payload,p=n.state;if(r.isTransition){var v=fe.T,k={};k.types=v!==null?v.types:null,fe.T=k;try{var P=a(p,c),J=fe.S;J!==null&&J(k,P),M2(n,r,P)}catch(le){Cm(n,r,le)}finally{v!==null&&k.types!==null&&(v.types=k.types),fe.T=v}}else try{v=a(p,c),M2(n,r,v)}catch(le){Cm(n,r,le)}}function M2(n,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(c){N2(n,r,c)},function(c){return Cm(n,r,c)}):N2(n,r,a)}function N2(n,r,a){r.status="fulfilled",r.value=a,D2(r),n.state=a,r=n.pending,r!==null&&(a=r.next,a===r?n.pending=null:(a=a.next,r.next=a,A2(n,a)))}function Cm(n,r,a){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=a,D2(r),r=r.next;while(r!==c)}n.action=null}function D2(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function j2(n,r){return r}function I2(n,r){if(Kt){var a=kn.formState;if(a!==null){e:{var c=Pt;if(Kt){if(Mn){t:{for(var p=Mn,v=ks;p.nodeType!==8;){if(!v){p=null;break t}if(p=As(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Mn=As(p.nextSibling),c=p.data==="F!";break e}}fa(c)}c=!1}c&&(r=a[0])}}return a=Hr(),a.memoizedState=a.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:j2,lastRenderedState:r},a.queue=c,a=W2.bind(null,Pt,c),c.dispatch=a,c=Rm(!1),v=Nm.bind(null,Pt,!1,c.queue),c=Hr(),p={state:r,dispatch:null,action:n,pending:null},c.queue=p,a=iD.bind(null,Pt,p,v,a),p.dispatch=a,c.memoizedState=n,[r,a,!1]}function P2(n){var r=$n();return L2(r,Sn,n)}function L2(n,r,a){if(r=wm(n,r,j2)[0],n=pf(Hi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Gc(r)}catch(k){throw k===fl?rf:k}else c=r;r=$n();var p=r.queue,v=p.dispatch;return a!==r.memoizedState&&(Pt.flags|=2048,ml(9,{destroy:void 0},aD.bind(null,p,a),null)),[c,v,n]}function aD(n,r){n.action=r}function z2(n){var r=$n(),a=Sn;if(a!==null)return L2(r,a,n);$n(),r=r.memoizedState,a=$n();var c=a.queue.dispatch;return a.memoizedState=n,[r,c,!1]}function ml(n,r,a,c){return n={tag:n,create:a,deps:c,inst:r,next:null},r=Pt.updateQueue,r===null&&(r=ff(),Pt.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=n.next=n:(c=a.next,a.next=n,n.next=c,r.lastEffect=n),n}function _2(){return $n().memoizedState}function gf(n,r,a,c){var p=Hr();Pt.flags|=n,p.memoizedState=ml(1|r,{destroy:void 0},a,c===void 0?null:c)}function mf(n,r,a,c){var p=$n();c=c===void 0?null:c;var v=p.memoizedState.inst;Sn!==null&&c!==null&&mm(c,Sn.memoizedState.deps)?p.memoizedState=ml(r,v,a,c):(Pt.flags|=n,p.memoizedState=ml(1|r,v,a,c))}function U2(n,r){gf(8390656,8,n,r)}function Tm(n,r){mf(2048,8,n,r)}function oD(n){Pt.flags|=4;var r=Pt.updateQueue;if(r===null)r=ff(),Pt.updateQueue=r,r.events=[n];else{var a=r.events;a===null?r.events=[n]:a.push(n)}}function H2(n){var r=$n().memoizedState;return oD({ref:r,nextImpl:n}),function(){if((un&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function F2(n,r){return mf(4,2,n,r)}function B2(n,r){return mf(4,4,n,r)}function V2(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 K2(n,r,a){a=a!=null?a.concat([n]):null,mf(4,4,V2.bind(null,r,n),a)}function km(){}function q2(n,r){var a=$n();r=r===void 0?null:r;var c=a.memoizedState;return r!==null&&mm(r,c[1])?c[0]:(a.memoizedState=[n,r],n)}function Y2(n,r){var a=$n();r=r===void 0?null:r;var c=a.memoizedState;if(r!==null&&mm(r,c[1]))return c[0];if(c=n(),Eo){Ge(!0);try{n()}finally{Ge(!1)}}return a.memoizedState=[c,r],c}function Om(n,r,a){return a===void 0||(Ui&1073741824)!==0&&(Jt&261930)===0?n.memoizedState=r:(n.memoizedState=a,n=nS(),Pt.lanes|=n,Ra|=n,a)}function $2(n,r,a,c){return cs(a,r)?a:va.current!==null?(n=Om(n,a,c),cs(n,r)||(er=!0),n):(Ui&106)===0||(Ui&1073741824)!==0&&(Jt&261930)===0?(er=!0,n.memoizedState=a):(n=nS(),Pt.lanes|=n,Ra|=n,r)}function G2(n,r,a,c,p){var v=ce.p;ce.p=v!==0&&8>v?v:8;var k=fe.T,P={};P.types=k!==null?k.types:null,fe.T=P,Nm(n,!1,r,a);try{var J=p(),le=fe.S;if(le!==null&&le(P,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var me=nD(J,c);Qc(n,r,me,ps(n))}else Qc(n,r,c,ps(n))}catch(Te){Qc(n,r,{then:function(){},status:"rejected",reason:Te},ps())}finally{ce.p=v,k!==null&&P.types!==null&&(k.types=P.types),fe.T=k}}function lD(){}function Am(n,r,a,c){if(n.tag!==5)throw Error(i(476));var p=Q2(n).queue;G2(n,p,r,Re,a===null?lD:function(){return X2(n),a(c)})}function Q2(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:Re,baseState:Re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:Re},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:a},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function X2(n){var r=Q2(n);r.next===null&&(r=n.alternate.memoizedState),Qc(n,r.next.queue,{},ps())}function Mm(){return br(Pl)}function Z2(){return $n().memoizedState}function J2(){return $n().memoizedState}function cD(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var a=ps();n=ma(a);var c=ya(r,n,a);c!==null&&(Zr(c,r,a),Vc(c,r,a)),r={cache:sm()},n.payload=r;return}r=r.return}}function uD(n,r,a){var c=ps();a={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},yf(n)?e1(r,a):(a=Qg(n,r,a,c),a!==null&&(Zr(a,n,c),t1(a,r,c)))}function W2(n,r,a){var c=ps();Qc(n,r,a,c)}function Qc(n,r,a,c){var p={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(yf(n))e1(r,p);else{var v=n.alternate;if(n.lanes===0&&(v===null||v.lanes===0)&&(v=r.lastRenderedReducer,v!==null))try{var k=r.lastRenderedState,P=v(k,a);if(p.hasEagerState=!0,p.eagerState=P,cs(P,k))return $d(n,r,p,0),kn===null&&Yd(),!1}catch{}if(a=Qg(n,r,p,c),a!==null)return Zr(a,n,c),t1(a,r,c),!0}return!1}function Nm(n,r,a,c){if(c={lane:2,revertLane:S0(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},yf(n)){if(r)throw Error(i(479))}else r=Qg(n,a,c,2),r!==null&&Zr(r,n,2)}function yf(n){var r=n.alternate;return n===Pt||r!==null&&r===Pt}function e1(n,r){pl=uf=!0;var a=n.pending;a===null?r.next=r:(r.next=a.next,a.next=r),n.pending=r}function t1(n,r,a){if((a&4194048)!==0){var c=r.lanes;c&=n.pendingLanes,a|=c,r.lanes=a,On(n,a)}}var vf={readContext:br,use:hf,useCallback:Vn,useContext:Vn,useEffect:Vn,useImperativeHandle:Vn,useLayoutEffect:Vn,useInsertionEffect:Vn,useMemo:Vn,useReducer:Vn,useRef:Vn,useState:Vn,useDebugValue:Vn,useDeferredValue:Vn,useTransition:Vn,useSyncExternalStore:Vn,useId:Vn,useHostTransitionStatus:Vn,useFormState:Vn,useActionState:Vn,useOptimistic:Vn,useMemoCache:Vn,useCacheRefresh:Vn,useEffectEvent:Vn},n1={readContext:br,use:hf,useCallback:function(n,r){return Hr().memoizedState=[n,r===void 0?null:r],n},useContext:br,useEffect:U2,useImperativeHandle:function(n,r,a){a=a!=null?a.concat([n]):null,gf(4194308,4,V2.bind(null,r,n),a)},useLayoutEffect:function(n,r){return gf(4194308,4,n,r)},useInsertionEffect:function(n,r){gf(4,2,n,r)},useMemo:function(n,r){var a=Hr();r=r===void 0?null:r;var c=n();if(Eo){Ge(!0);try{n()}finally{Ge(!1)}}return a.memoizedState=[c,r],c},useReducer:function(n,r,a){var c=Hr();if(a!==void 0){var p=a(r);if(Eo){Ge(!0);try{a(r)}finally{Ge(!1)}}}else p=r;return c.memoizedState=c.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},c.queue=n,n=n.dispatch=uD.bind(null,Pt,n),[c.memoizedState,n]},useRef:function(n){var r=Hr();return n={current:n},r.memoizedState=n},useState:function(n){n=Rm(n);var r=n.queue,a=W2.bind(null,Pt,r);return r.dispatch=a,[n.memoizedState,a]},useDebugValue:km,useDeferredValue:function(n,r){var a=Hr();return Om(a,n,r)},useTransition:function(){var n=Rm(!1);return n=G2.bind(null,Pt,n.queue,!0,!1),Hr().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,a){var c=Pt,p=Hr();if(Kt){if(a===void 0)throw Error(i(407));a=a()}else{if(a=r(),kn===null)throw Error(i(349));(Jt&127)!==0||E2(c,r,a)}p.memoizedState=a;var v={value:a,getSnapshot:r};return p.queue=v,U2(C2.bind(null,c,v,n),[n]),c.flags|=2048,ml(9,{destroy:void 0},R2.bind(null,c,v,a,r),null),a},useId:function(){var n=Hr(),r=kn.identifierPrefix;if(Kt){var a=li,c=oi;a=(c&~(1<<32-tt(c)-1)).toString(32)+a,r="_"+r+"R_"+a,a=df++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=rD++,r="_"+r+"r_"+a.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:Mm,useFormState:I2,useActionState:I2,useOptimistic:function(n){var r=Hr();r.memoizedState=r.baseState=n;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Nm.bind(null,Pt,!0,a),a.dispatch=r,[n,r]},useMemoCache:Sm,useCacheRefresh:function(){return Hr().memoizedState=cD.bind(null,Pt)},useEffectEvent:function(n){var r=Hr(),a={impl:n};return r.memoizedState=a,function(){if((un&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},r1={readContext:br,use:hf,useCallback:q2,useContext:br,useEffect:Tm,useImperativeHandle:K2,useInsertionEffect:F2,useLayoutEffect:B2,useMemo:Y2,useReducer:pf,useRef:_2,useState:function(){return pf(Hi)},useDebugValue:km,useDeferredValue:function(n,r){var a=$n();return $2(a,Sn.memoizedState,n,r)},useTransition:function(){var n=pf(Hi)[0],r=$n().memoizedState;return[typeof n=="boolean"?n:Gc(n),r]},useSyncExternalStore:w2,useId:Z2,useHostTransitionStatus:Mm,useFormState:P2,useActionState:P2,useOptimistic:function(n,r){var a=$n();return O2(a,Sn,n,r)},useMemoCache:Sm,useCacheRefresh:J2,useEffectEvent:H2},dD={readContext:br,use:hf,useCallback:q2,useContext:br,useEffect:Tm,useImperativeHandle:K2,useInsertionEffect:F2,useLayoutEffect:B2,useMemo:Y2,useReducer:Em,useRef:_2,useState:function(){return Em(Hi)},useDebugValue:km,useDeferredValue:function(n,r){var a=$n();return Sn===null?Om(a,n,r):$2(a,Sn.memoizedState,n,r)},useTransition:function(){var n=Em(Hi)[0],r=$n().memoizedState;return[typeof n=="boolean"?n:Gc(n),r]},useSyncExternalStore:w2,useId:Z2,useHostTransitionStatus:Mm,useFormState:z2,useActionState:z2,useOptimistic:function(n,r){var a=$n();return Sn!==null?O2(a,Sn,n,r):(a.baseState=n,[n,a.queue.dispatch])},useMemoCache:Sm,useCacheRefresh:J2,useEffectEvent:H2};function Dm(n,r,a,c){r=n.memoizedState,a=a(c,r),a=a==null?r:D({},r,a),n.memoizedState=a,n.lanes===0&&(n.updateQueue.baseState=a)}var jm={enqueueSetState:function(n,r,a){n=n._reactInternals;var c=ps(),p=ma(c);p.payload=r,a!=null&&(p.callback=a),r=ya(n,p,c),r!==null&&(Zr(r,n,c),Vc(r,n,c))},enqueueReplaceState:function(n,r,a){n=n._reactInternals;var c=ps(),p=ma(c);p.tag=1,p.payload=r,a!=null&&(p.callback=a),r=ya(n,p,c),r!==null&&(Zr(r,n,c),Vc(r,n,c))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var a=ps(),c=ma(a);c.tag=2,r!=null&&(c.callback=r),r=ya(n,c,a),r!==null&&(Zr(r,n,a),Vc(r,n,a))}};function s1(n,r,a,c,p,v,k){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,v,k):r.prototype&&r.prototype.isPureReactComponent?!Pc(a,c)||!Pc(p,v):!0}function i1(n,r,a,c){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,c),r.state!==n&&jm.enqueueReplaceState(r,r.state,null)}function Ro(n,r){var a=r;if("ref"in r){a={};for(var c in r)c!=="ref"&&(a[c]=r[c])}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 a1(n){qd(n)}function o1(n){console.error(n)}function l1(n){qd(n)}function bf(n,r){try{var a=n.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function c1(n,r,a){try{var c=n.onCaughtError;c(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Im(n,r,a){return a=ma(a),a.tag=3,a.payload={element:null},a.callback=function(){bf(n,r)},a}function u1(n){return n=ma(n),n.tag=3,n}function d1(n,r,a,c){var p=a.type.getDerivedStateFromError;if(typeof p=="function"){var v=c.value;n.payload=function(){return p(v)},n.callback=function(){c1(r,a,c)}}var k=a.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(n.callback=function(){c1(r,a,c),typeof p!="function"&&(Ca===null?Ca=new Set([this]):Ca.add(this));var P=c.stack;this.componentDidCatch(c.value,{componentStack:P!==null?P:""})})}function fD(n,r,a,c,p){if(a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=a.alternate,r!==null&&mo(r,a,p,!0),a=xr.current,a!==null){switch(a.tag){case 31:case 13:case 19:return Mr===null?Hf():a.alternate===null&&Kn===0&&(Kn=3),a.flags&=-257,a.flags|=65536,a.lanes=p,c===sf?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([c]):r.add(c),v0(n,c,p)),!1;case 22:return a.flags|=65536,c===sf?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([c]):a.add(c)),v0(n,c,p)),!1}throw Error(i(435,a.tag))}return v0(n,c,p),Hf(),!1}if(Kt)return r=xr.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,c!==em&&(n=Error(i(422),{cause:c}),_c(Rs(n,a)))):(c!==em&&(r=Error(i(423),{cause:c}),_c(Rs(r,a))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,c=Rs(c,a),p=Im(n.stateNode,c,p),um(n,p),Kn!==4&&(Kn=2)),!1;var v=Error(i(520),{cause:c});if(v=Rs(v,a),ru===null?ru=[v]:ru.push(v),Kn!==4&&(Kn=2),r===null)return!0;c=Rs(c,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,n=p&-p,a.lanes|=n,n=Im(a.stateNode,c,n),um(a,n),!1;case 1:if(r=a.type,v=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ca===null||!Ca.has(v))))return a.flags|=65536,p&=-p,a.lanes|=p,p=u1(p),d1(p,n,a,c),um(a,p),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var Pm=Error(i(461)),er=!1;function ar(n,r,a,c){r.child=n===null?g2(r,null,a,c):wo(r,n.child,a,c)}function f1(n,r,a,c,p){a=a.render;var v=r.ref;if("ref"in c){var k={};for(var P in c)P!=="ref"&&(k[P]=c[P])}else k=c;return yo(r),c=ym(n,r,a,k,v,p),P=vm(),n!==null&&!er?(bm(n,r,p),Fi(n,r,p)):(Kt&&P&&Zd(r),r.flags|=1,ar(n,r,c,p),r.child)}function h1(n,r,a,c,p){if(n===null){var v=a.type;return typeof v=="function"&&!Xg(v)&&v.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=v,p1(n,r,v,c,p)):(n=Qd(a.type,null,c,r,r.mode,p),n.ref=r.ref,n.return=r,r.child=n)}if(v=n.child,!Vm(n,p)){var k=v.memoizedProps;if(a=a.compare,a=a!==null?a:Pc,a(k,c)&&n.ref===r.ref)return Fi(n,r,p)}return r.flags|=1,n=Pi(v,c),n.ref=r.ref,n.return=r,r.child=n}function p1(n,r,a,c,p){if(n!==null){var v=n.memoizedProps;if(Pc(v,c)&&n.ref===r.ref)if(er=!1,r.pendingProps=c=v,Vm(n,p))(n.flags&131072)!==0&&(er=!0);else return r.lanes=n.lanes,Fi(n,r,p)}return Lm(n,r,a,c,p)}function g1(n,r,a,c){var p=c.children,v=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(v=v!==null?v.baseLanes|a:a,n!==null){for(c=r.child=n.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~v}else c=0,r.child=null;return m1(n,r,v,a,c)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&nf(r,v!==null?v.cachePool:null),v!==null?v2(r,v):fm(),b2(r);else return c=r.lanes=536870912,m1(n,r,v!==null?v.baseLanes|a:a,a,c)}else v!==null?(nf(r,v.cachePool),v2(r,v),xa(),r.memoizedState=null):(n!==null&&nf(r,null),fm(),xa());return ar(n,r,p,a),r.child}function Xc(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function m1(n,r,a,c,p){var v=am();return v=v===null?null:{parent:Jn._currentValue,pool:v},r.memoizedState={baseLanes:a,cachePool:v},n!==null&&nf(r,null),fm(),b2(r),n!==null&&mo(n,r,c,!0),r.childLanes=p,null}function xf(n,r){return r=Sf({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function y1(n,r,a){return wo(r,n.child,null,a),n=xf(r,r.pendingProps),n.flags|=2,us(r),r.memoizedState=null,n}function hD(n,r,a){var c=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(Kt){if(c.mode==="hidden")return n=xf(r,c),r.lanes=536870912,n.memoizedState={baseLanes:0,cachePool:null},Xc(null,n);if(pm(r),(n=Mn)?(n=VS(n,ks),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:ua!==null?{id:oi,overflow:li}:null,retryLane:536870912,hydrationErrors:null},a=e2(n),a.return=r,r.child=a,cr=r,Mn=null)):n=null,n===null)throw fa(r);return r.lanes=536870912,null}return xf(r,c)}var v=n.memoizedState;if(v!==null){var k=v.dehydrated;if(pm(r),p)if(r.flags&256)r.flags&=-257,r=y1(n,r,a);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(i(558));else if(er||mo(n,r,a,!1),p=(a&n.childLanes)!==0,er||p){if(va.current===null){if(c=kn,c!==null&&(k=$t(c,a),k!==0&&k!==v.retryLane))throw v.retryLane=k,fo(n,k),Zr(c,n,k),Pm;Hf()}r=y1(n,r,a)}else n=v.treeContext,Mn=As(k.nextSibling),cr=r,Kt=!0,da=null,ks=!1,n!==null&&r2(r,n),r=xf(r,c),r.flags|=134221824;return r}return n=Pi(n.child,{mode:c.mode,children:c.children}),n.ref=r.ref,r.child=n,n.return=r,n}function yl(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(i(284));(n===null||n.ref!==a)&&(r.flags|=4194816)}}function Lm(n,r,a,c,p){return yo(r),a=ym(n,r,a,c,void 0,p),c=vm(),n!==null&&!er?(bm(n,r,p),Fi(n,r,p)):(Kt&&c&&Zd(r),r.flags|=1,ar(n,r,a,p),r.child)}function v1(n,r,a,c,p,v){return yo(r),r.updateQueue=null,a=S2(r,c,a,p),x2(n),c=vm(),n!==null&&!er?(bm(n,r,v),Fi(n,r,v)):(Kt&&c&&Zd(r),r.flags|=1,ar(n,r,a,v),r.child)}function b1(n,r,a,c,p){if(yo(r),r.stateNode===null){var v=ol,k=a.contextType;typeof k=="object"&&k!==null&&(v=br(k)),v=new a(c,v),r.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=jm,r.stateNode=v,v._reactInternals=r,v=r.stateNode,v.props=c,v.state=r.memoizedState,v.refs={},lm(r),k=a.contextType,v.context=typeof k=="object"&&k!==null?br(k):ol,v.state=r.memoizedState,k=a.getDerivedStateFromProps,typeof k=="function"&&(Dm(r,a,k,c),v.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(k=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),k!==v.state&&jm.enqueueReplaceState(v,v.state,null),qc(r,c,v,p),Kc(),v.state=r.memoizedState),typeof v.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(n===null){v=r.stateNode;var P=r.memoizedProps,J=Ro(a,P);v.props=J;var le=v.context,me=a.contextType;k=ol,typeof me=="object"&&me!==null&&(k=br(me));var Te=a.getDerivedStateFromProps;me=typeof Te=="function"||typeof v.getSnapshotBeforeUpdate=="function",P=r.pendingProps!==P,me||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(P||le!==k)&&i1(r,v,c,k),ga=!1;var ie=r.memoizedState;v.state=ie,qc(r,c,v,p),Kc(),le=r.memoizedState,P||ie!==le||ga?(typeof Te=="function"&&(Dm(r,a,Te,c),le=r.memoizedState),(J=ga||s1(r,a,J,c,ie,le,k))?(me||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(r.flags|=4194308)):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=le),v.props=c,v.state=le,v.context=k,c=J):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{v=r.stateNode,cm(n,r),k=r.memoizedProps,me=Ro(a,k),v.props=me,Te=r.pendingProps,ie=v.context,le=a.contextType,J=ol,typeof le=="object"&&le!==null&&(J=br(le)),P=a.getDerivedStateFromProps,(le=typeof P=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(k!==Te||ie!==J)&&i1(r,v,c,J),ga=!1,ie=r.memoizedState,v.state=ie,qc(r,c,v,p),Kc();var he=r.memoizedState;k!==Te||ie!==he||ga||n!==null&&n.dependencies!==null&&ef(n.dependencies)?(typeof P=="function"&&(Dm(r,a,P,c),he=r.memoizedState),(me=ga||s1(r,a,me,c,ie,he,J)||n!==null&&n.dependencies!==null&&ef(n.dependencies))?(le||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,he,J),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,he,J)),typeof v.componentDidUpdate=="function"&&(r.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof v.componentDidUpdate!="function"||k===n.memoizedProps&&ie===n.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&ie===n.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=he),v.props=c,v.state=he,v.context=J,c=me):(typeof v.componentDidUpdate!="function"||k===n.memoizedProps&&ie===n.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&ie===n.memoizedState||(r.flags|=1024),c=!1)}return v=c,yl(n,r),c=(r.flags&128)!==0,v||c?(v=r.stateNode,a=c&&typeof a.getDerivedStateFromError!="function"?null:v.render(),r.flags|=1,n!==null&&c?(r.child=wo(r,n.child,null,p),r.child=wo(r,null,a,p)):ar(n,r,a,p),r.memoizedState=v.state,n=r.child):n=Fi(n,r,p),n}function x1(n,r,a,c){return po(),r.flags|=256,ar(n,r,a,c),r.child}var zm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _m(n){return{baseLanes:n,cachePool:c2()}}function Um(n,r,a){return n=n!==null?n.childLanes&~a:0,r&&(n|=hs),n}function S1(n,r,a){var c=r.pendingProps,p=!1,v=(r.flags&128)!==0,k;if((k=v)||(k=n!==null&&n.memoizedState===null?!1:(Sr.current&2)!==0),k&&(p=!0,r.flags&=-129),k=(r.flags&32)!==0,r.flags&=-33,n===null){if(Kt){if(p?ba(r):xa(),(n=Mn)?(n=VS(n,ks),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:ua!==null?{id:oi,overflow:li}:null,retryLane:536870912,hydrationErrors:null},a=e2(n),a.return=r,r.child=a,cr=r,Mn=null)):n=null,n===null)throw fa(r);return _0(n)?r.lanes=32:r.lanes=536870912,null}return v=c.children,c=c.fallback,p?(xa(),p=r.mode,v=Sf({mode:"hidden",children:v},p),c=ho(c,p,a,null),v.return=r,c.return=r,v.sibling=c,r.child=v,c=r.child,c.memoizedState=_m(a),c.childLanes=Um(n,k,a),r.memoizedState=zm,Xc(null,c)):(ba(r),Hm(r,v))}var P=n.memoizedState;if(P!==null){var J=P.dehydrated;if(J!==null)return pD(n,r,v,k,c,J,P,a)}return p?(xa(),p=c.fallback,v=r.mode,P=n.child,J=P.sibling,c=Pi(P,{mode:"hidden",children:c.children}),c.subtreeFlags=P.subtreeFlags&1206910976,J!==null?p=Pi(J,p):(p=ho(p,v,a,null),p.flags|=2),p.return=r,c.return=r,c.sibling=p,r.child=c,Xc(null,c),c=r.child,p=n.child.memoizedState,p===null?p=_m(a):(v=p.cachePool,v!==null?(P=Jn._currentValue,v=v.parent!==P?{parent:P,pool:P}:v):v=c2(),p={baseLanes:p.baseLanes|a,cachePool:v}),c.memoizedState=p,c.childLanes=Um(n,k,a),r.memoizedState=zm,Xc(n.child,c)):(ba(r),a=n.child,n=a.sibling,a=Pi(a,{mode:"visible",children:c.children}),a.return=r,a.sibling=null,n!==null&&(k=r.deletions,k===null?(r.deletions=[n],r.flags|=16):k.push(n)),r.child=a,r.memoizedState=null,a)}function Hm(n,r){return r=Sf({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function Sf(n,r){return n=$r(22,n,null,r),n.lanes=0,n}function wf(n,r,a){return wo(r,n.child,null,a),n=Hm(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function pD(n,r,a,c,p,v,k,P){if(a)return r.flags&256?(ba(r),r.flags&=-257,wf(n,r,P)):r.memoizedState!==null?(xa(),r.child=n.child,r.flags|=128,null):(xa(),v=p.fallback,k=r.mode,p=Sf({mode:"visible",children:p.children},k),v=ho(v,k,P,null),v.flags|=2,p.return=r,v.return=r,p.sibling=v,r.child=p,wo(r,n.child,null,P),p=r.child,p.memoizedState=_m(P),p.childLanes=Um(n,c,P),r.memoizedState=zm,Xc(null,p));if(ba(r),_0(v)){if(c=v.nextSibling&&v.nextSibling.dataset,c)var J=c.dgst;return c=J,c!==""&&(p=Error(i(419)),p.stack="",p.digest=c,_c({value:p,source:null,stack:null})),wf(n,r,P)}if(er||mo(n,r,P,!1),c=(P&n.childLanes)!==0,er||c){if(va.current!==null)return wf(n,r,P);if(c=kn,c!==null&&(p=$t(c,P),p!==0&&p!==k.retryLane))throw k.retryLane=p,fo(n,p),Zr(c,n,p),Pm;return z0(v)||Hf(),wf(n,r,P)}return z0(v)?(r.flags|=192,r.child=n.child,null):(n=k.treeContext,Mn=As(v.nextSibling),cr=r,Kt=!0,da=null,ks=!1,n!==null&&r2(r,n),r=Hm(r,p.children),r.flags|=134221824,r)}function w1(n,r,a){n.lanes|=r;var c=n.alternate;c!==null&&(c.lanes|=r),Wd(n.return,r,a)}function E1(n){for(var r=null;n!==null;){var a=n.alternate;a!==null&&cf(a)===null&&(r=n),n=n.sibling}return r}function Ef(n,r,a,c,p,v){var k=n.memoizedState;k===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:a,tailMode:p,treeForkCount:v}:(k.isBackwards=r,k.rendering=null,k.renderingStartTime=0,k.last=c,k.tail=a,k.tailMode=p,k.treeForkCount=v)}function Fm(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 Bm(n,r,a){var c=r.pendingProps,p=c.revealOrder,v=c.tail;c=c.children;var k=Sr.current;if(r.flags&128)return Yc(r,k),null;var P=(k&2)!==0;if(P?(k=k&1|2,r.flags|=128):k&=1,Yc(r,k),p==="backwards"&&n!==null?(Fm(n),ar(n,r,c,a),Fm(n)):ar(n,r,c,a),c=Kt?zc:0,!P&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&w1(n,a,r);else if(n.tag===19)w1(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=E1(r.child),a===null?(p=r.child,r.child=null):(p=a.sibling,a.sibling=null,Fm(r)),Ef(r,!0,p,null,v,c);break;case"unstable_legacy-backwards":for(a=null,p=r.child,r.child=null;p!==null;){if(n=p.alternate,n!==null&&cf(n)===null){r.child=p;break}n=p.sibling,p.sibling=a,a=p,p=n}Ef(r,!0,a,null,v,c);break;case"together":Ef(r,!1,null,null,void 0,c);break;case"independent":r.memoizedState=null;break;default:a=E1(r.child),a===null?(p=r.child,r.child=null):(p=a.sibling,a.sibling=null),Ef(r,!1,p,a,v,c)}return r.child}function R1(n,r,a){var c=r.pendingProps;return ha(r,r.type,c.value),ar(n,r,c.children,a),r.child}function Fi(n,r,a){if(n!==null&&(r.dependencies=n.dependencies),Ra|=r.lanes,(a&r.childLanes)===0)if(n!==null){if(mo(n,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(i(153));if(r.child!==null){for(n=r.child,a=Pi(n,n.pendingProps),r.child=a,a.return=r;n.sibling!==null;)n=n.sibling,a=a.sibling=Pi(n,n.pendingProps),a.return=r;a.sibling=null}return r.child}function Vm(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&ef(n)))}function gD(n,r,a){switch(r.tag){case 3:Je(r,r.stateNode.containerInfo),ha(r,Jn,n.memoizedState.cache),po();break;case 27:case 5:de(r);break;case 4:Je(r,r.stateNode.containerInfo);break;case 10:ha(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,pm(r),null;break;case 13:var c=r.memoizedState;if(c!==null){if(c.dehydrated!==null)return ba(r),r.flags|=128,null;c=mo(n,r,a,!1);var p=r.child.childLanes;return c||(a&p)!==0?S1(n,r,a):(ba(r),n=Fi(n,r,a),n!==null?n.sibling:null)}ba(r);break;case 19:if(r.flags&128)return Bm(n,r,a);if(p=(n.flags&128)!==0,c=(a&r.childLanes)!==0,c||(mo(n,r,a,!1),c=(a&r.childLanes)!==0),p){if(c)return Bm(n,r,a);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Yc(r,Sr.current),c)break;return null;case 22:return r.lanes=0,g1(n,r,a,r.pendingProps);case 24:ha(r,Jn,n.memoizedState.cache)}return Fi(n,r,a)}function C1(n,r,a){if(n!==null)if(n.memoizedProps!==r.pendingProps)er=!0;else{if(!Vm(n,a)&&(r.flags&128)===0)return er=!1,gD(n,r,a);er=(n.flags&131072)!==0}else er=!1,Kt&&(r.flags&1048576)!==0&&n2(r,zc,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(n=xo(r.elementType),r.type=n,typeof n=="function")Xg(n)?(c=Ro(n,c),r.tag=1,r=b1(null,r,n,c,a)):(r.tag=0,r=Lm(null,r,n,c,a));else{if(n!=null){var p=n.$$typeof;if(p===_){r.tag=11,r=f1(null,r,n,c,a);break e}else if(p===q){r.tag=14,r=h1(null,r,n,c,a);break e}else if(p===U){r.tag=10,r.type=n,r=R1(null,r,a);break e}}throw r=se(n)||n,Error(i(306,r,""))}}return r;case 0:return Lm(n,r,r.type,r.pendingProps,a);case 1:return c=r.type,p=Ro(c,r.pendingProps),b1(n,r,c,p,a);case 3:e:{if(Je(r,r.stateNode.containerInfo),n===null)throw Error(i(387));c=r.pendingProps;var v=r.memoizedState;p=v.element,cm(n,r),qc(r,c,null,a);var k=r.memoizedState;if(c=k.cache,ha(r,Jn,c),c!==v.cache&&rm(r,[Jn],a,!0),Kc(),c=k.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:k.cache},r.updateQueue.baseState=v,r.memoizedState=v,r.flags&256){r=x1(n,r,c,a);break e}else if(c!==p){p=Rs(Error(i(424)),r),_c(p),r=x1(n,r,c,a);break e}else for(n=r.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Mn=As(n.firstChild),cr=r,Kt=!0,da=null,ks=!0,a=g2(r,null,c,a),r.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling;else{if(po(),c===p){r=Fi(n,r,a);break e}ar(n,r,c,a)}r=r.child}return r;case 26:return yl(n,r),n===null?(a=XS(r.type,null,r.pendingProps,null))?r.memoizedState=a:Kt||(r.stateNode=AS(r.type,r.pendingProps,xe.current,r)):r.memoizedState=XS(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return de(r),n===null&&Kt&&(c=r.stateNode=YS(r.type,r.pendingProps,xe.current),cr=r,ks=!0,p=Mn,Oa(r.type)?(U0=p,Mn=As(c.firstChild)):Mn=p),ar(n,r,r.pendingProps.children,a),yl(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&Kt&&((p=c=Mn)&&(c=cj(c,r.type,r.pendingProps,ks),c!==null?(r.stateNode=c,cr=r,Mn=As(c.firstChild),ks=!1,p=!0):p=!1),p||fa(r)),de(r),p=r.type,v=r.pendingProps,k=n!==null?n.memoizedProps:null,c=v.children,M0(p,v)?c=null:k!==null&&M0(p,k)&&(r.flags|=32),r.memoizedState!==null&&(p=ym(n,r,sD,null,null,a),Pl._currentValue=p),yl(n,r),ar(n,r,c,a),r.child;case 6:return n===null&&Kt&&((n=a=Mn)&&(a=uj(a,r.pendingProps,ks),a!==null?(r.stateNode=a,cr=r,Mn=null,n=!0):n=!1),n||fa(r)),null;case 13:return S1(n,r,a);case 4:return Je(r,r.stateNode.containerInfo),c=r.pendingProps,n===null?r.child=wo(r,null,c,a):ar(n,r,c,a),r.child;case 11:return f1(n,r,r.type,r.pendingProps,a);case 7:return c=r.pendingProps,yl(n,r),ar(n,r,c,a),r.child;case 8:return ar(n,r,r.pendingProps.children,a),r.child;case 12:return ar(n,r,r.pendingProps.children,a),r.child;case 10:return R1(n,r,a);case 9:return p=r.type._context,c=r.pendingProps.children,yo(r),p=br(p),c=c(p),r.flags|=1,ar(n,r,c,a),r.child;case 14:return h1(n,r,r.type,r.pendingProps,a);case 15:return p1(n,r,r.type,r.pendingProps,a);case 19:return Bm(n,r,a);case 31:return hD(n,r,a);case 22:return g1(n,r,a,r.pendingProps);case 24:return yo(r),c=br(Jn),n===null?(p=am(),p===null&&(p=kn,v=sm(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=a),p=v),r.memoizedState={parent:c,cache:p},lm(r),ha(r,Jn,p)):((n.lanes&a)!==0&&(cm(n,r),qc(r,null,null,a),Kc()),p=n.memoizedState,v=r.memoizedState,p.parent!==c?(p={parent:c,cache:c},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),ha(r,Jn,c)):(c=v.cache,ha(r,Jn,c),c!==p.cache&&rm(r,[Jn],a,!0))),ar(n,r,r.pendingProps.children,a),r.child;case 30:return r.stateNode===null&&(r.stateNode={autoName:null,paired:null,clones:null,ref:null}),c=r.pendingProps,c.name!=null&&c.name!=="auto"?r.flags|=n===null?18882560:18874368:Kt&&Zd(r),n!==null&&n.memoizedProps.name!==c.name?r.flags|=4194816:yl(n,r),ar(n,r,c.children,a),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function Bi(n){n.flags|=4}function Km(n,r,a,c,p){var v;if((v=(n.mode&32)!==0)&&(v=a===null?ew(r,c):ew(r,c)&&(c.src!==a.src||c.srcSet!==a.srcSet)),v){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(aS())n.flags|=8192;else throw So=sf,om}else n.flags&=-16777217}function T1(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!tw(r))if(aS())n.flags|=8192;else throw So=sf,om}function Rf(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?nt():536870912,n.lanes|=r,wl|=r)}function Zc(n,r){if(!Kt)switch(n.tailMode){case"visible":break;case"collapsed":for(var a=n.tail,c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:c.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,c=0;if(r)for(var p=n.child;p!==null;)a|=p.lanes|p.childLanes,c|=p.subtreeFlags&1206910976,c|=p.flags&1206910976,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)a|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=c,n.childLanes=a,r}function mD(n,r,a){var c=r.pendingProps;switch(Wg(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,c=null,n!==null&&(c=n.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),_i(Jn),ot(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(n===null||n.child===null)&&(ul(r)?Bi(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,tm())),Nn(r),null;case 26:var p=r.type,v=r.memoizedState;return n===null?(Bi(r),v!==null?(Nn(r),T1(r,v)):(Nn(r),Km(r,p,null,c,a))):v?v!==n.memoizedState?(Bi(r),Nn(r),T1(r,v)):(Nn(r),r.flags&=-16777217):(n=n.memoizedProps,n!==c&&Bi(r),Nn(r),Km(r,p,n,c,a)),null;case 27:if(Ee(r),a=xe.current,p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&Bi(r);else{if(!c){if(r.stateNode===null)throw Error(i(166));return Nn(r),r.subtreeFlags&=-33554433,null}n=ke.current,ul(r)?s2(r):(n=YS(p,c,a),r.stateNode=n,Bi(r))}return Nn(r),r.subtreeFlags&=-33554433,null;case 5:if(Ee(r),p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&Bi(r);else{if(!c){if(r.stateNode===null)throw Error(i(166));return Nn(r),r.subtreeFlags&=-33554433,null}if(v=ke.current,ul(r))s2(r);else{var k=lu(xe.current);switch(v){case 1:v=k.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=k.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=k.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?k.createElement("select",{is:c.is}):k.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?k.createElement(p,{is:c.is}):k.createElement(p)}}v[hn]=r,v[An]=c;e:for(k=r.child;k!==null;){if(k.tag===5||k.tag===6)v.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===r)break e;for(;k.sibling===null;){if(k.return===null||k.return===r)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}r.stateNode=v;e:switch(Er(v,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Bi(r)}}return Nn(r),r.subtreeFlags&=-33554433,Km(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,a),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==c&&Bi(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(i(166));if(n=xe.current,ul(r)){if(n=r.stateNode,a=r.memoizedProps,c=null,p=cr,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}n[hn]=r,n=!!(n.nodeValue===a||c!==null&&c.suppressHydrationWarning===!0||CS(n.nodeValue,a)),n||fa(r,!0)}else n=lu(n).createTextNode(c),n[hn]=r,r.stateNode=n}return Nn(r),null;case 31:if(a=r.memoizedState,n===null||n.memoizedState!==null){if(c=ul(r),a!==null){if(n===null){if(!c)throw Error(i(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[hn]=r}else po(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nn(r),n=!1}else a=tm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=a),n=!0;if(!n)return r.flags&256?(us(r),r):(us(r),null);if((r.flags&128)!==0)throw Error(i(558))}return Nn(r),null;case 13:if(c=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=ul(r),c!==null&&c.dehydrated!==null){if(n===null){if(!p)throw Error(i(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[hn]=r}else po(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nn(r),p=!1}else p=tm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(us(r),r):(us(r),null)}return us(r),(r.flags&128)!==0?(r.lanes=a,r):(a=c!==null,n=n!==null&&n.memoizedState!==null,a&&(c=r.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==p&&(c.flags|=2048)),a!==n&&a&&(r.child.flags|=8192),Rf(r,r.updateQueue),Nn(r),null);case 4:return ot(),n===null&&C0(r.stateNode.containerInfo),r.flags|=67108864,Nn(r),null;case 10:return _i(r.type),Nn(r),null;case 19:if(gm(r),c=r.memoizedState,c===null)return Nn(r),null;if(p=(r.flags&128)!==0,v=c.rendering,v===null)if(p)Zc(c,!1);else{if(Kn!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(v=cf(n),v!==null){for(r.flags|=128,Zc(c,!1),n=v.updateQueue,r.updateQueue=n,Rf(r,n),r.subtreeFlags=0,n=a,a=r.child;a!==null;)Wx(a,n),a=a.sibling;return Yc(r,Sr.current&1|2),Kt&&Li(r,c.treeForkCount),r.child}n=n.sibling}c.tail!==null&&Et()>Lf&&(r.flags|=128,p=!0,Zc(c,!1),r.lanes=4194304)}else{if(!p)if(n=cf(v),n!==null){if(r.flags|=128,p=!0,n=n.updateQueue,r.updateQueue=n,Rf(r,n),Zc(c,!0),c.tail===null&&c.tailMode!=="collapsed"&&c.tailMode!=="visible"&&!v.alternate&&!Kt)return Nn(r),null}else 2*Et()-c.renderingStartTime>Lf&&a!==536870912&&(r.flags|=128,p=!0,Zc(c,!1),r.lanes=4194304);c.isBackwards?(v.sibling=r.child,r.child=v):(n=c.last,n!==null?n.sibling=v:r.child=v,c.last=v)}if(c.tail!==null){n=c.tail;e:{for(a=n;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return c.rendering=n,c.tail=n.sibling,c.renderingStartTime=Et(),n.sibling=null,v=Sr.current,v=p?v&1|2:v&1,c.tailMode==="visible"||c.tailMode==="collapsed"||!a||Kt?Yc(r,v):(a=v,Ve(xr,r),Ve(Sr,a),Mr===null&&(Mr=r)),Kt&&Li(r,c.treeForkCount),n}return Nn(r),null;case 22:case 23:return us(r),hm(),c=r.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(a&536870912)!==0&&(r.flags&128)===0&&(Nn(r),r.subtreeFlags&6&&(r.flags|=8192)):Nn(r),a=r.updateQueue,a!==null&&Rf(r,a.retryQueue),a=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==a&&(r.flags|=2048),n!==null&&ze(bo),null;case 24:return a=null,n!==null&&(a=n.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),_i(Jn),Nn(r),null;case 25:return null;case 30:return r.flags|=33554432,Nn(r),null}throw Error(i(156,r.tag))}function yD(n,r){switch(Wg(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return _i(Jn),ot(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return Ee(r),null;case 31:if(r.memoizedState!==null){if(us(r),r.alternate===null)throw Error(i(340));po()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(us(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(i(340));po()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return gm(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 _i(r.type),null;case 22:case 23:return us(r),hm(),n!==null&&ze(bo),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return _i(Jn),null;case 25:return null;default:return null}}function k1(n,r){switch(Wg(r),r.tag){case 3:_i(Jn),ot();break;case 26:case 27:case 5:Ee(r);break;case 4:ot();break;case 31:r.memoizedState!==null&&us(r);break;case 13:us(r);break;case 19:gm(r);break;case 10:_i(r.type);break;case 22:case 23:us(r),hm(),n!==null&&ze(bo);break;case 24:_i(Jn)}}function Jc(n,r){try{var a=r.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var p=c.next;a=p;do{if((a.tag&n)===n){c=void 0;var v=a.create,k=a.inst;c=v(),k.destroy=c}a=a.next}while(a!==p)}}catch(P){yn(r,r.return,P)}}function Sa(n,r,a){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var v=p.next;c=v;do{if((c.tag&n)===n){var k=c.inst,P=k.destroy;if(P!==void 0){k.destroy=void 0,p=r;var J=a,le=P;try{le()}catch(me){yn(p,J,me)}}}c=c.next}while(c!==v)}}catch(me){yn(r,r.return,me)}}function O1(n){var r=n.updateQueue;if(r!==null){var a=n.stateNode;try{y2(r,a)}catch(c){yn(n,n.return,c)}}}function A1(n,r,a){a.props=Ro(n.type,n.memoizedProps),a.state=n.memoizedState;try{a.componentWillUnmount()}catch(c){yn(n,r,c)}}function ci(n,r){try{var a=n.ref;if(a!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:var p=n.stateNode,v=ji(n.memoizedProps,p);(p.ref===null||p.ref.name!==v)&&(p.ref=LS(v)),c=p.ref;break;case 7:if(n.stateNode===null){var k=new gs(n);h(n.child,!1,oj,k,void 0,void 0),n.stateNode=k}c=n.stateNode;break;default:c=n.stateNode}typeof a=="function"?n.refCleanup=a(c):a.current=c}}catch(P){yn(n,r,P)}}function wr(n,r){var a=n.ref,c=n.refCleanup;if(a!==null)if(typeof c=="function")try{c()}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 Cf(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++)BS(n.stateNode,r[a])}function M1(n){for(var r=n.return;r!==null&&(Ym(r)&&BS(n.stateNode,r.stateNode),!qm(r));)r=r.return}function Wc(n){for(var r=n.return;r!==null&&(Ym(r)&&lj(n.stateNode,r.stateNode),!qm(r));)r=r.return}function qm(n){return n.tag===5||n.tag===3||n.tag===27}function Ym(n){return n&&n.tag===7&&n.stateNode!==null}function $m(n){var r=n.type,a=n.memoizedProps,c=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&c.focus();break e;case"img":a.src?c.src=a.src:a.srcSet&&(c.srcset=a.srcSet)}}catch(p){yn(n,n.return,p)}}function Gm(n,r,a){try{var c=n.stateNode;VD(c,n.type,a,r),c[An]=r}catch(p){yn(n,n.return,p)}}function N1(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Oa(n.type)||n.tag===4}function Qm(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||N1(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&&Oa(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 Xm(n,r,a,c){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=_r)),Cf(n,c),mt=!0;else if(p!==4&&(p===27&&(Cf(n,c),c=null,Oa(n.type)&&(a=n.stateNode,r=null)),n=n.child,n!==null))for(Xm(n,r,a,c),n=n.sibling;n!==null;)Xm(n,r,a,c),n=n.sibling}function Tf(n,r,a,c){var p=n.tag;if(p===5||p===6)p=n.stateNode,r?a.insertBefore(p,r):a.appendChild(p),Cf(n,c),mt=!0;else if(p!==4&&(p===27&&(Cf(n,c),c=null,Oa(n.type)&&(a=n.stateNode)),n=n.child,n!==null))for(Tf(n,r,a,c),n=n.sibling;n!==null;)Tf(n,r,a,c),n=n.sibling}function D1(n){var r=n.stateNode,a=n.memoizedProps;try{for(var c=n.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Er(r,c,a),r[hn]=n,r[An]=a}catch(v){yn(n,n.return,v)}}var kf=!1,ds=null;function j1(n){(n.tag===30||(n.subtreeFlags&33554432)!==0)&&(kf=!0)}var ui=null;function I1(){var n=ui;return ui=null,n}var Gr=0;function vl(n,r,a,c,p){return Gr=0,P1(n.child,r,a,c,p)}function P1(n,r,a,c,p){for(var v=!1;n!==null;){if(n.tag===5){var k=n.stateNode;if(c!==null){var P=j0(k);c.push(P),P.view&&(v=!0)}else v||j0(k).view&&(v=!0);kf=!0,IS(k,Gr===0?r:r+"_"+Gr,a),Gr++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&p||P1(n.child,r,a,c,p)&&(v=!0));n=n.sibling}return v}function di(n,r){for(;n!==null;)n.tag===5?PS(n.stateNode,n.memoizedProps):(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&r||di(n.child,r)),n=n.sibling}function Of(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if((n.tag!==22||n.memoizedState===null)&&(Of(n),n.tag===30&&(n.flags&18874368)!==0&&n.stateNode.paired)){var r=n.memoizedProps;if(r.name==null||r.name==="auto")throw Error(i(544));var a=r.name;r=Ii(r.default,r.share),r!=="none"&&(vl(n,a,r,null,!1)||di(n.child,!1))}n=n.sibling}}function Zm(n,r){if(n.tag===30){var a=n.stateNode,c=n.memoizedProps,p=ji(c,a),v=Ii(c.default,a.paired?c.share:c.enter);v!=="none"?vl(n,p,v,null,!1)?(Of(n),a.paired||r||Tl(n,c.onEnter)):di(n.child,!1):Of(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Zm(n,r),n=n.sibling;else Of(n)}function Jm(n){if(ds!==null&&ds.size!==0){var r=ds;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,c=a.name;if(c!=null&&c!=="auto"){var p=r.get(c);if(p!==void 0){var v=Ii(a.default,a.share);if(v!=="none"&&(vl(n,c,v,null,!1)?(v=n.stateNode,p.paired=v,v.paired=p,Tl(n,a.onShare)):di(n.child,!1)),r.delete(c),r.size===0)break}}}Jm(n)}n=n.sibling}}}function Wm(n){if(n.tag===30){var r=n.memoizedProps,a=ji(r,n.stateNode),c=ds!==null?ds.get(a):void 0,p=Ii(r.default,c!==void 0?r.share:r.exit);p!=="none"&&(vl(n,a,p,null,!1)?c!==void 0?(p=n.stateNode,c.paired=p,p.paired=c,ds.delete(a),Tl(n,r.onShare)):Tl(n,r.onExit):di(n.child,!1)),ds!==null&&Jm(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Wm(n),n=n.sibling;else ds!==null&&Jm(n)}function L1(n){for(n=n.child;n!==null;){if(n.tag===30){var r=n.memoizedProps,a=ji(r,n.stateNode);r=Ii(r.default,r.update),n.flags&=-5,r!=="none"&&vl(n,a,r,n.memoizedState=[],!1)}else(n.subtreeFlags&33554432)!==0&&L1(n);n=n.sibling}}function e0(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,di(n.child,!1))}e0(n)}n=n.sibling}}function Af(n){if(n.tag===30)n.stateNode.paired=null,di(n.child,!1),e0(n);else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Af(n),n=n.sibling;else e0(n)}function z1(n){for(n=n.child;n!==null;)n.tag===30?di(n.child,!1):(n.subtreeFlags&33554432)!==0&&z1(n),n=n.sibling}function t0(n,r,a,c,p,v,k){for(var P=!1;r!==null;){if(r.tag===5){var J=r.stateNode;if(v!==null&&Gr<v.length){var le=v[Gr],me=j0(J);(le.view||me.view)&&(P=!0);var Te;if(Te=(n.flags&4)===0)if(me.clip)Te=!0;else{Te=le.rect;var ie=me.rect;Te=Te.y!==ie.y||Te.x!==ie.x||Te.height!==ie.height||Te.width!==ie.width}Te&&(n.flags|=4),me.abs?me=!le.abs:(le=le.rect,me=me.rect,me=le.height!==me.height||le.width!==me.width),me&&(n.flags|=32)}else n.flags|=32;(n.flags&4)!==0&&IS(J,Gr===0?a:a+"_"+Gr,p),P&&(n.flags&4)!==0||(ui===null&&(ui=[]),ui.push(J,Gr===0?c:c+"_"+Gr,r.memoizedProps)),Gr++}else(r.tag!==22||r.memoizedState===null)&&(r.tag===30&&k?n.flags|=r.flags&32:t0(n,r.child,a,c,p,v,k)&&(P=!0));r=r.sibling}return P}function _1(n,r){for(n=n.child;n!==null;){if(n.tag===30){var a=n.memoizedProps,c=n.stateNode,p=ji(a,c),v=Ii(a.default,a.update),k;k=n.memoizedState,n.memoizedState=null,c=n;var P=n.child;Gr=0,p=t0(c,P,p,p,v,k,!1),(n.flags&4)!==0&&p&&Tl(n,a.onUpdate)}else(n.subtreeFlags&33554432)!==0&&_1(n);n=n.sibling}}var ur=!1,gn=!1,fi=!1,n0=!1,U1=typeof WeakSet=="function"?WeakSet:Set,dr=null,hi=!1,eu=!1,Mf=!1,r0=!1;function vD(n,r,a){if(n=n.containerInfo,O0=Ll,n=Vx(n),Vg(n)){if("selectionStart"in n)var c={start:n.selectionStart,end:n.selectionEnd};else e:{c=(c=n.ownerDocument)&&c.defaultView||window;var p=c.getSelection&&c.getSelection();if(p&&p.rangeCount!==0){c=p.anchorNode;var v=p.anchorOffset,k=p.focusNode;p=p.focusOffset;try{c.nodeType,k.nodeType}catch{c=null;break e}var P=0,J=-1,le=-1,me=0,Te=0,ie=n,he=null;t:for(;;){for(var Ye;ie!==c||v!==0&&ie.nodeType!==3||(J=P+v),ie!==k||p!==0&&ie.nodeType!==3||(le=P+p),ie.nodeType===3&&(P+=ie.nodeValue.length),(Ye=ie.firstChild)!==null;)he=ie,ie=Ye;for(;;){if(ie===n)break t;if(he===c&&++me===v&&(J=P),he===k&&++Te===p&&(le=P),(Ye=ie.nextSibling)!==null)break;ie=he,he=ie.parentNode}ie=Ye}c=J===-1||le===-1?null:{start:J,end:le}}else c=null}c=c||{start:0,end:0}}else c=null;for(A0={focusedElem:n,selectionRange:c},Ll=!1,a=(a&335544064)===a,dr=r,r=a?9270:1024;dr!==null;){if(n=dr,a&&(c=n.deletions,c!==null))for(v=0;v<c.length;v++)a&&Wm(c[v]);if(n.alternate===null&&(n.flags&2)!==0)a&&j1(n),Nf(a);else{if(n.tag===22){if(c=n.alternate,n.memoizedState!==null){c!==null&&c.memoizedState===null&&a&&Wm(c),Nf(a);continue}else if(c!==null&&c.memoizedState!==null){a&&j1(n),Nf(a);continue}}c=n.child,(n.subtreeFlags&r)!==0&&c!==null?(c.return=n,dr=c):(a&&L1(n),Nf(a))}}ds=null}function Nf(n){for(;dr!==null;){var r=dr,a=n,c=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 15:break;case 1:if((p&1024)!==0&&c!==null){a=void 0,p=c.memoizedProps,c=c.memoizedState;var v=r.stateNode;try{var k=Ro(r.type,p);a=v.getSnapshotBeforeUpdate(k,c),v.__reactInternalSnapshotBeforeUpdate=a}catch(P){yn(r,r.return,P)}}break;case 3:if((p&1024)!==0){if(c=r.stateNode.containerInfo,a=c.nodeType,a===9)L0(c);else if(a===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":L0(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&c!==null&&(a=ji(c.memoizedProps,c.stateNode),p=r.memoizedProps,p=Ii(p.default,p.update),p!=="none"&&vl(c,a,p,c.memoizedState=[],!0));break;default:if((p&1024)!==0)throw Error(i(163))}if(c=r.sibling,c!==null){c.return=r.return,dr=c;break}dr=r.return}}function H1(n,r,a){var c=a.flags;switch(a.tag){case 0:case 11:case 15:pi(n,a),c&4&&Jc(5,a);break;case 1:if(pi(n,a),c&4)if(n=a.stateNode,r===null)try{n.componentDidMount()}catch(k){yn(a,a.return,k)}else{var p=Ro(a.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(p,r,n.__reactInternalSnapshotBeforeUpdate)}catch(k){yn(a,a.return,k)}}c&64&&O1(a),c&512&&ci(a,a.return);break;case 3:if(pi(n,a),c&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{y2(n,r)}catch(k){yn(a,a.return,k)}}break;case 27:r===null&&c&4&&D1(a);case 26:case 5:pi(n,a),r===null&&c&4&&$m(a),c&512&&ci(a,a.return);break;case 12:pi(n,a);break;case 31:pi(n,a),c&4&&K1(n,a);break;case 13:pi(n,a),c&4&&q1(n,a),c&64&&(n=a.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(a=MD.bind(null,a),dj(n,a))));break;case 22:if(c=a.memoizedState!==null||ur,!c){var v=r!==null&&r.memoizedState!==null||gn;r=ur,p=gn,ur=c,(gn=v)&&!p?(c=2,(a.subtreeFlags&8772)!==0&&(c|=1),qs(n,a,c)):pi(n,a),ur=r,gn=p}break;case 30:pi(n,a),c&512&&ci(a,a.return);break;case 7:c&512&&ci(a,a.return);default:pi(n,a)}}function s0(n,r){for(n=n.child;n!==null;)F1(n,r),n=n.sibling}function F1(n,r){switch(n.tag){case 5:case 26:try{var a=n.stateNode;if(r){var c=a.style;typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"}else{var p=n.stateNode,v=n.memoizedProps.style,k=v!=null&&v.hasOwnProperty("display")?v.display:null;p.style.display=k==null||typeof k=="boolean"?"":(""+k).trim()}}catch(J){yn(n,n.return,J)}i0(n,r);break;case 6:try{n.stateNode.nodeValue=r?"":n.memoizedProps,mt=!0}catch(J){yn(n,n.return,J)}break;case 18:try{var P=n.stateNode;r?jS(P,!0):jS(n.stateNode,!1)}catch(J){yn(n,n.return,J)}break;case 22:case 23:n.memoizedState===null&&s0(n,r);break;default:s0(n,r)}}function i0(n,r){if(n.subtreeFlags&67108864)for(n=n.child;n!==null;){e:{var a=n,c=r;switch(a.tag){case 4:F1(a,c);break e;case 22:a.memoizedState===null&&i0(a,c);break e;default:i0(a,c)}}n=n.sibling}}function B1(n){var r=n.alternate;r!==null&&(n.alternate=null,B1(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&Yn(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,Qr=!1;function Vs(n,r,a){for(a=a.child;a!==null;)V1(n,r,a),a=a.sibling}function V1(n,r,a){if(_e&&typeof _e.onCommitFiberUnmount=="function")try{_e.onCommitFiberUnmount(Ie,a)}catch{}switch(a.tag){case 26:gn||wr(a,r),Vs(n,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!gn&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:gn||wr(a,r),Wc(a);var c=In,p=Qr;Oa(a.type)&&(In=a.stateNode,Qr=!1),Vs(n,r,a),$S(a.stateNode,a.type,a.memoizedProps),In=c,Qr=p;break;case 5:gn||wr(a,r),Wc(a);case 6:if(a.tag===6&&Wc(a),c=In,p=Qr,In=null,Vs(n,r,a),In=c,Qr=p,In!==null)if(Qr)try{(In.nodeType===9?In.body:In.nodeName==="HTML"?In.ownerDocument.body:In).removeChild(a.stateNode),mt=!0}catch(v){yn(a,r,v)}else try{In.removeChild(a.stateNode),mt=!0}catch(v){yn(a,r,v)}break;case 18:In!==null&&(Qr?(n=In,DS(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,a.stateNode),zl(n)):DS(In,a.stateNode));break;case 4:c=In,p=Qr,In=a.stateNode.containerInfo,Qr=!0,Vs(n,r,a),In=c,Qr=p;break;case 0:case 11:case 14:case 15:Sa(2,a,r),gn||Sa(4,a,r),Vs(n,r,a);break;case 1:gn||(wr(a,r),c=a.stateNode,typeof c.componentWillUnmount=="function"&&A1(a,r,c)),Vs(n,r,a);break;case 21:Vs(n,r,a);break;case 22:gn=(c=gn)||a.memoizedState!==null,Vs(n,r,a),gn=c;break;case 30:wr(a,r),Vs(n,r,a);break;case 7:gn||wr(a,r),Vs(n,r,a);break;default:Vs(n,r,a)}}function K1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{zl(n)}catch(a){yn(r,r.return,a)}}}function q1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{zl(n)}catch(a){yn(r,r.return,a)}}function bD(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new U1),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new U1),r;default:throw Error(i(435,n.tag))}}function Df(n,r){var a=bD(n);r.forEach(function(c){if(!a.has(c)){a.add(c);var p=ND.bind(null,n,c);c.then(p,p)}})}function Fr(n,r,a){var c=r.deletions;if(c!==null)for(var p=0;p<c.length;p++){var v=c[p],k=n,P=r,J=P;e:for(;J!==null;){switch(J.tag){case 27:if(Oa(J.type)){In=J.stateNode,Qr=!1;break e}break;case 5:In=J.stateNode,Qr=!1;break e;case 3:case 4:In=J.stateNode.containerInfo,Qr=!0;break e}J=J.return}if(In===null)throw Error(i(160));V1(k,P,v),In=null,Qr=!1,k=v.alternate,k!==null&&(k.return=null),v.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Y1(r,n,a),r=r.sibling}var Ks=null;function Y1(n,r,a){var c=n.alternate,p=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(p&4&&(c=n.updateQueue,c=c!==null?c.events:null,c!==null))for(var v=0;v<c.length;v++){var k=c[v];k.ref.impl=k.nextImpl}Fr(r,n,a),Br(n),p&4&&(Sa(3,n,n.return),Jc(3,n),Sa(5,n,n.return));break;case 1:Fr(r,n,a),Br(n),p&512&&(gn||c===null||wr(c,c.return)),p&64&&ur&&(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(v=Ks,Fr(r,n,a),Br(n),p&512&&(gn||c===null||wr(c,c.return)),p&4)if(p=c!==null?c.memoizedState:null,a=n.memoizedState,c===null)if(a===null)if(n.stateNode===null)if(ur)n.stateNode=AS(n.type,n.memoizedProps,r.containerInfo,n);else{e:{r=n.type,a=n.memoizedProps,p=v.ownerDocument||v;t:switch(r){case"title":c=p.getElementsByTagName("title")[0],(!c||c[Ss]||c[hn]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=p.createElement(r),p.head.insertBefore(c,p.querySelector("head > title"))),Er(c,r,a),c[hn]=n,we(c),r=c;break e;case"link":if(v=WS("link","href",p).get(r+(a.href||""))){for(k=0;k<v.length;k++)if(c=v[k],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){v.splice(k,1);break t}}c=p.createElement(r),Er(c,r,a),p.head.appendChild(c);break;case"meta":if(v=WS("meta","content",p).get(r+(a.content||""))){for(k=0;k<v.length;k++)if(c=v[k],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){v.splice(k,1);break t}}c=p.createElement(r),Er(c,r,a),p.head.appendChild(c);break;default:throw Error(i(468,r))}c[hn]=n,we(c),r=c}n.stateNode=r}else ur||V0(v,n.type,n.stateNode);else n.stateNode=JS(v,a,n.memoizedProps);else p!==a?(p===null?(r=c.stateNode,r===null||gn||r.parentNode.removeChild(r)):p.count--,a===null?ur||V0(v,n.type,n.stateNode):JS(v,a,n.memoizedProps)):a===null&&n.stateNode!==null&&Gm(n,n.memoizedProps,c.memoizedProps);break;case 27:Fr(r,n,a),Br(n),p&512&&(gn||c===null||wr(c,c.return)),c!==null&&p&4&&Gm(n,n.memoizedProps,c.memoizedProps);break;case 5:if(v=fi,fi=!1,Fr(r,n,a),fi=v,Br(n),p&512&&(gn||c===null||wr(c,c.return)),n.flags&32){r=n.stateNode;try{zr(r,""),mt=!0}catch(me){yn(n,n.return,me)}}p&4&&n.stateNode!=null&&(r=n.memoizedProps,Gm(n,r,c!==null?c.memoizedProps:r)),p&1024&&(n0=!0);break;case 6:if(Fr(r,n,a),Br(n),p&4){if(n.stateNode===null)throw Error(i(162));r=n.memoizedProps,a=n.stateNode;try{a.nodeValue=r,mt=!0}catch(me){yn(n,n.return,me)}}break;case 3:if(mt=!1,$f=null,v=Ks,Ks=cu(r.containerInfo),Fr(r,n,a),Ks=v,Br(n),p&4&&c!==null&&c.memoizedState.isDehydrated)try{zl(r.containerInfo)}catch(me){yn(n,n.return,me)}n0&&(n0=!1,$1(n)),mt=!1;break;case 4:p=fi,fi=ur,c=ir(),v=Ks,Ks=cu(n.stateNode.containerInfo),Fr(r,n,a),Br(n),Ks=v,mt&&eu&&(Mf=!0),mt=c,fi=p;break;case 12:Fr(r,n,a),Br(n);break;case 31:Fr(r,n,a),Br(n),p&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Df(n,r)));break;case 13:Fr(r,n,a),Br(n),n.child.flags&8192&&n.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Pf=Et()),p&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Df(n,r)));break;case 22:v=n.memoizedState!==null,k=c!==null&&c.memoizedState!==null;var P=ur,J=gn,le=fi;ur=P||v,fi=le||v,gn=J||k,Fr(r,n,a),gn=J,fi=le,ur=P,Br(n),p&8192&&(r=n.stateNode,r._visibility=v?r._visibility&-2:r._visibility|1,!v||c===null||k||ur||gn||(r=k||gn,a=ur,c=gn,ur=v||ur,gn=r,wa(n,2),ur=a,gn=c),!v&&fi||s0(n,v)),p&4&&(r=n.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Df(n,a))));break;case 19:Fr(r,n,a),Br(n),p&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Df(n,r)));break;case 30:p&512&&(gn||c===null||wr(c,c.return)),p=ir(),v=eu,k=(a&335544064)===a,P=n.memoizedProps,eu=k&&Ii(P.default,P.update)!=="none",Fr(r,n,a),Br(n),k&&c!==null&&mt&&(n.flags|=4),eu=v,mt=p;break;case 21:break;case 7:p&512&&(gn||c===null||wr(c,c.return)),c&&c.stateNode!==null&&(c.stateNode._fragmentFiber=n);default:Fr(r,n,a),Br(n)}}function Br(n){var r=n.flags;if(r&2){try{for(var a,c=n.return;c!==null;){if(N1(c)){a=c;break}c=c.return}c=null;for(var p=n.return;p!==null;){if(Ym(p)){var v=p.stateNode;c===null?c=[v]:c.push(v)}if(qm(p))break;p=p.return}var k=c;if(a==null)throw Error(i(160));switch(a.tag){case 27:var P=a.stateNode,J=Qm(n);Tf(n,J,P,k);break;case 5:var le=a.stateNode;a.flags&32&&(zr(le,""),a.flags&=-33);var me=Qm(n);Tf(n,me,le,k);break;case 3:case 4:var Te=a.stateNode.containerInfo,ie=Qm(n);Xm(n,ie,Te,k);break;default:throw Error(i(161))}}catch(he){yn(n,n.return,he)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function $1(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;$1(r),r.tag===5&&r.flags&1024&&(r=r.stateNode,Ll=!0,r.reset(),Ll=!1),n=n.sibling}}function bl(n,r){if(r.subtreeFlags&9270)for(r=r.child;r!==null;)G1(r,n),r=r.sibling;else _1(r)}function G1(n,r){var a=n.alternate;if(a===null)Zm(n,!1);else switch(n.tag){case 3:if(r0=hi=!1,I1(),bl(r,n),!hi&&!Mf){if(n=ui,n!==null)for(var c=0;c<n.length;c+=3){a=n[c];var p=n[c+1];PS(a,n[c+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"})),r0=!0}ui=null;break;case 5:bl(r,n);break;case 4:c=hi,hi=!1,bl(r,n),hi&&(Mf=!0),hi=c;break;case 22:n.memoizedState===null&&(a.memoizedState!==null?Zm(n,!1):bl(r,n));break;case 30:c=hi,p=I1(),hi=!1,bl(r,n),hi&&(n.flags|=4);var v=n.memoizedProps,k=n.stateNode;r=ji(v,k),k=ji(a.memoizedProps,k);var P=Ii(v.default,v.update);P==="none"?r=!1:(v=a.memoizedState,a.memoizedState=null,a=n.child,Gr=0,r=t0(n,a,r,k,P,v,!0),Gr!==(v===null?0:v.length)&&(n.flags|=32)),(n.flags&4)!==0&&r?(Tl(n,n.memoizedProps.onUpdate),ui=p):p!==null&&(p.push.apply(p,ui),ui=p),hi=(n.flags&32)!==0?!0:c;break;default:bl(r,n)}}function pi(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)H1(n,r.alternate,r),r=r.sibling}function wa(n,r){for(n=n.child;n!==null;){var a=n,c=r;switch(a.tag){case 0:case 11:case 14:case 15:Sa(4,a,a.return),wa(a,c);break;case 1:wr(a,a.return);var p=a.stateNode;typeof p.componentWillUnmount=="function"&&A1(a,a.return,p),wa(a,c);break;case 27:(c&2)!==0&&$S(a.stateNode,a.type,a.memoizedProps);case 5:wr(a,a.return),a.tag!==5&&a.tag!==27||Wc(a),wa(a,c);break;case 6:Wc(a);break;case 26:wr(a,a.return),p=a.stateNode,a.memoizedState!==null||p===null||gn||p.parentNode.removeChild(p),wa(a,c);break;case 22:a.memoizedState===null&&wa(a,c);break;case 30:wr(a,a.return),wa(a,c);break;case 7:wr(a,a.return);default:wa(a,c)}n=n.sibling}}function qs(n,r,a){for(a=(r.subtreeFlags&8772)!==0?a:a&-2,r=r.child;r!==null;){var c=r.alternate,p=n,v=r,k=v.flags,P=(a&1)!==0;switch(v.tag){case 0:case 11:case 15:qs(p,v,a),Jc(4,v);break;case 1:if(qs(p,v,a),c=v,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(me){yn(c,c.return,me)}if(c=v,p=c.updateQueue,p!==null){var J=c.stateNode;try{var le=p.shared.hiddenCallbacks;if(le!==null)for(p.shared.hiddenCallbacks=null,p=0;p<le.length;p++)m2(le[p],J)}catch(me){yn(c,c.return,me)}}P&&k&64&&O1(v),ci(v,v.return);break;case 27:(a&2)!==0&&D1(v);case 5:v.tag!==5&&v.tag!==27||M1(v),qs(p,v,a),P&&c===null&&k&4&&$m(v),ci(v,v.return);break;case 6:M1(v);break;case 26:J=v.stateNode,v.memoizedState!==null||J===null||ur||V0(cu(J.ownerDocument),v.type,J),qs(p,v,a),P&&c===null&&k&4&&$m(v),ci(v,v.return);break;case 12:qs(p,v,a);break;case 31:qs(p,v,a),P&&k&4&&K1(p,v);break;case 13:qs(p,v,a),P&&k&4&&q1(p,v);break;case 22:v.memoizedState===null&&qs(p,v,a),ci(v,v.return);break;case 30:qs(p,v,a),ci(v,v.return);break;case 7:ci(v,v.return);default:qs(p,v,a)}r=r.sibling}}function a0(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&&Uc(a))}function o0(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Uc(n))}function Os(n,r,a,c){var p=(a&335544064)===a;if(r.subtreeFlags&(p?10262:10256))for(r=r.child;r!==null;)Q1(n,r,a,c),r=r.sibling;else p&&z1(r)}function Q1(n,r,a,c){var p=(a&335544064)===a;p&&r.alternate===null&&r.return!==null&&r.return.alternate!==null&&Af(r);var v=r.flags;switch(r.tag){case 0:case 11:case 15:Os(n,r,a,c),v&2048&&Jc(9,r);break;case 1:Os(n,r,a,c);break;case 3:Os(n,r,a,c),p&&r0&&(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="")),v&2048&&(v=null,r.alternate!==null&&(v=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==v&&(r.refCount++,v!=null&&Uc(v)));break;case 12:if(v&2048){Os(n,r,a,c),v=r.stateNode;try{var k=r.memoizedProps,P=k.id,J=k.onPostCommit;typeof J=="function"&&J(P,r.alternate===null?"mount":"update",v.passiveEffectDuration,-0)}catch(le){yn(r,r.return,le)}}else Os(n,r,a,c);break;case 31:Os(n,r,a,c);break;case 13:Os(n,r,a,c);break;case 23:break;case 22:k=r.stateNode,P=r.alternate,r.memoizedState!==null?(p&&P!==null&&P.memoizedState===null&&Af(P),k._visibility&2?Os(n,r,a,c):tu(n,r)):(p&&P!==null&&P.memoizedState!==null&&Af(r),k._visibility&2?Os(n,r,a,c):(k._visibility|=2,xl(n,r,a,c,(r.subtreeFlags&10256)!==0||!1))),v&2048&&a0(P,r);break;case 24:Os(n,r,a,c),v&2048&&o0(r.alternate,r);break;case 30:p&&(v=r.alternate,v!==null&&(di(v.child,!0),di(r.child,!0))),Os(n,r,a,c);break;default:Os(n,r,a,c)}}function xl(n,r,a,c,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var v=n,k=r,P=a,J=c,le=k.flags;switch(k.tag){case 0:case 11:case 15:xl(v,k,P,J,p),Jc(8,k);break;case 23:break;case 22:var me=k.stateNode;k.memoizedState!==null?me._visibility&2?xl(v,k,P,J,p):tu(v,k):(me._visibility|=2,xl(v,k,P,J,p)),p&&le&2048&&a0(k.alternate,k);break;case 24:xl(v,k,P,J,p),p&&le&2048&&o0(k.alternate,k);break;default:xl(v,k,P,J,p)}r=r.sibling}}function tu(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=n,c=r,p=c.flags;switch(c.tag){case 22:tu(a,c),p&2048&&a0(c.alternate,c);break;case 24:tu(a,c),p&2048&&o0(c.alternate,c);break;default:tu(a,c)}r=r.sibling}}var Co=8192;function To(n,r,a){if(n.subtreeFlags&Co)for(n=n.child;n!==null;)X1(n,r,a),n=n.sibling}function X1(n,r,a){switch(n.tag){case 26:To(n,r,a),n.flags&Co&&(n.memoizedState!==null?Cj(a,Ks,n.memoizedState,n.memoizedProps):(n=n.stateNode,(r&335544128)===r&&rw(a,n)));break;case 5:To(n,r,a),n.flags&Co&&(n=n.stateNode,(r&335544128)===r&&rw(a,n));break;case 3:case 4:var c=Ks;Ks=cu(n.stateNode.containerInfo),To(n,r,a),Ks=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=Co,Co=16777216,To(n,r,a),Co=c):To(n,r,a));break;case 30:if((n.flags&Co)!==0&&(c=n.memoizedProps.name,c!=null&&c!=="auto")){var p=n.stateNode;p.paired=null,ds===null&&(ds=new Map),ds.set(c,p)}To(n,r,a);break;default:To(n,r,a)}}function Z1(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 nu(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var c=r[a];dr=c,W1(c,n)}Z1(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)J1(n),n=n.sibling}function J1(n){switch(n.tag){case 0:case 11:case 15:nu(n),n.flags&2048&&Sa(9,n,n.return);break;case 3:nu(n);break;case 12:nu(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,jf(n)):nu(n);break;default:nu(n)}}function jf(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var c=r[a];dr=c,W1(c,n)}Z1(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Sa(8,r,r.return),jf(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,jf(r));break;default:jf(r)}n=n.sibling}}function W1(n,r){for(;dr!==null;){var a=dr;switch(a.tag){case 0:case 11:case 15:Sa(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var c=a.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Uc(a.memoizedState.cache)}if(c=a.child,c!==null)c.return=a,dr=c;else e:for(a=n;dr!==null;){c=dr;var p=c.sibling,v=c.return;if(B1(c),c===a){dr=null;break e}if(p!==null){p.return=v,dr=p;break e}dr=v}}}var xD={getCacheForType:function(n){var r=br(Jn),a=r.data.get(n);return a===void 0&&(a=n(),r.data.set(n,a)),a},cacheSignal:function(){return br(Jn).controller.signal}},SD=typeof WeakMap=="function"?WeakMap:Map,un=0,kn=null,Gt=null,Jt=0,mn=0,fs=null,Ea=!1,Sl=!1,l0=!1,Vi=0,Kn=0,Ra=0,ko=0,If=0,hs=0,wl=0,ru=null,Xr=null,c0=!1,Pf=0,eS=0,Lf=1/0,zf=null,Ca=null,_n=0,Ys=null,Oo=null,gi=0,u0=0,d0=null,tS=null,El=null,Rl=null,Cl=null,su=0,_f=null;function ps(){return(un&2)!==0&&Jt!==0?Jt&-Jt:fe.T!==null?S0():Tn()}function nS(){if(hs===0)if((Jt&536870912)===0||Kt){var n=ve;ve<<=1,(ve&3932160)===0&&(ve=262144),hs=n}else hs=536870912;return n=xr.current,n!==null&&(n.flags|=32),hs}function Tl(n,r){if(r!=null){var a=n.stateNode,c=a.ref;c===null&&(c=a.ref=LS(ji(n.memoizedProps,a))),Rl===null&&(Rl=[]),Rl.push(r.bind(null,c))}}function Zr(n,r,a){(n===kn&&(mn===2||mn===9)||n.cancelPendingCommit!==null)&&(kl(n,0),Ta(n,Jt,hs,!1)),ft(n,a),((un&2)===0||n!==kn)&&(n===kn&&((un&2)===0&&(ko|=a),Kn===4&&Ta(n,Jt,hs,!1)),mi(n))}function rS(n,r,a){if((un&6)!==0)throw Error(i(327));var c=!a&&(r&127)===0&&(r&n.expiredLanes)===0||Xe(n,r),p=c?RD(n,r):h0(n,r,!0),v=c;do{if(p===0){Sl&&!c&&Ta(n,r,0,!1);break}else{if(a=n.current.alternate,v&&!wD(a)){p=h0(n,r,!1),v=!1;continue}if(p===2){if(v=r,n.errorRecoveryDisabledLanes&v)var k=0;else k=n.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){r=k;e:{var P=n;p=ru;var J=P.current.memoizedState.isDehydrated;if(J&&(kl(P,k).flags|=256),k=h0(P,k,!1),k!==2&&k!==6){if(l0&&!J){P.errorRecoveryDisabledLanes|=v,ko|=v,p=4;break e}v=Xr,Xr=p,v!==null&&(Xr===null?Xr=v:Xr.push.apply(Xr,v))}p=k}if(v=!1,p!==2)continue}}if(p===1){kl(n,0),Ta(n,r,0,!0);break}e:{switch(c=n,v=p,v){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r&&(r&62914560)!==r)break;case 6:Ta(c,r,hs,!Ea);break e;case 2:Xr=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(p=Pf+300-Et(),10<p)){if(Ta(c,r,hs,!Ea),Ke(c,0,!0)!==0)break e;gi=r,c.timeoutHandle=D0(sS.bind(null,c,a,Xr,zf,c0,r,hs,ko,wl,Ea,v,"Throttled",-0,0),p);break e}sS(c,a,Xr,zf,c0,r,hs,ko,wl,Ea,v,null,-0,0)}}break}while(!0);mi(n)}function sS(n,r,a,c,p,v,k,P,J,le,me,Te,ie,he){n.timeoutHandle=-1;var Ye=r.subtreeFlags,it=(v&335544064)===v;if(Te=null,(it||Ye&8192||(Ye&16785408)===16785408)&&(Te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_r},ds=null,X1(r,v,Te),it&&(Ye=Te,it=n.containerInfo,it=(it.nodeType===9?it:it.ownerDocument).__reactViewTransition,it!=null&&(Ye.count++,Ye.waitingForViewTransition=!0,Ye=fu.bind(Ye),it.finished.then(Ye,Ye))),Ye=(v&62914560)===v?Pf-Et():(v&4194048)===v?eS-Et():0,Ye=Tj(Te,Ye),Ye!==null)){gi=v,n.cancelPendingCommit=Ye(fS.bind(null,n,r,v,a,c,p,k,P,J,le,me,Te,null,ie,he)),Ta(n,v,k,!le);return}fS(n,r,v,a,c,p,k,P,J,le,me,Te)}function wD(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 c=0;c<a.length;c++){var p=a[c],v=p.getSnapshot;p=p.value;try{if(!cs(v(),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 Ta(n,r,a,c){r=Qe(n,r),r&=~If,r&=~ko,n.suspendedLanes|=r,n.pingedLanes&=~r,c&&(n.warmLanes|=r),c=n.expirationTimes;for(var p=r;0<p;){var v=31-tt(p),k=1<<v;c[v]=-1,p&=~k}a!==0&&Bt(n,a,r)}function Uf(){return(un&6)===0?(iu(0),!1):!0}function f0(){if(Gt!==null){if(mn===0)var n=Gt.return;else n=Gt,zi=go=null,xm(n),hl=null,Bc=0,n=Gt;for(;n!==null;)k1(n.alternate,n),n=n.return;Gt=null}}function kl(n,r){var a=n.timeoutHandle;return a!==-1&&(n.timeoutHandle=-1,YD(a)),a=n.cancelPendingCommit,a!==null&&(n.cancelPendingCommit=null,a()),gi=0,f0(),kn=n,Gt=a=Pi(n.current,null),Jt=r,mn=0,fs=null,Ea=!1,Sl=Xe(n,r),l0=!1,wl=hs=If=ko=Ra=Kn=0,Xr=ru=null,c0=!1,Vi=Qe(n,r),Yd(),a}function iS(n,r){Pt=null,fe.H=vf,r===fl||r===rf?(r=f2(),mn=3):r===om?(r=f2(),mn=4):mn=r===Pm?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,fs=r,Gt===null&&(Kn=1,bf(n,Rs(r,n.current)))}function aS(){var n=xr.current;return n===null?!0:(Jt&4194048)===Jt?Mr===null:(Jt&62914560)===Jt||(Jt&536870912)!==0?n===Mr:!1}function oS(){var n=fe.H;return fe.H=vf,n===null?vf:n}function lS(){var n=fe.A;return fe.A=xD,n}function Hf(){Kn=4,Ea||(Jt&4194048)!==Jt&&xr.current!==null||(Sl=!0),(Ra&134217727)===0&&(ko&134217727)===0||kn===null||Ta(kn,Jt,hs,!1)}function h0(n,r,a){var c=un;un|=2;var p=oS(),v=lS();(kn!==n||Jt!==r)&&(zf=null,kl(n,r)),r=!1;var k=Kn;e:do try{if(mn!==0&&Gt!==null){var P=Gt,J=fs;switch(mn){case 8:f0(),k=6;break e;case 3:case 2:case 9:case 6:xr.current===null&&(r=!0);var le=mn;if(mn=0,fs=null,Ol(n,P,J,le),a&&Sl){k=0;break e}break;default:le=mn,mn=0,fs=null,Ol(n,P,J,le)}}ED(),k=Kn;break}catch(me){iS(n,me)}while(!0);return r&&n.shellSuspendCounter++,zi=go=null,un=c,fe.H=p,fe.A=v,Gt===null&&(kn=null,Jt=0,Yd()),k}function ED(){for(;Gt!==null;)cS(Gt)}function RD(n,r){var a=un;un|=2;var c=oS(),p=lS();kn!==n||Jt!==r?(zf=null,Lf=Et()+500,kl(n,r)):Sl=Xe(n,r);e:do try{if(mn!==0&&Gt!==null){r=Gt;var v=fs;t:switch(mn){case 1:mn=0,fs=null,Ol(n,r,v,1);break;case 2:case 9:if(u2(v)){mn=0,fs=null,uS(r);break}r=function(){mn!==2&&mn!==9||kn!==n||(mn=7),mi(n)},v.then(r,r);break e;case 3:mn=7;break e;case 4:mn=5;break e;case 7:u2(v)?(mn=0,fs=null,uS(r)):(mn=0,fs=null,Ol(n,r,v,7));break;case 5:var k=null;switch(Gt.tag){case 26:k=Gt.memoizedState;case 5:case 27:var P=Gt;if(k?tw(k):P.stateNode.complete){mn=0,fs=null;var J=P.sibling;if(J!==null)Gt=J;else{var le=P.return;le!==null?(Gt=le,Ff(le)):Gt=null}break t}}mn=0,fs=null,Ol(n,r,v,5);break;case 6:mn=0,fs=null,Ol(n,r,v,6);break;case 8:f0(),Kn=6;break e;default:throw Error(i(462))}}CD();break}catch(me){iS(n,me)}while(!0);return zi=go=null,fe.H=c,fe.A=p,un=a,Gt!==null?0:(kn=null,Jt=0,Yd(),Kn)}function CD(){for(;Gt!==null&&!nn();)cS(Gt)}function cS(n){var r=C1(n.alternate,n,Vi);n.memoizedProps=n.pendingProps,r===null?Ff(n):Gt=r}function uS(n){var r=n,a=r.alternate;switch(r.tag){case 15:case 0:r=v1(a,r,r.pendingProps,r.type,void 0,Jt);break;case 11:r=v1(a,r,r.pendingProps,r.type.render,r.ref,Jt);break;case 5:xm(r);var c=r;c===cr&&(Kt?(Jd(c),c.tag===5&&c.stateNode!=null&&(Mn=c.stateNode)):(Jd(c),Kt=!0));default:k1(a,r),r=Gt=Wx(r,Vi),r=C1(a,r,Vi)}n.memoizedProps=n.pendingProps,r===null?Ff(n):Gt=r}function Ol(n,r,a,c){zi=go=null,xm(r),hl=null,Bc=0;var p=r.return;try{if(fD(n,p,r,a,Jt)){Kn=1,bf(n,Rs(a,n.current)),Gt=null;return}}catch(v){if(p!==null)throw Gt=p,v;Kn=1,bf(n,Rs(a,n.current)),Gt=null;return}r.flags&32768?(Kt||c===1?n=!0:Sl||(Jt&536870912)!==0?n=!1:(Ea=n=!0,(c===2||c===9||c===3||c===6)&&(c=xr.current,c!==null&&c.tag===13&&(c.flags|=16384))),dS(r,n)):Ff(r)}function Ff(n){var r=n;do{if((r.flags&32768)!==0){dS(r,Ea);return}n=r.return;var a=mD(r.alternate,r,Vi);if(a!==null){Gt=a;return}if(r=r.sibling,r!==null){Gt=r;return}Gt=r=n}while(r!==null);Kn===0&&(Kn=5)}function dS(n,r){do{var a=yD(n.alternate,n);if(a!==null){a.flags&=32767,Gt=a;return}if(a=n.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(n=n.sibling,n!==null)){Gt=n;return}Gt=n=a}while(n!==null);Kn=6,Gt=null}function fS(n,r,a,c,p,v,k,P,J,le,me,Te){n.cancelPendingCommit=null;do Bf();while(_n!==0);if((un&6)!==0)throw Error(i(327));if(r!==null){if(r===n.current)throw Error(i(177));n===kn&&(Gt=kn=null,Jt=0),Oo=r,Ys=n,gi=a,d0=p,tS=c,TD(n,r,a,k,P,J,Te)}}function TD(n,r,a,c,p,v,k){var P=r.lanes|r.childLanes;if(u0=P,P|=Gg,Yt(n,a,P,c,p,v),Rl=null,(a&335544064)===a?(Cl=eD(n),c=10262):(Cl=null,c=10256),(r.subtreeFlags&c)!==0||(r.flags&c)!==0?(n.callbackNode=null,n.callbackPriority=0,DD(yt,function(){return y0(),null})):(n.callbackNode=null,n.callbackPriority=0),kf=!1,c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=fe.T,fe.T=null,p=ce.p,ce.p=2,v=un,un|=4;try{vD(n,r,a)}finally{un=v,ce.p=p,fe.T=c}}_n=1,kf?El=JD(k,n.containerInfo,Cl,p0,g0,OD,m0,y0,kD):(p0(),g0(),m0())}function kD(n){if(_n!==0){var r=Ys.onRecoverableError;r(n,{componentStack:null})}}function OD(){_n===3&&(_n=0,G1(Oo,Ys),_n=4)}function p0(){if(_n===1){_n=0;var n=Ys,r=Oo,a=gi,c=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||c){c=fe.T,fe.T=null;var p=ce.p;ce.p=2;var v=un;un|=4;try{eu=Mf=!1,Y1(r,n,a),a=A0;var k=Vx(n.containerInfo),P=a.focusedElem,J=a.selectionRange;if(k!==P&&P&&P.ownerDocument&&Bx(P.ownerDocument.documentElement,P)){if(J!==null&&Vg(P)){var le=J.start,me=J.end;if(me===void 0&&(me=le),"selectionStart"in P)P.selectionStart=le,P.selectionEnd=Math.min(me,P.value.length);else{var Te=P.ownerDocument||document,ie=Te&&Te.defaultView||window;if(ie.getSelection){var he=ie.getSelection(),Ye=P.textContent.length,it=Math.min(J.start,Ye),Lt=J.end===void 0?it:Math.min(J.end,Ye);!he.extend&&it>Lt&&(k=Lt,Lt=it,it=k);var oe=Fx(P,it),te=Fx(P,Lt);if(oe&&te&&(he.rangeCount!==1||he.anchorNode!==oe.node||he.anchorOffset!==oe.offset||he.focusNode!==te.node||he.focusOffset!==te.offset)){var ue=Te.createRange();ue.setStart(oe.node,oe.offset),he.removeAllRanges(),it>Lt?(he.addRange(ue),he.extend(te.node,te.offset)):(ue.setEnd(te.node,te.offset),he.addRange(ue))}}}}for(Te=[],he=P;he=he.parentNode;)he.nodeType===1&&Te.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<Te.length;P++){var Ce=Te[P];Ce.element.scrollLeft=Ce.left,Ce.element.scrollTop=Ce.top}}Ll=!!O0,A0=O0=null}finally{un=v,ce.p=p,fe.T=c}}n.current=r,_n=2}}function g0(){if(_n===2){_n=0;var n=Ys,r=Oo,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=fe.T,fe.T=null;var c=ce.p;ce.p=2;var p=un;un|=4;try{H1(n,r.alternate,r)}finally{un=p,ce.p=c,fe.T=a}}_n=3}}function m0(){if(_n===4||_n===3){_n=0;var n=El;El=null,et();var r=Ys,a=Oo,c=gi,p=tS,v=(c&335544064)===c?10262:10256;if((a.subtreeFlags&v)!==0||(a.flags&v)!==0?_n=5:(_n=0,Oo=Ys=null,hS(r,r.pendingLanes)),v=r.pendingLanes,v===0&&(Ca=null),Cn(c),a=a.stateNode,_e&&typeof _e.onCommitFiberRoot=="function")try{_e.onCommitFiberRoot(Ie,a,void 0,(a.current.flags&128)===128)}catch{}if(p!==null){a=fe.T,v=ce.p,ce.p=2,fe.T=null;try{for(var k=r.onRecoverableError,P=0;P<p.length;P++){var J=p[P];k(J.value,{componentStack:J.stack})}}finally{fe.T=a,ce.p=v}}if(p=Rl,k=Cl,Cl=null,p!==null&&(Rl=null,k===null&&(k=[]),n!==null))for(J=0;J<p.length;J++)a=(0,p[J])(k),a!==void 0&&n.finished.finally(a);(gi&3)!==0&&Bf(),mi(r),v=r.pendingLanes,(c&261930)!==0&&(v&42)!==0?r===_f?su++:(su=0,_f=r):(su=0,_f=null),iu(0)}}function hS(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Uc(r)))}function Bf(){return El!==null&&(El.skipTransition(),El=null),p0(),g0(),m0(),y0()}function y0(){if(_n!==5)return!1;var n=Ys,r=u0;u0=0;var a=Cn(gi),c=fe.T,p=ce.p;try{ce.p=32>a?32:a,fe.T=null,a=d0,d0=null;var v=Ys,k=gi;if(_n=0,Oo=Ys=null,gi=0,(un&6)!==0)throw Error(i(331));var P=un;if(un|=4,J1(v.current),Q1(v,v.current,k,a),un=P,iu(0,!1),_e&&typeof _e.onPostCommitFiberRoot=="function")try{_e.onPostCommitFiberRoot(Ie,v)}catch{}return!0}finally{ce.p=p,fe.T=c,hS(n,r)}}function pS(n,r,a){r=Rs(a,r),r=Im(n.stateNode,r,2),n=ya(n,r,2),n!==null&&(ft(n,2),mi(n))}function yn(n,r,a){if(n.tag===3)pS(n,n,a);else for(;r!==null;){if(r.tag===3){pS(r,n,a);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ca===null||!Ca.has(c))){n=Rs(a,n),a=u1(2),c=ya(r,a,2),c!==null&&(d1(a,c,r,n),ft(c,2),mi(c));break}}r=r.return}}function v0(n,r,a){var c=n.pingCache;if(c===null){c=n.pingCache=new SD;var p=new Set;c.set(r,p)}else p=c.get(r),p===void 0&&(p=new Set,c.set(r,p));p.has(a)||(l0=!0,p.add(a),n=AD.bind(null,n,r,a),r.then(n,n))}function AD(n,r,a){var c=n.pingCache;c!==null&&c.delete(r),n.pingedLanes|=n.suspendedLanes&a,n.warmLanes&=~a,kn===n&&(Jt&a)===a&&((Kn===4||Kn===3&&(Jt&62914560)===Jt&&300>Et()-Pf)&&(un&2)===0?kl(n,0):If|=a,wl===Jt&&(wl=0)),mi(n)}function gS(n,r){r===0&&(r=nt()),n=fo(n,r),n!==null&&(ft(n,r),mi(n))}function MD(n){var r=n.memoizedState,a=0;r!==null&&(a=r.retryLane),gS(n,a)}function ND(n,r){var a=0;switch(n.tag){case 31:case 13:var c=n.stateNode,p=n.memoizedState;p!==null&&(a=p.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(r),gS(n,a)}function DD(n,r){return tn(n,r)}var Al=null,Ml=null,b0=!1,Vf=!1,x0=!1,ka=0;function mi(n){n!==Ml&&n.next===null&&(Ml===null?Al=Ml=n:Ml=Ml.next=n),Vf=!0,b0||(b0=!0,ID())}function iu(n,r){if(!x0&&Vf){x0=!0;do for(var a=!1,c=Al;c!==null;){if(n!==0){var p=c.pendingLanes;if(p===0)var v=0;else{var k=c.suspendedLanes,P=c.pingedLanes;v=(1<<31-tt(42|n)+1)-1,v&=p&~(k&~P),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(a=!0,bS(c,v))}else v=Jt,v=Ke(c,c===kn?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||Xe(c,v)||(a=!0,bS(c,v));c=c.next}while(a);x0=!1}}function jD(){mS()}function mS(){Vf=b0=!1;var n=0;ka!==0&&qD()&&(n=ka);for(var r=Et(),a=null,c=Al;c!==null;){var p=c.next,v=yS(c,r);v===0?(c.next=null,a===null?Al=p:a.next=p,p===null&&(Ml=a)):(a=c,(n!==0||(v&3)!==0)&&(Vf=!0)),c=p}_n!==0&&_n!==5||iu(n),ka!==0&&(ka=0)}function yS(n,r){for(var a=n.suspendedLanes,c=n.pingedLanes,p=n.expirationTimes,v=n.pendingLanes&-62914561;0<v;){var k=31-tt(v),P=1<<k,J=p[k];J===-1?((P&a)===0||(P&c)!==0)&&(p[k]=ct(P,r)):J<=r&&(n.expiredLanes|=P),v&=~P}if(r=kn,a=Jt,a=Ke(n,n===r?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,a===0||n===r&&(mn===2||mn===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&an(c),n.callbackNode=null,n.callbackPriority=0;if((a&3)===0||Xe(n,a)){if(r=a&-a,r===n.callbackPriority)return r;switch(c!==null&&an(c),Cn(a)){case 2:case 8:a=St;break;case 32:a=yt;break;case 268435456:a=dn;break;default:a=yt}return c=vS.bind(null,n),a=tn(a,c),n.callbackPriority=r,n.callbackNode=a,r}return c!==null&&c!==null&&an(c),n.callbackPriority=2,n.callbackNode=null,2}function vS(n,r){if(_n!==0&&_n!==5)return n.callbackNode=null,n.callbackPriority=0,null;var a=n.callbackNode;if(Bf()&&n.callbackNode!==a)return null;var c=Jt;return c=Ke(n,n===kn?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(rS(n,c,r),yS(n,Et()),n.callbackNode!=null&&n.callbackNode===a?vS.bind(null,n):null)}function bS(n,r){if(Bf())return null;rS(n,r,!0)}function ID(){$D(function(){(un&6)!==0?tn(pt,jD):mS()})}function S0(){if(ka===0){var n=vo;n===0&&(n=re,re<<=1,(re&261888)===0&&(re=256)),ka=n}return ka}function xS(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:yr(n)}function PD(n,r,a,c,p){if(r==="submit"&&a&&a.stateNode===p){var v=xS((p[An]||null).action),k=c.submitter;k&&(r=(r=k[An]||null)?xS(r.formAction):k.getAttribute("formAction"),r!==null&&(v=r,k=null));var P=new Bd("action","action",null,c,p);n.push({event:P,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ka!==0){var J=new FormData(p,k);Am(a,{pending:!0,data:J,method:p.method,action:v},null,J)}}else typeof v=="function"&&(P.preventDefault(),J=new FormData(p,k),Am(a,{pending:!0,data:J,method:p.method,action:v},v,J))},currentTarget:p}]})}}for(var w0=0;w0<$g.length;w0++){var E0=$g[w0],LD=E0.toLowerCase(),zD=E0[0].toUpperCase()+E0.slice(1);Bs(LD,"on"+zD)}Bs(Yx,"onAnimationEnd"),Bs($x,"onAnimationIteration"),Bs(Gx,"onAnimationStart"),Bs("dblclick","onDoubleClick"),Bs("focusin","onFocus"),Bs("focusout","onBlur"),Bs(YN,"onTransitionRun"),Bs($N,"onTransitionStart"),Bs(GN,"onTransitionCancel"),Bs(Qx,"onTransitionEnd"),xn("onMouseEnter",["mouseout","mouseover"]),xn("onMouseLeave",["mouseout","mouseover"]),xn("onPointerEnter",["pointerout","pointerover"]),xn("onPointerLeave",["pointerout","pointerover"]),Ft("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ft("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ft("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ft("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ft("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ft("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var au="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(" "),_D=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(au));function SS(n,r){r=(r&4)!==0;for(var a=0;a<n.length;a++){var c=n[a],p=c.event;c=c.listeners;e:{var v=void 0;if(r)for(var k=c.length-1;0<=k;k--){var P=c[k],J=P.instance,le=P.currentTarget;if(P=P.listener,J!==v&&p.isPropagationStopped())break e;v=P,p.currentTarget=le;try{v(p)}catch(me){qd(me)}p.currentTarget=null,v=J}else for(k=0;k<c.length;k++){if(P=c[k],J=P.instance,le=P.currentTarget,P=P.listener,J!==v&&p.isPropagationStopped())break e;v=P,p.currentTarget=le;try{v(p)}catch(me){qd(me)}p.currentTarget=null,v=J}}}}function Qt(n,r){var a=r[Mi];a===void 0&&(a=r[Mi]=new Set);var c=n+"__bubble";a.has(c)||(wS(r,n,2,!1),a.add(c))}function R0(n,r,a){var c=0;r&&(c|=4),wS(a,n,c,r)}var Kf="_reactListening"+Math.random().toString(36).slice(2);function C0(n){if(!n[Kf]){n[Kf]=!0,At.forEach(function(a){a!=="selectionchange"&&(_D.has(a)||R0(a,!1,n),R0(a,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[Kf]||(r[Kf]=!0,R0("selectionchange",!1,r))}}function wS(n,r,a,c){switch(dw(r)){case 2:var p=Mj;break;case 8:p=Nj;break;default:p=q0}a=p.bind(null,r,a,n),p=void 0,!lo||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),c?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 T0(n,r,a,c,p){var v=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var k=c.tag;if(k===3||k===4){var P=c.stateNode.containerInfo;if(P===p)break;if(k===4)for(k=c.return;k!==null;){var J=k.tag;if((J===3||J===4)&&k.stateNode.containerInfo===p)return;k=k.return}for(;P!==null;){if(k=Bn(P),k===null)return;if(J=k.tag,J===5||J===6||J===26||J===27){c=v=k;continue e}P=P.parentNode}}c=c.return}oo(function(){var le=v,me=ao(a),Te=[];e:{var ie=Xx.get(n);if(ie!==void 0){var he=Bd,Ye=n;switch(n){case"keypress":if(Hd(a)===0)break e;case"keydown":case"keyup":he=wN;break;case"focusin":Ye="focus",he=zg;break;case"focusout":Ye="blur",he=zg;break;case"beforeblur":case"afterblur":he=zg;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":he=Cx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=uN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=kN;break;case Yx:case $x:case Gx:he=hN;break;case Qx:he=AN;break;case"scroll":case"scrollend":he=lN;break;case"wheel":he=NN;break;case"copy":case"cut":case"paste":he=gN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=kx;break;case"submit":he=CN;break;case"toggle":case"beforetoggle":he=jN}var it=(r&4)!==0,Lt=!it&&(n==="scroll"||n==="scrollend"),oe=it?ie!==null?ie+"Capture":null:ie;it=[];for(var te=le,ue;te!==null;){var Ce=te;if(ue=Ce.stateNode,Ce=Ce.tag,Ce!==5&&Ce!==26&&Ce!==27||ue===null||oe===null||(Ce=Di(te,oe),Ce!=null&&it.push(ou(te,Ce,ue))),Lt)break;te=te.return}0<it.length&&(ie=new he(ie,Ye,null,a,me),Te.push({event:ie,listeners:it}))}}if((r&7)===0){e:{if(he=n==="mouseover"||n==="pointerover",ie=n==="mouseout"||n==="pointerout",he&&a!==io&&(Ye=a.relatedTarget||a.fromElement)&&(Bn(Ye)||Ye[jn]))break e;(ie||he)&&(Ye=me.window===me?me:(he=me.ownerDocument)?he.defaultView||he.parentWindow:window,ie?(he=a.relatedTarget||a.toElement,ie=le,he=he?Bn(he):null,he!==null&&(Lt=l(he),it=he.tag,he!==Lt||it!==5&&it!==27&&it!==6)&&(he=null)):(ie=null,he=le),ie!==he&&(it=Cx,Ce="onMouseLeave",oe="onMouseEnter",te="mouse",(n==="pointerout"||n==="pointerover")&&(it=kx,Ce="onPointerLeave",oe="onPointerEnter",te="pointer"),Lt=ie==null?Ye:pe(ie),ue=he==null?Ye:pe(he),Ye=new it(Ce,te+"leave",ie,a,me),Ye.target=Lt,Ye.relatedTarget=ue,Ce=null,Bn(me)===le&&(it=new it(oe,te+"enter",he,a,me),it.target=ue,it.relatedTarget=Lt,Ce=it),Lt=Ce,it=ie&&he?j(ie,he,UD):null,ie!==null&&ES(Te,Ye,ie,it,!1),he!==null&&Lt!==null&&ES(Te,Lt,he,it,!0)))}e:{if(ie=le?pe(le):window,he=ie.nodeName&&ie.nodeName.toLowerCase(),he==="select"||he==="input"&&ie.type==="file")var We=Px;else if(jx(ie))if(Lx)We=VN;else{We=FN;var Wt=HN}else he=ie.nodeName,!he||he.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?le&&so(le.elementType)&&(We=Px):We=BN;if(We&&(We=We(n,le))){Ix(Te,We,a,me);break e}Wt&&Wt(n,ie,le)}switch(Wt=le?pe(le):window,n){case"focusin":(jx(Wt)||Wt.contentEditable==="true")&&(sl=Wt,Kg=le,Lc=null);break;case"focusout":Lc=Kg=sl=null;break;case"mousedown":qg=!0;break;case"contextmenu":case"mouseup":case"dragend":qg=!1,Kx(Te,a,me);break;case"selectionchange":if(qN)break;case"keydown":case"keyup":Kx(Te,a,me)}var ut;if(Ug)e:{switch(n){case"compositionstart":var wt="onCompositionStart";break e;case"compositionend":wt="onCompositionEnd";break e;case"compositionupdate":wt="onCompositionUpdate";break e}wt=void 0}else rl?Nx(n,a)&&(wt="onCompositionEnd"):n==="keydown"&&a.keyCode===229&&(wt="onCompositionStart");wt&&(Ox&&a.locale!=="ko"&&(rl||wt!=="onCompositionStart"?wt==="onCompositionEnd"&&rl&&(ut=Ex()):(la=me,Ig="value"in la?la.value:la.textContent,rl=!0)),Wt=qf(le,wt),0<Wt.length&&(wt=new Tx(wt,n,null,a,me),Te.push({event:wt,listeners:Wt}),ut?wt.data=ut:(ut=Dx(a),ut!==null&&(wt.data=ut)))),(ut=PN?LN(n,a):zN(n,a))&&(wt=qf(le,"onBeforeInput"),0<wt.length&&(Wt=new Tx("onBeforeInput","beforeinput",null,a,me),Te.push({event:Wt,listeners:wt}),Wt.data=ut)),PD(Te,n,le,a,me)}SS(Te,r)})}function ou(n,r,a){return{instance:n,listener:r,currentTarget:a}}function qf(n,r){for(var a=r+"Capture",c=[];n!==null;){var p=n,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=Di(n,a),p!=null&&c.unshift(ou(n,p,v)),p=Di(n,r),p!=null&&c.push(ou(n,p,v))),n.tag===3)return c;n=n.return}return[]}function UD(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function ES(n,r,a,c,p){for(var v=r._reactName,k=[];a!==null&&a!==c;){var P=a,J=P.alternate,le=P.stateNode;if(P=P.tag,J!==null&&J===c)break;P!==5&&P!==26&&P!==27||le===null||(J=le,p?(le=Di(a,v),le!=null&&k.unshift(ou(a,le,J))):p||(le=Di(a,v),le!=null&&k.push(ou(a,le,J)))),a=a.return}k.length!==0&&n.push({event:r,listeners:k})}var HD=/\r\n?/g,FD=/\u0000|\uFFFD/g;function RS(n){return(typeof n=="string"?n:""+n).replace(HD,`
|
|
10
|
-
`).replace(FD,"")}function CS(n,r){return r=RS(r),RS(n)===r}function vn(n,r,a,c,p,v){switch(a){case"children":if(typeof c=="string")r==="body"||r==="textarea"&&c===""||zr(n,c);else if(typeof c=="number"||typeof c=="bigint")r!=="body"&&zr(n,""+c);else return;break;case"className":is(n,"class",c);break;case"tabIndex":is(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":is(n,a,c);break;case"style":os(n,c,v);return;case"data":if(r!=="object"){is(n,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||a!=="href")){n.removeAttribute(a);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(a);break}c=yr(c),n.setAttribute(a,c);break;case"action":case"formAction":if(typeof c=="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 v=="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(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(a);break}c=yr(c),n.setAttribute(a,c);break;case"onClick":c!=null&&(n.onclick=_r);return;case"onScroll":c!=null&&Qt("scroll",n);return;case"onScrollEnd":c!=null&&Qt("scrollend",n);return;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(p.children!=null)throw Error(i(60));v?.__html!==a&&(n.innerHTML=a)}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}a=yr(c),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":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(a,c):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":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(a,""):n.removeAttribute(a);break;case"capture":case"download":c===!0?n.setAttribute(a,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(a,c):n.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(a,c):n.removeAttribute(a);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(a):n.setAttribute(a,c);break;case"popover":Qt("beforetoggle",n),Qt("toggle",n),zn(n,"popover",c);break;case"xlinkActuate":Xn(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Xn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Xn(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Xn(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Xn(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Xn(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Xn(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Xn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Xn(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":zn(n,"is",c);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=kc.get(a)||a,zn(n,a,c);else return}mt=!0}function k0(n,r,a,c,p,v){switch(a){case"style":os(n,c,v);return;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(p.children!=null)throw Error(i(60));v?.__html!==a&&(n.innerHTML=a)}}break;case"children":if(typeof c=="string")zr(n,c);else if(typeof c=="number"||typeof c=="bigint")zr(n,""+c);else return;break;case"onScroll":c!=null&&Qt("scroll",n);return;case"onScrollEnd":c!=null&&Qt("scrollend",n);return;case"onClick":c!=null&&(n.onclick=_r);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Ct.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(p=a.endsWith("Capture"),v=a.slice(2,p?a.length-7:void 0),r=n[An]||null,r=r!=null?r[a]:null,typeof r=="function"&&n.removeEventListener(v,r,p),typeof c=="function")){typeof r!="function"&&r!==null&&(a in n?n[a]=null:n.hasAttribute(a)&&n.removeAttribute(a)),n.addEventListener(v,c,p);break e}mt=!0,a in n?n[a]=c:c===!0?n.setAttribute(a,""):zn(n,a,c)}return}mt=!0}function Er(n,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qt("error",n),Qt("load",n);var c=!1,p=!1,v;for(v in a)if(a.hasOwnProperty(v)){var k=a[v];if(k!=null)switch(v){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:vn(n,r,v,k,a,null)}}p&&vn(n,r,"srcSet",a.srcSet,a,null),c&&vn(n,r,"src",a.src,a,null);return;case"input":Qt("invalid",n);var P=v=k=p=null,J=null,le=null;for(c in a)if(a.hasOwnProperty(c)){var me=a[c];if(me!=null)switch(c){case"name":p=me;break;case"type":k=me;break;case"checked":J=me;break;case"defaultChecked":le=me;break;case"value":v=me;break;case"defaultValue":P=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(i(137,r));break;default:vn(n,r,c,me,a,null)}}aa(n,v,P,J,le,k,p,!1);return;case"select":Qt("invalid",n),c=k=v=null;for(p in a)if(a.hasOwnProperty(p)&&(P=a[p],P!=null))switch(p){case"value":v=P;break;case"defaultValue":k=P;break;case"multiple":c=P;default:vn(n,r,p,P,a,null)}r=v,a=k,n.multiple=!!c,r!=null?Yr(n,!!c,r,!1):a!=null&&Yr(n,!!c,a,!0);return;case"textarea":Qt("invalid",n),v=p=c=null;for(k in a)if(a.hasOwnProperty(k)&&(P=a[k],P!=null))switch(k){case"value":c=P;break;case"defaultValue":p=P;break;case"children":v=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(91));break;default:vn(n,r,k,P,a,null)}as(n,c,p,v);return;case"option":for(J in a)a.hasOwnProperty(J)&&(c=a[J],c!=null)&&(J==="selected"?n.selected=c&&typeof c!="function"&&typeof c!="symbol":vn(n,r,J,c,a,null));return;case"dialog":Qt("beforetoggle",n),Qt("toggle",n),Qt("cancel",n),Qt("close",n);break;case"iframe":case"object":Qt("load",n);break;case"video":case"audio":for(c=0;c<au.length;c++)Qt(au[c],n);break;case"image":Qt("error",n),Qt("load",n);break;case"details":Qt("toggle",n);break;case"embed":case"source":case"link":Qt("error",n),Qt("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(le in a)if(a.hasOwnProperty(le)&&(c=a[le],c!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:vn(n,r,le,c,a,null)}return;default:if(so(r)){for(me in a)a.hasOwnProperty(me)&&(c=a[me],c!==void 0&&k0(n,r,me,c,a,void 0));return}}for(P in a)a.hasOwnProperty(P)&&(c=a[P],c!=null&&vn(n,r,P,c,a,null))}var BD={};function VD(n,r,a,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,k=null,P=null,J=null,le=null,me=null;for(he in a){var Te=a[he];if(a.hasOwnProperty(he)&&Te!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":J=Te;default:c.hasOwnProperty(he)||vn(n,r,he,null,c,Te)}}for(var ie in c){var he=c[ie];if(Te=a[ie],c.hasOwnProperty(ie)&&(he!=null||Te!=null))switch(ie){case"type":he!==Te&&(mt=!0),v=he;break;case"name":he!==Te&&(mt=!0),p=he;break;case"checked":he!==Te&&(mt=!0),le=he;break;case"defaultChecked":he!==Te&&(mt=!0),me=he;break;case"value":he!==Te&&(mt=!0),k=he;break;case"defaultValue":he!==Te&&(mt=!0),P=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(i(137,r));break;default:he!==Te&&vn(n,r,ie,he,c,Te)}}Ar(n,k,P,J,le,me,v,p);return;case"select":he=k=P=ie=null;for(v in a)if(J=a[v],a.hasOwnProperty(v)&&J!=null)switch(v){case"value":break;case"multiple":he=J;default:c.hasOwnProperty(v)||vn(n,r,v,null,c,J)}for(p in c)if(v=c[p],J=a[p],c.hasOwnProperty(p)&&(v!=null||J!=null))switch(p){case"value":v!==J&&(mt=!0),ie=v;break;case"defaultValue":v!==J&&(mt=!0),P=v;break;case"multiple":v!==J&&(mt=!0),k=v;default:v!==J&&vn(n,r,p,v,c,J)}r=P,a=k,c=he,ie!=null?Yr(n,!!a,ie,!1):!!c!=!!a&&(r!=null?Yr(n,!!a,r,!0):Yr(n,!!a,a?[]:"",!1));return;case"textarea":he=ie=null;for(P in a)if(p=a[P],a.hasOwnProperty(P)&&p!=null&&!c.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:vn(n,r,P,null,c,p)}for(k in c)if(p=c[k],v=a[k],c.hasOwnProperty(k)&&(p!=null||v!=null))switch(k){case"value":p!==v&&(mt=!0),ie=p;break;case"defaultValue":p!==v&&(mt=!0),he=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(i(91));break;default:p!==v&&vn(n,r,k,p,c,v)}nl(n,ie,he);return;case"option":for(var Ye in a)ie=a[Ye],a.hasOwnProperty(Ye)&&ie!=null&&!c.hasOwnProperty(Ye)&&(Ye==="selected"?n.selected=!1:vn(n,r,Ye,null,c,ie));for(J in c)ie=c[J],he=a[J],c.hasOwnProperty(J)&&ie!==he&&(ie!=null||he!=null)&&(J==="selected"?(ie!==he&&(mt=!0),n.selected=ie&&typeof ie!="function"&&typeof ie!="symbol"):vn(n,r,J,ie,c,he));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 it in a)ie=a[it],a.hasOwnProperty(it)&&ie!=null&&!c.hasOwnProperty(it)&&vn(n,r,it,null,c,ie);for(le in c)if(ie=c[le],he=a[le],c.hasOwnProperty(le)&&ie!==he&&(ie!=null||he!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,r));break;default:vn(n,r,le,ie,c,he)}return;default:if(so(r)){for(var Lt in a)ie=a[Lt],a.hasOwnProperty(Lt)&&ie!==void 0&&!c.hasOwnProperty(Lt)&&k0(n,r,Lt,void 0,c,ie);for(me in c)ie=c[me],he=a[me],!c.hasOwnProperty(me)||ie===he||ie===void 0&&he===void 0||k0(n,r,me,ie,c,he);return}}for(var oe in a)ie=a[oe],a.hasOwnProperty(oe)&&ie!=null&&!c.hasOwnProperty(oe)&&vn(n,r,oe,null,c,ie);for(Te in c)ie=c[Te],he=a[Te],!c.hasOwnProperty(Te)||ie===he||ie==null&&he==null||vn(n,r,Te,ie,c,he)}function TS(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function KD(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,a=performance.getEntriesByType("resource"),c=0;c<a.length;c++){var p=a[c],v=p.transferSize,k=p.initiatorType,P=p.duration;if(v&&P&&TS(k)){for(k=0,P=p.responseEnd,c+=1;c<a.length;c++){var J=a[c],le=J.startTime;if(le>P)break;var me=J.transferSize,Te=J.initiatorType;me&&TS(Te)&&(J=J.responseEnd,k+=me*(J<P?1:(P-le)/(J-le)))}if(--c,r+=8*(v+k)/(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 O0=null,A0=null;function lu(n){return n.nodeType===9?n:n.ownerDocument}function kS(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 OS(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 AS(n,r,a,c){return a=lu(a).createElement(n),a[hn]=c,a[An]=r,Er(a,n,r),we(a),a}function M0(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 N0=null;function qD(){var n=window.event;return n&&n.type==="popstate"?n===N0?!1:(N0=n,!0):(N0=null,!1)}var D0=typeof setTimeout=="function"?setTimeout:void 0,YD=typeof clearTimeout=="function"?clearTimeout:void 0,MS=typeof Promise=="function"?Promise:void 0,NS=typeof requestAnimationFrame=="function"?requestAnimationFrame:D0,$D=typeof queueMicrotask=="function"?queueMicrotask:typeof MS<"u"?function(n){return MS.resolve(null).then(n).catch(GD)}:D0;function GD(n){setTimeout(function(){throw n})}function Oa(n){return n==="head"}function DS(n,r){var a=r,c=0;do{var p=a.nextSibling;if(n.removeChild(a),p&&p.nodeType===8)if(a=p.data,a==="/$"||a==="/&"){if(c===0){n.removeChild(p),zl(r);return}c--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")c++;else if(a==="html")H0(n.ownerDocument.documentElement);else if(a==="head"){a=n.ownerDocument.head,H0(a);for(var v=a.firstChild;v;){var k=v.nextSibling,P=v.nodeName;v[Ss]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&v.rel.toLowerCase()==="stylesheet"||a.removeChild(v),v=k}}else a==="body"&&H0(n.ownerDocument.body);a=p}while(a);zl(r)}function jS(n,r){var a=n;n=0;do{var c=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||""),c&&c.nodeType===8)if(a=c.data,a==="/$"){if(n===0)break;n--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||n++;a=c}while(a)}function IS(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 c=1;else for(var p=c=0;p<r.length;p++){var v=r[p];0<v.width&&0<v.height&&c++}c===1&&(n=n.style,n.display=r.length===1?"inline-block":"block",n.marginTop="-"+a.paddingTop,n.marginBottom="-"+a.paddingBottom)}}function PS(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 QD(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 j0(n){var r=n.getBoundingClientRect(),a=getComputedStyle(n);return QD(r,a,n)}function XD(n){return n.documentElement.clientHeight}function ZD(n){this.addEventListener("load",n),this.addEventListener("error",n)}function JD(n,r,a,c,p,v,k,P,J){var le=r.nodeType===9?r:r.ownerDocument;try{var me=le.startViewTransition({update:function(){var ie=le.defaultView,he=ie.navigation&&ie.navigation.transition,Ye=le.fonts.status;c();var it=[];if(Ye==="loaded"&&(XD(le),le.fonts.status==="loading"&&it.push(le.fonts.ready)),Ye=it.length,n!==null)for(var Lt=n.suspenseyImages,oe=0,te=0;te<Lt.length;te++){var ue=Lt[te];if(!ue.complete){var Ce=ue.getBoundingClientRect();if(0<Ce.bottom&&0<Ce.right&&Ce.top<ie.innerHeight&&Ce.left<ie.innerWidth){if(oe+=nw(ue),oe>Gf){it.length=Ye;break}ue=new Promise(ZD.bind(ue)),it.push(ue)}}}if(0<it.length)return ie=Promise.race([Promise.all(it),new Promise(function(We){return setTimeout(We,500)})]).then(p,p),(he?Promise.allSettled([he.finished,ie]):ie).then(v,v);if(p(),he)return he.finished.then(v,v);v()},types:a});le.__reactViewTransition=me;var Te=[];return me.ready.then(function(){for(var ie=le.documentElement.getAnimations({subtree:!0}),he=0;he<ie.length;he++){var Ye=ie[he],it=Ye.effect,Lt=it.pseudoElement;if(Lt!=null&&Lt.startsWith("::view-transition")){Te.push(Ye),Ye=it.getKeyframes();for(var oe=Lt=void 0,te=!0,ue=0;ue<Ye.length;ue++){var Ce=Ye[ue],We=Ce.width;if(Lt===void 0)Lt=We;else if(Lt!==We){te=!1;break}if(We=Ce.height,oe===void 0)oe=We;else if(oe!==We){te=!1;break}delete Ce.width,delete Ce.height,Ce.transform==="none"&&delete Ce.transform}te&&Lt!==void 0&&oe!==void 0&&(it.setKeyframes(Ye),te=getComputedStyle(it.target,it.pseudoElement),te.width!==Lt||te.height!==oe)&&(te=Ye[0],te.width=Lt,te.height=oe,te=Ye[Ye.length-1],te.width=Lt,te.height=oe,it.setKeyframes(Ye))}}k()},function(ie){le.__reactViewTransition===me&&(le.__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&&J(ie)}finally{c(),p(),k()}}),me.finished.finally(function(){for(var ie=0;ie<Te.length;ie++)Te[ie].cancel();le.__reactViewTransition===me&&(le.__reactViewTransition=null),P()}),me}catch{return c(),p(),k(),null}}function Ao(n,r){this._scope=document.documentElement,this._selector="::view-transition-"+n+"("+r+")"}Ao.prototype.animate=function(n,r){return r=typeof r=="number"?{duration:r}:D({},r),r.pseudoElement=this._selector,this._scope.animate(n,r)},Ao.prototype.getAnimations=function(){for(var n=this._scope,r=this._selector,a=n.getAnimations({subtree:!0}),c=[],p=0;p<a.length;p++){var v=a[p].effect;v!==null&&v.target===n&&v.pseudoElement===r&&c.push(a[p])}return c},Ao.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function LS(n){return{name:n,group:new Ao("group",n),imagePair:new Ao("image-pair",n),old:new Ao("old",n),new:new Ao("new",n)}}function gs(n){this._fragmentFiber=n,this._observers=this._eventListeners=null}gs.prototype.addEventListener=function(n,r,a){var c=null,p=null;if(!(a!=null&&typeof a!="boolean"&&(c=a.signal||null,c!==null&&c.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var v=this._eventListeners;if(_S(v,n,r,a)===-1){var k=this,P=r;a!=null&&typeof a!="boolean"&&a.once===!0&&(P=function(J){k.removeEventListener(n,r,a),typeof r=="function"?r.call(this,J):r.handleEvent(J)}),c!==null&&(p=k.removeEventListener.bind(k,n,r,a),c.addEventListener("abort",p,{once:!0}),p=c.removeEventListener.bind(c,"abort",p)),c=Nl(a),v.push({type:n,listener:r,optionsOrUseCapture:a,attachedListener:P,cleanup:p}),h(this._fragmentFiber.child,!1,WD,n,P,c)}this._eventListeners=v}};function WD(n,r,a,c){return E(n).addEventListener(r,a,c),!1}gs.prototype.removeEventListener=function(n,r,a){var c=this._eventListeners;if(c!==null&&(r=_S(c,n,r,a),r!==-1)){var p=c[r];a=p.attachedListener;var v=p.cleanup;p=Nl(p.optionsOrUseCapture),h(this._fragmentFiber.child,!1,ej,n,a,p),c.splice(r,1),v!==null&&v()}};function ej(n,r,a,c){return E(n).removeEventListener(r,a,c),!1}function Nl(n){return n!=null&&typeof n!="boolean"&&(n.once===!0||n.signal instanceof AbortSignal)?{capture:n.capture,passive:n.passive}:n}function zS(n){return n==null?"c=0":typeof n=="boolean"?"c="+(n?"1":"0"):"c="+(n.capture?"1":"0")}function _S(n,r,a,c){if(n.length===0)return-1;c=zS(c);for(var p=0;p<n.length;p++){var v=n[p];if(v.type===r&&v.listener===a&&zS(v.optionsOrUseCapture)===c)return p}return-1}gs.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 c=r.nodeType===9?r.createComment(""):document.createTextNode("");if(a)for(var p=0;p<a.length;p++){var v=a[p];c.addEventListener(v.type,v.attachedListener,Nl(v.optionsOrUseCapture))}if(r.appendChild(c),n=c.dispatchEvent(n),a)for(p=0;p<a.length;p++)v=a[p],c.removeEventListener(v.type,v.attachedListener,Nl(v.optionsOrUseCapture));return r.removeChild(c),n}return r.dispatchEvent(n)},gs.prototype.focus=function(n){h(this._fragmentFiber.child,!0,US,n,void 0,void 0)};function US(n,r){return n.tag===6?!1:(n=E(n),fj(n,r))}gs.prototype.focusLast=function(n){var r=[];h(this._fragmentFiber.child,!0,I0,r,void 0,void 0);for(var a=r.length-1;0<=a&&!US(r[a],n);a--);};function I0(n,r){return r.push(n),!1}gs.prototype.blur=function(){var n=x(this._fragmentFiber);n!==null&&(n=E(n),n=lu(n).activeElement,n!==null&&h(this._fragmentFiber.child,!1,tj,n,void 0,void 0))};function tj(n,r){return n.tag===6?!1:(n=E(n),n===r||n.contains(r)?(r.blur(),!0):!1)}gs.prototype.observeUsing=function(n){this._observers===null&&(this._observers=new Set),this._observers.add(n),h(this._fragmentFiber.child,!1,nj,n,void 0,void 0)};function nj(n,r){return n.tag===6||(n=E(n),r.observe(n)),!1}gs.prototype.unobserveUsing=function(n){var r=this._observers;if(r!==null&&r.has(n)){r.delete(n),h(this._fragmentFiber.child,!1,rj,n,void 0,void 0);for(var a=r=0;a<$s.length;a++){var c=$s[a];c.fragmentInstance===this&&c.observer===n?n.unobserve(c.instance):$s[r++]=c}$s.length=r}};function rj(n,r){return n.tag===6||(n=E(n),r.unobserve(n)),!1}var $s=[],P0=!1;function sj(n,r,a){$s.push({fragmentInstance:n,observer:r,instance:a}),P0||(P0=!0,hj(function(){P0=!1;var c=$s;$s=[];for(var p=0;p<c.length;p++){var v=c[p];v.observer.unobserve(v.instance)}}))}gs.prototype.getClientRects=function(){var n=[];return h(this._fragmentFiber.child,!1,ij,n,void 0,void 0),n};function ij(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}gs.prototype.getRootNode=function(n){var r=x(this._fragmentFiber);return r===null?this:E(r).getRootNode(n)},gs.prototype.compareDocumentPosition=function(n){var r=x(this._fragmentFiber);if(r===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];h(this._fragmentFiber.child,!1,I0,a,void 0,void 0);var c=E(r);if(a.length===0){if(a=c,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=c=a.compareDocumentPosition(n);return a===n?p=Node.DOCUMENT_POSITION_CONTAINS:c&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 v=S(this._fragmentFiber)?r.parentElement:c;if(v==null)return Node.DOCUMENT_POSITION_DISCONNECTED;c=v.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY,v=v.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_CONTAINED_BY;var k=r.compareDocumentPosition(n),P=p.compareDocumentPosition(n),J=k&Node.DOCUMENT_POSITION_CONTAINED_BY||P&Node.DOCUMENT_POSITION_CONTAINED_BY;return P=c&&v&&k&Node.DOCUMENT_POSITION_FOLLOWING&&P&Node.DOCUMENT_POSITION_PRECEDING,r=c&&r===n||v&&p===n||J||P?Node.DOCUMENT_POSITION_CONTAINED_BY:!c&&r===n||!v&&p===n?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:k,r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||aj(r,this._fragmentFiber,a[0],a[a.length-1],n)?r:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function aj(n,r,a,c,p){var v=Bn(p);if(n&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!v)e:{for(;v!==null;){if(v.tag===7&&(v===r||v.alternate===r)){a=!0;break e}v=v.return}a=!1}return a}if(n&Node.DOCUMENT_POSITION_CONTAINS){if(v===null)return v=p.ownerDocument,p===v||p===v.documentElement||p===v.body;e:{for(v=r,r=x(r);v!==null;){if(!(v.tag!==5&&v.tag!==3&&v.tag!==27||v!==r&&v.alternate!==r)){v=!0;break e}v=v.return}v=!1}return v}return n&Node.DOCUMENT_POSITION_PRECEDING?((r=!!v)&&!(r=v===a)&&(r=j(a,v,N),r===null?r=!1:(h(r,!0,T,v,a),v=R,R=null,r=v!==null)),r):n&Node.DOCUMENT_POSITION_FOLLOWING?((r=!!v)&&!(r=v===c)&&(r=j(c,v,N),r===null?r=!1:(h(r,!0,A,v,c),v=R,O=R=null,r=v!==null)),r):!1}function HS(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)}gs.prototype.scrollIntoView=function(n){if(typeof n=="object")throw Error(i(566));var r=[];h(this._fragmentFiber.child,!1,I0,r,void 0,void 0);var a=n!==!1;if(r.length===0){var c=w(this._fragmentFiber);if(c=a?c[1]||c[0]||x(this._fragmentFiber):c[0]||c[1],c===null)return;if(c.tag===6){n=E(c),HS(n,a);return}if(c=E(c),c.nodeType!==9){if(c.nodeType===11){a="host"in c?c.host:null,a!==null&&a.scrollIntoView(n);return}c.scrollIntoView(n)}}for(c=a?r.length-1:0;c!==(a?-1:r.length);){var p=r[c];p.tag===6?(p=E(p),HS(p,a)):E(p).scrollIntoView(n),c+=a?-1:1}};function oj(n,r){return n=E(n),FS(n,r),!1}function FS(n,r){n.reactFragments==null&&(n.reactFragments=new Set),n.reactFragments.add(r)}function BS(n,r){var a=r._eventListeners;if(a!==null)for(var c=0;c<a.length;c++){var p=a[c];n.addEventListener(p.type,p.attachedListener,Nl(p.optionsOrUseCapture))}n.nodeType!==3&&(a=r._observers,a!==null&&a.forEach(function(v){for(var k=0,P=0;P<$s.length;P++){var J=$s[P];(J.fragmentInstance!==r||J.observer!==v||J.instance!==n)&&($s[k++]=J)}$s.length=k,v.observe(n)}),FS(n,r))}function lj(n,r){var a=r._eventListeners;if(a!==null)for(var c=0;c<a.length;c++){var p=a[c];n.removeEventListener(p.type,p.attachedListener,Nl(p.optionsOrUseCapture))}n.nodeType!==3&&(a=r._observers,a!==null&&a.forEach(function(v){typeof v.rootMargin=="string"?sj(r,v,n):v.unobserve(n)}),n.reactFragments!=null&&n.reactFragments.delete(r))}function L0(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":L0(a),Yn(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}n.removeChild(a)}}function cj(n,r,a,c){for(;n.nodeType===1;){var p=a;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[Ss])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(v=n.getAttribute("rel"),v==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(v!==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(v=n.getAttribute("src"),(v!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===v)return n}else return n;if(n=As(n.nextSibling),n===null)break}return null}function uj(n,r,a){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=As(n.nextSibling),n===null))return null;return n}function VS(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=As(n.nextSibling),n===null))return null;return n}function z0(n){return n.data==="$?"||n.data==="$~"}function _0(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function dj(n,r){var a=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||a.readyState!=="loading")r();else{var c=function(){r(),a.removeEventListener("DOMContentLoaded",c)};a.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function As(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 U0=null;function KS(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var a=n.data;if(a==="/$"||a==="/&"){if(r===0)return As(n.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}n=n.nextSibling}return null}function qS(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 fj(n,r){function a(){c=!0}if(n.ownerDocument.activeElement===n)return!0;var c=!1;try{n.ownerDocument.addEventListener("focus",a,!0),(n.focus||HTMLElement.prototype.focus).call(n,r)}finally{n.ownerDocument.removeEventListener("focus",a,!0)}return c}function hj(n){NS(function(){NS(function(r){return n(r)})})}function YS(n,r,a){switch(r=lu(a),n){case"html":if(n=r.documentElement,!n)throw Error(i(452));return n;case"head":if(n=r.head,!n)throw Error(i(453));return n;case"body":if(n=r.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function $S(n,r,a){for(var c in a){var p=a[c];a.hasOwnProperty(c)&&p!=null&&vn(n,r,c,null,BD,p)}a.dangerouslySetInnerHTML!=null&&(n.textContent=""),n.onclick===_r&&(n.onclick=null),Yn(n)}function H0(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);Yn(n)}var Ms=new Map,GS=new Set;function cu(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 Ki=ce.d;ce.d={f:pj,r:gj,D:mj,C:yj,L:vj,m:bj,X:Sj,S:xj,M:wj};function pj(){var n=Ki.f(),r=Uf();return n||r}function gj(n){var r=mr(n);r!==null&&r.tag===5&&r.type==="form"?X2(r):Ki.r(n)}var Dl=typeof document>"u"?null:document;function QS(n,r,a){var c=Dl;if(c&&typeof r=="string"&&r){var p=Dn(r);p='link[rel="'+n+'"][href="'+p+'"]',typeof a=="string"&&(p+='[crossorigin="'+a+'"]'),GS.has(p)||(GS.add(p),n={rel:n,crossOrigin:a,href:r},c.querySelector(p)===null&&(r=c.createElement("link"),Er(r,"link",n),we(r),c.head.appendChild(r)))}}function mj(n){Ki.D(n),QS("dns-prefetch",n,null)}function yj(n,r){Ki.C(n,r),QS("preconnect",n,r)}function vj(n,r,a){Ki.L(n,r,a);var c=Dl;if(c&&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 v=p;switch(r){case"style":v=jl(n);break;case"script":v=Il(n)}if(!(Ms.has(v)||(n=D({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:n,as:r},a),Ms.set(v,n),c.querySelector(p)!==null||r==="style"&&c.querySelector(uu(v))||r==="script"&&c.querySelector(du(v))))){var k=c.createElement("link");Er(k,"link",n),r==="style"&&(k[_t]=!0,k.onload=k.onerror=function(){rt(k)}),we(k),c.head.appendChild(k)}}}function bj(n,r){Ki.m(n,r);var a=Dl;if(a&&n){var c=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Dn(c)+'"][href="'+Dn(n)+'"]',v=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Il(n)}if(!Ms.has(v)&&(n=D({rel:"modulepreload",href:n},r),Ms.set(v,n),a.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(du(v)))return}c=a.createElement("link"),Er(c,"link",n),we(c),a.head.appendChild(c)}}}function xj(n,r,a){Ki.S(n,r,a);var c=Dl;if(c&&n){var p=Ae(c).hoistableStyles,v=jl(n);r=r||"default";var k=p.get(v);if(!k){var P={loading:0,preload:null};if(k=c.querySelector(uu(v)))P.loading=5;else{n=D({rel:"stylesheet",href:n,"data-precedence":r},a),(a=Ms.get(v))&&F0(n,a);var J=k=c.createElement("link");we(J),Er(J,"link",n),J._p=new Promise(function(le,me){J.onload=le,J.onerror=me}),J.addEventListener("load",function(){P.loading|=1}),J.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Yf(k,r,c)}k={type:"stylesheet",instance:k,count:1,state:P},p.set(v,k)}}}function Sj(n,r){Ki.X(n,r);var a=Dl;if(a&&n){var c=Ae(a).hoistableScripts,p=Il(n),v=c.get(p);v||(v=a.querySelector(du(p)),v||(n=D({src:n,async:!0},r),(r=Ms.get(p))&&B0(n,r),v=a.createElement("script"),we(v),Er(v,"link",n),a.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function wj(n,r){Ki.M(n,r);var a=Dl;if(a&&n){var c=Ae(a).hoistableScripts,p=Il(n),v=c.get(p);v||(v=a.querySelector(du(p)),v||(n=D({src:n,async:!0,type:"module"},r),(r=Ms.get(p))&&B0(n,r),v=a.createElement("script"),we(v),Er(v,"link",n),a.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function XS(n,r,a,c){var p=(p=xe.current)?cu(p):null;if(!p)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=jl(a.href),r=Ae(p).hoistableStyles,c=r.get(a),c||(c={type:"style",instance:null,count:0,state:null},r.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){n=jl(a.href);var v=Ae(p).hoistableStyles,k=v.get(n);if(k||(p=p.ownerDocument||p,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(n,k),(v=p.querySelector(uu(n)))?v._p||(k.instance=v,k.state.loading=5):(v=Ms.get(n),v||(v={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ms.set(n,v)),Ej(p,n,v,k.state))),r&&c===null)throw Error(i(528,""));return k}if(r&&c!==null)throw Error(i(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(a=Il(a),r=Ae(p).hoistableScripts,c=r.get(a),c||(c={type:"script",instance:null,count:0,state:null},r.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function jl(n){return'href="'+Dn(n)+'"'}function uu(n){return'link[rel="stylesheet"]['+n+"]"}function ZS(n){return D({},n,{"data-precedence":n.precedence,precedence:null})}function Ej(n,r,a,c){if(r=n.querySelector('link[rel="preload"][as="style"]['+r+"]")){if(r[_t]!==!0){c.loading=1;return}}else r=n.createElement("link"),r[_t]=!0,r.onload=r.onerror=rt.bind(null,r),Er(r,"link",a),we(r),n.head.appendChild(r);c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2})}function Il(n){return'[src="'+Dn(n)+'"]'}function du(n){return"script[async]"+n}function JS(n,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var c=n.querySelector('style[data-href~="'+Dn(a.href)+'"]');if(c)return r.instance=c,we(c),c;var p=D({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),we(c),Er(c,"style",p),Yf(c,a.precedence,n),r.instance=c;case"stylesheet":p=jl(a.href);var v=n.querySelector(uu(p));if(v)return r.state.loading|=4,r.instance=v,we(v),v;c=ZS(a),(p=Ms.get(p))&&F0(c,p),v=(n.ownerDocument||n).createElement("link"),we(v);var k=v;return k._p=new Promise(function(P,J){k.onload=P,k.onerror=J}),Er(v,"link",c),r.state.loading|=4,Yf(v,a.precedence,n),r.instance=v;case"script":return v=Il(a.src),(p=n.querySelector(du(v)))?(r.instance=p,we(p),p):(c=a,(p=Ms.get(v))&&(c=D({},a),B0(c,p)),n=n.ownerDocument||n,p=n.createElement("script"),we(p),Er(p,"link",c),n.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,Yf(c,a.precedence,n));return r.instance}function Yf(n,r,a){for(var c=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,v=p,k=0;k<c.length;k++){var P=c[k];if(P.dataset.precedence===r)v=P;else if(v!==p)break}v?v.parentNode.insertBefore(n,v.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(n,r.firstChild))}function F0(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function B0(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var $f=null;function WS(n,r,a){if($f===null){var c=new Map,p=$f=new Map;p.set(a,c)}else p=$f,c=p.get(a),c||(c=new Map,p.set(a,c));if(c.has(n))return c;for(c.set(n,null),a=a.getElementsByTagName(n),p=0;p<a.length;p++){var v=a[p];if(!(v[Ss]||v[hn]||n==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var k=v.getAttribute(r)||"";k=n+k;var P=c.get(k);P?P.push(v):c.set(k,[v])}}return c}function V0(n,r,a){n=n.ownerDocument||n,n.head.insertBefore(a,r==="title"?n.querySelector("head > title"):null)}function Rj(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 ew(n,r){return n==="img"&&r.src!=null&&r.src!==""&&r.onLoad==null&&r.loading!=="lazy"}function tw(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function nw(n){return(n.width||100)*(n.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function rw(n,r){typeof r.decode=="function"&&(n.imgCount++,r.complete||(n.imgBytes+=nw(r),n.suspenseyImages.push(r)),n=kj.bind(n),r.decode().then(n,n))}function Cj(n,r,a,c){if(a.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var p=jl(c.href),v=r.querySelector(uu(p));if(v){r=v._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=fu.bind(n),r.then(n,n)),a.state.loading|=4,a.instance=v,we(v);return}v=r.ownerDocument||r,c=ZS(c),(p=Ms.get(p))&&F0(c,p),v=v.createElement("link"),we(v);var k=v;k._p=new Promise(function(P,J){k.onload=P,k.onerror=J}),Er(v,"link",c),a.instance=v}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(n.count++,a=fu.bind(n),r.addEventListener("load",a),r.addEventListener("error",a))}}var Gf=0;function Tj(n,r){return n.stylesheets&&n.count===0&&Xf(n,n.stylesheets),0<n.count||0<n.imgCount?function(a){var c=setTimeout(function(){if(n.stylesheets&&Xf(n,n.stylesheets),n.unsuspend){var v=n.unsuspend;n.unsuspend=null,v()}},6e4+r);0<n.imgBytes&&Gf===0&&(Gf=62500*KD());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Xf(n,n.stylesheets),n.unsuspend)){var v=n.unsuspend;n.unsuspend=null,v()}},(n.imgBytes>Gf?50:800)+r);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function sw(n){if(n.count===0&&(n.imgCount===0||!n.waitingForImages)){if(n.stylesheets)Xf(n,n.stylesheets);else if(n.unsuspend){var r=n.unsuspend;n.unsuspend=null,r()}}}function fu(){this.count--,sw(this)}function kj(){this.imgCount--,sw(this)}var Qf=null;function Xf(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Qf=new Map,r.forEach(Oj,n),Qf=null,fu.call(n))}function Oj(n,r){if(!(r.state.loading&4)){var a=Qf.get(n);if(a)var c=a.get(null);else{a=new Map,Qf.set(n,a);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var k=p[v];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(a.set(k.dataset.precedence,k),c=k)}c&&a.set(null,c)}p=r.instance,k=p.getAttribute("data-precedence"),v=a.get(k)||c,v===c&&a.set(null,p),a.set(k,p),this.count++,c=fu.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),v?v.parentNode.insertBefore(p,v.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),r.state.loading|=4}}var Pl={$$typeof:U,Provider:null,Consumer:null,_currentValue:Re,_currentValue2:Re,_threadCount:0};function Aj(n,r,a,c,p,v,k,P,J){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=Rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rt(0),this.hiddenUpdates=Rt(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.transitionTypes=null,this.incompleteTransitions=new Map}function iw(n,r,a,c,p,v,k,P,J,le,me,Te){return n=new Aj(n,r,a,k,J,le,me,Te,P),r=1,v===!0&&(r|=24),v=$r(3,null,null,r),n.current=v,v.stateNode=n,r=sm(),r.refCount++,n.pooledCache=r,r.refCount++,v.memoizedState={element:c,isDehydrated:a,cache:r},lm(v),n}function aw(n){return n?(n=ol,n):ol}function ow(n,r,a,c,p,v){p=aw(p),c.context===null?c.context=p:c.pendingContext=p,c=ma(r),c.payload={element:a},v=v===void 0?null:v,v!==null&&(c.callback=v),a=ya(n,c,r),a!==null&&(Zr(a,n,r),Vc(a,n,r))}function lw(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var a=n.retryLane;n.retryLane=a!==0&&a<r?a:r}}function K0(n,r){lw(n,r),(n=n.alternate)&&lw(n,r)}function cw(n){if(n.tag===13||n.tag===31){var r=fo(n,67108864);r!==null&&Zr(r,n,67108864),K0(n,67108864)}}function uw(n){if(n.tag===13||n.tag===31){var r=ps();r=Vt(r);var a=fo(n,r);a!==null&&Zr(a,n,r),K0(n,r)}}var Ll=!0;function Mj(n,r,a,c){var p=fe.T;fe.T=null;var v=ce.p;try{ce.p=2,q0(n,r,a,c)}finally{ce.p=v,fe.T=p}}function Nj(n,r,a,c){var p=fe.T;fe.T=null;var v=ce.p;try{ce.p=8,q0(n,r,a,c)}finally{ce.p=v,fe.T=p}}function q0(n,r,a,c){if(Ll){var p=Y0(c);if(p===null)T0(n,r,c,Zf,a),fw(n,c);else if(jj(p,n,r,a,c))c.stopPropagation();else if(fw(n,c),r&4&&-1<Dj.indexOf(n)){for(;p!==null;){var v=mr(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var k=qe(v.pendingLanes);if(k!==0){var P=v;for(P.pendingLanes|=2,P.entangledLanes|=2;k;){var J=1<<31-tt(k);P.entanglements[1]|=J,k&=~J}mi(v),(un&6)===0&&(Lf=Et()+500,iu(0))}}break;case 31:case 13:P=fo(v,2),P!==null&&Zr(P,v,2),Uf(),K0(v,2)}if(v=Y0(c),v===null&&T0(n,r,c,Zf,a),v===p)break;p=v}p!==null&&c.stopPropagation()}else T0(n,r,c,null,a)}}function Y0(n){return n=ao(n),$0(n)}var Zf=null;function $0(n){if(Zf=null,n=Bn(n),n!==null){var r=l(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 Zf=n,null}function dw(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 pt:return 2;case St:return 8;case yt:case Ht:return 32;case dn:return 268435456;default:return 32}default:return 32}}var G0=!1,Aa=null,Ma=null,Na=null,hu=new Map,pu=new Map,Da=[],Dj="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 fw(n,r){switch(n){case"focusin":case"focusout":Aa=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":hu.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":pu.delete(r.pointerId)}}function gu(n,r,a,c,p,v){return n===null||n.nativeEvent!==v?(n={blockedOn:r,domEventName:a,eventSystemFlags:c,nativeEvent:v,targetContainers:[p]},r!==null&&(r=mr(r),r!==null&&cw(r)),n):(n.eventSystemFlags|=c,r=n.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),n)}function jj(n,r,a,c,p){switch(r){case"focusin":return Aa=gu(Aa,n,r,a,c,p),!0;case"dragenter":return Ma=gu(Ma,n,r,a,c,p),!0;case"mouseover":return Na=gu(Na,n,r,a,c,p),!0;case"pointerover":var v=p.pointerId;return hu.set(v,gu(hu.get(v)||null,n,r,a,c,p)),!0;case"gotpointercapture":return v=p.pointerId,pu.set(v,gu(pu.get(v)||null,n,r,a,c,p)),!0}return!1}function hw(n){var r=Bn(n.target);if(r!==null){var a=l(r);if(a!==null){if(r=a.tag,r===13){if(r=u(a),r!==null){n.blockedOn=r,rs(n.priority,function(){uw(a)});return}}else if(r===31){if(r=d(a),r!==null){n.blockedOn=r,rs(n.priority,function(){uw(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 Jf(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var a=Y0(n.nativeEvent);if(a===null){a=n.nativeEvent;var c=new a.constructor(a.type,a);io=c,a.target.dispatchEvent(c),io=null}else return r=mr(a),r!==null&&cw(r),n.blockedOn=a,!1;r.shift()}return!0}function pw(n,r,a){Jf(n)&&a.delete(r)}function Ij(){G0=!1,Aa!==null&&Jf(Aa)&&(Aa=null),Ma!==null&&Jf(Ma)&&(Ma=null),Na!==null&&Jf(Na)&&(Na=null),hu.forEach(pw),pu.forEach(pw)}function Wf(n,r){n.blockedOn===r&&(n.blockedOn=null,G0||(G0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Ij)))}var eh=null;function gw(n){eh!==n&&(eh=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){eh===n&&(eh=null);for(var r=0;r<n.length;r+=3){var a=n[r],c=n[r+1],p=n[r+2];if(typeof c!="function"){if($0(c||a)===null)continue;break}var v=mr(a);v!==null&&(n.splice(r,3),r-=3,Am(v,{pending:!0,data:p,method:a.method,action:c},c,p))}}))}function zl(n){function r(J){return Wf(J,n)}Aa!==null&&Wf(Aa,n),Ma!==null&&Wf(Ma,n),Na!==null&&Wf(Na,n),hu.forEach(r),pu.forEach(r);for(var a=0;a<Da.length;a++){var c=Da[a];c.blockedOn===n&&(c.blockedOn=null)}for(;0<Da.length&&(a=Da[0],a.blockedOn===null);)hw(a),a.blockedOn===null&&Da.shift();if(a=(n.ownerDocument||n).$$reactFormReplay,a!=null)for(c=0;c<a.length;c+=3){var p=a[c],v=a[c+1],k=p[An]||null;if(typeof v=="function")k||gw(a);else if(k){var P=null;if(v&&v.hasAttribute("formAction")){if(p=v,k=v[An]||null)P=k.formAction;else if($0(p)!==null)continue}else P=k.action;typeof P=="function"?a[c+1]=P:(a.splice(c,3),c-=3),gw(a)}}}function mw(){function n(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(k){return p=k})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),c||setTimeout(a,20)}function a(){if(!c&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function Q0(n){this._internalRoot=n}th.prototype.render=Q0.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(i(409));var a=r.current,c=ps();ow(a,c,n,r,null,null)},th.prototype.unmount=Q0.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;ow(n.current,2,null,n,null,null),Uf(),r[jn]=null}};function th(n){this._internalRoot=n}th.prototype.unstable_scheduleHydration=function(n){if(n){var r=Tn();n={blockedOn:null,target:n,priority:r};for(var a=0;a<Da.length&&r!==0&&r<Da[a].priority;a++);Da.splice(a,0,n),a===0&&hw(n)}};var yw=t.version;if(yw!=="19.3.1")throw Error(i(527,yw,"19.3.1"));ce.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=g(r),n=n!==null?m(n):null,n=n===null?null:n.stateNode,n};var Pj={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:fe,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nh.isDisabled&&nh.supportsFiber)try{Ie=nh.inject(Pj),_e=nh}catch{}}return yu.createRoot=function(n,r){if(!o(n))throw Error(i(299));var a=!1,c="",p=a1,v=o1,k=l1;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(v=r.onCaughtError),r.onRecoverableError!==void 0&&(k=r.onRecoverableError)),r=iw(n,1,!1,null,null,a,c,null,p,v,k,mw),n[jn]=r.current,C0(n),new Q0(r)},yu.hydrateRoot=function(n,r,a){if(!o(n))throw Error(i(299));var c=!1,p="",v=a1,k=o1,P=l1,J=null;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onUncaughtError!==void 0&&(v=a.onUncaughtError),a.onCaughtError!==void 0&&(k=a.onCaughtError),a.onRecoverableError!==void 0&&(P=a.onRecoverableError),a.formState!==void 0&&(J=a.formState)),r=iw(n,1,!0,r,a??null,c,p,J,v,k,P,mw),r.context=aw(null),a=r.current,c=ps(),c=Vt(c),p=ma(c),p.callback=null,ya(a,p,c),a=c,r.current.lanes=a,ft(r,a),mi(r),n[jn]=r.current,C0(n),new th(r)},yu.version="19.3.1",yu}var kw;function qj(){if(kw)return J0.exports;kw=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(),J0.exports=Kj(),J0.exports}var Yj=qj();const Ow={};function rr(e,t){const s=b.useRef(Ow);return s.current===Ow&&(s.current=e(t)),s}const Ly=[];let zy;function $j(){return zy}function Gj(e){Ly.push(e)}function td(e){const t=(s,i)=>{const o=rr(Qj).current;let l;try{zy=o;for(const u of Ly)u.before(o);l=e(s,i);for(const u of Ly)u.after(o);o.didInitialize=!0}finally{zy=void 0}return l};return t.displayName=e.displayName||e.name,t}function Rp(e){return b.forwardRef(td(e))}function Qj(){return{didInitialize:!1}}function En(){}const Ls=Object.freeze([]),Xt=Object.freeze({}),Xj=()=>{},Pe=typeof document<"u"?b.useLayoutEffect:Xj;function Zj(e,t){return function(i,...o){const l=new URL(e);return l.searchParams.set("code",i.toString()),o.forEach(u=>l.searchParams.append("args[]",u)),`${t} error #${i}; visit ${l} for the full message.`}}const cn=Zj("https://base-ui.com/production-error","Base UI"),uC=b.createContext(void 0);function nd(e){const t=b.useContext(uC);if(t===void 0&&!e)throw new Error(cn(72));return t}function Av(e){b.useEffect(e,Ls)}const vu=0;class zs{static create(){return new zs}currentId=vu;start(t,s){this.clear(),this.currentId=setTimeout(()=>{this.currentId=vu,s()},t)}isStarted(){return this.currentId!==vu}clear=()=>{this.currentId!==vu&&(clearTimeout(this.currentId),this.currentId=vu)};disposeEffect=()=>this.clear}function Hn(){const e=rr(zs.create).current;return Av(e.disposeEffect),e}function Jj(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Wj,platform:e4,maxTouchPoints:t4}=Jj(),Cp=Wj.toLowerCase(),Hu=e4.toLowerCase(),Tp=/^i(os$|p)/.test(Hu)||Hu==="macintel"&&t4>1,Aw="android",_y=Hu===Aw||Cp.includes(Aw),Mv=!Tp&&Hu.startsWith("mac");Hu.startsWith("win");const n4=Mv||Tp,Ti=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Ti&&Cp.includes("firefox");!Ti&&Cp.includes("chrom");const r4=n4,Nv=/jsdom|happydom/.test(Cp);function Qs(e){e.preventDefault(),e.stopPropagation()}function s4(e){return"nativeEvent"in e}function ac(e){return e.pointerType===""&&e.isTrusted?!0:_y&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Dv(e){return Nv?!1:!_y&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(_y||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Ha(e,t){const s=["mouse","pen"];return t||s.push("",void 0),s.includes(e)}function i4(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function kp(){return typeof window<"u"}function Tr(e){return jv(e)?(e.nodeName||"").toLowerCase():"#document"}function Rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function na(e){var t;return(t=(jv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jv(e){return kp()?e instanceof Node||e instanceof Rn(e).Node:!1}function ln(e){return kp()?e instanceof Element||e instanceof Rn(e).Element:!1}function bn(e){return kp()?e instanceof HTMLElement||e instanceof Rn(e).HTMLElement:!1}function Ho(e){return!kp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rn(e).ShadowRoot}function rd(e){const{overflow:t,overflowX:s,overflowY:i,display:o}=vs(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+s)&&o!=="inline"&&o!=="contents"}function a4(e){return/^(table|td|th)$/.test(Tr(e))}function Op(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const o4=/transform|translate|scale|rotate|perspective|filter/,l4=/paint|layout|strict|content/,Mo=e=>!!e&&e!=="none";let ny;function Iv(e){const t=ln(e)?vs(e):e;return Mo(t.transform)||Mo(t.translate)||Mo(t.scale)||Mo(t.rotate)||Mo(t.perspective)||!Pv()&&(Mo(t.backdropFilter)||Mo(t.filter))||o4.test(t.willChange||"")||l4.test(t.contain||"")}function c4(e){let t=Wi(e);for(;bn(t)&&!Xi(t);){if(Iv(t))return t;if(Op(t))return null;t=Wi(t)}return null}function Pv(){return ny==null&&(ny=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ny}function Xi(e){return/^(html|body|#document)$/.test(Tr(e))}function vs(e){return Rn(e).getComputedStyle(e)}function Ap(e){return ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wi(e){if(Tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ho(e)&&e.host||na(e);return Ho(t)?t.host:t}function dC(e){const t=Wi(e);return Xi(t)?(e.ownerDocument||e).body:bn(t)&&rd(t)?t:dC(t)}function Fu(e,t,s){var i;t===void 0&&(t=[]),s===void 0&&(s=!0);const o=dC(e),l=o===((i=e.ownerDocument)==null?void 0:i.body),u=Rn(o);if(l){const d=Uy(u);return t.concat(u,u.visualViewport||[],rd(o)?o:[],d&&s?Fu(d):[])}else return t.concat(o,Fu(o,[],s))}function Uy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vr(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function st(e,t){if(!e||!t)return!1;const s=t.getRootNode?.();if(e.contains(t))return!0;if(s&&Ho(s)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function Bu(e,t){let s=e;for(;s;){if(ln(s)&&s.matches(t))return s;s=s.assignedSlot??s.parentNode??(Ho(s)?s.host:null)}return null}function sr(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const Hy="data-base-ui-focusable",fC="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Mp="ArrowLeft",Np="ArrowRight",hC="ArrowUp",Lv="ArrowDown",zv="data-starting-style",u4="data-ending-style",d4={[zv]:""},f4={[u4]:""},ni={transitionStatus(e){return e==="starting"?d4:e==="ending"?f4:null}},h4="data-open",p4="data-closed",g4="data-anchor-hidden",pC="data-popup-open",m4="data-pressed",y4={[pC]:""},v4={[pC]:"",[m4]:""},b4={[h4]:""},x4={[p4]:""},S4={[g4]:""},Dp={open(e){return e?y4:null}},Vu={open(e){return e?v4:null}},sd={open(e){return e?b4:x4},anchorHidden(e){return e?S4:null}},jp={...sd,...ni},Fy="data-trigger-disabled";function $h(e,t){if(!ln(e))return!1;const s=e;if(t.hasElement(s))return!s.hasAttribute(Fy);for(const[,i]of t.entries())if(st(i,s))return!i.hasAttribute(Fy);return!1}function ry(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const s=e;return s.target!=null&&t.contains(s.target)}function w4(e){return e.matches("html,body")}function id(e){return bn(e)&&e.matches(fC)}function E4(e){return Bu(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${fC}`)!=null}function By(e){return e?e.getAttribute("role")==="combobox"&&id(e):!1}function R4(e){if(!e||Nv)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Gh(e){return e?e.hasAttribute(Hy)?e:e.querySelector(`[${Hy}]`)||e:null}function C4(e,t){return t!=null&&!Ha(t)?0:typeof e=="function"?e():e}function Fo(e,t,s){const i=C4(e,s);return typeof i=="number"?i:i?.[t]}function Mw(e){return typeof e=="function"?e():e}function gC(e,t){return t||e==="click"||e==="mousedown"}function T4(e){return e?.includes("mouse")&&e!=="mousedown"}function lt(e,t,s,i){let o=!1,l=!1;const u=i??Xt;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){l=!0},get isCanceled(){return o},get isPropagationAllowed(){return l},trigger:s,...u}}function k4(e,t,s){const i=s??Xt;return{reason:e,event:t??new Event("base-ui"),...i}}const kr="none",Zs="trigger-press",qn="trigger-hover",$l="trigger-focus",Ip="outside-press",zo="item-press",mC="close-press",Ba="focus-out",ad="escape-key",Qh="list-navigation",yC="keyboard",O4="pointer",_v="cancel-open",Ru="sibling-open",vC="disabled",Nw="missing",Dw="initial",od="imperative-action",A4="window-resize",bC=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new zs,currentIdRef:{current:null},currentContextRef:{current:null}});function M4(e,t){e.current=t.current}function N4(e){const{children:t,delay:s,timeoutMs:i=0}=e,o=b.useRef(s),l=b.useRef(s),u=b.useRef(null),d=b.useRef(null),f=Hn();return Pe(()=>{if(l.current=s,!u.current){o.current=s;return}o.current={open:Fo(o.current,"open"),close:Fo(s,"close")}},[s,u,o,l]),y.jsx(bC.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:o,initialDelayRef:l,currentIdRef:u,timeoutMs:i,currentContextRef:d,timeout:f}),[i,f]),children:t})}function D4(e,t={open:!1}){const{open:s}=t,i=e.useState("floatingId"),o=b.useContext(bC),{currentIdRef:l,delayRef:u,timeoutMs:d,initialDelayRef:f,currentContextRef:g,hasProvider:m,timeout:h}=o,[x,S]=b.useState(!1),w=b.useRef(s);return Pe(()=>{w.current=s},[s]),Pe(()=>{function C(){g.current?.setIsInstantPhase(!1),l.current=null,g.current=null,u.current=f.current,h.clear()}if(l.current&&!s&&l.current===i){if(S(!1),d){const E=i;return h.start(d,()=>{e.select("open")||l.current&&l.current!==E||C()}),()=>{(w.current||l.current!==E)&&h.clear()}}C()}},[s,i,l,u,d,f,g,h,e]),Pe(()=>{if(!s)return;const C=g.current,E=l.current;h.clear(),g.current={onOpenChange:e.setOpen,setIsInstantPhase:S},l.current=i,u.current={open:0,close:Fo(f.current,"close")},E!==null&&E!==i?(S(!0),C?.setIsInstantPhase(!0),C?.onOpenChange(!1,lt(kr))):(S(!1),C?.setIsInstantPhase(!1))},[s,i,e,l,u,f,g,h]),Pe(()=>()=>{if(l.current===i){if(g.current=null,!w.current)return;l.current=null,M4(u,f),h.clear()}},[g,l,u,i,f,h]),b.useMemo(()=>({activeIdRef:l,hasProvider:m,delayRef:u,isInstantPhase:x}),[l,m,u,x])}function zt(e,t,s,i){return e.addEventListener(t,s,i),()=>{e.removeEventListener(t,s,i)}}function Ei(...e){return()=>{for(let t=0;t<e.length;t+=1){const s=e[t];s&&s()}}}function es(e,t,s,i){const o=rr(xC).current;return I4(o,e,t,s,i)&&SC(o,[e,t,s,i]),o.callback}function j4(e){const t=rr(xC).current;return P4(t,e)&&SC(t,e),t.callback}function xC(){return{callback:null,cleanup:null,refs:[]}}function I4(e,t,s,i,o){return e.refs[0]!==t||e.refs[1]!==s||e.refs[2]!==i||e.refs[3]!==o}function P4(e,t){return e.refs.length!==t.length||e.refs.some((s,i)=>s!==t[i])}function SC(e,t){if(e.refs=t,t.every(s=>s==null)){e.callback=null;return}e.callback=s=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),s!=null){const i=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const l=t[o];if(l!=null)switch(typeof l){case"function":{const u=l(s);typeof u=="function"&&(i[o]=u);break}case"object":{l.current=s;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const l=t[o];if(l!=null)switch(typeof l){case"function":{const u=i[o];typeof u=="function"?u():l(null);break}case"object":{l.current=null;break}}}}}}}function Ln(e){const t=rr(L4,e).current;return t.next=e,Pe(t.effect),t}function L4(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Uv={...lC},sy=Uv.useInsertionEffect,z4=sy&&sy!==Uv.useLayoutEffect?sy:e=>e();function Be(e){const t=rr(_4).current;return t.next=e,z4(t.effect),t.trampoline}function _4(){const e={next:void 0,callback:U4,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function U4(){}const rh=null;class H4{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const s=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let o=0;o<s.length;o+=1)s[o]?.(t)};request(t){const s=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),s}cancel(t){const s=t-this.startId;s<0||s>=this.callbacks.length||this.callbacks[s]!==null&&(this.callbacks[s]=null,this.callbacksCount-=1)}}let sh=new H4;class jr{static create(){return new jr}static request(t){return sh.request(t)}static cancel(t){return sh.cancel(t)}currentId=rh;request(t){this.cancel(),this.currentId=sh.request(()=>{this.currentId=rh,t()})}cancel=()=>{this.currentId!==rh&&(sh.cancel(this.currentId),this.currentId=rh)};disposeEffect=()=>this.cancel}function oc(){const e=rr(jr.create).current;return Av(e.disposeEffect),e}function qt(e){return e?.ownerDocument||document}const wC={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ld={...wC,position:"fixed",margin:0,top:0,left:0},Pp={...wC,position:"absolute"},Va=b.forwardRef(function(t,s){const[i,o]=b.useState();Pe(()=>{r4&&Ti&&o("button")},[]);const l={tabIndex:0,role:i};return y.jsx("span",{...t,ref:s,style:ld,"aria-hidden":i?void 0:!0,...l,"data-base-ui-focus-guard":""})}),lc=Math.min,Zi=Math.max,Xh=Math.round,ih=Math.floor,Ji=e=>({x:e,y:e}),F4={left:"right",right:"left",bottom:"top",top:"bottom"};function EC(e,t,s){return Zi(e,lc(t,s))}function Ka(e,t){return typeof e=="function"?e(t):e}function ys(e){return e.split("-")[0]}function Ri(e){return e.split("-")[1]}function Hv(e){return e==="x"?"y":"x"}function Fv(e){return e==="y"?"height":"width"}function Is(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Bv(e){return Hv(Is(e))}function B4(e,t,s){s===void 0&&(s=!1);const i=Ri(e),o=Bv(e),l=Fv(o);let u=o==="x"?i===(s?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=Zh(u)),[u,Zh(u)]}function V4(e){const t=Zh(e);return[Vy(e),t,Vy(t)]}function Vy(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jw=["left","right"],Iw=["right","left"],K4=["top","bottom"],q4=["bottom","top"];function Y4(e,t,s){switch(e){case"top":case"bottom":return s?t?Iw:jw:t?jw:Iw;case"left":case"right":return t?K4:q4;default:return[]}}function $4(e,t,s,i){const o=Ri(e);let l=Y4(ys(e),s==="start",i);return o&&(l=l.map(u=>u+"-"+o),t&&(l=l.concat(l.map(Vy)))),l}function Zh(e){const t=ys(e);return F4[t]+e.slice(t.length)}function G4(e){var t,s,i,o;return{top:(t=e.top)!=null?t:0,right:(s=e.right)!=null?s:0,bottom:(i=e.bottom)!=null?i:0,left:(o=e.left)!=null?o:0}}function RC(e){return typeof e!="number"?G4(e):{top:e,right:e,bottom:e,left:e}}function Ku(e){const{x:t,y:s,width:i,height:o}=e;return{width:i,height:o,top:s,left:t,right:t+i,bottom:s+o,x:t,y:s}}function Gl(e,t){return t<0||t>=e.length}function Nh(e,t){return Ql(e.current,{disabledIndices:t})}function Ky(e,t){return Ql(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Q4(e,t,s){const{decrement:i,loopFocus:o,allowEscape:l,disabledIndices:u,minIndex:d,maxIndex:f}=s,g=()=>Ql(e,{startingIndex:t,decrement:i,disabledIndices:u});let m,h=!1;if(!o)m=i?Math.max(d,g()):Math.min(f,g());else if(i?t<=d:t>=f){const x=i?-1:e.length;l&&t!==x?m=-1:(m=i?f:d,h=!0)}else m=g();return{index:Gl(e,m)?-1:m,wrapped:h}}function Ql(e,{startingIndex:t=-1,decrement:s=!1,disabledIndices:i,amount:o=1}={}){let l=t;do l+=s?-o:o;while(l>=0&&l<=e.length-1&&Xl(e,l,i));return l}function Xl(e,t,s){if(typeof s=="function"?s(t):s?.includes(t)??!1)return!0;const o=e[t];return o?!Lp(o)||o.matches(":disabled")?!0:!s&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function X4(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Lp(e,t=e?vs(e):null){return!e||!e.isConnected||!t||X4(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Z4='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function J4(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const s=e.getRootNode();return Ho(s)?s.host:null}function qy(e){for(const t of Array.from(e.children))if(Tr(t)==="summary")return t;return null}function W4(e,t){const s=qy(t);return!!s&&(e===s||st(s,e))}function CC(e){const t=e?Tr(e):"";return e!=null&&e.matches(Z4)&&(t!=="summary"||e.parentElement!=null&&Tr(e.parentElement)==="details"&&qy(e.parentElement)===e)&&(t!=="details"||qy(e)==null)&&(t!=="input"||e.type!=="hidden")}function Vv(e){if(!CC(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=J4(t)){const s=t!==e,i=Tr(t)==="slot";if(t.hasAttribute("inert")||s&&Tr(t)==="details"&&!t.open&&!W4(e,t)||t.hasAttribute("hidden")||!i&&!eI(t,s))return!1}return!0}function eI(e,t){const s=vs(e);return t?s.display!=="none":Lp(e,s)}function TC(e){const t=e.tabIndex;if(t<0){const s=Tr(e);if(s==="details"||s==="audio"||s==="video"||bn(e)&&e.isContentEditable)return 0}return t}function iy(e){if(Tr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function kC(e,t){const s=iy(e);if(!s)return!0;const i=t.find(o=>{const l=iy(o);return l?.name===s.name&&l.form===s.form&&l.checked});return i?i===s:t.find(o=>{const l=iy(o);return l?.name===s.name&&l.form===s.form})===s}function OC(e){if(bn(e)&&Tr(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 Kv(e,t){OC(e).forEach(s=>{CC(s)&&t.push(s),Kv(s,t)})}function AC(e,t,s){OC(e).forEach(i=>{bn(i)&&i.matches(t)&&s.push(i),AC(i,t,s)})}function zp(e){return Vv(e)&&TC(e)>=0}function MC(e){const t=[];return Kv(e,t),t.filter(Vv)}function _p(e){const t=MC(e);return t.filter(s=>TC(s)>=0&&kC(s,t))}function NC(e,t){const s=_p(e),i=s.length;if(i===0)return;const o=Vr(qt(e)),l=s.indexOf(o),u=l===-1?t===1?0:i-1:l+t;return s[u]}function DC(e){return NC(qt(e).body,1)||e}function jC(e){return NC(qt(e).body,-1)||e}function tI(e,t,s){if(!e)return null;const i=[];Kv(qt(e).body,i);const o=i.indexOf(e);if(o===-1)return null;const l=i.filter(Vv);for(let u=1;u<i.length;u+=1){const d=i[(o+t*u+i.length)%i.length];if(!st(s,d)&&zp(d)&&kC(d,l))return d}return i[o]}function Zl(e,t){const s=t||e.currentTarget,i=e.relatedTarget;return!i||!st(s,i)}function nI(e){_p(e).forEach(s=>{s.dataset.tabindex=s.getAttribute("tabindex")||"",s.setAttribute("tabindex","-1")})}function Pw(e){const t=[];AC(e,"[data-tabindex]",t),t.forEach(s=>{const i=s.dataset.tabindex;delete s.dataset.tabindex,i?s.setAttribute("tabindex",i):s.removeAttribute("tabindex")})}function qa(e,t,s=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!s||o.context?.open?[o]:[],...qa(e,o.id,s)])}function Lw(e,t){let s=[],i=e.find(o=>o.id===t)?.parentId;for(;i;){const o=e.find(l=>l.id===i);i=o?.parentId,o&&(s=s.concat(o))}return s}function Jl(e){return`data-base-ui-${e}`}let ah=0;function Dh(e,t={}){const{preventScroll:s=!1,sync:i=!1,shouldFocus:o}=t;cancelAnimationFrame(ah);function l(){o&&!o()||e?.focus({preventScroll:s})}if(i)return l(),En;const u=requestAnimationFrame(l);return ah=u,()=>{ah===u&&(cancelAnimationFrame(u),ah=0)}}const zw="data-base-ui-inert";let bu=new WeakMap,oh=new WeakSet,xu=new WeakMap,ay=0;function IC(e){return e?Ho(e)?e.host:IC(e.parentNode):null}const _w=(e,t)=>t.map(s=>{if(e.contains(s))return s;const i=IC(s);return e.contains(i)?i:null}).filter(s=>s!=null),Uw=e=>{const t=new Set;return e.forEach(s=>{let i=s;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},Hw=(e,t,s)=>{const i=[],o=l=>{!l||s.has(l)||Array.from(l.children).forEach(u=>{Tr(u)!=="script"&&(t.has(u)?o(u):i.push(u))})};return o(e),i};function rI(e,t,s,{mark:i=!0}){const o=_w(t,e),l=i?Hw(t,Uw(o),new Set(o)):[],u=[],d=[];if(s){const f=_w(t,Array.from(t.querySelectorAll("[aria-live]"))),g=o.concat(f);Hw(t,Uw(g),new Set(g)).forEach(h=>{const x=h.getAttribute("aria-hidden"),S=x!==null&&x!=="false",w=(bu.get(h)||0)+1;bu.set(h,w),u.push(h),w===1&&S&&oh.add(h),S||h.setAttribute("aria-hidden","true")})}return i&&l.forEach(f=>{const g=(xu.get(f)||0)+1;xu.set(f,g),d.push(f),g===1&&f.setAttribute(zw,"")}),ay+=1,()=>{u.forEach(f=>{const g=(bu.get(f)||0)-1;bu.set(f,g),g||(oh.has(f)||f.removeAttribute("aria-hidden"),oh.delete(f))}),i&&d.forEach(f=>{const g=(xu.get(f)||0)-1;xu.set(f,g),g||f.removeAttribute(zw)}),ay-=1,ay||(bu=new WeakMap,oh=new WeakSet,xu=new WeakMap)}}function Fw(e,t={}){const{ariaHidden:s=!1,mark:i=!0}=t,o=qt(e[0]).body;return rI(e,o,s,{mark:i})}var hr=cC();const sI=oC(hr);function PC(){const[,e]=b.useState({});return b.useCallback(()=>{e({})},[])}let Bw=0;function iI(e,t="mui"){const s=b.useRef(void 0),i=PC(),o=e??s.current;return b.useEffect(()=>{s.current==null&&(Bw+=1,s.current=`${t}-${Bw}`,e==null&&i())},[e,t,i]),o}const Vw=Uv.useId;function hc(e,t){if(Vw!==void 0){const s=Vw();return e??(t?`${t}-${s}`:s)}return iI(e,t)}const aI=parseInt(b.version,10);function qv(e){return aI>=e}function Kw(e){if(!b.isValidElement(e))return null;const t=e,s=t.props;return(qv(19)?s?.ref:t.ref)??null}function Yy(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function oI(e,t){const s={};for(const i in e){const o=e[i];if(t?.hasOwnProperty(i)){const l=t[i](o);l!=null&&Object.assign(s,l);continue}o===!0?s[`data-${i.toLowerCase()}`]="":o&&(s[`data-${i.toLowerCase()}`]=o.toString())}return s}function lI(e,t){return typeof e=="function"?e(t):e}function LC(e,t){return typeof e=="function"?e(t):e}const zC={};function Ir(e,t,s,i,o){if(!s&&!i&&!o&&!e)return Jh(t);let l=Jh(e);return t&&(l=Cu(l,t)),s&&(l=Cu(l,s)),i&&(l=Cu(l,i)),o&&(l=Cu(l,o)),l}function cI(e){if(e.length===0)return zC;if(e.length===1)return Jh(e[0]);let t=Jh(e[0]);for(let s=1;s<e.length;s+=1)t=Cu(t,e[s]);return t}function Jh(e){return UC(e)?{...e(zC)}:uI(e)}function Cu(e,t){return UC(t)?t(e):dI(e,t)}function uI(e){const t={...e};for(const s in t){const i=t[s];_C(s,i)&&(t[s]=HC(i))}return t}function dI(e,t){if(!t)return e;for(const s in t){const i=t[s];switch(s){case"style":{e[s]=Yy(e.style,i);break}case"className":{e[s]=FC(e.className,i);break}default:_C(s,i)?e[s]=fI(e[s],i):e[s]=i}}return e}function _C(e,t){const s=e.charCodeAt(0),i=e.charCodeAt(1),o=e.charCodeAt(2);return s===111&&i===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function UC(e){return typeof e=="function"}function fI(e,t){return t?e?(...s)=>{const i=s[0];if(BC(i)){const l=i;Wh(l);const u=t(...s);return l.baseUIHandlerPrevented||e?.(...s),u}const o=t(...s);return e?.(...s),o}:HC(t):e}function HC(e){return e&&((...t)=>{const s=t[0];return BC(s)&&Wh(s),e(...t)})}function Wh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function FC(e,t){return t?e?t+" "+e:t:e}function BC(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function bt(e,t,s={}){let i=t.render;s.enabled!==!1&&(i=Yv(i));const o=hI(t,s,i);if(s.enabled===!1)return null;const l=s.state??Xt;return mI(e,i,o,l)}function hI(e,t,s){const{className:i,style:o}=e,{state:l=Xt,ref:u,props:d,stateAttributesMapping:f,enabled:g=!0}=t,m=g?lI(i,l):void 0,h=g?LC(o,l):void 0,x=g?oI(l,f):Xt,S=g&&d?pI(d):void 0,w=g?Yy(x,S)??{}:Xt;return typeof document<"u"&&(g?Array.isArray(u)?w.ref=j4([w.ref,Kw(s),...u]):w.ref=es(w.ref,Kw(s),u):es(null,null)),g?(m!==void 0&&(w.className=FC(w.className,m)),h!==void 0&&(w.style=Yy(w.style,h)),w):Xt}function pI(e){return Array.isArray(e)?cI(e):Ir(void 0,e)}const gI=Symbol.for("react.lazy");function Yv(e){if(e?.$$typeof!==gI)return e;const t=b.Children.toArray(e)[0];return b.isValidElement(t)?t:e}function mI(e,t,s,i){if(t){if(typeof t=="function")return t(s,i);const o=Ir(s,t.props);return o.ref=s.ref,b.cloneElement(t,o)}return yI(e,s)}function yI(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 vI=500,VC=500,bI={style:{transition:"none"}},$v="data-base-ui-click-trigger",KC={fallbackAxisSide:"none"},Gv={fallbackAxisSide:"end"},xI={clipPath:"inset(50%)",position:"fixed",top:0,left:0},qC=b.createContext(null),YC=()=>b.useContext(qC),SI=Jl("portal");function $C(e={}){const{ref:t,container:s,componentProps:i=Xt,elementProps:o}=e,l=hc(),d=YC()?.portalNode,[f,g]=b.useState(null),[m,h]=b.useState(null),x=Be(E=>{E!==null&&h(E)}),S=b.useRef(null);Pe(()=>{if(s===null){S.current&&(S.current=null,h(null),g(null));return}const E=(s&&(jv(s)?s:s.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))},[s,d]);const w=bt("div",i,{ref:[t,x],props:[{id:l,[SI]:""},o]}),C=f&&w?hr.createPortal(w,f):null;return{node:m,nodeId:b.isValidElement(w)?w.props.id:void 0,subtree:C}}const Up=b.forwardRef(function(t,s){const{render:i,className:o,style:l,children:u,container:d,portalOwnerRole:f,...g}=t,{node:m,nodeId:h,subtree:x}=$C({container:d,ref:s,componentProps:t,elementProps:g}),S=b.useRef(null),w=b.useRef(null),C=b.useRef(null),E=b.useRef(null),[R,O]=b.useState(null),T=b.useRef(!1),A=R?.modal,N=R?.open,j=!!R&&!R.modal&&R.open&&!!m;b.useEffect(()=>{if(!m||A)return;function M(z){m&&z.relatedTarget&&Zl(z)&&(z.type==="focusin"?T.current&&(Pw(m),T.current=!1):(nI(m),T.current=!0))}return Ei(zt(m,"focusin",M,!0),zt(m,"focusout",M,!0))},[m,A]),Pe(()=>{!m||N!==!0||!T.current||(Pw(m),T.current=!1)},[N,m]);const D=b.useMemo(()=>({beforeOutsideRef:S,afterOutsideRef:w,beforeInsideRef:C,afterInsideRef:E,portalNode:m,setFocusManagerState:O}),[m]);return y.jsxs(b.Fragment,{children:[x,y.jsxs(qC.Provider,{value:D,children:[j&&m&&y.jsx(Va,{"data-type":"outside",ref:S,onFocus:M=>{if(Zl(M,m))C.current?.focus();else{const z=R?R.domReference:null;jC(z)?.focus()}}}),j&&m&&y.jsx("span",{role:f,"aria-owns":h,style:xI}),m&&hr.createPortal(u,m),j&&m&&y.jsx(Va,{"data-type":"outside",ref:w,onFocus:M=>{if(Zl(M,m))E.current?.focus();else{const z=R?R.domReference:null;DC(z)?.focus(),R?.closeOnFocusOut&&R?.onOpenChange(!1,lt(Ba,M.nativeEvent))}}})]})]})});function GC(){const e=new Map;return{emit(t,s){e.get(t)?.forEach(i=>i(s))},on(t,s){e.has(t)||e.set(t,new Set),e.get(t).add(s)},off(t,s){e.get(t)?.delete(s)}}}class Qv{nodesRef={current:[]};events=GC();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const s=this.nodesRef.current.findIndex(i=>i===t);s!==-1&&this.nodesRef.current.splice(s,1)}}const QC=b.createContext(null),XC=b.createContext(null),Xa=()=>b.useContext(QC)?.id||null,Za=e=>{const t=b.useContext(XC);return e??t};function Xv(e){const t=hc(),s=Za(e),i=Xa();return Pe(()=>{if(!t)return;const o={id:t,parentId:i};return s?.addNode(o),()=>{s?.removeNode(o)}},[s,t,i]),t}function ZC(e){const{children:t,id:s}=e,i=Xa();return y.jsx(QC.Provider,{value:b.useMemo(()=>({id:s,parentId:i}),[s,i]),children:t})}function JC(e){const{children:t,externalTree:s}=e,i=rr(()=>s??new Qv).current;return y.jsx(XC.Provider,{value:i,children:t})}function Yi(e){return e==null?e:"current"in e?e.current:e}function wI(e,t){const s=Rn(sr(e));return e instanceof s.KeyboardEvent?"keyboard":e instanceof s.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||(ac(e)?"keyboard":t||"mouse"):"touches"in e?"touch":e instanceof s.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const qw=20;let _a=[];function Zv(){_a=_a.filter(e=>e.deref()?.isConnected)}function Yw(e){Zv(),e&&Tr(e)!=="body"&&(_a.push(new WeakRef(e)),_a.length>qw&&(_a=_a.slice(-qw)))}function $w(){return Zv(),_a[_a.length-1]?.deref()}function EI(e){return e?zp(e)?e:_p(e)[0]||e:null}function Gw(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const s=MC(e).filter(o=>{const l=o.getAttribute("data-tabindex")||"";return zp(o)||o.hasAttribute("data-tabindex")&&!l.startsWith("-")}),i=e.getAttribute("tabindex");s.length===0?i!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Hp(e){const{context:t,children:s,disabled:i=!1,initialFocus:o=!0,returnFocus:l=!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"),O=t.useState("floatingElement"),{events:T,dataRef:A}=t.context,N=Be(()=>A.current.floatingContext?.nodeId),j=o===!1,D=By(R)&&j,M=Ln(o),z=Ln(l),L=Ln(u),K=Ln(m),X=Ln(E),B=Za(w),H=YC(),U=b.useRef(!1),_=b.useRef(!1),Q=b.useRef(!1),G=b.useRef(null),q=b.useRef(""),Y=b.useRef(""),ee=b.useRef(null),$=b.useRef(null),ae=es(ee,S,H?.beforeInsideRef),I=es($,H?.afterInsideRef),F=Hn(),Z=Hn(),ne=oc(),ye=H!=null,se=Gh(O),ge=Be((be=se)=>be?_p(be):[]),fe=Be(()=>C?.().filter(be=>be!=null)??[]);b.useEffect(()=>{if(i||!f)return;function be(Oe){Oe.key==="Tab"&&st(se,Vr(qt(se)))&&ge().length===0&&!D&&Qs(Oe)}const Le=qt(se);return zt(Le,"keydown",be)},[i,se,f,D,ge]),b.useEffect(()=>{if(i||!E)return;const be=qt(se);function Le(){Q.current=!1}function Oe(Ve){const ke=sr(Ve),Ue=fe(),xe=st(O,ke)||st(R,ke)||st(H?.portalNode,ke)||Ue.some(Fe=>Fe===ke||st(Fe,ke));Q.current=!xe,Y.current=Ve.pointerType||"keyboard",Bu(ke,`[${$v}]`)&&(_.current=!0,Z.start(0,()=>{_.current=!1}))}function ze(){Y.current="keyboard"}return Ei(zt(be,"pointerdown",Oe,!0),zt(be,"pointerup",Le,!0),zt(be,"pointercancel",Le,!0),zt(be,"keydown",ze,!0),Le)},[i,O,R,se,E,H,Z,fe]),b.useEffect(()=>{if(i||!g)return;const be=qt(se);function Le(){_.current=!0,Z.start(0,()=>{_.current=!1})}function Oe(Ue){const xe=sr(Ue);zp(xe)&&(G.current=xe)}function ze(Ue){const xe=Ue.relatedTarget,Fe=Ue.currentTarget,Je=sr(Ue);f&&xe==null&&Je!=null&&st(O,Je)&&Yw(Je),queueMicrotask(()=>{const ot=N(),de=t.context.triggerElements,Ee=fe(),$e=xe?.hasAttribute(Jl("focus-guard"))&&[ee.current,$.current,H?.beforeInsideRef.current,H?.afterInsideRef.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,Yi(x),Yi(h)].includes(xe),Me=!(st(R,xe)||st(O,xe)||st(xe,O)||st(H?.portalNode,xe)||Ee.some(De=>De===xe||st(De,xe))||de.hasMatchingElement(De=>st(De,xe))||$e||B&&(qa(B.nodesRef.current,ot).find(De=>st(De.context?.elements.floating,xe)||st(De.context?.elements.domReference,xe))||Lw(B.nodesRef.current,ot).find(De=>[De.context?.elements.floating,Gh(De.context?.elements.floating)].includes(xe)||De.context?.elements.domReference===xe)));if(Fe===R&&se&&Gw(se),d&&Fe!==R&&!Lp(Je)&&Vr(be)===be.body){if(bn(se)&&(se.focus(),d==="popup")){ne.request(()=>{se.focus()});return}const De=ge(),xt=G.current,dt=(xt&&De.includes(xt)?xt:null)||De[De.length-1]||se;bn(dt)&&dt.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(D||!f)&&xe&&Me&&!_.current&&(D||xe!==$w())&&(U.current=!0,t.setOpen(!1,lt(Ba,Ue)))})}function Ve(){Q.current||(A.current.insideReactTree=!0,F.start(0,()=>{A.current.insideReactTree=!1}))}const ke=bn(R)?R:null;if(!(!O&&!ke))return Ei(ke&&zt(ke,"focusout",ze),ke&&zt(ke,"pointerdown",Le),O&&zt(O,"focusin",Oe),O&&zt(O,"focusout",ze),O&&H&&zt(O,"focusout",Ve,!0))},[i,R,O,se,f,B,H,t,g,d,ge,D,N,A,F,Z,ne,h,x,fe]),b.useEffect(()=>{if(i||!O||!E)return;const be=Array.from(H?.portalNode?.querySelectorAll(`[${Jl("portal")}]`)||[]),Oe=(B?Lw(B.nodesRef.current,N()):[]).find(Fe=>By(Fe.context?.elements.domReference||null))?.context?.elements.domReference,Ve=[...[O,...be,ee.current,$.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,...fe()],Oe,Yi(x),Yi(h),D?R:null].filter(Fe=>Fe!=null),ke=Fw(Ve,{ariaHidden:f||D,mark:!1}),Ue=[O,...be].filter(Fe=>Fe!=null),xe=Fw(Ue);return()=>{xe(),ke()}},[E,i,R,O,f,H,D,B,N,h,x,fe]),Pe(()=>{if(!E||i||!bn(se))return;q.current="",Y.current="";const be=qt(se),Le=Vr(be);queueMicrotask(()=>{const Oe=M.current,ze=typeof Oe=="function"?Oe(K.current||""):Oe;if(ze===void 0||ze===!1||st(se,Le))return;let ke=null;const Ue=()=>(ke==null&&(ke=ge(se)),ke[0]||se);let xe;ze===!0||ze===null?xe=Ue():xe=Yi(ze),xe=xe||Ue();const Fe=st(se,Vr(be)),Je=A.current.openEvent,ot=Je?.type==="mousedown"&&ac(Je);Dh(xe,{sync:ot,preventScroll:xe===se,shouldFocus(){if(!X.current)return!1;if(Fe)return!0;const de=Vr(be);return!(de!==xe&&st(se,de))}})})},[i,E,se,ge,M,K,X,A]);const ce=b.useRef(null);Pe(()=>{if(i||!se){ce.current=null;return}ce.current&&(ce.current.cancelled=!0,ce.current=null);const be=qt(se),Le=Vr(be),Oe=K.current==null;Yw(Le);function ze(ke){if(ke.open||(q.current=wI(ke.nativeEvent,Y.current)),(ke.reason===Ba&&ke.triggerElement?.hasAttribute(Jl("focus-guard"))||ke.reason===qn&&ke.nativeEvent.type==="mouseleave")&&(U.current=!0),ke.reason===Ip)if(ke.nested)U.current=!1;else if(ac(ke.nativeEvent)||Dv(ke.nativeEvent))U.current=!1;else{let Ue=!1;qt(se).createElement("div").focus({get preventScroll(){return Ue=!0,!1}}),Ue?U.current=!1:U.current=!0}}T.on("openchange",ze);function Ve(ke){const Ue=z.current;let xe=typeof Ue=="function"?Ue(ke):Ue;if(xe===void 0||xe===!1)return null;xe===null&&(xe=!0);const Fe=R?.isConnected?R:null,Je=Le?.isConnected&&Tr(Le)!=="body"?Le:null;let ot=Oe?Je||Fe:Fe||Je;return ot||(ot=$w()||null),typeof xe=="boolean"?ot:Yi(xe)||ot||null}return()=>{T.off("openchange",ze);const ke=Vr(be),Ue=fe(),xe=st(O,ke)||Ue.some(Ee=>Ee===ke||st(Ee,ke))||B&&qa(B.nodesRef.current,N(),!1).some(Ee=>st(Ee.context?.elements.floating,ke)),Fe=z.current,Je=q.current,ot=Ve(Je),de={cancelled:!1};ce.current=de,queueMicrotask(()=>{ce.current===de&&(ce.current=null);const Ee=EI(ot),$e=L.current??typeof Fe!="boolean";if(!de.cancelled&&Fe&&!U.current&&bn(Ee)&&(!(!$e&&Ee!==ke&&ke!==be.body)||xe)){const Me={preventScroll:!0};Je==="keyboard"&&(Me.focusVisible=!0),Ee.focus(Me)}U.current=!1})}},[i,O,se,z,L,K,T,B,R,N,fe]),Pe(()=>{if(!Ti||E||!O)return;const be=Vr(qt(O));!bn(be)||!id(be)||st(O,be)&&be.blur()},[E,O]),Pe(()=>{if(!(i||!H))return H.setFocusManagerState({modal:f,closeOnFocusOut:g,open:E,onOpenChange:t.setOpen,domReference:R}),()=>{H.setFocusManagerState(null)}},[i,H,f,E,t,g,R]),Pe(()=>{if(!(i||!se))return Gw(se),()=>{queueMicrotask(Zv)}},[i,se]);const Re=!i&&(f?!D:!0)&&(ye||f);return y.jsxs(b.Fragment,{children:[Re&&y.jsx(Va,{"data-type":"inside",ref:ae,onFocus:be=>{if(f){const Le=ge();Dh(Le[Le.length-1])}else H?.portalNode&&(U.current=!1,Zl(be,H.portalNode)?DC(R)?.focus():Yi(x??H.beforeOutsideRef)?.focus())}}),s,Re&&y.jsx(Va,{"data-type":"inside",ref:I,onFocus:be=>{f?Dh(ge()[0]):H?.portalNode&&(g&&(U.current=!0),Zl(be,H.portalNode)?jC(R)?.focus():Yi(h??H.afterOutsideRef)?.focus())}})]})}function Fp(e,t={}){const{enabled:s=!0,event:i="click",toggle:o=!0,ignoreMouse:l=!1,stickIfOpen:u=!0,touchOpenDelay:d=0,reason:f=Zs}=t,g=e.context.dataRef,m=b.useRef(void 0),h=oc(),x=Hn(),S=b.useMemo(()=>{function w(E,R,O,T){const A=lt(f,R,O);E&&T==="touch"&&d>0?x.start(d,()=>{e.setOpen(!0,A)}):e.setOpen(E,A)}function C(E,R,O){const T=g.current.openEvent,A=e.select("domReferenceElement")!==R;return E&&A||!E||!o?!0:T&&(typeof u=="function"?u():u)?!O(T.type):!1}return{onPointerDown(E){m.current=Ha(E.pointerType,!0)&&Dv(E.nativeEvent)?"virtual":E.pointerType},onMouseDown(E){const R=m.current,O=E.nativeEvent,T=e.select("open");if(E.button!==0||i==="click"||Ha(R,!0)&&l)return;const A=C(T,E.currentTarget,M=>M==="click"||M==="mousedown"),N=sr(O),j=id(N);if(j||R==="virtual"){w(A,O,j?N:E.currentTarget,R);return}const D=E.currentTarget;h.request(()=>{w(A,O,D,R)})},onClick(E){if(i==="mousedown-only")return;const R=m.current;if(i==="mousedown"&&R){m.current=void 0;return}if(Ha(R,!0)&&l)return;const O=e.select("open"),T=C(O,E.currentTarget,A=>A==="click"||A==="mousedown"||A==="keydown"||A==="keyup");w(T,E.nativeEvent,E.currentTarget,R)},onKeyDown(){m.current=void 0}}},[g,i,l,f,e,u,o,h,x,d]);return b.useMemo(()=>s?{reference:S}:Xt,[s,S])}function RI(e,t){let s=null,i=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){const l=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"?l.width:0,m=t.axis==="x"?l.height:0;let h=l.x,x=l.y;return s==null&&t.x&&u&&(s=l.x-t.x),i==null&&t.y&&d&&(i=l.y-t.y),h-=s||0,x-=i||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 Qw(e){return e!=null&&e.clientX!=null}function CI(e,t={}){const{enabled:s=!0,axis:i="both"}=t,o=e.useState("open"),l=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(T=>{e.set("positionReference",T)}),C=Be((T,A,N)=>{f.current||d.current.openEvent&&!Qw(d.current.openEvent)||e.set("positionReference",RI(N??u,{x:T,y:A,axis:i,dataRef:d,pointerType:m}))}),E=Be(T=>{o?g.current||(C(T.clientX,T.clientY,T.currentTarget),S([])):C(T.clientX,T.clientY,T.currentTarget)}),R=Ha(m)?l:o;b.useEffect(()=>{if(!s){w(u);return}if(!R)return;function T(){g.current?.(),g.current=null}const A=Rn(l);function N(j){const D=sr(j);st(l,D)?T():C(j.clientX,j.clientY)}return!d.current.openEvent||Qw(d.current.openEvent)?g.current=zt(A,"mousemove",N):w(u),T},[R,s,l,d,u,e,C,w,x]),b.useEffect(()=>()=>{e.set("positionReference",null)},[e]),b.useEffect(()=>{s&&!l&&(f.current=!1)},[s,l]),b.useEffect(()=>{!s&&o&&(f.current=!0)},[s,o]);const O=b.useMemo(()=>{function T(A){h(A.pointerType)}return{onPointerDown:T,onPointerEnter:T,onMouseMove:E,onMouseEnter:E}},[E]);return b.useMemo(()=>s?{reference:O,trigger:O}:{},[s,O])}function TI(){return!1}function kI(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function cd(e,t={}){const{enabled:s=!0,escapeKey:i=!0,outsidePress:o=!0,outsidePressEvent:l="sloppy",referencePress:u=TI,bubbles:d,externalTree:f}=t,g=e.useState("open"),m=e.useState("floatingElement"),{dataRef:h,events:x}=e.context,S=Za(f),w=Be(typeof o=="function"?o:()=>!1),C=typeof o=="function"?w:o,E=C!==!1,R=Be(()=>l),{escapeKey:O,outsidePress:T}=kI(d),A=b.useRef(!1),N=b.useRef(!1),j=b.useRef(!1),D=b.useRef(!1),M=b.useRef(!1),z=b.useRef(""),L=b.useRef(null),K=Hn(),X=Hn(),B=Hn(),H=Be(()=>{X.clear(),h.current.insideReactTree=!1}),U=Be(I=>{const F=h.current.floatingContext?.nodeId;return(S?qa(S.nodesRef.current,F):[]).some(ne=>ne.context?.open&&!ne.context.dataRef.current[I])}),_=Be(I=>ry(I,e.select("floatingElement"))||ry(I,e.select("domReferenceElement"))),Q=Be(I=>{u()&&e.setOpen(!1,lt(Zs,I.nativeEvent))}),G=Be(I=>{if(!g||!s||!i||I.key!=="Escape")return;const F=s4(I)?I.nativeEvent:I;if(M.current||F.isComposing||!O&&U("__escapeKeyBubbles"))return;const Z=lt(ad,F);e.setOpen(!1,Z),Z.isCanceled||I.preventDefault(),!O&&!Z.isPropagationAllowed&&I.stopPropagation()}),q=Be(()=>{h.current.insideReactTree=!0,X.start(0,H)}),Y=Be(I=>{if(!g||!s||I.button!==0)return;const F=sr(I.nativeEvent);st(e.select("floatingElement"),F)&&(A.current||(A.current=!0,N.current=!1))}),ee=Be(I=>{!g||!s||(I.defaultPrevented||I.nativeEvent.defaultPrevented)&&A.current&&(N.current=!0)});b.useEffect(()=>{function I(F){F.open||(D.current=!1)}return x.on("openchange",I),()=>{x.off("openchange",I)}},[x]),b.useEffect(()=>H,[H]),b.useEffect(()=>{if(!g||!s)return g||(D.current=!1,M.current=!1,z.current="",L.current=null),H;h.current.__escapeKeyBubbles=O,h.current.__outsidePressBubbles=T;const I=new zs,F=qt(m);function Z(){B.clear(),M.current=!0}function ne(){M.current=!0,B.start(Ti?5:0,()=>{M.current=!1})}function ye(){j.current=!0,I.start(0,()=>{j.current=!1})}function se(){A.current=!1,N.current=!1}function ge(){const de=z.current,Ee=de==="pen"||!de?"mouse":de,$e=R(),Me=typeof $e=="function"?$e():$e;return typeof Me=="string"?Me:Me[Ee]}function fe(de){const Ee=ge();return Ee==="intentional"&&de.type!=="click"||Ee==="sloppy"&&de.type==="click"}function ce(de){const Ee=h.current.floatingContext?.nodeId,$e=S&&qa(S.nodesRef.current,Ee).some(Me=>ry(de,Me.context?.elements.floating));return _(de)||$e}function Re(de){if(fe(de)){de.type!=="click"&&!_(de)&&(I.clear(),j.current=!1),H();return}if(h.current.insideReactTree){H();return}const Ee=sr(de),$e=`[${Jl("inert")}]`,Me=ln(Ee)?Ee.getRootNode():null,De=Array.from((Ho(Me)?Me:qt(e.select("floatingElement"))).querySelectorAll($e)),xt=e.context.triggerElements;if(Ee&&(xt.hasElement(Ee)||xt.hasMatchingElement(gt=>st(gt,Ee))))return;let dt=ln(Ee)?Ee:null;for(;dt&&!Xi(dt);){const gt=Wi(dt);if(Xi(gt)||!ln(gt))break;dt=gt}if(!(De.length&&ln(Ee)&&!w4(Ee)&&!st(Ee,e.select("floatingElement"))&&De.every(gt=>!st(dt,gt)))){if(bn(Ee)&&!("touches"in de)){const gt=Xi(Ee),Dt=vs(Ee),It=/auto|scroll/,tn=gt||It.test(Dt.overflowX),an=gt||It.test(Dt.overflowY),nn=tn&&Ee.clientWidth>0&&Ee.scrollWidth>Ee.clientWidth,et=an&&Ee.clientHeight>0&&Ee.scrollHeight>Ee.clientHeight,Et=Dt.direction==="rtl",Zt=et&&(Et?de.offsetX<=Ee.offsetWidth-Ee.clientWidth:de.offsetX>Ee.clientWidth),pt=nn&&de.offsetY>Ee.clientHeight;if(Zt||pt)return}if(!ce(de)){if(ge()==="intentional"){if(de.detail!==0&&!ac(de)&&!D.current)return;if(j.current){I.clear(),j.current=!1;return}}typeof C=="function"&&!C(de)||U("__outsidePressBubbles")||(e.setOpen(!1,lt(Ip,de)),H())}}}function be(de){ge()!=="sloppy"||de.pointerType==="touch"||!e.select("open")||!s||_(de)||Re(de)}function Le(de){if(ge()!=="sloppy"||!e.select("open")||!s||_(de))return;const Ee=de.touches[0];Ee&&(L.current={startTime:Date.now(),startX:Ee.clientX,startY:Ee.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},K.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}function Oe(de,Ee){const $e=sr(de);if(!$e)return;const Me=zt($e,de.type,()=>{Ee(de),Me()})}function ze(de){z.current="touch",Oe(de,Le)}function Ve(de){K.clear(),de.type==="pointerdown"&&(de.button===0&&(D.current=!0),z.current=de.pointerType),!(de.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)&&Oe(de,Ee=>{Ee.type==="pointerdown"?be(Ee):Re(Ee)})}function ke(de){if(de.type==="pointercancel"&&(D.current=!1),!A.current)return;const Ee=N.current;if(se(),ge()==="intentional"){if(de.type==="pointercancel"){Ee&&ye();return}if(!ce(de)){if(Ee){ye();return}typeof C=="function"&&!C(de)||(I.clear(),j.current=!0,H())}}}function Ue(de){if(ge()!=="sloppy"||!L.current||_(de))return;const Ee=de.touches[0];if(!Ee)return;const $e=Math.abs(Ee.clientX-L.current.startX),Me=Math.abs(Ee.clientY-L.current.startY),De=Math.sqrt($e*$e+Me*Me);De>5&&(L.current.dismissOnTouchEnd=!0),De>10&&(Re(de),K.clear(),L.current=null)}function xe(de){Oe(de,Ue)}function Fe(de){ge()!=="sloppy"||!L.current||_(de)||(L.current.dismissOnTouchEnd&&Re(de),K.clear(),L.current=null)}function Je(de){Oe(de,Fe)}const ot=Ei(i&&Ei(zt(F,"keydown",G),zt(F,"compositionstart",Z),zt(F,"compositionend",ne)),E&&Ei(zt(F,"click",Ve,!0),zt(F,"pointerdown",Ve,!0),zt(F,"pointerup",ke,!0),zt(F,"pointercancel",ke,!0),zt(F,"mousedown",Ve,!0),zt(F,"mouseup",ke,!0),zt(F,"touchstart",ze,{capture:!0,passive:!0}),zt(F,"touchmove",xe,{capture:!0,passive:!0}),zt(F,"touchend",Je,{capture:!0,passive:!0})));return()=>{ot(),I.clear(),se(),j.current=!1}},[h,m,i,E,C,g,s,O,T,G,H,R,U,_,S,e,K,B]);const $=b.useMemo(()=>({onKeyDown:G,onPointerDown:Q,onClick:Q}),[G,Q]),ae=b.useMemo(()=>({onKeyDown:G,onPointerDown:ee,onMouseDown:ee,onClickCapture:q,onMouseDownCapture(I){q(),Y(I)},onPointerDownCapture(I){q(),Y(I)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[G,q,Y,ee]);return b.useMemo(()=>s?{reference:$,floating:ae,trigger:$}:{},[s,$,ae])}function WC(e){const{popupStore:t,treatPopupAsFloatingElement:s=!1,floatingRootContext:i,floatingId:o,nested:l,onOpenChange:u}=e,d=t.useState("open"),f=t.useState("activeTriggerElement"),g=t.useState(s?"popupElement":"positionerElement"),m=u;return t.useSyncedValue("floatingId",o),Pe(()=>{const h={open:d,floatingId:o,referenceElement:f,floatingElement:g};ln(f)&&(h.domReferenceElement=f),i.state.positionReference===i.state.referenceElement&&(h.positionReference=f),i.update(h)},[d,o,f,g,i]),i.context.onOpenChange=m,i.context.nested=l,i}function Ja(e,t=!1,s=!1,i=!1){const[o,l]=b.useState(e&&t?"idle":void 0),[u,d]=b.useState(e&&!i);return e&&!u&&(d(!0),l("starting")),!e&&u&&o!=="ending"&&!s&&l("ending"),!e&&!u&&o==="ending"&&l(void 0),Pe(()=>{if(!e&&u&&o!=="ending"&&s){const f=jr.request(()=>{l("ending")});return()=>{jr.cancel(f)}}},[e,u,o,s]),Pe(()=>{if(!e||t||o===void 0)return;const f=jr.request(()=>{l(void 0)});return()=>{jr.cancel(f)}},[t,e,o]),Pe(()=>{if(!e||!t)return;e&&u&&o!=="idle"&&l("starting");const f=jr.request(()=>{l("idle")});return()=>{jr.cancel(f)}},[t,e,u,o]),{mounted:u,setMounted:d,transitionStatus:o}}function Xw(e,t){return e.getAnimations(t).filter(s=>{const i=s.effect?.getTiming();return i?.duration!==1/0&&i?.iterations!==1/0})}let lh=null;function OI(e){if(!lh){const t=[];lh=t,queueMicrotask(()=>{lh=null,hr.flushSync(()=>{for(const s of t)s()})})}lh.push(e)}function Bp(e,t=!1,s=!1){const i=oc();return Be((o,l=null)=>{i.cancel();const u=Yi(e);if(u==null)return;const d=u,f=()=>{if(!s){hr.flushSync(o);return}OI(()=>{l?.aborted||o()})};if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){o();return}function g(){Promise.all(Xw(d).map(m=>m.finished.then(En))).then(()=>{l?.aborted||f()},()=>{if(l?.aborted)return;if(Xw(d).some(h=>h.pending||h.playState!=="finished")){g();return}f()})}if(t){const m=zv;if(!d.hasAttribute(m)){i.request(g);return}const h=new MutationObserver(()=>{d.hasAttribute(m)||(h.disconnect(),g())});h.observe(d,{attributes:!0,attributeFilter:[m]}),l?.addEventListener("abort",()=>h.disconnect(),{once:!0});return}i.request(g)})}function bs(e){const{enabled:t=!0,open:s,ref:i,batch:o=!1,onComplete:l}=e,u=Be(l),d=Bp(i,s,o);b.useEffect(()=>{if(!t)return;const f=new AbortController;return d(u,f.signal),()=>{f.abort()}},[t,s,u,d])}function eT(e){const{open:t,ref:s,preventUnmountOnClose:i,setPreventUnmountOnClose:o,onUnmount:l,animateInitialOpen:u}=e,d=Be(o),{mounted:f,setMounted:g,transitionStatus:m}=Ja(t,!1,!1,u),h=t?!1:i;Pe(()=>{t&&d(!1)},[t,d]);const x=b.useRef(f),S=b.useRef(!1),w=PC(),C=()=>{x.current=!1,g(!1),l()};Pe(()=>{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 bs({enabled:f&&!t&&!h,open:t,ref:s,onComplete(){t||E()}}),{mounted:f,transitionStatus:m,preventUnmountingOnClose:h,forceUnmount:E}}const ud={tabIndex:-1,[Hy]:""};function tT(e){return t=>t==="touch"?e.current:!0}function Jv(e,t=!1){const s=hc(),i=Xa()!=null,o=rr(()=>e(s,i)).current;return WC({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:s,nested:i,onOpenChange:o.setOpen}),o}function Vp({handle:e,store:t}){return Pe(()=>e.attachStore(t),[e,t]),null}function Zw(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function AI(e,t){const s=b.useRef(null);return Be(i=>{const o=s.current;if(o!==null){if(o.element===i&&o.store===t&&o.id===e)return;s.current=null;const l=o.store;l.context.triggerElements.getById(o.id)===o.element&&(l.context.triggerElements.delete(o.id),Zw(l))}i!==null&&e!==void 0&&(s.current={store:t,id:e,element:i},t.context.triggerElements.add(e,i),Zw(t))})}function Kp(e,t,s,i=!1){let o=e.preventUnmountingOnClose;t?o=!1:i&&(o=!0);const l=s?.id??null;let u=e.activeTriggerId,d=e.activeTriggerElement;return(l||t)&&(u=l,d=s??null),{open:t,preventUnmountingOnClose:o,activeTriggerId:u,activeTriggerElement:d,openedWithoutTrigger:t?s==null:e.openedWithoutTrigger}}function qp(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function MI(e,t,s,i={}){const o=s.reason,l=o===qn,u=t&&o===$l,d=!t&&(o===Zs||o===ad),f=qp(s);if(e.context.onOpenChange?.(t,s),s.isCanceled)return;i.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,s);const g=()=>{const m=Kp(e.state,t,s.trigger,f()),h={...i.extraState,...m};u?h.instantType="focus":d?h.instantType="dismiss":l&&(h.instantType=void 0),e.update(h)};l?hr.flushSync(g):g()}function Yp(e,t,s,i){const o=s.useState("isMountedByTrigger",e),l=AI(e,s),u=Be(f=>{const g=s.select("open"),m=s.select("activeTriggerId");if(m===e){const h={activeTriggerElement:f,...g?i:null};s.update(h);return}if(m==null&&g&&!s.state.openedWithoutTrigger){const h={activeTriggerId:e??null,activeTriggerElement:f,...i};s.update(h)}}),d=Be(f=>{l(f),f&&u(f)});return Pe(()=>(d(t.current),()=>d(null)),[d,t,s,e]),Pe(()=>{if(o){const f={activeTriggerElement:t.current,...i};s.update(f)}},[o,s,t,...Object.values(i)]),{registerTrigger:d,isMountedByThisTrigger:o}}function $p(e,t={}){const{closeOnActiveTriggerUnmount:s=!1}=t,i=b.useRef(null),o=e.useState("open"),l=e.useState("triggerCount"),u=e.useState("activeTriggerId"),d=e.useState("activeTriggerElement");Pe(()=>{if(!o){i.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)i.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,i.current=S;break}g.activeTriggerId===void 0&&(i.current===m?h=m:i.current=null)}}else i.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,i.current=S}}(g.triggerCount!==void 0||g.activeTriggerId!==void 0||g.activeTriggerElement!==void 0)&&e.update(g),h&&s&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===h&&!e.context.triggerElements.getById(h)){const x=lt(kr);e.setOpen(!1,x),x.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,l,u,d,s])}function Gp(e,t,s,i){const{mounted:o,transitionStatus:l,forceUnmount:u}=eT({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:d=>t.set("preventUnmountingOnClose",d),animateInitialOpen:i,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),s?.(),t.context.onOpenChangeComplete?.(!1)}});return rr(()=>(t.set("mounted",o),null)),t.useSyncedValues({mounted:o,transitionStatus:l}),{forceUnmount:u,transitionStatus:l}}function Qp(e,t){e.useSyncedValues(t),Pe(()=>()=>{e.update({activeTriggerProps:Xt,inactiveTriggerProps:Xt,popupProps:Xt})},[e])}function nT(e,t){Pe(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Pe(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class dd{idMap=new Map;add(t,s){this.idMap.set(t,s)}delete(t){this.idMap.delete(t)}hasElement(t){for(const s of this.idMap.values())if(s===t)return!0;return!1}hasMatchingElement(t){for(const s of this.idMap.values())if(t(s))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 oy={exports:{}},ly={};var Jw;function NI(){if(Jw)return ly;Jw=1;var e=ed();function t(h,x){return h===x&&(h!==0||1/h===1/x)||h!==h&&x!==x}var s=typeof Object.is=="function"?Object.is:t,i=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function d(h,x){var S=x(),w=i({inst:{value:S,getSnapshot:x}}),C=w[0].inst,E=w[1];return l(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!s(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 ly.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,ly}var Ww;function rT(){return Ww||(Ww=1,oy.exports=NI()),oy.exports}var Xp=rT(),cy={exports:{}},uy={};var eE;function DI(){if(eE)return uy;eE=1;var e=ed(),t=rT();function s(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var i=typeof Object.is=="function"?Object.is:s,o=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,d=e.useMemo,f=e.useDebugValue;return uy.useSyncExternalStoreWithSelector=function(g,m,h,x,S){var w=l(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(!O){if(O=!0,T=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,i(T,j))return D;var M=x(j);return S!==void 0&&S(D,M)?(T=j,D):(T=j,A=M)}var O=!1,T,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},uy}var tE;function jI(){return tE||(tE=1,cy.exports=DI()),cy.exports}var II=jI();const PI=qv(19),LI=PI?_I:UI;function sT(e,t,s,i,o){return LI(e,t,s,i,o)}function zI(e,t,s,i,o){const l=b.useCallback(()=>t(e.getSnapshot(),s,i,o),[e,t,s,i,o]);return Xp.useSyncExternalStore(e.subscribe,l,l)}Gj({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let s=0;s<e.syncHooks.length;s+=1){const i=e.syncHooks[s],o=i.selector(i.store.state,i.a1,i.a2,i.a3);Object.is(i.value,o)||(t=!0,i.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const s=new Set;for(const o of e.syncHooks)s.add(o.store);const i=[];for(const o of s)i.push(o.subscribe(t));return()=>{for(const o of i)o()}}),Xp.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function _I(e,t,s,i,o){const l=$j();if(!l)return zI(e,t,s,i,o);const u=l.syncIndex;l.syncIndex+=1;let d;return l.didInitialize?(d=l.syncHooks[u],(d.store!==e||d.selector!==t||!Object.is(d.a1,s)||!Object.is(d.a2,i)||!Object.is(d.a3,o))&&(d.store!==e&&(l.didChangeStore=!0),d.store=e,d.selector=t,d.a1=s,d.a2=i,d.a3=o,d.value=t(e.getSnapshot(),s,i,o))):(d={store:e,selector:t,a1:s,a2:i,a3:o,value:t(e.getSnapshot(),s,i,o)},l.syncHooks.push(d)),d.value}function UI(e,t,s,i,o){return II.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,l=>t(l,s,i,o))}class HI{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 s=this.updateTick;for(const i of this.listeners){if(s!==this.updateTick)return;i(t)}}update(t){for(const s in t)if(!Object.is(this.state[s],t[s])){this.setState({...this.state,...t});return}}set(t,s){Object.is(this.state[t],s)||this.setState({...this.state,[t]:s})}notifyAll(){const t={...this.state};this.setState(t)}use(t,s,i,o){return sT(this,t,s,i,o)}}class pc extends HI{constructor(t,s={},i){super(t),this.context=s,this.selectors=i}useSyncedValue(t,s){b.useDebugValue(t);const i=this;Pe(()=>{i.state[t]!==s&&i.set(t,s)},[i,t,s])}useSyncedValueWithCleanup(t,s){const i=this;Pe(()=>(i.state[t]!==s&&i.set(t,s),()=>{i.set(t,void 0)}),[i,t,s])}useSyncedValues(t){const s=this,i=Object.values(t);Pe(()=>{s.update(t)},[s,...i])}useControlledProp(t,s){b.useDebugValue(t);const i=this,o=s!==void 0;Pe(()=>{o&&!Object.is(i.state[t],s)&&i.setState({...i.state,[t]:s})},[i,t,s,o])}select(t,s,i,o){const l=this.selectors[t];return l(this.state,s,i,o)}useState(t,s,i,o){return b.useDebugValue(t),sT(this,this.selectors[t],s,i,o)}useContextCallback(t,s){b.useDebugValue(t);const i=Be(s??En);this.context[t]=i}useStateSetter(t){const s=b.useRef(void 0);return s.current===void 0&&(s.current=i=>{this.set(t,i)}),s.current}observe(t,s){let i;typeof t=="function"?i=t:i=this.selectors[t];let o=i(this.state);return s(o,o,this),this.subscribe(l=>{const u=i(l);if(!Object.is(o,u)){const d=o;o=u,s(u,d,this)}})}}const FI={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 iT extends pc{constructor(t){const{syncOnly:s,nested:i,onOpenChange:o,triggerElements:l,...u}=t;super({...u,positionReference:u.referenceElement,domReferenceElement:u.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:GC(),nested:i,triggerElements:l},FI),this.syncOnly=s}syncOpenEvent=(t,s)=>{(!t||!this.state.open||s!=null&&i4(s))&&(this.context.dataRef.current.openEvent=t?s:void 0)};dispatchOpenChange=(t,s)=>{this.syncOpenEvent(t,s.event);const i={open:t,reason:s.reason,nativeEvent:s.event,nested:this.context.nested,triggerElement:s.trigger};this.context.events.emit("openchange",i)};setOpen=(t,s)=>{if(this.syncOnly){this.context.onOpenChange?.(t,s);return}this.dispatchOpenChange(t,s),this.context.onOpenChange?.(t,s)}}function Zp(e,t,s=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new iT({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:s,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 Du=e=>e.triggerIdProp??e.activeTriggerId,ep=e=>e.openProp??e.open,nE=e=>(e.popupElement?.id??e.floatingId)||void 0;function aT(e,t){return t!==void 0&&ep(e)&&Du(e)===t}function BI(e,t){return aT(e,t)?!0:t!==void 0&&ep(e)&&Du(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}const Gi={open:ep,mounted:e=>e.mounted,transitionStatus:e=>ep(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Du,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:nE,isTriggerActive:(e,t)=>t!==void 0&&Du(e)===t,isOpenedByTrigger:(e,t)=>aT(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Du(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>BI(e,t)?nE(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Jp(e){const t=b.useCallback(i=>e===void 0?En:e.subscribeStore(i),[e]),s=b.useCallback(()=>e===void 0?void 0:e.store,[e]);return Xp.useSyncExternalStore(t,s,()=>e?.serverStore)}function VI(e){const{open:t=!1,onOpenChange:s,elements:i={}}=e,o=hc(),l=Xa()!=null,u=rr(()=>new iT({open:t,transitionStatus:void 0,onOpenChange:s,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new dd,floatingId:o,syncOnly:!1,nested:l})).current;return Pe(()=>{const d={open:t,floatingId:o};i.reference!==void 0&&(d.referenceElement=i.reference,d.domReferenceElement=ln(i.reference)?i.reference:null),i.floating!==void 0&&(d.floatingElement=i.floating),u.update(d)},[t,o,i.reference,i.floating,u]),u.context.onOpenChange=s,u.context.nested=l,u}const dy=Mv&&Ti;function oT(e,t={}){const{enabled:s=!0,delay:i}=t,{events:o,dataRef:l}=e.context,u=b.useRef(!1),d=b.useRef(null),f=b.useRef(!0),g=Hn();b.useEffect(()=>{const h=e.select("domReferenceElement");if(!s)return;const x=Rn(h);function S(){const E=e.select("domReferenceElement");!e.select("open")&&bn(E)&&E===Vr(qt(E))&&(u.current=!0,d.current=E)}function w(){f.current=!0}function C(){f.current=!1}return Ei(zt(x,"blur",S),dy&&zt(x,"keydown",w,!0),dy&&zt(x,"pointerdown",C,!0))},[e,s]),b.useEffect(()=>{if(!s)return;function h(x){if(x.reason===Zs||x.reason===ad){const S=e.select("domReferenceElement");ln(S)&&(d.current=S,u.current=!0)}}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,s,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=sr(x.nativeEvent);if(ln(w)){if(dy&&!x.relatedTarget){if(!f.current&&!id(w))return}else if(!R4(w))return}const C=$h(x.relatedTarget,e.context.triggerElements),{nativeEvent:E,currentTarget:R}=x;if(e.select("open")&&C||!i){e.setOpen(!0,lt($l,E,R));return}g.start(i,()=>{u.current||e.setOpen(!0,lt($l,E,R))})},onBlur(x){h();const S=x.relatedTarget,w=x.nativeEvent,C=ln(S)&&S.hasAttribute(Jl("focus-guard"))&&S.getAttribute("data-type")==="outside";g.start(0,()=>{const E=e.select("domReferenceElement"),R=Vr(qt(E));!S&&R===E||st(l.current.floatingContext?.refs.floating.current,R)||st(E,R)||C||$h(S??R,e.context.triggerElements)||e.setOpen(!1,lt($l,w))})}}},[l,i,e,g]);return b.useMemo(()=>s?{reference:m,trigger:m}:{},[s,m])}class Wv{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new zs;restTimeout=new zs;handleCloseOptions=void 0;static create(){return new Wv}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const tp=new WeakMap;function np(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&tp.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),tp.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function lT(e,t){const{scopeElement:s,referenceElement:i,floatingElement:o}=t,l=tp.get(s);l&&l!==e&&np(l),np(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=s,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=o,tp.set(s,e),s.style.pointerEvents="none",i.style.pointerEvents="auto",o.style.pointerEvents="auto"}function eb(e){const t=e.context.dataRef.current,s=rr(()=>t.hoverInteractionState??Wv.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=s),Av(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function tb(e,t={}){const{enabled:s=!0,closeDelay:i=0,nodeId:o}=t,l=e.useState("open"),u=e.useState("floatingElement"),d=e.useState("domReferenceElement"),{dataRef:f}=e.context,g=Za(),m=Xa(),h=eb(e),x=Hn(),S=Be(()=>gC(f.current.openEvent?.type,h.interactedInside)),w=Be(()=>T4(f.current.openEvent?.type)),C=Be(()=>{np(h)});Pe(()=>{l||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,C())},[l,h,C]),b.useEffect(()=>C,[C]),Pe(()=>{if(s&&l&&h.handleCloseOptions?.blockPointerEvents&&w()&&ln(d)&&u){const E=d,R=u,O=qt(u),T=g?.nodesRef.current.find(D=>D.id===m)?.context?.elements.floating;T&&(T.style.pointerEvents="");const A=h.pointerEventsScopeElement!==R?h.pointerEventsScopeElement:null,N=T!==R?T:null,j=h.handleCloseOptions?.getScope?.()??A??N??Bu(E,"[data-rootownerid]")??O.body;return lT(h,{scopeElement:j,referenceElement:E,floatingElement:R}),()=>{C()}}},[s,l,d,u,h,w,g,m,C]),b.useEffect(()=>{if(!s)return;function E(){return!!(g&&m&&qa(g.nodesRef.current,m).length>0)}function R(D){const M=Fo(i,"close",h.pointerType),z=()=>{e.setOpen(!1,lt(qn,D)),g?.events.emit("floating.closed",D)};M?h.openChangeTimeout.start(M,z):(h.openChangeTimeout.clear(),z())}function O(D){const M=sr(D);if(!E4(M)){h.interactedInside=!1;return}h.interactedInside=Bu(M,"[aria-haspopup]")!=null}function T(){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($h(D.relatedTarget,e.context.triggerElements))return;const M=f.current.floatingContext?.nodeId??o,z=D.relatedTarget;if(!(g&&M&&ln(z)&&qa(g.nodesRef.current,M,!1).some(K=>st(K.context?.elements.floating,z)))){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,lt(qn,D)),g.events.emit("floating.closed",D)})}const j=u;return Ei(j&&zt(j,"mouseenter",T),j&&zt(j,"mouseleave",A),j&&zt(j,"pointerdown",O,!0),()=>{g?.events.off("floating.closed",N)})},[s,u,e,f,i,o,w,S,C,h,g,m,x])}const KI={current:null};function nb(e,t={}){const{enabled:s=!0,delay:i=0,handleClose:o=null,mouseOnly:l=!1,restMs:u=0,move:d=!0,triggerElementRef:f=KI,externalTree:g,isActiveTrigger:m=!0,getHandleCloseContext:h,isClosing:x,shouldOpen:S,guardStaleOpen:w=!1}=t,{dataRef:C,events:E}=e.context,R=Za(g),O=eb(e),T=b.useRef(!1),A=Ln(o),N=Ln(i),j=Ln(u),D=Ln(s),M=Ln(S),z=Ln(x),L=Be(()=>gC(C.current.openEvent?.type,O.interactedInside)),K=Be(()=>M.current?.()!==!1),X=Be((U,_,Q)=>{const G=e.context.triggerElements;if(G.hasElement(_))return!U||!st(U,_);if(!ln(Q))return!1;const q=Q;return G.hasMatchingElement(Y=>st(Y,q))&&(!U||!st(U,q))}),B=Be(()=>{if(!O.handler)return;qt(e.select("domReferenceElement")).removeEventListener("mousemove",O.handler),O.handler=void 0}),H=Be(()=>{np(O)});return m&&(O.handleCloseOptions=o?.__options),b.useEffect(()=>B,[B]),b.useEffect(()=>{if(!s)return;function U(_){_.open?T.current=!1:(T.current=_.reason===qn,B(),O.openChangeTimeout.clear(),O.restTimeout.clear(),O.blockMouseMove=!0,O.restTimeoutPending=!1)}return E.on("openchange",U),()=>{E.off("openchange",U)}},[s,E,O,B]),b.useEffect(()=>{if(!s)return;function U(ee,$=!0){const ae=Fo(N.current,"close",O.pointerType);ae?O.openChangeTimeout.start(ae,()=>{e.setOpen(!1,lt(qn,ee)),R?.events.emit("floating.closed",ee)}):$&&(O.openChangeTimeout.clear(),e.setOpen(!1,lt(qn,ee)),R?.events.emit("floating.closed",ee))}const _=f.current??(m?e.select("domReferenceElement"):null);if(!ln(_))return;function Q(ee){if(O.openChangeTimeout.clear(),O.blockMouseMove=!1,l&&!Ha(O.pointerType))return;const $=Mw(j.current),ae=Fo(N.current,"open",O.pointerType),I=sr(ee),F=ee.currentTarget??null,Z=e.select("domReferenceElement");let ne=F;if(ln(I)&&!e.context.triggerElements.hasElement(I)){for(const Oe of e.context.triggerElements.elements())if(st(Oe,I)){ne=Oe;break}}ln(F)&&ln(Z)&&!e.context.triggerElements.hasElement(F)&&st(F,Z)&&(ne=Z);const ye=ne==null?!1:X(Z,ne,I),se=e.select("open"),ge=z.current?.()??e.select("transitionStatus")==="ending",fe=!se&&ge&&T.current,ce=!ye&&ln(ne)&&ln(Z)&&st(Z,ne)&&fe,Re=$>0&&!ae,be=ye&&(se||fe)||ce,Le=!se||ye;if(be){K()&&e.setOpen(!0,lt(qn,ee,ne));return}Re||(ae?O.openChangeTimeout.start(ae,()=>{Le&&K()&&e.setOpen(!0,lt(qn,ee,ne))}):Le&&K()&&e.setOpen(!0,lt(qn,ee,ne)))}function G(ee){if(L()){H();return}B();const $=e.select("domReferenceElement"),ae=qt($);O.restTimeout.clear(),O.restTimeoutPending=!1;const I=C.current.floatingContext??h?.();if($h(ee.relatedTarget,e.context.triggerElements))return;if(A.current&&I){e.select("open")||O.openChangeTimeout.clear();const Z=f.current;O.handler=A.current({...I,tree:R,x:ee.clientX,y:ee.clientY,onClose(){H(),B(),D.current&&!L()&&Z===e.select("domReferenceElement")&&U(ee,!0)}}),ae.addEventListener("mousemove",O.handler),O.handler(ee);return}(O.pointerType!=="touch"||!st(e.select("floatingElement"),ee.relatedTarget))&&U(ee)}function q(ee){st(_,ee.relatedTarget)||(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1)}const Y=w?zt(_,"mouseout",q):void 0;return d?Ei(zt(_,"mousemove",Q,{once:!0}),zt(_,"mouseenter",Q),zt(_,"mouseleave",G),Y):Ei(zt(_,"mouseenter",Q),zt(_,"mouseleave",G),Y)},[B,H,C,N,e,s,A,O,m,X,L,l,d,j,f,R,D,h,z,K,w]),b.useMemo(()=>{if(!s)return;function U(_){O.pointerType=_.pointerType}return{onPointerDown:U,onPointerEnter:U,onMouseMove(_){const{nativeEvent:Q}=_,G=_.currentTarget,q=e.select("domReferenceElement"),Y=e.select("open"),ee=X(q,G,_.target);if(l&&!Ha(O.pointerType))return;if(Y&&ee&&O.handleCloseOptions?.blockPointerEvents){const I=e.select("floatingElement");if(I){const F=O.handleCloseOptions?.getScope?.()??G.ownerDocument.body;lT(O,{scopeElement:F,referenceElement:G,floatingElement:I})}}const $=Mw(j.current);if(Y&&!ee||$===0||!ee&&O.restTimeoutPending&&_.movementX**2+_.movementY**2<2)return;O.restTimeout.clear();function ae(){if(O.restTimeoutPending=!1,L())return;const I=e.select("open");!O.blockMouseMove&&(!I||ee)&&K()&&e.setOpen(!0,lt(qn,Q,G))}O.pointerType==="touch"?hr.flushSync(()=>{ae()}):ee&&Y?ae():(O.restTimeoutPending=!0,O.restTimeout.start($,ae))}}},[s,O,L,X,l,e,j,K])}function rE(e){return Ti&&e.movementX===0&&e.movementY===0}function Wp(e,t,s){switch(e){case"vertical":return t;case"horizontal":return s;default:return t||s}}function ch(e,t){return Wp(t,e===hC||e===Lv,e===Mp||e===Np)}function fy(e,t,s){return Wp(t,e===Lv,s?e===Mp:e===Np)||e==="Enter"||e===" "||e===""}function qI(e,t,s){return Wp(t,s?e===Mp:e===Np,e===Lv)}function YI(e,t,s,i){const o=s?e===Np:e===Mp,l=e===hC;return t==="both"||t==="horizontal"&&i?e==="Escape":Wp(t,o,l)}function cT(e,t){const{listRef:s,activeIndex:i,onNavigate:o=()=>{},enabled:l=!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:O,id:T,resetOnPointerLeave:A=!0,externalTree:N,nestedReturnFocusRef:j,grid:D}=t,M=D!=null,z=e.useState("open"),L=e.useState("floatingElement"),K=e.useState("domReferenceElement"),X=e.context.dataRef,B=Gh(L),H=By(K),U=Ln(B),_=Xa(),Q=Za(N),G=b.useRef(x),q=b.useRef(u??-1),Y=b.useRef(null),ee=b.useRef(!0),$=Be(de=>{o(q.current===-1?null:q.current,de)}),ae=b.useRef(!!L),I=b.useRef(z),F=b.useRef(!1),Z=b.useRef(!1),ne=b.useRef(null),ye=Ln(C),se=Ln(z),ge=Ln(u),fe=Ln(A),ce=oc(),Re=oc(),be=Be(()=>{ce.cancel();function de(De){h||(ne.current=Dh(De,{sync:F.current,preventScroll:!0}))}const Ee=s.current[q.current],$e=Z.current;Ee&&de(Ee),(F.current?De=>De():De=>ce.request(De))(()=>{const De=s.current[q.current]||Ee;if(!De)return;Ee||de(De),Ue&&($e||!ee.current)&&De.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Pe(()=>{X.current.orientation=E},[X,E]),Pe(()=>{z||(Y.current=null),(!z||x!=="auto")&&(G.current=x)},[z,x]),Pe(()=>{l&&(z&&L?(q.current=u??-1,G.current&&u!=null&&(Z.current=!0,$())):ae.current&&(q.current=-1,$()))},[l,z,L,u,$]),Pe(()=>{if(l){if(!z){F.current=!1;return}if(L)if(i==null){if(F.current=!1,ge.current!=null)return;if(ae.current&&(q.current=-1,be()),(!I.current||!ae.current)&&G.current&&(Y.current!=null||G.current===!0&&Y.current==null)){let de=0;const Ee=()=>{s.current[0]==null?(de<2&&(de?Me=>Re.request(Me):queueMicrotask)(Ee),de+=1):(q.current=Y.current==null||fy(Y.current,R,m)||g?Nh(s):Ky(s),Y.current=null,$())};Ee()}}else Gl(s.current,i)||(q.current=i,be(),Z.current=!1)}},[l,z,L,i,ge,g,s,R,m,$,be,Re]),Pe(()=>{if(!l||L||!Q||h||!ae.current)return;const de=Q.nodesRef.current,Ee=de.find(De=>De.id===_)?.context?.elements.floating,$e=Vr(qt(K??Ee??null)),Me=de.some(De=>De.context&&st(De.context.elements.floating,$e));Ee&&!Me&&ee.current&&Ee.focus({preventScroll:!0})},[l,L,K,Q,_,h]),Pe(()=>{I.current=z,ae.current=!!L});const Le=i!=null,Oe=Be(de=>{if(!se.current)return;const Ee=s.current.indexOf(de.currentTarget);Ee!==-1&&(q.current!==Ee||i!==Ee)&&(q.current=Ee,$(de))}),ze=Be(()=>O??Q?.nodesRef.current.find(de=>de.id===_)?.context?.dataRef?.current.orientation),Ve=Be(()=>Nh(s,ye.current)),ke=Be(de=>{if(ee.current=!1,F.current=!0,de.which===229||!se.current&&de.currentTarget===U.current)return;if(g&&YI(de.key,E,m,M)){ch(de.key,ze())||Qs(de),e.setOpen(!1,lt(Qh,de.nativeEvent));const De=j?.current??K;bn(De)&&De.focus();return}i!=null&&i!==q.current&&!Gl(s.current,i)&&(q.current=i);const Ee=q.current,$e=Nh(s,C),Me=Ky(s,C);if(H||(de.key==="Home"&&(Qs(de),q.current=$e,$(de)),de.key==="End"&&(Qs(de),q.current=Me,$(de))),D!=null){const De=D(de,q.current,s,E,f,m,C,$e,Me);if(De!=null&&De!==q.current&&(q.current=De,$(de)),E==="both")return}if(ch(de.key,E)){Qs(de);const De=Vr(de.currentTarget.ownerDocument);if(z&&!h&&st(de.currentTarget,De)&&!s.current.some(gt=>gt!=null&&st(gt,De))){q.current=fy(de.key,E,m)?$e:Me,$(de),i===q.current&&be();return}const{index:xt,wrapped:dt}=Q4(s.current,Ee,{decrement:!fy(de.key,E,m),loopFocus:f,allowEscape:d,disabledIndices:C,minIndex:$e,maxIndex:Me});dt&&(F.current=!1),q.current=xt,$(de)}}),Ue=b.useMemo(()=>({onFocus(Ee){F.current=!0,Oe(Ee)},onClick({currentTarget:Ee}){h||Ee.focus({preventScroll:!0})},onMouseMove(Ee){rE(Ee)||(F.current=!0,Z.current=!1,S&&Oe(Ee))},onPointerLeave(Ee){if(!se.current||!ee.current||Ee.pointerType==="touch")return;F.current=!0;const $e=Ee.relatedTarget;if(!(!S||s.current.includes($e))&&fe.current&&(ne.current?.(),ne.current=null,q.current=-1,$(Ee),!h)){const Me=U.current,De=Vr(qt(Me));Me&&st(Me,De)&&Me.focus({preventScroll:!0})}}}),[Oe,se,U,S,s,$,fe,h]),xe=b.useMemo(()=>h&&z&&Le&&{"aria-activedescendant":`${T}-${i}`},[h,z,Le,T,i]),Fe=b.useMemo(()=>({...H?{}:xe,onKeyDown(de){if(de.key==="Tab"&&de.shiftKey&&z&&!h){const Ee=sr(de.nativeEvent);if(Ee&&!st(U.current,Ee))return;Qs(de);const $e=lt(Ba,de.nativeEvent);e.setOpen(!1,$e);const Me=j?.current??K;!$e.isCanceled&&bn(Me)&&Me.focus();return}ke(de)},onPointerMove(de){rE(de)||(ee.current=!0)}}),[xe,ke,U,H,e,z,h,K,j]),Je=b.useMemo(()=>{function de(Me){e.setOpen(!0,lt(Qh,Me.nativeEvent,Me.currentTarget))}function Ee(Me){x==="auto"&&ac(Me.nativeEvent)&&(G.current=!h)}function $e(Me){G.current=x,x==="auto"&&Dv(Me.nativeEvent)&&(G.current=!0)}return{onKeyDown(Me){const De=e.select("open");ee.current=!1;const xt=Me.key.startsWith("Arrow"),dt=qI(Me.key,ze(),m),gt=ch(Me.key,De?E:R),Dt=(g?dt:gt)||Me.key==="Enter"||Me.key.trim()==="";if(h&&De&&(!g||id(Me.currentTarget)))return ke(Me);if(!(!De&&!w&&xt)){if(Dt){const It=ch(Me.key,ze());Y.current=g&&It?null:Me.key}if(g){dt&&(Qs(Me),De?(q.current=Ve(),$(Me),h&&U.current?.focus()):de(Me));return}gt&&(ge.current!=null&&(q.current=ge.current),Qs(Me),!De&&w?de(Me):ke(Me),De&&$(Me))}},onFocus(Me){Me.target===Me.currentTarget&&e.select("open")&&!h&&(q.current=-1,$(Me))},onPointerDown:$e,onPointerEnter:$e,onMouseDown:Ee,onClick:Ee}},[ke,x,Ve,g,$,e,w,E,R,ze,m,ge,h,U]),ot=b.useMemo(()=>({...xe,...Je}),[xe,Je]);return b.useMemo(()=>l?{reference:ot,floating:Fe,item:Ue,trigger:Je}:{},[l,ot,Fe,Je,Ue])}function uT(e,t){const{listRef:s,elementsRef:i,activeIndex:o,onMatch:l,disabledIndices:u,onTyping:d,enabled:f=!0,resetMs:g=750,selectedIndex:m=null}=t,h=Be(d),x=e.useState("open"),S=Hn(),w=b.useRef(""),C=b.useRef(m??o??-1),E=b.useRef(null),R=Be(A=>{function N(H){return i?.current[H]}function j(H){const U=N(H);return U&&!Lp(U)||U?.matches(":disabled")?!1:u==null||!Xl(Ls,H,u)}function D(H,U,_=0){if(H.length===0)return-1;const Q=(_%H.length+H.length)%H.length,G=U.toLowerCase();for(let q=0;q<H.length;q+=1){const Y=(Q+q)%H.length;if(!(!H[Y]?.toLowerCase().startsWith(G)||!j(Y)))return Y}return-1}const M=s.current;if(w.current.length>0&&A.key===" "&&(Qs(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!==" "&&(Qs(A),h?.(!0));const z=w.current==="";z&&(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=((z?m??o??-1:C.current)??0)+1,B=D(M,w.current,X);B!==-1?(l?.(B,A),E.current=B):A.key!==" "&&(w.current="",h?.(!1))}),O=Be(A=>{const N=A.relatedTarget,j=e.select("domReferenceElement"),D=e.select("floatingElement");st(j,N)||st(D,N)||(S.clear(),w.current="",C.current=E.current,h?.(!1))});Pe(()=>{!x&&m!==null||(S.clear(),E.current=null,w.current!==""&&(w.current="",h?.(!1)))},[x,m,S,h]);const T=b.useMemo(()=>({onKeyDown:R,onBlur:O}),[R,O]);return b.useMemo(()=>f?{reference:T,floating:T}:{},[f,T])}const sE=.1,$I=sE*sE,wn=.5;function uh(e,t,s,i,o,l){return i>=t!=l>=t&&e<=(o-s)*(t-i)/(l-i)+s}function dh(e,t,s,i,o,l,u,d,f,g){let m=!1;return uh(e,t,s,i,o,l)&&(m=!m),uh(e,t,o,l,u,d)&&(m=!m),uh(e,t,u,d,f,g)&&(m=!m),uh(e,t,f,g,s,i)&&(m=!m),m}function GI(e,t,s){return e>=s.x&&e<=s.x+s.width&&t>=s.y&&t<=s.y+s.height}function fh(e,t,s,i,o,l){const u=Math.min(s,o),d=Math.max(s,o),f=Math.min(i,l),g=Math.max(i,l);return e>=u&&e<=d&&t>=f&&t<=g}function rb(e={}){const{blockPointerEvents:t=!1}=e,s=new zs,i=({x:o,y:l,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(O,T){const A=performance.now(),N=A-C;if(S===null||w===null||N===0)return S=O,w=T,C=A,!1;const j=O-S,D=T-w,M=j*j+D*D,z=N*N*$I;return S=O,w=T,C=A,M<z}function R(){s.clear(),f()}return function(T){s.clear();const A=d.domReference,N=d.floating;if(!A||!N||h==null||o==null||l==null)return;const{clientX:j,clientY:D}=T,M=sr(T),z=T.type==="mouseleave",L=st(N,M),K=st(A,M);if(L&&(x=!0,!z))return;if(K&&(x=!1,!z)){x=!0;return}if(z&&ln(T.relatedTarget)&&st(N,T.relatedTarget))return;function X(){return!!(m&&qa(m.nodesRef.current,g).length>0)}function B(){X()||R()}if(X())return;const H=A.getBoundingClientRect(),U=N.getBoundingClientRect(),_=o>U.right-U.width/2,Q=l>U.bottom-U.height/2,G=U.width>H.width,q=U.height>H.height,Y=(G?H:U).left,ee=(G?H:U).right,$=(q?H:U).top,ae=(q?H:U).bottom;if(h==="top"&&l>=H.bottom-1||h==="bottom"&&l<=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=fh(j,D,Y,H.top+1,ee,U.bottom-1);break;case"bottom":I=fh(j,D,Y,U.top+1,ee,H.bottom-1);break;case"left":I=fh(j,D,U.right-1,ae,H.left+1,$);break;case"right":I=fh(j,D,H.right-1,ae,U.left+1,$);break}if(I)return;if(x&&!GI(j,D,H)){B();return}if(!z&&E(j,D)){B();return}let F=!1;switch(h){case"top":{const Z=G?wn/2:wn*4,ne=G||_?o+Z:o-Z,ye=G?o-Z:_?o+Z:o-Z,se=l+wn+1,ge=_||G?U.bottom-wn:U.top,fe=_?G?U.bottom-wn:U.top:U.bottom-wn;F=dh(j,D,ne,se,ye,se,U.left,ge,U.right,fe);break}case"bottom":{const Z=G?wn/2:wn*4,ne=G||_?o+Z:o-Z,ye=G?o-Z:_?o+Z:o-Z,se=l-wn,ge=_||G?U.top+wn:U.bottom,fe=_?G?U.top+wn:U.bottom:U.top+wn;F=dh(j,D,ne,se,ye,se,U.left,ge,U.right,fe);break}case"left":{const Z=q?wn/2:wn*4,ne=q||Q?l+Z:l-Z,ye=q?l-Z:Q?l+Z:l-Z,se=o+wn+1,ge=Q||q?U.right-wn:U.left,fe=Q?q?U.right-wn:U.left:U.right-wn;F=dh(j,D,ge,U.top,fe,U.bottom,se,ne,se,ye);break}case"right":{const Z=q?wn/2:wn*4,ne=q||Q?l+Z:l-Z,ye=q?l-Z:Q?l+Z:l-Z,se=o-wn,ge=Q||q?U.left+wn:U.right,fe=Q?q?U.left+wn:U.right:U.left+wn;F=dh(j,D,se,ne,se,ye,ge,U.top,fe,U.bottom);break}}F?x||s.start(40,B):B()}};return i.__options={...e,blockPointerEvents:t},i}function iE(e,t,s){let{reference:i,floating:o}=e;const l=Is(t),u=Bv(t),d=Fv(u),f=ys(t),g=l==="y",m=i.x+i.width/2-o.width/2,h=i.y+i.height/2-o.height/2,x=i[d]/2-o[d]/2;let S;switch(f){case"top":S={x:m,y:i.y-o.height};break;case"bottom":S={x:m,y:i.y+i.height};break;case"right":S={x:i.x+i.width,y:h};break;case"left":S={x:i.x-o.width,y:h};break;default:S={x:i.x,y:i.y}}const w=Ri(t);return w&&(S[u]+=x*(w==="end"?1:-1)*(s&&g?-1:1)),S}async function QI(e,t){var s;t===void 0&&(t={});const{x:i,y:o,platform:l,rects:u,elements:d,strategy:f}=e,{boundary:g="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:x=!1,padding:S=0}=Ka(t,e),w=RC(S),E=d[x?h==="floating"?"reference":"floating":h],R=Ku(await l.getClippingRect({element:(s=await(l.isElement==null?void 0:l.isElement(E)))==null||s?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:g,rootBoundary:m,strategy:f})),O=h==="floating"?{x:i,y:o,width:u.floating.width,height:u.floating.height}:u.reference,T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),A=await(l.isElement==null?void 0:l.isElement(T))&&await(l.getScale==null?void 0:l.getScale(T))||{x:1,y:1},N=Ku(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:O,offsetParent:T,strategy:f}):O);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 XI=50,ZI=async(e,t,s)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:u}=s,d=u.detectOverflow?u:{...u,detectOverflow:QI},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}=iE(g,i,f),x=i,S=0;const w={};for(let C=0;C<l.length;C++){const E=l[C];if(!E)continue;const{name:R,fn:O}=E,{x:T,y:A,data:N,reset:j}=await O({x:m,y:h,initialPlacement:i,placement:x,strategy:o,middlewareData:w,rects:g,platform:d,elements:{reference:e,floating:t}});m=T??m,h=A??h,w[R]={...w[R],...N},j&&S<XI&&(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}=iE(g,x,f)),C=-1)}return{x:m,y:h,placement:x,strategy:o,middlewareData:w}},JI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,i;const{placement:o,middlewareData:l,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}=Ka(e,t);if((s=l.arrow)!=null&&s.alignmentOffset)return{};const R=ys(o),O=Is(d),T=ys(d)===d,A=await(f.isRTL==null?void 0:f.isRTL(g.floating)),N=x||(T||!C?[Zh(d)]:V4(d)),j=w!=="none";!x&&j&&N.push(...$4(d,C,w,A));const D=[d,...N],M=await f.detectOverflow(t,E),z=[];let L=((i=l.flip)==null?void 0:i.overflows)||[];if(m&&z.push(M[R]),h){const H=B4(o,u,A);z.push(M[H[0]],M[H[1]])}if(L=[...L,{placement:o,overflows:z}],!z.every(H=>H<=0)){var K,X;const H=(((K=l.flip)==null?void 0:K.index)||0)+1,U=D[H];if(U&&(!(h==="alignment"?O!==Is(U):!1)||L.every(G=>Is(G.placement)===O?G.overflows[0]>0:!0)))return{data:{index:H,overflows:L},reset:{placement:U}};let _=(X=L.filter(Q=>Q.overflows[0]<=0).sort((Q,G)=>Q.overflows[1]-G.overflows[1])[0])==null?void 0:X.placement;if(!_)switch(S){case"bestFit":{var B;const Q=(B=L.filter(G=>{if(j){const q=Is(G.placement);return q===O||q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(q=>q>0).reduce((q,Y)=>q+Y,0)]).sort((G,q)=>G[1]-q[1])[0])==null?void 0:B[0];Q&&(_=Q);break}case"initialPlacement":_=d;break}if(o!==_)return{reset:{placement:_}}}return{}}}},dT=new Set(["left","top"]);async function WI(e,t){const{placement:s,platform:i,elements:o}=e,l=await(i.isRTL==null?void 0:i.isRTL(o.floating)),u=ys(s),d=Ri(s),f=Is(s)==="y",g=dT.has(u)?-1:1,m=l&&f?-1:1,h=Ka(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 e3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,i;const{x:o,y:l,placement:u,middlewareData:d}=t,f=await WI(t,e);return u===((s=d.offset)==null?void 0:s.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:o+f.x,y:l+f.y,data:{...f,placement:u}}}}},t3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:i,placement:o,platform:l}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:f={fn:O=>{let{x:T,y:A}=O;return{x:T,y:A}}},...g}=Ka(e,t),m={x:s,y:i},h=await l.detectOverflow(t,g),x=Is(o),S=Hv(x);let w=m[S],C=m[x];const E=(O,T)=>EC(T+h[O==="y"?"top":"left"],T,T-h[O==="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-s,y:R.y-i,enabled:{[S]:u,[x]:d}}}}}},n3=function(e){return e===void 0&&(e={}),{options:e,fn(t){var s,i;const{x:o,y:l,placement:u,rects:d,middlewareData:f}=t,{offset:g=0,mainAxis:m=!0,crossAxis:h=!0}=Ka(e,t),x={x:o,y:l},S=Is(u),w=Hv(S);let C=x[w],E=x[S];const R=Ka(g,t),O=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(s=R.mainAxis)!=null?s:0,crossAxis:(i=R.crossAxis)!=null?i:0};if(m){const N=w==="y"?"height":"width",j=d.reference[w]-d.floating[N]+O.mainAxis,D=d.reference[w]+d.reference[N]-O.mainAxis;C<j?C=j:C>D&&(C=D)}if(h){var T,A;const N=w==="y"?"width":"height",j=dT.has(ys(u)),D=d.reference[S]-d.floating[N]+(j&&((T=f.offset)==null?void 0:T[S])||0)+(j?0:O.crossAxis),M=d.reference[S]+d.reference[N]+(j?0:((A=f.offset)==null?void 0:A[S])||0)-(j?O.crossAxis:0);E<D?E=D:E>M&&(E=M)}return{[w]:C,[S]:E}}}},r3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:s,rects:i,platform:o,elements:l}=t,{apply:u=()=>{},...d}=Ka(e,t),f=await o.detectOverflow(t,d),g=ys(s),m=Ri(s),h=Is(s)==="y",{width:x,height:S}=i.floating;let w,C;g==="top"||g==="bottom"?(w=g,C=m===(await(o.isRTL==null?void 0:o.isRTL(l.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,O=lc(S-f[w],E),T=lc(x-f[C],R),A=t.middlewareData.shift,N=!A;let j=O,D=T;A!=null&&A.enabled.x&&(D=R),A!=null&&A.enabled.y&&(j=E),N&&!m&&(h?D=x-2*Zi(f.left,f.right):j=S-2*Zi(f.top,f.bottom)),await u({...t,availableWidth:D,availableHeight:j});const M=await o.getDimensions(l.floating);return x!==M.width||S!==M.height?{reset:{rects:!0}}:{}}}};function fT(e){const t=vs(e);let s=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=bn(e),l=o?e.offsetWidth:s,u=o?e.offsetHeight:i,d=Xh(s)!==l||Xh(i)!==u;return d&&(s=l,i=u),{width:s,height:i,$:d}}function sb(e){return ln(e)?e:e.contextElement}function Wl(e){const t=sb(e);if(!bn(t))return Ji(1);const s=t.getBoundingClientRect(),{width:i,height:o,$:l}=fT(t);let u=(l?Xh(s.width):s.width)/i,d=(l?Xh(s.height):s.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const s3=Ji(0);function hT(e){const t=Rn(e);return!Pv()||!t.visualViewport?s3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function i3(e,t,s){return t===void 0&&(t=!1),!!s&&t&&s===Rn(e)}function Bo(e,t,s,i){t===void 0&&(t=!1),s===void 0&&(s=!1);const o=e.getBoundingClientRect(),l=sb(e);let u=Ji(1);t&&(i?ln(i)&&(u=Wl(i)):u=Wl(e));const d=i3(l,s,i)?hT(l):Ji(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(l&&i){const x=Rn(l),S=ln(i)?Rn(i):i;let w=x,C=Uy(w);for(;C&&S!==w;){const E=Wl(C),R=C.getBoundingClientRect(),O=vs(C),T=R.left+(C.clientLeft+parseFloat(O.paddingLeft))*E.x,A=R.top+(C.clientTop+parseFloat(O.paddingTop))*E.y;f*=E.x,g*=E.y,m*=E.x,h*=E.y,f+=T,g+=A,w=Rn(C),C=Uy(w)}}return Ku({width:m,height:h,x:f,y:g})}function eg(e,t){const s=Ap(e).scrollLeft;return t?t.left+s:Bo(na(e)).left+s}function pT(e,t){const s=e.getBoundingClientRect(),i=s.left+t.scrollLeft-eg(e,s),o=s.top+t.scrollTop;return{x:i,y:o}}function a3(e){let{elements:t,rect:s,offsetParent:i,strategy:o}=e;const l=o==="fixed",u=na(i),d=t?Op(t.floating):!1;if(i===u||d&&l)return s;let f={scrollLeft:0,scrollTop:0},g=Ji(1);const m=Ji(0),h=bn(i);if((h||!l)&&((Tr(i)!=="body"||rd(u))&&(f=Ap(i)),h)){const S=Bo(i);g=Wl(i),m.x=S.x+i.clientLeft,m.y=S.y+i.clientTop}const x=u&&!h&&!l?pT(u,f):Ji(0);return{width:s.width*g.x,height:s.height*g.y,x:s.x*g.x-f.scrollLeft*g.x+m.x+x.x,y:s.y*g.y-f.scrollTop*g.y+m.y+x.y}}function o3(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function l3(e){const t=Ap(e),s=e.ownerDocument.body,i=Zi(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=Zi(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let l=-t.scrollLeft+eg(e);const u=-t.scrollTop;return vs(s).direction==="rtl"&&(l+=Zi(e.clientWidth,s.clientWidth)-i),{width:i,height:o,x:l,y:u}}const c3=25;function u3(e,t,s){s===void 0&&(s="viewport");const i=s==="layoutViewport",o=Rn(e),l=na(e),u=o.visualViewport;let d=l.clientWidth,f=l.clientHeight,g=0,m=0;if(u){const x=!Pv()||t==="fixed";i?x||(g=-u.offsetLeft,m=-u.offsetTop):(d=u.width,f=u.height,x&&(g=u.offsetLeft,m=u.offsetTop))}if(eg(l)<=0){const x=l.ownerDocument,S=x.body,w=getComputedStyle(S),C=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,E=Math.abs(l.clientWidth-S.clientWidth-C),R=getComputedStyle(l).scrollbarGutter==="stable both-edges"?E/2:E;R<=c3&&(d-=R)}return{width:d,height:f,x:g,y:m}}function d3(e,t){const s=Bo(e,!0,t==="fixed"),i=s.top+e.clientTop,o=s.left+e.clientLeft,l=Wl(e),u=e.clientWidth*l.x,d=e.clientHeight*l.y,f=o*l.x,g=i*l.y;return{width:u,height:d,x:f,y:g}}function aE(e,t,s){let i;if(t==="viewport"||t==="layoutViewport")i=u3(e,s,t);else if(t==="document")i=l3(na(e));else if(ln(t))i=d3(t,s);else{const o=hT(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ku(i)}function f3(e,t){const s=t.get(e);if(s)return s;let i=Fu(e,[],!1).filter(d=>ln(d)&&Tr(d)!=="body"),o=null;const l=vs(e).position==="fixed";let u=l?Wi(e):e;for(;ln(u)&&!Xi(u);){const d=vs(u),f=Iv(u),g=o?o.position:l?"fixed":"";!f&&(g==="fixed"||g==="absolute"&&d.position==="static")?i=i.filter(h=>h!==u):o=d,u=Wi(u)}return t.set(e,i),i}function h3(e){let{element:t,boundary:s,rootBoundary:i,strategy:o}=e;const u=[...s==="clippingAncestors"?Op(t)?[]:f3(t,this._c):[].concat(s),i],d=aE(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=aE(t,u[x],o);f=Zi(S.top,f),g=lc(S.right,g),m=lc(S.bottom,m),h=Zi(S.left,h)}return{width:g-h,height:m-f,x:h,y:f}}function p3(e){const{width:t,height:s}=fT(e);return{width:t,height:s}}function g3(e,t,s){const i=bn(t),o=na(t),l=s==="fixed",u=Bo(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=Ji(0);if((i||!l)&&((Tr(t)!=="body"||rd(o))&&(d=Ap(t)),i)){const x=Bo(t,!0,l,t);f.x=x.x+t.clientLeft,f.y=x.y+t.clientTop}!i&&o&&(f.x=eg(o));const g=o&&!i&&!l?pT(o,d):Ji(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 hy(e){return vs(e).position==="static"}function oE(e,t){if(!bn(e)||vs(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return na(e)===s&&(s=s.ownerDocument.body),s}function gT(e,t){const s=Rn(e);if(Op(e))return s;if(!bn(e)){let o=Wi(e);for(;o&&!Xi(o);){if(ln(o)&&!hy(o))return o;o=Wi(o)}return s}let i=oE(e,t);for(;i&&a4(i)&&hy(i);)i=oE(i,t);return i&&Xi(i)&&hy(i)&&!Iv(i)?s:i||c4(e)||s}const m3=async function(e){const t=this.getOffsetParent||gT,s=this.getDimensions,i=await s(e.floating);return{reference:g3(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function y3(e){return vs(e).direction==="rtl"}const mT={convertOffsetParentRelativeRectToViewportRelativeRect:a3,getDocumentElement:na,getClippingRect:h3,getOffsetParent:gT,getElementRects:m3,getClientRects:o3,getDimensions:p3,getScale:Wl,isElement:ln,isRTL:y3};function yT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function v3(e,t,s){let i=null,o;const l=na(e);function u(){var m;clearTimeout(o),(m=i)==null||m.disconnect(),i=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=ih(w),O=ih(l.clientWidth-(S+C)),T=ih(l.clientHeight-(w+E)),A=ih(S),j={rootMargin:-R+"px "+-O+"px "+-T+"px "+-A+"px",threshold:Zi(0,lc(1,h))||1};let D=!0;function M(z){const L=z[0].intersectionRatio;if(!yT(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{i=new IntersectionObserver(M,{...j,root:l.ownerDocument})}catch{i=new IntersectionObserver(M,j)}i.observe(e)}const f=Rn(e),g=()=>d(s);return f.addEventListener("resize",g),d(!0),()=>{f.removeEventListener("resize",g),u()}}function lE(e,t,s,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,g=sb(e),m=o||l?[...g?Fu(g):[],...t?Fu(t):[]]:[];m.forEach(R=>{o&&R.addEventListener("scroll",s),l&&R.addEventListener("resize",s)});const h=g&&d?v3(g,s,l):null;let x=-1,S=null;u&&(S=new ResizeObserver(R=>{let[O]=R;O&&O.target===g&&S&&t&&(S.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var T;(T=S)==null||T.observe(t)})),s()}),g&&!f&&S.observe(g),t&&S.observe(t));let w,C=f?Bo(e):null;f&&E();function E(){const R=Bo(e);C&&!yT(C,R)&&s(),C=R,w=requestAnimationFrame(E)}return s(),()=>{var R;m.forEach(O=>{o&&O.removeEventListener("scroll",s),l&&O.removeEventListener("resize",s)}),h?.(),(R=S)==null||R.disconnect(),S=null,f&&cancelAnimationFrame(w)}}const b3=e3,x3=t3,S3=JI,w3=r3,E3=n3,R3=(e,t,s)=>{const i=new Map,o=s??{},l={...mT,...o.platform,_c:i};return ZI(e,t,{...o,platform:l})};var C3=typeof document<"u",T3=function(){},jh=C3?b.useLayoutEffect:T3;function rp(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 s,i,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(i=s;i--!==0;)if(!rp(e[i],t[i]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(t).length)return!1;for(i=s;i--!==0;)if(!{}.hasOwnProperty.call(t,o[i]))return!1;for(i=s;i--!==0;){const l=o[i];if(!(l==="_owner"&&e.$$typeof)&&!rp(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function vT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cE(e,t){const s=vT(e);return Math.round(t*s)/s}function py(e){const t=b.useRef(e);return jh(()=>{t.current=e}),t}function k3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:i=[],platform:o,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:f,open:g}=e,[m,h]=b.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[x,S]=b.useState(i);rp(x,i)||S(i);const[w,C]=b.useState(null),[E,R]=b.useState(null),O=b.useCallback(G=>{G!==j.current&&(j.current=G,C(G))},[]),T=b.useCallback(G=>{G!==D.current&&(D.current=G,R(G))},[]),A=l||w,N=u||E,j=b.useRef(null),D=b.useRef(null),M=b.useRef(m),z=f!=null,L=py(f),K=py(o),X=py(g),B=b.useCallback(()=>{if(!j.current||!D.current)return;const G={placement:t,strategy:s,middleware:x};K.current&&(G.platform=K.current),R3(j.current,D.current,G).then(q=>{const Y={...q,isPositioned:X.current!==!1};H.current&&!rp(M.current,Y)&&(M.current=Y,hr.flushSync(()=>{h(Y)}))})},[x,t,s,K,X]);jh(()=>{g===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h(G=>({...G,isPositioned:!1})))},[g]);const H=b.useRef(!1);jh(()=>(H.current=!0,()=>{H.current=!1}),[]),jh(()=>{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,z]);const U=b.useMemo(()=>({reference:j,floating:D,setReference:O,setFloating:T}),[O,T]),_=b.useMemo(()=>({reference:A,floating:N}),[A,N]),Q=b.useMemo(()=>{const G={position:s,left:0,top:0};if(!_.floating)return G;const q=cE(_.floating,m.x),Y=cE(_.floating,m.y);return d?{...G,transform:"translate("+q+"px, "+Y+"px)",...vT(_.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:q,top:Y}},[s,d,_.floating,m.x,m.y]);return b.useMemo(()=>({...m,update:B,refs:U,elements:_,floatingStyles:Q}),[m,B,U,_,Q])}const O3=(e,t)=>{const s=b3(e);return{name:s.name,fn:s.fn,options:[e,t]}},A3=(e,t)=>{const s=x3(e);return{name:s.name,fn:s.fn,options:[e,t]}},M3=(e,t)=>({fn:E3(e).fn,options:[e,t]}),N3=(e,t)=>{const s=S3(e);return{name:s.name,fn:s.fn,options:[e,t]}},D3=(e,t)=>{const s=w3(e);return{name:s.name,fn:s.fn,options:[e,t]}},j3={...Gi,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 I3 extends pc{constructor(t,s,i){const o=new dd;super(P3(t,o,s,i),L3(o),j3)}setOpen=(t,s)=>{MI(this,t,s,{extraState:{openChangeReason:s.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,lt(Zs,t))}}function P3(e,t,s,i=!1){return{...Zp(t,s,i),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function L3(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const z3=td(function(t){const{disabled:s=!1,defaultOpen:i=!1,open:o,disableHoverablePopup:l=!1,trackCursorAxis:u="none",actionsRef:d,onOpenChange:f,onOpenChangeComplete:g,handle:m,triggerId:h,defaultTriggerId:x=null,children:S}=t,w=Jv((K,X)=>new I3({open:i,openProp:o,activeTriggerId:x,triggerIdProp:h},K,X));w.useControlledProp("openProp",o),w.useControlledProp("triggerIdProp",h),w.useContextCallback("onOpenChange",f),w.useContextCallback("onOpenChangeComplete",g);const C=w.useState("open"),E=!s&&C,R=w.useState("activeTriggerId"),O=w.useState("mounted"),T=w.useState("payload");w.useSyncedValues({trackCursorAxis:u,disableHoverablePopup:l,disabled:s}),$p(w,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:A,transitionStatus:N}=Gp(E,w),j=w.useState("isInstantPhase"),D=w.useState("instantType"),M=w.useState("lastOpenChangeReason"),z=b.useRef(null);Pe(()=>{C&&s&&w.setOpen(!1,lt(vC))},[C,s,w]),Pe(()=>{N==="ending"&&M===kr||N!=="ending"&&j?(D!=="delay"&&(z.current=D),w.set("instantType","delay")):z.current!==null&&(w.set("instantType",z.current),z.current=null)},[N,j,M,D,w]),Pe(()=>{E&&R==null&&w.set("payload",void 0)},[w,R,E]),b.useImperativeHandle(d,()=>({unmount:A,close:()=>w.setOpen(!1,lt(od))}),[A,w]);const L=E||O||!s&&u!=="none";return y.jsxs(uC.Provider,{value:w,children:[m&&y.jsx(Vp,{handle:m,store:w}),L&&y.jsx(_3,{store:w,disabled:s,trackCursorAxis:u}),typeof S=="function"?S({payload:T}):S]})});function _3({store:e,disabled:t,trackCursorAxis:s}){const i=e.useState("floatingRootContext"),o=cd(i,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),l=CI(i,{enabled:!t&&s!=="none",axis:s==="none"?void 0:s}),u=b.useMemo(()=>Ir(l.reference,o.reference),[l.reference,o.reference]);return Qp(e,{activeTriggerProps:u,inactiveTriggerProps:u,popupProps:o.floating??Xt}),null}function Qn(e){return hc(e,"base-ui")}const bT=b.createContext(void 0);function U3(){return b.useContext(bT)}const H3=600,uE="data-base-ui-tooltip-trigger";function dE(e){const t=sr(e);return ln(t)?t:null}const F3=Rp(function(t,s){const{render:i,className:o,style:l,handle:u,payload:d,disabled:f,delay:g,closeOnClick:m=!0,closeDelay:h,id:x,...S}=t,w=nd(!0),E=Jp(u)??w;if(!E)throw new Error(cn(82));const R=Qn(x),O=E.useState("isTriggerActive",R),T=E.useState("isOpenedByTrigger",R),A=E.useState("floatingRootContext"),N=b.useRef(null),j=h??0,{registerTrigger:D,isMountedByThisTrigger:M}=Yp(R,N,E,{payload:d,closeOnClick:m,closeDelay:j}),z=U3(),{activeIdRef:L,delayRef:K,isInstantPhase:X,hasProvider:B}=D4(A,{open:T}),H=eb(A);E.useSyncedValue("isInstantPhase",X);const U=E.useState("disabled"),_=f??U,Q=Ln(_),G=E.useState("trackCursorAxis"),q=E.useState("disableHoverablePopup"),Y=b.useRef(!1),ee=Hn(),$=b.useRef(void 0);function ae(){return B&&L.current!=null?0:g??z??H3}function I(ce){const Re=N.current;if(!Re||!ce)return!1;const be=Bu(ce,`[${uE}]`);return be!==null&&be!==Re&&st(Re,be)}function F(ce){const Re=I(ce);return Y.current=Re,Re&&(H.openChangeTimeout.clear(),H.restTimeout.clear(),H.restTimeoutPending=!1,ee.clear()),Re}const Z=nb(A,{enabled:!_,mouseOnly:!0,move:!1,handleClose:!q&&G!=="both"?rb():null,restMs:ae,delay(){return h==null&&B?{close:Fo(K.current,"close")}:{close:j}},triggerElementRef:N,isActiveTrigger:O,isClosing:()=>E.select("transitionStatus")==="ending",shouldOpen(){return!Y.current}}),ne=oT(A,{enabled:!_}).reference,ye=ce=>{const Re=Y.current,be=dE(ce),Le=F(be),Oe=N.current,ze=Oe&&be&&st(Oe,be);if(Le&&E.select("open")&&E.select("lastOpenChangeReason")===qn){E.setOpen(!1,lt(qn,ce));return}if(Re&&!Le&&ze&&!Q.current&&!E.select("open")&&Oe&&Ha($.current)){const Ve=()=>{!Y.current&&!Q.current&&!E.select("open")&&E.setOpen(!0,lt(qn,ce,Oe))},ke=ae();ke===0?(ee.clear(),Ve()):ee.start(ke,Ve)}},se=E.useState("appliedTriggerProps",M||G!=="none");return bt("button",t,{state:{open:T},ref:[s,D,N],props:[Z,ne,se,{onMouseOver(ce){ye(ce.nativeEvent)},onFocus(ce){I(dE(ce.nativeEvent))&&ce.preventBaseUIHandler()},onMouseLeave(){Y.current=!1,ee.clear(),$.current=void 0},onPointerEnter(ce){$.current=ce.pointerType},onPointerDown(ce){$.current=ce.pointerType,E.set("closeOnClick",m),m&&!E.select("open")&&E.cancelPendingOpen(ce.nativeEvent)},onClick(ce){m&&!E.select("open")&&E.cancelPendingOpen(ce.nativeEvent)},id:R,[Fy]:_?"":void 0,[uE]:_?void 0:""},S],stateAttributesMapping:Dp})}),xT=b.createContext(void 0);function B3(){const e=b.useContext(xT);if(e===void 0)throw new Error(cn(70));return e}const V3=b.forwardRef(function(t,s){const{children:i,container:o,className:l,render:u,style:d,...f}=t,{node:g,subtree:m}=$C({container:o,ref:s,componentProps:t,elementProps:f});return!m&&!g?null:y.jsxs(b.Fragment,{children:[m,g&&hr.createPortal(i,g)]})}),K3=b.forwardRef(function(t,s){const{keepMounted:i=!1,...o}=t;return nd().useState("mounted")||i?y.jsx(xT.Provider,{value:i,children:y.jsx(V3,{ref:s,...o})}):null}),ST=b.createContext(void 0);function wT(){const e=b.useContext(ST);if(e===void 0)throw new Error(cn(71));return e}function q3(e){const{nodeId:t,externalTree:s,rootContext:i}=e,o=i.useState("referenceElement"),l=i.useState("floatingElement"),u=i.useState("domReferenceElement"),d=i.useState("open"),f=i.useState("floatingId"),[g,m]=b.useState(null),h=b.useRef(null),x=Za(s),S=b.useMemo(()=>({reference:o,floating:l,domReference:u}),[o,l,u]),w=k3({...e,elements:{...S,...g&&{reference:g}}}),C=b.useCallback(T=>{const A=ln(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;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]),O=b.useMemo(()=>({...w,dataRef:i.context.dataRef,open:d,onOpenChange:i.setOpen,events:i.context.events,floatingId:f,refs:E,elements:R,nodeId:t,rootStore:i}),[w,E,R,t,i,d,f]);return Pe(()=>{u&&(h.current=u)},[u]),Pe(()=>{i.context.dataRef.current.floatingContext=O;const T=x?.nodesRef.current.find(A=>A.id===t);T&&(T.context=O)}),b.useMemo(()=>({...w,context:O,refs:E,elements:R,rootStore:i}),[w,E,R,O,i])}const Y3=b.createContext(void 0);function tg(){return b.useContext(Y3)?.direction??"ltr"}const $3=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:i,placement:o,rects:l,platform:u,elements:d,middlewareData:f}=t,{element:g,padding:m=0}=Ka(e,t)||{};if(g==null)return{};const h=RC(m),x={x:s,y:i},S=Bv(o),w=Fv(S),C=await u.getDimensions(g),E=S==="y",R=E?"top":"left",O=E?"bottom":"right",T=E?"clientHeight":"clientWidth",A=l.reference[w]+l.reference[S]-x[S]-l.floating[w],N=x[S]-l.reference[S],j=d.floating[T]||l.floating[w],D=A/2-N/2,M=j/2-C[w]/2-1,z=Math.min(h[R],M),L=Math.min(h[O],M),K=z,X=j-C[w]-L,B=j/2-C[w]/2+D,H=EC(K,B,X),U=!f.arrow&&Ri(o)!=null&&B!==H&&l.reference[w]/2-(B<K?z:L)-C[w]/2<0,_=U?B<K?B-K:B-X:0;return{[S]:x[S]+_,data:{[S]:H,centerOffset:B-H-_,...U&&{alignmentOffset:_}},reset:U}}}),G3=(e,t)=>{const{name:s,fn:i}=$3(e);return{name:s,fn:i,options:[e,t]}},Q3={name:"hide",async fn(e){const{width:t,height:s,x:i,y:o}=e.rects.reference,l=t===0&&s===0&&i===0&&o===0,u=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:u.top-s>=0||u.right-t>=0||u.bottom-s>=0||u.left-t>=0||l}}}},X3={sideX:"left",sideY:"top"},Z3="--available-width",J3="--available-height",W3="--anchor-width",eP="--anchor-height",tP="--transform-origin",fE=Z3,hE=J3;function ET(e,t,s){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?s?"inline-start":"inline-end":"right",bottom:"bottom",left:i?s?"inline-end":"inline-start":"left"}[t]}function pE(e,t,s){const{rects:i,placement:o}=e;return{side:ET(t,ys(o),s),align:Ri(o)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function ng(e){return nP(e,q3)}function nP(e,t){const{anchor:s,positionMethod:i="absolute",side:o="bottom",sideOffset:l=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:O,nodeId:T,adaptiveOrigin:A,lazyFlip:N=!1,externalTree:j}=e,D=R.side||"flip",M=R.align||"flip",z=R.fallbackAxisSide||"end",L=O?.crossAxis??!1,K=O?.rootBoundary,X=typeof s=="function"?s:void 0,B=Be(X),H=X?B:s,U=Ln(s),_=Ln(E),G=tg()==="rtl",[q,Y]=b.useState(null);!E&&q!==null&&Y(null);const ee=N==="placement",$=q?ys(q):null,ae=q&&ee?Ri(q)||"center":null,I=$||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":G?"left":"right","inline-start":G?"right":"left"}[o],F=ae||u,Z=F==="center"?I:`${I}-${F}`;let ne=g;typeof ne=="number"?ne={top:ne,right:ne,bottom:ne,left:ne}:ne&&(ne={top:ne.top||0,right:ne.right||0,bottom:ne.bottom||0,left:ne.left||0});const ye=1,se=o==="bottom"?ye:0,ge=o==="top"?ye:0,fe=o==="right"?ye:0,ce=o==="left"?ye:0,Re={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:ne},be=b.useRef(null),Le=Ln(l),Oe=Ln(d),ze=typeof l!="function"?l:0,Ve=typeof d!="function"?d:0,ke=[];S&&ke.push(S),ke.push(O3(je=>{const at=pE(je,o,G),Ie=typeof Le.current=="function"?Le.current(at):Le.current,_e=typeof Oe.current=="function"?Oe.current(at):Oe.current;return{mainAxis:Ie,crossAxis:_e,alignmentAxis:_e}},[ze,Ve,G,o]));const Ue=M==="none"&&D!=="shift",xe=!Ue&&(m||L||D==="shift"),Fe=D==="none"?null:N3({...Re,padding:{top:ne.top+ye+se,right:ne.right+ye+ce,bottom:ne.bottom+ye+ge,left:ne.left+ye+fe},mainAxis:!L&&D==="flip",crossAxis:M==="flip"?"alignment":!1,fallbackAxisSideDirection:z}),Je=Ue?null:A3({...Re,rootBoundary:K,mainAxis:M!=="none",crossAxis:xe,limiter:m||L?void 0:M3(je=>{if(!be.current)return{};const{width:at,height:Ie}=be.current.getBoundingClientRect(),_e=Is(ys(je.placement)),Ge=_e==="y"?at:Ie,tt=_e==="y"?ne.left+ne.right:ne.top+ne.bottom;return{offset:Ge/2+tt/2}})},[Re,m,L,K,ne,M]);D==="shift"||M==="shift"||F==="center"?ke.push(Je,Fe):ke.push(Fe,Je),ke.push(D3({...Re,apply({elements:{floating:je},availableWidth:at,availableHeight:Ie,rects:_e}){if(!_.current)return;const Ge=je.style;Ge.setProperty(fE,`${at}px`),Ge.setProperty(hE,`${Ie}px`);const tt=Rn(je).devicePixelRatio||1,{x:kt,y:V,width:W,height:re}=_e.reference,ve=(Math.round((kt+W)*tt)-Math.round(kt*tt))/tt,Se=(Math.round((V+re)*tt)-Math.round(V*tt))/tt;Ge.setProperty(W3,`${ve}px`),Ge.setProperty(eP,`${Se}px`)}}),G3(je=>({element:be.current||qt(je.elements.floating).createElement("div"),padding:be.current?h:0}),[h]),{name:"transformOrigin",fn(je){const{elements:{floating:at},middlewareData:Ie,placement:_e,platform:Ge,rects:tt,y:kt}=je,V=ys(_e),W=Ri(_e),re=Is(V)==="y",ve=be.current,Se=typeof l=="function"?l(pE(je,o,G)):l;let qe;if(!ve&&W&&Math.abs(re?Ie.shift?.x||0:Ie.shift?.y||0)<=1)qe=W==="start"===(re&&Ge.isRTL?.(at)===!0)?"100%":"0%";else{const Xe=re?Ie.arrow?.x||0:Ie.arrow?.y||0,Qe=re?ve?.clientWidth||0:ve?.clientHeight||0;qe=`${Xe+Qe/2}px`}let Ke=V==="top"||V==="left"?`calc(100% + ${Se}px)`:`${-Se}px`;return xe&&re&&Math.abs(Ie.shift?.y||0)>Se&&(Ke=`${tt.reference.y+tt.reference.height/2-kt}px`),at.style.setProperty(tP,re?`${qe} ${Ke}`:`${Ke} ${qe}`),{}}},Q3,A),Pe(()=>{!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:Ee,x:$e,y:Me,middlewareData:De,update:xt,placement:dt,context:gt,isPositioned:Dt,floatingStyles:It}=t({rootContext:C,open:w?E:void 0,placement:Z,middleware:ke,strategy:i,whileElementsMounted:w?void 0:(...je)=>lE(...je,ot),nodeId:T,externalTree:j}),{sideX:tn,sideY:an}=De.adaptiveOrigin||X3,nn=Dt?i:"fixed",et=b.useMemo(()=>{let je;return Dt?A?je={position:nn,[tn]:$e,[an]:Me}:je={...It,position:nn}:je={position:nn,top:0,left:0},je[fE]="100vw",je[hE]="100vh",Dt||(je.opacity=0),je},[A,nn,tn,$e,an,Me,It,Dt]),Et=b.useRef(null);Pe(()=>{if(!E)return;const je=U.current,at=typeof je=="function"?je():je,_e=(gE(at)?at.current:at)||null||null;_e!==Et.current&&(de.setPositionReference(_e),Et.current=_e)},[E,de,H,U]),b.useEffect(()=>{if(!E)return;const je=U.current;typeof je!="function"&&gE(je)&&je.current!==Et.current&&(de.setPositionReference(je.current),Et.current=je.current)},[E,de,H,U]),b.useEffect(()=>{if(w&&E&&Ee.reference&&Ee.floating)return lE(Ee.reference,Ee.floating,xt,ot)},[w,E,Ee,xt,ot]);const Zt=ys(dt),pt=ET(o,Zt,G),St=Ri(dt)||"center",yt=!!De.hide?.referenceHidden;Pe(()=>{N&&E&&Dt&&(Zt!==I||ee&&St!==F)&&Y(dt)},[N,ee,E,Dt,dt,Zt,St,I,F]);const Ht=b.useMemo(()=>({position:"absolute",top:De.arrow?.y,left:De.arrow?.x}),[De.arrow]),dn=De.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:et,arrowStyles:Ht,arrowRef:be,arrowUncentered:dn,side:pt,align:St,physicalSide:Zt,anchorHidden:yt,refs:de,context:gt,isPositioned:Dt,update:xt}),[et,Ht,be,dn,pt,St,Zt,yt,de,gt,Dt,xt])}function gE(e){return e!=null&&"current"in e}function fd(e){return e==="starting"?bI:Xt}function rg(e,t,{styles:s,transitionStatus:i,props:o,refs:l,hidden:u,inert:d=!1}){const f={...s};return d&&(f.pointerEvents="none"),bt("div",e,{state:t,ref:l,props:[{role:"presentation",hidden:u,style:f},fd(i),o],stateAttributesMapping:sd})}const rP=b.forwardRef(function(t,s){const{render:i,className:o,anchor:l,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=Gv,style:R,...O}=t,T=nd(),A=B3(),N=T.useState("open"),j=T.useState("mounted"),D=T.useState("trackCursorAxis"),M=T.useState("disableHoverablePopup"),z=T.useState("floatingRootContext"),L=T.useState("instantType"),K=T.useState("transitionStatus"),X=T.useState("adaptiveOrigin"),B=ng({anchor:l,positionMethod:u,floatingRootContext:z,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=rg(t,H,{styles:B.positionerStyles,transitionStatus:K,props:O,refs:[s,T.useStateSetter("positionerElement")],hidden:!j,inert:!N||D==="both"||M});return y.jsx(ST.Provider,{value:B,children:U})}),sP=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,d=nd(),{side:f,align:g}=wT(),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");bs({open:m,ref:d.context.popupRef,onComplete(){m&&d.context.onOpenChangeComplete?.(!0)}}),tb(w,{enabled:!C,closeDelay:E});const R=d.useStateSetter("popupElement");return bt("div",t,{state:{open:m,side:f,align:g,instant:h,transitionStatus:x},ref:[s,d.context.popupRef,R],props:[ud,S,fd(x),u],stateAttributesMapping:jp})}),iP=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,d=nd(),{arrowRef:f,side:g,align:m,arrowUncentered:h,arrowStyles:x}=wT(),S=d.useState("open"),w=d.useState("instantType");return bt("div",t,{state:{open:S,side:g,align:m,uncentered:h,instant:w},ref:[s,f],props:[{style:x,"aria-hidden":!0},u],stateAttributesMapping:sd})}),aP=function(t){const{delay:s,closeDelay:i,timeout:o=400}=t,l=b.useMemo(()=>({open:s,close:i}),[s,i]);return y.jsx(bT.Provider,{value:s,children:y.jsx(N4,{delay:l,timeoutMs:o,children:t.children})})};function hd(e){return qv(19)?e:e?"true":void 0}function oP(e){const[t,s]=b.useState({current:e,previous:null});return Object.is(e,t.current)||s({current:e,previous:t.current}),t.previous}const RT=48,ki=(e,t=0)=>{const s=new Int32Array(e.length);for(let i=0;i<e.length;i++)s[i]=e.charCodeAt(i)-RT-t;return s},sg=e=>{const t=new Int32Array(e.length+1);for(let s=0;s<e.length;s++)t[s+1]=t[s]+e[s];return t},Ya=e=>{const t=new Int32Array(e.length);let s=0;for(let i=0;i<e.length;i++){const o=e.charCodeAt(i)-RT;s+=o>>>1^-(o&1),t[i]=s}return t},lP=384,cP=[],Do=sg(ki("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),uP=sg(ki(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),dP="@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",fP=(()=>{const e=Do.length-1,t=new Int32Array(e);for(let o=e-1;o>=0;o--){let l=1,u=o+1;for(let d=Do[o];d<Do[o+1];d++)l+=t[u],u+=t[u];t[o]=l}const s=new Int32Array(Do[e]);let i=0;for(let o=0;o<e;o++){let l=o+1;for(let u=Do[o];u<Do[o+1];u++)s[i++]=l,l+=t[l]}return s})(),hP=ki("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),pP=sg(ki("123333359346463635126536711576")),gP=ki("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),mP=ki("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),yP=Ya("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),vP=(()=>{const e=new Int32Array(319).fill(-1),t=Ya("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),s=Ya("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let i=0;i<t.length;i++)e[t[i]]=s[i];return e})(),bP="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(" "),s=t.shift();for(let i=0;i<t.length;i++)t[i]=s+t[i];return t}),mE=Ya("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),xP=Ya("ɠ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"),SP=Ya("02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}22
:22z22222222222G000qOVI00000{2<40000@00000G¦§000ª00000000000000021K¬«00®000000000000000000000222HGH_1¸222½2¾2222ÇÊ000°2±"),CT=new Int32Array(987),TT=new Int32Array(987),kT=new Int32Array(987);let $y="";const Gy=new Int32Array(1022);{const e=new Map;let t=0,s=0;for(let i=0;i<mE.length;i++)for(const o of bP[SP[i]]){let l=e.get(o);l===void 0&&(l=t++,e.set(o,l),Gy[l*2]=$y.length,Gy[l*2+1]=o.length,$y+=o),CT[s]=mE[i],TT[s]=xP[i],kT[s]=l,s++}}const wP=Ya("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),EP=sg(ki("1::24444432:442:44:44>222222:44:4421322511111311111114")),RP=Ya("24A;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"),CP=ki("ij"),TP=ki(""),kP=ki("1"),OP="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var AP={GROUP_COUNT:lP,customValidatorNames:cP,edgeStart:Do,labelStart:uP,labelText:dP,edgeTarget:fP,nodeGroup:hP,nodeVlist:vP,vlistPat:pP,vlistOps:gP,vlistRef:mP,vlistGroup:yP,litAnchor:CT,litGroup:TT,litPool:kT,poolOffsets:Gy,poolText:$y,adjGid:wP,adjStart:EP,adjTgt:RP,patGid:CP,patTgt:TP,postfixLookupGroups:kP,orderSensitiveModifiers:OP};const MP="line"in new Error,yi=-1,No=-1,gy=(e,t,s)=>{let i=2166136261;for(let o=t;o<s;o++)i=Math.imul(i^e.charCodeAt(o),16777619);return i},Ih=(e,t,s)=>{const i=s-t;let o=Math.imul(i,2654435761)^e.charCodeAt(t);if(i>3){const l=i>>2,u=i>>1;o=Math.imul(o^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+l),2246822507),o=Math.imul(o^e.charCodeAt(t+u)<<8^e.charCodeAt(t+u+l)<<16^e.charCodeAt(s-3),3266489909),o^=e.charCodeAt(s-2)<<8^e.charCodeAt(s-1)<<16;for(let d=t+3,f=s-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},NP=(e,t,s={})=>{const{GROUP_COUNT:i,edgeStart:o,labelStart:l,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:O,adjGid:T,adjStart:A,adjTgt:N,patGid:j,patTgt:D,postfixLookupGroups:M,customValidatorNames:z,orderSensitiveModifiers:L}=e,K=new Int32Array(i).fill(-1);for(let pe=0;pe<T.length;pe++)K[T[pe]]=pe;let X=0;for(let pe=0;pe+1<A.length;pe++){const Ae=A[pe+1]-A[pe];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 pe=0;pe<x.length;pe++)H[pe+1]=H[pe]+m[x[pe]+1]-m[x[pe]];const U=new Uint8Array(i);for(let pe=0;pe<M.length;pe++)U[M[pe]]=1;const _=o.length-1,Q=new Uint8Array(_);let G=0,q=!0;for(let pe=0;pe<w.length;pe++){Q[w[pe]]=1;const Ae=R[E[pe]*2+1];Ae>G&&(G=Ae);const we=O.charCodeAt(R[E[pe]*2]);(we===91||we===40)&&(q=!1)}let Y=1;for(;Y<w.length*2;)Y<<=1;const ee=new Int32Array(Y).fill(-1);for(let pe=0;pe<w.length;pe++){const Ae=R[E[pe]*2];let we=(gy(O,Ae,Ae+R[E[pe]*2+1])^Math.imul(w[pe],2654435761)|0)&Y-1;for(;ee[we]!==-1;)we=we+1&Y-1;ee[we]=pe}const $=(pe,Ae,we,rt)=>{let At=(gy(Ae,we,rt)^Math.imul(pe,2654435761)|0)&Y-1;const Ct=rt-we;for(;;){const Ft=ee[At];if(Ft===-1)return-1;if(w[Ft]===pe&&R[E[Ft]*2+1]===Ct){const xn=R[E[Ft]*2];let pn=!0;for(let vt=0;vt<Ct;vt++)if(O.charCodeAt(xn+vt)!==Ae.charCodeAt(we+vt)){pn=!1;break}if(pn)return C[Ft]}At=At+1&Y-1}},ae=s.cacheSize??8192,I=s.prefix??e.prefix??"",F=I===""?"":I+":",Z=F.length,ne=(z??[]).map(pe=>{throw new Error("cn: missing validator "+pe)}),ye=/\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$/,se=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ge=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let ce=0,Re=-1,be=-1,Le=-1,Oe=-1;const ze=pe=>pe>=97&&pe<=122||pe>=65&&pe<=90||pe>=48&&pe<=57||pe===95,Ve=pe=>/\s/.test(String.fromCharCode(pe)),ke=(pe,Ae,we)=>{if(ce=0,Re=-1,we-Ae<3)return;const rt=pe.charCodeAt(Ae),At=pe.charCodeAt(we-1);if(rt===91&&At===93)ce=1;else if(rt===40&&At===41)ce=2;else return;Le=Ae+1,Oe=we-1;let Ct=Ae+1;if(ze(pe.charCodeAt(Ct))){for(Ct++;Ct<we-1;){const Ft=pe.charCodeAt(Ct);if(!ze(Ft)&&Ft!==45)break;Ct++}Ct<we-2&&pe.charCodeAt(Ct)===58&&(Re=Ae+1,be=Ct,Le=Ct+1)}},Ue=(pe,Ae,we,rt)=>{if(we-Ae!==rt.length)return!1;for(let At=0;At<rt.length;At++)if(pe.charCodeAt(Ae+At)!==rt.charCodeAt(At))return!1;return!0},xe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Fe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Je=pe=>!!pe&&!Number.isNaN(Number(pe)),ot=(pe,Ae,we)=>{if(we-Ae<11||!Ue(pe,Ae,Ae+10,"@container"))return!1;if(pe.charCodeAt(Ae+10)===47)return we-Ae>=12;const rt=pe.charCodeAt(Ae+11);return rt===115&&we-Ae>=17&&Ue(pe,Ae+10,Ae+16,"-size/")||rt===110&&we-Ae>=19&&Ue(pe,Ae+10,Ae+18,"-normal/")},de=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],Ee="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(pe=>pe.split(" ")),$e=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Me=(pe,Ae,we,rt)=>{if(pe>=10){if(pe>=25)return ne[pe-25](Ae.slice(we,rt));const At=pe-10;if(ce!==de[At])return!1;if(Re>=0){for(const Ct of Ee[At])if(Ue(Ae,Re,be,Ct))return!0;return!1}switch($e[At]){case 0:return!1;case 1:return!0;case 2:{const Ct=Ae.slice(Le,Oe);return ye.test(Ct)&&!se.test(Ct)}case 3:return Je(Ae.slice(Le,Oe));case 4:return fe.test(Ae.slice(Le,Oe));default:return ge.test(Ae.slice(Le,Oe))}}switch(pe){case 0:return!0;case 1:return ce===0;case 2:return ce===1;case 3:return ce===2;case 4:return xe.test(Ae.slice(we,rt));case 5:return Je(Ae.slice(we,rt));case 6:{const At=Ae.slice(we,rt);return!!At&&Number.isInteger(Number(At))}case 7:return rt>we&&Ae.charCodeAt(rt-1)===37&&Je(Ae.slice(we,rt-1));case 8:return Fe.test(Ae.slice(we,rt));default:return ot(Ae,we,rt)}},De=new Set(typeof L=="string"?L.split(" "):L),xt=(pe,Ae,we,rt,At,Ct)=>{const Ft=gy(Ae,we,rt)^(At?2654435769:0)|0;let xn=pe.get(Ft);if(xn!==void 0)e:for(let jt=0;jt<xn.length;jt++){const on=xn[jt];if(!(on.imp!==At||on.k.length!==rt-we)){for(let mt=0;mt<on.k.length;mt++)if(on.k.charCodeAt(mt)!==Ae.charCodeAt(we+mt))continue e;return on.id}}else pe.set(Ft,xn=[]);const pn=Ae.slice(we,rt),vt=Ct(pn);return xn.push({k:pn,imp:At,id:vt}),vt};let dt=new Map,gt=new Map,Dt=2;const It=4096,tn=(pe,Ae)=>{const we=[];let rt=0,At=0,Ct=0;for(let vt=0;vt<pe.length;vt++){const jt=pe.charCodeAt(vt);rt===0&&At===0&&jt===58?(we.push(pe.slice(Ct,vt)),Ct=vt+1):jt===91?rt++:jt===93?rt--:jt===40?At++:jt===41&&At--}we.push(pe.slice(Ct));let Ft=we[0];if(we.length>1){const vt=[];let jt=[];for(const on of we)on.charCodeAt(0)===91||De.has(on)?(jt.length&&(vt.push(...jt.sort()),jt=[]),vt.push(on)):jt.push(on);jt.length&&vt.push(...jt.sort()),Ft=vt.join(":")}const xn=Ae?Ft+" !":Ft;let pn=gt.get(xn);return pn===void 0&>.set(xn,pn=Dt++),pn};let an=new Map,nn=i;const et=i+4096,Et=()=>nn++,Zt=2097152,pt=8192,St=new Int32Array(pt),yt=new Array(pt).fill(null),Ht=new Int32Array(pt),dn=new Int32Array(pt),je=new Uint8Array(pt);let at=0;const Ie=(pe,Ae,we,rt,At,Ct,Ft,xn)=>{let pn=pe;if(yt[pe]!==null)if(yt[pe|1]===null)pn=pe|1;else if((at++&3)===0)pn=pe|at>>2&1;else return;yt[pn]=Ae.slice(we,rt),St[pn]=At,Ht[pn]=Ct,dn[pn]=Ft,je[pn]=xn},_e=()=>yt.fill(null);let Ge=256,tt=[new Int32Array(Ge),new Int32Array(Ge),new Int32Array(Ge),new Int32Array(Ge)],[kt,V,W,re]=tt,ve=new Uint8Array(Ge),Se=new Uint8Array(Ge);const qe=()=>{Ge*=2,tt=tt.map(Ae=>{const we=new Int32Array(Ge);return we.set(Ae),we}),[kt,V,W,re]=tt;const pe=new Uint8Array(Ge);pe.set(ve),ve=pe,Se=new Uint8Array(Ge)};let Ke=64,Xe=new Int32Array(Ke),Qe=new Int32Array(Ke);const ct=new Int32Array(i);let nt=2048,Rt=21,ft=new Float64Array(nt),Yt=new Int32Array(nt),Bt=0;const On=(pe,Ae)=>{if(pe===0&&Ae<i)return ct[Ae]===Bt?1:(ct[Ae]=Bt,0);const we=pe*2097152+Ae+1;let rt=Math.imul(we,2654435761)>>>Rt;for(;Yt[rt]===Bt;){if(ft[rt]===we)return 1;rt=rt+1&nt-1}return ft[rt]=we,Yt[rt]=Bt,0},$t=(pe,Ae,we,rt,At)=>{if(we-Ae>=2&&pe.charCodeAt(Ae)===91&&pe.charCodeAt(we-1)===93){let Ct=-1;for(let Ft=Ae+1;Ft<we-1;Ft++)if(pe.charCodeAt(Ft)===58){Ct=Ft;break}return Ct===-1||Ct===Ae+1?yi:xt(an,pe,Ae+1,Ct,0,Et)}if(rt>=0&&f[rt]>=0)return f[rt];for(let Ct=At-1;Ct>=0;Ct--){const Ft=Qe[Ct];if(Ft>we)continue;const xn=Xe[Ct],pn=we-Ft;if(Q[xn]===1&&pn>0&&pn<=G){const zn=pe.charCodeAt(Ft);if(q===!1||zn!==91&&zn!==40){const is=$(xn,pe,Ft,we);if(is>=0)return is}}const vt=g[xn];if(vt<0)continue;const jt=x[vt],on=m[jt],mt=m[jt+1];if(on===mt)continue;ke(pe,Ft,we);const ir=H[vt]-on;for(let zn=on;zn<mt;zn++)if(Me(h[zn],pe,Ft,we))return S[ir+zn]}return yi},Vt=pe=>{const Ae=pe.length;let we=0,rt=0,At=!1;(Dt>It||dt.size>It)&&(dt=new Map,gt=new Map,Dt=2,_e()),nn>et&&(an=new Map,nn=i,_e());let Ct=0;for(;Ct<Ae;){let vt=pe.charCodeAt(Ct);if(vt===32||vt>=9&&vt<=13||vt>=160&&Ve(vt)){vt!==32&&(At=!0),Ct++;continue}const jt=Ct;let on=0;for(;Ct<Ae;){if(vt=pe.charCodeAt(Ct),vt<=32){if(vt===32)break;if(vt>=9&&vt<=13){At=!0;break}}else if(vt>=160&&Ve(vt)){At=!0;break}on=Math.imul(on^vt,16777619),Ct++}const mt=Ct,ir=mt-jt;we===Ge&&qe();const zn=we++;kt[zn]=jt,V[zn]=mt,rt+=ir,on^=Math.imul(ir,2654435761);const is=on^on>>>15|0,Xn=is&8190;{let rn=-1;if(St[Xn]===is&&yt[Xn]!==null&&yt[Xn].length===ir?rn=Xn:St[Xn|1]===is&&yt[Xn|1]!==null&&yt[Xn|1].length===ir&&(rn=Xn|1),rn>=0){const lr=yt[rn];let ws=!0;for(let ls=0;ls<ir;ls++)if(lr.charCodeAt(ls)!==pe.charCodeAt(jt+ls)){ws=!1;break}if(ws){W[zn]=Ht[rn],re[zn]=dn[rn],ve[zn]=je[rn];continue}}}let Zn=jt;if(Z!==0){if(mt-jt<=Z||!pe.startsWith(F,jt)){W[zn]=yi,Ie(Xn,pe,jt,mt,is,yi,0,0);continue}Zn=jt+Z}let Wo=0,Cc=0,Ni=-1,el=-1;for(let rn=Zn;rn<mt;rn++){const lr=pe.charCodeAt(rn);if(Wo===0&&Cc===0){if(lr===58){Ni=rn;continue}if(lr===47){el=rn;continue}}lr===91?Wo++:lr===93?Wo--:lr===40?Cc++:lr===41&&Cc--}const _d=Ni>=Zn?Ni+1:Zn;let Dn=_d,Ar=mt,aa=!1,tl=0;Ar>Dn&&pe.charCodeAt(Ar-1)===33?(aa=!0,Ar--):Ar>Dn&&pe.charCodeAt(Dn)===33&&(aa=!0,Dn++,tl=1);let Yr=-1;el>_d&&(Yr=el+tl,Yr>=Ar&&(Yr=-1));let nl=Dn;Ar-Dn>1&&pe.charCodeAt(Dn)===45&&(nl=Dn+1);let as=0,zr=0,oa=0,Tc=-1,os=0;(g[0]>=0||Q[0]===1)&&(Xe[0]=0,Qe[0]=nl,os=1);let so=No,kc=0;for(let rn=nl;rn<Ar;rn++)if(rn===Yr&&(so=zr<oa?No:as,kc=os),as!==No){const lr=pe.charCodeAt(rn);let ws=-1;if(zr<oa)u.charCodeAt(zr)===lr?(zr++,zr===oa&&(ws=as=Tc)):as=No;else{const ls=o[as],oo=o[as+1];let Di=No;for(let vr=ls;vr<oo;vr++){const lo=l[vr];if(u.charCodeAt(lo)===lr){l[vr+1]-lo===1?ws=Di=d[vr]:(zr=lo+1,oa=l[vr+1],Tc=d[vr],Di=as);break}}as=Di}if(ws>=0&&(g[ws]>=0||Q[ws]===1)&&rn+1<Ar&&pe.charCodeAt(rn+1)===45){if(os===Ke){Ke*=2;const ls=new Int32Array(Ke);ls.set(Xe),Xe=ls;const oo=new Int32Array(Ke);oo.set(Qe),Qe=oo}Xe[os]=ws,Qe[os]=rn+2,os++}}Yr===Ar&&(so=zr<oa?No:as,kc=os);const Oc=zr<oa?No:as;let yr,_r=!1;if(Yr>=0)if(_r=!0,yr=$t(pe,Dn,Yr,so,kc),yr!==yi&&yr<i&&U[yr]){const rn=$t(pe,Dn,Ar,Oc,os);rn!==yi&&rn!==yr&&(yr=rn,_r=!1)}else yr===yi&&(yr=$t(pe,Dn,Ar,Oc,os),_r=!1);else yr=$t(pe,Dn,Ar,Oc,os);let io=0,ao=0;yr===yi?W[zn]=yi:(ao=_r?1:0,io=Zn>=Ni?aa?1:0:xt(dt,pe,Zn,Ni,aa?1:0,rn=>tn(rn,aa)),W[zn]=yr,ve[zn]=ao,re[zn]=io),Ie(Xn,pe,jt,mt,is,yr,io,ao)}if(we===0)return"";if(we===1)return kt[0]===0&&V[0]===Ae?pe:pe.slice(kt[0],V[0]);if(we*B>nt){for(;we*B>nt;)nt<<=1,Rt--;ft=new Float64Array(nt),Yt=new Int32Array(nt)}if(Dt>=Zt||nn>=Zt)throw new Error("cn: too many distinct classes in one merge");Bt=Bt+1|0,Bt===0&&(ct.fill(0),Yt.fill(0),Bt=1);let Ft=!1;for(let vt=we-1;vt>=0;vt--){const jt=W[vt];if(jt===yi){Se[vt]=1;continue}const on=re[vt];if(On(on,jt)===1){Se[vt]=0,Ft=!0;continue}if(Se[vt]=1,jt<i){const mt=K[jt];if(mt>=0)for(let ir=A[mt];ir<A[mt+1];ir++)On(on,N[ir]);if(ve[vt]&1)for(let ir=0;ir<j.length;ir++)j[ir]===jt&&On(on,D[ir])}}if(!Ft&&!At&&Ae===rt+we-1)return pe;let xn="",pn=0;for(;pn<we;){if(!Se[pn]){pn++;continue}const vt=kt[pn];let jt=V[pn],on=pn+1;for(;on<we&&Se[on]&&kt[on]===jt+1&&pe.charCodeAt(jt)===32;)jt=V[on],on++;xn.length>0&&(xn+=" "),xn+=pe.slice(vt,jt),pn=on}return xn},Cn=16384,Tn=new Int32Array(Cn*2);let rs=0,fn=1,hn=Object.create(null),An=Object.create(null),jn=new Map,Mi=new Map,Lr=0,Fs=0;const ss=()=>{rs^=Cn,fn=fn+1|0,Fs=0},Ss=pe=>{let Ae=hn[pe];if(Ae!==void 0)return Ae;const we=Ih(pe,0,pe.length),rt=(we&16383)+rs,At=Tn[rt]===(we^fn)||Tn[rt^Cn]===(we^fn-1);return At&&(Ae=An[pe],Ae!==void 0)?(hn[pe]=Ae,Ae):(Ae=Vt(pe),At?(hn[pe]=Ae,++Lr>ae&&(Lr=0,An=hn,hn=Object.create(null),ss())):(Tn[rt]=we^fn,++Fs>Cn&&ss()),Ae)},_t=pe=>{let Ae=jn.get(pe);if(Ae!==void 0)return Ae;const we=Ih(pe,0,pe.length),rt=(we&16383)+rs,At=Tn[rt]===(we^fn)||Tn[rt^Cn]===(we^fn-1);return At&&(Ae=Mi.get(pe),Ae!==void 0)?(jn.set(pe,Ae),Ae):(Ae=Vt(pe),At?(jn.set(pe,Ae),++Lr>ae&&(Lr=0,Mi=jn,jn=new Map,ss())):(Tn[rt]=we^fn,++Fs>Cn&&ss()),Ae)},Yn=pe=>{const Ae=Ih(pe,0,pe.length),we=(Ae&16383)+rs;return Tn[we]===(Ae^fn)||Tn[we^Cn]===(Ae^fn-1)?!0:(Tn[we]=Ae^fn,++Fs>Cn&&ss(),!1)},Bn=ae===0?Vt:MP?pe=>{const Ae=jn.get(pe);return Ae!==void 0?Ae:_t(pe)}:Ss;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?Bn(arguments[0]):Bn(jP.apply(null,arguments))},mergeString:Bn,seenBefore:ae===0?()=>!1:Yn,mergeUncached:Vt}},sp=(e,t)=>{if(!e)return"";if(typeof e=="string")return e;let s="";if(typeof e.length=="number"&&(!t||Array.isArray(e))){const i=e;for(let o=0;o<i.length;o++){const l=i[o];if(!l)continue;const u=typeof l=="string"?l:sp(l,t);u&&(s&&(s+=" "),s+=u)}return s}if(t){if(typeof e=="number")return""+e;if(typeof e=="object")for(const i in e)e[i]&&(s&&(s+=" "),s+=i)}return s},DP=(e,t)=>{let s="";for(let i=0;i<e.length;i++){const o=e[i];if(!o)continue;const l=typeof o=="string"?o:sp(o,t);l&&(s&&(s+=" "),s+=l)}return s},jP=function(){return DP(arguments,!1)},IP=256,yE=16,PP=1024,my=4096,LP=(e,t)=>{const s=t===void 0?()=>!0:t.seenBefore,i=t===void 0?e:t.mergeUncached;let o=new Map,l=new Map,u=0,d=null,f=null,g=[],m=[],h=0;const x=(R,O,T)=>{f===null&&(f=new Array(my).fill(""),g=new Array(my).fill(""),m=new Array(my).fill(""));const A=Ih(R,0,R.length)&4094;if(f[A]===R&&g[A]===O)return m[A];if(f[A|1]===R&&g[A|1]===O)return m[A|1];const N=e(T?O+" "+R:R),j=f[A]===""?A:A|(f[A|1]===""?1:h++&1);return f[j]=R,g[j]=O,m[j]=N,N},S=(R,O,T,A)=>{let N=0;if(O){if(O!==R.a0)return!1;N=1}if(T){if(T!==(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,O)=>{const T=R.a;let A=0;for(let N=0;N<O.length;N++){const j=O[N];if(j){if(j!==T[A])return!1;A++}}return A===R.t},C=(R,O)=>{const T=R.length,A=d===null?null:d.n;if(!O){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 K=0;K<T;K++){let X=R[K];if(X){if(typeof X!="string"){if(X=R[K]=sp(X,!0),!X)continue;M=!0}j<0&&(N=X,j=K),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 z=o.get(N);z===void 0&&(z=l.get(N),z!==void 0&&o.set(N,z));let L=null;if(z!==void 0){if(z.skip>0){z.skip--,d=null;let X=N;for(let B=j+1;B<T;B++){const H=R[B];H&&(X+=" "+H)}return x(X,"",!1)}const K=z.e;e:for(let X=0;X<K.length;X++){const B=K[X];if(B.t!==D)continue;const H=B.a;let U=1;for(let _=j+1;_<T;_++){const Q=R[_];if(Q&&Q!==H[U++])continue e}L=B;break}L!==null&&(z.miss=0)}if(L===null){let K=N;const X=[N];for(let H=j+1;H<T;H++){const U=R[H];U&&(K+=" "+U,X.push(U))}if(!s(K))return i(K);L={r:e(K),t:X.length,a0:X[0],a1:X[1],a2:X[2]??"",a:X,n:null},z===void 0?o.set(N,z={e:[],miss:0,skip:0,at:0}):++z.miss>yE&&(z.miss=yE,z.skip=PP,z.e.length=0,z.at=0);const B=z.e;B.length<IP?B.push(L):(B[z.at]=L,z.at=z.at+1&255),++u>1e3&&(u=0,l=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(sp(R,!0));return function(R,O,T){const A=arguments.length;if((A|1)===3){const D=d;if(D!==null){const M=D.n;if(M!==null&&S(M,R,O,T))return d=M,M.r;if(D!==M&&S(D,R,O,T))return D.r}if(A===2&&typeof O=="string"&&O!==""){const M=o.get(R);if(M!==void 0&&M.skip>0)return M.skip--,d=null,x(O,R,!0)}return C([R,O,T],!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 z=0,L=!0;for(let K=0;K<A;K++){const X=arguments[K];if(X){if(X!==M[z]){L=!1;break}z++}}if(L&&z===D.t)return d=D,D.r}if(N!==D){const M=N.a;let z=0,L=!0;for(let K=0;K<A;K++){const X=arguments[K];if(X){if(X!==M[z]){L=!1;break}z++}}if(L&&z===N.t)return N.r}}const j=[];for(let D=0;D<A;D++)j.push(arguments[D]);return C(j,!0)}},vE=NP(AP),He=LP(vE.mergeString,vE);function zP({delay:e=0,...t}){return y.jsx(aP,{"data-slot":"tooltip-provider",delay:e,...t})}function ip({...e}){return y.jsx(z3,{"data-slot":"tooltip",...e})}function ap({...e}){return y.jsx(F3,{"data-slot":"tooltip-trigger",...e})}function op({className:e,side:t="top",sideOffset:s=4,align:i="center",alignOffset:o=0,children:l,...u}){return y.jsx(K3,{children:y.jsx(rP,{align:i,alignOffset:o,side:t,sideOffset:s,className:"isolate z-50",children:y.jsxs(sP,{"data-slot":"tooltip-content",className:He("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:[l,y.jsx(iP,{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 _P=(e,t,s,i,o,l,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&&l?o.map(R=>l[R]||R):o;C?(f.classList.remove(...E),f.classList.add(l&&l[S]?l[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(i)m(i);else try{let S=localStorage.getItem(t)||s,w=u&&S==="system"?x():S;m(w)}catch{}},UP=b.createContext(void 0),HP={setTheme:e=>{},themes:[]},FP=()=>{var e;return(e=b.useContext(UP))!=null?e:HP};b.memo(({forcedTheme:e,storageKey:t,attribute:s,enableSystem:i,enableColorScheme:o,defaultTheme:l,value:u,themes:d,nonce:f,scriptProps:g})=>{let m=JSON.stringify([s,t,l,e,d,u,i,o]).slice(1,-1);return b.createElement("script",{...g,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${_P.toString()})(${m})`}})});function BP(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const VP=e=>{switch(e){case"success":return YP;case"info":return GP;case"warning":return $P;case"error":return QP;default:return null}},KP=Array(12).fill(0),qP=({visible:e,className:t})=>Ne.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ne.createElement("div",{className:"sonner-spinner"},KP.map((s,i)=>Ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),YP=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"})),$P=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"})),GP=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"})),QP=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"})),XP=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"})),ZP=()=>{const[e,t]=Ne.useState(document.hidden);return Ne.useEffect(()=>{const s=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[]),e};let JP=1;const WP=100,bE=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:JP++};class eL{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(s=>t(s)),()=>{const s=this.subscribers.indexOf(t);this.subscribers.splice(s,1)}),this.publish=t=>{this.subscribers.forEach(s=>s(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-WP;t<=0||(this.toasts=this.toasts.filter(s=>t>0&&this.dismissedToasts.has(s.id)?(this.dismissedToasts.delete(s.id),t--,!1):!0))},this.create=t=>{const{message:s,...i}=t,o=bE(t),l=this.pendingDismissals.get(o);l!==void 0&&(cancelAnimationFrame(l),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:s}),{...g,...t,id:o,dismissible:d,title:s}):g):this.addToast({title:s,...i,dismissible:d,id:o}),o},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(i=>{this.dismissedToasts.add(i.id),this.subscribers.forEach(o=>o({id:i.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const s=this.pendingDismissals.get(t);return s!==void 0&&cancelAnimationFrame(s),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(i=>i({id:t,dismiss:!0}))})),t},this.message=(t,s)=>this.create({...s,message:t,type:void 0}),this.error=(t,s)=>this.create({...s,message:t,type:"error"}),this.success=(t,s)=>this.create({...s,type:"success",message:t}),this.info=(t,s)=>this.create({...s,type:"info",message:t}),this.warning=(t,s)=>this.create({...s,type:"warning",message:t}),this.loading=(t,s)=>this.create({...s,type:"loading",message:t}),this.promise=(t,s)=>{if(!s)return;let i;s.loading!==void 0&&(i=this.create({...s,promise:t,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let l=i!==void 0,u;const d=o.then(async g=>{if(u=["resolve",g],Ne.isValidElement(g))l=!1,this.create({id:i,type:"default",message:g});else if(nL(g)&&!g.ok){l=!1;const h=typeof s.error=="function"?await s.error(`HTTP error! status: ${g.status}`):s.error,x=typeof s.description=="function"?await s.description(`HTTP error! status: ${g.status}`):s.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:i,type:"error",description:x,...w})}else if(g instanceof Error){l=!1;const h=typeof s.error=="function"?await s.error(g):s.error,x=typeof s.description=="function"?await s.description(g):s.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:i,type:"error",description:x,...w})}else if(s.success!==void 0){l=!1;const h=typeof s.success=="function"?await s.success(g):s.success,x=typeof s.description=="function"?await s.description(g):s.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:i,type:"success",description:x,...w})}}).catch(async g=>{if(u=["reject",g],s.error!==void 0){l=!1;const m=typeof s.error=="function"?await s.error(g):s.error,h=typeof s.description=="function"?await s.description(g):s.description,S=typeof m=="object"&&!Ne.isValidElement(m)?m:{message:m};this.create({id:i,type:"error",description:h,...S})}}).finally(()=>{l&&(this.dismiss(i),i=void 0),s.finally==null||s.finally.call(s)}),f=()=>new Promise((g,m)=>d.then(()=>u[0]==="reject"?m(u[1]):g(u[1])).catch(m));return typeof i!="string"&&typeof i!="number"?{unwrap:f}:Object.assign(i,{unwrap:f})},this.custom=(t,s)=>{const i=bE(s);return this.create({...s,jsx:t(i),id:i,type:void 0}),i},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Jr=new eL,tL=(e,t)=>Jr.message(e,t),nL=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",rL=tL,sL=()=>Jr.toasts,iL=()=>Jr.getActiveToasts(),Nt=Object.assign(rL,{success:Jr.success,info:Jr.info,warning:Jr.warning,error:Jr.error,custom:Jr.custom,message:Jr.message,promise:Jr.promise,dismiss:Jr.dismiss,loading:Jr.loading},{getHistory:sL,getToasts:iL});BP("[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 hh(e){return e.label!==void 0}const aL=3,oL="24px",lL="16px",xE=4e3,cL=356,uL=14,dL=45,fL=200;function vi(...e){return e.filter(Boolean).join(" ")}function hL(e){const[t,s]=e.split("-"),i=[];return t&&i.push(t),s&&i.push(s),i}const pL=e=>{var t,s,i,o,l,u,d,f,g;const{invert:m,toast:h,unstyled:x,interacting:S,setHeights:w,visibleToasts:C,heights:E,index:R,toasts:O,expanded:T,removeToast:A,defaultRichColors:N,closeButton:j,style:D,cancelButtonStyle:M,actionButtonStyle:z,className:L="",descriptionClassName:K="",duration:X,position:B,gap:H,expandByDefault:U,classNames:_,icons:Q,closeButtonAriaLabel:G="Close toast"}=e,[q,Y]=Ne.useState(null),[ee,$]=Ne.useState(null),[ae,I]=Ne.useState(!1),[F,Z]=Ne.useState(!1),[ne,ye]=Ne.useState(!1),[se,ge]=Ne.useState(!1),[fe,ce]=Ne.useState(!1),[Re,be]=Ne.useState(0),[Le,Oe]=Ne.useState(0),ze=Ne.useRef(h.duration||X||xE),Ve=Ne.useRef(null),ke=Ne.useRef(null),Ue=R===0,xe=R+1<=C,Fe=h.type,Je=Fe??"default",ot=h.dismissible!==!1,de=h.className||"",Ee=h.descriptionClassName||"",$e=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||xE,[h.duration,X]),xt=Ne.useRef(0),dt=Ne.useRef(0),gt=Ne.useRef(0),Dt=Ne.useRef(null),[It,tn]=B.split("-"),an=Ne.useMemo(()=>E.reduce((je,at,Ie)=>Ie>=$e?je:je+at.height,0),[E,$e]),nn=ZP(),et=Ne.useMemo(()=>{var je;return(je=e.swipeDirections)!=null?je:hL(B)},[e.swipeDirections,B]),Et=h.invert||m,Zt=Fe==="loading";dt.current=Ne.useMemo(()=>$e*H+an,[$e,an]),Ne.useEffect(()=>{ze.current=De},[De]),Ne.useEffect(()=>{I(!0)},[]),Ne.useEffect(()=>{const je=ke.current;if(je){const at=je.getBoundingClientRect().height;return Oe(at),w(Ie=>[{toastId:h.id,height:at,position:h.position},...Ie]),()=>w(Ie=>Ie.filter(_e=>_e.toastId!==h.id))}},[w,h.id]),Ne.useLayoutEffect(()=>{if(!ae)return;const je=ke.current,at=je.style.height;je.style.height="auto";const Ie=je.getBoundingClientRect().height;je.style.height=at,Oe(Ie),w(_e=>_e.find(tt=>tt.toastId===h.id)?_e.map(tt=>tt.toastId===h.id?{...tt,height:Ie}:tt):[{toastId:h.id,height:Ie,position:h.position},..._e])},[ae,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const pt=Ne.useCallback(()=>{Z(!0),be(dt.current),w(je=>je.filter(at=>at.toastId!==h.id)),setTimeout(()=>{A(h)},fL)},[h,A,w,dt]);Ne.useEffect(()=>{if(h.promise&&Fe==="loading"||h.duration===1/0||h.type==="loading")return;let je;return T||S||nn?(()=>{if(gt.current<xt.current){const _e=new Date().getTime()-xt.current;ze.current=ze.current-_e}gt.current=new Date().getTime()})():ze.current!==1/0&&(xt.current=new Date().getTime(),je=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),pt()},ze.current)),()=>clearTimeout(je)},[T,S,h,Fe,nn,pt]),Ne.useEffect(()=>{h.delete&&(pt(),h.onDismiss==null||h.onDismiss.call(h,h))},[pt,h.delete]);function St(){var je;if(Q?.loading){var at;return Ne.createElement("div",{className:vi(_?.loader,h==null||(at=h.classNames)==null?void 0:at.loader,"sonner-loader"),"data-visible":Fe==="loading"},Q.loading)}return Ne.createElement(qP,{className:vi(_?.loader,h==null||(je=h.classNames)==null?void 0:je.loader),visible:Fe==="loading"})}const yt=h.icon||Q?.[Fe]||VP(Fe);var Ht,dn;return Ne.createElement("li",{tabIndex:0,ref:ke,className:vi(L,de,_?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,_?.[Je],h==null||(s=h.classNames)==null?void 0:s[Je]),"data-sonner-toast":"","data-rich-colors":(Ht=h.richColors)!=null?Ht:N,"data-styled":!(h.jsx||h.unstyled||x),"data-mounted":ae,"data-promise":!!h.promise,"data-swiped":fe,"data-removed":F,"data-visible":xe,"data-y-position":It,"data-x-position":tn,"data-index":R,"data-front":Ue,"data-swiping":ne,"data-dismissible":ot,"data-type":Fe,"data-invert":Et,"data-swipe-out":se,"data-swipe-direction":ee,"data-expanded":!!(T||U&&ae),"data-testid":h.testId,style:{"--index":R,"--toasts-before":R,"--z-index":O.length-R,"--offset":`${F?Re:dt.current}px`,"--initial-height":U?"auto":`${Le}px`,...D,...h.style},onDragEnd:()=>{ye(!1),Y(null),Dt.current=null},onPointerDown:je=>{je.button!==2&&(Zt||!ot||(Ve.current=new Date,be(dt.current),je.target.setPointerCapture(je.pointerId),je.target.tagName!=="BUTTON"&&(ye(!0),Dt.current={x:je.clientX,y:je.clientY})))},onPointerUp:()=>{var je,at,Ie;if(se||!ot)return;Dt.current=null;const _e=Number(((je=ke.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ge=Number(((at=ke.current)==null?void 0:at.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),tt=new Date().getTime()-((Ie=Ve.current)==null?void 0:Ie.getTime()),kt=q==="x"?_e:Ge,V=Math.abs(kt)/tt;if((q==="x"?et.includes(_e>0?"right":"left"):et.includes(Ge>0?"bottom":"top"))&&(Math.abs(kt)>=dL||V>.11)){be(dt.current),h.onDismiss==null||h.onDismiss.call(h,h),$(q==="x"?_e>0?"right":"left":Ge>0?"down":"up"),pt(),ge(!0);return}else{var re,ve;(re=ke.current)==null||re.style.setProperty("--swipe-amount-x","0px"),(ve=ke.current)==null||ve.style.setProperty("--swipe-amount-y","0px")}ce(!1),ye(!1),Y(null)},onPointerMove:je=>{var at,Ie,_e;if(!Dt.current||!ot||((at=window.getSelection())==null?void 0:at.toString().length)>0)return;const tt=je.clientY-Dt.current.y,kt=je.clientX-Dt.current.x;!q&&(Math.abs(kt)>1||Math.abs(tt)>1)&&Y(Math.abs(kt)>Math.abs(tt)?"x":"y");let V={x:0,y:0};const W=re=>1/(1.5+Math.abs(re)/20);if(q==="y"){if(et.includes("top")||et.includes("bottom"))if(et.includes("top")&&tt<0||et.includes("bottom")&&tt>0)V.y=tt;else{const re=tt*W(tt);V.y=Math.abs(re)<Math.abs(tt)?re:tt}}else if(q==="x"&&(et.includes("left")||et.includes("right")))if(et.includes("left")&&kt<0||et.includes("right")&&kt>0)V.x=kt;else{const re=kt*W(kt);V.x=Math.abs(re)<Math.abs(kt)?re:kt}(Math.abs(V.x)>0||Math.abs(V.y)>0)&&ce(!0),(Ie=ke.current)==null||Ie.style.setProperty("--swipe-amount-x",`${V.x}px`),(_e=ke.current)==null||_e.style.setProperty("--swipe-amount-y",`${V.y}px`)}},Me&&!h.jsx&&Fe!=="loading"?Ne.createElement("button",{"aria-label":G,"data-disabled":Zt,"data-close-button":!0,onClick:Zt||!ot?()=>{}:()=>{pt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:vi(_?.closeButton,h==null||(i=h.classNames)==null?void 0:i.closeButton)},(dn=Q?.close)!=null?dn:XP):null,(Fe||h.icon||h.promise)&&h.icon!==null&&(Q?.[Fe]!==null||h.icon)?Ne.createElement("div",{"data-icon":"",className:vi(_?.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},Fe==="loading"?h.icon||St():h.promise?St():null,Fe!=="loading"?yt:null):null,Ne.createElement("div",{"data-content":"",className:vi(_?.content,h==null||(l=h.classNames)==null?void 0:l.content)},Ne.createElement("div",{"data-title":"",className:vi(_?.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:vi(K,Ee,_?.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&&hh(h.cancel)?Ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||M,onClick:je=>{hh(h.cancel)&&ot&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,je),pt())},className:vi(_?.cancelButton,h==null||(f=h.classNames)==null?void 0:f.cancelButton)},h.cancel.label):null,Ne.isValidElement(h.action)?h.action:h.action&&hh(h.action)?Ne.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||z,onClick:je=>{hh(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,je),!je.defaultPrevented&&pt())},className:vi(_?.actionButton,h==null||(g=h.classNames)==null?void 0:g.actionButton)},h.action.label):null)};function SE(){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 gL(e,t){const s={};return[e,t].forEach((i,o)=>{const l=o===1,u=l?"--mobile-offset":"--offset",d=l?lL:oL;function f(g){["top","right","bottom","left"].forEach(m=>{s[`${u}-${m}`]=typeof g=="number"?`${g}px`:g})}typeof i=="number"||typeof i=="string"?f(i):typeof i=="object"?["top","right","bottom","left"].forEach(g=>{i[g]===void 0?s[`${u}-${g}`]=d:s[`${u}-${g}`]=typeof i[g]=="number"?`${i[g]}px`:i[g]}):f(d)}),s}const mL=Ne.forwardRef(function(t,s){const{id:i,invert:o,position:l="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=aL,toastOptions:R,dir:O=SE(),gap:T=uL,icons:A,customAriaLabel:N,containerAriaLabel:j="Notifications"}=t,[D,M]=Ne.useState([]),z=Ne.useMemo(()=>i?D.filter(I=>I.toasterId===i):D.filter(I=>!I.toasterId),[D,i]),L=Ne.useMemo(()=>Array.from(new Set([l].concat(z.filter(I=>I.position).map(I=>I.position)))),[z,l]),[K,X]=Ne.useState([]),[B,H]=Ne.useState(!1),[U,_]=Ne.useState(!1),[Q,G]=Ne.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=Ne.useRef(null),Y=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=Ne.useRef(null),$=Ne.useRef(!1),ae=Ne.useCallback(I=>{M(F=>{var Z;return(Z=F.find(ne=>ne.id===I.id))!=null&&Z.delete||Jr.dismiss(I.id),F.filter(({id:ne})=>ne!==I.id)})},[]);return Ne.useEffect(()=>Jr.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{M(F=>F.map(Z=>Z.id===I.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{sI.flushSync(()=>{M(F=>{const Z=F.findIndex(ne=>ne.id===I.id);return Z!==-1?[...F.slice(0,Z),{...F[Z],...I},...F.slice(Z+1)]:[I,...F]})})})}),[]),Ne.useEffect(()=>{if(x!=="system"){G(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:F})=>{G(F?"dark":"light")})}catch{I.addListener(({matches:Z})=>{try{G(Z?"dark":"light")}catch(ne){console.error(ne)}})}},[x]),Ne.useEffect(()=>{D.length<=1&&H(!1)},[D]),Ne.useEffect(()=>{const I=F=>{var Z;if(u.length>0&&u.every(se=>F[se]||F.code===se)){var ye;H(!0),(ye=q.current)==null||ye.focus()}F.code==="Escape"&&(document.activeElement===q.current||(Z=q.current)!=null&&Z.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[u]),Ne.useEffect(()=>{if(q.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,$.current=!1)}},[q.current]),Ne.createElement("section",{ref:s,"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,F)=>{var Z;const[ne,ye]=I.split("-");return z.length?Ne.createElement("ol",{key:I,dir:O==="auto"?SE():O,tabIndex:-1,ref:q,className:g,"data-sonner-toaster":!0,"data-sonner-theme":Q,"data-y-position":ne,"data-x-position":ye,style:{"--front-toast-height":`${((Z=K[0])==null?void 0:Z.height)||0}px`,"--width":`${cL}px`,"--gap":`${T}px`,...C,...gL(m,h)},onBlur:se=>{$.current&&!se.currentTarget.contains(se.relatedTarget)&&($.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||$.current||($.current=!0,ee.current=se.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{U||H(!1)},onDragEnd:()=>H(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||_(!0)},onPointerUp:()=>_(!1)},z.filter(se=>!se.position&&F===0||se.position===I).map((se,ge)=>{var fe,ce;return Ne.createElement(pL,{key:se.id,icons:A,index:ge,toast:se,defaultRichColors:S,duration:(fe=R?.duration)!=null?fe:w,className:R?.className,descriptionClassName:R?.descriptionClassName,invert:o,visibleToasts:E,closeButton:(ce=R?.closeButton)!=null?ce:f,interacting:U,position:I,style:R?.style,unstyled:R?.unstyled,classNames:R?.classNames,cancelButtonStyle:R?.cancelButtonStyle,actionButtonStyle:R?.actionButtonStyle,closeButtonAriaLabel:R?.closeButtonAriaLabel,removeToast:ae,toasts:z.filter(Re=>Re.position==se.position),heights:K.filter(Re=>Re.position==se.position),setHeights:X,expandByDefault:d,gap:T,expanded:B,swipeDirections:t.swipeDirections})})):null}))}),yL=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join("-").toLowerCase();function vL(e,t,s=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:yL(e),size:24,node:t,...s.length>0?{aliases:s}:{}}}const bL=e=>{let t="",s=!1;for(const i of e){if(i==="-"||i==="_"||i<=" "){s=t.length>0;continue}t.length===0?t+=i.toLowerCase():t+=s?i.toUpperCase():i,s=!1}return t},xL=e=>{const t=bL(e);return t.charAt(0).toUpperCase()+t.slice(1)},Qy=(...e)=>{const t=new Set;for(const s of e)if(typeof s=="string")for(const i of s.split(/\s+/))i&&t.add(i);return[...t].join(" ")},_l={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 yy(e){return e!=null}function SL(e,t={}){const s=t.attributeNames??{},i=x=>s[x]??x,o=e.size??e.width??_l.width,l=e.size??e.height??_l.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?Qy(...f):Qy("lucide",...d,...f);let m=t.strokeWidth??_l["stroke-width"];if(t.absoluteStrokeWidth){const x=Number(m)*Number(e.size??e.width??_l.width)/Number(t.size??t.width??_l.width);Number.isFinite(x)&&(m=x)}return["svg",{...Object.entries(_l).reduce((x,[S,w])=>(x[i(S)]=w,x),{}),..."color"in t&&t.color&&{[i("stroke")]:t.color},..."size"in t&&yy(t.size)&&{[i("width")]:t.size,[i("height")]:t.size},..."width"in t&&yy(t.width)&&{[i("width")]:t.width},..."height"in t&&yy(t.height)&&{[i("height")]:t.height},[i("stroke-width")]:m,...g&&{[i("class")]:g},[i("viewBox")]:`0 0 ${o} ${l}`,...t.hasA11yProp===!1?{[i("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(x=>{const[S,w,C]=x,E=t.nonScalingStroke?{[i("vector-effect")]:"non-scaling-stroke",...w}:w;return C?[S,E,C]:[S,E]})]}function wL(e,t={}){return SL(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const EL=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},RL=b.createContext({}),CL=()=>b.useContext(RL),TL=b.forwardRef(({color:e,size:t,width:s,height:i,strokeWidth:o,absoluteStrokeWidth:l,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:O=""}=CL()??{},T=!!f||EL(h),[A,N,j=[]]=wL(m,{color:e??R,width:s??t??S,height:i??t??S,strokeWidth:o??w,absoluteStrokeWidth:l??C,nonScalingStroke:u??E,className:Qy(O,d),hasA11yProp:T,attributes:h});return b.createElement(A,{ref:x,...N},[...j.map(([D,M])=>b.createElement(D,M)),...Array.isArray(f)?f:[f]])});function Ot(e,t=[],s=[]){const i=typeof e=="string"?vL(e,t,s):e,o=b.forwardRef(({className:l,...u},d)=>b.createElement(TL,{ref:d,icon:i,className:l,...u}));return i.name&&(o.displayName=xL(i.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 kL=Ot(OT),AT={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"}]]};AT.node;const ib=Ot(AT),MT={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};MT.node;const pd=Ot(MT),NT={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};NT.node;const ab=Ot(NT),DT={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};DT.node;const ob=Ot(DT),jT={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};jT.node;const OL=Ot(jT),IT={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"]};IT.node;const PT=Ot(IT),LT={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"]};LT.node;const AL=Ot(LT),zT={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"]};zT.node;const ML=Ot(zT),_T={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"}]]};_T.node;const UT=Ot(_T),HT={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"}]]};HT.node;const ig=Ot(HT),FT={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"]};FT.node;const ag=Ot(FT),BT={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"}]]};BT.node;const NL=Ot(BT),VT={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"}]]};VT.node;const DL=Ot(VT),KT={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"}]]};KT.node;const qT=Ot(KT),YT={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"}]]};YT.node;const $T=Ot(YT),GT={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"}]]};GT.node;const jL=Ot(GT),QT={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"}]]};QT.node;const lb=Ot(QT),XT={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"}]]};XT.node;const IL=Ot(XT),ZT={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"}]]};ZT.node;const cb=Ot(ZT),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 PL=Ot(JT),WT={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"}]]};WT.node;const ek=Ot(WT),tk={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"}]]};tk.node;const ub=Ot(tk),nk={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"}]]};nk.node;const LL=Ot(nk),rk={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"}]]};rk.node;const zL=Ot(rk),sk={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"}]]};sk.node;const _L=Ot(sk),ik={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"}]]};ik.node;const UL=Ot(ik),ak={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};ak.node;const HL=Ot(ak),ok={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};ok.node;const Pr=Ot(ok),lk={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"}]]};lk.node;const FL=Ot(lk),ck={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};ck.node;const BL=Ot(ck),uk={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"]};uk.node;const VL=Ot(uk),dk={name:"package-plus",size:24,node:[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"M16 17h6",key:"1ook5g"}],["path",{d:"M19 14v6",key:"1ckrd5"}],["path",{d:"M21 10.535V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.675-.955",key:"28k6lz"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]};dk.node;const wE=Ot(dk),fk={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"}]]};fk.node;const KL=Ot(fk),hk={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"]};hk.node;const qL=Ot(hk),pk={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"}]]};pk.node;const gk=Ot(pk),mk={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};mk.node;const gc=Ot(mk),yk={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"}]]};yk.node;const YL=Ot(yk),vk={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"}]]};vk.node;const bk=Ot(vk),xk={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"}]]};xk.node;const db=Ot(xk),Sk={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"}]]};Sk.node;const $L=Ot(Sk),wk={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"}]]};wk.node;const Ek=Ot(wk),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 GL=Ot(Rk),Ck={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"]};Ck.node;const qu=Ot(Ck),Tk={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"]};Tk.node;const fb=Ot(Tk),kk={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"]};kk.node;const Ok=Ot(kk),Ak={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"}]]};Ak.node;const Vo=Ot(Ak),Mk={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Mk.node;const ra=Ot(Mk),QL=({...e})=>{const{theme:t="system"}=FP();return y.jsx(mL,{theme:t,className:"toaster group",icons:{success:y.jsx(PT,{className:"size-4"}),info:y.jsx(LL,{className:"size-4"}),warning:y.jsx(fb,{className:"size-4"}),error:y.jsx(VL,{className:"size-4"}),loading:y.jsx(Pr,{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})},Tt=e=>typeof e=="string",Su=()=>{let e,t;const s=new Promise((i,o)=>{e=i,t=o});return s.resolve=e,s.reject=t,s},ph=e=>e==null?"":String(e),XL=(e,t,s)=>{e.forEach(i=>{t[i]&&(s[i]=t[i])})},ZL=/###/g,EE=e=>e&&e.includes("###")?e.replace(ZL,"."):e,RE=e=>!e||Tt(e),ju=(e,t,s)=>{const i=Tt(t)?t.split("."):t;let o=0;for(;o<i.length-1;){if(RE(e))return{};const l=EE(i[o]);!e[l]&&s&&(e[l]=new s),Object.prototype.hasOwnProperty.call(e,l)?e=e[l]:e={},++o}return RE(e)?{}:{obj:e,k:EE(i[o])}},CE=(e,t,s)=>{const{obj:i,k:o}=ju(e,t,Object);if(i!==void 0||t.length===1){i[o]=s;return}let l=t[t.length-1],u=t.slice(0,t.length-1),d=ju(e,u,Object);for(;d.obj===void 0&&u.length;)l=`${u[u.length-1]}.${l}`,u=u.slice(0,u.length-1),d=ju(e,u,Object),d?.obj&&typeof d.obj[`${d.k}.${l}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${l}`]=s},JL=(e,t,s,i)=>{const{obj:o,k:l}=ju(e,t,Object);o[l]=o[l]||[],o[l].push(s)},lp=(e,t)=>{const{obj:s,k:i}=ju(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},WL=(e,t,s)=>{const i=lp(e,s);return i!==void 0?i:lp(t,s)},Nk=(e,t,s)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Tt(e[i])||e[i]instanceof String||Tt(t[i])||t[i]instanceof String?s&&(e[i]=t[i]):Nk(e[i],t[i],s):e[i]=t[i]);return e},qi=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),e5={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},t5=e=>Tt(e)?e.replace(/[&<>"'\/]/g,t=>e5[t]):e;class n5{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const s=this.regExpMap.get(t);if(s!==void 0)return s;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const r5=[" ",",","?","!",";"],s5=new n5(20),i5=(e,t,s)=>{t=t||"",s=s||"";const i=r5.filter(u=>!t.includes(u)&&!s.includes(u));if(i.length===0)return!0;const o=s5.getRegExp(`(${i.map(u=>u==="?"?"\\?":u).join("|")})`);let l=!o.test(e);if(!l){const u=e.indexOf(s);u>0&&!o.test(e.substring(0,u))&&(l=!0)}return l},Xy=(e,t,s=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(s);let o=e;for(let l=0;l<i.length;){if(!o||typeof o!="object")return;let u,d="";for(let f=l;f<i.length;++f)if(f!==l&&(d+=s),d+=i[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<i.length-1)continue;l+=f-l+1;break}o=u}return o},cc=e=>e?.replace(/_/g,"-"),a5={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 cp{constructor(t,s={}){this.init(t,s)}init(t,s={}){this.prefix=s.prefix||"i18next:",this.logger=t||a5,this.options=s,this.debug=s.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,s,i,o){return o&&!this.debug?null:(t=t.map(l=>Tt(l)?l.replace(/[\r\n\x00-\x1F\x7F]/g," "):l),Tt(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[s](t))}create(t){return new cp(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new cp(this.logger,t)}}var wi=new cp;class og{constructor(){this.observers={}}on(t,s){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const o=this.observers[i].get(s)||0;this.observers[i].set(s,o+1)}),this}off(t,s){if(this.observers[t]){if(!s){delete this.observers[t];return}this.observers[t].delete(s)}}once(t,s){const i=(...o)=>{s(...o),this.off(t,i)};return this.on(t,i),this}emit(t,...s){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,l])=>{for(let u=0;u<l;u++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,l])=>{for(let u=0;u<l;u++)o(t,...s)})}}const TE=new WeakSet;class kE extends og{constructor(t,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=s,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 s=this.options.ns.indexOf(t);s>-1&&this.options.ns.splice(s,1)}getResource(t,s,i,o={}){const l=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,s],i&&(Array.isArray(i)?d.push(...i):Tt(i)&&l?d.push(...i.split(l)):d.push(i)));const f=lp(this.data,d);return f==null&&!s&&!i&&t.includes(".")&&(t=d[0],s=d[1],i=d.slice(2).join(".")),f!=null||!u||!Tt(i)?f:Xy(this.data?.[t]?.[s],i,l)}addResource(t,s,i,o,l={silent:!1}){const u=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let d=[t,s];i&&(d=d.concat(u?i.split(u):i)),t.includes(".")&&(d=t.split("."),o=s,s=d[1]),this.addNamespaces(s),CE(this.data,d,o),l.silent||this.emit("added",t,s,i,o)}addResources(t,s,i,o={silent:!1}){for(const l in i)(Tt(i[l])||Array.isArray(i[l]))&&this.addResource(t,s,l,i[l],{silent:!0});o.silent||this.emit("added",t,s,i)}addResourceBundle(t,s,i,o,l,u={silent:!1,skipCopy:!1}){let d=[t,s];t.includes(".")&&(d=t.split("."),o=i,i=s,s=d[1]),this.addNamespaces(s);let f=lp(this.data,d)||{};u.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?Nk(f,i,l):f={...f,...i},CE(this.data,d,f),u.silent||this.emit("added",t,s,i)}removeResourceBundle(t,s){this.hasResourceBundle(t,s)&&delete this.data[t][s],this.removeNamespaces(s),this.emit("removed",t,s)}hasResourceBundle(t,s){return this.getResource(t,s)!==void 0}getResourceBundle(t,s){return s||(s=this.options.defaultNS),this.getResource(t,s)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const s=this.getDataByLanguage(t);return!!(s&&Object.keys(s)||[]).find(o=>{const l=s[o];return TE.has(l)?!0:!l||Object.keys(l).length===0?!1:(typeof l=="object"&&TE.add(l),!0)})}toJSON(){return this.data}}var Dk={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,s,i,o){return e.forEach(l=>{t=this.processors[l]?.process(t,s,i,o)??t}),t}};const jk=Symbol("i18next/PATH_KEY");function o5(){const e=[],t=Object.create(null);let s;return t.get=(i,o)=>(s?.revoke?.(),o===jk?e:(e.push(o),s=Proxy.revocable(i,t),s.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Fa(e,t){const{[jk]:s}=e(o5()),i=t?.keySeparator??".",o=t?.nsSeparator??":",l=t?.enableSelector==="strict";if(s.length>1&&o){const u=t?.ns,d=l?Array.isArray(u)?u:u?[u]:null:Array.isArray(u)?u:null;if(d&&(l?d:d.length>1?d.slice(1):[]).includes(s[0]))return`${s[0]}${o}${s.slice(1).join(i)}`}return s.join(i)}const vy=e=>!Tt(e)&&typeof e!="boolean"&&typeof e!="number";class up extends og{constructor(t,s={}){super(),XL(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wi.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,s={interpolation:{}}){const i={...s};if(t==null)return!1;const o=this.resolve(t,i);if(o?.res===void 0)return!1;const l=vy(o.res);return!(i.returnObjects===!1&&l)}extractFromKey(t,s){let i=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=s.ns||this.options.defaultNS||[];const u=i&&t.includes(i),d=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!i5(t,i,o);if(u&&!d){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:Tt(l)?[l]:l};const g=t.split(i);(i!==o||i===o&&this.options.ns.includes(g[0]))&&(l=g.shift()),t=g.join(o)}return{key:t,namespaces:Tt(l)?[l]:l}}translate(t,s,i){let o=typeof s=="object"?{...s}:s;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=Fa(t,{...this.options,...o})),Array.isArray(t)||(t=[String(t)]),t=t.map(B=>typeof B=="function"?Fa(B,{...this.options,...o}):String(B));const l=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?l?{res:`${g}${m}${d}`,usedKey:d,exactUsedKey:d,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(o)}:`${g}${m}${d}`:l?{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]"],O=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject,A=o.count!==void 0&&!Tt(o.count),N=up.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,z=M&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${j}`]||o[`defaultValue${D}`]||o.defaultValue;let L=w;T&&!w&&N&&(L=z);const K=vy(L),X=Object.prototype.toString.apply(L);if(T&&L&&K&&!R.includes(X)&&!(Tt(O)&&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 l?(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 _ in L)if(Object.prototype.hasOwnProperty.call(L,_)){const Q=`${U}${u}${_}`;N&&!w?H[_]=this.translate(Q,{...o,defaultValue:vy(z)?z[_]:void 0,joinArrays:!1,ns:f}):H[_]=this.translate(Q,{...o,joinArrays:!1,ns:f}),H[_]===Q&&(H[_]=L[_])}w=H}}else if(T&&Tt(O)&&Array.isArray(w))w=w.join(O),w&&(w=this.extendTranslation(w,t,o,S,i));else{let B=!1,H=!1;!this.isValidLookup(w)&&N&&(B=!0,w=z),this.isValidLookup(w)||(H=!0,w=d);const _=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:w,Q=N&&z!==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?z: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 G=[];const q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&q&&q[0])for(let ee=0;ee<q.length;ee++)G.push(q[ee]);else this.options.saveMissingTo==="all"?G=this.languageUtils.toResolveHierarchy(o.lng||this.language):G.push(o.lng||this.language);const Y=(ee,$,ae)=>{const I=N&&ae!==w?ae:_;this.options.missingKeyHandler?this.options.missingKeyHandler(ee,g,$,I,Q,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ee,g,$,I,Q,o),this.emit("missingKey",ee,g,$,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?G.forEach(ee=>{const $=this.pluralResolver.getSuffixes(ee,o);M&&o[`defaultValue${this.options.pluralSeparator}zero`]&&!$.includes(`${this.options.pluralSeparator}zero`)&&$.push(`${this.options.pluralSeparator}zero`),$.forEach(ae=>{Y([ee],d+ae,o[`defaultValue${ae}`]||z)})}):Y(G,d,z))}w=this.extendTranslation(w,t,o,S,i),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 l?(S.res=w,S.usedParams=this.getUsedParamsDetails(o),S):w}extendTranslation(t,s,i,o,l){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const f=Tt(t)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let g;if(f){const h=t.match(this.interpolator.nestingRegexp);g=h&&h.length}let m=i.replace&&!Tt(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),t=this.interpolator.interpolate(t,m,i.lng||this.language||o.usedLng,i),f){const h=t.match(this.interpolator.nestingRegexp),x=h&&h.length;g<x&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(t=this.interpolator.nest(t,(...h)=>l?.[0]===h[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${s[0]}`),null):this.translate(...h,s),i)),i.interpolation&&this.interpolator.reset()}const u=i.postProcess||this.options.postProcess,d=Tt(u)?[u]:u;return t!=null&&d?.length&&i.applyPostProcessor!==!1&&(t=Dk.handle(d,t,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,s={}){let i,o,l,u,d;return Tt(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(f=>typeof f=="function"?Fa(f,{...this.options,...s}):f)),t.forEach(f=>{if(this.isValidLookup(i))return;const g=this.extractFromKey(f,s),m=g.key;o=m;let h=g.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const x=s.count!==void 0&&!Tt(s.count),S=x&&!s.ordinal&&s.count===0,w=s.context!==void 0&&(Tt(s.context)||typeof s.context=="number")&&s.context!=="",C=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);h.forEach(E=>{this.isValidLookup(i)||(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(i))return;u=R;const O=[m];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(O,m,R,E,s);else{let A;x&&(A=this.pluralResolver.getSuffix(R,s.count,s));const N=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(x&&(s.ordinal&&A.startsWith(j)&&O.push(m+A.replace(j,this.options.pluralSeparator)),O.push(m+A),S&&O.push(m+N)),w){const D=`${m}${this.options.contextSeparator||"_"}${s.context}`;O.push(D),x&&(s.ordinal&&A.startsWith(j)&&O.push(D+A.replace(j,this.options.pluralSeparator)),O.push(D+A),S&&O.push(D+N))}}let T;for(;T=O.pop();)this.isValidLookup(i)||(l=T,i=this.getResource(R,E,T,s))}))})}),{res:i,usedKey:o,exactUsedKey:l,usedLng:u,usedNS:d}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,s,i,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,s,i,o):this.resourceStore.getResource(t,s,i,o)}getUsedParamsDetails(t={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Tt(t.replace);let o=i?t.replace:t;if(i&&typeof t.count<"u"&&(o={...o,count:t.count}),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const l of s)delete o[l]}return o}static hasDefaultValue(t){const s="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(s)&&t[i]!==void 0)return!0;return!1}}class OE{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wi.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=cc(t),!t||!t.includes("-"))return null;const s=t.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(t){if(t=cc(t),!t||!t.includes("-"))return t;const s=t.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(t){if(Tt(t)&&t.includes("-")){let s;try{s=Intl.getCanonicalLocales(t)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(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 s;return t.forEach(i=>{if(s)return;const o=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(o))&&(s=o)}),!s&&this.options.supportedLngs&&t.forEach(i=>{if(s)return;const o=this.getScriptPartFromCode(i);if(this.isSupportedCode(o))return s=o;const l=this.getLanguagePartFromCode(i);if(this.isSupportedCode(l))return s=l;s=this.options.supportedLngs.find(u=>u===l?!0:!u.includes("-")&&!l.includes("-")?!1:!!(u.includes("-")&&!l.includes("-")&&u.slice(0,u.indexOf("-"))===l))}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(t,s){if(!t)return[];if(typeof t=="function"&&(t=t(s)),Tt(t)&&(t=[t]),Array.isArray(t))return t;if(!s)return t.default||[];let i=t[s];return i||(i=t[this.getScriptPartFromCode(s)]),i||(i=t[this.formatLanguageCode(s)]),i||(i=t[this.getLanguagePartFromCode(s)]),i||(i=t.default),i||[]}toResolveHierarchy(t,s){const i=this.options.fallbackLng,o=Array.isArray(i)?i.join("|"):i;o!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=o);const l=s===void 0||s===!1||Tt(s),u=s===void 0&&typeof this.options.fallbackLng=="function",d=Tt(t)&&l&&!u;let f=null;if(d){let x;s===void 0?x="undefined":s===!1?x="boolean:false":x=`string:${s}`,f=`${t.length}:${t}|${x}`}if(f!==null){const x=this.resolveHierarchyCache[f];if(x!==void 0)return x.slice()}const g=this.getFallbackCodes((s===!1?[]:s)||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 Tt(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))):Tt(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 AE={zero:0,one:1,two:2,few:3,many:4,other:5},ME={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class l5{constructor(t,s={}){this.languageUtils=t,this.options=s,this.logger=wi.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,s={}){const i=cc(t==="dev"?"en":t),o=s.ordinal?"ordinal":"cardinal",l=JSON.stringify({cleanedCode:i,type:o});if(l in this.pluralRulesCache)return this.pluralRulesCache[l];let u;try{u=new Intl.PluralRules(i,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),ME;if(!t.match(/-|_/))return ME;const f=this.languageUtils.getLanguagePartFromCode(t);u=this.getRule(f,s)}return this.pluralRulesCache[l]=u,u}needsPlural(t,s={}){let i=this.getRule(t,s);return i||(i=this.getRule("dev",s)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,s,i={}){return this.getSuffixes(t,i).map(o=>`${s}${o}`)}getSuffixes(t,s={}){let i=this.getRule(t,s);return i||(i=this.getRule("dev",s)),i?i.resolvedOptions().pluralCategories.sort((o,l)=>AE[o]-AE[l]).map(o=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,s,i={}){const o=this.getRule(t,i);return o?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(s)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",s,i))}}const NE=(e,t,s,i=".",o=!0)=>{let l=WL(e,t,s);return!l&&o&&Tt(s)&&(l=Xy(e,s,i),l===void 0&&(l=Xy(t,s,i))),l};class DE{constructor(t={}){this.logger=wi.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(s=>s),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:s,escapeValue:i,useRawValueToEscape:o,prefix:l,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:O}=t.interpolation;this.escape=s!==void 0?s:t5,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=l?qi(l):u||"{{",this.suffix=d?qi(d):f||"}}",this.formatSeparator=g||",",this.unescapePrefix=m?"":h?qi(h):"-",this.unescapeSuffix=this.unescapePrefix?"":m?qi(m):"",this.nestingPrefix=x?qi(x):S||qi("$t("),this.nestingSuffix=w?qi(w):C||qi(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=R||1e3,this.alwaysFormat=O!==void 0?O:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(s,i)=>s?.source===i?(s.lastIndex=0,s):new RegExp(i,"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,s,i,o){let l,u,d;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},g=C=>{if(!C.includes(this.formatSeparator)){const T=NE(s,f,C,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(T,void 0,i,{...o,...s,interpolationkey:C}):T}const E=C.split(this.formatSeparator),R=E.shift().trim(),O=E.join(this.formatSeparator).trim();return this.format(NE(s,f,R,this.options.keySeparator,this.options.ignoreJSONStructure),O,i,{...o,...s,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;l=C.regex.exec(t);){const E=l.index-w,R=S.find(([A,N])=>E>=A&&E<N);if(R){C.regex.lastIndex=R[1]+w;continue}const O=l[1].trim();if(u=g(O),u===void 0)if(typeof m=="function"){const A=m(t,l,o);u=Tt(A)?A:""}else if(o&&Object.prototype.hasOwnProperty.call(o,O))u="";else if(h){u=l[0];continue}else this.logger.warn(`missed to pass in variable ${O} for interpolating ${t}`),u="";else!Tt(u)&&!this.useRawValueToEscape&&(u=ph(u));const T=ph(C.safeValue(u));if(t=t.slice(0,l.index)+T+t.slice(l.index+l[0].length),h?(C.regex===this.regexpUnescape?S.push([l.index,l.index+T.length]):w+=T.length-l[0].length,C.regex.lastIndex+=T.length,C.regex.lastIndex-=l[0].length):C.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),t}nest(t,s,i={}){let o,l,u;const d=(h,x)=>{const S=this.nestingOptionsSeparator;if(!h.includes(S))return h;const w=h.split(new RegExp(`${qi(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(O){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,O),`${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={...i},u=u.replace&&!Tt(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)),l=s(d.call(this,o[1].trim(),u),u),l&&o[0]===t&&!Tt(l))return l;Tt(l)||(l=ph(l)),l||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),l=""),h.length&&(l=h.reduce((S,w)=>this.format(S,w,i.lng,{...i,interpolationkey:o[1].trim()}),l.trim())),g+=t.slice(m,o.index)+ph(l),m=f.lastIndex,this.regexp.lastIndex=0}return m?g+t.slice(m):t}}const c5=e=>{let t=e.toLowerCase().trim();const s={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const o=i[1].slice(0,-1);t==="currency"&&!o.includes(":")?s.currency||(s.currency=o.trim()):t==="relativetime"&&!o.includes(":")?s.range||(s.range=o.trim()):o.split(";").forEach(u=>{if(u){const[d,...f]=u.split(":"),g=f.join(":").trim().replace(/^'+|'+$/g,""),m=d.trim();s[m]||(s[m]=g),g==="false"&&(s[m]=!1),g==="true"&&(s[m]=!0),isNaN(g)||(s[m]=parseInt(g,10))}})}return{formatName:t,formatOptions:s}},jE=e=>{const t={};return(s,i,o)=>{let l=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(l={...l,[o.interpolationkey]:void 0});let u;try{u=i+JSON.stringify(l)}catch{return e(cc(i),o)(s)}let d=t[u];return d||(d=e(cc(i),o),t[u]=d),d(s)}},u5=e=>(t,s,i)=>e(cc(s),i)(t);class d5{constructor(t={}){this.logger=wi.create("formatter"),this.options=t,this.init(t)}init(t,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const i=s.cacheInBuiltFormats?jE:u5;this.formats={number:i((o,l)=>{const u=new Intl.NumberFormat(o,{...l});return d=>u.format(d)}),currency:i((o,l)=>{const u=new Intl.NumberFormat(o,{...l,style:"currency"});return d=>u.format(d)}),datetime:i((o,l)=>{const u=new Intl.DateTimeFormat(o,{...l});return d=>u.format(d)}),relativetime:i((o,l)=>{const u=new Intl.RelativeTimeFormat(o,{...l});return d=>u.format(d,l.range||"day")}),list:i((o,l)=>{const u=new Intl.ListFormat(o,{...l});return d=>u.format(d)})}}add(t,s){this.formats[t.toLowerCase().trim()]=s}addCached(t,s){this.formats[t.toLowerCase().trim()]=jE(s)}format(t,s,i,o={}){if(!s||t==null)return t;const l=s.split(this.formatSeparator),u=[];for(let f=0;f<l.length;f++){let g=l[f];for(;g.indexOf("(")>-1&&!g.includes(")")&&f+1<l.length;)g=`${g}${this.formatSeparator}${l[++f]}`;u.push(g)}return u.reduce((f,g)=>{const{formatName:m,formatOptions:h}=c5(g);if(this.formats[m]){let x=f;try{const S=o?.formatParams?.[o.interpolationkey]||{},w=S.locale||S.lng||o.locale||o.lng||i;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 f5=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class h5 extends og{constructor(t,s,i,o={}){super(),this.backend=t,this.store=s,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=wi.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?.(i,o.backend,o)}queueLoad(t,s,i,o){const l={},u={},d={},f={};return t.forEach(g=>{let m=!0;s.forEach(h=>{const x=`${g}|${h}`;!i.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),l[x]===void 0&&(l[x]=!0),f[h]===void 0&&(f[h]=!0)))}),m||(d[g]=!0)}),(Object.keys(l).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(l),pending:Object.keys(u),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(f)}}loaded(t,s,i){const o=t.split("|"),l=o[0],u=o[1];s&&this.emit("failedLoading",l,u,s),!s&&i&&this.store.addResourceBundle(l,u,i,void 0,void 0,{skipCopy:!0}),this.state[t]=s?-1:2,s&&i&&(this.state[t]=0);const d={};this.queue.forEach(f=>{JL(f.loaded,[l],u),f5(f,t),s&&f.errors.push(s),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,s,i,o=0,l=this.retryTimeout,u){if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:s,fcName:i,tried:o,wait:l,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,s,i,o+1,l*2,u)},l);return}u(g,m)},f=this.backend[i].bind(this.backend);if(f.length===2){try{const g=f(t,s);g&&typeof g.then=="function"?g.then(m=>d(null,m)).catch(d):d(null,g)}catch(g){d(g)}return}return f(t,s,d)}prepareLoading(t,s,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Tt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Tt(s)&&(s=[s]);const l=this.queueLoad(t,s,i,o);if(!l.toLoad.length)return l.pending.length||o(),null;l.toLoad.forEach(u=>{this.loadOne(u)})}load(t,s,i){this.prepareLoading(t,s,{},i)}reload(t,s,i){this.prepareLoading(t,s,{reload:!0},i)}loadOne(t,s=""){const i=t.split("|"),o=i[0],l=i[1];this.read(o,l,"read",void 0,void 0,(u,d)=>{u&&this.logger.warn(`${s}loading namespace ${l} for language ${o} failed`,u),!u&&d&&this.logger.log(`${s}loaded namespace ${l} for language ${o}`,d),this.loaded(t,u,d)})}saveMissing(t,s,i,o,l,u={},d=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(s)){this.logger.warn(`did not save key "${i}" as the namespace "${s}" 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(!(i==null||i==="")){if(this.backend?.create){const f={...u,isUpdate:l},g=this.backend.create.bind(this.backend);if(g.length<6)try{let m;g.length===5?m=g(t,s,i,o,f):m=g(t,s,i,o),m&&typeof m.then=="function"?m.then(h=>d(null,h)).catch(d):d(null,m)}catch(m){d(m)}else g(t,s,i,o,d,f)}!t||!t[0]||this.store.addResource(t[0],s,i,o)}}}const by=()=>({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]),Tt(e[1])&&(t.defaultValue=e[1]),Tt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const s=e[3]||e[2];Object.keys(s).forEach(i=>{t[i]=s[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),IE=e=>(Tt(e.ns)&&(e.ns=[e.ns]),Tt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Tt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),gh=()=>{},p5=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(s=>{typeof e[s]=="function"&&(e[s]=e[s].bind(e))})};class Iu extends og{constructor(t={},s){if(super(),this.options=IE(t),this.services={},this.logger=wi,this.modules={external:[]},p5(this),s&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,s),this;setTimeout(()=>{this.init(t,s)},0)}}init(t={},s){this.isInitializing=!0,typeof t=="function"&&(s=t,t={}),t.defaultNS==null&&t.ns&&(Tt(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=by();this.options={...i,...this.options,...IE(t)},this.options.interpolation={...i.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=i.overloadTranslationOptionHandler);const o=g=>g?typeof g=="function"?new g:g:null;if(!this.options.isClone){this.modules.logger?wi.init(o(this.modules.logger),this.options):wi.init(null,this.options);let g;this.modules.formatter?g=this.modules.formatter:g=d5;const m=new OE(this.options);this.store=new kE(this.options.resources,this.options);const h=this.services;h.logger=wi,h.resourceStore=this.store,h.languageUtils=m,h.pluralResolver=new l5(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 DE(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new h5(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 up(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,s||(s=gh),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=Su(),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),s(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,s=gh){let i=s;const o=Tt(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],u=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(g=>{g!=="cimode"&&(l.includes(g)||l.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(l,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(d)})}else i(null)}reloadResources(t,s,i){const o=Su();return typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=void 0),t||(t=this.languages),s||(s=this.options.ns),i||(i=gh),this.services.backendConnector.reload(t,s,l=>{o.resolve(),i(l)}),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"&&Dk.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 s=0;s<this.languages.length;s++){const i=this.languages[s];if(!["cimode","dev"].includes(i)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,s){this.isLanguageChangingTo=t;const i=Su();this.emit("languageChanging",t);const o=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},l=(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,i.resolve((...g)=>this.t(...g)),s&&s(d,(...g)=>this.t(...g))},u=d=>{!t&&!d&&this.services.languageDetector&&(d=[]);const f=Tt(d)?d:d&&d[0],g=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(Tt(d)?[d]:d);g&&(this.language||o(g),this.translator.language||this.translator.changeLanguage(g),this.services.languageDetector?.cacheUserLanguage?.(g)),this.loadResources(g,m=>{l(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),i}getFixedT(t,s,i,o){const l=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||i||u.keyPrefix);const x={...this.options,...m};Array.isArray(l)&&!h&&(x.ns=l),typeof m.keyPrefix=="function"&&(m.keyPrefix=Fa(m.keyPrefix,x));const S=this.options.keySeparator||".";let w;return m.keyPrefix&&Array.isArray(d)?w=d.map(C=>(typeof C=="function"&&(C=Fa(C,x)),`${m.keyPrefix}${S}${C}`)):(typeof d=="function"&&(d=Fa(d,x)),w=m.keyPrefix?`${m.keyPrefix}${S}${d}`:d),this.t(w,m)};return Tt(t)?u.lng=t:u.lngs=t,u.ns=s,u.keyPrefix=i,u}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,s={}){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 i=s.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const u=(g,m)=>{const h=this.services.backendConnector.state[`${g}|${m}`];return h===-1||h===0||h===2};if(s.precheck){const g=s.precheck(this,u);if(g!==void 0)return g}if(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;const{languageUtils:d}=this.services,f=s.lng?d.isSupportedCode(i)&&d.toResolveHierarchy(i,!1)[0]:i;return!!((!f||u(f,t))&&(!o||u(l,t)))}loadNamespaces(t,s){const i=Su();return this.options.ns?(Tt(t)&&(t=[t]),t.forEach(o=>{this.options.ns.includes(o)||this.options.ns.push(o)}),this.loadResources(o=>{i.resolve(),s&&s(o)}),i):(s&&s(),Promise.resolve())}loadLanguages(t,s){const i=Su();Tt(t)&&(t=[t]);const o=this.options.preload||[],l=t.filter(u=>!o.includes(u)&&this.services.languageUtils.isSupportedCode(u));return l.length?(this.options.preload=o.concat(l),this.loadResources(u=>{i.resolve(),s&&s(u)}),i):(s&&s(),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 l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const s=["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"],i=this.services?.languageUtils||new OE(by());return t.toLowerCase().indexOf("-latn")>1?"ltr":s.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},s){const i=new Iu(t,s);return i.createInstance=Iu.createInstance,i}cloneInstance(t={},s=gh){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const o={...this.options,preload:!1,...t,isClone:!0},l=new Iu(o);if((t.debug!==void 0||t.prefix!==void 0)&&(l.logger=l.logger.clone(t)),["store","services","language"].forEach(d=>{l[d]=this[d]}),l.services={...this.services},l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},i){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);l.store=new kE(f,o),l.services.resourceStore=l.store}if(t.interpolation){const f={...by().interpolation,...this.options.interpolation,...t.interpolation},g={...o,interpolation:f};l.services.interpolator=new DE(g)}return l.translator=new up(l.services,o),l.translator.on("*",(d,...f)=>{l.emit(d,...f)}),l.init(o,s),l.translator.options=o,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const pr=Iu.createInstance();pr.createInstance;pr.dir;pr.init;pr.loadResources;pr.reloadResources;pr.use;pr.changeLanguage;pr.getFixedT;pr.t;pr.exists;pr.setDefaultNamespace;pr.hasLoadedNamespace;pr.loadNamespaces;pr.loadLanguages;const g5={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},m5=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function PE(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},s=e.match(/<\/?([^\s]+?)[/\s>]/);if(s&&(t.name=s[1],(g5[s[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){const l=e.indexOf("-->");return{type:"comment",comment:l!==-1?e.slice(4,l):""}}const i=new RegExp(m5);let o=null;for(;o=i.exec(e),o!==null;)if(o[0].trim())if(o[1]){const l=o[1].trim();let u=[l,null];const d=l.indexOf("=");d>-1&&(u=[l.slice(0,d),l.slice(d+1)]),t.attrs[u[0]]=u[1],i.lastIndex--}else o[2]&&(t.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1));return t}const mh=/<!--[\s\S]*?-->|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,y5=/<\/?([^\s]+?)[/\s>]/,v5=/^\s*$/,b5=/^(script|style)$/i,Tu="\0",x5=Object.create(null);function Ik(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(Tu).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(Tu).join("<");return}for(const s in t.attrs){const i=t.attrs[s];typeof i=="string"&&i.indexOf(Tu)>-1&&(t.attrs[s]=i.split(Tu).join("<"))}t.children.length&&Ik(t.children)})}function S5(e,t){const s=t&&t.components||x5,i=t&&t.allowedTags;let o=!1;if(i){const w=typeof i=="function"?i:function(O){return i.indexOf(O)>-1};let C="",E=0;mh.lastIndex=0;let R;for(;R=mh.exec(e);){const O=R[0];C+=e.slice(E,R.index);const T=O.match(y5);O.startsWith("<!--")||T&&w(T[1])?(C+=O,E=R.index+O.length):(o=!0,C+=Tu,E=R.index+1,mh.lastIndex=E)}e=C+e.slice(E)}const l=[],u=[];let d,f=-1,g=!1,m=0,h;if(e.indexOf("<")!==0){const w=e.indexOf("<");l.push({type:"text",content:w===-1?e:e.substring(0,w)})}const x=[];let S;for(;S=mh.exec(e);)x.push(S);return x.forEach(function(w,C){const E=w[0];if(!E||E.startsWith("<!--"))return;let R=0,O=0,T=-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&&(T=j)):D===">"&&O++}const N=T>-1&&/[a-zA-Z0-9\-!/]/.test(E.charAt(T+1));if(R>O&&N){const j=E.substring(0,T),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 O=E.charAt(1)!=="/",T=E.startsWith("<!--"),A=R+E.length,N=e.charAt(A),j=x[C+1];let D;if(N==="<"&&j){const z=e.substring(A,j.index);D=z.split("<").length>z.split(">").length}let M;if(T){const z=PE(E);if(f<0)return l.push(z),l;M=u[f],M.children.push(z);const L=e.slice(A,j?j.index:void 0);return L.length>0&&M.children.push({type:"text",content:L}),l}if(O){f++,d=PE(E),d.type==="tag"&&s[d.name]&&(d.type="component",g=!0);let z=!1;if(!g&&!d.voidElement&&b5.test(d.name)){z=!0,h||(h=e.toLowerCase());const L=h.indexOf("</"+d.name.toLowerCase()+">",A),K=L===-1?e.length:L,X=e.slice(A,K);X&&d.children.push({type:"text",content:X}),m=K}!d.voidElement&&!g&&!z&&N&&N!=="<"&&d.children.push({type:"text",content:e.slice(A,j?j.index:void 0)}),f===0&&l.push(d),M=u[f-1],M&&M.children.push(d),u[f]=d}if((!O||d.voidElement)&&(f>-1&&(d.voidElement||d.name===E.slice(2,-1))&&(f--,d=f===-1?l:u[f]),!g&&(N!=="<"||D)&&N)){M=f===-1?l:u[f].children;const z=j?j.index:-1;let L=e.slice(A,z===-1?void 0:z);v5.test(L)&&(L=" "),(z>-1&&f+M.length>=0||L!==" ")&&M.push({type:"text",content:L})}}),o&&Ik(l),l}function w5(e){const t=[];for(const s in e)e[s]===null?t.push(s):t.push(s+'="'+String(e[s]).replace(/"/g,""")+'"');return t.length?" "+t.join(" "):""}function Pk(e,t){switch(t.type){case"text":return e+t.content;case"tag":{const s=t.voidElement&&t.name.toLowerCase()!=="!doctype"?"/>":">";return e+="<"+t.name+(t.attrs?w5(t.attrs):"")+s,t.voidElement?e:e+t.children.reduce(Pk,"")+"</"+t.name+">"}case"comment":return e+="<!--"+t.comment+"-->",e}}function E5(e){return e.reduce(function(t,s){return t+Pk("",s)},"")}var R5={parse:S5,stringify:E5};const Ph=(e,t,s,i)=>{const o=[s,{code:t,...i||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);Wr(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...o):console?.warn&&console.warn(...o)},LE={},ec=(e,t,s,i)=>{Wr(s)&&LE[s]||(Wr(s)&&(LE[s]=new Date),Ph(e,t,s,i))},Lk=(e,t)=>()=>{if(e.isInitialized)t();else{const s=()=>{setTimeout(()=>{e.off("initialized",s)},0),t()};e.on("initialized",s)}},Zy=(e,t,s)=>{e.loadNamespaces(t,Lk(e,s))},zE=(e,t,s,i)=>{if(Wr(s)&&(s=[s]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Zy(e,s,i);s.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,Lk(e,i))},C5=(e,t,s={})=>!t.languages||!t.languages.length?(ec(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:s.lng,precheck:(i,o)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,e))return!1}}),Wr=e=>typeof e=="string",Si=e=>typeof e=="object"&&e!==null,T5=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,k5={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},O5=e=>k5[e],zk=e=>e.replace(T5,O5);let Jy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:zk,transDefaultProps:void 0};const A5=(e={})=>{Jy={...Jy,...e}},hb=()=>Jy;let _k;const M5=e=>{_k=e},pb=()=>_k,Lh=(e,t)=>{if(!e)return!1;const s=e.props?.children??e.children;return t?s.length>0:!!s},ku=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?$i(t):t},N5=e=>$i(e).every(b.isValidElement),$i=e=>Array.isArray(e)?e:[e],D5=(e,t)=>{const s={...t};return s.props={...t.props,...e.props},s},j5=e=>{const t={};if(!e)return t;const s=i=>{$i(i).forEach(l=>{Wr(l)||(Lh(l)?s(ku(l)):Si(l)&&!b.isValidElement(l)&&Object.assign(t,l))})};return s(e),t},Wy=(e,t,s,i)=>{if(!e)return"";let o="";const l=$i(e),u=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return l.forEach((d,f)=>{if(Wr(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=Wr(S)?S:Wy(S,t,s,i);o+=`<${m}>${C}</${m}>`;return}const w=Wy(S,t,s,i);o+=`<${f}>${w}</${f}>`;return}if(d===null){Ph(s,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Si(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}Ph(s,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:d});return}Ph(s,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:d})}),o},I5=(e,t,s,i,o,l,u)=>{if(s==="")return[];const d=o.transKeepBasicHtmlNodesFor||[],f=s&&new RegExp(d.map(T=>`<${T}`).join("|")).test(s);if(!e&&!t&&!f&&!u)return[s];const g=t??{},m=T=>{$i(T).forEach(N=>{Wr(N)||(Lh(N)?m(ku(N)):Si(N)&&!b.isValidElement(N)&&Object.assign(g,N))})};m(e);const h=Object.keys(g),x=T=>/^\d+$/.test(T)||d.indexOf(T)>-1||h.indexOf(T)>-1,S=R5.parse(`<0>${s}</0>`,{allowedTags:x}),w={...g,...l},C=(T,A,N)=>{const j=ku(T),D=R(j,A.children,N);return N5(j)&&D.length===0||T.props?.i18nIsDynamicList?j:D},E=(T,A,N,j,D)=>{T.dummy?(T.children=A,N.push(b.cloneElement(T,{key:j},D?void 0:A))):N.push(...b.Children.map([T],M=>{if(M.type===b.Fragment||M.props?.i18nIsDynamicList!==void 0){const L={key:j};return M&&M.props&&Object.keys(M.props).forEach(K=>{K==="children"||K==="i18nIsDynamicList"||(L[K]=M.props[K])}),b.createElement(M.type,L,D?null:A)}const z={key:j};return M&&M.props&&Object.keys(M.props).forEach(L=>{L==="ref"||L==="children"||(z[L]=M.props[L])}),b.cloneElement(M,z,D?null:A)}))},R=(T,A,N)=>{const j=$i(T),D=$i(A),M={};return D.reduce((z,L,K)=>{const X=L.children?.[0]?.content&&i.services.interpolator.interpolate(L.children[0].content,w,i.language);if(L.type==="tag"){let B=j[parseInt(L.name,10)];!B&&t&&(B=t[L.name]),N.length===1&&!B&&Si(N[0])&&(B=N[0][L.name]),B||(B={});const H={...L.attrs};u&&Object.keys(H).forEach(Y=>{const ee=H[Y];Wr(ee)&&(H[Y]=zk(ee))});const U=Object.keys(H).length!==0?D5({props:H},B):B,_=b.isValidElement(U),Q=_&&Lh(L,!0)&&!L.voidElement,G=f&&Si(U)&&U.dummy&&!_,q=Si(t)&&Object.hasOwnProperty.call(t,L.name);if(Wr(U)){const Y=i.services.interpolator.interpolate(U,w,i.language);z.push(Y)}else if(Lh(U)||Q){const Y=C(U,L,N);E(U,Y,z,K)}else if(G){const Y=R(j,L.children,N);E(U,Y,z,K)}else if(Number.isNaN(parseFloat(L.name)))if(q){const Y=C(U,L,N);E(U,Y,z,K,L.voidElement)}else if(o.transSupportBasicHtmlNodes&&d.indexOf(L.name)>-1)if(L.voidElement)z.push(b.createElement(L.name,{key:`${L.name}-${K}`}));else{const Y=M[L.name]||0;M[L.name]=Y+1;let ee,$=0;for(let F=0;F<j.length;F+=1){const Z=j[F];if(b.isValidElement(Z)&&Z.type===L.name){if($===Y){ee=Z;break}$+=1}}const ae=ee?$i(ku(ee)):j,I=R(ae,L.children,N);z.push(b.createElement(L.name,{key:`${L.name}-${K}`},I))}else if(L.voidElement)z.push(`<${L.name} />`);else{const Y=R(j,L.children,N);z.push(`<${L.name}>${Y}</${L.name}>`)}else if(Si(U)&&!_){const Y=L.children[0]?X:null;Y&&z.push(Y)}else E(U,X,z,K,L.children.length!==1||!X)}else if(L.type==="text"){const B=o.transWrapTextNodes,H=typeof o.unescape=="function"?o.unescape:hb().unescape,U=u?H(i.services.interpolator.interpolate(L.content,w,i.language)):i.services.interpolator.interpolate(L.content,w,i.language);B?z.push(b.createElement(B,{key:`${L.name}-${K}`},U)):z.push(U)}return z},[])},O=R([{dummy:!0,children:e||[]}],S,$i(e||[]));return ku(O[0])},Uk=(e,t,s)=>{const i=e.key||t,o=b.cloneElement(e,{key:i});if(!o.props||!o.props.children||s.indexOf(`${t}/>`)<0&&s.indexOf(`${t} />`)<0)return o;function l(){return b.createElement(b.Fragment,null,o)}return b.createElement(l,{key:i})},P5=(e,t)=>e.map((s,i)=>Uk(s,i,t)),L5=(e,t)=>{const s={};return Object.keys(e).forEach(i=>{Object.assign(s,{[i]:Uk(e[i],i,t)})}),s},z5=(e,t,s,i)=>e?Array.isArray(e)?P5(e,t):Si(e)?L5(e,t):(ec(s,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:i}),null):null,_5=e=>!Si(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,s)=>t&&Number.isNaN(Number.parseFloat(s)),!0);function U5({children:e,count:t,parent:s,i18nKey:i,context:o,tOptions:l={},values:u,defaults:d,components:f,ns:g,i18n:m,t:h,shouldUnescape:x,...S}){const w=m||pb();if(!w)return ec(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:i}),e;const C=h||w.t.bind(w)||(ee=>ee),E={...hb(),...w.options?.react};let R=g||(C.ns?void 0:w.options?.defaultNS||"translation");Wr(R)&&(R=[R]);const{transDefaultProps:O}=E,T=O?.tOptions?{...O.tOptions,...l}:l,A=x??O?.shouldUnescape,N=O?.values?{...O.values,...u}:u,j=O?.components?{...O.components,...f}:f,D=Wy(e,E,w,i),M=Array.isArray(i)?i[i.length-1]:i,z=d||T?.defaultValue||D||E.transEmptyNodeValue||(typeof M=="function"?Fa(M):M),{hashTransKey:L}=E,K=i||(L?L(D||z):D||z);w.options?.interpolation?.defaultVariables?u={...w.options.interpolation.defaultVariables,...N}:u=N;const X=j5(e);X&&typeof X.count=="number"&&t===void 0&&(t=X.count),t===void 0&&(t=T?.count);const B=u||t!==void 0&&!w.options?.interpolation?.alwaysFormat||!e?T.interpolation:{interpolation:{...T.interpolation,prefix:"#$?",suffix:"?$#"}},H={...T,context:o||T.context,count:t,...u,...B,defaultValue:z,ns:R};let U=K?C(K,H):z;U===K&&z&&(U=z);const _=z5(j,U,w,i);let Q=_||e,G=null;_5(_)?(G=_,Q=e):_&&!Array.isArray(_)&&(G=_,Q=void 0);const q=I5(Q,G,U,w,E,H,A),Y=s??E.defaultTransParent;return Y?b.createElement(Y,S,q):q}const H5={type:"3rdParty",init(e){A5(e.options.react),M5(e)}},Hk=b.createContext();class F5{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function gd({children:e,count:t,parent:s,i18nKey:i,context:o,tOptions:l={},values:u,defaults:d,components:f,ns:g,i18n:m,t:h,shouldUnescape:x,...S}){const{i18n:w,defaultNS:C}=b.useContext(Hk)||{},E=m||w||pb(),R=h||E?.t.bind(E);return U5({children:e,count:t,parent:s,i18nKey:i,context:o,tOptions:l,values:u,defaults:d,components:f,ns:g||(R?.ns?void 0:C||E?.options?.defaultNS),i18n:E,t:h,shouldUnescape:x,...S})}const B5=(e,t)=>{if(Wr(t))return t;if(Si(t)&&Wr(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const s=e[e.length-1];return typeof s=="function"?"":s}return e},V5={t:B5,ready:!1},K5=()=>()=>{},ht=(e,t={})=>{const{i18n:s}=t,{i18n:i,defaultNS:o}=b.useContext(Hk)||{},l=s||i||pb();l&&!l.reportNamespaces&&(l.reportNamespaces=new F5),l||ec(l,"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(()=>({...hb(),...l?.options?.react,...t}),[l,t]),{useSuspense:d,keyPrefix:f,bindI18n:g,bindI18nStore:m}=u,h=o||l?.options?.defaultNS,x=Wr(h)?[h]:h||["translation"],S=JSON.stringify(x),w=b.useMemo(()=>x,[S]);l?.reportNamespaces?.addUsedNamespaces?.(w);const C=b.useRef(0),E=b.useCallback(H=>{if(!l)return K5;const U=()=>{C.current+=1,H()};return g&&l.on(g,U),m&&l.store.on(m,U),()=>{g&&g.split(" ").forEach(_=>l.off(_,U)),m&&m.split(" ").forEach(_=>l.store.off(_,U))}},[l,g,m]),R=b.useRef(),O=b.useCallback(()=>{if(!l)return V5;const H=!!(l.isInitialized||l.initializedStoreOnce)&&w.every(ee=>C5(ee,l,u)),U=t.lng||l.language,_=C.current,Q=typeof f=="function"?Fa(f,{...l.options,ns:w}):f,G=R.current;if(G&&G.i18n===l&&G.ready===H&&G.lng===U&&G.namespaces===w&&G.keyPrefix===Q&&G.revision===_)return G;const Y={t:l.getFixedT(U,u.nsMode==="fallback"?w:w[0],f,{scopeNs:w}),i18n:l,ready:H,lng:U,namespaces:w,keyPrefix:Q,revision:_};return R.current=Y,Y},[l,w,f,u,t.lng]),[T,A]=b.useState(0);let{t:N,ready:j}=Xp.useSyncExternalStore(E,O,O),D;l&&d&&!j&&(D=new Promise(H=>{const U=()=>H();t.lng?zE(l,t.lng,w,U):Zy(l,w,U)}),{t:N,ready:j}=O()),b.useEffect(()=>{if(l&&!j&&!d){const H=()=>A(U=>U+1);t.lng?zE(l,t.lng,w,H):Zy(l,w,H)}},[l,t.lng,w,j,d,T]);const M=l||{},z=b.useRef(null),L=b.useRef(),K=H=>`${H.language}|${H.resolvedLanguage}|${H.languages?.join(",")}`,X=H=>{const U=Object.getOwnPropertyDescriptors(H);U.__original&&delete U.__original;const _=Object.create(Object.getPrototypeOf(H),U);if(!Object.prototype.hasOwnProperty.call(_,"__original"))try{Object.defineProperty(_,"__original",{value:H,writable:!1,enumerable:!1,configurable:!1})}catch{}return _},B=b.useMemo(()=>{const H=M,U=H&&K(H);let _=H;H&&(z.current&&z.current.__original===H?L.current!==U?(_=X(H),z.current=_,L.current=U):_=z.current:(_=X(H),z.current=_,L.current=U));const Q=!j&&!d?(...q)=>(ec(l,"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(...q)):N,G=[Q,_,j];return G.t=Q,G.i18n=_,G.ready=j,G},[N,M,j,M.resolvedLanguage,M.language,M.languages]);if(l&&d&&!j){let H=!1;try{H=!1}catch{}throw H&&ec(l,"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 Fk(e){var t,s,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=Fk(e[t]))&&(i&&(i+=" "),i+=s)}else for(s in e)e[s]&&(i&&(i+=" "),i+=s);return i}function q5(){for(var e,t,s=0,i="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=Fk(e))&&(i&&(i+=" "),i+=t);return i}const _E=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,UE=q5,$o=(e,t)=>s=>{var i;if(t?.variants==null)return UE(e,s?.class,s?.className);const{variants:o,defaultVariants:l}=t,u=Object.keys(o).map(g=>{const m=s?.[g],h=l?.[g];if(m===null)return null;const x=_E(m)||_E(h);return o[g][x]}),d=s&&Object.entries(s).reduce((g,m)=>{let[h,x]=m;return x===void 0||(g[h]=x),g},{}),f=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.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({...l,...d}[C]):{...l,...d}[C]===E})?[...g,h,x]:g},[]);return UE(e,u,f,s?.class,s?.className)},Bk=b.createContext(void 0);function lg(e=!1){const t=b.useContext(Bk);if(t===void 0&&!e)throw new Error(cn(16));return t}function Y5(e){const{focusableWhenDisabled:t,disabled:s,composite:i=!1,tabIndex:o=0,isNativeButton:l}=e,u=i&&t!==!1,d=i&&t===!1;return{props:b.useMemo(()=>{const g={onKeyDown(m){s&&t&&m.key!=="Tab"&&m.preventDefault()}};return i||(g.tabIndex=o,!l&&s&&(g.tabIndex=t?o:-1)),(l&&(t||u)||!l&&s)&&(g["aria-disabled"]=s),l&&(!t||d)&&(g.disabled=s),g},[i,s,t,u,d,l,o])}}function _o(e,t,{detail:s=0,pointerType:i=""}={}){e.dispatchEvent(new(Rn(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:s,pointerType:i,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function ns(e={}){const{disabled:t=!1,focusableWhenDisabled:s,tabIndex:i=0,native:o=!0,composite:l}=e,u=b.useRef(null),d=lg(!0),f=l??d!==void 0,{props:g}=Y5({focusableWhenDisabled:s,disabled:t,composite:f,tabIndex:i,isNativeButton:o}),m=b.useCallback(()=>{const S=u.current;xy(S)&&f&&t&&g.disabled===void 0&&S.disabled&&(S.disabled=!1)},[t,g.disabled,f]);Pe(m,[m]);const h=b.useCallback((S={})=>{const{onClick:w,onMouseDown:C,onKeyUp:E,onKeyDown:R,onPointerDown:O,...T}=S;return Ir({onClick(A){if(t){A.preventDefault();return}w?.(A)},onMouseDown(A){t||C?.(A)},onKeyDown(A){if(t||(Wh(A),R?.(A),A.baseUIHandlerPrevented))return;const N=A.target===A.currentTarget,j=A.currentTarget,D=xy(j),M=!o&&$5(j),z=N&&(o?D:!M),L=A.key==="Enter",K=A.key===" ",X=j.getAttribute("role"),B=X?.startsWith("menuitem")||X==="option"||X==="gridcell";if(N&&f&&K){if(A.defaultPrevented&&B)return;A.preventDefault(),(!o||D)&&(A.preventBaseUIHandler(),_o(j,A));return}if(!z||o||!K&&!L){N&&M&&K&&A.preventDefault();return}A.defaultPrevented||(A.preventDefault(),L&&(A.preventBaseUIHandler(),_o(j,A)))},onKeyUp(A){if(!t){if(Wh(A),E?.(A),A.target===A.currentTarget&&o&&f&&xy(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!o&&!f&&!A.defaultPrevented&&A.key===" "&&(A.preventBaseUIHandler(),_o(A.currentTarget,A))}},onPointerDown(A){if(t){A.preventDefault();return}O?.(A)}},o?{type:"button"}:{role:"button"},g,T)},[t,g,f,o]),x=Be(S=>{u.current=S,m()});return{getButtonProps:h,buttonRef:x}}function xy(e){return bn(e)&&e.tagName==="BUTTON"}function $5(e){return bn(e)&&e.tagName==="A"&&!!e.href}const G5=b.forwardRef(function(t,s){const{render:i,className:o,disabled:l=!1,focusableWhenDisabled:u=!1,nativeButton:d=!0,style:f,...g}=t,{getButtonProps:m,buttonRef:h}=ns({disabled:l,focusableWhenDisabled:u,native:d});return bt("button",t,{state:{disabled:l},ref:[s,h],props:[g,m]})}),Vk=$o("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 Ze({className:e,variant:t="default",size:s="default",...i}){return y.jsx(G5,{"data-slot":"button",className:He(Vk({variant:t,size:s,className:e})),...i})}const Q5=$o("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 X5({className:e,variant:t="default",size:s="default",...i}){return y.jsx("div",{"data-slot":"code-block","data-variant":t,"data-size":s,className:He(Q5({variant:t}),e),...i})}function Z5({className:e,...t}){return y.jsx("div",{"data-slot":"code-block-header",className:He("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 J5({className:e,...t}){return y.jsx("div",{"data-slot":"code-block-title",className:He("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 W5({className:e,...t}){return y.jsx("div",{"data-slot":"code-block-actions",className:He("-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 ez({value:e,variant:t="ghost",size:s="icon-xs",className:i,onClick:o,...l}){const[u,d]=b.useState(!1);return b.useEffect(()=>{if(!u)return;const f=setTimeout(()=>d(!1),2e3);return()=>clearTimeout(f)},[u]),y.jsxs(y.Fragment,{children:[y.jsx(Ze,{"data-slot":"code-block-copy-button","data-copied":u||void 0,variant:t,size:s,"aria-label":u?"Copied":"Copy",className:He(i),onClick:f=>{o?.(f),navigator.clipboard.writeText(e).then(()=>d(!0)).catch(()=>{})},...l,children:u?y.jsx(pd,{}):y.jsx(UT,{})}),y.jsx("span",{"aria-live":"polite",className:"sr-only",children:u?"Copied":""})]})}function tz({className:e,children:t,style:s,wrap:i=!1,lineNumbers:o=!1,startLine:l=1,...u}){return y.jsx("pre",{"data-slot":"code-block-content","data-wrap":i||void 0,"data-numbered":o||void 0,dir:"ltr",tabIndex:0,style:{counterReset:`line ${l-1}`,...s},className:He("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:y.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)=>y.jsx(rz,{children:d},f)):t})})}const nz=$o("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 rz({className:e,variant:t="default",children:s,...i}){const o=s==null||s===""||Array.isArray(s)&&s.length===0;return y.jsx("span",{"data-slot":"code-block-line","data-variant":t,className:He(nz({variant:t}),e),...i,children:y.jsx("span",{"data-slot":"code-block-line-content",className:"min-w-0",children:o?`
|
|
12
|
-
`:s})})}const Kk=b.createContext(void 0);function md(e){const t=b.useContext(Kk);if(t===void 0&&!e)throw new Error(cn(47));return t}const sz={...Gi,disabled:e=>e.disabled,instantType:e=>e.instantType==="trigger-change"&&!Gi.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===Zs&&Gi.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod==="touch"&&e.openChangeReason===Zs,hasTriggerFocusGuards:(e,t)=>Gi.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 iz extends pc{constructor(t,s,i){const o=new dd;super(az(t,o,s,i),oz(o),sz)}setOpen=(t,s)=>{const i=s.reason===qn,o=s.reason===Zs&&s.event.detail===0,l=!t&&(s.reason===ad||s.reason==null),u=qp(s),d=this.select("activeTriggerId");if(!t&&s.reason===mC&&s.trigger==null&&d!=null&&(s.trigger=this.context.triggerElements.getById(d)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(t,s),s.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,s);const f=()=>{const m=Kp(this.state,t,s.trigger,u());m.openChangeReason=s.reason,this.update(m)};i?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(VC,()=>{this.context.stickIfOpen=!1}),hr.flushSync(f)):f();let g;o?g="click":l?g="dismiss":s.reason===Ba&&(g="focus"),this.set("instantType",g)}}function az(e,t,s,i=!1){const o={...Zp(t,s,i),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 oz(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeTriggerFocusGuardRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new zs,stickIfOpen:!0,triggerElements:e}}const HE=td(function({props:t}){const{children:s,open:i,defaultOpen:o=!1,onOpenChange:l,onOpenChangeComplete:u,modal:d=!1,handle:f,triggerId:g,defaultTriggerId:m=null}=t,h=cz(f,{modal:d,open:o,openProp:i,activeTriggerId:m,triggerIdProp:g});h.useControlledProp("openProp",i),h.useControlledProp("triggerIdProp",g);const x=h.useState("open"),S=h.useState("mounted"),w=h.useState("payload");h.useContextCallback("onOpenChange",l),h.useContextCallback("onOpenChangeComplete",u),nT(h,x),$p(h);const{forceUnmount:C}=Gp(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,lt(od))}),[C,h]);const E=x||S||f!=null;return y.jsxs(Kk.Provider,{value:h,children:[f&&y.jsx(Vp,{handle:f,store:h}),E&&y.jsx(uz,{store:h,modal:d}),typeof s=="function"?s({payload:w}):s]})});function lz(e){return md(!0)?y.jsx(HE,{props:e}):y.jsx(JC,{children:y.jsx(HE,{props:e})})}function cz(e,t){const s=Jv((i,o)=>new iz(t,i,o));return b.useEffect(()=>s.context.stickIfOpenTimeout.disposeEffect(),[s]),s}function uz({store:e,modal:t}){const s=e.useState("floatingRootContext"),i=cd(s,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),o=i.reference,l=i.floating;return Qp(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:l}),null}const dz=300;function qk(e,t){function s(l,u,d){const f=l.currentTarget;hr.flushSync(()=>{e.setOpen(!1,lt(Ba,l.nativeEvent,f))}),tI(f.isConnected?f:t.current,u,d)?.focus()}function i(l){s(l,-1,e.select("positionerElement"))}function o(l){const u=e.select("positionerElement");u&&Zl(l,u)?e.context.beforeContentFocusGuardRef.current?.focus():s(l,1,u)}return{handlePreFocusGuardFocus:i,handleFocusTargetFocus:o}}function fz(e){const t=b.useRef(""),s=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:s}}function mc(e,t){const s=b.useRef(e),i=Be(t);Pe(()=>{s.current!==e&&i(s.current),s.current=e},[e,i])}function gb(e,t){const s=Be((l,u)=>{(typeof e=="function"?e():e)||t(u||(Tp?"touch":""))}),{onClick:i,onPointerDown:o}=fz(s);return b.useMemo(()=>({onClick:i,onPointerDown:o}),[i,o])}function Yk(e){const[t,s]=b.useState(null),i=gb(e,s);return mc(e,o=>{o&&!e&&s(null)}),b.useMemo(()=>({openMethod:t,triggerProps:i}),[t,i])}const hz=Rp(function(t,s){const{render:i,className:o,style:l,disabled:u=!1,nativeButton:d=!0,handle:f,payload:g,openOnHover:m=!1,delay:h=dz,closeDelay:x=0,id:S,...w}=t,C=md(!0),R=Jp(f)??C;if(!R)throw new Error(cn(74));const O=Qn(S),T=R.useState("isTriggerActive",O),A=R.useState("floatingRootContext"),N=R.useState("isOpenedByTrigger",O),j=R.useState("triggerPopupId",O),D=b.useRef(null),{registerTrigger:M,isMountedByThisTrigger:z}=Yp(O,D,R,{payload:g,disabled:u,openOnHover:m,closeDelay:x}),L=R.useState("isPressOpenedByTrigger",O),K=R.useState("isTouchPressOpen",m),X=R.useState("hasTriggerFocusGuards",O),B=nb(A,{enabled:!u&&m&&!K,mouseOnly:!0,move:!1,handleClose:rb(),restMs:h,delay:{close:x},triggerElementRef:D,isActiveTrigger:T,isClosing:()=>R.select("transitionStatus")==="ending"}),H=Be(()=>R.context.stickIfOpen),U=Fp(A,{stickIfOpen:H}),_=gb(()=>R.select("open"),Z=>{R.set("openMethod",Z)}),Q=R.useState("triggerProps",z),{getButtonProps:G,buttonRef:q}=ns({disabled:u,native:d}),Y={open(Z){return L?Vu.open(Z):Dp.open(Z)}},{handlePreFocusGuardFocus:ee,handleFocusTargetFocus:$}=qk(R,D),I=bt("button",t,{state:{disabled:u,open:N},ref:[q,s,M,D],props:[U.reference,B,Q,_,{[$v]:"",id:O,"aria-haspopup":"dialog","aria-expanded":N,"aria-controls":j},w,G],stateAttributesMapping:Y}),F=y.jsx(b.Fragment,{children:I},O);return X?y.jsxs(b.Fragment,{children:[y.jsx(Va,{ref:R.context.beforeTriggerFocusGuardRef,onFocus:ee}),F,y.jsx(Va,{ref:R.context.triggerFocusTargetRef,onFocus:$})]}):F}),$k=b.createContext(void 0);function pz(){const e=b.useContext($k);if(e===void 0)throw new Error(cn(45));return e}const gz=b.forwardRef(function(t,s){const{keepMounted:i=!1,...o}=t;return md().useState("mounted")||i?y.jsx($k.Provider,{value:i,children:y.jsx(Up,{ref:s,...o})}):null}),Gk=b.createContext(void 0);function mz(){const e=b.useContext(Gk);if(!e)throw new Error(cn(46));return e}const cg=b.forwardRef(function(t,s){const{cutout:i,...o}=t;let l;if(i){const u=i.getBoundingClientRect();l=`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 y.jsx("div",{ref:s,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:l}})});function Qk(e){const{store:t,domReference:s,positionerElement:i,open:o}=e,l=b.useRef(null),u=b.useRef(null),d=Bp(i);Pe(()=>{o||(u.current?.abort(),u.current=null,t.state.instantType==="trigger-change"&&t.set("instantType",void 0))},[o,t]),Pe(()=>{const f=s,g=l.current;if(f&&(l.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()}},[s,d,t])}let FE={},BE={},VE="";function ug(e,t){return rd(e)?e:t}function KE(e,t,s){return/hidden|clip/.test(e.getComputedStyle(ug(t,s)).overflowY)}function yz(e){if(typeof document>"u")return!1;const t=qt(e);return Rn(t).innerWidth-t.documentElement.clientWidth>0}function vz(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const s=qt(e),i=s.documentElement,o=s.body,l=ug(i,o),u=l.style.overflowY,d=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",l.style.overflowY="scroll";const f=l.offsetWidth;l.style.overflowY="hidden";const g=l.offsetWidth;return l.style.overflowY=u,i.style.scrollbarGutter=d,f===g}function bz(e){const t=qt(e),s=t.documentElement,i=t.body,o=ug(s,i),l={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,l)}}function xz(e){const t=qt(e),s=t.documentElement,i=t.body,o=Rn(s);let l=0,u=0,d=!1;const f=jr.create();if(Ti&&(o.visualViewport?.scale??1)!==1)return()=>{};function g(){const S=o.getComputedStyle(s),w=o.getComputedStyle(i),R=(S.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";l=s.scrollTop,u=s.scrollLeft,FE={scrollbarGutter:s.style.scrollbarGutter,overflowY:s.style.overflowY,overflowX:s.style.overflowX},VE=s.style.scrollBehavior,BE={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const O=s.scrollHeight>s.clientHeight,T=s.scrollWidth>s.clientWidth,A=S.overflowY==="scroll"||w.overflowY==="scroll",N=S.overflowX==="scroll"||w.overflowX==="scroll",j=Math.max(0,o.innerWidth-i.clientWidth),D=Math.max(0,o.innerHeight-i.clientHeight),M=parseFloat(w.marginTop)+parseFloat(w.marginBottom),z=parseFloat(w.marginLeft)+parseFloat(w.marginRight),L=ug(s,i);if(d=vz(e),d){s.style.scrollbarGutter=R,L.style.overflowY="hidden",L.style.overflowX="hidden";return}Object.assign(s.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(O||A)&&(s.style.overflowY="scroll"),(T||N)&&(s.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:M||D?`calc(100dvh - ${M+D}px)`:"100dvh",width:z||j?`calc(100vw - ${z+j}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=l,i.scrollLeft=u,s.setAttribute("data-base-ui-scroll-locked",""),s.style.scrollBehavior="unset"}function m(){Object.assign(s.style,FE),Object.assign(i.style,BE),d||(s.scrollTop=l,s.scrollLeft=u,s.removeAttribute("data-base-ui-scroll-locked"),s.style.scrollBehavior=VE)}function h(){m(),f.request(g)}g();const x=zt(o,"resize",h);return()=>{f.cancel(),m(),typeof o.removeEventListener=="function"&&x()}}class Sz{lockCount=0;restore=null;timeoutLock=zs.create();timeoutUnlock=zs.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const s=qt(t),i=s.documentElement,o=s.body,l=Rn(i);if(KE(l,i,o)){const d=new l.MutationObserver(()=>{KE(l,i,o)||(d.disconnect(),this.restore=null,this.lock(t))}),f={attributes:!0};d.observe(i,f),d.observe(o,f),this.restore=()=>d.disconnect();return}const u=Tp||!yz(t);this.restore=u?bz(t):xz(t)}}const wz=new Sz;function Xk(e=!0,t=null){Pe(()=>{if(e)return wz.acquire(t)},[e,t])}const Ez=20;function mb(e,t,s,i){const[o,l]=b.useState(!1);Pe(()=>{if(!e||!t||s==null){l(!1);return}const u=qt(s).documentElement.clientWidth,d=s.offsetWidth;l(u>0&&d>0&&d>=u-Ez)},[e,t,s]),Xk(e&&(!t||o),i)}const Rz=b.forwardRef(function(t,s){const{render:i,className:o,style:l,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=Gv,...O}=t,T=md(),A=pz(),N=Xv(),j=T.useState("floatingRootContext"),D=T.useState("mounted"),M=T.useState("open"),z=T.useState("openChangeReason"),L=T.useState("activeTriggerElement"),K=T.useState("modal"),X=T.useState("openMethod"),B=T.useState("positionerElement"),H=T.useState("instantType"),U=T.useState("transitionStatus"),_=T.useState("adaptiveOrigin"),Q=ng({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:_}),G=j.useState("domReferenceElement");Qk({store:T,domReference:G,positionerElement:B,open:M});const q=K===!0&&z!==qn;mb(M&&q,X==="touch",B,L);const Y=T.useStateSetter("positionerElement"),ee={open:M,side:Q.side,align:Q.align,anchorHidden:Q.anchorHidden,instant:H},$=rg(t,ee,{styles:Q.positionerStyles,transitionStatus:U,props:O,refs:[s,Y],hidden:!D,inert:!M});return y.jsxs(Gk.Provider,{value:Q,children:[D&&q&&y.jsx(cg,{inert:hd(!M),cutout:L}),y.jsx(ZC,{id:N,children:$})]})}),ev="ArrowUp",tv="ArrowDown",nv="ArrowLeft",rv="ArrowRight",sv="Home",iv="End",yd=new Set([ev,tv,nv,rv,sv,iv]),Zk="Shift",Cz=[Zk,"Control","Alt","Meta"];function Tz(e){return bn(e)&&e.tagName==="INPUT"}function qE(e){return!!(Tz(e)&&e.selectionStart!=null||bn(e)&&e.tagName==="TEXTAREA")}function YE(e,t,s,i){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,l=e.scrollTop;const u=e.clientWidth<e.scrollWidth,d=e.clientHeight<e.scrollHeight;if(u&&i!=="vertical"){const f=$E(e,t,"left"),g=yh(e),m=yh(t);s==="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)),s==="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&&i!=="horizontal"){const f=$E(e,t,"top"),g=yh(e),m=yh(t);f-m.scrollMarginTop<e.scrollTop+g.scrollPaddingTop?l=f-m.scrollMarginTop-g.scrollPaddingTop:f+t.offsetHeight+m.scrollMarginBottom>e.scrollTop+e.clientHeight-g.scrollPaddingBottom&&(l=f+t.offsetHeight+m.scrollMarginBottom-e.clientHeight+g.scrollPaddingBottom)}e.scrollTo({left:o,top:l,behavior:"auto"})}function $E(e,t,s){const i=s==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[i],t.offsetParent!==e);)t=t.offsetParent;return o}function yh(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 kz=b.createContext(void 0);function dg(e){return b.useContext(kz)}const Oz=b.createContext(void 0);function Az(){const[e,t]=b.useState(0),s=Be(()=>(t(o=>o+1),()=>{t(o=>Math.max(0,o-1))}));return{context:b.useMemo(()=>({register:s}),[s]),hasClosePart:e>0}}const Mz=b.forwardRef(function(t,s){const{render:i,className:o,style:l,initialFocus:u,finalFocus:d,...f}=t,g=md(),m=mz(),h=dg()!=null,{context:x,hasClosePart:S}=Az(),w=g.useState("open"),C=g.useState("openMethod"),E=g.useState("instantType"),R=g.useState("transitionStatus"),O=g.useState("popupProps"),T=g.useState("titleElementId"),A=g.useState("descriptionElementId"),N=g.useState("modal"),j=g.useState("mounted"),D=g.useState("openChangeReason"),M=g.useState("activeTriggerElement"),z=g.useState("floatingRootContext"),L=z.useState("floatingId"),K=g.useState("disabled"),X=g.useState("openOnHover"),B=g.useState("closeDelay");bs({open:w,ref:g.context.popupRef,onComplete(){w&&g.context.onOpenChangeComplete?.(!0)}}),tb(z,{enabled:X&&!K,closeDelay:B});const H=u===void 0?tT(g.context.popupRef):u,U=N!==!1&&S;g.useSyncedValue("focusManagerModal",U);const _=g.useStateSetter("popupElement"),Q={open:w,side:m.side,align:m.align,instant:E,transitionStatus:R},G=bt("div",t,{state:Q,ref:[s,g.context.popupRef,_],props:[O,{id:L,role:"dialog",...ud,"aria-labelledby":T,"aria-describedby":A,onKeyDown(q){h&&yd.has(q.key)&&q.stopPropagation()}},fd(R),f],stateAttributesMapping:jp});return y.jsx(Hp,{context:z,openInteractionType:C,modal:U,disabled:!j||D===qn,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:y.jsx(Oz.Provider,{value:x,children:G})})});function yb({...e}){return y.jsx(lz,{"data-slot":"popover",...e})}function Jk({...e}){return y.jsx(hz,{"data-slot":"popover-trigger",...e})}function vb({anchor:e,align:t="center",alignOffset:s=0,side:i="bottom",sideOffset:o=4,className:l,...u}){return y.jsx(gz,{children:y.jsx(Rz,{anchor:e,className:"isolate z-50 outline-none",align:t,alignOffset:s,side:i,sideOffset:o,children:y.jsx(Mz,{"data-slot":"popover-content",className:He("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",l),...u})})})}const Wk=b.createContext(void 0),Or=e=>{const t=b.useContext(Wk);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Nz=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(Wk.Provider,{value:e,children:t})),Dz={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var jz=class{#e=Dz;#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 Po=new jz;function Iz(e){setTimeout(e,0)}const Pz=typeof window>"u"||"Deno"in globalThis;function Kr(){}function Lz(e,t){return typeof e=="function"?e(t):e}function eO(e){return typeof e=="number"&&e>=0&&e!==1/0}function tO(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pn(e,t){return typeof e=="function"?e(t):e}function GE(e,t){const{type:s="all",exact:i,fetchStatus:o,predicate:l,queryKey:u,stale:d}=e;if(u){if(i){if(t.queryHash!==bb(u,t.options))return!1}else if(!uc(t.queryKey,u))return!1}if(s!=="all"){const f=t.isActive();if(s==="active"&&!f||s==="inactive"&&f)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||o&&o!==t.state.fetchStatus||l&&!l(t))}function QE(e,t){const{exact:s,status:i,predicate:o,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(s){if(Ko(t.options.mutationKey)!==Ko(l))return!1}else if(!uc(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||o&&!o(t))}function bb(e,t){return(t?.queryKeyHashFn||Ko)(e)}function Ko(e){return JSON.stringify(e,(t,s)=>av(s)?Object.keys(s).sort().reduce((i,o)=>(i[o]=s[o],i),{}):s)}function uc(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 i=0;i<t.length;i++)if(!uc(e[i],t[i]))return!1;return!0}const s=Object.keys(t);for(const i of s)if(!uc(e[i],t[i]))return!1;return!0}return!1}const zz=Object.prototype.hasOwnProperty;function xb(e,t,s=0){if(e===t)return e;if(s>500)return t;const i=XE(e)&&XE(t);if(!i&&!(av(e)&&av(t)))return t;const o=(i?e:Object.keys(e)).length,l=i?t:Object.keys(t),u=l.length,d=i?new Array(u):{};let f=0;for(let g=0;g<u;g++){const m=i?g:l[g],h=e[m],x=t[m];if(h===x){d[m]=h,(i?g<o:zz.call(e,m))&&f++;continue}if(h===null||x===null||typeof h!="object"||typeof x!="object"){d[m]=x;continue}const S=xb(h,x,s+1);d[m]=S,S===h&&f++}return o===u&&f===o?e:d}function zh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function XE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function av(e){if(!ZE(e))return!1;const t=Object.getPrototypeOf(e),s=t?.constructor;if(s===void 0)return!0;if(typeof s!="function")return!1;const i=s.prototype;return!(!ZE(i)||!i.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function ZE(e){return Object.prototype.toString.call(e)==="[object Object]"}function _z(e){return new Promise(t=>{Po.setTimeout(t,e)})}function ov(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?xb(e,t):t}function Uz(e,t,s=0){const i=[...e,t];return s&&i.length>s?i.slice(1):i}function Hz(e,t,s=0){const i=[t,...e];return s&&i.length>s?i.slice(0,-1):i}const Sb=Symbol();function nO(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Sb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function wb(e,t){return typeof e=="function"?e(...t):!!e}function Fz(e,t,s){let i=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),i||(i=!0,o.aborted?s():o.addEventListener("abort",s,{once:!0})),o)}),e}let Bz=()=>Pz;const Eb=()=>Bz();var yc=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 yc{#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 Rb=new Vz,Kz=Iz;function qz(){let e=[],t=0,s=d=>{d()},i=d=>{d()},o=Kz;const l=d=>{t?e.push(d):o(()=>{s(d)})},u=()=>{const d=e;e=[],d.length&&o(()=>{i(()=>{d.forEach(f=>{s(f)})})})};return{batch:d=>{let f;t++;try{f=d()}finally{t--,t||u()}return f},batchCalls:d=>(...f)=>{l(()=>{d(...f)})},schedule:l,setNotifyFunction:d=>{s=d},setBatchNotifyFunction:d=>{i=d},setScheduler:d=>{o=d}}}const nr=qz();var Yz=class extends yc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}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 dp=new Yz;function $z(e){return Math.min(1e3*2**e,3e4)}function rO(e){return(e??"online")==="online"?dp.isOnline():!0}var lv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function sO(e){let t=!1,s=0,i,o="pending",l,u;const d=new Promise((O,T)=>{l=O,u=T});d.catch(Kr);const f=()=>o!=="pending",g=O=>{if(!f()){const T=new lv(O);C(T),e.onCancel?.(T)}},m=()=>{t=!0},h=()=>{t=!1},x=()=>Rb.isFocused()&&(e.networkMode==="always"||dp.isOnline())&&e.canRun(),S=()=>rO(e.networkMode)&&e.canRun(),w=O=>{f()||(i?.(),o="resolved",l(O))},C=O=>{f()||(i?.(),o="rejected",u(O))},E=O=>new Promise(T=>{i=A=>{(f()||O())&&T(A)},e.onPause?.()}).then(()=>{i=void 0,f()||e.onContinue?.()}),R=()=>{if(f())return;let O;const T=s===0?e.initialPromise:void 0;try{O=T??e.fn()}catch(A){O=Promise.reject(A)}Promise.resolve(O).then(w).catch(A=>{if(f())return;const N=e.retry??(Eb()?0:3),j=e.retryDelay??$z,D=typeof j=="function"?j(s,A):j,M=N===!0||typeof N=="number"&&s<N||typeof N=="function"&&N(s,A);if(t||!M){C(A);return}s++,e.onFail?.(s,A),_z(D).then(()=>x()?void 0:E(x)).then(()=>{t?C(A):R()})})};return{promise:d,status:()=>o,cancel:g,continue:()=>(i?.(),d),cancelRetry:m,continueRetry:h,canStart:S,start:()=>(S()?R():E(S).then(R),d)}}var iO=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),eO(this.gcTime)&&(this.#e=Po.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Eb()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Po.clearTimeout(this.#e),this.#e=void 0)}};function Gz(e){return{onFetch:(t,s)=>{const i=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let d={pages:[],pageParams:[]},f=0;const g=async()=>{let m=!1;const h=w=>{Fz(w,()=>t.signal,()=>m=!0)},x=nO(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 O=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};return h(j),j})(),T=await x(O),{maxPages:A}=t.options,N=E?Hz:Uz;return{pages:N(w.pages,T,A),pageParams:N(w.pageParams,C,A)}};if(o&&l.length){const w=o==="backward",C=w?Qz:JE,E={pages:l,pageParams:u};d=await S(E,C(i,E),w)}else{const w=e??l.length;do{const C=f===0?u[0]===void 0?i.initialPageParam:u[0]:JE(i,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},s):t.fetchFn=g}}}function JE(e,{pages:t,pageParams:s}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,s[i],s):void 0}function Qz(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var Xz=class extends iO{#e;#t;#n;#r;#i;#s;#a;#l;constructor(e){super(),this.#l=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=eR(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.#s?.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=eR(this.options);t.data!==void 0&&(this.setState(WE(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const s=ov(this.state.data,e,this.options);return this.#o({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e){this.#o({type:"setState",state:e})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Pn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sb||!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:!tO(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.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.#s&&(this.#l||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#s.cancel({revert:!0}):this.#s.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.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(g=>g.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#l=!0,s.signal)})},o=()=>{const f=nO(this.options,t),m=(()=>{const h={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(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.#i,state:this.state,fetchFn:o};return i(f),f})();(this.#e==="infinite"?Gz(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.#s=sO({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:f=>{f instanceof lv&&f.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.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 lv){if(f.silent)return this.#s.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.#s===d&&(this.#s=void 0),this.scheduleGc()}}#o(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...aO(s.data,this.options),fetchMeta:e.meta??null};case"success":const i={...s,...WE(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?i:void 0,i;case"error":const o=e.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),nr.batch(()=>{this.observers.slice().forEach(s=>{s.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function aO(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rO(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function WE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function eR(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,i=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Zz=class extends yc{#e;#t=void 0;#n=void 0;#r=void 0;#i;#s;#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),tR(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cv(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,s=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&&!zh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&nR(this.#t,s,this.options,t)&&this.#f(),this.updateResult(),i&&(this.#t!==s||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();i&&(this.#t!==s||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),s=this.createResult(t,e);return zh(this.getCurrentResult(),s)||(this.#r=s,this.#s=this.options,this.#i=this.#t.state),s}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(s,i)=>(this.trackProp(i),t?.(i),Reflect.get(s,i))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);let i=()=>{},o;const l=new Promise(u=>{o=u,i=this.#e.getQueryCache().subscribe(d=>{d.type==="updated"&&d.query.queryHash===s.queryHash&&s.state.data!==void 0&&(i(),u(this.createResult(s,t)))})});return Promise.race([s.fetch(t).then(()=>{const u=this.createResult(s,t);return o?.(u),u}).finally(()=>{i()}),l])}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(Kr)),t}#g(e){return!Eb()&&Pn(this.options.enabled,this.#t)!==!1&&eO(e)}#m(){this.#x();const e=Pn(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#g(e))return;const t=tO(this.#r.dataUpdatedAt,e)+1;this.#u=Po.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=Po.setInterval(()=>{(this.options.refetchIntervalInBackground||Rb.isFocused())&&this.#f()},this.#c))}#b(){this.#m(),this.#v(this.#y())}#x(){this.#u!==void 0&&(Po.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#d!==void 0&&(Po.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){const s=this.#t,i=this.options,o=this.#r,l=this.#i,u=this.#s,d=e!==s?e.state:this.#n,{state:f}=e;let g={...f},m=!1,h;if(t._optimisticResults){const N=this.hasListeners(),j=!N&&tR(e,t),D=N&&nR(e,s,t,i);(j||D)&&(g={...g,...aO(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=ov(o?.data,N,t),m=!0)}if(t.select&&h!==void 0&&!C)if(o&&h===l?.data&&t.select===this.#l)h=this.#o;else try{this.#l=t.select,h=t.select(h),h=ov(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",O=w==="error",T=R&&E,A=h!==void 0;return{status:w,fetchStatus:g.fetchStatus,isPending:R,isSuccess:w==="success",isError:O,isInitialLoading:T,isLoading:T,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:O&&!A,isPaused:g.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:O&&A,isStale:Cb(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.#i=this.#t.state,this.#s=this.options,this.#i.data!==void 0&&(this.#h=this.#t),zh(t,e))return;this.#r=t;const i=(()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!this.#p.size)return!0;const u=new Set(l??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)})})();nr.batch(()=>{i&&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 Jz(e,t){return Pn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Pn(t.retryOnMount,e)===!1)}function tR(e,t){return Jz(e,t)||e.state.data!==void 0&&cv(e,t,t.refetchOnMount)}function cv(e,t,s){if(Pn(t.enabled,e)!==!1&&Pn(t.staleTime,e)!=="static"){const i=Pn(s,e);return i==="always"||i!==!1&&Cb(e,t)}return!1}function nR(e,t,s,i){return(e!==t||Pn(i.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Cb(e,s)}function Cb(e,t){return Pn(t.enabled,e)!==!1&&e.isStaleByTime(Pn(t.staleTime,e))}var Wz=class extends iO{#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||oO(),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.#i({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},i=this.#r=sO({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(u,d)=>{this.#i({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#i({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",l=!i.canStart();try{if(o)t();else{this.#i({type:"pending",variables:e,isPaused:l}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const d=await this.options.onMutate?.(e,s);d!==this.state.context&&this.#i({type:"pending",context:d,variables:e,isPaused:l})}const u=await i.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,s),await this.options.onSuccess?.(u,e,this.state.context,s),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(u,null,e,this.state.context,s),this.#i({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onError?.(u,e,this.state.context,s)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,s)}catch(d){Promise.reject(d)}throw this.#i({type:"error",error:u}),u}finally{this.#r===i&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,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{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),nr.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function oO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var e_=class extends yc{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,s){const i=new Wz({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:s});return this.add(i),i}add(e){this.#e.add(e);const t=vh(e);if(typeof t=="string"){const s=this.#t.get(t);s?s.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=vh(e);if(typeof t=="string"){const s=this.#t.get(t);if(s)if(s.length>1){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}else s[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=vh(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=vh(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){nr.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(s=>QE(t,s))}findAll(e={}){return this.getAll().filter(t=>QE(e,t))}notify(e){nr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return nr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Kr))))}};function vh(e){return e.options.scope?.id}var t_=class extends yc{#e;#t=void 0;#n;#r;constructor(t,s){super(),this.#e=t,this.setOptions(s),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#e.defaultMutationOptions(t),zh(this.options,s)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),s?.mutationKey&&this.options.mutationKey&&Ko(s.mutationKey)!==Ko(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.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#i(),this.#s(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#s()}mutate(t,s){return this.#r=s,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#i(){const t=this.#n?.state??oO();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}}#s(t){nr.batch(()=>{const s=this.#r;if(s&&this.hasListeners()){const i=this.#t.variables,o=this.#t.context,l={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{s.onSuccess?.(t.data,i,o,l)}catch(u){Promise.reject(u)}try{s.onSettled?.(t.data,null,i,o,l)}catch(u){Promise.reject(u)}}else if(t?.type==="error"){try{s.onError?.(t.error,i,o,l)}catch(u){Promise.reject(u)}try{s.onSettled?.(void 0,t.error,i,o,l)}catch(u){Promise.reject(u)}}}this.listeners.forEach(i=>{i(this.#t)})})}},lO=class extends yc{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,s){const i=t.queryKey,o=t.queryHash??bb(i,t);let l=this.get(o);return l||(l=new Xz({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}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(){nr.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(s=>GE(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>GE(e,s)):t}notify(e){nr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){nr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){nr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},n_=class{#e;#t;#n;#r;#i;#s;#a;#l;constructor(e={}){this.#e=e.queryCache||new lO,this.#t=e.mutationCache||new e_,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=Rb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=dp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===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),s=this.#e.build(this,t),i=s.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Pn(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:s})=>[t,s.data])}setQueryData(e,t,s){const i=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(i.queryHash)?.state.data,l=Lz(t,o);if(l!==void 0)return this.#e.build(this,i).setData(l,{...s,manual:!0})}setQueriesData(e,t,s){return nr.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;nr.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#e;return nr.batch(()=>{const i=s.findAll(e),o=new Set(i);return i.forEach(l=>{l.reset()}),this.refetchQueries({type:"active",predicate:l=>o.has(l)},t)})}cancelQueries(e,t={}){const s={revert:!0,...t},i=nr.batch(()=>this.#e.findAll(e).map(o=>o.cancel(s)));return Promise.all(i).then(Kr).catch(Kr)}invalidateQueries(e,t={}){return nr.batch(()=>(this.#e.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},i=nr.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let l=o.fetch(void 0,s);return s.throwOnError||(l=l.catch(Kr)),o.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(Kr)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#e.build(this,t),i=s.isStaleByTime(Pn(t.staleTime,s))?await s.fetch(t):s.state.data,o=t.select;return o?o(i):i}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#e.build(this,t);return s.isStaleByTime(Pn(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return dp.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(Ko(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],s={};return t.forEach(i=>{uc(e,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(e,t){this.#i.set(Ko(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(i=>{uc(e,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bb(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===Sb&&(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 cO=b.createContext(!1),r_=()=>b.useContext(cO);cO.Provider;function s_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const i_=b.createContext(s_()),a_=()=>b.useContext(i_),o_=(e,t,s)=>{const i=s?.state.status==="error"&&typeof e.throwOnError=="function"?wb(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||i)&&(t.isReset()||(e.retryOnMount=!1))},l_=e=>{b.useEffect(()=>{e.clearReset()},[e])},c_=({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(o&&e.data===void 0||wb(s,[e.error,i])),u_=e=>{if(e.suspense){const s=o=>o==="static"?o:Math.max(o??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...o)=>s(i(...o)):s(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},d_=(e,t)=>e?.suspense&&t.isPending,f_=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function h_(e,t,s){const i=r_(),o=a_(),l=Or(s),u=l.defaultQueryOptions(e),d=l.getQueryCache().get(u.queryHash),f=e.subscribed!==!1;u._optimisticResults=i?"isRestoring":f?"optimistic":void 0,u_(u),o_(u,o,d),l_(o);const[g]=b.useState(()=>new t(l,u)),m=g.getOptimisticResult(u),h=!i&&f;if(b.useSyncExternalStore(b.useCallback(x=>{const S=h?g.subscribe(nr.batchCalls(x)):Kr;return g.updateResult(),S},[g,h]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),b.useEffect(()=>{g.setOptions(u)},[u,g]),d_(u,m))throw f_(u,g,o);if(c_({result:m,errorResetBoundary:o,throwOnError:u.throwOnError,query:d,suspense:u.suspense}))throw m.error;return u.notifyOnChangeProps?m:g.trackResult(m)}function ri(e,t){return h_(e,Zz,t)}function fg(e,t){const s=Or(t);return g_({filters:{...e,status:"pending"}},s).length}function p_(){let e;return(t,s)=>{let i=[],o;return()=>{const l=t.findAll(s.filters),u=l.flatMap(d=>[d,d.state]);return(!o||u.length!==i.length||u.some((d,f)=>!Object.is(d,i[f])))&&(i=u,o=xb(e,l.map(d=>s.select?s.select(d):d.state)),e=o),o}}}function g_(e={},t){const s=Or(t).getMutationCache(),[i]=b.useState(()=>p_()),o=i(s,e);return b.useSyncExternalStore(b.useCallback(l=>s.subscribe(nr.batchCalls(l)),[s]),o,o)}function Un(e,t){const s=Or(t),[i]=b.useState(()=>new t_(s,e));b.useEffect(()=>{i.setOptions(e)},[i,e]);const o=b.useSyncExternalStore(b.useCallback(u=>i.subscribe(nr.batchCalls(u)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=b.useCallback((...u)=>{i.mutate(u[0],u[1]).catch(Kr)},[i]);if(o.error&&wb(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:l,mutateAsync:o.mutate}}const hg="/api/settings";function m_(e){return vd({signal:e})}function y_(e){return vd({method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function v_(e){return vd({signal:e},`${hg}/skill-copy`)}function b_(e){return vd({method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)},`${hg}/skill-copy`)}function x_(e){return vd({signal:e},`${hg}/skill-status`)}async function vd(e,t=hg){const s=await fetch(t,e);if(!s.ok)throw new Error(await S_(s));return s.json()}async function S_(e){try{return(await e.json()).error?.message??`Request failed with status ${e.status}`}catch{return`Request failed with status ${e.status}`}}const uO=["skill-status"];function w_(){return ri({queryKey:uO,queryFn:({signal:e})=>x_(e),retry:!1})}const Sy=768;function Tb(){const[e,t]=b.useState(void 0);return b.useEffect(()=>{const s=window.matchMedia(`(max-width: ${Sy-1}px)`),i=()=>{t(window.innerWidth<Sy)};return s.addEventListener("change",i),t(window.innerWidth<Sy),()=>s.removeEventListener("change",i)},[]),!!e}var dO=e=>{throw TypeError(e)},fO=(e,t,s)=>t.has(e)||dO("Cannot "+s),Ns=(e,t,s)=>(fO(e,t,"read from private field"),s?s.call(e):t.get(e)),Ou=(e,t,s)=>t.has(e)?dO("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),bi=(e,t,s,i)=>(fO(e,t,"write to private field"),t.set(e,s),s),pg=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,gg=/^[\\/]{2}/;function hO(e,t){return t+e.replace(/\\/g,"/")}var rR="popstate";function sR(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function E_(e={}){function t(o,l){let{pathname:u="/",search:d="",hash:f=""}=si(o.location.hash.substring(1));return!u.startsWith("/")&&!u.startsWith(".")&&(u="/"+u),Yu("",{pathname:u,search:d,hash:f},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function s(o,l){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 l=="string"?l:Cr(l))}function i(o,l){Fn(o.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(l)})`)}return C_(t,s,i,e)}function Ut(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Fn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function R_(){return Math.random().toString(36).substring(2,10)}function iR(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 Yu(e,t,s=null,i,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?si(t):t,state:s,key:t&&t.key||i||R_(),mask:o}}function Cr({pathname:e="/",search:t="",hash:s=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),s&&s!=="#"&&(e+=s.charAt(0)==="#"?s:"#"+s),e}function si(e){let t={};if(e){let s=e.indexOf("#");s>=0&&(t.hash=e.substring(s),e=e.substring(0,s));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function C_(e,t,s,i={}){let{window:o=document.defaultView,v5Compat:l=!1}=i,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 O=sR(E)?E:Yu(C.location,E,R);s&&s(O,E),g=m()+1;let T=iR(O,g),A=C.createHref(O.mask||O);try{u.pushState(T,"",A)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;o.location.assign(A)}l&&f&&f({action:d,location:C.location,delta:1})}function S(E,R){d="REPLACE";let O=sR(E)?E:Yu(C.location,E,R);s&&s(O,E),g=m();let T=iR(O,g),A=C.createHref(O.mask||O);u.replaceState(T,"",A),l&&f&&f({action:d,location:C.location,delta:0})}function w(E){return pO(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(rR,h),f=E,()=>{o.removeEventListener(rR,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 pO(e,t,s=!1){let i="http://localhost";e&&(i=e.location.origin!=="null"?e.location.origin:e.location.href),Ut(i,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Cr(t);return o=o.replace(/ $/,"%20"),!s&&gg.test(o)&&(o=i+o),new URL(o,i)}var Au,aR=class{constructor(e){if(Ou(this,Au,new Map),e)for(let[t,s]of e)this.set(t,s)}get(e){if(Ns(this,Au).has(e))return Ns(this,Au).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Ns(this,Au).set(e,t)}};Au=new WeakMap;var T_=new Set(["lazy","caseSensitive","path","id","index","children"]);function k_(e){return T_.has(e)}var O_=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function A_(e){return O_.has(e)}function M_(e){return e.index===!0}function $u(e,t,s=[],i={},o=!1){return e.map((l,u)=>{let d=[...s,String(u)],f=typeof l.id=="string"?l.id:d.join("-");if(Ut(l.index!==!0||!l.children,"Cannot specify children on an index route"),Ut(o||!i[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),M_(l)){let g={...l,id:f};return i[f]=oR(g,t(g)),g}else{let g={...l,id:f,children:void 0};return i[f]=oR(g,t(g)),l.children&&(g.children=$u(l.children,t,d,i,o)),g}})}function oR(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function gO(e,t,s="/"){return Gs(e,t,s,!1)}function Gs(e,t,s,i,o){let l=typeof t=="string"?si(t):t,u=ts(l.pathname||"/",s);if(u==null)return null;let d=o??_h(e),f=null,g=xO(u);for(let m=0;f==null&&m<d.length;++m)f=F_(d[m],g,i);return f}function N_(e,t){let{route:s,pathname:i,params:o}=e;return{id:s.id,pathname:i,params:o,data:t[s.id],loaderData:t[s.id],handle:s.handle}}function _h(e){let t=mO(e);return D_(t),t}function mO(e,t=[],s=[],i="",o=!1){let l=(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(i)&&f)return;Ut(m.relativePath.startsWith(i),`Absolute route path "${m.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(i.length)}let h=Ps([i,m.relativePath]),x=s.concat(m);u.children&&u.children.length>0&&(Ut(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),mO(u.children,t,x,h,f)),!(u.path==null&&!u.index)&&t.push({path:h,score:U_(h,u.index),routesMeta:x.map((S,w)=>{let[C,E]=bO(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("?"))l(u,d);else for(let f of yO(u.path))l(u,d,!0,f)}),t}function yO(e){let t=e.split("/");if(t.length===0)return[];let[s,...i]=t,o=s.endsWith("?"),l=s.replace(/\?$/,"");if(i.length===0)return o?[l,""]:[l];let u=yO(i.join("/")),d=[];return d.push(...u.map(f=>f===""?l:[l,f].join("/"))),o&&d.push(...u),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function D_(e){e.sort((t,s)=>t.score!==s.score?s.score-t.score:H_(t.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}var j_=/^:[\w-]+$/,I_=3,P_=2,L_=1,z_=10,__=-2,lR=e=>e==="*";function U_(e,t){let s=e.split("/"),i=s.length;return s.some(lR)&&(i+=__),t&&(i+=P_),s.filter(o=>!lR(o)).reduce((o,l)=>o+(j_.test(l)?I_:l===""?L_:z_),i)}function H_(e,t){return e.length===t.length&&e.slice(0,-1).every((i,o)=>i===t[o])?e[e.length-1]-t[t.length-1]:0}function F_(e,t,s=!1){let{routesMeta:i}=e,o={},l="/",u=[];for(let d=0;d<i.length;++d){let f=i[d],g=d===i.length-1,m=l==="/"?t:t.slice(l.length)||"/",h={path:f.relativePath,caseSensitive:f.caseSensitive,end:g},x=f.matcher&&f.compiledParams?vO(h,m,f.matcher,f.compiledParams):Gu(h,m),S=f.route;if(!x&&g&&s&&!i[i.length-1].route.index&&(x=Gu({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!x)return null;Object.assign(o,x.params),u.push({params:o,pathname:Ps([l,x.pathname]),pathnameBase:K_(Ps([l,x.pathnameBase])),route:S}),x.pathnameBase!=="/"&&(l=Ps([l,x.pathnameBase]))}return u}function Gu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[s,i]=bO(e.path,e.caseSensitive,e.end);return vO(e,t,s,i)}function vO(e,t,s,i){let o=t.match(s);if(!o)return null;let l=o[0],u=dc(l,1),d=o.slice(1);return{params:i.reduce((g,{paramName:m,isOptional:h},x)=>{if(m==="*"){let w=d[x]||"";u=dc(l.slice(0,l.length-w.length),1)}const S=d[x];return h&&!S?g[m]=void 0:g[m]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:l,pathnameBase:u,pattern:e}}function bO(e,t=!1,s=!0){Fn(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 i=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,f,g,m)=>{if(i.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("*")?(i.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),i]}function xO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Fn(!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 ts(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let s=t.endsWith("/")?t.length-1:t.length,i=e.charAt(s);return i&&i!=="/"?null:e.slice(s)||"/"}function B_({basename:e,pathname:t}){return t==="/"?e:Ps([e,t])}var kb=e=>pg.test(e);function V_(e,t="/"){let{pathname:s,search:i="",hash:o=""}=typeof e=="string"?si(e):e,l;return s?(s=Ob(s),s.startsWith("/")||s.startsWith("\\")?l=cR(s.substring(1),"/"):l=cR(s,t)):l=t,{pathname:l,search:q_(i),hash:Y_(o)}}function cR(e,t){let s=dc(t).split("/");return e.split("/").forEach(o=>{o===".."?s.length>1&&s.pop():o!=="."&&s.push(o)}),s.length>1?s.join("/"):"/"}function wy(e,t,s,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function SO(e){return e.filter((t,s)=>s===0||t.route.path&&t.route.path.length>0)}function mg(e){let t=SO(e);return t.map((s,i)=>i===t.length-1?s.pathname:s.pathnameBase)}function bd(e,t,s,i=!1){let o;typeof e=="string"?o=si(e):(o={...e},Ut(!o.pathname||!o.pathname.includes("?"),wy("?","pathname","search",o)),Ut(!o.pathname||!o.pathname.includes("#"),wy("#","pathname","hash",o)),Ut(!o.search||!o.search.includes("#"),wy("#","search","hash",o)));let l=e===""||o.pathname==="",u=l?"/":o.pathname,d;if(u==null)d=s;else{let h=t.length-1;if(!i&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),h-=1;o.pathname=x.join("/")}d=h>=0?t[h]:"/"}let f=V_(o,d),g=u&&u!=="/"&&u.endsWith("/"),m=(l||u===".")&&s.endsWith("/");return!f.pathname.endsWith("/")&&(g||m)&&(f.pathname+="/"),f}var Ob=e=>e.replace(/[\\/]{2,}/g,"/"),Ps=e=>Ob(e.join("/"));function dc(e,t=0){let s=e.length;for(;s>t&&e.charCodeAt(s-1)===47;)s--;return s===e.length?e:e.slice(0,s)}var K_=e=>dc(e).replace(/^\/*/,"/"),q_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Y_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,$_=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],xd=class{constructor(e,t,s,i=!1){this.status=e,this.statusText=t||"",this.internal=i,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Qu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Sd(e){let t=e.map(s=>s.route.path).filter(Boolean);return Ps(t)||"/"}var wO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function EO(e,t){let s=e;if(typeof s!="string"||!pg.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let i=s,o=!1;if(wO)try{let l=new URL(window.location.href),u=gg.test(s)?new URL(hO(s,l.protocol)):new URL(s),d=ts(u.pathname,t);u.origin===l.origin&&d!=null?s=d+u.search+u.hash:o=!0}catch{Fn(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:o,to:s}}var Ua=Symbol("Uninstrumented");function G_(e,t){let s={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(l){let u=Object.keys(s);for(let d of u)l[d]&&s[d].push(l[d])}}));let i={};if(typeof t.lazy=="function"&&s.lazy.length>0){let o=Yl(s.lazy,t.lazy,()=>{});o&&(i.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(l=>{let u=o[l],d=s[`lazy.${l}`];if(typeof u=="function"&&d.length>0){let f=Yl(d,u,()=>{});f&&(i.lazy=Object.assign(i.lazy||{},{[l]:f}))}})}return["loader","action"].forEach(o=>{let l=t[o];if(typeof l=="function"&&s[o].length>0){let u=l[Ua]??l,d=Yl(s[o],u,(...f)=>uR(f[0]));d&&(o==="loader"&&u.hydrate===!0&&(d.hydrate=!0),d[Ua]=u,i[o]=d)}}),t.middleware&&t.middleware.length>0&&s.middleware.length>0&&(i.middleware=t.middleware.map(o=>{let l=o[Ua]??o,u=Yl(s.middleware,l,(...d)=>uR(d[0]));return u?(u[Ua]=l,u):o})),i}function Q_(e,t){let s={navigate:[],fetch:[]};if(t.forEach(i=>i({instrument(o){let l=Object.keys(o);for(let u of l)o[u]&&s[u].push(o[u])}})),s.navigate.length>0){let i=e.navigate[Ua]??e.navigate,o=Yl(s.navigate,i,(...l)=>{let[u,d]=l;return{to:typeof u=="number"||typeof u=="string"?u:u?Cr(u):".",...dR(e,d??{})}});o&&(o[Ua]=i,e.navigate=o)}if(s.fetch.length>0){let i=e.fetch[Ua]??e.fetch,o=Yl(s.fetch,i,(...l)=>{let[u,,d,f]=l;return{href:d??".",fetcherKey:u,...dR(e,f??{})}});o&&(o[Ua]=i,e.fetch=o)}return e}function Yl(e,t,s){return e.length===0?null:async(...i)=>{let o=await RO(e,s(...i),()=>t(...i),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function RO(e,t,s,i){let o=e[i],l;if(o){let u,d=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=RO(e,t,s,i-1),l=await u,Ut(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.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{l={type:"success",value:await s()}}catch(u){l={type:"error",value:u}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function uR(e){let{request:t,context:s,params:i,pattern:o}=e;return{request:X_(t),params:{...i},pattern:o,context:Z_(s)}}function dR(e,t){return{currentUrl:Cr(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 X_(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Z_(e){if(W_(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var J_=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function W_(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")===J_}var fR=new URL("http://localhost");function Ab(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),fR)}catch{return fR}}function Ey(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function e6(e,t){if(e.startsWith("//"))return!0;let s=t.protocol.toLowerCase();return e.toLowerCase().startsWith(s)?t.host===""||e.slice(s.length).startsWith("//"):!1}function tc(e,t,s,i){let o=null;try{o=e==null?null:new URL(e,s)}catch{}let l=new URL(t,s),u=o!=null&&!Ey(o,s),d=!Ey(l,s);if(i==="reject"){if(u||d)throw new Error("External navigation is not allowed")}else if(d&&(o==null||!e6(e,o)||!Ey(o,l)))throw new Error("External navigation is not allowed")}var CO=["POST","PUT","PATCH","DELETE"],t6=new Set(CO),n6=["GET",...CO],r6=new Set(n6),TO=new Set([301,302,303,307,308]),s6=new Set([307,308]),Ry={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},i6={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Fl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},a6=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),kO="remix-router-transitions",OO=Symbol("ResetLoaderData"),jo,Bl,Ia,Vl,o6=class{constructor(e){Ou(this,jo),Ou(this,Bl),Ou(this,Ia),Ou(this,Vl),bi(this,jo,e),bi(this,Bl,_h(e))}get stableRoutes(){return Ns(this,jo)}get activeRoutes(){return Ns(this,Ia)??Ns(this,jo)}get branches(){return Ns(this,Vl)??Ns(this,Bl)}get hasHMRRoutes(){return Ns(this,Ia)!=null}setRoutes(e){bi(this,jo,e),bi(this,Bl,_h(e))}setHmrRoutes(e){bi(this,Ia,e),bi(this,Vl,_h(e))}commitHmrRoutes(){Ns(this,Ia)&&(bi(this,jo,Ns(this,Ia)),bi(this,Bl,Ns(this,Vl)),bi(this,Ia,void 0),bi(this,Vl,void 0))}};jo=new WeakMap;Bl=new WeakMap;Ia=new WeakMap;Vl=new WeakMap;function l6(e){const t=e.window?e.window:typeof window<"u"?window:void 0,s=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Ut(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=e.hydrationRouteProperties||[],o=e.mapRouteProperties||a6,l=o;if(e.instrumentations){let V=e.instrumentations;l=W=>({...o(W),...G_(V.map(re=>re.route).filter(Boolean),W)})}let u={},d=new o6($u(e.routes,l,void 0,u)),f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let g=e.dataStrategy||h6,m={...e.future},h=null,x=new Set,S=null,w=null,C=null,E=null,R=e.hydrationData!=null,O=Gs(d.activeRoutes,e.history.location,f,!1,d.branches),T=!1,A=null,N,j;if(O==null&&!e.patchRoutesOnNavigation){let V=Ds(404,{pathname:e.history.location.pathname}),{matches:W,route:re}=bh(d.activeRoutes);N=!0,j=!N,O=W,A={[re.id]:V}}else if(O&&!e.hydrationData&&Ie(O,d.activeRoutes,e.history.location.pathname).active&&(O=null),O)if(O.some(V=>V.route.lazy))N=!1,j=!N;else if(!O.some(V=>Mb(V.route)))N=!0,j=!N;else{let V=e.hydrationData?e.hydrationData.loaderData:null,W=e.hydrationData?e.hydrationData.errors:null,re=O;if(W){let ve=O.findIndex(Se=>W[Se.route.id]!==void 0);re=re.slice(0,ve+1)}j=!1,N=!0,re.forEach(ve=>{let Se=AO(ve.route,V,W);j=j||Se.renderFallback,N=N&&!Se.shouldLoad})}else{N=!1,j=!N,O=[];let V=Ie(null,d.activeRoutes,e.history.location.pathname);V.active&&V.matches&&(T=!0,O=V.matches)}let D,M={historyAction:e.history.action,location:e.history.location,matches:O,initialized:N,renderFallback:j,navigation:Ry,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||A,fetchers:new Map,blockers:new Map},z="POP",L=null,K=!1,X,B=!1,H=new Map,U=null,_=!1,Q=!1,G=new Set,q=new Map,Y=0,ee=-1,$=new Map,ae=new Set,I=new Map,F=new Map,Z=new Set,ne=new Map,ye,se=null;function ge(){if(h=e.history.listen(({action:V,location:W,delta:re})=>{if(ye){ye(),ye=void 0;return}Fn(ne.size===0||re!=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 ve=St({currentLocation:M.location,nextLocation:W,historyAction:V});if(ve&&re!=null){let Se=new Promise(qe=>{ye=qe});e.history.go(re*-1),pt(ve,{state:"blocked",location:W,proceed(){pt(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:W}),Se.then(()=>e.history.go(re))},reset(){let qe=new Map(M.blockers);qe.set(ve,Fl),Re({blockers:qe})}}),L?.resolve(),L=null;return}return ze(V,W)}),s){D6(t,H);let V=()=>j6(t,H);t.addEventListener("pagehide",V),U=()=>t.removeEventListener("pagehide",V)}return M.initialized||ze("POP",M.location,{initialHydration:!0}),D}function fe(){h&&h(),U&&U(),x.clear(),X&&X.abort(),M.fetchers.forEach((V,W)=>Dt(M.fetchers,W)),M.blockers.forEach((V,W)=>Zt(W))}function ce(V){if(x.add(V),S){let{newErrors:W}=S;S=null,V(M,{deletedFetchers:[],newErrors:W,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(V)}function Re(V,W={}){V.matches&&(V.matches=V.matches.map(Se=>{let qe=u[Se.route.id],Ke=Se.route;return Ke.element!==qe.element||Ke.errorElement!==qe.errorElement||Ke.hydrateFallbackElement!==qe.hydrateFallbackElement?{...Se,route:qe}:Se})),M={...M,...V};let re=[],ve=[];M.fetchers.forEach((Se,qe)=>{Se.state==="idle"&&(Z.has(qe)?re.push(qe):ve.push(qe))}),Z.forEach(Se=>{!M.fetchers.has(Se)&&!q.has(Se)&&re.push(Se)}),x.size===0&&(S={newErrors:V.errors??null}),[...x].forEach(Se=>Se(M,{deletedFetchers:re,newErrors:V.errors??null,viewTransitionOpts:W.viewTransitionOpts,flushSync:W.flushSync===!0})),re.forEach(Se=>Dt(M.fetchers,Se)),ve.forEach(Se=>M.fetchers.delete(Se))}function be(V,W,{flushSync:re}={}){let ve=M.actionData!=null&&M.navigation.formMethod!=null&&Dr(M.navigation.formMethod)&&M.navigation.state==="loading"&&V.state?._isRedirect!==!0,Se;W.actionData?Object.keys(W.actionData).length>0?Se=W.actionData:Se=null:ve?Se=M.actionData:Se=null;let qe=W.loaderData?wR(M.loaderData,W.loaderData,W.matches||[],W.errors):M.loaderData,Ke=M.blockers;Ke.size>0&&(Ke=new Map(Ke),Ke.forEach((nt,Rt)=>Ke.set(Rt,Fl)));let Xe=_?!1:at(V,W.matches||M.matches),Qe=K===!0||M.navigation.formMethod!=null&&Dr(M.navigation.formMethod)&&V.state?._isRedirect!==!0;d.commitHmrRoutes(),_||z==="POP"||(z==="PUSH"?e.history.push(V,V.state):z==="REPLACE"&&e.history.replace(V,V.state));let ct;if(z==="POP"&&!_&&V!==M.location){let nt=H.get(M.location.pathname);nt&&nt.has(V.pathname)?ct={currentLocation:M.location,nextLocation:V}:H.has(V.pathname)&&(ct={currentLocation:V,nextLocation:M.location})}else if(B){let nt=H.get(M.location.pathname);nt?nt.add(V.pathname):(nt=new Set([V.pathname]),H.set(M.location.pathname,nt)),ct={currentLocation:M.location,nextLocation:V}}Re({...W,actionData:Se,loaderData:qe,historyAction:z,location:V,initialized:!0,renderFallback:!1,navigation:Ry,revalidation:"idle",restoreScrollPosition:Xe,preventScrollReset:Qe,blockers:Ke},{viewTransitionOpts:ct,flushSync:re===!0}),z="POP",K=!1,B=!1,_=!1,Q=!1,L?.resolve(),L=null,se?.resolve(),se=null}async function Le(V,W){if(L?.resolve(),L=null,typeof V=="number"){L||(L=TR());let Bt=L.promise;return e.history.go(V),Bt}let re=uv(M.location,M.matches,f,V,W?.fromRouteId,W?.relative),{path:ve,submission:Se,error:qe}=hR(!1,re,W),Ke;if(W?.mask){let Bt=typeof W.mask=="string"?si(W.mask):{...M.location.mask,...W.mask};if(Ke={pathname:Bt.pathname??"",search:Bt.search??"",hash:Bt.hash??""},gg.test(Ke.pathname))throw new Error("External navigation is not allowed");Ke.pathname.startsWith("\\")&&(Ke.pathname=Ke.pathname.replace(/^\\+/,"/")),tc(typeof W.mask=="string"?W.mask:Cr(W.mask),Cr(Ke),e.history.createURL("/"),"reject")}let Xe=M.location,Qe=Yu(Xe,ve,W&&W.state,void 0,Ke);Qe={...Qe,...e.history.encodeLocation(Qe)},tc(V==null?e.history.createHref(M.location):typeof V=="string"?V:Cr(V),e.history.createHref(Qe.mask||Qe),e.history.createURL("/"),"reject");let ct=W&&W.replace!=null?W.replace:void 0,nt="PUSH";ct===!0?nt="REPLACE":ct===!1||Se!=null&&Dr(Se.formMethod)&&Se.formAction===M.location.pathname+M.location.search&&(nt="REPLACE");let Rt=W&&"preventScrollReset"in W?W.preventScrollReset===!0:void 0,ft=(W&&W.flushSync)===!0,Yt=St({currentLocation:Xe,nextLocation:Qe,historyAction:nt});if(Yt){pt(Yt,{state:"blocked",location:Qe,proceed(){pt(Yt,{state:"proceeding",proceed:void 0,reset:void 0,location:Qe}),Le(V,W)},reset(){let Bt=new Map(M.blockers);Bt.set(Yt,Fl),Re({blockers:Bt})}});return}await ze(nt,Qe,{submission:Se,pendingError:qe,preventScrollReset:Rt,replace:W&&W.replace,enableViewTransition:W&&W.viewTransition,flushSync:ft,callSiteDefaultShouldRevalidate:W&&W.defaultShouldRevalidate})}function Oe(){se||(se=TR()),Me(),Re({revalidation:"loading"});let V=se.promise;return M.navigation.state==="submitting"?V:M.navigation.state==="idle"?(ze(M.historyAction,M.location,{startUninterruptedRevalidation:!0}),V):(ze(z||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation,enableViewTransition:B===!0}),V)}async function ze(V,W,re){X&&X.abort(),X=null,z=V,_=(re&&re.startUninterruptedRevalidation)===!0,je(M.location,M.matches),K=(re&&re.preventScrollReset)===!0,B=(re&&re.enableViewTransition)===!0;let ve=d.activeRoutes,Se=re?.initialHydration&&M.matches&&M.matches.length>0&&!T?M.matches:Gs(ve,W,f,!1,d.branches),qe=(re&&re.flushSync)===!0;if(Se&&M.initialized&&!Q&&w6(M.location,W)&&!(re&&re.submission&&Dr(re.submission.formMethod))){be(W,{matches:Se},{flushSync:qe});return}let Ke=Ie(Se,ve,W.pathname);if(Ke.active&&Ke.matches&&(Se=Ke.matches),!Se){let{error:$t,notFoundMatches:Vt,route:Cn}=yt(W.pathname);be(W,{matches:Vt,loaderData:{},errors:{[Cn.id]:$t}},{flushSync:qe});return}let Xe=re&&re.overrideNavigation?{...re.overrideNavigation,matches:Se,historyAction:V}:void 0;X=new AbortController;let Qe=Kl(e.history,W,X.signal,re&&re.submission),ct=e.getContext?await e.getContext():new aR,nt;if(re&&re.pendingError)nt=[za(Se).route.id,{type:"error",error:re.pendingError}];else if(re&&re.submission&&Dr(re.submission.formMethod)){let $t=await Ve(Qe,W,re.submission,Se,V,ct,Ke.active,re&&re.initialHydration===!0,{replace:re.replace,flushSync:qe});if($t.shortCircuited)return;if($t.pendingActionResult){let[Vt,Cn]=$t.pendingActionResult;if(ms(Cn)&&Qu(Cn.error)&&Cn.error.status===404){X=null,be(W,{matches:$t.matches,loaderData:{},errors:{[Vt]:Cn.error}});return}}Se=$t.matches||Se,nt=$t.pendingActionResult,Xe=Cy(W,Se,V,re.submission),qe=!1,Ke.active=!1,Qe=Kl(e.history,Qe.url,Qe.signal)}let{shortCircuited:Rt,matches:ft,loaderData:Yt,errors:Bt,workingFetchers:On}=await ke(Qe,W,Se,V,ct,Ke.active,Xe,re&&re.submission,re&&re.fetcherSubmission,re&&re.replace,re&&re.initialHydration===!0,qe,nt,re&&re.callSiteDefaultShouldRevalidate);Rt||(X=null,be(W,{matches:ft||Se,...ER(nt),loaderData:Yt,errors:Bt,...On?{fetchers:On}:{}}))}async function Ve(V,W,re,ve,Se,qe,Ke,Xe,Qe={}){Me();let ct=M6(W,ve,Se,re);if(Re({navigation:ct},{flushSync:Qe.flushSync===!0}),Ke){let ft=await _e(ve,W.pathname,V.signal);if(ft.type==="aborted")return{shortCircuited:!0};if(ft.type==="error"){if(ft.partialMatches.length===0){let{matches:Bt,route:On}=bh(d.activeRoutes);return{matches:Bt,pendingActionResult:[On.id,{type:"error",error:ft.error}]}}let Yt=za(ft.partialMatches).route.id;return{matches:ft.partialMatches,pendingActionResult:[Yt,{type:"error",error:ft.error}]}}else if(ft.matches)ve=ft.matches;else{let{notFoundMatches:Yt,error:Bt,route:On}=yt(W.pathname);return{matches:Yt,pendingActionResult:[On.id,{type:"error",error:Bt}]}}}let nt,Rt=Uh(ve,W);if(!Rt.route.action&&!Rt.route.lazy)nt={type:"error",error:Ds(405,{method:V.method,pathname:W.pathname,routeId:Rt.route.id})};else{let ft=nc(l,u,V,W,ve,Rt,Xe?[]:i,qe),Yt=await Ee(V,W,ft,qe,null);if(nt=Yt[Rt.route.id],!nt){for(let Bt of ve)if(Yt[Bt.route.id]){nt=Yt[Bt.route.id];break}}if(V.signal.aborted)return{shortCircuited:!0}}if(Lo(nt)){let ft;return Qe&&Qe.replace!=null?ft=Qe.replace:ft=bR(nt.response.headers.get("Location"),new URL(V.url),f,e.history)===M.location.pathname+M.location.search,await de(V,nt,!0,{submission:re,replace:ft}),{shortCircuited:!0}}if(ms(nt)){let ft=za(ve,Rt.route.id);return(Qe&&Qe.replace)!==!0&&(z="PUSH"),{matches:ve,pendingActionResult:[ft.route.id,nt,Rt.route.id]}}return{matches:ve,pendingActionResult:[Rt.route.id,nt]}}async function ke(V,W,re,ve,Se,qe,Ke,Xe,Qe,ct,nt,Rt,ft,Yt){let Bt=Ke||Cy(W,re,ve,Xe),On=Xe||Qe||CR(Bt),$t=!_&&!nt;if(qe){if($t){let Yn=Ue(ft);Re({navigation:Bt,...Yn!==void 0?{actionData:Yn}:{}},{flushSync:Rt})}let _t=await _e(re,W.pathname,V.signal);if(_t.type==="aborted")return{shortCircuited:!0};if(_t.type==="error"){if(_t.partialMatches.length===0){let{matches:Bn,route:mr}=bh(d.activeRoutes);return{matches:Bn,loaderData:{},errors:{[mr.id]:_t.error}}}let Yn=za(_t.partialMatches).route.id;return{matches:_t.partialMatches,loaderData:{},errors:{[Yn]:_t.error}}}else if(_t.matches)re=_t.matches;else{let{error:Yn,notFoundMatches:Bn,route:mr}=yt(W.pathname);return{matches:Bn,loaderData:{},errors:{[mr.id]:Yn}}}}let Vt=d.activeRoutes,{dsMatches:Cn,revalidatingFetchers:Tn}=pR(V,Se,l,u,e.history,M,re,On,W,nt?[]:i,nt===!0,Q,G,Z,I,ae,Vt,f,e.patchRoutesOnNavigation!=null,d.branches,ft,Yt);if(ee=++Y,!e.dataStrategy&&!Cn.some(_t=>_t.shouldLoad)&&!Cn.some(_t=>_t.route.middleware&&_t.route.middleware.length>0)&&Tn.length===0){let _t=new Map(M.fetchers),Yn=nn(_t);return be(W,{matches:re,loaderData:{},errors:ft&&ms(ft[1])?{[ft[0]]:ft[1].error}:null,...ER(ft),...Yn?{fetchers:_t}:{}},{flushSync:Rt}),{shortCircuited:!0}}if($t){let _t={};if(!qe){_t.navigation=Bt;let Yn=Ue(ft);Yn!==void 0&&(_t.actionData=Yn)}Tn.length>0&&(_t.fetchers=xe(Tn)),Re(_t,{flushSync:Rt})}Tn.forEach(_t=>{tn(_t.key),_t.controller&&q.set(_t.key,_t.controller)});let rs=()=>Tn.forEach(_t=>tn(_t.key));X&&X.signal.addEventListener("abort",rs);let{loaderResults:fn,fetcherResults:hn}=await $e(Cn,Tn,V,W,Se);if(V.signal.aborted)return{shortCircuited:!0};X&&X.signal.removeEventListener("abort",rs),Tn.forEach(_t=>q.delete(_t.key));let An=xh(fn);if(An)return await de(V,An.result,!0,{replace:ct}),{shortCircuited:!0};if(An=xh(hn),An)return ae.add(An.key),await de(V,An.result,!0,{replace:ct}),{shortCircuited:!0};let jn=new Map(M.fetchers),{loaderData:Mi,errors:Lr}=SR(M,re,fn,ft,Tn,hn,jn);nt&&M.errors&&(Lr={...M.errors,...Lr});let Fs=nn(jn),ss=et(ee,jn),Ss=Fs||ss||Tn.length>0;return{matches:re,loaderData:Mi,errors:Lr,...Ss?{workingFetchers:jn}:{}}}function Ue(V){if(V&&!ms(V[1]))return{[V[0]]:V[1].data};if(M.actionData)return Object.keys(M.actionData).length===0?null:M.actionData}function xe(V){let W=new Map(M.fetchers);return V.forEach(re=>{let ve=W.get(re.key),Se=wu(void 0,ve?ve.data:void 0);W.set(re.key,Se)}),W}async function Fe(V,W,re,ve){tn(V);let Se=(ve&&ve.flushSync)===!0,qe=d.activeRoutes,Ke=uv(M.location,M.matches,f,re,W,ve?.relative),Xe=Gs(qe,Ke,f,!1,d.branches),Qe=Ie(Xe,qe,Ke);if(Qe.active&&Qe.matches&&(Xe=Qe.matches),!Xe){xt(V,W,Ds(404,{pathname:Ke}),{flushSync:Se});return}let{path:ct,submission:nt,error:Rt}=hR(!0,Ke,ve);if(Rt){xt(V,W,Rt,{flushSync:Se});return}let ft=e.getContext?await e.getContext():new aR,Yt=(ve&&ve.preventScrollReset)===!0;if(nt&&Dr(nt.formMethod)){await Je(V,W,ct,Xe,ft,Qe.active,Se,Yt,nt,ve&&ve.defaultShouldRevalidate);return}I.set(V,{routeId:W,path:ct}),await ot(V,W,ct,Xe,ft,Qe.active,Se,Yt,nt)}async function Je(V,W,re,ve,Se,qe,Ke,Xe,Qe,ct){Me(),I.delete(V);let nt=M.fetchers.get(V);De(V,N6(Qe,nt),{flushSync:Ke});let Rt=new AbortController,ft=Kl(e.history,re,Rt.signal,Qe);if(qe){let we=await _e(ve,new URL(ft.url).pathname,ft.signal,V);if(we.type==="aborted")return;if(we.type==="error"){xt(V,W,we.error,{flushSync:Ke});return}else if(we.matches)ve=we.matches;else{xt(V,W,Ds(404,{pathname:re}),{flushSync:Ke});return}}let Yt=Uh(ve,re);if(!Yt.route.action&&!Yt.route.lazy){let we=Ds(405,{method:Qe.formMethod,pathname:re,routeId:W});xt(V,W,we,{flushSync:Ke});return}q.set(V,Rt);let Bt=Y,On=nc(l,u,ft,re,ve,Yt,i,Se),$t=await Ee(ft,re,On,Se,V),Vt=$t[Yt.route.id];if(!Vt){for(let we of On)if($t[we.route.id]){Vt=$t[we.route.id];break}}if(ft.signal.aborted){q.get(V)===Rt&&q.delete(V);return}if(Z.has(V)){if(Lo(Vt)||ms(Vt)){De(V,xi(void 0));return}}else{if(Lo(Vt))if(q.delete(V),ee>Bt){De(V,xi(void 0));return}else return ae.add(V),De(V,wu(Qe)),de(ft,Vt,!1,{fetcherSubmission:Qe,preventScrollReset:Xe});if(ms(Vt)){xt(V,W,Vt.error);return}}let Cn=M.navigation.location||M.location,Tn=Kl(e.history,Cn,Rt.signal),rs=d.activeRoutes,fn=M.navigation.state!=="idle"?Gs(rs,M.navigation.location,f,!1,d.branches):M.matches;Ut(fn,"Didn't find any matches after fetcher action");let hn=++Y;$.set(V,hn);let{dsMatches:An,revalidatingFetchers:jn}=pR(Tn,Se,l,u,e.history,M,fn,Qe,Cn,i,!1,Q,G,Z,I,ae,rs,f,e.patchRoutesOnNavigation!=null,d.branches,[Yt.route.id,Vt],ct),Mi=wu(Qe,Vt.data),Lr=new Map(M.fetchers);Lr.set(V,Mi),jn.filter(we=>we.key!==V).forEach(we=>{let rt=we.key,At=Lr.get(rt),Ct=wu(void 0,At?At.data:void 0);Lr.set(rt,Ct),tn(rt),we.controller&&q.set(rt,we.controller)}),Re({fetchers:Lr});let Fs=()=>jn.forEach(we=>tn(we.key));Rt.signal.addEventListener("abort",Fs);let{loaderResults:ss,fetcherResults:Ss}=await $e(An,jn,Tn,Cn,Se);if(Rt.signal.aborted)return;Rt.signal.removeEventListener("abort",Fs),$.delete(V),q.delete(V),jn.forEach(we=>q.delete(we.key));let _t=M.fetchers.has(V),Yn=we=>{if(!_t)return we;let rt=new Map(we.fetchers);return rt.set(V,xi(Vt.data)),{...we,fetchers:rt}},Bn=xh(ss);if(Bn)return M=Yn(M),de(Tn,Bn.result,!1,{preventScrollReset:Xe});if(Bn=xh(Ss),Bn)return ae.add(Bn.key),M=Yn(M),de(Tn,Bn.result,!1,{preventScrollReset:Xe});let mr=new Map(M.fetchers);_t&&mr.set(V,xi(Vt.data));let{loaderData:pe,errors:Ae}=SR(M,fn,ss,void 0,jn,Ss,mr);et(hn,mr),M.navigation.state==="loading"&&hn>ee?(Ut(z,"Expected pending action"),X&&X.abort(),be(M.navigation.location,{matches:fn,loaderData:pe,errors:Ae,fetchers:mr})):(Re({errors:Ae,loaderData:wR(M.loaderData,pe,fn,Ae),fetchers:mr}),Q=!1)}async function ot(V,W,re,ve,Se,qe,Ke,Xe,Qe){let ct=M.fetchers.get(V);De(V,wu(Qe,ct?ct.data:void 0),{flushSync:Ke});let nt=new AbortController,Rt=Kl(e.history,re,nt.signal);if(qe){let Vt=await _e(ve,new URL(Rt.url).pathname,Rt.signal,V);if(Vt.type==="aborted")return;if(Vt.type==="error"){xt(V,W,Vt.error,{flushSync:Ke});return}else if(Vt.matches)ve=Vt.matches;else{xt(V,W,Ds(404,{pathname:re}),{flushSync:Ke});return}}let ft=Uh(ve,re);q.set(V,nt);let Yt=Y,Bt=nc(l,u,Rt,re,ve,ft,i,Se),On=await Ee(Rt,re,Bt,Se,V),$t=On[ft.route.id];if(!$t){for(let Vt of ve)if(On[Vt.route.id]){$t=On[Vt.route.id];break}}if(q.get(V)===nt&&q.delete(V),!Rt.signal.aborted){if(Z.has(V)){De(V,xi(void 0));return}if(Lo($t))if(ee>Yt){De(V,xi(void 0));return}else{ae.add(V),await de(Rt,$t,!1,{preventScrollReset:Xe});return}if(ms($t)){xt(V,W,$t.error);return}De(V,xi($t.data))}}async function de(V,W,re,{submission:ve,fetcherSubmission:Se,preventScrollReset:qe,replace:Ke}={}){re||(L?.resolve(),L=null),W.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let Xe=W.response.headers.get("Location");Ut(Xe,"Expected a Location header on the redirect Response");let Qe=Xe,ct=new URL(V.url);Xe=bR(Xe,ct,f,e.history),tc(Qe,Xe,ct,"allow-explicit");let nt=Yu(M.location,Xe,{_isRedirect:!0});if(s){let $t=!1;if(W.response.headers.has("X-Remix-Reload-Document"))$t=!0;else if(kb(Xe)){const Vt=pO(t,Xe,!0);$t=Vt.origin!==t.location.origin||ts(Vt.pathname,f)==null}if($t){Ke?t.location.replace(Xe):t.location.assign(Xe);return}}X=null;let Rt=Ke===!0||W.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ft,formAction:Yt,formEncType:Bt}=M.navigation;!ve&&!Se&&ft&&Yt&&Bt&&(ve=CR(M.navigation));let On=ve||Se;if(s6.has(W.response.status)&&On&&Dr(On.formMethod))await ze(Rt,nt,{submission:{...On,formAction:Xe},preventScrollReset:qe||K,enableViewTransition:re?B:void 0});else{let $t=Cy(nt,[],Rt,ve);await ze(Rt,nt,{overrideNavigation:$t,fetcherSubmission:Se,preventScrollReset:qe||K,enableViewTransition:re?B:void 0})}}async function Ee(V,W,re,ve,Se){let qe,Ke={};try{qe=await g6(g,V,W,re,Se,ve,!1)}catch(Xe){return re.filter(Qe=>Qe.shouldLoad).forEach(Qe=>{Ke[Qe.route.id]={type:"error",error:Xe}}),Ke}if(V.signal.aborted)return Ke;if(!Dr(V.method))for(let Xe of re){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(T6(Qe)){let ct=Qe.result;Ke[Xe]={type:"redirect",response:b6(ct,V,Xe,re,f)}}else Ke[Xe]=await v6(Qe);return Ke}async function $e(V,W,re,ve,Se){let qe=Ee(re,ve,V,Se,null),Ke=Promise.all(W.map(async ct=>{if(ct.matches&&ct.match&&ct.request&&ct.controller){let Rt=(await Ee(ct.request,ct.path,ct.matches,Se,ct.key))[ct.match.route.id];return{[ct.key]:Rt}}else return Promise.resolve({[ct.key]:{type:"error",error:Ds(404,{pathname:ct.path})}})})),Xe=await qe,Qe=(await Ke).reduce((ct,nt)=>Object.assign(ct,nt),{});return{loaderResults:Xe,fetcherResults:Qe}}function Me(){Q=!0,I.forEach((V,W)=>{q.has(W)&&G.add(W),tn(W)})}function De(V,W,re={}){let ve=new Map(M.fetchers);ve.set(V,W),Re({fetchers:ve},{flushSync:(re&&re.flushSync)===!0})}function xt(V,W,re,ve={}){let Se=za(M.matches,W),qe=new Map(M.fetchers);Dt(qe,V),Re({errors:{[Se.route.id]:re},fetchers:qe},{flushSync:(ve&&ve.flushSync)===!0})}function dt(V){return F.set(V,(F.get(V)||0)+1),Z.has(V)&&Z.delete(V),M.fetchers.get(V)||i6}function gt(V,W){tn(V,W?.reason),De(V,xi(null))}function Dt(V,W){let re=M.fetchers.get(W);q.has(W)&&!(re&&re.state==="loading"&&$.has(W))&&tn(W),I.delete(W),$.delete(W),ae.delete(W),Z.delete(W),G.delete(W),V.delete(W)}function It(V){let W=(F.get(V)||0)-1;W<=0?(F.delete(V),Z.add(V)):F.set(V,W),Re({fetchers:new Map(M.fetchers)})}function tn(V,W){let re=q.get(V);re&&(re.abort(W),q.delete(V))}function an(V,W){for(let re of V){let ve=W.get(re);Ut(ve,`Expected fetcher: ${re}`);let Se=xi(ve.data);W.set(re,Se)}}function nn(V){let W=[],re=!1;for(let ve of ae){let Se=V.get(ve);Ut(Se,`Expected fetcher: ${ve}`),Se.state==="loading"&&(ae.delete(ve),W.push(ve),re=!0)}return an(W,V),re}function et(V,W){let re=[];for(let[ve,Se]of $)if(Se<V){let qe=W.get(ve);Ut(qe,`Expected fetcher: ${ve}`),qe.state==="loading"&&(tn(ve),$.delete(ve),re.push(ve))}return an(re,W),re.length>0}function Et(V,W){let re=M.blockers.get(V)||Fl;return ne.get(V)!==W&&ne.set(V,W),re}function Zt(V){M.blockers.delete(V),ne.delete(V)}function pt(V,W){let re=M.blockers.get(V)||Fl;Ut(re.state==="unblocked"&&W.state==="blocked"||re.state==="blocked"&&W.state==="blocked"||re.state==="blocked"&&W.state==="proceeding"||re.state==="blocked"&&W.state==="unblocked"||re.state==="proceeding"&&W.state==="unblocked",`Invalid blocker state transition: ${re.state} -> ${W.state}`);let ve=new Map(M.blockers);ve.set(V,W),Re({blockers:ve})}function St({currentLocation:V,nextLocation:W,historyAction:re}){if(ne.size===0)return;ne.size>1&&Fn(!1,"A router only supports one blocker at a time");let ve=Array.from(ne.entries()),[Se,qe]=ve[ve.length-1],Ke=M.blockers.get(Se);if(!(Ke&&Ke.state==="proceeding")&&qe({currentLocation:V,nextLocation:W,historyAction:re}))return Se}function yt(V){let W=Ds(404,{pathname:V}),re=d.activeRoutes,{matches:ve,route:Se}=bh(re);return{notFoundMatches:ve,route:Se,error:W}}function Ht(V,W,re){if(w=V,E=W,C=re||null,!R&&M.navigation===Ry){R=!0;let ve=at(M.location,M.matches);ve!=null&&Re({restoreScrollPosition:ve})}return()=>{w=null,E=null,C=null}}function dn(V,W){return C&&C(V,W.map(ve=>N_(ve,M.loaderData)))||V.key}function je(V,W){if(w&&E){let re=dn(V,W);w[re]=E()}}function at(V,W){if(w){let re=dn(V,W),ve=w[re];if(typeof ve=="number")return ve}return null}function Ie(V,W,re){if(e.patchRoutesOnNavigation){let ve=d.branches;if(V){if(Object.keys(V[0].params).length>0)return{active:!0,matches:Gs(W,re,f,!0,ve)}}else return{active:!0,matches:Gs(W,re,f,!0,ve)||[]}}return{active:!1,matches:null}}async function _e(V,W,re,ve){if(!e.patchRoutesOnNavigation)return{type:"success",matches:V};let Se=V;for(;;){let qe=u;try{await e.patchRoutesOnNavigation({signal:re,path:W,matches:Se,fetcherKey:ve,patch:(ct,nt)=>{re.aborted||gR(ct,nt,d,qe,l,!1)}})}catch(ct){return{type:"error",error:ct,partialMatches:Se}}if(re.aborted)return{type:"aborted"};let Ke=d.branches,Xe=Gs(d.activeRoutes,W,f,!1,Ke),Qe=null;if(Xe){if(Object.keys(Xe[0].params).length===0)return{type:"success",matches:Xe};if(Qe=Gs(d.activeRoutes,W,f,!0,Ke),!(Qe&&Se.length<Qe.length&&Ge(Se,Qe.slice(0,Se.length))))return{type:"success",matches:Xe}}if(Qe||(Qe=Gs(d.activeRoutes,W,f,!0,Ke)),!Qe||Ge(Se,Qe))return{type:"success",matches:null};Se=Qe}}function Ge(V,W){return V.length===W.length&&V.every((re,ve)=>re.route.id===W[ve].route.id)}function tt(V){u={},d.setHmrRoutes($u(V,l,void 0,u))}function kt(V,W,re=!1){gR(V,W,d,u,l,re),d.hasHMRRoutes||Re({})}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:ge,subscribe:ce,enableScrollRestoration:Ht,navigate:Le,fetch:Fe,revalidate:Oe,createHref:V=>e.history.createHref(V),createURL:V=>e.history.createURL(V),encodeLocation:V=>e.history.encodeLocation(V),getFetcher:dt,resetFetcher:gt,deleteFetcher:It,dispose:fe,getBlocker:Et,deleteBlocker:Zt,patchRoutes:kt,_internalFetchControllers:q,_internalSetRoutes:tt,_internalSetStateDoNotUseOrYouWillBreakYourApp(V){Re(V)}},e.instrumentations&&(D=Q_(D,e.instrumentations.map(V=>V.router).filter(Boolean))),D}function c6(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function uv(e,t,s,i,o,l){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=bd(i||".",mg(u),ts(e.pathname,s)||e.pathname,l==="path");if(i==null&&(f.search=e.search,f.hash=e.hash),(i==null||i===""||i===".")&&d){let g=Db(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 s!=="/"&&(f.pathname=B_({basename:s,pathname:f.pathname})),Cr(f)}function hR(e,t,s){if(!s||!c6(s))return{path:t};if(s.formMethod&&!A6(s.formMethod))return{path:t,error:Ds(405,{method:s.formMethod})};let i=()=>({path:t,error:Ds(400,{type:"invalid-body"})}),l=(s.formMethod||"get").toUpperCase(),u=LO(t);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!Dr(l))return i();let h=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((x,[S,w])=>`${x}${S}=${w}
|
|
13
|
-
`,""):String(s.body);return{path:t,submission:{formMethod:l,formAction:u,formEncType:s.formEncType,formData:void 0,json:void 0,text:h}}}else if(s.formEncType==="application/json"){if(!Dr(l))return i();try{let h=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:t,submission:{formMethod:l,formAction:u,formEncType:s.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}Ut(typeof FormData=="function","FormData is not available in this environment");let d,f;if(s.formData)d=hv(s.formData),f=s.formData;else if(s.body instanceof FormData)d=hv(s.body),f=s.body;else if(s.body instanceof URLSearchParams)d=s.body,f=xR(d);else if(s.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(s.body),f=xR(d)}catch{return i()}let g={formMethod:l,formAction:u,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Dr(g.formMethod))return{path:t,submission:g};let m=si(t);return e&&m.search&&Db(m.search)&&d.append("index",""),m.search=`?${d}`,{path:Cr(m),submission:g}}function pR(e,t,s,i,o,l,u,d,f,g,m,h,x,S,w,C,E,R,O,T,A,N){let j=A?ms(A[1])?A[1].error:A[1].data:void 0,D=o.createURL(l.location),M=o.createURL(f),z;if(m&&l.errors){let _=Object.keys(l.errors)[0];z=u.findIndex(Q=>Q.route.id===_)}else if(A&&ms(A[1])){let _=A[0];z=u.findIndex(Q=>Q.route.id===_)-1}let L=A?A[1].statusCode:void 0,K=L&&L>=400,X={currentUrl:D,currentParams:l.matches[0]?.params||{},nextUrl:M,nextParams:u[0].params,...d,actionResult:j,actionStatus:L},B=Sd(u),H=u.map((_,Q)=>{let{route:G}=_,q=null;if(z!=null&&Q>z)q=!1;else if(G.lazy)q=!0;else if(!Mb(G))q=!1;else if(m){let{shouldLoad:ae}=AO(G,l.loaderData,l.errors);q=ae}else u6(l.loaderData,l.matches[Q],_)&&(q=!0);if(q!==null)return dv(s,i,e,f,B,_,g,t,q);let Y=!1;typeof N=="boolean"?Y=N:K?Y=!1:(h||D.pathname+D.search===M.pathname+M.search||D.search!==M.search||d6(l.matches[Q],_))&&(Y=!0);let ee={...X,defaultShouldRevalidate:Y},$=Pu(_,ee);return dv(s,i,e,f,B,_,g,t,$,ee,N)}),U=[];return w.forEach((_,Q)=>{if(m||!u.some(F=>F.route.id===_.routeId)||S.has(Q))return;let G=l.fetchers.get(Q),q=G&&G.state!=="idle"&&G.data===void 0,Y=Gs(E,_.path,R??"/",!1,T);if(!Y){if(O&&q)return;U.push({key:Q,routeId:_.routeId,path:_.path,matches:null,match:null,request:null,controller:null});return}if(C.has(Q))return;let ee=Uh(Y,_.path),$=new AbortController,ae=Kl(o,_.path,$.signal),I=null;if(x.has(Q))x.delete(Q),I=nc(s,i,ae,_.path,Y,ee,g,t);else if(q)h&&(I=nc(s,i,ae,_.path,Y,ee,g,t));else{let F;typeof N=="boolean"?F=N:K?F=!1:F=h;let Z={...X,defaultShouldRevalidate:F};Pu(ee,Z)&&(I=nc(s,i,ae,_.path,Y,ee,g,t,Z))}I&&U.push({key:Q,routeId:_.routeId,path:_.path,matches:I,match:ee,request:ae,controller:$})}),{dsMatches:H,revalidatingFetchers:U}}function Mb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function AO(e,t,s){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Mb(e))return{shouldLoad:!1,renderFallback:!1};let i=t!=null&&e.id in t,o=s!=null&&s[e.id]!==void 0;if(!i&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let l=!i&&!o;return{shouldLoad:l,renderFallback:l}}function u6(e,t,s){let i=!t||s.route.id!==t.route.id,o=!e.hasOwnProperty(s.route.id);return i||o}function d6(e,t){let s=e.route.path;return e.pathname!==t.pathname||s!=null&&s.endsWith("*")&&e.params["*"]!==t.params["*"]}function Pu(e,t){if(e.route.shouldRevalidate){let s=e.route.shouldRevalidate(t);if(typeof s=="boolean")return s}return t.defaultShouldRevalidate}function gR(e,t,s,i,o,l){let u;if(e){let g=i[e];Ut(g,`No route found to patch children into: routeId = ${e}`),g.children||(g.children=[]),u=g.children}else u=s.activeRoutes;let d=[],f=[];if(t.forEach(g=>{let m=u.find(h=>MO(g,h));m?f.push({existingRoute:m,newRoute:g}):d.push(g)}),d.length>0){let g=$u(d,o,[e||"_","patch",String(u?.length||"0")],i);u.push(...g)}if(l&&f.length>0)for(let g=0;g<f.length;g++){let{existingRoute:m,newRoute:h}=f[g],x=m,[S]=$u([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})}s.hasHMRRoutes||s.setRoutes([...s.activeRoutes])}function MO(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((s,i)=>t.children?.some(o=>MO(s,o)))??!1:!1}var mR=new WeakMap,NO=({key:e,route:t,manifest:s,mapRouteProperties:i})=>{let o=s[t.id];if(Ut(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let l=o.lazy[e];if(!l)return;let u=mR.get(o);u||(u={},mR.set(o,u));let d=u[e];if(d)return d;let f=(async()=>{let g=k_(e),h=o[e]!==void 0&&e!=="hasErrorBoundary";if(g)Fn(!g,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(h)Fn(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await l();x!=null&&(Object.assign(o,{[e]:x}),Object.assign(o,i(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},yR=new WeakMap;function f6(e,t,s,i,o){let l=s[e.id];if(Ut(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=yR.get(l);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let h=(async()=>{Ut(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=A_(w),O=l[w]!==void 0&&w!=="hasErrorBoundary";E?Fn(!E,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):O?Fn(!O,`Route "${l.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(l,S),Object.assign(l,{...i(l),lazy:void 0})})();return yR.set(l,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=NO({key:m,route:e,manifest:s,mapRouteProperties:i});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 vR(e){let t=e.matches.filter(o=>o.shouldLoad),s={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,l)=>{s[t[l].route.id]=o}),s}async function h6(e){return e.matches.some(t=>t.route.middleware)?DO(e,()=>vR(e)):vR(e)}function DO(e,t){return p6(e,t,i=>{if(O6(i))throw i;return i},R6,s);function s(i,o,l){if(l)return Promise.resolve(Object.assign(l.value,{[o]:{type:"error",result:i}}));{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=za(u,u[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:i}})}}}async function p6(e,t,s,i,o){let{matches:l,...u}=e,d=l.flatMap(g=>g.route.middleware?g.route.middleware.map(m=>[g.route.id,m]):[]);return await jO(u,d,t,s,i,o)}async function jO(e,t,s,i,o,l,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 s();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 jO(e,t,s,i,o,l,u+1)},h.value}catch(S){return h={value:await l(S,g,h)},h.value}};try{let S=await m(e,x),w=S!=null?i(S):void 0;return o(w)?w:h?w??h.value:(h={value:await x()},h.value)}catch(S){return await l(S,g,h)}}function IO(e,t,s,i,o){let l=NO({key:"middleware",route:i.route,manifest:t,mapRouteProperties:e}),u=f6(i.route,Dr(s.method)?"action":"loader",t,e,o);return{middleware:l,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function dv(e,t,s,i,o,l,u,d,f,g=null,m){let h=!1,x=IO(e,t,s,l,u);return{...l,_lazyPromises:x,shouldLoad:f,shouldRevalidateArgs:g,shouldCallHandler(S){return h=!0,g?typeof m=="boolean"?Pu(l,{...g,defaultShouldRevalidate:m}):typeof S=="boolean"?Pu(l,{...g,defaultShouldRevalidate:S}):Pu(l,g):f},resolve(S){let{lazy:w,loader:C,middleware:E}=l.route,R=h||f||S&&!Dr(s.method)&&(w||C),O=E&&E.length>0&&!C&&!w;return R&&(Dr(s.method)||!O)?m6({request:s,path:i,pattern:o,match:l,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:S,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function nc(e,t,s,i,o,l,u,d,f=null){return o.map(g=>g.route.id!==l.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:IO(e,t,s,g,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:dv(e,t,s,i,Sd(o),g,u,d,!0,f))}async function g6(e,t,s,i,o,l,u){i.some(m=>m._lazyPromises?.middleware)&&await Promise.all(i.map(m=>m._lazyPromises?.middleware));let d={request:t,url:PO(t,s),pattern:Sd(i),params:i[0].params,context:l,matches:i},g=await e({...d,fetcherKey:o,runClientMiddleware:m=>{let h=d;return DO(h,()=>m({...h,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(m=>[m._lazyPromises?.handler,m._lazyPromises?.route]))}catch{}return g}async function m6({request:e,path:t,pattern:s,match:i,lazyHandlerPromise:o,lazyRoutePromise:l,handlerOverride:u,scopedContext:d}){let f,g,m=Dr(e.method),h=m?"action":"loader",x=S=>{let w,C=new Promise((O,T)=>w=T);g=()=>w(),e.signal.addEventListener("abort",g);let E=O=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${i.route.id}]`)):S({request:e,url:PO(e,t),pattern:s,params:i.params,context:d},...O!==void 0?[O]:[]),R=(async()=>{try{return{type:"data",result:await(u?u(T=>E(T)):E())}}catch(O){return{type:"error",result:O}}})();return Promise.race([R,C])};try{let S=m?i.route.action:i.route.loader;if(o||l)if(S){let w,[C]=await Promise.all([x(S).catch(E=>{w=E}),o,l]);if(w!==void 0)throw w;f=C}else{await o;let w=m?i.route.action:i.route.loader;if(w)[f]=await Promise.all([x(w),l]);else if(h==="action"){let C=new URL(e.url),E=C.pathname+C.search;throw Ds(405,{method:e.method,pathname:E,routeId:i.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 Ds(404,{pathname:C})}}catch(S){return{type:"error",result:S}}finally{g&&e.signal.removeEventListener("abort",g)}return f}async function y6(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 v6(e){let{result:t,type:s}=e;if(Nb(t)){let i;try{i=await y6(t)}catch(o){return{type:"error",error:o}}return s==="error"?{type:"error",error:new xd(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:"data",data:i,statusCode:t.status,headers:t.headers}}return s==="error"?RR(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:E6(t),statusCode:Qu(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Qu(t)?t.status:void 0}:RR(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 b6(e,t,s,i,o){let l=e.headers.get("Location");if(Ut(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!kb(l)){let u=i.slice(0,i.findIndex(d=>d.route.id===s)+1);l=uv(new URL(t.url),u,o,l),e.headers.set("Location",l)}return e}var x6=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function fv(e){try{return x6.includes(new URL(e).protocol)}catch{return!1}}function bR(e,t,s,i){if(kb(e)){let o=e,l=gg.test(o)?new URL(hO(o,t.protocol)):new URL(o);if(fv(l.toString()))throw new Error("Invalid redirect location");let u=ts(l.pathname,s)!=null;if(l.origin===t.origin&&u)return Ob(l.pathname)+l.search+l.hash}try{let o=i.createURL(e);if(fv(o.toString()))throw new Error("Invalid redirect location")}catch{}return e}function Kl(e,t,s,i){let o=e.createURL(LO(t)).toString(),l={signal:s};if(i&&Dr(i.formMethod)){let{formMethod:u,formEncType:d}=i;l.method=u.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(i.json)):d==="text/plain"?l.body=i.text:d==="application/x-www-form-urlencoded"&&i.formData?l.body=hv(i.formData):l.body=i.formData}return new Request(o,l)}function PO(e,t){let s=new URL(e.url),i=typeof t=="string"?si(t):t;if(s.pathname=i.pathname||"/",i.search){let o=new URLSearchParams(i.search),l=o.getAll("index");o.delete("index");for(let u of l.filter(Boolean))o.append("index",u);s.search=o.size?`?${o.toString()}`:""}else s.search="";return s.hash=i.hash||"",s}function hv(e){let t=new URLSearchParams;for(let[s,i]of e.entries())t.append(s,typeof i=="string"?i:i.name);return t}function xR(e){let t=new FormData;for(let[s,i]of e.entries())t.append(s,i);return t}function S6(e,t,s,i=!1,o=!1){let l={},u=null,d,f=!1,g={},m=s&&ms(s[1])?s[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let x=h.route.id,S=t[x];if(Ut(!Lo(S),"Cannot handle redirect results in processLoaderData"),ms(S)){let w=S.error;if(m!==void 0&&(w=m,m=void 0),u=u||{},o)u[x]=w;else{let C=za(e,x);u[C.route.id]==null&&(u[C.route.id]=w)}i||(l[x]=OO),f||(f=!0,d=Qu(S.error)?S.error.status:500),S.headers&&(g[x]=S.headers)}else l[x]=S.data,S.statusCode&&S.statusCode!==200&&!f&&(d=S.statusCode),S.headers&&(g[x]=S.headers)}),m!==void 0&&s&&(u={[s[0]]:m},s[2]&&(l[s[2]]=void 0)),{loaderData:l,errors:u,statusCode:d||200,loaderHeaders:g}}function SR(e,t,s,i,o,l,u){let{loaderData:d,errors:f}=S6(t,s,i);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=l[m];if(Ut(S,"Did not find corresponding fetcher result"),ms(S)){let w=za(e.matches,h?.route.id);f&&f[w.route.id]||(f={...f,[w.route.id]:S.error}),u.delete(m)}else if(Lo(S))Ut(!1,"Unhandled fetcher revalidation redirect");else{let w=xi(S.data);u.set(m,w)}}),{loaderData:d,errors:f}}function wR(e,t,s,i){let o=Object.entries(t).filter(([,l])=>l!==OO).reduce((l,[u,d])=>(l[u]=d,l),{});for(let l of s){let u=l.route.id;if(!t.hasOwnProperty(u)&&e.hasOwnProperty(u)&&l.route.loader&&(o[u]=e[u]),i&&i.hasOwnProperty(u))break}return o}function ER(e){return e?ms(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function za(e,t){return(t?e.slice(0,e.findIndex(i=>i.route.id===t)+1):[...e]).reverse().find(i=>i.route.hasErrorBoundary===!0)||e[0]}function bh(e){let t=e.length===1?e[0]:e.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ds(e,{pathname:t,routeId:s,method:i,type:o,message:l}={}){let u="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(u="Bad Request",i&&t&&s?d=`You made a ${i} request to "${t}" but did not provide a \`loader\` for route "${s}", so there is no way to handle the request.`:o==="invalid-body"&&(d="Unable to encode submission body")):e===403?(u="Forbidden",d=`Route "${s}" does not match URL "${t}"`):e===404?(u="Not Found",d=`No route matches URL "${t}"`):e===405&&(u="Method Not Allowed",i&&t&&s?d=`You made a ${i.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${s}", so there is no way to handle the request.`:i&&(d=`Invalid request method "${i.toUpperCase()}"`)),new xd(e||500,u,new Error(d),!0)}function xh(e){let t=Object.entries(e);for(let s=t.length-1;s>=0;s--){let[i,o]=t[s];if(Lo(o))return{key:i,result:o}}}function LO(e){let t=typeof e=="string"?si(e):e;return Cr({...t,hash:""})}function w6(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function E6(e){return new xd(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function R6(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,s])=>typeof t=="string"&&C6(s))}function C6(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function T6(e){return Nb(e.result)&&TO.has(e.result.status)}function ms(e){return e.type==="error"}function Lo(e){return(e&&e.type)==="redirect"}function RR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Nb(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function k6(e){return TO.has(e)}function O6(e){return Nb(e)&&k6(e.status)&&e.headers.has("Location")}function A6(e){return r6.has(e.toUpperCase())}function Dr(e){return t6.has(e.toUpperCase())}function Db(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Uh(e,t){let s=typeof t=="string"?si(t).search:t.search;if(e[e.length-1].route.index&&Db(s||""))return e[e.length-1];let i=SO(e);return i[i.length-1]}function CR(e){let{formMethod:t,formAction:s,formEncType:i,text:o,formData:l,json:u}=e;if(!(!t||!s||!i)){if(o!=null)return{formMethod:t,formAction:s,formEncType:i,formData:void 0,json:void 0,text:o};if(l!=null)return{formMethod:t,formAction:s,formEncType:i,formData:l,json:void 0,text:void 0};if(u!==void 0)return{formMethod:t,formAction:s,formEncType:i,formData:void 0,json:u,text:void 0}}}function Cy(e,t,s,i){return i?{state:"loading",location:e,matches:t,historyAction:s,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}:{state:"loading",location:e,matches:t,historyAction:s,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function M6(e,t,s,i){return{state:"submitting",location:e,matches:t,historyAction:s,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}}function wu(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 N6(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 xi(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 D6(e,t){try{let s=e.sessionStorage.getItem(kO);if(s){let i=JSON.parse(s);for(let[o,l]of Object.entries(i||{}))l&&Array.isArray(l)&&t.set(o,new Set(l||[]))}}catch{}}function j6(e,t){if(t.size>0){let s={};for(let[i,o]of t)s[i]=[...o];try{e.sessionStorage.setItem(kO,JSON.stringify(s))}catch(i){Fn(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function TR(){let e,t,s=new Promise((i,o)=>{e=async l=>{i(l);try{await s}catch{}},t=async l=>{o(l);try{await s}catch{}}});return{promise:s,resolve:e,reject:t}}var Go=b.createContext(null);Go.displayName="DataRouter";var wd=b.createContext(null);wd.displayName="DataRouterState";var zO=b.createContext(!1);function _O(){return b.useContext(zO)}var jb=b.createContext({isTransitioning:!1});jb.displayName="ViewTransition";var UO=b.createContext(new Map);UO.displayName="Fetchers";var I6=b.createContext(null);I6.displayName="Await";var xs=b.createContext(null);xs.displayName="Navigation";var yg=b.createContext(null);yg.displayName="Location";var Hs=b.createContext({outlet:null,matches:[],isDataRoute:!1});Hs.displayName="Route";var Ib=b.createContext(null);Ib.displayName="RouteError";var HO="REACT_ROUTER_ERROR",P6="REDIRECT",L6="ROUTE_ERROR_RESPONSE";function z6(e){if(e.startsWith(`${HO}:${P6}:{`))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 _6(e){if(e.startsWith(`${HO}:${L6}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new xd(t.status,t.statusText,t.data)}catch{}}function U6(e,{relative:t}={}){Ut(Qo(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:i}=b.useContext(xs),{hash:o,pathname:l,search:u}=Ed(e,{relative:t}),d=l;return s!=="/"&&(d=l==="/"?s:Ps([s,l])),i.createHref({pathname:d,search:u,hash:o})}function Qo(){return b.useContext(yg)!=null}function gr(){return Ut(Qo(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(yg).location}function H6(e){Ut(Qo(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=gr();return b.useMemo(()=>Gu(e,xO(t)),[t,e])}var FO="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function BO(e){b.useContext(xs).static||b.useLayoutEffect(e)}function Xo(){let{isDataRoute:e}=b.useContext(Hs);return e?n8():F6()}function F6(){Ut(Qo(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Go),{basename:t,navigator:s}=b.useContext(xs),{matches:i}=b.useContext(Hs),{pathname:o}=gr(),l=JSON.stringify(mg(i)),u=b.useRef(!1);return BO(()=>{u.current=!0}),b.useCallback((f,g={})=>{if(Fn(u.current,FO),!u.current)return;if(typeof f=="number"){s.go(f);return}let m=bd(f,JSON.parse(l),o,g.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Ps([t,m.pathname])),tc(typeof f=="string"?f:Cr(f),s.createHref(m),Ab(s),"reject"),(g.replace?s.replace:s.push)(m,g.state,g)},[t,s,l,o,e])}var B6=b.createContext(null);function V6(e){let t=b.useContext(Hs).outlet;return b.useMemo(()=>t&&b.createElement(B6.Provider,{value:e},t),[t,e])}function K6(){let{matches:e}=b.useContext(Hs);return e[e.length-1]?.params??{}}function Ed(e,{relative:t}={}){let{matches:s}=b.useContext(Hs),{pathname:i}=gr(),o=JSON.stringify(mg(s));return b.useMemo(()=>bd(e,JSON.parse(o),i,t==="path"),[e,o,i,t])}function q6(e,t,s){Ut(Qo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=b.useContext(xs),{matches:o}=b.useContext(Hs),l=o[o.length-1],u=l?l.params:{},d=l?l.pathname:"/",f=l?l.pathnameBase:"/",g=l&&l.route;{let E=g&&g.path||"";YO(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.
|
|
14
|
-
|
|
15
|
-
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let m=gr(),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=s&&s.state.matches.length?s.state.matches.map(E=>Object.assign(E,{route:s.manifest[E.route.id]||E.route})):gO(e,{pathname:S});return Fn(g||w!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Fn(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.`),X6(w&&w.map(E=>Object.assign({},E,{params:Object.assign({},u,E.params),pathname:Ps([f,i.encodeLocation?i.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?f:Ps([f,i.encodeLocation?i.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),o,s)}function Y6(){let e=W6(),t=Qu(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),s=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},l={padding:"2px 4px",backgroundColor:i},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:l},"ErrorBoundary")," or"," ",b.createElement("code",{style:l},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),s?b.createElement("pre",{style:o},s):null,u)}var $6=b.createElement(Y6,null),VO=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 s=_6(e.digest);s&&(e=s)}let t=e!==void 0?b.createElement(Hs.Provider,{value:this.props.routeContext},b.createElement(Ib.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(G6,{error:e},t):t}};VO.contextType=zO;var Ty=new WeakMap;function G6({children:e,error:t}){let{basename:s,navigator:i}=b.useContext(xs);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=z6(t.digest);if(o){let l=Ty.get(t);if(l)throw l;let u=EO(o.location,s),d=u.absoluteURL||u.to;if(tc(o.location,d,Ab(i),"allow-explicit"),fv(d))throw new Error("Invalid redirect location");if(wO&&!Ty.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 Ty.set(t,f),f}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return e}function Q6({routeContext:e,match:t,children:s}){let i=b.useContext(Go);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(Hs.Provider,{value:e},s)}function X6(e,t=[],s){let i=s?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let o=e,l=i?.errors;if(l!=null){let m=o.findIndex(h=>h.route.id&&l?.[h.route.id]!==void 0);Ut(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let u=!1,d=-1;if(s&&i){u=i.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}=i,w=h.route.loader&&!x.hasOwnProperty(h.route.id)&&(!S||S[h.route.id]===void 0);if(h.route.lazy||w){s.isStatic&&(u=!0),d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}}let f=s?.onError,g=i&&f?(m,h)=>{f(m,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Sd(i.matches),errorInfo:h})}:void 0;return o.reduceRight((m,h,x)=>{let S,w=!1,C=null,E=null;i&&(S=l&&h.route.id?l[h.route.id]:void 0,C=h.route.errorElement||$6,u&&(d<0&&x===0?(YO("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)),O=()=>{let T;return S?T=C:w?T=E:h.route.Component?T=b.createElement(h.route.Component,null):h.route.element?T=h.route.element:T=m,b.createElement(Q6,{match:h,routeContext:{outlet:m,matches:R,isDataRoute:i!=null},children:T})};return i&&(h.route.ErrorBoundary||h.route.errorElement||x===0)?b.createElement(VO,{location:i.location,revalidation:i.revalidation,component:C,error:S,children:O(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:g}):O()},null)}function Pb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function KO(e){let t=b.useContext(Go);return Ut(t,Pb(e)),t}function qO(e){let t=b.useContext(wd);return Ut(t,Pb(e)),t}function Z6(e){let t=b.useContext(Hs);return Ut(t,Pb(e)),t}function Lb(e){let t=Z6(e),s=t.matches[t.matches.length-1];return Ut(s.route.id,`${e} can only be used on routes that contain a unique "id"`),s.route.id}function J6(){return Lb("useRouteId")}function W6(){let e=b.useContext(Ib),t=qO("useRouteError"),s=Lb("useRouteError");return e!==void 0?e:t.errors?.[s]}var e8=0;function t8(e){let{router:t,basename:s}=KO("useBlocker"),i=qO("useBlocker"),[o,l]=b.useState(""),u=b.useCallback(d=>{if(typeof e!="function")return!!e;if(s==="/")return e(d);let{currentLocation:f,nextLocation:g,historyAction:m}=d;return e({currentLocation:{...f,pathname:ts(f.pathname,s)||f.pathname},nextLocation:{...g,pathname:ts(g.pathname,s)||g.pathname},historyAction:m})},[s,e]);return b.useEffect(()=>{let d=String(++e8);return l(d),()=>t.deleteBlocker(d)},[t]),b.useEffect(()=>{o!==""&&t.getBlocker(o,u)},[t,o,u]),o&&i.blockers.has(o)?i.blockers.get(o):Fl}function n8(){let{router:e}=KO("useNavigate"),t=Lb("useNavigate"),s=b.useRef(!1);return BO(()=>{s.current=!0}),b.useCallback(async(o,l={})=>{Fn(s.current,FO),s.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...l}))},[e,t])}var kR={};function YO(e,t,s){!t&&!kR[e]&&(kR[e]=!0,Fn(!1,s))}var OR={};function AR(e,t){!e&&!OR[t]&&(OR[t]=!0,console.warn(t))}var r8="useOptimistic",MR=lC[r8],s8=()=>{};function i8(e){return MR?MR(e):[e,s8]}function a8(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Fn(!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&&Fn(!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&&Fn(!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 o8=["HydrateFallback","hydrateFallbackElement"],l8=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",e(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",t(s))}})}};function c8({router:e,flushSync:t,onError:s,useTransitions:i}){i=_O()||i;let[l,u]=b.useState(e.state),[d,f]=i8(l),[g,m]=b.useState(),[h,x]=b.useState({isTransitioning:!1}),[S,w]=b.useState(),[C,E]=b.useState(),[R,O]=b.useState(),T=b.useRef(new Map),A=b.useCallback((M,{deletedFetchers:z,newErrors:L,flushSync:K,viewTransitionOpts:X})=>{L&&s&&Object.values(L).forEach(H=>s(H,{location:M.location,params:M.matches[0]?.params??{},pattern:Sd(M.matches)})),M.fetchers.forEach((H,U)=>{H.data!==void 0&&T.current.set(U,H.data)}),z.forEach(H=>T.current.delete(H)),AR(K===!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(AR(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&&K?t(()=>u(M)):i===!1?u(M):b.startTransition(()=>{i===!0&&f(H=>NR(H,M)),u(M)});return}if(t&&K){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(),O({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,i,f,s]);b.useLayoutEffect(()=>e.subscribe(A),[e,A]),b.useEffect(()=>{h.isTransitioning&&!h.flushSync&&w(new l8)},[h]),b.useEffect(()=>{if(S&&g&&e.window){let M=g,z=S.promise,L=e.window.document.startViewTransition(async()=>{i===!1?u(M):b.startTransition(()=>{i===!0&&f(K=>NR(K,M)),u(M)}),await z});L.finished.finally(()=>{w(void 0),E(void 0),m(void 0),x({isTransitioning:!1})}),E(L)}},[g,S,e.window,i,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}),O(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,z,L)=>e.navigate(M,{state:z,preventScrollReset:L?.preventScrollReset}),replace:(M,z,L)=>e.navigate(M,{replace:!0,state:z,preventScrollReset:L?.preventScrollReset})}),[e]),j=e.basename||"/",D=b.useMemo(()=>({router:e,navigator:N,static:!1,basename:j,onError:s}),[e,N,j,s]);return b.createElement(b.Fragment,null,b.createElement(Go.Provider,{value:D},b.createElement(wd.Provider,{value:d},b.createElement(UO.Provider,{value:T.current},b.createElement(jb.Provider,{value:h},b.createElement(h8,{basename:j,location:d.location,navigationType:d.historyAction,navigator:N,useTransitions:i},b.createElement(u8,{routes:e.routes,manifest:e.manifest,future:e.future,state:d,isStatic:!1,onError:s})))))),null)}function NR(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 u8=b.memo(d8);function d8({routes:e,manifest:t,future:s,state:i,isStatic:o,onError:l}){return q6(e,void 0,{manifest:t,state:i,isStatic:o,onError:l})}function f8({to:e,replace:t,state:s,relative:i}){Ut(Qo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:l}=b.useContext(xs);Fn(!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(Hs),{pathname:d}=gr(),f=Xo(),g=bd(e,mg(u),d,i==="path");tc(typeof e=="string"?e:Cr(e),l.createHref(g),Ab(l),"reject");let m=JSON.stringify(g);return b.useEffect(()=>{f(JSON.parse(m),{replace:t,state:s,relative:i})},[f,m,i,t,s]),null}function zb(e){return V6(e.context)}function h8({basename:e="/",children:t=null,location:s,navigationType:i="POP",navigator:o,static:l=!1,useTransitions:u}){Ut(!Qo(),"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:l,useTransitions:u,future:{}}),[d,o,l,u]);typeof s=="string"&&(s=si(s));let{pathname:g="/",search:m="",hash:h="",state:x=null,key:S="default",mask:w}=s,C=b.useMemo(()=>{let E=ts(g,d);return E==null?null:{location:{pathname:E,search:m,hash:h,state:x,key:S,mask:w},navigationType:i}},[d,g,m,h,x,S,i,w]);return Fn(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(xs.Provider,{value:f},b.createElement(yg.Provider,{children:t,value:C}))}var Hh="get",Fh="application/x-www-form-urlencoded";function vg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function p8(e){return vg(e)&&e.tagName.toLowerCase()==="button"}function g8(e){return vg(e)&&e.tagName.toLowerCase()==="form"}function m8(e){return vg(e)&&e.tagName.toLowerCase()==="input"}function y8(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function v8(e,t){return e.button===0&&(!t||t==="_self")&&!y8(e)}function pv(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,s)=>{let i=e[s];return t.concat(Array.isArray(i)?i.map(o=>[s,o]):[[s,i]])},[]))}function b8(e,t){let s=pv(e);return t&&t.forEach((i,o)=>{s.has(o)||t.getAll(o).forEach(l=>{s.append(o,l)})}),s}var Sh=null;function x8(){if(Sh===null)try{new FormData(document.createElement("form"),0),Sh=!1}catch{Sh=!0}return Sh}var S8=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ky(e){return e!=null&&!S8.has(e)?(Fn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Fh}"`),null):e}function w8(e,t){let s,i,o,l,u;if(g8(e)){let d=e.getAttribute("action");i=d?ts(d,t):null,s=e.getAttribute("method")||Hh,o=ky(e.getAttribute("enctype"))||Fh,l=new FormData(e)}else if(p8(e)||m8(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(i=f?ts(f,t):null,s=e.getAttribute("formmethod")||d.getAttribute("method")||Hh,o=ky(e.getAttribute("formenctype"))||ky(d.getAttribute("enctype"))||Fh,l=new FormData(d,e),!x8()){let{name:g,type:m,value:h}=e;if(m==="image"){let x=g?`${g}.`:"";l.append(`${x}x`,"0"),l.append(`${x}y`,"0")}else g&&l.append(g,h)}}else{if(vg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Hh,i=null,o=Fh,u=e}return l&&o==="text/plain"&&(u=l,l=void 0),{action:i,method:s.toLowerCase(),encType:o,formData:l,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _b(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $O(e,t,s,i){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return s?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${i}`:o.pathname=`${o.pathname}.${i}`:o.pathname==="/"?o.pathname=`_root.${i}`:t&&ts(o.pathname,t)==="/"?o.pathname=`${dc(t)}/_root.${i}`:o.pathname=`${dc(o.pathname)}.${i}`,o}async function E8(e,t){if(e.id in t)return t[e.id];try{let s=await import(e.module);return t[e.id]=s,s}catch(s){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function R8(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 C8(e,t,s){let i=await Promise.all(e.map(async o=>{let l=t.routes[o.route.id];if(l){let u=await E8(l,s);return u.links?u.links():[]}return[]}));return A8(i.flat(1).filter(R8).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function DR(e,t,s,i,o,l){let u=(f,g)=>s[g]?f.route.id!==s[g].route.id:!0,d=(f,g)=>s[g].pathname!==f.pathname||s[g].route.path?.endsWith("*")&&s[g].params["*"]!==f.params["*"];return l==="assets"?t.filter((f,g)=>u(f,g)||d(f,g)):l==="data"?t.filter((f,g)=>{let m=i.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:s[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function T8(e,t,{includeHydrateFallback:s}={}){return k8(e.map(i=>{let o=t.routes[i.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),s&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function k8(e){return[...new Set(e)]}function O8(e){let t={},s=Object.keys(e).sort();for(let i of s)t[i]=e[i];return t}function A8(e,t){let s=new Set;return new Set(t),e.reduce((i,o)=>{let l=JSON.stringify(O8(o));return s.has(l)||(s.add(l),i.push({key:l,link:o})),i},[])}function Ub(){let e=b.useContext(Go);return _b(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function M8(){let e=b.useContext(wd);return _b(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Hb=b.createContext(void 0);Hb.displayName="FrameworkContext";function bg(){let e=b.useContext(Hb);return _b(e,"You must render this element inside a <HydratedRouter> element"),e}function N8(e,t){let s=b.useContext(Hb),[i,o]=b.useState(!1),[l,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(O=>{u(O.isIntersecting)})},E=new IntersectionObserver(C,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[e]),b.useEffect(()=>{if(i){let C=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(C)}}},[i]);let S=()=>{o(!0)},w=()=>{o(!1),u(!1)};return s?e!=="intent"?[l,x,{}]:[l,x,{onFocus:Eu(d,S),onBlur:Eu(f,w),onMouseEnter:Eu(g,S),onMouseLeave:Eu(m,w),onTouchStart:Eu(h,S)}]:[!1,x,{}]}function Eu(e,t){return s=>{e&&e(s),s.defaultPrevented||t(s)}}function D8({page:e,...t}){let s=_O(),{nonce:i}=bg(),{router:o}=Ub(),l=b.useMemo(()=>gO(o.routes,e,o.basename),[o.routes,e,o.basename]);return l?(t.nonce==null&&i&&(t={...t,nonce:i}),s?b.createElement(I8,{page:e,matches:l,...t}):b.createElement(P8,{page:e,matches:l,...t})):null}function j8(e){let{manifest:t,routeModules:s}=bg(),[i,o]=b.useState([]);return b.useEffect(()=>{let l=!1;return C8(e,t,s).then(u=>{l||o(u)}),()=>{l=!0}},[e,t,s]),i}function I8({page:e,matches:t,...s}){let i=gr(),{future:o}=bg(),{basename:l}=Ub(),u=b.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let d=$O(e,l,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]},[l,o.v8_trailingSlashAwareDataRequests,e,i,t]);return b.createElement(b.Fragment,null,u.map(d=>b.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...s})))}function P8({page:e,matches:t,...s}){let i=gr(),{future:o,manifest:l,routeModules:u}=bg(),{basename:d}=Ub(),{loaderData:f,matches:g}=M8(),m=b.useMemo(()=>DR(e,t,g,l,i,"data"),[e,t,g,l,i]),h=b.useMemo(()=>DR(e,t,g,l,i,"assets"),[e,t,g,l,i]),x=b.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let C=new Set,E=!1;if(t.forEach(O=>{let T=l.routes[O.route.id];!T||!T.hasLoader||(!m.some(A=>A.route.id===O.route.id)&&O.route.id in f&&u[O.route.id]?.shouldRevalidate||T.hasClientLoader?E=!0:C.add(O.route.id))}),C.size===0)return[];let R=$O(e,d,o.v8_trailingSlashAwareDataRequests,"data");return E&&C.size>0&&R.searchParams.set("_routes",t.filter(O=>C.has(O.route.id)).map(O=>O.route.id).join(",")),[R.pathname+R.search]},[d,o.v8_trailingSlashAwareDataRequests,f,i,l,m,t,e,u]),S=b.useMemo(()=>T8(h,l),[h,l]),w=j8(h);return b.createElement(b.Fragment,null,x.map(C=>b.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...s})),S.map(C=>b.createElement("link",{key:C,rel:"modulepreload",href:C,...s})),w.map(({key:C,link:E})=>b.createElement("link",{key:C,nonce:s.nonce,...E,crossOrigin:E.crossOrigin??s.crossOrigin})))}function L8(...e){return t=>{e.forEach(s=>{typeof s=="function"?s(t):s!=null&&(s.current=t)})}}var z8=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{z8&&(window.__reactRouterVersion="7.18.5")}catch{}function _8(e,t){return l6({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:E_({window:t?.window}),hydrationData:U8(),routes:e,mapRouteProperties:a8,hydrationRouteProperties:o8,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function U8(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:H8(e.errors)}),e}function H8(e){if(!e)return null;let t=Object.entries(e),s={};for(let[i,o]of t)if(o&&o.__type==="RouteErrorResponse")s[i]=new xd(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&$_.includes(o.__subType)){let l=window[o.__subType];if(typeof l=="function")try{let u=new l(o.message);u.stack="",s[i]=u}catch{}}if(s[i]==null){let l=new Error(o.message);l.stack="",s[i]=l}}else s[i]=o;return s}var vc=b.forwardRef(function({onClick:t,discover:s="render",prefetch:i="none",relative:o,reloadDocument:l,replace:u,mask:d,state:f,target:g,to:m,preventScrollReset:h,viewTransition:x,defaultShouldRevalidate:S,...w},C){let{basename:E,navigator:R,useTransitions:O}=b.useContext(xs),T=typeof m=="string"&&pg.test(m),A=EO(m,E);m=A.to;let N=U6(m,{relative:o}),j=gr(),D=null;if(d){let U=bd(d,[],j.mask?j.mask.pathname:"/",!0);E!=="/"&&(U.pathname=U.pathname==="/"?E:Ps([E,U.pathname])),D=R.createHref(U)}let[M,z,L]=N8(i,w),K=V8(m,{replace:u,mask:d,state:f,target:g,preventScrollReset:h,relative:o,viewTransition:x,defaultShouldRevalidate:S,useTransitions:O});function X(U){t&&t(U),U.defaultPrevented||K(U)}let B=!(A.isExternal||l),H=b.createElement("a",{...w,...L,href:(B?D:void 0)||A.absoluteURL||N,onClick:B?X:t,ref:L8(C,z),target:g,"data-discover":!T&&s==="render"?"true":void 0});return M&&!T?b.createElement(b.Fragment,null,H,b.createElement(D8,{page:N})):H});vc.displayName="Link";var Lu=b.forwardRef(function({"aria-current":t="page",caseSensitive:s=!1,className:i="",end:o=!1,style:l,to:u,viewTransition:d,children:f,...g},m){let h=Ed(u,{relative:g.relative}),x=gr(),S=b.useContext(wd),{navigator:w,basename:C}=b.useContext(xs),E=S!=null&&X8(h)&&d===!0,R=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,O=x.pathname,T=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;s||(O=O.toLowerCase(),T=T?T.toLowerCase():null,R=R.toLowerCase()),T&&C&&(T=ts(T,C)||T);const A=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let N=O===R||!o&&O.startsWith(R)&&O.charAt(A)==="/",j=T!=null&&(T===R||!o&&T.startsWith(R)&&T.charAt(R.length)==="/"),D={isActive:N,isPending:j,isTransitioning:E},M=N?t:void 0,z;typeof i=="function"?z=i(D):z=[i,N?"active":null,j?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let L=typeof l=="function"?l(D):l;return b.createElement(vc,{...g,"aria-current":M,className:z,ref:m,style:L,to:u,viewTransition:d},typeof f=="function"?f(D):f)});Lu.displayName="NavLink";var F8=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:s,reloadDocument:i,replace:o,state:l,method:u=Hh,action:d,onSubmit:f,relative:g,preventScrollReset:m,viewTransition:h,defaultShouldRevalidate:x,...S},w)=>{let{useTransitions:C}=b.useContext(xs),E=$8(),R=G8(d,{relative:g}),O=u.toLowerCase()==="get"?"get":"post",T=typeof d=="string"&&pg.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:s,replace:o,state:l,relative:g,preventScrollReset:m,viewTransition:h,defaultShouldRevalidate:x});C&&s!==!1?b.startTransition(()=>M()):M()};return b.createElement("form",{ref:w,method:O,action:R,onSubmit:i?f:A,...S,"data-discover":!T&&e==="render"?"true":void 0})});F8.displayName="Form";function B8(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function GO(e){let t=b.useContext(Go);return Ut(t,B8(e)),t}function V8(e,{target:t,replace:s,mask:i,state:o,preventScrollReset:l,relative:u,viewTransition:d,defaultShouldRevalidate:f,useTransitions:g}={}){let m=Xo(),h=gr(),x=Ed(e,{relative:u});return b.useCallback(S=>{if(v8(S,t)){S.preventDefault();let w=s!==void 0?s:Cr(h)===Cr(x),C=()=>m(e,{replace:w,mask:i,state:o,preventScrollReset:l,relative:u,viewTransition:d,defaultShouldRevalidate:f});g?b.startTransition(()=>C()):C()}},[h,m,x,s,i,o,t,e,l,u,d,f,g])}function K8(e){Fn(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(pv(e)),s=b.useRef(!1),i=gr(),o=b.useMemo(()=>b8(i.search,s.current?null:t.current),[i.search]),l=Xo(),u=b.useCallback((d,f)=>{const g=pv(typeof d=="function"?d(new URLSearchParams(o)):d);s.current=!0,l("?"+g,f)},[l,o]);return[o,u]}var q8=0,Y8=()=>`__${String(++q8)}__`;function $8(){let{router:e}=GO("useSubmit"),{basename:t}=b.useContext(xs),s=J6(),i=e.fetch,o=e.navigate;return b.useCallback(async(l,u={})=>{let{action:d,method:f,encType:g,formData:m,body:h}=w8(l,t);if(u.navigate===!1){let x=u.fetcherKey||Y8();await i(x,s,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:s,flushSync:u.flushSync,viewTransition:u.viewTransition})},[i,o,t,s])}function G8(e,{relative:t}={}){let{basename:s}=b.useContext(xs),i=b.useContext(Hs);Ut(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),l={...Ed(e||".",{relative:t})},u=gr();if(e==null){l.search=u.search;let d=new URLSearchParams(l.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();l.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(l.pathname=l.pathname==="/"?s:Ps([s,l.pathname])),Cr(l)}function Q8(e,t){let{capture:s}={};b.useEffect(()=>{let i=s!=null?{capture:s}:void 0;return window.addEventListener("beforeunload",e,i),()=>{window.removeEventListener("beforeunload",e,i)}},[e,s])}function X8(e,{relative:t}={}){let s=b.useContext(jb);Ut(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=GO("useViewTransitionState"),o=Ed(e,{relative:t});if(!s.isTransitioning)return!1;let l=ts(s.currentLocation.pathname,i)||s.currentLocation.pathname,u=ts(s.nextLocation.pathname,i)||s.nextLocation.pathname;return Gu(o.pathname,u)!=null||Gu(o.pathname,l)!=null}function Z8(e){return b.createElement(c8,{flushSync:hr.flushSync,...e})}const J8={agents:"statusBar.targetAgents",claude:"statusBar.targetClaude"},W8={missing:"statusBar.statusMissing",outdated:"statusBar.statusOutdated",current:"statusBar.statusCurrent"},gv={missing:"text-red-600 dark:text-red-400",outdated:"text-amber-600 dark:text-amber-400",current:"text-emerald-600 dark:text-emerald-400"},QO={missing:ML,outdated:fb,current:PT};function eU(){const{t:e}=ht(),t=gr(),s=Tb(),i=b.useRef(null),[o,l]=b.useState(!1),u=w_(),d=u.data?.targets??[],f=d.length>0?nU(d):void 0,g=f?QO[f]:void 0,m=d.filter(({status:x})=>x!=="current"),h=`foundry settings download-skill --target ${m.map(({target:x})=>x==="agents"?".agents":".claude").join(",")}`;return y.jsxs("div",{ref:i,"data-slot":"skill-status-bar",className:`
|
|
16
|
-
fixed inset-x-0 bottom-0 z-20 flex h-6 items-center justify-between
|
|
17
|
-
gap-3 border-t bg-background/95 px-3 text-[11px] text-muted-foreground
|
|
18
|
-
backdrop-blur-sm
|
|
19
|
-
`,children:[y.jsx("span",{"data-slot":"skill-status-version",className:"min-w-0 truncate",children:u.data?e("statusBar.foundryVersion",{version:u.data.version}):e("statusBar.foundry")}),y.jsxs(yb,{open:o,onOpenChange:l,children:[y.jsxs(Jk,{openOnHover:!s,delay:120,"aria-label":e("statusBar.skillStatus"),className:`
|
|
20
|
-
flex h-5 cursor-pointer items-center gap-1.5 rounded-sm px-1.5
|
|
21
|
-
outline-none
|
|
22
|
-
hover:bg-muted hover:text-foreground
|
|
23
|
-
focus-visible:ring-2 focus-visible:ring-ring/50
|
|
24
|
-
`,children:[y.jsx("span",{children:e("statusBar.skill")}),u.isPending&&y.jsx("span",{className:`
|
|
25
|
-
size-1.5 animate-pulse rounded-full bg-muted-foreground
|
|
26
|
-
`}),u.isError&&y.jsx(fb,{className:`
|
|
27
|
-
size-3 text-amber-600
|
|
28
|
-
dark:text-amber-400
|
|
29
|
-
`}),g&&f&&y.jsx(g,{className:`
|
|
30
|
-
size-3
|
|
31
|
-
${gv[f]}
|
|
32
|
-
`})]}),y.jsx(vb,{anchor:s?i:void 0,side:"top",align:s?"center":"end",sideOffset:8,className:`
|
|
33
|
-
w-[calc(100vw-2rem)] max-w-[calc(100vw-2rem)]
|
|
34
|
-
md:w-116
|
|
35
|
-
`,children:y.jsxs("div",{className:"flex flex-col gap-3",children:[u.isPending&&y.jsx("p",{className:"text-xs text-muted-foreground",children:e("statusBar.skillChecking")}),u.isError&&y.jsx("p",{className:`
|
|
36
|
-
text-xs text-amber-600
|
|
37
|
-
dark:text-amber-400
|
|
38
|
-
`,children:e("statusBar.skillUnavailable")}),d.length>0&&y.jsx("div",{className:"flex flex-col gap-3",children:d.map(x=>y.jsx(tU,{...x},x.target))}),m.length>0&&y.jsxs("div",{className:"flex flex-col gap-1.5",children:[y.jsx("p",{className:"text-[11px] text-muted-foreground",children:y.jsx(gd,{i18nKey:"statusBar.skillRefreshHint",components:{settings:y.jsx(vc,{to:"/settings?panel=advanced",state:{backTo:Cr(t)},onClick:()=>l(!1),className:`
|
|
39
|
-
font-medium text-foreground underline
|
|
40
|
-
underline-offset-2
|
|
41
|
-
`})}})}),y.jsxs(X5,{size:"sm",children:[y.jsxs(Z5,{children:[y.jsxs(J5,{children:[y.jsx(GL,{}),e("statusBar.terminal")]}),y.jsx(W5,{children:y.jsx(ez,{value:h,"aria-label":e("statusBar.copyCommand")})})]}),y.jsx(tz,{wrap:!0,children:h})]})]})]})})]})]})}function tU({target:e,status:t,destination:s}){const{t:i}=ht(),o=QO[t];return y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsxs("span",{className:`
|
|
42
|
-
flex items-center gap-1.5 text-xs font-medium text-foreground
|
|
43
|
-
`,children:[y.jsx(o,{className:`
|
|
44
|
-
size-3
|
|
45
|
-
${gv[t]}
|
|
46
|
-
`}),i(J8[e])]}),y.jsx("span",{className:`
|
|
47
|
-
text-[11px]
|
|
48
|
-
${gv[t]}
|
|
49
|
-
`,children:i(W8[t])})]}),y.jsx("code",{className:"font-mono text-[11px] break-all text-muted-foreground",children:s})]})}function nU(e){return e.some(({status:t})=>t==="missing")?"missing":e.some(({status:t})=>t==="outdated")?"outdated":"current"}function Ci({controlled:e,default:t,name:s,state:i="value"}){const{current:o}=b.useRef(e!==void 0),[l,u]=b.useState(()=>t),d=o&&e!==void 0?e:l,f=b.useCallback(g=>{o||u(g)},[]);return[d,f]}function rU(e){const{open:t,defaultOpen:s=!1,onOpenChange:i,disabled:o}=e,[l,u]=Ci({controlled:t,default:s,name:"Collapsible",state:"open"}),{mounted:d,setMounted:f,transitionStatus:g}=Ja(l,!0,!0),m=Qn(),[h,x]=b.useState(),S=h===null?void 0:h??m,w=Be(C=>{const E=!l,R=lt(Zs,C.nativeEvent);i(E,R),!R.isCanceled&&u(E)});return b.useMemo(()=>({defaultPanelId:m,disabled:o,handleTrigger:w,mounted:d,open:l,panelId:S,setMounted:f,setOpen:u,setPanelIdState:x,transitionStatus:g}),[m,o,w,d,l,S,f,u,x,g])}const XO=b.createContext(void 0);function ZO(){const e=b.useContext(XO);if(e===void 0)throw new Error(cn(15));return e}const sU="data-open",iU="data-closed",wh=zv,aU="data-panel-open",oU={[sU]:""},lU={[iU]:""},cU={open(e){return e?{[aU]:""}:null}},uU={open(e){return e?oU:lU}},JO={...uU,...ni},dU=b.forwardRef(function(t,s){const{render:i,className:o,defaultOpen:l=!1,disabled:u=!1,onOpenChange:d,open:f,style:g,...m}=t,h=Be(d),x=rU({open:f,defaultOpen:l,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=bt("div",t,{state:S,ref:s,props:m,stateAttributesMapping:JO});return y.jsx(XO.Provider,{value:w,children:C})}),fU={...cU,...ni},hU=b.forwardRef(function(t,s){const{panelId:i,open:o,handleTrigger:l,state:u,disabled:d}=ZO(),{className:f,disabled:g=d,render:m,nativeButton:h=!0,style:x,...S}=t,{getButtonProps:w,buttonRef:C}=ns({disabled:g,native:h});return bt("button",t,{state:u,ref:[s,C],props:[{"aria-controls":o?i:void 0,"aria-expanded":o,onClick:l},S,w],stateAttributesMapping:fU})}),Ul={height:void 0,width:void 0};function pU(e){const{externalRef:t,hiddenUntilFound:s,id:i,keepMounted:o,mounted:l,onOpenChange:u,open:d,setMounted:f,setOpen:g,transitionStatus:m}=e,h=b.useRef(null),x=b.useRef(null),[S,w]=b.useState(Ul),C=b.useRef(Ul),E=b.useRef(!1),R=b.useRef(d),O=b.useRef(!1),[T,A]=b.useState(!1),N=b.useRef(null),j=es(t,h),D=Ln(d),M=Bp(h),z=!d&&!l,L=T?"idle":m,K=d&&(R.current||O.current),X=!d&&l&&x.current==="css-animation"&&S.height===void 0&&S.width===void 0?C.current:S,B=s&&z&&x.current!=="css-animation",H=Be((q,Y=!0)=>{Y&&(C.current=q),w(q)}),U=Be(()=>{N.current?.(),N.current=null}),_=Be(q=>{U(),N.current=()=>{N.current=null,q()}}),Q=Be(()=>{d&&l&&x.current==="css-animation"&&(O.current=!0)});Pe(()=>{!T||m==="starting"||A(!1)},[T,m]),b.useEffect(()=>()=>{Q(),U()},[Q,U]),Pe(()=>{d||(R.current=!1,O.current=!1);const q=h.current;if(!q)return;!d&&N.current&&U();const Y=gU(q,K);if(x.current=Y,d&&m==="idle"&&R.current&&Y==="css-animation"){C.current=Hl(q);return}if(d&&m==="starting"){const ae=E.current;if(E.current=!1,Y==="none"){H(Hl(q)),A(!0);return}if(Y==="css-transition"){const Z=mU(q);if(H(Hl(q)),!ae)return Z;const ne=Eh(q,"transition-duration","0s");return _(ne),A(!0),Z}H(Hl(q));const I=Eh(q,"animation-name","none");if(!ae){I();return}const F=Eh(q,"animation-duration","0s");I(),_(F),A(!0);return}if(!d&&l&&(m==="idle"||m==="starting")){if(Y==="none"){H(Ul,!1),f(!1);return}H(Hl(q));return}if(m!=="ending")return;if(Y==="none"){f(!1);return}const ee=Hl(q);if(!(ee.height>0||ee.width>0)){f(!1);return}H(ee),Y==="css-animation"&&Eh(q,"animation-name","none")()},[l,d,U,H,f,_,K,m]),bs({enabled:d&&l&&L==="idle",open:!0,ref:h,onComplete(){d&&H(Ul,!1)}}),b.useEffect(()=>{if(d||!l||L!=="ending")return;if(!h.current){f(!1),H(Ul,!1);return}const Y=new AbortController;let ee=-1;function $(){D.current||(f(!1),H(Ul,!1))}return ee=jr.request(()=>{M($,Y.signal)}),()=>{jr.cancel(ee),Y.abort()}},[D,l,d,L,M,H,f]),Pe(()=>{const q=h.current;!q||!s||!z||q.setAttribute("hidden","until-found")},[z,s]),b.useEffect(function(){const Y=h.current;if(!Y)return;const ee=zs.create();let $=-1;const ae=(Z,ne)=>{ee.start(0,()=>{D.current||($=jr.request(()=>{D.current||(Z&&(E.current=!1),ne&&Y.setAttribute(wh,""),Y.setAttribute("hidden","until-found"))}))})},F=zt(Y,"beforematch",Z=>{const ne=lt(kr,Z);if(u(!0,ne),ne.isCanceled){ae(!1,!1);return}E.current=!0;const ye=Y.hasAttribute(wh);Y.removeAttribute(wh),g(!0),ae(!0,ye)});return()=>{ee.clear(),jr.cancel($),F()}},[D,u,g]);const G=o||s||l||d;return{height:X.height,props:{...B?{[wh]:""}:void 0,hidden:z,id:i},ref:j,shouldPreventOpenAnimation:K,shouldRender:G,transitionStatus:L,width:X.width}}function Hl(e){return{height:e.scrollHeight,width:e.scrollWidth}}function gU(e,t){const s=Rn(e).getComputedStyle(e),i=(s.animationName.split(",").map(l=>l.trim()).some(l=>l!==""&&l!=="none")||t)&&jR(s.animationDuration),o=jR(s.transitionDuration);return i&&o||o?"css-transition":i?"css-animation":"none"}function jR(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function Eh(e,t,s){const i=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);return e.style.setProperty(t,s),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,o)}}function mU(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 s(){Object.entries(t).forEach(([o,l])=>{if(l===""){e.style.removeProperty(o);return}e.style.setProperty(o,l)})}const i=jr.request(s);return()=>{jr.cancel(i),s()}}const yU="--collapsible-panel-height",vU="--collapsible-panel-width",bU=b.forwardRef(function(t,s){const{className:i,hiddenUntilFound:o,keepMounted:l,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:O}=ZO(),T=o??!1,A=l??!1,N=d||void 0,j=N??m;Pe(()=>(C(Q=>N??(Q===null?void 0:Q)),()=>{C(Q=>Q===N?null:Q)}),[N,C]);const{height:D,props:M,ref:z,shouldPreventOpenAnimation:L,shouldRender:K,transitionStatus:X,width:B}=pU({externalRef:s,hiddenUntilFound:T,id:j,keepMounted:A,mounted:h,onOpenChange:x,open:S,setMounted:w,setOpen:E,transitionStatus:O}),H={...R,transitionStatus:X},U=LC(f,H),_=bt("div",{...t,style:void 0},{state:H,ref:z,props:[M,{style:{[yU]:D===void 0?"auto":`${D}px`,[vU]:B===void 0?"auto":`${B}px`}},g,U?{style:U}:void 0,L?{style:{animationName:"none"}}:void 0],stateAttributesMapping:JO});return K?_:null});function xU({...e}){return y.jsx(dU,{"data-slot":"collapsible",...e})}function SU({...e}){return y.jsx(hU,{"data-slot":"collapsible-trigger",...e})}function wU({...e}){return y.jsx(bU,{"data-slot":"collapsible-content",...e})}const WO=b.createContext(void 0);function EU(e){const t=b.useContext(WO);if(t===void 0)throw new Error(cn(33));return t}const xg=b.createContext(void 0);function sa(e){const t=b.useContext(xg);if(t===void 0&&!e)throw new Error(cn(36));return t}const eA=b.createContext(void 0);function Sg(e=!0){const t=b.useContext(eA);if(t===void 0&&!e)throw new Error(cn(25));return t}const tA=b.createContext(null);function wg(e="root"){const t=b.useContext(tA),s=b.useContext(xg);return t===null||s===void 0?null:(e==="submenu-trigger"?s.virtualFocus||s.parentVirtualFocus:s.virtualFocus)?t:null}const RU={visible:!0,ref:null};function CU(){return RU}function nA(e,t,s="root"){const i=wg(s),l=((s==="submenu-trigger"?i?.useSubmenuTrigger:i?.useItem)??CU)({label:e.label,children:e.children,render:e.render}),u=es(t,l.ref);return{visible:l.visible,ref:u,props:l.props}}function TU(e){e.preventDefault()}function kU(e){const{closeOnClick:t,highlighted:s,id:i,nodeId:o,store:l,typingRef:u,itemRef:d,itemMetadata:f}=e,g=sa(),m=Sg(!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",s),{events:C}=l.useState("floatingTreeRoot"),E=l.useState("open"),R=m!==void 0,O=!x&&E&&s?0:-1;return b.useMemo(()=>({id:i,role:"menuitem",tabIndex:O,"aria-selected":w,onMouseDown:x?TU:void 0,onKeyDown(T){T.key===" "&&u?.current&&T.preventDefault()},onMouseMove(T){o&&C.emit("itemhover",{nodeId:o,target:T.currentTarget})},onClick(T){t&&C.emit("close",{domEvent:T.nativeEvent,reason:zo})},onMouseUp(T){if(m){const A=m.initialCursorPointRef.current;if(m.initialCursorPointRef.current=null,R&&A&&Math.abs(T.clientX-A.x)<=1&&Math.abs(T.clientY-A.y)<=1||R&&!Mv&&T.button===2)return}d.current&&l.context.allowMouseUpTriggerRef.current&&(!R||T.button===2)&&f.type==="regular-item"&&_o(d.current,T,{detail:1,pointerType:"mouse"})}}),[t,O,i,C,o,l.context.allowMouseUpTriggerRef,u,d,m,R,f.type,w,x])}const rA={type:"regular-item"};function sA(e){const{closeOnClick:t,disabled:s,highlighted:i,id:o,store:l,typingRef:u=l.context.typingRef,nativeButton:d,itemMetadata:f,nodeId:g}=e,m=b.useRef(null),{getButtonProps:h,buttonRef:x}=ns({disabled:s,focusableWhenDisabled:!0,native:d,composite:!0}),S=kU({closeOnClick:t,highlighted:i,id:o,nodeId:g,store:l,typingRef:u,itemRef:m,itemMetadata:f}),w=b.useCallback(E=>Ir(S,{onMouseEnter(R){f.type==="submenu-trigger"&&f.setActive(R.nativeEvent)}},E,h),[S,h,f]),C=es(m,x);return b.useMemo(()=>({getItemProps:w,itemRef:C}),[w,C])}const iA=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function OU(){return b.useContext(iA)}function Rd(e={}){const{guess:t,label:s,metadata:i,textRef:o,index:l}=e,{register:u,unregister:d,subscribeMapChange:f,nextIndexRef:g}=OU(),m=b.useRef(-1),[h,x]=b.useState(l==null&&t?()=>{if(m.current===-1){const E=g.current;g.current+=1,m.current=E}return m.current}:-1),S=l??h,w=b.useRef(null),C=b.useCallback(E=>{const R=w.current;R&&d(R),w.current=E,E&&u(E,{metadata:i??null,index:l??null,label:s,textRef:o})},[l,u,d,i,s,o]);return Pe(()=>{if(l==null)return f(E=>{const R=w.current?E.get(w.current)?.index:null;R!=null&&x(R)})},[l,f]),{ref:C,index:S}}const AU="data-checked",MU="data-unchecked",aA={checked(e){return e?{[AU]:""}:{[MU]:""}},...ni},Fb=b.createContext(void 0);function NU(){const e=b.useContext(Fb);if(e===void 0)throw new Error(cn(31));return e}const DU=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,[d,f]=b.useState(void 0),g=bt("div",t,{ref:s,props:{role:"group","aria-labelledby":d,...u}});return y.jsx(Fb.Provider,{value:f,children:g})}),jU=b.forwardRef(function(t,s){const i=wg()?.Group??DU;return y.jsx(i,{...t,ref:s})}),IU=b.forwardRef(function(t,s){const{render:i,className:o,style:l,id:u,...d}=t,f=Qn(u),g=NU();return Pe(()=>(g(f),()=>{g(m=>m===f?void 0:m)}),[g,f]),bt("div",t,{ref:s,props:{id:f,"aria-hidden":!0,...d}})}),PU=b.forwardRef(function(t,s){const{render:i,className:o,id:l,label:u,nativeButton:d=!1,disabled:f=!1,closeOnClick:g=!0,style:m,...h}=t,{store:x}=sa(),S=Rd({guess:!0,label:u}),w=Qn(l),C=x.useState("disabled"),E=x.useState("isActive",S.index),R=x.useState("floatingNodeId"),O=x.useState("itemProps"),T=f||C,{getItemProps:A,itemRef:N}=sA({closeOnClick:g,disabled:T,highlighted:E,id:w,store:x,nativeButton:d,nodeId:R,itemMetadata:rA});return bt("div",t,{state:{disabled:T,highlighted:E},props:[O,h,A],ref:[N,s,S.ref]})}),oA=b.forwardRef(function(t,s){const i=nA(t,s);return i.visible?y.jsx(PU,{...t,ref:i.ref}):null}),LU=b.createContext(void 0);function zU(){return b.useContext(LU)}function _U(e,t){const s=Yv(e.render);if(b.isValidElement(s)){const i=s.props;if(Object.hasOwn(i,"id"))return i.id??""}return e.id??t}function UU(e,t,s){const i=_U(e,t),o=i===t?void 0:i,l=b.useCallback(u=>s?.(u?o:void 0),[o,s]);return[i,l]}function HU(e,t,s){const i=Yv(e.render),o=b.isValidElement(i)?i.props:void 0,l=e["aria-label"]??o?.["aria-label"];let u=e["aria-labelledby"]??o?.["aria-labelledby"];return u==null&&!l&&(u=t?t.id||void 0:s||void 0),u}const FU=b.forwardRef(function(t,s){const{render:i,className:o,style:l,finalFocus:u,id:d,initialFocus:f,...g}=t,{store:m,defaultFloatingId:h,setRenderedFloatingId:x,virtualFocus:S,orientation:w}=sa(),C=zU(),{side:E,align:R}=EU(),O=dg()!=null,T=m.useState("open"),A=m.useState("transitionStatus"),N=m.useState("popupProps"),j=m.useState("mounted"),D=m.useState("instantType"),M=m.useState("activeTriggerElement"),z=m.useState("parent"),L=m.useState("lastOpenChangeReason"),K=m.useState("rootId"),X=m.useState("floatingRootContext"),B=m.useState("floatingTreeRoot"),H=m.useState("closeDelay"),U=m.useState("hoverEnabled"),_=m.useState("disabled"),Q=m.useState("openMethod"),G=m.useState("activeTriggerId"),q=m.useState("listElement"),[Y,ee]=UU(t,h,x),$=HU(t,M,G),ae=z.type==="menu"?C:void 0,I=z.type==="context-menu";let F=f??z.type!=="menu";f===void 0&&q&&z.type!=="menu"&&(F=()=>m.state.activeIndex!==null?!1:q),bs({open:T,ref:m.context.popupRef,onComplete(){T&&m.context.onOpenChangeComplete?.(!0)}}),b.useEffect(()=>{function be(Le){m.setOpen(!1,lt(Le.reason,Le.domEvent))}return B.events.on("close",be),()=>{B.events.off("close",be)}},[B.events,m]),tb(X,{enabled:U&&!_&&!I&&z.type!=="menubar",closeDelay:H});const Z=m.useStateSetter("popupElement"),ne=b.useContext(tA)?.useParentHandoff??VU,{parentVirtualFocusRef:ye,handleFocus:se}=ne(m,z,T,S),ge={transitionStatus:A,side:E,align:R,open:T,nested:z.type==="menu",instant:D},fe=bt("div",t,{state:ge,ref:[s,m.context.popupRef,Z,ee],stateAttributesMapping:jp,props:[N,{id:Y,...q?{role:"presentation"}:{role:"menu","aria-orientation":w==="horizontal"?"horizontal":void 0,"aria-labelledby":$},onKeyDown(be){ae?.onPopupKeyDown?.(be),O&&yd.has(be.key)&&be.stopPropagation()},onFocus:se},fd(A),g,{"data-rootownerid":K}]});let ce=z.type===void 0||I;(M||z.type==="menubar"&&L!==Ip)&&(ce=!0);const Re=ae?.getReturnElement??ye;return y.jsx(Hp,{context:X,openInteractionType:Q,modal:I,disabled:!j,returnFocus:u??Re??ce,explicitReturnFocus:u===void 0&&Re?!1:void 0,initialFocus:F,restoreFocus:!0,getInsideElements:z.type===void 0?()=>[m.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:z.type!=="menubar"?B:void 0,previousFocusableElement:M,nextFocusableElement:z.type===void 0?m.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:m.context.beforeContentFocusGuardRef,children:fe})}),BU={parentVirtualFocusRef:void 0,handleFocus:void 0};function VU(){return BU}const lA=b.forwardRef(function(t,s){const i=wg()?.Popup??FU;return y.jsx(i,{...t,ref:s})}),cA=b.createContext(void 0);function KU(){const e=b.useContext(cA);if(e===void 0)throw new Error(cn(32));return e}const uA=b.forwardRef(function(t,s){const{keepMounted:i=!1,...o}=t,{store:l,parent:u}=sa();if(!(l.useState("mounted")||i))return null;const g=u.type==="menu"||u.type==="menubar"?"group":void 0;return y.jsx(cA.Provider,{value:i,children:y.jsx(Up,{ref:s,...o,portalOwnerRole:g})})});function Eg(e){const{children:t,elementsRef:s,labelsRef:i,onMapChange:o}=e,l=Be(o),[,u]=b.useState(0),d=rr(YU).current,f=rr(qU).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 s.current.length=0,i&&(i.current.length=0),N.forEach(D=>{j.set(D.element,{...D.registration.metadata??{},index:D.index}),s.current[D.index]=D.element,i&&(i.current[D.index]=D.registration.label!==void 0?D.registration.label:D.registration.textRef?.current?.textContent??D.element.textContent)}),g.current=s.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(!QU(M))return;let z=null;for(const L of N)if(L.isConnected){if(z&&dA(z,L)>0){j.disconnect(),S();return}z=L}});x.current=j;const D=new Set;for(let M=1;M<N.length;M+=1){const z=GU(N[M-1],N[M]);z&&D.add(z)}D.forEach(M=>j.observe(M,{childList:!0}))}const O=Be(()=>{const[N,j]=$U(f),D=E(N),M=h.current,z=!M||M.length!==N.length||N.some((L,K)=>{const X=M[K];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,z&&(d.forEach(L=>L(D)),l(D))});Pe(()=>(!m.current&&h.current&&E(h.current),()=>{s.current=[],i&&(i.current=[])}),[s,i,E]),Pe(()=>{m.current&&O()}),Pe(()=>()=>{x.current?.disconnect(),m.current=!0},[]);const T=Be(N=>(d.add(N),()=>{d.delete(N)})),A=b.useMemo(()=>({register:w,unregister:C,subscribeMapChange:T,nextIndexRef:g}),[w,C,T,g]);return y.jsx(iA.Provider,{value:A,children:t})}function qU(){return new Map}function YU(){return new Set}function $U(e){const t=new Set,s=[],i=[];e.forEach((l,u)=>{if(!u.isConnected)return;const d=l.index,f={index:d??-1,element:u,registration:l};d===null?i.push(f):d>=0&&(t.add(d),s.push(f))});let o=0;return i.sort((l,u)=>dA(l.element,u.element)),i.forEach(l=>{for(;t.has(o);)o+=1;l.index=o,s.push(l),o+=1}),t.size>0&&s.sort((l,u)=>l.index-u.index),[s,i.map(l=>l.element)]}function GU(e,t){let s=e.parentElement;for(;s&&!s.contains(t);)s=s.parentElement;return s}function QU(e){for(const t of e)for(let s=0;s<t.removedNodes.length;s+=1)if(t.removedNodes[s].isConnected)return!0;return!1}function dA(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const fA=b.forwardRef(function(t,s){const{anchor:i,positionMethod:o="absolute",className:l,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=KC,style:R,...O}=t,{store:T,virtualFocus:A,syncHighlightedItem:N}=sa(),j=KU(),D=Sg(!0),M=T.useState("parent"),z=T.useState("floatingRootContext"),L=T.useState("floatingTreeRoot"),K=T.useState("mounted"),X=T.useState("open"),B=T.useState("modal"),H=T.useState("openMethod"),U=T.useState("activeTriggerElement"),_=T.useState("transitionStatus"),Q=T.useState("positionerElement"),G=T.useState("instantType"),q=T.useState("adaptiveOrigin"),Y=T.useState("lastOpenChangeReason"),ee=T.useState("floatingNodeId"),$=T.useState("floatingParentNodeId"),ae=z.useState("domReferenceElement");let I=i,F=g,Z=m,ne=f,ye=E;M.type==="context-menu"&&(I=i??M.context?.anchor,ne=ne??"start",!d&&ne!=="center"&&(Z=t.alignOffset??2,F=t.sideOffset??-5));let se=d,ge=ne;M.type==="menu"?(se=se??"inline-end",ge=ge??"start",ye=t.collisionAvoidance??Gv):M.type==="menubar"&&(se=se??(M.context.orientation==="vertical"?"inline-end":"bottom"),ge=ge??"start");const fe=M.type==="context-menu",ce=ng({anchor:I,floatingRootContext:z,positionMethod:D?"fixed":o,mounted:K,side:se,sideOffset:F,align:ge,alignOffset:Z,arrowPadding:fe?0:S,collisionBoundary:h,collisionPadding:x,sticky:w,nodeId:ee,keepMounted:j,disableAnchorTracking:C,collisionAvoidance:ye,shift:fe?{crossAxis:!("side"in ye&&ye.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:L,adaptiveOrigin:q,lazyFlip:A?"placement":!1});b.useEffect(()=>{function Ue(xe){xe.open&&(xe.parentNodeId===ee&&T.set("hoverEnabled",!1),xe.nodeId!==ee&&xe.parentNodeId===T.select("floatingParentNodeId")&&T.setOpen(!1,lt(Ru)))}return L.events.on("menuopenchange",Ue),()=>{L.events.off("menuopenchange",Ue)}},[T,L.events,ee]),b.useEffect(()=>{if(T.select("floatingParentNodeId")==null)return;function Ue(xe){if(xe.open||xe.nodeId!==T.select("floatingParentNodeId"))return;const Fe=xe.reason??Ru;T.setOpen(!1,lt(Fe))}return L.events.on("menuopenchange",Ue),()=>{L.events.off("menuopenchange",Ue)}},[L.events,T]);const Re=Hn();b.useEffect(()=>{X||Re.clear()},[X,Re]),b.useEffect(()=>{function Ue(xe){if(!(!X||xe.nodeId!==T.select("floatingParentNodeId")))if(xe.target&&U&&U!==xe.target){const Fe=T.select("closeDelay");Fe>0?Re.isStarted()||Re.start(Fe,()=>{T.setOpen(!1,lt(Ru))}):T.setOpen(!1,lt(Ru))}else Re.clear()}return L.events.on("itemhover",Ue),()=>{L.events.off("itemhover",Ue)}},[L.events,X,U,T,Re]),b.useEffect(()=>{const Ue={open:X,nodeId:ee,parentNodeId:$,reason:T.select("lastOpenChangeReason")};L.events.emit("menuopenchange",Ue)},[L.events,X,T,ee,$]),Qk({store:T,domReference:ae,positionerElement:Q,open:X});const be={open:X,side:ce.side,align:ce.align,anchorHidden:ce.anchorHidden,nested:M.type==="menu",instant:G},Le=M.type==="menubar"&&M.context.modal;mb(X&&(Le||B&&Y!==qn),H==="touch",Q,U);const ze=rg(t,be,{styles:ce.positionerStyles,transitionStatus:_,props:O,refs:[s,T.useStateSetter("positionerElement")],hidden:!K,inert:!X}),Ve=K&&M.type!=="menu"&&(M.type!=="menubar"&&B&&Y!==qn||M.type==="menubar"&&M.context.modal);let ke=null;return M.type==="menubar"?ke=M.context.contentElement:M.type===void 0&&(ke=U),y.jsxs(WO.Provider,{value:ce,children:[Ve&&y.jsx(cg,{ref:M.type==="context-menu"||M.type==="nested-context-menu"?M.context.internalBackdropRef:null,inert:hd(!X),cutout:ke}),y.jsx(ZC,{id:ee,children:y.jsx(Eg,{elementsRef:T.context.itemDomElements,labelsRef:T.context.itemLabels,onMapChange:N,children:ze})})]})}),hA=b.createContext(void 0);function XU(){const e=b.useContext(hA);if(e===void 0)throw new Error(cn(34));return e}const ZU=b.forwardRef(function(t,s){const{render:i,className:o,value:l,defaultValue:u,onValueChange:d,disabled:f=!1,style:g,"aria-labelledby":m,...h}=t,[x,S]=b.useState(void 0),[w,C]=Ci({controlled:l,default:u,name:"MenuRadioGroup"}),E=Be((A,N)=>{d?.(A,N),!N.isCanceled&&C(A)}),O=bt("div",t,{state:{disabled:f},ref:s,props:{role:"group","aria-labelledby":m??x,"aria-disabled":f||void 0,...h}}),T=b.useMemo(()=>({value:w,setValue:E,disabled:f}),[w,E,f]);return y.jsx(Fb.Provider,{value:S,children:y.jsx(hA.Provider,{value:T,children:O})})}),JU=b.memo(b.forwardRef(function(t,s){const i=wg()?.RadioGroup??ZU;return y.jsx(i,{...t,ref:s})})),pA=b.createContext(void 0);function WU(){const e=b.useContext(pA);if(e===void 0)throw new Error(cn(35));return e}const eH=b.forwardRef(function(t,s){const{render:i,className:o,id:l,label:u,nativeButton:d=!1,disabled:f=!1,closeOnClick:g=!1,value:m,style:h,...x}=t,{store:S}=sa(),{value:w,setValue:C,disabled:E}=XU(),R=Rd({guess:!0,label:u}),O=Qn(l),T=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:z,itemRef:L}=sA({closeOnClick:g,disabled:D,highlighted:T,id:O,store:S,nativeButton:d,nodeId:A,itemMetadata:rA}),K=b.useMemo(()=>({disabled:D,highlighted:T,checked:M}),[D,T,M]);function X(H){const U=lt(zo,H.nativeEvent,void 0,{preventUnmountOnClose:En});C(m,U)}const B=bt("div",t,{state:K,stateAttributesMapping:aA,props:[N,{role:"menuitemradio","aria-checked":M,onClick:X},x,z],ref:[L,s,R.ref]});return y.jsx(pA.Provider,{value:K,children:B})}),tH=b.forwardRef(function(t,s){const i=nA(t,s);return i.visible?y.jsx(eH,{...t,ref:i.ref}):null}),nH=b.forwardRef(function(t,s){const{render:i,className:o,style:l,keepMounted:u=!1,...d}=t,f=WU(),g=b.useRef(null),{transitionStatus:m,mounted:h,setMounted:x}=Ja(f.checked);bs({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 bt("span",t,{state:S,stateAttributesMapping:aA,ref:[s,g],props:{"aria-hidden":!0,...d},enabled:u||h})}),rH=b.createContext(null);function gA(e){return b.useContext(rH)}function sH(e){return e==null?kr:e.type.startsWith("key")?yC:e.type.startsWith("mouse")||e.type.startsWith("pointer")?O4:kr}const iH={...Gi,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 s=Gi.triggerPopupId(e,t);return s?e.listElement?.id||s:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Ti&&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"&&!Gi.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 aH extends pc{constructor(t,s,i=!1){const o=new dd,l=lH(o,s,i,t);super(l,oH(o),iH),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 s=t.store.select("rootId"),i=t.store.select("floatingTreeRoot"),o=t.store.select("keyboardEventRelay");return t.store.subscribe(()=>{const l=t.store.select("rootId"),u=t.store.select("floatingTreeRoot"),d=t.store.select("keyboardEventRelay");s===l&&i===u&&o===d||(s=l,i=u,o=d,this.notifyAll())})}setOpen(t,s){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:s})}setActiveIndex(t,s,i){if(this.state.activeIndex!==t){const l=(t===null?void 0:this.context.itemDomElements.current[t])===this.context.reportedItem;this.context.highlightReason=l?"none":s,this.context.highlightEvent=l?void 0:i}this.set("activeIndex",t)}highlightItem(t,s,i){const o=this.context.itemDomElements.current.indexOf(t);o>-1&&this.setActiveIndex(o,s,i)}}function oH(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 lH(e,t,s=!1,i){return{...Zp(e,t,s),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 Qv,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Xt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...i}}const IR=b.createContext(null);function mA(e,t){return(e===Zs||e===zo)&&t?.detail===0}function cH(e,t){return e===Qh||mA(e,t)}const uH=td(function(t){const{children:s,open:i,onOpenChange:o,onOpenChangeComplete:l,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:O=!1,virtualFocus:T=!1,virtualFocusRef:A,allowEscape:N=!0,resetOnPointerLeave:j=!0}=t,D=Sg(!0),M=sa(!0),z=gA(!0),L=M?.store,K=M?.virtualFocus??!1,X=b.useMemo(()=>O&&L?{type:"menu",store:L}:z?{type:"menubar",context:z}:D&&!L?{type:"context-menu",context:D}:{type:void 0},[D,L,z,O]),B=Qn(),H=Qn(),[U,_]=b.useState(void 0),Q=(U??H)||void 0,G=Xa(),q=X.type==="menu"?X.store:void 0,Y=(i??d)&&q?.state.transitionStatus==="starting",ee=rr(()=>Y?q?.state.instantType:void 0).current,$=rr(()=>{const Ie=new aH({open:d,openProp:i,activeTriggerId:E,triggerIdProp:C,parent:X,disabled:f,highlightItemOnHover:R,modal:X.type===void 0?g:void 0,rootId:B,instantType:ee},Q,G!=null);return Ie.context.virtualFocusRef=A,Ie}).current;$.useControlledProp("openProp",i),$.useControlledProp("triggerIdProp",C),$.useContextCallback("onOpenChangeComplete",l);const ae=$.useState("floatingTreeRoot"),I=Xv(ae),F=$.useState("open"),Z=$.useState("activeTriggerElement"),ne=$.useState("positionerElement"),ye=$.useState("hoverEnabled"),se=$.useState("disabled"),ge=$.useState("lastOpenChangeReason"),fe=$.useState("parent"),ce=$.useState("activeIndex"),Re=$.useState("keyboardOpen"),be=$.useState("payload"),Le=$.useState("floatingParentNodeId"),Oe=b.useRef(null),ze=b.useRef(fe.type!=="context-menu"),Ve=Hn(),ke=b.useRef(!0),Ue=Hn(),xe=Le!=null,{openMethod:Fe,triggerProps:Je}=Yk(F);$.useSyncedValues({disabled:f,highlightItemOnHover:R,modal:fe.type===void 0?g:void 0,openMethod:Fe,rootId:B}),$p($);const{forceUnmount:ot,transitionStatus:de}=Gp(F,$,()=>{$.set("allowMouseEnter",!1)},Y),Ee=Bp($.context.popupRef);b.useEffect(()=>{if(ee===void 0)return;const Ie=()=>{$.state.instantType===ee&&$.set("instantType",void 0)};if(!F){Ie();return}if(de!==void 0)return;if($.context.popupRef.current==null){Ie();return}const _e=new AbortController;return Ee(Ie,_e.signal),()=>{_e.abort()}},[ee,F,de,Ee,$]),Pe(()=>{D&&!M?$.update({parent:{type:"context-menu",context:D},floatingNodeId:I,floatingParentNodeId:G}):(M||!$.select("activeTriggerElement"))&&$.update({floatingNodeId:I,floatingParentNodeId:G})},[D,M,I,G,Z,$]),b.useEffect(()=>{if(F||(Oe.current=null),fe.type==="context-menu"){if(!F){Ve.clear(),ze.current=!1;return}Ve.start(500,()=>{ze.current=!0})}},[Ve,F,fe.type]),Pe(()=>{!F&&!ye&&$.set("hoverEnabled",!0)},[F,ye,$]);const $e=Be((Ie,_e)=>{const Ge=_e.reason;if(!Ie&&!$.select("open")||F===Ie&&_e.trigger===Z&&ge===Ge)return;const tt=qp(_e);if(!Ie&&_e.trigger==null&&(_e.trigger=Z??void 0),o?.(Ie,_e),_e.isCanceled)return;$.state.floatingRootContext.dispatchOpenChange(Ie,_e);const kt=_e.event;if(Ie===!1&&Ge!==zo&&kt?.type==="click"&&kt.pointerType==="touch"&&!ke.current)return;Ie&&Ge===$l?(ke.current=!1,Ue.start(300,()=>{ke.current=!0})):(ke.current=!0,Ue.clear());const V=!Ie&&(Ge===ad||Ge==null);Oe.current=_e.event;const W=Kp($.state,Ie,_e.trigger,tt());W.openChangeReason=Ge,W.keyboardOpen=Ie&&cH(Ge,kt),fe.type==="menubar"&&(Ge===$l||Ge===Ba||Ge===qn||Ge===Qh||Ge===Ru)?W.instantType="group":mA(Ge,kt)?W.instantType="click":V?W.instantType="dismiss":W.instantType=void 0,$.update(W)}),Me=WC({popupStore:$,floatingRootContext:$.state.floatingRootContext,floatingId:Q,nested:G!=null,onOpenChange:$e}),De=Me.context.events;Pe(()=>{const Ie=({open:_e,eventDetails:Ge})=>$e(_e,Ge);return De.on("setOpen",Ie),()=>{De?.off("setOpen",Ie)}},[De,$e]),Pe(()=>$.subscribeToParentMenu(),[$]);const xt=b.useCallback(()=>{$.setOpen(!1,lt(od))},[$]);b.useImperativeHandle(x,()=>({unmount:ot,close:xt}),[ot,xt]);let dt;fe.type==="context-menu"&&(dt=fe.context),b.useImperativeHandle(dt?.positionerRef,()=>ne,[ne]),b.useImperativeHandle(dt?.actionsRef,()=>({setOpen:$e}),[$e]);const gt=cd(Me,{enabled:!se,bubbles:{escapeKey:S&&fe.type==="menu"},outsidePress(){return fe.type!=="context-menu"||Oe.current?.type==="contextmenu"?!0:ze.current},externalTree:xe?ae:void 0}),Dt=tg(),It=cT(Me,{enabled:!se,listRef:$.context.itemDomElements,activeIndex:ce,virtual:T,nested:fe.type==="menubar"||!T&&fe.type!==void 0,parentOrientation:fe.type==="menubar"?fe.context.orientation:void 0,loopFocus:m,focusItemOnOpen:T?Re:void 0,allowEscape:T&&m&&N,orientation:h,triggerOrientation:T?"vertical":h,rtl:Dt==="rtl",disabledIndices:Ls,onNavigate(Ie,_e){$.setActiveIndex(Ie,sH(_e),_e?.nativeEvent)},openOnArrowKeyDown:fe.type!=="context-menu"&&!(T&&O),externalTree:!T&&xe?ae:void 0,nestedReturnFocusRef:q?.context.virtualFocusRef,focusItemOnHover:R,resetOnPointerLeave:j}),tn=b.useCallback(Ie=>{$.context.typingRef.current=Ie},[$]),an=uT(Me,{enabled:!se&&!T,listRef:$.context.itemLabels,elementsRef:$.context.itemDomElements,activeIndex:ce,resetMs:vI,onMatch:(Ie,_e)=>{F&&Ie!==ce&&$.setActiveIndex(Ie,yC,_e.nativeEvent)},onTyping:tn}),nn=Be(u),et=b.useRef(-1),Et=Be(()=>{const Ie=$.state.activeIndex,_e=Ie===null?void 0:$.context.itemDomElements.current[Ie]??void 0;if(_e?.isConnected===!1)return;const Ge=_e===void 0?-1:Ie;if(et.current===Ge&&$.context.reportedItem===_e)return;et.current=Ge,$.context.reportedItem=_e,T&&$.set("highlightedItem",_e);const{highlightReason:tt,highlightEvent:kt}=$.context;$.context.highlightReason=kr,$.context.highlightEvent=void 0,u&&nn(_e,k4(tt,kt,{label:_e===void 0?void 0:$.context.itemLabels.current[Ge]??void 0}))});Pe(()=>{Et()},[ce,Et]);const Zt=b.useMemo(()=>{if(!T)return It.reference;if(!It.trigger)return Xt;const{onFocus:Ie,..._e}=It.trigger;return _e},[T,It.reference,It.trigger]);$.useSyncedValue("inputProps",T?It.reference??Xt:Xt);const pt=b.useMemo(()=>{const Ie=Ir(an.reference,Zt,gt.reference,{onMouseMove(){$.set("allowMouseEnter",!0)}},Je);return Ie["aria-haspopup"]="menu",Ie["aria-expanded"]=F,Ie},[$,an.reference,Zt,gt.reference,Je,F]),St=b.useMemo(()=>{const Ie=Ir(It.trigger,gt.trigger,Je);return Ie["aria-haspopup"]="menu",Ie["aria-expanded"]=!1,Ie},[It.trigger,gt.trigger,Je]);rr(()=>($.update({inactiveTriggerProps:St}),null));const yt=b.useMemo(()=>Ir(ud,{onMouseMove(){$.set("allowMouseEnter",!0),fe.type==="menu"&&$.set("hoverEnabled",!1)},onClick(){$.select("hoverEnabled")&&$.set("hoverEnabled",!1)},onKeyDown(Ie){const _e=$.select("keyboardEventRelay");_e&&!Ie.isPropagationStopped()&&_e(Ie)}},an.floating,It.floating,gt.floating),[fe.type,$,an.floating,It.floating,gt.floating]),Ht=It.item??Xt;Qp($,{floatingRootContext:Me,activeTriggerProps:pt,inactiveTriggerProps:St,popupProps:yt,itemProps:Ht});const dn=b.useMemo(()=>({store:$,parent:X,orientation:h,loopFocus:m,allowEscape:N,defaultFloatingId:H,setRenderedFloatingId:_,virtualFocus:T,parentVirtualFocus:K,syncHighlightedItem:Et}),[$,X,h,m,N,H,T,K,Et]),je=typeof s=="function"?s({payload:be}):s;let at=y.jsxs(xg.Provider,{value:dn,children:[w&&y.jsx(Vp,{handle:w,store:$}),je]});return(fe.type===void 0||fe.type==="context-menu")&&(at=y.jsx(JC,{externalTree:ae,children:at})),at});function yA(e){const t=b.useContext(IR);if(t===null)return y.jsx(uH,{...e});const s=t.Root;return y.jsx(IR.Provider,{value:null,children:y.jsx(s,{...t.options,...e})})}const Rh=5;function vA(e,t){const s=dH(t);return e.clientX>=s.left-Rh&&e.clientX<=s.right+Rh&&e.clientY>=s.top-Rh&&e.clientY<=s.bottom+Rh}function dH(e){const t=e.getBoundingClientRect(),s=Rn(e);if(Nv)return t;const i=s.getComputedStyle(e,"::before"),o=s.getComputedStyle(e,"::after");if(!(i.content!=="none"||o.content!=="none"))return t;const u=parseFloat(i.width)||0,d=parseFloat(i.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 bA(e={}){const{highlightItemOnHover:t,highlightedIndex:s,onHighlightedIndexChange:i}=lg(),{ref:o,index:l}=Rd(e),u=s===l,d=b.useRef(null),f=es(o,d);return{compositeProps:{tabIndex:u?0:-1,onFocus(){i(l)},onMouseMove(){const m=d.current;if(!t||!m)return;const h=m.hasAttribute("disabled")||m.ariaDisabled==="true";!u&&!h&&m.focus()}},compositeRef:f,index:l}}function Bb(e){const{render:t,className:s,style:i,state:o=Xt,props:l=Ls,refs:u=Ls,metadata:d,stateAttributesMapping:f,tag:g="div",...m}=e,{compositeProps:h,compositeRef:x}=bA({metadata:d});return bt(g,e,{state:o,ref:[x,...u],props:[h,...l,m],stateAttributesMapping:f})}function Vb(e){if(bn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!Xi(e))return Vb(Wi(e))}function fH(e){const{enabled:t=!0,mouseDownAction:s,open:i}=e,o=b.useRef(!1);return b.useMemo(()=>t?{onMouseDown:l=>{(s==="open"&&!i||s==="close"&&i)&&(o.current=!0,qt(l.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:l=>{o.current&&(o.current=!1,l.preventBaseUIHandler())}}:Xt,[t,s,i])}const hH=Rp(function(t,s){const{render:i,className:o,style:l,disabled:u=!1,nativeButton:d=!0,id:f,openOnHover:g,delay:m=100,closeDelay:h=0,handle:x,payload:S,...w}=t,C=sa(!0),R=Jp(x)??C?.store;if(!R)throw new Error(cn(85));const O=Qn(f),T=R.useState("isTriggerActive",O),A=R.useState("floatingRootContext"),N=R.useState("isOpenedByTrigger",O),j=R.useState("triggerControlsId",O),D=b.useRef(null),M=gH(),z=lg(!0),L=Za(),K=b.useMemo(()=>L??new Qv,[L]),X=Xv(K),B=Xa(),{registerTrigger:H,isMountedByThisTrigger:U}=Yp(O,D,R,{payload:S,closeDelay:h,parent:M,floatingTreeRoot:K,floatingNodeId:X,floatingParentNodeId:B,keyboardEventRelay:z?.relayKeyboardEvent}),_=M.type==="menubar",Q=R.useState("disabled"),G=u||Q||_&&M.context.disabled,{getButtonProps:q,buttonRef:Y}=ns({disabled:G,native:d});b.useEffect(()=>{!N&&M.type===void 0&&(R.context.allowMouseUpTriggerRef.current=!1)},[R,N,M.type]);const ee=b.useRef(null),$=Hn(),ae=Be(Ue=>{if(!ee.current)return;$.clear(),R.context.allowMouseUpTriggerRef.current=!1;const xe=Ue.target;st(ee.current,xe)||st(R.select("positionerElement"),xe)||xe===ee.current||xe!=null&&Vb(xe)===R.select("rootId")||vA(Ue,ee.current)||K.events.emit("close",{domEvent:Ue,reason:_v})});b.useEffect(()=>{const Ue=qt(ee.current);if(N&&R.select("lastOpenChangeReason")===qn)return Ue.addEventListener("mouseup",ae,{once:!0}),()=>{Ue.removeEventListener("mouseup",ae)}},[N,ae,R]);const I=_&&M.context.hasSubmenuOpen,Z=nb(A,{enabled:(g??I)&&!G&&(!_||I&&!U),handleClose:rb({blockPointerEvents:!_}),mouseOnly:!0,move:!1,restMs:M.type===void 0?m:void 0,delay:{close:h},triggerElementRef:D,externalTree:K,isActiveTrigger:T,isClosing:()=>R.select("transitionStatus")==="ending"}),ne=pH(N,R.select("lastOpenChangeReason")),ye=Fp(A,{enabled:!G,event:N&&_?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:M.type===void 0?ne:!1}),se=oT(A,{enabled:!G&&I}),ge=fH({open:N,enabled:_,mouseDownAction:"open"}),fe=b.useMemo(()=>Ir(se.reference,ye.reference),[se.reference,ye.reference]),ce=R.useState("triggerProps",U),Re=R.useState("filterTriggerProps"),{handlePreFocusGuardFocus:be,handleFocusTargetFocus:Le}=qk(R,D),Oe={disabled:G,open:N},ze=[ee,s,Y,H,D],Ve=[fe,Z??Xt,ce,{"aria-haspopup":"menu","aria-controls":j,id:O,onMouseDown:Ue=>{if(R.select("open"))return;$.start(200,()=>{R.context.allowMouseUpTriggerRef.current=!0}),qt(Ue.currentTarget).addEventListener("mouseup",ae,{once:!0})}},Re,_?{role:"menuitem"}:{},ge,w,q],ke=bt("button",t,{enabled:!_,stateAttributesMapping:Vu,state:Oe,ref:ze,props:Ve});return _?y.jsx(Bb,{tag:"button",render:i,className:o,style:l,state:Oe,refs:ze,props:Ve,stateAttributesMapping:Vu}):N?y.jsxs(b.Fragment,{children:[y.jsx(Va,{ref:R.context.beforeTriggerFocusGuardRef,onFocus:be},`${O}-pre-focus-guard`),y.jsx(b.Fragment,{children:ke},O),y.jsx(Va,{ref:R.context.triggerFocusTargetRef,onFocus:Le},`${O}-post-focus-guard`)]}):y.jsx(b.Fragment,{children:ke},O)});function pH(e,t){const s=Hn(),[i,o]=b.useState(!1);return Pe(()=>{e&&t===qn?(o(!0),s.start(VC,()=>{o(!1)})):e||(s.clear(),o(!1))},[e,t,s]),i}function gH(){const e=gA();return b.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}const mH=b.forwardRef(function(t,s){const{className:i,render:o,orientation:l="horizontal",style:u,...d}=t;return bt("div",t,{state:{orientation:l},ref:s,props:[{role:"separator","aria-orientation":l},d]})});function xA(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function fp(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function yH(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}function SA(e){return yH(e?.[0])}function vH(e){return SA(e)?e.flatMap(t=>t.items):e}function bH(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(SA(t)){for(const s of t)for(const i of s.items)if(i&&i.value==null&&i.label!=null)return!0;return!1}for(const s of t)if(s&&s.value==null&&s.label!=null)return!0;return!1}function wA(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 fp(e)}function ql(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?fp(e.value):fp(e)}function EA(e,t,s){function i(){return wA(e,s)}if(s&&e!=null)return s(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)??i();if(Array.isArray(t)){const l=vH(t);if(e==null||typeof e!="object"){const u=l.find(d=>d.value===e);return u&&u.label!=null?u.label:i()}if("value"in e){const u=l.find(d=>d&&d.value===e.value);if(u&&u.label!=null)return u.label}}return i()}function xH(e,t,s){return e.reduce((i,o,l)=>(l>0&&i.push(", "),i.push(y.jsx(b.Fragment,{children:EA(o,t,s)},l)),i),[])}function Wa({...e}){return y.jsx(yA,{"data-slot":"dropdown-menu",...e})}function eo({...e}){return y.jsx(hH,{"data-slot":"dropdown-menu-trigger",...e})}function to({align:e="start",alignOffset:t=0,side:s="bottom",sideOffset:i=4,className:o,...l}){return y.jsx(uA,{children:y.jsx(fA,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:s,sideOffset:i,children:y.jsx(lA,{"data-slot":"dropdown-menu-content",className:He("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),...l})})})}function RA({...e}){return y.jsx(jU,{"data-slot":"dropdown-menu-group",...e})}function CA({className:e,inset:t,...s}){return y.jsx(IU,{"data-slot":"dropdown-menu-label","data-inset":t,className:He("px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5",e),...s})}function $a({className:e,inset:t,variant:s="default",...i}){return y.jsx(oA,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":s,className:He("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),...i})}function SH({...e}){return y.jsx(JU,{"data-slot":"dropdown-menu-radio-group",...e})}function wH({className:e,children:t,inset:s,...i}){return y.jsxs(tH,{"data-slot":"dropdown-menu-radio-item","data-inset":s,className:He("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),...i,children:[y.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:y.jsx(nH,{children:y.jsx(pd,{})})}),t]})}function Kb(e){return bt(e.defaultTagName??"div",e,e)}const EH="data-valid",RH="data-invalid",CH={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},TH={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},kH={disabled:!1,...TH},bc={valid(e){return e===null?null:e?{[EH]:""}:{[RH]:""}}},OH={invalid:void 0,name:void 0,validityData:{state:CH,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:kH,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(OH);function ia(e=!0){const t=b.useContext(AH);if(t.setValidityData===En&&!e)throw new Error(cn(28));return t}const MH=b.createContext(void 0);function NH(e=!1){const t=b.useContext(MH);if(!t&&!e)throw new Error(cn(86));return t}const DH=b.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:En,validationMode:"onSubmit",submitCountRef:{current:0}});function Cd(){return b.useContext(DH)}const jH=b.createContext({controlId:void 0,registerControlId:En,resetControlId:En,labelId:void 0,setLabelId:En,messageIds:[],setMessageIds:En,getDescriptionProps:e=>e});function Zo(){return b.useContext(jH)}function qb(e,t,s,i=!0,o,l){const[u,d]=b.useState(),f=Qn(o?`${o}-label`:void 0),g=!!l?.trim(),h=e??(g?void 0:t)??u;return Pe(()=>{const x=e||t||g||!i?void 0:IH(s.current,f);u!==x&&d(x)}),h}function IH(e,t){const s=PH(e);if(s)return!s.id&&t&&(s.id=t),s.id||void 0}function PH(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const s=e.id;if(s){const o=e.nextElementSibling;if(o&&o.htmlFor===s)return o}const i=e.labels;return i&&i[0]}function xc(e={}){const{id:t,enabled:s=!0}=e,{controlId:i,registerControlId:o,resetControlId:l}=Zo(),u=Qn(),d=rr(()=>Symbol()),f=b.useRef(!1),g=b.useRef(!1),m=Be(()=>{!f.current||o===En||(f.current=!1,o(d.current,void 0))});return Pe(()=>{if(!s||o===En){m();return}let h;if(t!==void 0)g.current=!0,h=t;else if(g.current)h=u;else{l();return}if(h===void 0){m();return}f.current=!0,o(d.current,h)},[t,s,o,l,u,d,m]),Pe(()=>m,[m]),(s?i:void 0)??t??u}function LH(e,t){return e.matches(":disabled")?!1:!t||e.form===t?!0:e.form===null&&!e.hasAttribute("form")}const zH=b.createContext({disabled:!1});function TA(){return b.useContext(zH)}function Td(e,t,s){const{setFocused:i,focusOwnerRef:o}=ia(),l=Be(u=>{(u?!e:o.current===l)&&(o.current=u&&l,i(u))});return Pe(()=>{const u=t.current;return u?.getRootNode()?.activeElement===u&&l(!0),()=>l(!1)},[e,t,l]),l}function kd(e,t,s,i,o=!0,l){const{registerFieldControl:u}=ia(),d=rr(()=>Symbol());Pe(()=>{const f=d.current;if(!o){u(f,void 0);return}u(f,{controlRef:e,getValue:i,id:t,name:l,value:s})},[e,o,i,t,l,u,d,s]),Pe(()=>{const f=d.current;return()=>{u(f,void 0)}},[u,d])}const _H=b.forwardRef(function(t,s){const{render:i,className:o,id:l,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:O,validityData:T,setFilled:A,validationMode:N,validation:j}=ia(),{clearErrors:D,elementRef:M,submitCountRef:z}=Cd(),L=E||f,K=C??u,X={...w,disabled:L},{labelId:B}=Zo(),H=xc({id:l}),U=d!==void 0,_=d==null?void 0:String(d),Q=Be(()=>j.inputRef.current?.value);kd(j.inputRef,H,_,Q,!L,u),Pe(()=>{const $=_??j.inputRef.current?.value;$!==void 0&&A($!=="")},[_,m,j.inputRef,A]),mc(_,()=>{_!==void 0&&(D(K),O(_!==(T.initialValue??"")),j.change(_))});const G=b.useRef(null),q=Td(L,G),Y=Hn();return bt("input",t,{ref:[s,G],state:X,props:[{id:H,disabled:L,name:K,ref:j.inputRef,"aria-labelledby":B,autoFocus:h,...U?{value:d}:{defaultValue:m},onChange($){const ae=$.currentTarget.value,I=lt(kr,$.nativeEvent);g?.(ae,I),!U&&(O(ae!==(T.initialValue??"")),A(ae!==""),!$.nativeEvent.defaultPrevented&&!I.isCanceled&&(D(K),j.change(ae)))},onFocus(){q(!0)},onBlur($){if(R(!0),q(!1),N==="onBlur"){const ae=$.currentTarget.value;j.commit(ae),U&&queueMicrotask(()=>{const I=j.inputRef.current?.value;I!==void 0&&I!==ae&&I!==(T.initialValue??"")&&j.commit(I)})}},onKeyDown($){if($.currentTarget.tagName==="INPUT"&&$.key==="Enter"){R(!0);const ae=$.currentTarget.value,I=$.currentTarget.form;if(I&&I===M.current&&!$.defaultPrevented){const F=$.currentTarget,Z=z.current;Y.start(0,()=>{z.current===Z&&j.commit(F.value)})}else j.commit(ae)}}},S,$=>j.getValidationProps(L,$)],stateAttributesMapping:bc})}),UH=b.forwardRef(function(t,s){return y.jsx(_H,{ref:s,...t})});function Od({className:e,type:t,...s}){return y.jsx(UH,{type:t,"data-slot":"input",className:He("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),...s})}function kA({className:e,orientation:t="horizontal",...s}){return y.jsx(mH,{"data-slot":"separator",orientation:t,className:He("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...s})}const OA=b.createContext(void 0);function no(e){const t=b.useContext(OA);if(!e&&t===void 0)throw new Error(cn(27));return t}const AA=b.forwardRef(function(t,s){const{render:i,className:o,style:l,forceRender:u=!1,...d}=t,f=no(),g=f.useState("open"),m=f.useState("nested"),h=f.useState("mounted"),x=f.useState("transitionStatus");return bt("div",t,{state:{open:g,transitionStatus:x},ref:[f.context.backdropRef,s],stateAttributesMapping:jp,props:[{role:"presentation",hidden:!h,style:{userSelect:"none",WebkitUserSelect:"none"}},d],enabled:u||!m})}),Rg=b.forwardRef(function(t,s){const{render:i,className:o,style:l,disabled:u=!1,nativeButton:d=!0,...f}=t,g=no(),m=g.useState("open"),{getButtonProps:h,buttonRef:x}=ns({disabled:u,native:d}),S={disabled:u};function w(C){m&&g.setOpen(!1,lt(mC,C.nativeEvent))}return bt("button",t,{state:S,ref:[s,x],props:[{onClick:w},f,h]})}),MA=b.forwardRef(function(t,s){const{render:i,className:o,style:l,id:u,...d}=t,f=no(),g=Qn(u);return f.useSyncedValueWithCleanup("descriptionElementId",g),bt("p",t,{ref:s,props:[{id:g},d]})}),NA=b.createContext(void 0);function HH(){const e=b.useContext(NA);if(e===void 0)throw new Error(cn(26));return e}const FH="--nested-dialogs",BH="data-nested-dialog-open",VH={...sd,...ni,nestedDialogOpen(e){return e?{[BH]:""}:null}},DA=b.forwardRef(function(t,s){const{render:i,className:o,style:l,finalFocus:u,initialFocus:d,...f}=t,g=no(),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"),O=g.useState("open"),T=g.useState("openMethod"),A=g.useState("titleElementId"),N=g.useState("transitionStatus"),j=g.useState("role"),D=x.useState("floatingId");HH(),bs({open:O,ref:g.context.popupRef,onComplete(){O&&g.context.onOpenChangeComplete?.(!0)}});const M=d===void 0?tT(g.context.popupRef):d,z=R>0,L=g.useStateSetter("popupElement"),X=bt("div",t,{state:{open:O,nested:E,transitionStatus:N,nestedDialogOpen:z},props:[S,{id:D,"aria-labelledby":A,"aria-describedby":m,role:j,...ud,hidden:!C,onKeyDown(B){yd.has(B.key)&&B.stopPropagation()},style:{[FH]:R}},f],ref:[s,g.context.popupRef,L],stateAttributesMapping:VH});return y.jsx(Hp,{context:x,openInteractionType:T,disabled:!C,closeOnFocusOut:!h,initialFocus:M,returnFocus:u,modal:w!==!1,restoreFocus:"popup",children:X})}),jA=b.forwardRef(function(t,s){const{keepMounted:i=!1,...o}=t,l=no(),u=l.useState("mounted"),d=l.useState("modal"),f=l.useState("open");return u||i?y.jsx(NA.Provider,{value:i,children:y.jsxs(Up,{ref:s,...o,children:[u&&d===!0&&y.jsx(cg,{ref:l.context.internalBackdropRef,inert:hd(!f)}),t.children]})}):null});function KH({store:e,parentContext:t,isDrawer:s}){const i=e.useState("open"),o=e.useState("mounted"),l=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=cd(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=sr(C);if(S&&!l){if(u){const R=e.context.internalBackdropRef.current,O=e.context.backdropRef.current;return R||O?R===E||O===E||st(E,d)&&!E?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:S});return Xk(i&&u===!0,d),e.useContextCallback("onNestedDialogOpen",(C,E)=>{!e.select("open")&&!e.select("mounted")||(m(C),x(E))}),Pe(()=>{!i&&!o&&(m(0),x(0))},[i,o]),Pe(()=>(t?.onNestedDialogOpen&&i&&t.onNestedDialogOpen(g+1,h+(s?1:0)),()=>{t?.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[s,i,g,h,t]),Qp(e,{activeTriggerProps:w.reference,inactiveTriggerProps:w.trigger,popupProps:w.floating,nestedOpenDialogCount:g,nestedOpenDrawerCount:h}),null}const qH={...Gi,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 YH extends pc{constructor(t,s,i){const o=new dd,l=$H(t,o,s,i);super(l,GH(o),qH)}setOpen=(t,s)=>{s.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&s.trigger==null&&this.state.activeTriggerId!=null&&(s.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,s),!s.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(t,s),this.update(Kp(this.state,t,s.trigger)))}}function $H(e,t,s,i=!1){return{...Zp(t,s,i),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function GH(e){return{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function QH(e,t){const{children:s,open:i,defaultOpen:o=!1,onOpenChange:l,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=no(!0),O=R!=null,T={modal:w,disablePointerDismissal:C,nested:O,role:E},A=Jv((L,K)=>new YH({open:o,openProp:i,activeTriggerId:x,triggerIdProp:h,...T},L,K),!0);A.useControlledProp("openProp",i),A.useControlledProp("triggerIdProp",h),A.useSyncedValues(T),A.useContextCallback("onOpenChange",l),A.useContextCallback("onOpenChangeComplete",u);const N=A.useState("open"),j=A.useState("mounted"),D=A.useState("payload");nT(A,N),$p(A);const{forceUnmount:M}=Gp(N,A);b.useImperativeHandle(g,()=>({unmount:M,close:()=>A.setOpen(!1,lt(od))}),[M,A]);const z=N||j||m!=null;return y.jsxs(OA.Provider,{value:A,children:[m&&y.jsx(Vp,{handle:m,store:A}),z&&y.jsx(KH,{store:A,parentContext:R?.context,isDrawer:S}),typeof s=="function"?s({payload:D}):s]})}const IA=td(function(t){return QH("dialog",t)}),PA=b.forwardRef(function(t,s){const{render:i,className:o,style:l,id:u,...d}=t,f=no(),g=Qn(u);return f.useSyncedValueWithCleanup("titleElementId",g),bt("h2",t,{ref:s,props:[{id:g},d]})}),XH=Rp(function(t,s){const{render:i,className:o,style:l,disabled:u=!1,nativeButton:d=!0,id:f,payload:g,handle:m,...h}=t,x=no(!0),w=Jp(m)??x;if(!w)throw new Error(cn(79));const C=Qn(f),E=w.useState("floatingRootContext"),R=w.useState("isOpenedByTrigger",C),O=w.useState("triggerPopupId",C),T=b.useRef(null),{registerTrigger:A,isMountedByThisTrigger:N}=Yp(C,T,w,{payload:g}),{getButtonProps:j,buttonRef:D}=ns({disabled:u,native:d}),M=Fp(E),z=gb(()=>w.select("open"),X=>{w.set("openMethod",X)}),L={disabled:u,open:R},K=w.useState("triggerProps",N);return bt("button",t,{state:L,ref:[D,s,A,T],props:[M.reference,K,z,{[$v]:"",id:C,"aria-haspopup":"dialog","aria-expanded":R,"aria-controls":O},h,j],stateAttributesMapping:Dp})});function Yb({...e}){return y.jsx(IA,{"data-slot":"sheet",...e})}function LA({...e}){return y.jsx(XH,{"data-slot":"sheet-trigger",...e})}function ZH({...e}){return y.jsx(jA,{"data-slot":"sheet-portal",...e})}function JH({className:e,...t}){return y.jsx(AA,{"data-slot":"sheet-overlay",className:He("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 $b({className:e,children:t,side:s="right",showCloseButton:i=!0,...o}){const{t:l}=ht();return y.jsxs(ZH,{children:[y.jsx(JH,{}),y.jsxs(DA,{"data-slot":"sheet-content","data-side":s,className:He("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,i&&y.jsxs(Rg,{"data-slot":"sheet-close",render:y.jsx(Ze,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[y.jsx(ra,{}),y.jsx("span",{className:"sr-only",children:l("a11y.close")})]})]})]})}function zA({className:e,...t}){return y.jsx("div",{"data-slot":"sheet-header",className:He("flex flex-col gap-1.5 p-6",e),...t})}function Gb({className:e,...t}){return y.jsx(PA,{"data-slot":"sheet-title",className:He("font-heading text-sm font-medium text-foreground",e),...t})}function WH({className:e,...t}){return y.jsx(MA,{"data-slot":"sheet-description",className:He("text-xs/relaxed text-muted-foreground",e),...t})}function Gn({className:e,...t}){return y.jsx("div",{"data-slot":"skeleton",className:He("animate-pulse rounded-md bg-muted",e),...t})}const eF="sidebar_state",tF=3600*24*7,nF="16rem",rF="18rem",sF="3rem",iF="b",_A=b.createContext(null);function Sc(){const e=b.useContext(_A);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function aF({defaultOpen:e=!0,open:t,onOpenChange:s,className:i,style:o,children:l,...u}){const d=Tb(),[f,g]=b.useState(!1),[m,h]=b.useState(e),x=t??m,S=b.useCallback(R=>{const O=typeof R=="function"?R(x):R;s?s(O):h(O),document.cookie=`${eF}=${O}; path=/; max-age=${tF}`},[s,x]),w=b.useCallback(()=>d?g(R=>!R):S(R=>!R),[d,S,g]);b.useEffect(()=>{const R=O=>{O.key===iF&&(O.metaKey||O.ctrlKey)&&(O.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 y.jsx(_A.Provider,{value:E,children:y.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":nF,"--sidebar-width-icon":sF,...o},className:He("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",i),...u,children:l})})}function oF({side:e="left",variant:t="sidebar",collapsible:s="offcanvas",className:i,children:o,dir:l,...u}){const{t:d}=ht(),{isMobile:f,state:g,openMobile:m,setOpenMobile:h}=Sc();return s==="none"?y.jsx("div",{"data-slot":"sidebar",className:He("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",i),...u,children:o}):f?y.jsx(Yb,{open:m,onOpenChange:h,...u,children:y.jsxs($b,{dir:l,"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":rF},side:e,children:[y.jsxs(zA,{className:"sr-only",children:[y.jsx(Gb,{children:d("a11y.sidebar")}),y.jsx(WH,{children:d("a11y.sidebarDescription")})]}),y.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):y.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":g,"data-collapsible":g==="collapsed"?s:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[y.jsx("div",{"data-slot":"sidebar-gap",className:He("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)")}),y.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:He("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",i),...u,children:y.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 lF({className:e,onClick:t,...s}){const{t:i}=ht(),{toggleSidebar:o}=Sc();return y.jsxs(Ze,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:He(e),onClick:l=>{t?.(l),o()},...s,children:[y.jsx(qL,{}),y.jsx("span",{className:"sr-only",children:i("a11y.toggleSidebar")})]})}function cF({className:e,...t}){const{t:s}=ht(),{toggleSidebar:i}=Sc();return y.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":s("a11y.toggleSidebar"),tabIndex:-1,onClick:i,title:s("a11y.toggleSidebar"),className:He("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 uF({className:e,...t}){return y.jsx("main",{"data-slot":"sidebar-inset",className:He("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 dF({className:e,...t}){return y.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:He("flex flex-col gap-2 p-2",e),...t})}function fF({className:e,...t}){return y.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:He("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function hF({className:e,...t}){return y.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:He("relative flex w-full min-w-0 flex-col px-2 py-1",e),...t})}function UA({className:e,...t}){return y.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:He("flex w-full min-w-0 flex-col gap-px",e),...t})}function Bh({className:e,...t}){return y.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:He("group/menu-item relative",e),...t})}const pF=$o("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 Vh({render:e,isActive:t=!1,variant:s="default",size:i="default",tooltip:o,className:l,...u}){const{isMobile:d,state:f}=Sc(),g=Kb({defaultTagName:"button",props:Ir({className:He(pF({variant:s,size:i}),l)},u),render:o?y.jsx(ap,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:i,active:t}});return o?(typeof o=="string"&&(o={children:o}),y.jsxs(ip,{children:[g,y.jsx(op,{side:"right",align:"center",hidden:f!=="collapsed"||d,...o})]})):g}function gF({className:e,...t}){return y.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:He("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 mF({className:e,...t}){return y.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:He("group/menu-sub-item relative",e),...t})}function yF({render:e,size:t="md",isActive:s=!1,className:i,...o}){return Kb({defaultTagName:"a",props:Ir({className:He("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",i)},o),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:s}})}function vF({items:e}){const{t}=ht(),{pathname:s}=gr(),{isMobile:i,state:o}=Sc(),l=o==="collapsed"&&!i,u=d=>s===d||s.startsWith(`${d}/`);return y.jsx(hF,{children:y.jsx(UA,{children:e.map(d=>{const f=d.icon,g=d.items?.some(m=>u(m.url))??!1;return d.items?l?y.jsx(Bh,{children:y.jsxs(Wa,{children:[y.jsxs(eo,{render:y.jsx(Vh,{tooltip:t(d.titleKey),isActive:g}),children:[y.jsx(f,{}),y.jsx("span",{children:t(d.titleKey)})]}),y.jsx(to,{className:"w-40",side:"right",align:"start",sideOffset:4,children:y.jsxs(RA,{children:[y.jsx(CA,{children:t(d.titleKey)}),d.items.map(m=>y.jsx($a,{className:"cursor-pointer",render:y.jsx(Lu,{to:m.url}),children:y.jsx("span",{children:t(m.titleKey)})},m.titleKey))]})})]})},d.titleKey):y.jsxs(xU,{defaultOpen:g,className:"group/collapsible",render:y.jsx(Bh,{}),children:[y.jsxs(SU,{render:y.jsx(Vh,{tooltip:t(d.titleKey),isActive:g}),children:[y.jsx(f,{}),y.jsx("span",{children:t(d.titleKey)}),y.jsx(ob,{className:`
|
|
50
|
-
ml-auto transition-transform duration-200
|
|
51
|
-
group-data-open/collapsible:rotate-90
|
|
52
|
-
`})]}),y.jsx(wU,{children:y.jsx(gF,{children:d.items.map(m=>y.jsx(mF,{children:y.jsx(yF,{isActive:u(m.url),render:y.jsx(Lu,{to:m.url}),children:y.jsx("span",{children:t(m.titleKey)})})},m.titleKey))})})]},`${d.titleKey}-${g?"active":"inactive"}`):y.jsx(Bh,{children:y.jsxs(Vh,{tooltip:t(d.titleKey),isActive:s===d.url,render:y.jsx(Lu,{to:d.url??"/dashboard"}),children:[y.jsx(f,{}),y.jsx("span",{children:t(d.titleKey)})]})},d.titleKey)})})})}const Qb=[{titleKey:"nav.dashboard",url:"/dashboard",icon:_L},{titleKey:"nav.library",icon:UL,items:[{titleKey:"nav.instructions",url:"/library/instructions"},{titleKey:"nav.skills",url:"/library/skills"}]},{titleKey:"nav.models",icon:ib,items:[{titleKey:"nav.genesis",url:"/models/genesis"},{titleKey:"nav.explorer",url:"/models/explorer"},{titleKey:"nav.quantum",url:"/models/quantum"}]}],bF=new Map([["/settings","nav.settings"],...Qb.flatMap(e=>[...e.url?[[e.url,e.titleKey]]:[],...e.items?.map(t=>[t.url,t.titleKey])??[]])]);function HA(e){return e.startsWith("/library/skills/")?"nav.skills":bF.get(e)??"nav.dashboard"}const xF=Qb.flatMap(e=>[...e.url?[e.url]:[],...e.items?.map(t=>t.url)??[]]),SF=xF;function wF({...e}){const{t}=ht(),s=gr(),{pathname:i}=s,{isMobile:o,setOpenMobile:l}=Sc();return b.useEffect(()=>{o&&l(!1)},[o,i,l]),y.jsxs(oF,{collapsible:"icon",...e,children:[y.jsx(fF,{children:y.jsx(vF,{items:Qb})}),y.jsx(dF,{children:y.jsx(UA,{children:y.jsx(Bh,{children:y.jsxs(Vh,{tooltip:t("nav.settings"),render:y.jsx(Lu,{to:"/settings",state:{backTo:Cr(s)}}),children:[y.jsx($L,{}),y.jsx("span",{children:t("nav.settings")})]})})})}),y.jsx(cF,{})]})}function EF({className:e,...t}){return y.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:He(e),...t})}function RF({className:e,...t}){return y.jsx("ol",{"data-slot":"breadcrumb-list",className:He("flex flex-wrap items-center gap-1.5 text-xs/relaxed wrap-break-word text-muted-foreground",e),...t})}function CF({className:e,...t}){return y.jsx("li",{"data-slot":"breadcrumb-item",className:He("inline-flex items-center gap-1",e),...t})}function TF({className:e,render:t,...s}){return Kb({defaultTagName:"a",props:Ir({className:He("transition-colors hover:text-foreground",e)},s),render:t,state:{slot:"breadcrumb-link"}})}function kF({className:e,...t}){return y.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:He("font-normal text-foreground",e),...t})}function OF({children:e,className:t,...s}){return y.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:He("[&>svg]:size-3.5",t),...s,children:e??y.jsx(ob,{})})}function AF({items:e}){const{t}=ht();return y.jsx(EF,{"aria-label":t("a11y.breadcrumb"),className:"min-w-0",children:y.jsx(RF,{className:"flex-nowrap text-sm font-medium text-foreground",children:e.map((s,i)=>y.jsxs(b.Fragment,{children:[i>0&&y.jsx(OF,{}),y.jsx(CF,{className:s.to?"shrink-0":"min-w-0",children:s.to?y.jsx(TF,{render:y.jsx(vc,{to:s.to}),className:"truncate",title:s.label,children:s.label}):y.jsx(kF,{className:"truncate font-medium",title:s.label,children:s.label})})]},s.to??s.label))})})}const Cg=b.createContext(null);Cg.displayName="PageHeaderActionsContext";function MF({children:e}){const[t,s]=b.useState(null);return y.jsx(Cg,{value:{container:t,setContainer:s},children:e})}function NF(){const e=b.use(Cg);if(!e)throw new Error("PageHeaderActionsSlot must be used within PageHeaderActionsProvider");const t=e.setContainer,s=b.useCallback(i=>{t(i)},[t]);return y.jsx("div",{ref:s,className:"ml-auto flex shrink-0 items-center gap-2 px-4"})}function FA({children:e}){const t=b.use(Cg);return t?.container?hr.createPortal(e,t.container):null}function DF(){const{t:e}=ht(),{pathname:t}=gr(),s=H6("/library/skills/:name");return y.jsx(MF,{children:y.jsxs(aF,{className:"h-svh pb-6",children:[y.jsx(wF,{className:"pb-6"}),y.jsxs(uF,{className:s?"h-full min-w-0 overflow-hidden":"min-w-0",children:[y.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:[y.jsxs("div",{className:"flex min-w-0 items-center gap-2 px-4",children:[y.jsx(lF,{size:"icon",className:"-ml-1"}),y.jsx(kA,{orientation:"vertical",className:`
|
|
57
|
-
mr-2
|
|
58
|
-
data-vertical:h-4 data-vertical:self-auto
|
|
59
|
-
`}),y.jsx(AF,{items:s?[{label:e("nav.skills"),to:"/library/skills"},{label:s.params.name??""}]:[{label:e(HA(t))}]})]}),y.jsx(NF,{})]}),y.jsx(zb,{})]})]})})}function jF(){const{t:e}=ht(),{pathname:t,state:s}=gr(),i=Xo(),o=IF(s)?s.backTo:"/dashboard",l=()=>{i(o)};return y.jsxs("div",{"data-slot":"full-screen-layout",className:"flex h-dvh flex-col overflow-hidden bg-background pb-6",children:[y.jsx("header",{className:`
|
|
60
|
-
flex h-16 shrink-0 items-center gap-2 transition-[width,height]
|
|
61
|
-
ease-linear
|
|
62
|
-
`,children:y.jsxs("div",{className:"flex items-center gap-2 px-4",children:[y.jsxs(Ze,{variant:"ghost",size:"icon",className:"-ml-1",onClick:l,children:[y.jsx(kL,{}),y.jsx("span",{className:"sr-only",children:e("a11y.goBack")})]}),y.jsx(kA,{orientation:"vertical",className:`
|
|
63
|
-
mr-2
|
|
64
|
-
data-vertical:h-4 data-vertical:self-auto
|
|
65
|
-
`}),y.jsx("span",{className:"text-sm font-medium",children:e(HA(t))})]})}),y.jsx("main",{className:"min-h-0 flex-1 overflow-hidden",children:y.jsx(zb,{})})]})}function IF(e){return typeof e=="object"&&e!==null&&"backTo"in e&&typeof e.backTo=="string"&&e.backTo.length>0}function PF(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return b.useMemo(()=>i=>{t.forEach(o=>o(i))},t)}const Tg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function wc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Xb(e){return"nodeType"in e}function qr(e){var t,s;return e?wc(e)?e:Xb(e)&&(t=(s=e.ownerDocument)==null?void 0:s.defaultView)!=null?t:window:window}function Zb(e){const{Document:t}=qr(e);return e instanceof t}function Ad(e){return wc(e)?!1:e instanceof qr(e).HTMLElement}function BA(e){return e instanceof qr(e).SVGElement}function Ec(e){return e?wc(e)?e.document:Xb(e)?Zb(e)?e:Ad(e)||BA(e)?e.ownerDocument:document:document:document}const Js=Tg?b.useLayoutEffect:b.useEffect;function kg(e){const t=b.useRef(e);return Js(()=>{t.current=e}),b.useCallback(function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];return t.current==null?void 0:t.current(...i)},[])}function LF(){const e=b.useRef(null),t=b.useCallback((i,o)=>{e.current=setInterval(i,o)},[]),s=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,s]}function Xu(e,t){t===void 0&&(t=[e]);const s=b.useRef(e);return Js(()=>{s.current!==e&&(s.current=e)},t),s}function Md(e,t){const s=b.useRef();return b.useMemo(()=>{const i=e(s.current);return s.current=i,i},[...t])}function hp(e){const t=kg(e),s=b.useRef(null),i=b.useCallback(o=>{o!==s.current&&t?.(o,s.current),s.current=o},[]);return[s,i]}function pp(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let Oy={};function Nd(e,t){return b.useMemo(()=>{if(t)return t;const s=Oy[e]==null?0:Oy[e]+1;return Oy[e]=s,e+"-"+s},[e,t])}function VA(e){return function(t){for(var s=arguments.length,i=new Array(s>1?s-1:0),o=1;o<s;o++)i[o-1]=arguments[o];return i.reduce((l,u)=>{const d=Object.entries(u);for(const[f,g]of d){const m=l[f];m!=null&&(l[f]=m+e*g)}return l},{...t})}}const rc=VA(1),Zu=VA(-1);function zF(e){return"clientX"in e&&"clientY"in e}function Og(e){if(!e)return!1;const{KeyboardEvent:t}=qr(e.target);return t&&e instanceof t}function _F(e){if(!e)return!1;const{TouchEvent:t}=qr(e.target);return t&&e instanceof t}function gp(e){if(_F(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:s}=e.touches[0];return{x:t,y:s}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:s}=e.changedTouches[0];return{x:t,y:s}}}return zF(e)?{x:e.clientX,y:e.clientY}:null}const Ga=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:s}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(s?Math.round(s):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:s}=e;return"scaleX("+t+") scaleY("+s+")"}},Transform:{toString(e){if(e)return[Ga.Translate.toString(e),Ga.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:s,easing:i}=e;return t+" "+s+"ms "+i}}}),PR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function UF(e){return e.matches(PR)?e:e.querySelector(PR)}const HF={display:"none"};function FF(e){let{id:t,value:s}=e;return Ne.createElement("div",{id:t,style:HF},s)}function BF(e){let{id:t,announcement:s,ariaLiveType:i="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":i,"aria-atomic":!0},s)}function VF(){const[e,t]=b.useState("");return{announce:b.useCallback(i=>{i!=null&&t(i)},[]),announcement:e}}const KA=b.createContext(null);function KF(e){const t=b.useContext(KA);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function qF(){const[e]=b.useState(()=>new Set),t=b.useCallback(i=>(e.add(i),()=>e.delete(i)),[e]);return[b.useCallback(i=>{let{type:o,event:l}=i;e.forEach(u=>{var d;return(d=u[o])==null?void 0:d.call(u,l)})},[e]),t]}const YF={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
|
-
`},$F={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:s}=e;return s?"Draggable item "+t.id+" was moved over droppable area "+s.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:s}=e;return s?"Draggable item "+t.id+" was dropped over droppable area "+s.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function GF(e){let{announcements:t=$F,container:s,hiddenTextDescribedById:i,screenReaderInstructions:o=YF}=e;const{announce:l,announcement:u}=VF(),d=Nd("DndLiveRegion"),[f,g]=b.useState(!1);if(b.useEffect(()=>{g(!0)},[]),KF(b.useMemo(()=>({onDragStart(h){let{active:x}=h;l(t.onDragStart({active:x}))},onDragMove(h){let{active:x,over:S}=h;t.onDragMove&&l(t.onDragMove({active:x,over:S}))},onDragOver(h){let{active:x,over:S}=h;l(t.onDragOver({active:x,over:S}))},onDragEnd(h){let{active:x,over:S}=h;l(t.onDragEnd({active:x,over:S}))},onDragCancel(h){let{active:x,over:S}=h;l(t.onDragCancel({active:x,over:S}))}}),[l,t])),!f)return null;const m=Ne.createElement(Ne.Fragment,null,Ne.createElement(FF,{id:i,value:o.draggable}),Ne.createElement(BF,{id:d,announcement:u}));return s?hr.createPortal(m,s):m}var or;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(or||(or={}));function mp(){}function Ay(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function QF(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return b.useMemo(()=>[...t].filter(i=>i!=null),[...t])}const Ws=Object.freeze({x:0,y:0});function Jb(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function XF(e,t){const s=gp(e);if(!s)return"0 0";const i={x:(s.x-t.left)/t.width*100,y:(s.y-t.top)/t.height*100};return i.x+"% "+i.y+"%"}function Wb(e,t){let{data:{value:s}}=e,{data:{value:i}}=t;return s-i}function ZF(e,t){let{data:{value:s}}=e,{data:{value:i}}=t;return i-s}function mv(e){let{left:t,top:s,height:i,width:o}=e;return[{x:t,y:s},{x:t+o,y:s},{x:t,y:s+i},{x:t+o,y:s+i}]}function qA(e,t){if(!e||e.length===0)return null;const[s]=e;return s[t]}function LR(e,t,s){return t===void 0&&(t=e.left),s===void 0&&(s=e.top),{x:t+e.width*.5,y:s+e.height*.5}}const JF=e=>{let{collisionRect:t,droppableRects:s,droppableContainers:i}=e;const o=LR(t,t.left,t.top),l=[];for(const u of i){const{id:d}=u,f=s.get(d);if(f){const g=Jb(LR(f),o);l.push({id:d,data:{droppableContainer:u,value:g}})}}return l.sort(Wb)},WF=e=>{let{collisionRect:t,droppableRects:s,droppableContainers:i}=e;const o=mv(t),l=[];for(const u of i){const{id:d}=u,f=s.get(d);if(f){const g=mv(f),m=o.reduce((x,S,w)=>x+Jb(g[w],S),0),h=Number((m/4).toFixed(4));l.push({id:d,data:{droppableContainer:u,value:h}})}}return l.sort(Wb)};function e7(e,t){const s=Math.max(t.top,e.top),i=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),u=o-i,d=l-s;if(i<o&&s<l){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 t7=e=>{let{collisionRect:t,droppableRects:s,droppableContainers:i}=e;const o=[];for(const l of i){const{id:u}=l,d=s.get(u);if(d){const f=e7(d,t);f>0&&o.push({id:u,data:{droppableContainer:l,value:f}})}}return o.sort(ZF)};function n7(e,t){const{top:s,left:i,bottom:o,right:l}=t;return s<=e.y&&e.y<=o&&i<=e.x&&e.x<=l}const r7=e=>{let{droppableContainers:t,droppableRects:s,pointerCoordinates:i}=e;if(!i)return[];const o=[];for(const l of t){const{id:u}=l,d=s.get(u);if(d&&n7(i,d)){const g=mv(d).reduce((h,x)=>h+Jb(i,x),0),m=Number((g/4).toFixed(4));o.push({id:u,data:{droppableContainer:l,value:m}})}}return o.sort(Wb)};function s7(e,t,s){return{...e,scaleX:t&&s?t.width/s.width:1,scaleY:t&&s?t.height/s.height:1}}function YA(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ws}function i7(e){return function(s){for(var i=arguments.length,o=new Array(i>1?i-1:0),l=1;l<i;l++)o[l-1]=arguments[l];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}),{...s})}}const a7=i7(1);function $A(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 o7(e,t,s){const i=$A(t);if(!i)return e;const{scaleX:o,scaleY:l,x:u,y:d}=i,f=e.left-u-(1-o)*parseFloat(s),g=e.top-d-(1-l)*parseFloat(s.slice(s.indexOf(" ")+1)),m=o?e.width/o:e.width,h=l?e.height/l:e.height;return{width:m,height:h,top:g,right:f+m,bottom:g+h,left:f}}const l7={ignoreTransform:!1};function Rc(e,t){t===void 0&&(t=l7);let s=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:m}=qr(e).getComputedStyle(e);g&&(s=o7(s,g,m))}const{top:i,left:o,width:l,height:u,bottom:d,right:f}=s;return{top:i,left:o,width:l,height:u,bottom:d,right:f}}function zR(e){return Rc(e,{ignoreTransform:!0})}function c7(e){const t=e.innerWidth,s=e.innerHeight;return{top:0,left:0,right:t,bottom:s,width:t,height:s}}function u7(e,t){return t===void 0&&(t=qr(e).getComputedStyle(e)),t.position==="fixed"}function d7(e,t){t===void 0&&(t=qr(e).getComputedStyle(e));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const l=t[o];return typeof l=="string"?s.test(l):!1})}function Ag(e,t){const s=[];function i(o){if(t!=null&&s.length>=t||!o)return s;if(Zb(o)&&o.scrollingElement!=null&&!s.includes(o.scrollingElement))return s.push(o.scrollingElement),s;if(!Ad(o)||BA(o)||s.includes(o))return s;const l=qr(e).getComputedStyle(o);return o!==e&&d7(o,l)&&s.push(o),u7(o,l)?s:i(o.parentNode)}return e?i(e):s}function GA(e){const[t]=Ag(e,1);return t??null}function My(e){return!Tg||!e?null:wc(e)?e:Xb(e)?Zb(e)||e===Ec(e).scrollingElement?window:Ad(e)?e:null:null}function QA(e){return wc(e)?e.scrollX:e.scrollLeft}function XA(e){return wc(e)?e.scrollY:e.scrollTop}function yv(e){return{x:QA(e),y:XA(e)}}var fr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(fr||(fr={}));function ZA(e){return!Tg||!e?!1:e===document.scrollingElement}function JA(e){const t={x:0,y:0},s=ZA(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-s.width,y:e.scrollHeight-s.height},o=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,u=e.scrollTop>=i.y,d=e.scrollLeft>=i.x;return{isTop:o,isLeft:l,isBottom:u,isRight:d,maxScroll:i,minScroll:t}}const f7={x:.2,y:.2};function h7(e,t,s,i,o){let{top:l,left:u,right:d,bottom:f}=s;i===void 0&&(i=10),o===void 0&&(o=f7);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&&l<=t.top+C.height?(S.y=fr.Backward,w.y=i*Math.abs((t.top+C.height-l)/C.height)):!m&&f>=t.bottom-C.height&&(S.y=fr.Forward,w.y=i*Math.abs((t.bottom-C.height-f)/C.height)),!x&&d>=t.right-C.width?(S.x=fr.Forward,w.x=i*Math.abs((t.right-C.width-d)/C.width)):!h&&u<=t.left+C.width&&(S.x=fr.Backward,w.x=i*Math.abs((t.left+C.width-u)/C.width)),{direction:S,speed:w}}function p7(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:u}=window;return{top:0,left:0,right:l,bottom:u,width:l,height:u}}const{top:t,left:s,right:i,bottom:o}=e.getBoundingClientRect();return{top:t,left:s,right:i,bottom:o,width:e.clientWidth,height:e.clientHeight}}function WA(e){return e.reduce((t,s)=>rc(t,yv(s)),Ws)}function g7(e){return e.reduce((t,s)=>t+QA(s),0)}function m7(e){return e.reduce((t,s)=>t+XA(s),0)}function eM(e,t){if(t===void 0&&(t=Rc),!e)return;const{top:s,left:i,bottom:o,right:l}=t(e);GA(e)&&(o<=0||l<=0||s>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const y7=[["x",["left","right"],g7],["y",["top","bottom"],m7]];class ex{constructor(t,s){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 i=Ag(s),o=WA(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,u,d]of y7)for(const f of u)Object.defineProperty(this,f,{get:()=>{const g=d(i),m=o[l]-g;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class zu{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(s=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...s)})},this.target=t}add(t,s,i){var o;(o=this.target)==null||o.addEventListener(t,s,i),this.listeners.push([t,s,i])}}function v7(e){const{EventTarget:t}=qr(e);return e instanceof t?e:Ec(e)}function Ny(e,t){const s=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(s**2+i**2)>t:"x"in t&&"y"in t?s>t.x&&i>t.y:"x"in t?s>t.x:"y"in t?i>t.y:!1}var js;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(js||(js={}));function _R(e){e.preventDefault()}function b7(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 tM={start:[en.Space,en.Enter],cancel:[en.Esc],end:[en.Space,en.Enter,en.Tab]},x7=(e,t)=>{let{currentCoordinates:s}=t;switch(e.code){case en.Right:return{...s,x:s.x+25};case en.Left:return{...s,x:s.x-25};case en.Down:return{...s,y:s.y+25};case en.Up:return{...s,y:s.y-25}}};class tx{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:s}}=t;this.props=t,this.listeners=new zu(Ec(s)),this.windowListeners=new zu(qr(s)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(js.Resize,this.handleCancel),this.windowListeners.add(js.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(js.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:s}=this.props,i=t.node.current;i&&eM(i),s(Ws)}handleKeyDown(t){if(Og(t)){const{active:s,context:i,options:o}=this.props,{keyboardCodes:l=tM,coordinateGetter:u=x7,scrollBehavior:d="smooth"}=o,{code:f}=t;if(l.end.includes(f)){this.handleEnd(t);return}if(l.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:g}=i.current,m=g?{x:g.left,y:g.top}:Ws;this.referenceCoordinates||(this.referenceCoordinates=m);const h=u(t,{active:s,context:i.current,currentCoordinates:m});if(h){const x=Zu(h,m),S={x:0,y:0},{scrollableAncestors:w}=i.current;for(const C of w){const E=t.code,{isTop:R,isRight:O,isLeft:T,isBottom:A,maxScroll:N,minScroll:j}=JA(C),D=p7(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))},z=E===en.Right&&!O||E===en.Left&&!T,L=E===en.Down&&!A||E===en.Up&&!R;if(z&&M.x!==h.x){const K=C.scrollLeft+x.x,X=E===en.Right&&K<=N.x||E===en.Left&&K>=j.x;if(X&&!x.y){C.scrollTo({left:K,behavior:d});return}X?S.x=C.scrollLeft-K: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 K=C.scrollTop+x.y,X=E===en.Down&&K<=N.y||E===en.Up&&K>=j.y;if(X&&!x.x){C.scrollTo({top:K,behavior:d});return}X?S.y=C.scrollTop-K: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,rc(Zu(h,this.referenceCoordinates),S))}}}handleMove(t,s){const{onMove:i}=this.props;t.preventDefault(),i(s)}handleEnd(t){const{onEnd:s}=this.props;t.preventDefault(),this.detach(),s()}handleCancel(t){const{onCancel:s}=this.props;t.preventDefault(),this.detach(),s()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}tx.activators=[{eventName:"onKeyDown",handler:(e,t,s)=>{let{keyboardCodes:i=tM,onActivation:o}=t,{active:l}=s;const{code:u}=e.nativeEvent;if(i.start.includes(u)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function UR(e){return!!(e&&"distance"in e)}function HR(e){return!!(e&&"delay"in e)}class nx{constructor(t,s,i){var o;i===void 0&&(i=v7(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=s;const{event:l}=t,{target:u}=l;this.props=t,this.events=s,this.document=Ec(u),this.documentListeners=new zu(this.document),this.listeners=new zu(i),this.windowListeners=new zu(qr(u)),this.initialCoordinates=(o=gp(l))!=null?o:Ws,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:s,bypassActivationConstraint:i}}}=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(js.Resize,this.handleCancel),this.windowListeners.add(js.DragStart,_R),this.windowListeners.add(js.VisibilityChange,this.handleCancel),this.windowListeners.add(js.ContextMenu,_R),this.documentListeners.add(js.Keydown,this.handleKeydown),s){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(HR(s)){this.timeoutId=setTimeout(this.handleStart,s.delay),this.handlePending(s);return}if(UR(s)){this.handlePending(s);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,s){const{active:i,onPending:o}=this.props;o(i,t,this.initialCoordinates,s)}handleStart(){const{initialCoordinates:t}=this,{onStart:s}=this.props;t&&(this.activated=!0,this.documentListeners.add(js.Click,b7,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(js.SelectionChange,this.removeTextSelection),s(t))}handleMove(t){var s;const{activated:i,initialCoordinates:o,props:l}=this,{onMove:u,options:{activationConstraint:d}}=l;if(!o)return;const f=(s=gp(t))!=null?s:Ws,g=Zu(o,f);if(!i&&d){if(UR(d)){if(d.tolerance!=null&&Ny(g,d.tolerance))return this.handleCancel();if(Ny(g,d.distance))return this.handleStart()}if(HR(d)&&Ny(g,d.tolerance))return this.handleCancel();this.handlePending(d,g);return}t.cancelable&&t.preventDefault(),u(f)}handleEnd(){const{onAbort:t,onEnd:s}=this.props;this.detach(),this.activated||t(this.props.active),s()}handleCancel(){const{onAbort:t,onCancel:s}=this.props;this.detach(),this.activated||t(this.props.active),s()}handleKeydown(t){t.code===en.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const S7={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class nM extends nx{constructor(t){const{event:s}=t,i=Ec(s.target);super(t,S7,i)}}nM.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:s}=e,{onActivation:i}=t;return!s.isPrimary||s.button!==0?!1:(i?.({event:s}),!0)}}];const w7={move:{name:"mousemove"},end:{name:"mouseup"}};var vv;(function(e){e[e.RightClick=2]="RightClick"})(vv||(vv={}));class rM extends nx{constructor(t){super(t,w7,Ec(t.event.target))}}rM.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:s}=e,{onActivation:i}=t;return s.button===vv.RightClick?!1:(i?.({event:s}),!0)}}];const Dy={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class sM extends nx{constructor(t){super(t,Dy)}static setup(){return window.addEventListener(Dy.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Dy.move.name,t)};function t(){}}}sM.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:s}=e,{onActivation:i}=t;const{touches:o}=s;return o.length>1?!1:(i?.({event:s}),!0)}}];var _u;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(_u||(_u={}));var yp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(yp||(yp={}));function E7(e){let{acceleration:t,activator:s=_u.Pointer,canScroll:i,draggingRect:o,enabled:l,interval:u=5,order:d=yp.TreeOrder,pointerCoordinates:f,scrollableAncestors:g,scrollableAncestorRects:m,delta:h,threshold:x}=e;const S=C7({delta:h,disabled:!l}),[w,C]=LF(),E=b.useRef({x:0,y:0}),R=b.useRef({x:0,y:0}),O=b.useMemo(()=>{switch(s){case _u.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case _u.DraggableRect:return o}},[s,o,f]),T=b.useRef(null),A=b.useCallback(()=>{const j=T.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===yp.TreeOrder?[...g].reverse():g,[d,g]);b.useEffect(()=>{if(!l||!g.length||!O){C();return}for(const j of N){if(i?.(j)===!1)continue;const D=g.indexOf(j),M=m[D];if(!M)continue;const{direction:z,speed:L}=h7(j,M,O,t,x);for(const K of["x","y"])S[K][z[K]]||(L[K]=0,z[K]=0);if(L.x>0||L.y>0){C(),T.current=j,w(A,u),E.current=L,R.current=z;return}}E.current={x:0,y:0},R.current={x:0,y:0},C()},[t,A,i,C,l,u,JSON.stringify(O),JSON.stringify(S),w,g,N,m,JSON.stringify(x)])}const R7={x:{[fr.Backward]:!1,[fr.Forward]:!1},y:{[fr.Backward]:!1,[fr.Forward]:!1}};function C7(e){let{delta:t,disabled:s}=e;const i=pp(t);return Md(o=>{if(s||!i||!o)return R7;const l={x:Math.sign(t.x-i.x),y:Math.sign(t.y-i.y)};return{x:{[fr.Backward]:o.x[fr.Backward]||l.x===-1,[fr.Forward]:o.x[fr.Forward]||l.x===1},y:{[fr.Backward]:o.y[fr.Backward]||l.y===-1,[fr.Forward]:o.y[fr.Forward]||l.y===1}}},[s,t,i])}function T7(e,t){const s=t!=null?e.get(t):void 0,i=s?s.node.current:null;return Md(o=>{var l;return t==null?null:(l=i??o)!=null?l:null},[i,t])}function k7(e,t){return b.useMemo(()=>e.reduce((s,i)=>{const{sensor:o}=i,l=o.activators.map(u=>({eventName:u.eventName,handler:t(u.handler,i)}));return[...s,...l]},[]),[e,t])}var Ju;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ju||(Ju={}));var bv;(function(e){e.Optimized="optimized"})(bv||(bv={}));const FR=new Map;function O7(e,t){let{dragging:s,dependencies:i,config:o}=t;const[l,u]=b.useState(null),{frequency:d,measure:f,strategy:g}=o,m=b.useRef(e),h=E(),x=Xu(h),S=b.useCallback(function(R){R===void 0&&(R=[]),!x.current&&u(O=>O===null?R:O.concat(R.filter(T=>!O.includes(T))))},[x]),w=b.useRef(null),C=Md(R=>{if(h&&!s)return FR;if(!R||R===FR||m.current!==e||l!=null){const O=new Map;for(let T of e){if(!T)continue;if(l&&l.length>0&&!l.includes(T.id)&&T.rect.current){O.set(T.id,T.rect.current);continue}const A=T.node.current,N=A?new ex(f(A),A):null;T.rect.current=N,N&&O.set(T.id,N)}return O}return R},[e,l,s,h,f]);return b.useEffect(()=>{m.current=e},[e]),b.useEffect(()=>{h||S()},[s,h]),b.useEffect(()=>{l&&l.length>0&&u(null)},[JSON.stringify(l)]),b.useEffect(()=>{h||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{S(),w.current=null},d))},[d,h,S,...i]),{droppableRects:C,measureDroppableContainers:S,measuringScheduled:l!=null};function E(){switch(g){case Ju.Always:return!1;case Ju.BeforeDragging:return s;default:return!s}}}function rx(e,t){return Md(s=>e?s||(typeof t=="function"?t(e):e):null,[t,e])}function A7(e,t){return rx(e,t)}function M7(e){let{callback:t,disabled:s}=e;const i=kg(t),o=b.useMemo(()=>{if(s||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(i)},[i,s]);return b.useEffect(()=>()=>o?.disconnect(),[o]),o}function Mg(e){let{callback:t,disabled:s}=e;const i=kg(t),o=b.useMemo(()=>{if(s||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(i)},[s]);return b.useEffect(()=>()=>o?.disconnect(),[o]),o}function N7(e){return new ex(Rc(e),e)}function BR(e,t,s){t===void 0&&(t=N7);const[i,o]=b.useState(null);function l(){o(f=>{if(!e)return null;if(e.isConnected===!1){var g;return(g=f??s)!=null?g:null}const m=t(e);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const u=M7({callback(f){if(e)for(const g of f){const{type:m,target:h}=g;if(m==="childList"&&h instanceof HTMLElement&&h.contains(e)){l();break}}}}),d=Mg({callback:l});return Js(()=>{l(),e?(d?.observe(e),u?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),u?.disconnect())},[e]),i}function D7(e){const t=rx(e);return YA(e,t)}const VR=[];function j7(e){const t=b.useRef(e),s=Md(i=>e?i&&i!==VR&&e&&t.current&&e.parentNode===t.current.parentNode?i:Ag(e):VR,[e]);return b.useEffect(()=>{t.current=e},[e]),s}function I7(e){const[t,s]=b.useState(null),i=b.useRef(e),o=b.useCallback(l=>{const u=My(l.target);u&&s(d=>d?(d.set(u,yv(u)),new Map(d)):null)},[]);return b.useEffect(()=>{const l=i.current;if(e!==l){u(l);const d=e.map(f=>{const g=My(f);return g?(g.addEventListener("scroll",o,{passive:!0}),[g,yv(g)]):null}).filter(f=>f!=null);s(d.length?new Map(d):null),i.current=e}return()=>{u(e),u(l)};function u(d){d.forEach(f=>{const g=My(f);g?.removeEventListener("scroll",o)})}},[o,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,u)=>rc(l,u),Ws):WA(e):Ws,[e,t])}function KR(e,t){t===void 0&&(t=[]);const s=b.useRef(null);return b.useEffect(()=>{s.current=null},t),b.useEffect(()=>{const i=e!==Ws;i&&!s.current&&(s.current=e),!i&&s.current&&(s.current=null)},[e]),s.current?Zu(e,s.current):Ws}function P7(e){b.useEffect(()=>{if(!Tg)return;const t=e.map(s=>{let{sensor:i}=s;return i.setup==null?void 0:i.setup()});return()=>{for(const s of t)s?.()}},e.map(t=>{let{sensor:s}=t;return s}))}function L7(e,t){return b.useMemo(()=>e.reduce((s,i)=>{let{eventName:o,handler:l}=i;return s[o]=u=>{l(u,t)},s},{}),[e,t])}function iM(e){return b.useMemo(()=>e?c7(e):null,[e])}const qR=[];function z7(e,t){t===void 0&&(t=Rc);const[s]=e,i=iM(s?qr(s):null),[o,l]=b.useState(qR);function u(){l(()=>e.length?e.map(f=>ZA(f)?i:new ex(t(f),f)):qR)}const d=Mg({callback:u});return Js(()=>{d?.disconnect(),u(),e.forEach(f=>d?.observe(f))},[e]),o}function aM(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ad(t)?t:e}function _7(e){let{measure:t}=e;const[s,i]=b.useState(null),o=b.useCallback(g=>{for(const{target:m}of g)if(Ad(m)){i(h=>{const x=t(m);return h?{...h,width:x.width,height:x.height}:x});break}},[t]),l=Mg({callback:o}),u=b.useCallback(g=>{const m=aM(g);l?.disconnect(),m&&l?.observe(m),i(m?t(m):null)},[t,l]),[d,f]=hp(u);return b.useMemo(()=>({nodeRef:d,rect:s,setRef:f}),[s,d,f])}const U7=[{sensor:nM,options:{}},{sensor:tx,options:{}}],H7={current:{}},Kh={draggable:{measure:zR},droppable:{measure:zR,strategy:Ju.WhileDragging,frequency:bv.Optimized},dragOverlay:{measure:Rc}};class Uu extends Map{get(t){var s;return t!=null&&(s=super.get(t))!=null?s:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:s}=t;return!s})}getNodeFor(t){var s,i;return(s=(i=this.get(t))==null?void 0:i.node.current)!=null?s:void 0}}const F7={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Uu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:mp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Kh,measureDroppableContainers:mp,windowRect:null,measuringScheduled:!1},oM={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:mp,draggableNodes:new Map,over:null,measureDroppableContainers:mp},Dd=b.createContext(oM),lM=b.createContext(F7);function B7(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Uu}}}function V7(e,t){switch(t.type){case or.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case or.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 or.DragEnd:case or.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case or.RegisterDroppable:{const{element:s}=t,{id:i}=s,o=new Uu(e.droppable.containers);return o.set(i,s),{...e,droppable:{...e.droppable,containers:o}}}case or.SetDroppableDisabled:{const{id:s,key:i,disabled:o}=t,l=e.droppable.containers.get(s);if(!l||i!==l.key)return e;const u=new Uu(e.droppable.containers);return u.set(s,{...l,disabled:o}),{...e,droppable:{...e.droppable,containers:u}}}case or.UnregisterDroppable:{const{id:s,key:i}=t,o=e.droppable.containers.get(s);if(!o||i!==o.key)return e;const l=new Uu(e.droppable.containers);return l.delete(s),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function K7(e){let{disabled:t}=e;const{active:s,activatorEvent:i,draggableNodes:o}=b.useContext(Dd),l=pp(i),u=pp(s?.id);return b.useEffect(()=>{if(!t&&!i&&l&&u!=null){if(!Og(l)||document.activeElement===l.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=UF(m);if(h){h.focus();break}}})}},[i,t,o,u,l]),null}function cM(e,t){let{transform:s,...i}=t;return e!=null&&e.length?e.reduce((o,l)=>l({transform:o,...i}),s):s}function q7(e){return b.useMemo(()=>({draggable:{...Kh.draggable,...e?.draggable},droppable:{...Kh.droppable,...e?.droppable},dragOverlay:{...Kh.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Y7(e){let{activeNode:t,measure:s,initialRect:i,config:o=!0}=e;const l=b.useRef(!1),{x:u,y:d}=typeof o=="boolean"?{x:o,y:o}:o;Js(()=>{if(!u&&!d||!t){l.current=!1;return}if(l.current||!i)return;const g=t?.node.current;if(!g||g.isConnected===!1)return;const m=s(g),h=YA(m,i);if(u||(h.x=0),d||(h.y=0),l.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const x=GA(g);x&&x.scrollBy({top:h.y,left:h.x})}},[t,u,d,i,s])}const Ng=b.createContext({...Ws,scaleX:1,scaleY:1});var La;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(La||(La={}));const $7=b.memo(function(t){var s,i,o,l;let{id:u,accessibility:d,autoScroll:f=!0,children:g,sensors:m=U7,collisionDetection:h=t7,measuring:x,modifiers:S,...w}=t;const C=b.useReducer(V7,void 0,B7),[E,R]=C,[O,T]=qF(),[A,N]=b.useState(La.Uninitialized),j=A===La.Initialized,{draggable:{active:D,nodes:M,translate:z},droppable:{containers:L}}=E,K=D!=null?M.get(D):null,X=b.useRef({initial:null,translated:null}),B=b.useMemo(()=>{var St;return D!=null?{id:D,data:(St=K?.data)!=null?St:H7,rect:X}:null},[D,K]),H=b.useRef(null),[U,_]=b.useState(null),[Q,G]=b.useState(null),q=Xu(w,Object.values(w)),Y=Nd("DndDescribedBy",u),ee=b.useMemo(()=>L.getEnabled(),[L]),$=q7(x),{droppableRects:ae,measureDroppableContainers:I,measuringScheduled:F}=O7(ee,{dragging:j,dependencies:[z.x,z.y],config:$.droppable}),Z=T7(M,D),ne=b.useMemo(()=>Q?gp(Q):null,[Q]),ye=pt(),se=A7(Z,$.draggable.measure);Y7({activeNode:D!=null?M.get(D):null,config:ye.layoutShiftCompensation,initialRect:se,measure:$.draggable.measure});const ge=BR(Z,$.draggable.measure,se),fe=BR(Z?Z.parentElement:null),ce=b.useRef({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Re=L.getNodeFor((s=ce.current.over)==null?void 0:s.id),be=_7({measure:$.dragOverlay.measure}),Le=(i=be.nodeRef.current)!=null?i:Z,Oe=j?(o=be.rect)!=null?o:ge:null,ze=!!(be.nodeRef.current&&be.rect),Ve=D7(ze?null:ge),ke=iM(Le?qr(Le):null),Ue=j7(j?Re??Z:null),xe=z7(Ue),Fe=cM(S,{transform:{x:z.x-Ve.x,y:z.y-Ve.y,scaleX:1,scaleY:1},activatorEvent:Q,active:B,activeNodeRect:ge,containerNodeRect:fe,draggingNodeRect:Oe,over:ce.current.over,overlayNodeRect:be.rect,scrollableAncestors:Ue,scrollableAncestorRects:xe,windowRect:ke}),Je=ne?rc(ne,z):null,ot=I7(Ue),de=KR(ot),Ee=KR(ot,[ge]),$e=rc(Fe,de),Me=Oe?a7(Oe,Fe):null,De=B&&Me?h({active:B,collisionRect:Me,droppableRects:ae,droppableContainers:ee,pointerCoordinates:Je}):null,xt=qA(De,"id"),[dt,gt]=b.useState(null),Dt=ze?Fe:rc(Fe,Ee),It=s7(Dt,(l=dt?.rect)!=null?l:null,ge),tn=b.useRef(null),an=b.useCallback((St,yt)=>{let{sensor:Ht,options:dn}=yt;if(H.current==null)return;const je=M.get(H.current);if(!je)return;const at=St.nativeEvent,Ie=new Ht({active:H.current,activeNode:je,event:at,options:dn,context:ce,onAbort(Ge){if(!M.get(Ge))return;const{onDragAbort:kt}=q.current,V={id:Ge};kt?.(V),O({type:"onDragAbort",event:V})},onPending(Ge,tt,kt,V){if(!M.get(Ge))return;const{onDragPending:re}=q.current,ve={id:Ge,constraint:tt,initialCoordinates:kt,offset:V};re?.(ve),O({type:"onDragPending",event:ve})},onStart(Ge){const tt=H.current;if(tt==null)return;const kt=M.get(tt);if(!kt)return;const{onDragStart:V}=q.current,W={activatorEvent:at,active:{id:tt,data:kt.data,rect:X}};hr.unstable_batchedUpdates(()=>{V?.(W),N(La.Initializing),R({type:or.DragStart,initialCoordinates:Ge,active:tt}),O({type:"onDragStart",event:W}),_(tn.current),G(at)})},onMove(Ge){R({type:or.DragMove,coordinates:Ge})},onEnd:_e(or.DragEnd),onCancel:_e(or.DragCancel)});tn.current=Ie;function _e(Ge){return async function(){const{active:kt,collisions:V,over:W,scrollAdjustedTranslate:re}=ce.current;let ve=null;if(kt&&re){const{cancelDrop:Se}=q.current;ve={activatorEvent:at,active:kt,collisions:V,delta:re,over:W},Ge===or.DragEnd&&typeof Se=="function"&&await Promise.resolve(Se(ve))&&(Ge=or.DragCancel)}H.current=null,hr.unstable_batchedUpdates(()=>{R({type:Ge}),N(La.Uninitialized),gt(null),_(null),G(null),tn.current=null;const Se=Ge===or.DragEnd?"onDragEnd":"onDragCancel";if(ve){const qe=q.current[Se];qe?.(ve),O({type:Se,event:ve})}})}}},[M]),nn=b.useCallback((St,yt)=>(Ht,dn)=>{const je=Ht.nativeEvent,at=M.get(dn);if(H.current!==null||!at||je.dndKit||je.defaultPrevented)return;const Ie={active:at};St(Ht,yt.options,Ie)===!0&&(je.dndKit={capturedBy:yt.sensor},H.current=dn,an(Ht,yt))},[M,an]),et=k7(m,nn);P7(m),Js(()=>{ge&&A===La.Initializing&&N(La.Initialized)},[ge,A]),b.useEffect(()=>{const{onDragMove:St}=q.current,{active:yt,activatorEvent:Ht,collisions:dn,over:je}=ce.current;if(!yt||!Ht)return;const at={active:yt,activatorEvent:Ht,collisions:dn,delta:{x:$e.x,y:$e.y},over:je};hr.unstable_batchedUpdates(()=>{St?.(at),O({type:"onDragMove",event:at})})},[$e.x,$e.y]),b.useEffect(()=>{const{active:St,activatorEvent:yt,collisions:Ht,droppableContainers:dn,scrollAdjustedTranslate:je}=ce.current;if(!St||H.current==null||!yt||!je)return;const{onDragOver:at}=q.current,Ie=dn.get(xt),_e=Ie&&Ie.rect.current?{id:Ie.id,rect:Ie.rect.current,data:Ie.data,disabled:Ie.disabled}:null,Ge={active:St,activatorEvent:yt,collisions:Ht,delta:{x:je.x,y:je.y},over:_e};hr.unstable_batchedUpdates(()=>{gt(_e),at?.(Ge),O({type:"onDragOver",event:Ge})})},[xt]),Js(()=>{ce.current={activatorEvent:Q,active:B,activeNode:Z,collisionRect:Me,collisions:De,droppableRects:ae,draggableNodes:M,draggingNode:Le,draggingNodeRect:Oe,droppableContainers:L,over:dt,scrollableAncestors:Ue,scrollAdjustedTranslate:$e},X.current={initial:Oe,translated:Me}},[B,Z,De,Me,M,Le,Oe,ae,L,dt,Ue,$e]),E7({...ye,delta:z,draggingRect:Me,pointerCoordinates:Je,scrollableAncestors:Ue,scrollableAncestorRects:xe});const Et=b.useMemo(()=>({active:B,activeNode:Z,activeNodeRect:ge,activatorEvent:Q,collisions:De,containerNodeRect:fe,dragOverlay:be,draggableNodes:M,droppableContainers:L,droppableRects:ae,over:dt,measureDroppableContainers:I,scrollableAncestors:Ue,scrollableAncestorRects:xe,measuringConfiguration:$,measuringScheduled:F,windowRect:ke}),[B,Z,ge,Q,De,fe,be,M,L,ae,dt,I,Ue,xe,$,F,ke]),Zt=b.useMemo(()=>({activatorEvent:Q,activators:et,active:B,activeNodeRect:ge,ariaDescribedById:{draggable:Y},dispatch:R,draggableNodes:M,over:dt,measureDroppableContainers:I}),[Q,et,B,ge,R,Y,M,dt,I]);return Ne.createElement(KA.Provider,{value:T},Ne.createElement(Dd.Provider,{value:Zt},Ne.createElement(lM.Provider,{value:Et},Ne.createElement(Ng.Provider,{value:It},g)),Ne.createElement(K7,{disabled:d?.restoreFocus===!1})),Ne.createElement(GF,{...d,hiddenTextDescribedById:Y}));function pt(){const St=U?.autoScrollEnabled===!1,yt=typeof f=="object"?f.enabled===!1:f===!1,Ht=j&&!St&&!yt;return typeof f=="object"?{...f,enabled:Ht}:{enabled:Ht}}}),G7=b.createContext(null),YR="button",Q7="Draggable";function uM(e){let{id:t,data:s,disabled:i=!1,attributes:o}=e;const l=Nd(Q7),{activators:u,activatorEvent:d,active:f,activeNodeRect:g,ariaDescribedById:m,draggableNodes:h,over:x}=b.useContext(Dd),{role:S=YR,roleDescription:w="draggable",tabIndex:C=0}=o??{},E=f?.id===t,R=b.useContext(E?Ng:G7),[O,T]=hp(),[A,N]=hp(),j=L7(u,t),D=Xu(s);Js(()=>(h.set(t,{id:t,key:l,node:O,activatorNode:A,data:D}),()=>{const z=h.get(t);z&&z.key===l&&h.delete(t)}),[h,t]);const M=b.useMemo(()=>({role:S,tabIndex:C,"aria-disabled":i,"aria-pressed":E&&S===YR?!0:void 0,"aria-roledescription":w,"aria-describedby":m.draggable}),[i,S,C,E,w,m.draggable]);return{active:f,activatorEvent:d,activeNodeRect:g,attributes:M,isDragging:E,listeners:i?void 0:j,node:O,over:x,setNodeRef:T,setActivatorNodeRef:N,transform:R}}function dM(){return b.useContext(lM)}const X7="Droppable",Z7={timeout:25};function fM(e){let{data:t,disabled:s=!1,id:i,resizeObserverConfig:o}=e;const l=Nd(X7),{active:u,dispatch:d,over:f,measureDroppableContainers:g}=b.useContext(Dd),m=b.useRef({disabled:s}),h=b.useRef(!1),x=b.useRef(null),S=b.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:E}={...Z7,...o},R=Xu(C??i),O=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]),T=Mg({callback:O,disabled:w||!u}),A=b.useCallback((M,z)=>{T&&(z&&(T.unobserve(z),h.current=!1),M&&T.observe(M))},[T]),[N,j]=hp(A),D=Xu(t);return b.useEffect(()=>{!T||!N.current||(T.disconnect(),h.current=!1,T.observe(N.current))},[N,T]),b.useEffect(()=>(d({type:or.RegisterDroppable,element:{id:i,key:l,disabled:s,node:N,rect:x,data:D}}),()=>d({type:or.UnregisterDroppable,key:l,id:i})),[i]),b.useEffect(()=>{s!==m.current.disabled&&(d({type:or.SetDroppableDisabled,id:i,key:l,disabled:s}),m.current.disabled=s)},[i,l,s,d]),{active:u,rect:x,isOver:f?.id===i,node:N,over:f,setNodeRef:j}}function J7(e){let{animation:t,children:s}=e;const[i,o]=b.useState(null),[l,u]=b.useState(null),d=pp(s);return!s&&!i&&d&&o(d),Js(()=>{if(!l)return;const f=i?.key,g=i?.props.id;if(f==null||g==null){o(null);return}Promise.resolve(t(g,l)).then(()=>{o(null)})},[t,i,l]),Ne.createElement(Ne.Fragment,null,s,i?b.cloneElement(i,{ref:u}):null)}const W7={x:0,y:0,scaleX:1,scaleY:1};function e9(e){let{children:t}=e;return Ne.createElement(Dd.Provider,{value:oM},Ne.createElement(Ng.Provider,{value:W7},t))}const t9={position:"fixed",touchAction:"none"},n9=e=>Og(e)?"transform 250ms ease":void 0,r9=b.forwardRef((e,t)=>{let{as:s,activatorEvent:i,adjustScale:o,children:l,className:u,rect:d,style:f,transform:g,transition:m=n9}=e;if(!d)return null;const h=o?g:{...g,scaleX:1,scaleY:1},x={...t9,width:d.width,height:d.height,top:d.top,left:d.left,transform:Ga.Transform.toString(h),transformOrigin:o&&i?XF(i,d):void 0,transition:typeof m=="function"?m(i):m,...f};return Ne.createElement(s,{className:u,style:x,ref:t},l)}),s9=e=>t=>{let{active:s,dragOverlay:i}=t;const o={},{styles:l,className:u}=e;if(l!=null&&l.active)for(const[d,f]of Object.entries(l.active))f!==void 0&&(o[d]=s.node.style.getPropertyValue(d),s.node.style.setProperty(d,f));if(l!=null&&l.dragOverlay)for(const[d,f]of Object.entries(l.dragOverlay))f!==void 0&&i.node.style.setProperty(d,f);return u!=null&&u.active&&s.node.classList.add(u.active),u!=null&&u.dragOverlay&&i.node.classList.add(u.dragOverlay),function(){for(const[f,g]of Object.entries(o))s.node.style.setProperty(f,g);u!=null&&u.active&&s.node.classList.remove(u.active)}},i9=e=>{let{transform:{initial:t,final:s}}=e;return[{transform:Ga.Transform.toString(t)},{transform:Ga.Transform.toString(s)}]},a9={duration:250,easing:"ease",keyframes:i9,sideEffects:s9({styles:{active:{opacity:"0"}}})};function o9(e){let{config:t,draggableNodes:s,droppableContainers:i,measuringConfiguration:o}=e;return kg((l,u)=>{if(t===null)return;const d=s.get(l);if(!d)return;const f=d.node.current;if(!f)return;const g=aM(u);if(!g)return;const{transform:m}=qr(u).getComputedStyle(u),h=$A(m);if(!h)return;const x=typeof t=="function"?t:l9(t);return eM(f,o.draggable.measure),x({active:{id:l,data:d.data,node:f,rect:o.draggable.measure(f)},draggableNodes:s,dragOverlay:{node:u,rect:o.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:o,transform:h})})}function l9(e){const{duration:t,easing:s,sideEffects:i,keyframes:o}={...a9,...e};return l=>{let{active:u,dragOverlay:d,transform:f,...g}=l;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=i?.({active:u,dragOverlay:d,...g}),R=d.node.animate(S,{duration:t,easing:s,fill:"forwards"});return new Promise(O=>{R.onfinish=()=>{E?.(),O()}})}}let $R=0;function c9(e){return b.useMemo(()=>{if(e!=null)return $R++,$R},[e])}const u9=Ne.memo(e=>{let{adjustScale:t=!1,children:s,dropAnimation:i,style:o,transition:l,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:O,scrollableAncestors:T,scrollableAncestorRects:A,windowRect:N}=dM(),j=b.useContext(Ng),D=c9(h?.id),M=cM(u,{activatorEvent:m,active:h,activeNodeRect:x,containerNodeRect:S,draggingNodeRect:E.rect,over:R,overlayNodeRect:E.rect,scrollableAncestors:T,scrollableAncestorRects:A,transform:j,windowRect:N}),z=rx(x),L=o9({config:i,draggableNodes:w,droppableContainers:C,measuringConfiguration:O}),K=z?E.setRef:void 0;return Ne.createElement(e9,null,Ne.createElement(J7,{animation:L},h&&D?Ne.createElement(r9,{key:D,id:h.id,ref:K,as:d,activatorEvent:m,adjustScale:t,className:f,transition:l,rect:z,style:{zIndex:g,...o},transform:M},s):null))});function sx(e,t,s){const i=e.slice();return i.splice(s<0?i.length+s:s,0,i.splice(t,1)[0]),i}function d9(e,t){return e.reduce((s,i,o)=>{const l=t.get(i);return l&&(s[o]=l),s},Array(e.length))}function Ch(e){return e!==null&&e>=0}function f9(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}function h9(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const hM=e=>{let{rects:t,activeIndex:s,overIndex:i,index:o}=e;const l=sx(t,i,s),u=t[o],d=l[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}},Th={scaleX:1,scaleY:1},p9=e=>{var t;let{activeIndex:s,activeNodeRect:i,index:o,rects:l,overIndex:u}=e;const d=(t=l[s])!=null?t:i;if(!d)return null;if(o===s){const g=l[u];return g?{x:0,y:s<u?g.top+g.height-(d.top+d.height):g.top-d.top,...Th}:null}const f=g9(l,o,s);return o>s&&o<=u?{x:0,y:-d.height-f,...Th}:o<s&&o>=u?{x:0,y:d.height+f,...Th}:{x:0,y:0,...Th}};function g9(e,t,s){const i=e[t],o=e[t-1],l=e[t+1];return i?s<t?o?i.top-(o.top+o.height):l?l.top-(i.top+i.height):0:l?l.top-(i.top+i.height):o?i.top-(o.top+o.height):0:0}const pM="Sortable",gM=Ne.createContext({activeIndex:-1,containerId:pM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:hM,disabled:{draggable:!1,droppable:!1}});function m9(e){let{children:t,id:s,items:i,strategy:o=hM,disabled:l=!1}=e;const{active:u,dragOverlay:d,droppableRects:f,over:g,measureDroppableContainers:m}=dM(),h=Nd(pM,s),x=d.rect!==null,S=b.useMemo(()=>i.map(j=>typeof j=="object"&&"id"in j?j.id:j),[i]),w=u!=null,C=u?S.indexOf(u.id):-1,E=g?S.indexOf(g.id):-1,R=b.useRef(S),O=!f9(S,R.current),T=E!==-1&&C===-1||O,A=h9(l);Js(()=>{O&&w&&m(S)},[O,S,w,m]),b.useEffect(()=>{R.current=S},[S]);const N=b.useMemo(()=>({activeIndex:C,containerId:h,disabled:A,disableTransforms:T,items:S,overIndex:E,useDragOverlay:x,sortedRects:d9(S,f),strategy:o}),[C,h,A.draggable,A.droppable,T,S,E,f,x,o]);return Ne.createElement(gM.Provider,{value:N},t)}const y9=e=>{let{id:t,items:s,activeIndex:i,overIndex:o}=e;return sx(s,i,o).indexOf(t)},v9=e=>{let{containerId:t,isSorting:s,wasDragging:i,index:o,items:l,newIndex:u,previousItems:d,previousContainerId:f,transition:g}=e;return!g||!i||d!==l&&o===u?!1:s?!0:u!==o&&t===f},b9={duration:200,easing:"ease"},mM="transform",x9=Ga.Transition.toString({property:mM,duration:0,easing:"linear"}),S9={roleDescription:"sortable"};function w9(e){let{disabled:t,index:s,node:i,rect:o}=e;const[l,u]=b.useState(null),d=b.useRef(s);return Js(()=>{if(!t&&s!==d.current&&i.current){const f=o.current;if(f){const g=Rc(i.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)}}s!==d.current&&(d.current=s)},[t,s,i,o]),b.useEffect(()=>{l&&u(null)},[l]),l}function E9(e){let{animateLayoutChanges:t=v9,attributes:s,disabled:i,data:o,getNewIndex:l=y9,id:u,strategy:d,resizeObserverConfig:f,transition:g=b9}=e;const{items:m,containerId:h,activeIndex:x,disabled:S,disableTransforms:w,sortedRects:C,overIndex:E,useDragOverlay:R,strategy:O}=b.useContext(gM),T=R9(i,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:z,setNodeRef:L}=fM({id:u,data:N,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...f}}),{active:K,activatorEvent:X,activeNodeRect:B,attributes:H,setNodeRef:U,listeners:_,isDragging:Q,over:G,setActivatorNodeRef:q,transform:Y}=uM({id:u,data:N,attributes:{...S9,...s},disabled:T.draggable}),ee=PF(L,U),$=!!K,ae=$&&!w&&Ch(x)&&Ch(E),I=!R&&Q,F=I&&ae?Y:null,ne=ae?F??(d??O)({rects:C,activeNodeRect:B,activeIndex:x,overIndex:E,index:A}):null,ye=Ch(x)&&Ch(E)?l({id:u,items:m,activeIndex:x,overIndex:E}):A,se=K?.id,ge=b.useRef({activeId:se,items:m,newIndex:ye,containerId:h}),fe=m!==ge.current.items,ce=t({active:K,containerId:h,isDragging:Q,isSorting:$,id:u,index:A,items:m,newIndex:ge.current.newIndex,previousItems:ge.current.items,previousContainerId:ge.current.containerId,transition:g,wasDragging:ge.current.activeId!=null}),Re=w9({disabled:!ce,index:A,node:M,rect:D});return b.useEffect(()=>{$&&ge.current.newIndex!==ye&&(ge.current.newIndex=ye),h!==ge.current.containerId&&(ge.current.containerId=h),m!==ge.current.items&&(ge.current.items=m)},[$,ye,h,m]),b.useEffect(()=>{if(se===ge.current.activeId)return;if(se!=null&&ge.current.activeId==null){ge.current.activeId=se;return}const Le=setTimeout(()=>{ge.current.activeId=se},50);return()=>clearTimeout(Le)},[se]),{active:K,activeIndex:x,attributes:H,data:N,rect:D,index:A,newIndex:ye,items:m,isOver:z,isSorting:$,isDragging:Q,listeners:_,node:M,overIndex:E,over:G,setNodeRef:ee,setActivatorNodeRef:q,setDroppableNodeRef:L,setDraggableNodeRef:U,transform:Re??ne,transition:be()};function be(){if(Re||fe&&ge.current.newIndex===A)return x9;if(!(I&&!Og(X)||!g)&&($||ce))return Ga.Transition.toString({...g,property:mM})}}function R9(e,t){var s,i;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(s=e?.draggable)!=null?s:t.draggable,droppable:(i=e?.droppable)!=null?i:t.droppable}}function vp(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 C9=[en.Down,en.Right,en.Up,en.Left],T9=(e,t)=>{let{context:{active:s,collisionRect:i,droppableRects:o,droppableContainers:l,over:u,scrollableAncestors:d}}=t;if(C9.includes(e.code)){if(e.preventDefault(),!s||!i)return;const f=[];l.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const x=o.get(h.id);if(x)switch(e.code){case en.Down:i.top<x.top&&f.push(h);break;case en.Up:i.top>x.top&&f.push(h);break;case en.Left:i.left>x.left&&f.push(h);break;case en.Right:i.left<x.left&&f.push(h);break}});const g=WF({collisionRect:i,droppableRects:o,droppableContainers:f});let m=qA(g,"id");if(m===u?.id&&g.length>1&&(m=g[1].id),m!=null){const h=l.get(s.id),x=l.get(m),S=x?o.get(x.id):null,w=x?.node.current;if(w&&S&&h&&x){const E=Ag(w).some((j,D)=>d[D]!==j),R=yM(h,x),O=k9(h,x),T=E||!R?{x:0,y:0}:{x:O?i.width-S.width:0,y:O?i.height-S.height:0},A={x:S.left,y:S.top};return T.x&&T.y?A:Zu(A,T)}}}};function yM(e,t){return!vp(e)||!vp(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function k9(e,t){return!vp(e)||!vp(t)||!yM(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Qi({className:e,size:t="default",...s}){return y.jsx("div",{"data-slot":"card","data-size":t,className:He("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),...s})}function O9({className:e,...t}){return y.jsx("div",{"data-slot":"card-header",className:He("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 A9({className:e,...t}){return y.jsx("div",{"data-slot":"card-content",className:He("px-(--card-spacing)",e),...t})}const vM=b.createContext(void 0);function M9(){const e=b.useContext(vM);if(e===void 0)throw new Error(cn(63));return e}const N9="data-checked",D9="data-unchecked",bM={...bc,checked(e){return e?{[N9]:""}:{[D9]:""}}},j9=b.forwardRef(function(t,s){const{checked:i,className:o,defaultChecked:l,"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:O,style:T,...A}=t,{clearErrors:N}=Cd(),{state:j,setTouched:D,setDirty:M,validityData:z,setFilled:L,validationMode:K,disabled:X,name:B,validation:H}=ia(),{labelId:U}=Zo(),_=X||C,Q=B??m,G=b.useRef(null),q=es(G,g,H.inputRef),Y=b.useRef(null),ee=Td(_,Y),$=Qn(),ae=xc({id:f}),I=h?void 0:ae,[F,Z]=Ci({controlled:i,default:!!l,name:"Switch",state:"checked"});kd(Y,$,F,void 0,!_,m),Pe(()=>{L(F)},[F,L]),mc(F,()=>{N(Q),M(F!==z.initialValue),H.change(F)});const{getButtonProps:ne,buttonRef:ye}=ns({disabled:_,native:h}),se=qb(u,U,G,!h,I,A["aria-label"]),ge={id:h?ae:$,role:"switch","aria-checked":F,"aria-readonly":S||void 0,"aria-required":w||void 0,"aria-labelledby":se,onFocus(){ee(!0)},onBlur(){const be=G.current;!be||_||(D(!0),ee(!1),K==="onBlur"&&H.commit(be.checked))},onClick(be){if(S||_)return;be.preventDefault();const Le=G.current;Le&&_o(Le,be)}},fe={...H.getValidationProps(_),checked:F,disabled:_,form:d,id:I,name:Q,required:w,style:Q?Pp:ld,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:q,onChange(be){if(be.nativeEvent.defaultPrevented)return;if(S){be.preventDefault();return}const Le=be.currentTarget.checked,Oe=lt(kr,be.nativeEvent);x?.(Le,Oe),!Oe.isCanceled&&Z(Le)},onClick(be){be.stopPropagation()},onFocus(){Y.current?.focus()},...O!==void 0?{value:O}:Xt},ce=b.useMemo(()=>({...j,checked:F,disabled:_,readOnly:S,required:w}),[j,F,_,S,w]),Re=bt("span",t,{state:ce,ref:[s,Y,ye],props:[ge,A,ne,be=>H.getValidationProps(_,be)],stateAttributesMapping:bM});return y.jsxs(vM.Provider,{value:ce,children:[Re,!F&&Q&&R!==void 0&&y.jsx("input",{type:"hidden",form:d,name:Q,value:R,disabled:_}),y.jsx("input",{...fe,suppressHydrationWarning:!0})]})}),I9=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,d=M9();return bt("span",t,{state:d,ref:s,stateAttributesMapping:bM,props:u})});function P9({className:e,...t}){return y.jsx(j9,{"data-slot":"switch",className:He(`
|
|
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:y.jsx(I9,{"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 L9(e){return`library:${e}`}function xM(e,t){return`assigned:${e}:${t}`}function SM(e){return`agent:${e}`}function z9(e){return String(e).startsWith("assigned:")}function xv(e){return ix(e)&&e.type==="library-instruction"&&typeof e.instructionId=="string"}function sc(e){return ix(e)&&e.type==="assigned-instruction"&&typeof e.agentId=="string"&&typeof e.instructionId=="string"}function GR(e){return ix(e)&&e.type==="agent"&&typeof e.agentId=="string"}function ix(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const _9="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",U9='<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>',H9="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",F9='<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>',B9={openai:{src:_9,monochromeSvg:U9,invertInDark:!0},claudecode:{src:H9,monochromeSvg:F9,invertInDark:!1}};function ax({icon:e,monochrome:t=!1,className:s}){const i=B9[e];return y.jsx("div",{"aria-hidden":"true",className:He(`
|
|
79
|
-
flex size-8 shrink-0 items-center justify-center rounded-md bg-muted
|
|
80
|
-
text-foreground
|
|
81
|
-
`,t&&"text-muted-foreground",s),children:i?y.jsxs(y.Fragment,{children:[y.jsx("span",{hidden:!t,className:`
|
|
82
|
-
size-4
|
|
83
|
-
[&_svg]:size-full
|
|
84
|
-
`,dangerouslySetInnerHTML:{__html:i.monochromeSvg}}),y.jsx("img",{hidden:t,src:i.src,alt:"",draggable:!1,className:He("size-4",i.invertInDark&&"dark:invert")})]}):y.jsx(ib,{className:"size-4"})})}function V9({agent:e,instructionsById:t,isInstructionsLoading:s,isPending:i,isReapplying:o,onRemoveInstruction:l,onToggle:u,onReapply:d,onOpenFile:f}){const{t:g}=ht(),{isOver:m,setNodeRef:h}=fM({id:SM(e.id),data:{type:"agent",agentId:e.id},disabled:i}),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 y.jsxs(Qi,{"data-agent-id":e.id,ref:h,className:He("gap-0 py-0 transition-shadow",m&&"ring-2 ring-ring/40"),children:[y.jsxs("div",{className:"flex items-center gap-3 p-3",children:[y.jsx(ax,{icon:e.icon}),y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),y.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})]}),y.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[y.jsxs(ip,{children:[y.jsx(ap,{render:y.jsx("span",{className:"inline-flex"}),children:y.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":g("agents.reapplyAria",{name:e.name}),disabled:i||!e.enabled,onClick:()=>{d(e.id)},children:y.jsx(YL,{className:He(o&&"animate-spin")})})}),y.jsx(op,{children:S})]}),y.jsxs(ip,{children:[y.jsx(ap,{render:y.jsx("span",{className:"inline-flex"}),children:y.jsx(P9,{checked:e.enabled,disabled:i||!x,"aria-label":g("agents.toggleAria",{name:e.name}),onCheckedChange:C=>{u(e.id,C)}})}),y.jsx(op,{children:w})]})]})]}),y.jsx("div",{className:"border-t border-border/60 p-3",children:e.instructionIds.length===0?y.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")}):y.jsx(m9,{items:e.instructionIds.map(C=>xM(e.id,C)),strategy:p9,children:y.jsx("ol",{className:"flex flex-col gap-1",children:e.instructionIds.map((C,E)=>{const R=t.get(C),O=R?.name??C;return y.jsx(K9,{agentId:e.id,index:E,instructionId:C,instructionName:s&&!R?g("agents.loadingInstruction"):O,isPending:i,onRemove:l},C)})})})})]})}function K9({agentId:e,index:t,instructionId:s,instructionName:i,isPending:o,onRemove:l}){const{t:u}=ht(),{attributes:d,isDragging:f,isOver:g,listeners:m,setNodeRef:h,transform:x,transition:S}=E9({id:xM(e,s),animateLayoutChanges:()=>!1,data:{type:"assigned-instruction",agentId:e,instructionId:s},disabled:o});return y.jsxs("li",{...d,...m,ref:h,"data-instruction-id":s,style:{transform:Ga.Transform.toString(x),transition:S},className:He(`
|
|
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:[y.jsx(ub,{"aria-hidden":"true",className:`
|
|
99
|
-
size-3.5 shrink-0 text-muted-foreground
|
|
100
|
-
group-active:cursor-grabbing
|
|
101
|
-
`}),y.jsx("span",{className:`
|
|
102
|
-
w-4 shrink-0 text-center font-mono text-[10px] text-muted-foreground
|
|
103
|
-
`,children:t+1}),y.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:i}),y.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":u("agents.removeInstructionAria",{name:i}),disabled:o,onClick:()=>{l(e,s)},onKeyDown:w=>{w.stopPropagation()},onPointerDown:w=>{w.stopPropagation()},children:y.jsx(ra,{})})]})}class wM extends Error{constructor(t,s){super(s),this.code=t,this.name="OpenPathApiError"}code}async function ox(e){const t=await fetch("/api/open-path",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e})});if(!t.ok){const s=await t.json();throw new wM(s.error?.code??"OPEN_PATH_FAILED",s.error?.message??`Request failed with status ${t.status}`)}return t.json()}const jd="/api/agents";class EM extends Error{constructor(t,s){super(s),this.code=t,this.name="AgentApiError"}code}function RM(e){return Jo(jd,{signal:e})}function q9(e,t){return Jo(`${jd}/${encodeURIComponent(e)}/skills`,{signal:t})}function Y9(e,t){return Jo(`${jd}/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/bring-in`,{method:"POST"})}function $9(e,t){return Jo(`${jd}/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}`,{method:"DELETE"})}const jy=e=>["agents",e,"skills"];function G9(e,t){return Jo(lx(e,"instructions"),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({instructionIds:t})})}function Q9(e,t){return Jo(lx(e,"enabled"),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})})}function X9(e){return Jo(lx(e,"reapply"),{method:"POST"})}function lx(e,t){return`${jd}/${encodeURIComponent(e)}/${t}`}async function Jo(e,t){const s=await fetch(e,t);if(!s.ok){const i=await Z9(s);throw new EM(i.code,i.message)}return s.json()}async function Z9(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 Nr=["agents"],kh=["agents","update"];function J9(){const{t:e}=ht(),t=Or(),s=ri({queryKey:Nr,queryFn:({signal:h})=>RM(h),retry:!1});function i(h){t.setQueryData(Nr,x=>x?.map(S=>S.id===h.id?h:S))}const o=Un({mutationKey:kh,mutationFn:({agentId:h,instructionIds:x})=>G9(h,x),onMutate:async({previous:h})=>(await t.cancelQueries({queryKey:Nr}),{previous:h}),onError:(h,x,S)=>{S?.previous&&t.setQueryData(Nr,S.previous),Nt.error(e("agents.updateError"))},onSuccess:i,onSettled:()=>t.invalidateQueries({queryKey:Nr})}),l=Un({mutationKey:kh,mutationFn:({agentId:h,enabled:x})=>Q9(h,x),onMutate:async({agentId:h,enabled:x})=>{await t.cancelQueries({queryKey:Nr});const S=t.getQueryData(Nr);return t.setQueryData(Nr,w=>w?.map(C=>C.id===h?{...C,enabled:x}:C)),{previous:S}},onError:(h,x,S)=>{S?.previous&&t.setQueryData(Nr,S.previous),Nt.error(e("agents.enableError"))},onSuccess:h=>{i(h),Nt.success(e(h.enabled?"agents.applied":"agents.removed"))},onSettled:()=>t.invalidateQueries({queryKey:Nr})}),u=Un({mutationKey:kh,mutationFn:h=>X9(h),onSuccess:h=>{i(h),Nt.success(e("agents.reapplied"))},onError:()=>{Nt.error(e("agents.reapplyError"))},onSettled:()=>t.invalidateQueries({queryKey:Nr})}),d=Un({mutationKey:kh,mutationFn:({path:h})=>ox(h),onError:h=>{Nt.error(e(h instanceof wM&&h.code==="OPEN_PATH_NOT_FOUND"?"agents.fileMissing":"agents.openFileError"))}}),f=[o,l,u,d],g=new Set;for(const h of f){if(!h.isPending)continue;const x=W9(h.variables);x&&g.add(x)}const m=new Set(u.isPending&&typeof u.variables=="string"?[u.variables]:[]);return{agents:s.data??[],isLoading:s.isPending,isError:s.isError&&s.data===void 0,retry:s.refetch,pendingAgentIds:g,reapplyingAgentIds:m,updateInstructions:(h,x)=>{const S=t.getQueryData(Nr);t.setQueryData(Nr,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)=>{l.mutate({agentId:h,enabled:x})},reapply:h=>{u.mutate(h)},openFile:h=>{const x=s.data?.find(({id:S})=>S===h);x&&d.mutate({agentId:h,path:x.instructionFile})}}}function W9(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 ea({className:e,description:t,icon:s,title:i}){let o=null;return t!=null&&(o=y.jsx("p",{className:"max-w-64 text-xs/relaxed text-muted-foreground",children:t})),y.jsxs("div",{"data-slot":"empty",className:He(`
|
|
104
|
-
flex w-full flex-1 flex-col items-center justify-center gap-2 px-4
|
|
105
|
-
py-10 text-center
|
|
106
|
-
`,e),children:[s&&y.jsx("div",{className:`
|
|
107
|
-
flex size-8 items-center justify-center rounded-md bg-muted
|
|
108
|
-
text-muted-foreground
|
|
109
|
-
`,children:y.jsx(s,{"aria-hidden":"true",className:"size-4"})}),y.jsx("div",{className:"text-sm font-medium",children:i}),o]})}function eB(e){const[t,s]=b.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),i=b.useRef(null),o=b.useRef(null),l=b.useRef(null),u=b.useRef(null),d=b.useRef(!0),f=b.useRef(null),g=hc(),m=b.useMemo(()=>({anchor:t,setAnchor:s,actionsRef:l,backdropRef:i,internalBackdropRef:o,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:g}),[t,g]);return y.jsx(eA.Provider,{value:m,children:y.jsx(xg.Provider,{value:void 0,children:y.jsx(yA,{...e})})})}const QR=500,tB=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,{setAnchor:d,actionsRef:f,internalBackdropRef:g,backdropRef:m,positionerRef:h,allowMouseUpTriggerRef:x,initialCursorPointRef:S,rootId:w}=Sg(!1),{store:C}=sa(!1),E=C.useState("open"),R=C.useState("disabled"),O=b.useRef(null),T=b.useRef(null),A=Hn(),N=Hn(),j=b.useRef(!1),D=b.useRef(null);function M(U,_,Q){const G=Q.type.startsWith("touch");S.current={x:U,y:_},d({getBoundingClientRect(){return DOMRect.fromRect({width:G?10:0,height:G?10:0,x:U,y:_})}}),j.current=!1,f.current?.setOpen(!0,lt(Zs,Q)),N.start(QR,()=>{j.current=!0})}function z(U){if(R)return;x.current=!0,Qs(U),M(U.clientX,U.clientY,U.nativeEvent);const _=qt(O.current);D.current?.abort();const Q=new AbortController;D.current=Q,_.addEventListener("mouseup",G=>{if(x.current=!1,!j.current)return;N.clear(),j.current=!1;const q=sr(G);st(h.current,q)||w&&q&&Vb(q)===w||f.current?.setOpen(!1,lt(_v,G))},{once:!0,signal:Q.signal})}function L(){A.clear(),T.current=null}function K(U){if(R){L();return}if(x.current=!1,U.touches.length!==1){L();return}U.stopPropagation();const _=U.touches[0],Q={x:_.clientX,y:_.clientY};T.current=Q,A.start(QR,()=>{M(Q.x,Q.y,U.nativeEvent)})}function X(U){if(U.touches.length!==1){L();return}if(A.isStarted()&&T.current){const _=U.touches[0],Q=10,G=Math.abs(_.clientX-T.current.x),q=Math.abs(_.clientY-T.current.y);(G>Q||q>Q)&&L()}}return b.useEffect(()=>()=>{D.current?.abort()},[]),b.useEffect(()=>{function U(Q){if(R)return;const q=sr(Q);(st(O.current,q)||st(g.current,q)||st(m.current,q))&&Q.preventDefault()}const _=qt(O.current);return zt(_,"contextmenu",U)},[m,R,g]),bt("div",t,{state:{open:E},ref:[O,s],props:[{onContextMenu:z,onTouchStart:K,onTouchMove:X,onTouchEnd:L,onTouchCancel:L,style:{WebkitTouchCallout:"none"}},u],stateAttributesMapping:Vu})}),nB=fA;function Id({...e}){return y.jsx(eB,{"data-slot":"context-menu",...e})}function Pd({className:e,...t}){return y.jsx(tB,{"data-slot":"context-menu-trigger",className:He("select-none",e),...t})}function Ld({className:e,align:t="start",alignOffset:s=4,side:i="right",sideOffset:o=0,...l}){return y.jsx(uA,{children:y.jsx(nB,{className:"isolate z-50 outline-none",align:t,alignOffset:s,side:i,sideOffset:o,children:y.jsx(lA,{"data-slot":"context-menu-content",className:He("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),...l})})})}function fc({className:e,inset:t,variant:s="default",...i}){return y.jsx(oA,{"data-slot":"context-menu-item","data-inset":t,"data-variant":s,className:He("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),...i})}function rB({instructions:e,isLoading:t,isError:s,onRetry:i,onEdit:o,onDelete:l,onPreload:u}){const{t:d}=ht();return t?y.jsx(Qi,{className:"gap-0 py-0",children:y.jsx("div",{className:"divide-y",children:[0,1,2].map(f=>y.jsxs("div",{className:"flex items-center gap-2 p-3",children:[y.jsx(Gn,{className:"size-3.5 rounded-sm"}),y.jsx(Gn,{className:"h-4 w-2/3"})]},f))})}):s?y.jsxs(Qi,{className:"items-start gap-3 p-4",children:[y.jsx("p",{className:"text-xs text-muted-foreground",children:d("instructions.loadError")}),y.jsxs(Ze,{type:"button",variant:"outline",onClick:i,children:[y.jsx(bk,{}),y.jsx("span",{children:d("common.retry")})]})]}):e.length===0?y.jsx(Qi,{className:"gap-0 py-0",children:y.jsx(ea,{icon:lb,title:d("instructions.emptyTitle"),description:d("instructions.emptyDescription")})}):y.jsx(Qi,{className:"gap-0 py-0",children:y.jsx("ul",{"aria-label":d("instructions.listAria"),className:"divide-y",children:e.map(f=>y.jsx(sB,{instruction:f,onRequestDelete:()=>l(f),onEdit:()=>{o(f)},onPreload:u},f.id))})})}function sB({instruction:e,onEdit:t,onPreload:s,onRequestDelete:i}){const{t:o}=ht(),{attributes:l,isDragging:u,listeners:d,setNodeRef:f}=uM({id:L9(e.id),data:{type:"library-instruction",instructionId:e.id}});return y.jsxs(Id,{children:[y.jsxs(Pd,{ref:f,render:y.jsx("li",{...d,"data-instruction-id":e.id,className:He(`
|
|
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:[y.jsx(ub,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),y.jsx("button",{...l,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:s,onPointerEnter:s,children:y.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.name})}),y.jsxs(Wa,{children:[y.jsx(eo,{render:y.jsx(Ze,{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:y.jsx(ag,{})}),y.jsx(to,{align:"end",className:"w-40",children:y.jsx(XR,{Item:$a,onDelete:i,onEdit:t})})]})]}),y.jsx(Ld,{children:y.jsx(XR,{Item:fc,onDelete:i,onEdit:t})})]})}function XR({Item:e,onEdit:t,onDelete:s}){const{t:i}=ht();return y.jsxs(y.Fragment,{children:[y.jsxs(e,{onClick:t,children:[y.jsx(gk,{}),y.jsx("span",{children:i("instructions.edit")})]}),y.jsxs(e,{variant:"destructive",onClick:s,children:[y.jsx(qu,{}),y.jsx("span",{children:i("instructions.delete")})]})]})}const iB=["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"],aB=["America/Los_Angeles","America/New_York","Asia/Shanghai","Asia/Taipei","Asia/Tokyo","UTC"],oB=1,lB="settings.changed",cB=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function uB(e,t){return cB.compare(e,t)}const dB=64,fB=1024,hB=/^[\p{L}\p{N}]+(?:-[\p{L}\p{N}]+)*$/u;function CM(e){return e.trim().normalize("NFKC")}function pB(e){const t=CM(e);return[...t].length<=dB&&t===t.toLowerCase()&&hB.test(t)}function gB(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 TM({className:e,...t}){return y.jsx("label",{"data-slot":"label",className:He("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 ta({children:e,className:t,...s}){return y.jsxs(TM,{className:He("gap-1",t),...s,children:[e,y.jsx("span",{"aria-hidden":"true",className:"text-destructive",children:"*"})]})}function ii({...e}){return y.jsx(IA,{"data-slot":"dialog",...e})}function mB({...e}){return y.jsx(jA,{"data-slot":"dialog-portal",...e})}function zd({...e}){return y.jsx(Rg,{"data-slot":"dialog-close",...e})}function yB({className:e,...t}){return y.jsx(AA,{"data-slot":"dialog-overlay",className:He("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 ai({className:e,children:t,showCloseButton:s=!0,...i}){return y.jsxs(mB,{children:[y.jsx(yB,{}),y.jsxs(DA,{"data-slot":"dialog-content",className:He("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),...i,children:[t,s&&y.jsxs(Rg,{"data-slot":"dialog-close",render:y.jsx(Ze,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[y.jsx(ra,{}),y.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _s({className:e,...t}){return y.jsx("div",{"data-slot":"dialog-header",className:He("flex flex-col gap-1",e),...t})}function ei({className:e,showCloseButton:t=!1,children:s,...i}){return y.jsxs("div",{"data-slot":"dialog-footer",className:He("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...i,children:[s,t&&y.jsx(Rg,{render:y.jsx(Ze,{variant:"outline"}),children:"Close"})]})}function Us({className:e,...t}){return y.jsx(PA,{"data-slot":"dialog-title",className:He("font-heading text-sm font-medium",e),...t})}function ti({className:e,...t}){return y.jsx(MA,{"data-slot":"dialog-description",className:He("text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const cx="/api/instructions";class kM extends Error{constructor(t,s){super(s),this.code=t,this.name="InstructionApiError"}code}function vB(e){return ux(cx,{signal:e})}function bB(e){return ux(cx,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function xB(e,t){return ux(OM(e),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}async function SB(e){const t=await fetch(OM(e),{method:"DELETE"});if(t.ok)return;const s=await AM(t);throw new kM(s.code,s.message)}async function ux(e,t){const s=await fetch(e,t);if(!s.ok){const i=await AM(s);throw new kM(i.code,i.message)}return s.json()}function OM(e){return`${cx}/${encodeURIComponent(e)}`}async function AM(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 Wu=["instructions"];function wB(){const e=ri({queryKey:Wu,queryFn:({signal:t})=>vB(t),retry:!1});return{instructions:e.data??[],isLoading:e.isPending,isError:e.isError&&e.data===void 0,retry:e.refetch}}const EB="modulepreload",RB=function(e){return"/"+e},ZR={},CB=function(t,s,i){let o=Promise.resolve();if(s&&s.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(s.map(g=>{if(g=RB(g),g in ZR)return;ZR[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":EB,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 l(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"&&l(d.reason);return t().catch(l)})},MM=()=>CB(()=>import("./code-editor-nn2D110F.js").then(e=>e.j2),__vite__mapDeps([0,1]));function Iy(){MM()}const TB=b.lazy(async()=>({default:(await MM()).CodeEditor}));function NM(e){const{t}=ht();return y.jsx(b.Suspense,{fallback:y.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:y.jsx(TB,{...e})})}const kB="16rem";function JR({instruction:e,onClose:t}){const{t:s}=ht(),i=Or(),o=b.useId(),l=b.useId(),u=e!==void 0,[d,f]=b.useState(e?.name??""),[g,m]=b.useState(e?.content??""),h=Un({mutationFn:T=>e?xB(e.id,T):bB(T),onSuccess:T=>{i.setQueryData(Wu,A=>[...(A??[]).filter(N=>N.id!==T.id),T].toSorted((N,j)=>uB(N.name,j.name))),i.invalidateQueries({queryKey:Wu}),Nt.success(s(u?"instructions.updated":"instructions.created")),t()},onError:()=>{Nt.error(s(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?db:gc;function O(){x||t()}return y.jsx(ii,{open:!0,onOpenChange:T=>{T||O()},children:y.jsxs(ai,{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:[y.jsxs("form",{className:"contents","aria-busy":x,onSubmit:T=>{T.preventDefault(),S&&h.mutate({name:d.trim(),content:g})},children:[y.jsx(_s,{className:"pr-8",children:y.jsx(Us,{children:s(w)})}),y.jsxs("div",{className:"flex min-h-0 flex-col gap-3 overflow-y-auto pr-1",children:[y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(ta,{htmlFor:o,children:s("instructions.name")}),y.jsx(Od,{id:o,autoFocus:!0,required:!0,maxLength:200,value:d,disabled:x,placeholder:s("instructions.namePlaceholder"),onChange:T=>{f(T.target.value)}})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(ta,{id:l,children:s("instructions.content")}),y.jsx("div",{role:"group","aria-labelledby":l,"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:y.jsx(NM,{height:kB,value:g,ariaLabel:s("instructions.content"),placeholder:s("instructions.contentPlaceholder"),readOnly:x,onChange:m})})]})]}),y.jsxs(ei,{children:[y.jsx(Ze,{type:"button",variant:"ghost",disabled:x,onClick:O,children:s("common.cancel")}),y.jsxs(Ze,{type:"submit",disabled:!S,children:[x?y.jsx(Pr,{className:"animate-spin"}):y.jsx(R,{}),y.jsx("span",{children:s(x?C:E)})]})]})]}),y.jsxs(zd,{disabled:x,render:y.jsx(Ze,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[y.jsx(ra,{}),y.jsx("span",{className:"sr-only",children:s("a11y.close")})]})]})})}function OB({instruction:e,onClose:t}){const{t:s}=ht(),i=Or(),o=Un({mutationFn:()=>SB(e.id),onSuccess:()=>{i.setQueryData(Wu,u=>u?.filter(({id:d})=>d!==e.id)),i.setQueryData(Nr,u=>u?.map(d=>{const f=d.instructionIds.filter(g=>g!==e.id);return{...d,instructionIds:f,enabled:f.length>0&&d.enabled}})),i.invalidateQueries({queryKey:Wu}),i.invalidateQueries({queryKey:Nr}),Nt.success(s("instructions.deleted")),t()},onError:()=>Nt.error(s("instructions.deleteError"))}),l=()=>{o.isPending||t()};return y.jsx(ii,{open:!0,onOpenChange:u=>{u||l()},children:y.jsxs(ai,{showCloseButton:!1,children:[y.jsxs(_s,{children:[y.jsx(Us,{children:s("instructions.deleteConfirmTitle")}),y.jsx(ti,{children:s("instructions.deleteConfirmDescription",{name:e.name})})]}),y.jsxs(ei,{children:[y.jsx(Ze,{type:"button",variant:"ghost",disabled:o.isPending,onClick:l,children:s("common.cancel")}),y.jsxs(Ze,{type:"button",variant:"destructive",disabled:o.isPending,onClick:()=>o.mutate(),children:[o.isPending&&y.jsx(Pr,{className:"animate-spin"}),y.jsx("span",{children:s("instructions.delete")})]})]})]})})}const AB=e=>{const t=e.active.data.current;if(sc(t))return MB(e,t.agentId);const s=e.pointerCoordinates?r7(e):JF(e),i=s.filter(({id:o})=>z9(o));return i.length>0?i:s};function MB(e,t){const s=e.collisionRect.left+e.collisionRect.width/2,i=e.collisionRect.top+e.collisionRect.height/2,o=e.droppableRects.get(SM(t));if(o&&(s<o.left||s>o.left+o.width||i<o.top||i>o.top+o.height))return[];let l;for(const u of e.droppableContainers){const d=u.data.current;if(!sc(d)||d.agentId!==t)continue;const f=e.droppableRects.get(u.id);if(!f)continue;const g=(f.left+f.width/2-s)**2+(f.top+f.height/2-i)**2;(!l||g<l.distance)&&(l={id:u.id,distance:g})}return l?[{id:l.id}]:[]}function NB(){const{t:e}=ht(),[t,s]=b.useState(null),[i,o]=b.useState(!1),[l,u]=b.useState(null),[d,f]=b.useState(null),g=wB(),m=J9(),h=QF(Ay(rM,{activationConstraint:{distance:4}}),Ay(sM,{activationConstraint:{delay:200,tolerance:8}}),Ay(tx,{coordinateGetter:T9})),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=DB(w),E=C?x.get(C)?.name??C:"",R=t?.rect.current.initial?.width;function O(N,j,D){const M=m.agents.find(({id:K})=>K===N);if(!M||m.pendingAgentIds.has(N))return;if(M.instructionIds.includes(j)){Nt.error(e("agents.duplicateError"));return}const z=[...M.instructionIds],L=D?z.indexOf(D):-1;z.splice(L<0?z.length:L,0,j),m.updateInstructions(N,z)}function T(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(s(null),!j)return;const D=N.data.current,M=j.data.current;if(xv(D)){if(GR(M)){O(M.agentId,D.instructionId);return}sc(M)&&O(M.agentId,D.instructionId,M.instructionId);return}if(!sc(D))return;const z=m.agents.find(({id:H})=>H===D.agentId);if(!z||m.pendingAgentIds.has(z.id))return;const L=z.instructionIds,K=L.indexOf(D.instructionId),X=sc(M)&&M.agentId===D.agentId?L.indexOf(M.instructionId):GR(M)&&M.agentId===D.agentId?L.length-1:-1;if(K===X||K===-1||X===-1)return;const B=sx([...L],K,X);B.length===L.length&&B.every((H,U)=>H===L[U])||m.updateInstructions(z.id,B)}return y.jsxs($7,{sensors:h,collisionDetection:AB,onDragStart:({active:N})=>{s(N)},onDragCancel:()=>{s(null)},onDragEnd:A,children:[y.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:[y.jsx(FA,{children:y.jsxs(Ze,{type:"button",onFocus:Iy,onPointerEnter:Iy,onClick:()=>{o(!0)},children:[y.jsx(gc,{}),y.jsx("span",{children:e("instructions.create")})]})}),y.jsxs("section",{className:"flex min-h-0 flex-col gap-2",children:[y.jsxs("div",{className:"flex items-baseline justify-between gap-3 px-1",children:[y.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:e("nav.instructions")}),y.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:e("instructions.dragHint")})]}),y.jsx("div",{className:`
|
|
140
|
-
min-h-0 flex-1 overflow-y-auto p-1
|
|
141
|
-
max-md:max-h-64
|
|
142
|
-
`,children:y.jsx(rB,{instructions:g.instructions,isLoading:g.isLoading,isError:g.isError,onRetry:()=>{g.retry()},onEdit:N=>{f(N.id)},onDelete:N=>{u(N)},onPreload:Iy})})]}),y.jsxs("section",{className:"flex min-h-0 flex-col gap-2",children:[y.jsxs("div",{className:"flex items-baseline justify-between gap-3 px-1",children:[y.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:e("agents.title")}),y.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:e("agents.orderHint")})]}),y.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&&y.jsx(jB,{}),!m.isLoading&&m.isError&&y.jsxs(Qi,{className:"items-start gap-3 p-4",children:[y.jsx("p",{className:"text-xs text-muted-foreground",children:e("agents.loadError")}),y.jsxs(Ze,{type:"button",variant:"outline",onClick:()=>{m.retry()},children:[y.jsx(bk,{}),y.jsx("span",{children:e("common.retry")})]})]}),!m.isLoading&&!m.isError&&m.agents.map(N=>y.jsx(V9,{agent:N,instructionsById:x,isInstructionsLoading:g.isLoading,isPending:m.pendingAgentIds.has(N.id),isReapplying:m.reapplyingAgentIds.has(N.id),onRemoveInstruction:T,onToggle:(j,D)=>{m.setEnabled(j,D)},onReapply:j=>{m.reapply(j)},onOpenFile:j=>{m.openFile(j)}},N.id))]})]}),l&&y.jsx(OB,{instruction:l,onClose:()=>u(null)}),i&&y.jsx(JR,{onClose:()=>{o(!1)}}),S&&y.jsx(JR,{instruction:S,onClose:()=>{f(null)}})]}),xv(w)&&y.jsx(u9,{dropAnimation:null,children:E&&y.jsxs("div",{style:{width:R},className:"flex items-center gap-2 bg-card px-3 py-2.5 text-xs",children:[y.jsx(ub,{className:"size-3.5 text-muted-foreground"}),y.jsx("span",{className:"truncate",children:E})]})})]})}function DB(e){if(xv(e)||sc(e))return e.instructionId}function jB(){return y.jsx(y.Fragment,{children:[0,1].map(e=>y.jsxs(Qi,{className:"gap-0 py-0",children:[y.jsxs("div",{className:"flex items-center gap-3 p-3",children:[y.jsx(Gn,{className:"size-8 rounded-md"}),y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx(Gn,{className:"h-4 w-24"}),y.jsx(Gn,{className:"mt-2 h-3 w-40"})]}),y.jsx(Gn,{className:"h-4 w-7 rounded-full"})]}),y.jsx("div",{className:"border-t border-border/60 p-3",children:y.jsx(Gn,{className:"h-20 w-full"})})]},e))})}class Qa extends Error{constructor(t,s){super(s),this.code=t,this.name="SkillApiError"}code}async function Oi(e,t){const s=await fetch(e,t);if(!s.ok){const i=await s.json();throw new Qa(i.error?.code??"SKILL_REQUEST_FAILED",i.error?.message??`Request failed with status ${s.status}`)}return s.status===204?void 0:s.json()}function IB(e){return Oi("/api/skills",{signal:e})}function DM(e,t){return Oi(`/api/skills/${encodeURIComponent(e)}`,{signal:t})}function PB(e){return Oi("/api/skills",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function LB(e){return Oi("/api/skills/import/local",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function zB(e){return Oi("/api/skills/import/url",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function _B(e,t){return Oi(`/api/skills/${encodeURIComponent(e)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}function UB(e){return Oi(`/api/skills/${encodeURIComponent(e)}`,{method:"DELETE"})}function jM(e){return Oi("/api/skills/agents/assignments",{signal:e})}function IM(e,t,s){return Oi(`/api/skills/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({assigned:s})})}const qo=["skills"],Uo=e=>["skills",e],ic=["skills","agents","assignments"];function HB(e,t){return Oi(`/api/skills/${encodeURIComponent(e)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({files:t})})}const PM=["skill-batch-assignment"];function FB({className:e,...t}){return y.jsx("textarea",{"data-slot":"textarea",className:He("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 Sv({skill:e,onClose:t,onSaved:s}){const{t:i}=ht(),o=Xo(),l=Or(),u=b.useId(),d=b.useId(),f=e!==void 0,[g,m]=b.useState(e?.name??""),[h,x]=b.useState(e?.description??""),S=Un({mutationFn:R=>e?_B(e.name,R):PB(R),onSuccess:R=>{const O=e?l.getQueryData(Uo(e.name)):void 0;e&&e.name!==R.name&&l.removeQueries({queryKey:Uo(e.name),exact:!0}),O?.files&&l.setQueryData(Uo(R.name),{...O,...R}),l.invalidateQueries({queryKey:qo}),Nt.success(i(f?"skills.updated":"skills.created")),t(),s?.(R),f||o(`/library/skills/${encodeURIComponent(R.name)}`)},onError:R=>{R instanceof Qa&&R.code==="SKILL_LINK_CONFLICT"?Nt.error(i("skills.linkConflict")):R instanceof Qa&&R.code==="SKILL_NAME_CONFLICT"?Nt.error(i("skills.nameConflict")):Nt.error(i(f?"skills.updateError":"skills.createError"))}}),w=S.isPending,C=pB(g)&&!!h.trim()&&!w;function E(){w||t()}return y.jsx(ii,{open:!0,onOpenChange:R=>{R||E()},children:y.jsxs(ai,{showCloseButton:!1,className:`
|
|
147
|
-
max-h-[calc(100vh-2rem)] overflow-y-auto
|
|
148
|
-
sm:max-w-120
|
|
149
|
-
`,children:[y.jsxs("form",{className:"flex flex-col gap-4","aria-busy":w,onSubmit:R=>{R.preventDefault(),C&&S.mutate({name:CM(g),description:h.trim()})},children:[y.jsxs(_s,{className:"pr-8",children:[y.jsx(Us,{children:i(f?"skills.editTitle":"skills.createManually")}),y.jsx(ti,{children:i(f?"skills.editDescription":"skills.createManuallyDescription")})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(ta,{htmlFor:u,children:i("skills.name")}),y.jsx(Od,{id:u,autoFocus:!0,required:!0,"aria-describedby":`${u}-hint`,placeholder:i("skills.namePlaceholder"),value:g,disabled:w,onChange:R=>{m(R.target.value)}}),y.jsx("p",{id:`${u}-hint`,className:"text-xs text-muted-foreground",children:i("skills.nameHint")})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(ta,{htmlFor:d,children:i("skills.description")}),y.jsx(FB,{id:d,required:!0,rows:3,maxLength:fB,placeholder:i("skills.descriptionPlaceholder"),value:h,disabled:w,onChange:R=>{x(R.target.value)}})]}),y.jsxs(ei,{children:[y.jsx(Ze,{type:"button",variant:"ghost",disabled:w,onClick:E,children:i("common.cancel")}),y.jsxs(Ze,{type:"submit",disabled:!C,children:[w?y.jsx(Pr,{className:"animate-spin"}):f?y.jsx(db,{}):y.jsx(gc,{}),y.jsx("span",{children:i(w?f?"skills.updating":"skills.creating":f?"skills.saveChanges":"skills.create")})]})]})]}),y.jsxs(zd,{disabled:w,render:y.jsx(Ze,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[y.jsx(ra,{}),y.jsx("span",{className:"sr-only",children:i("a11y.close")})]})]})})}class wv extends Error{constructor(t,s){super(s),this.code=t}code}async function BB(e){const t=await fetch("/api/file-picker",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const s=await t.json();throw new wv(s.error?.code??"FILE_PICKER_FAILED",s.error?.message??"Unable to open file picker")}return(await t.json()).path}function VB({isPending:e,onClose:t,onImport:s}){const{t:i}=ht(),o=b.useId(),[l,u]=b.useState("");let d=!1;try{const g=new URL(l.trim());d=["http:","https:"].includes(g.protocol)&&!g.username&&!g.password}catch{}function f(){e||t()}return y.jsx(ii,{open:!0,onOpenChange:g=>{g||f()},children:y.jsxs(ai,{showCloseButton:!1,className:`
|
|
150
|
-
max-h-[calc(100vh-2rem)] overflow-y-auto
|
|
151
|
-
sm:max-w-120
|
|
152
|
-
`,children:[y.jsxs("form",{className:"flex flex-col gap-4","aria-busy":e,onSubmit:g=>{g.preventDefault(),d&&!e&&s(l.trim())},children:[y.jsxs(_s,{className:"pr-8",children:[y.jsx(Us,{children:i("skills.importUrl")}),y.jsx(ti,{children:i("skills.importUrlDescription")})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(ta,{htmlFor:o,children:i("skills.url")}),y.jsx(Od,{id:o,autoFocus:!0,required:!0,type:"url",placeholder:i("skills.importUrlHint"),autoComplete:"off",spellCheck:!1,value:l,disabled:e,onChange:g=>u(g.target.value)})]}),y.jsxs(ei,{children:[y.jsx(Ze,{type:"button",variant:"ghost",disabled:e,onClick:f,children:i("common.cancel")}),y.jsxs(Ze,{type:"submit",disabled:!d||e,children:[e?y.jsx(Pr,{className:"animate-spin"}):y.jsx(ig,{}),y.jsx("span",{children:i(e?"skills.importing":"skills.importSubmit")})]})]})]}),y.jsxs(zd,{disabled:e,render:y.jsx(Ze,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[y.jsx(ra,{}),y.jsx("span",{className:"sr-only",children:i("a11y.close")})]})]})})}const KB=[{titleKey:"skills.createManually",descriptionKey:"skills.createManuallyDescription",icon:gc},{titleKey:"skills.importLocal",descriptionKey:"skills.importLocalDescription",icon:cb},{titleKey:"skills.importUrl",descriptionKey:"skills.importUrlDescription",icon:ig}],WR={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 qB({onCreateManually:e}){const{t}=ht(),s=Or(),i=Xo(),[o,l]=b.useState(!1),u=Un({mutationFn:m=>"url"in m?zB(m):LB(m),onSuccess:m=>{l(!1),s.invalidateQueries({queryKey:qo});const h=t("skills.importSummary",{imported:m.imported.length,skipped:m.skipped.length});m.skipped.length>0?Nt.warning(h,{description:y.jsx("ul",{className:"max-h-40 overflow-y-auto",children:m.skipped.map(x=>y.jsxs("li",{className:"wrap-break-word",children:[x.source,":",t(x.code==="SKILL_NAME_CONFLICT"?"skills.importSkippedConflict":WR[x.code]??"skills.importSkippedInvalid")]},x.source))})}):Nt.success(h),m.imported.length===1&&m.skipped.length===0&&i(`/library/skills/${encodeURIComponent(m.imported[0].name)}`)},onError:m=>{const h=m instanceof Qa?WR[m.code]:void 0;Nt.error(t(h??"skills.importError"))}}),d=Un({mutationFn:()=>BB({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 wv&&m.code==="FILE_PICKER_UNAVAILABLE"?h="filePicker.unavailable":m instanceof wv&&m.code==="FILE_PICKER_BUSY"&&(h="filePicker.busy"),Nt.error(t(h))}}),f=d.isPending||u.isPending;let g="skills.new";return d.isPending?g="filePicker.selecting":u.isPending&&(g="skills.importing"),y.jsxs(y.Fragment,{children:[y.jsxs(Wa,{children:[y.jsxs(eo,{render:y.jsx(Ze,{type:"button",disabled:f}),children:[f?y.jsx(Pr,{className:"animate-spin"}):y.jsx(gc,{}),y.jsx("span",{children:t(g)}),y.jsx(ab,{})]}),y.jsx(to,{align:"end",className:"w-max max-w-[min(20rem,calc(100vw-2rem))]",children:KB.map(({titleKey:m,descriptionKey:h,icon:x})=>y.jsxs($a,{className:"items-start gap-2 p-2",onClick:()=>{m==="skills.createManually"?e():m==="skills.importLocal"?d.mutate():l(!0)},children:[y.jsx(x,{"aria-hidden":"true",className:"mt-0.5 size-4"}),y.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5 whitespace-normal",children:[y.jsx("span",{className:"text-sm",children:t(m)}),y.jsx("span",{className:"text-xs text-muted-foreground",children:t(h)})]})]},m))})]}),o&&y.jsx(VB,{isPending:u.isPending,onClose:()=>l(!1),onImport:m=>u.mutate({url:m})})]})}function YB(e){if(!e)return null;for(const t of e.elements){const s=t.tagName;if(s==="BUTTON"||s==="INPUT"){const i=t;if(i.type==="submit")return i}}return null}const $B="data-checked",GB="data-unchecked";function LM(e){return{checked(t){return e.indeterminate?{}:t?{[$B]:""}:{[GB]:""}},...bc}}const QB=b.createContext(void 0);function XB(){return b.useContext(QB)}const zM=b.createContext(void 0);function ZB(){const e=b.useContext(zM);if(e===void 0)throw new Error(cn(14));return e}const JB="data-parent",WB=b.forwardRef(function(t,s){const{checked:i,className:o,defaultChecked:l=!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:O,value:T,nativeButton:A=!1,style:N,...j}=t,{clearErrors:D}=Cd(),{disabled:M,name:z,setDirty:L,setFilled:K,setTouched:X,state:B,validationMode:H,validityData:U,validation:_}=ia(),Q=TA(),{labelId:G,registerControlId:q,getDescriptionProps:Y}=Zo(),ee=XB(),$=ee?.allValues===void 0?void 0:ee.parent,ae=$!==void 0,I=M||Q.disabled||ee?.disabled||d,F=z??x,Z=T??F,ne=Qn(),ye=ee?.registerControlId!==q,se=xc({id:g||void 0,enabled:ye}),ge=A?se:ne;let fe={};ae&&(w?fe=$.getParentProps():Z!==void 0&&(fe=$.getChildProps(Z)));const{checked:ce=i,indeterminate:Re=m,onCheckedChange:be,...Le}=fe,Oe=ee?.value,ze=b.useRef(null),Ve=Td(I,ze),{getButtonProps:ke,buttonRef:Ue}=ns({disabled:I,native:A}),xe=ee?.validation??_,[Fe,Je]=Ci({controlled:Z!==void 0&&Oe!==void 0&&!w?Oe.includes(Z):ce,default:l,name:"Checkbox",state:"checked"}),ot=ae?!!ce:Fe,de=ae&&Re||m;kd(ze,ne,Fe,void 0,!ee&&!I,x);const Ee=$?.registerChildId,$e=b.useRef(null),Me=xe.registerInput,De=ee?Z:void 0,xt=b.useCallback(et=>Me(et,{controlRef:ze,value:De}),[Me,De]),dt=es(h,$e,w?void 0:xt),gt=qb(u,G,$e,!A,se,j["aria-label"]);Pe(()=>{$e.current&&($e.current.indeterminate=de),ee||K(Fe)},[Fe,de,ee,K]),mc(Fe,()=>{ee||(D(F),L(Fe!==U.initialValue),xe.change(Fe))});const Dt=Ir({checked:Fe,disabled:I,form:f,name:w?void 0:F,id:A?void 0:se,required:R,ref:dt,style:F?Pp:ld,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(et){if(et.nativeEvent.defaultPrevented)return;if(C){et.preventDefault();return}const Et=et.currentTarget.checked,Zt=lt(kr,et.nativeEvent);if(S?.(Et,Zt),!Zt.isCanceled&&(be?.(Et,Zt),!Zt.isCanceled&&(Je(Et),Z!==void 0&&ee!==void 0&&!w&&!ae))){const pt=Et?[...ee.value,Z]:ee.value.filter(St=>St!==Z);ee.setValue(pt,Zt)}},onClick(et){et.stopPropagation()},onFocus(){ze.current?.focus()}},T!==void 0?{value:(ee?Fe&&T:T)||""}:Xt,Y,et=>xe.getValidationProps(I,et));b.useEffect(()=>{if(!$||Z===void 0)return;const et=$.disabledStatesRef.current;return et.set(Z,I),()=>{et.delete(Z)}},[$,I,Z]);const It=b.useMemo(()=>({...B,checked:ot,disabled:I,readOnly:C,required:R,indeterminate:de}),[B,ot,I,C,R,de]),tn=LM(It),an=bt("span",t,{state:It,ref:[Ue,ze,s],props:[{id:ge,role:"checkbox","aria-checked":de?"mixed":ot,"aria-readonly":C||void 0,"aria-required":R||void 0,"aria-labelledby":gt,[JB]:w?"":void 0,onFocus(){Ve(!0)},onBlur(){const et=$e.current;et&&(X(!0),Ve(!1),H==="onBlur"&&xe.commit(ee?Oe:et.checked))},onKeyDown(et){if(et.key!=="Enter"||(et.preventBaseUIHandler(),et.defaultPrevented))return;const Et=$e.current?.form??null,Zt=et.currentTarget,pt=et.nativeEvent,St=et.preventDefault,yt=pt.preventDefault;let Ht=!1;et.preventDefault=()=>{Ht=!0,St.call(et)},pt.preventDefault=()=>{Ht=!0,yt.call(pt)},yt.call(pt),Rn(Zt).queueMicrotask(()=>{et.preventDefault=St,pt.preventDefault=yt,Ht||YB(Et)?.click()})},onClick(et){if(C||I)return;et.preventDefault();const Et=$e.current;Et&&_o(Et,et)}},j,Le,ke,Y,et=>xe.getValidationProps(I,et)],stateAttributesMapping:tn}),nn=an.props.id;return Pe(()=>{if(!(!Ee||w||Z===void 0||nn===void 0))return Ee(Z,nn)},[Ee,w,Z,nn]),y.jsxs(zM.Provider,{value:It,children:[an,!Fe&&!ee&&F&&!w&&O!==void 0&&y.jsx("input",{type:"hidden",form:f,name:F,value:O,disabled:I}),y.jsx("input",{...Dt,suppressHydrationWarning:!0})]})}),eV=b.forwardRef(function(t,s){const{render:i,className:o,style:l,keepMounted:u=!1,...d}=t,f=ZB(),g=f.checked||f.indeterminate,{mounted:m,transitionStatus:h,setMounted:x}=Ja(g),S=b.useRef(null),w={...f,transitionStatus:h};bs({batch:!0,enabled:!g,open:g,ref:S,onComplete(){g||x(!1)}});const E={...LM(f),...ni},R=u||m,O=bt("span",t,{ref:[s,S],state:w,stateAttributesMapping:E,props:d});return R?O:null});function _M({className:e,...t}){return y.jsx(WB,{"data-slot":"checkbox",className:He("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:y.jsx(eV,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:y.jsx(pd,{})})})}function UM({skill:e,to:t,isSelected:s=!1,leading:i,secondary:o,trailing:l,className:u,...d}){const f=y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-sm",children:[y.jsx("span",{className:"min-w-0 truncate font-medium",children:e.name}),y.jsx("span",{className:"min-w-0 flex-1 basis-0 truncate text-muted-foreground",children:e.description})]}),o]});return y.jsxs("div",{role:"listitem","data-selected":s||void 0,className:He(`
|
|
153
|
-
group flex min-h-9 items-center rounded-md px-2 transition-colors
|
|
154
|
-
hover:bg-muted/50
|
|
155
|
-
has-aria-expanded:bg-muted/50
|
|
156
|
-
data-selected:bg-muted/50
|
|
157
|
-
`,u),...d,children:[i,t?y.jsx(vc,{to:t,className:`
|
|
158
|
-
flex min-w-0 flex-1 flex-col gap-1 rounded-sm
|
|
159
|
-
focus-visible:outline-2 focus-visible:outline-ring
|
|
160
|
-
`,children:f}):y.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:f}),l]})}const HM=b.createContext(void 0);function tV(){return b.useContext(HM)}const nV=b.forwardRef(function(t,s){const{className:i,defaultPressed:o=!1,disabled:l=!1,form:u,onPressedChange:d,pressed:f,render:g,type:m,value:h,nativeButton:x=!0,style:S,...w}=t,C=Qn(h||void 0),E=tV(),R=E?.value??[],O=(l||E?.disabled)??!1,[T,A]=Ci({controlled:E?C!==void 0&&R.indexOf(C)>-1:f,default:o,name:"Toggle",state:"pressed"}),{getButtonProps:N,buttonRef:j}=ns({disabled:O,native:x}),D={disabled:O,pressed:T},M=[j,s],z=[{"aria-pressed":T,onClick(X){const B=!T,H=lt(kr,X.nativeEvent);d?.(B,H),!H.isCanceled&&(C&&E?.setGroupValue?.(C,B,H),!H.isCanceled&&A(B))}},w,N],L=bt("button",t,{enabled:!E,state:D,ref:M,props:z}),K=b.useMemo(()=>({disabled:O,focusableWhenDisabled:!1}),[O]);return E?y.jsx(Bb,{tag:"button",render:g,className:i,style:S,metadata:K,state:D,refs:M,props:z}):L}),Dg="data-composite-item-active";function rV(e){const{loopFocus:t=!0,orientation:s="both",grid:i,onLoop:o,direction:l,highlightedIndex:u,onHighlightedIndexChange:d,rootRef:f,enableHomeAndEndKeys:g=!1,stopEventPropagation:m,disabledIndices:h,modifierKeys:x=Ls}=e,[S,w]=b.useState(0),C=i!=null,E=b.useRef(null),R=es(E,f),O=b.useRef([]),T=b.useRef(!1),A=b.useRef(null),N=u??S,j=Be((K,X=!1)=>{if(A.current=O.current[K]??null,(d??w)(K),X){const B=O.current[K];YE(E.current,B,l,s)}}),D=Be(K=>{if(K.size===0)return;if(T.current){const U=O.current,_=U.indexOf(A.current);if(_===-1){const Q=U[N];!Q||Xl(U,N,h)?j(sV(U,h)):A.current=Q}else _!==N&&j(_);return}T.current=!0;const X=Array.from(K.keys()),B=X.find(U=>U?.hasAttribute(Dg))??null,H=B?K.get(B)?.index??-1:-1;if(H!==-1)j(H);else if(Xl(X,N,h)){const U=Ql(X,{disabledIndices:h});Gl(X,U)||j(U)}YE(E.current,B,l,s)});Pe(()=>{if(h==null||u!=null||!T.current)return;const K=O.current;if(Xl(K,N,h)){const X=Ql(K,{disabledIndices:h});Gl(K,X)||j(X)}},[h,u,N,O,j]);const M=Be((K,X,B)=>o?o(K,X,B,O):B),z=Be(K=>{const X=K.key===sv||K.key===iv;if(!yd.has(K.key)||!g&&X||iV(K,x)||!E.current)return;const H=l==="rtl",U=H?nv:rv,_=H?rv:nv,Q=s==="vertical"?tv:U,G=s==="vertical"?ev:_,q=sr(K.nativeEvent);if(q!=null&&qE(q)&&!xA(q)){const F=q.selectionStart,Z=q.selectionEnd,ne=q.value;if(F==null||K.shiftKey||F!==Z||K.key!==G&&F<ne.length||K.key!==Q&&F>0)return}let Y=N;const ee=Nh(O,h),$=Ky(O,h);i!=null&&(Y=i({disabledIndices:h,elementsRef:O,event:K,highlightedIndex:N,loopFocus:t,maxIndex:$,minIndex:ee,onLoop:M,orientation:s,rtl:H}));const ae=s!=="vertical"&&K.key===U||s!=="horizontal"&&K.key===tv,I=s!=="vertical"&&K.key===_||s!=="horizontal"&&K.key===ev;g&&(K.key===sv?Y=ee:K.key===iv&&(Y=$)),Y===N&&(ae||I)&&(t&&Y===$&&ae?(Y=ee,o&&(Y=o(K,N,Y,O))):t&&Y===ee&&I?(Y=$,o&&(Y=o(K,N,Y,O))):Y=Ql(O.current,{startingIndex:Y,decrement:I,disabledIndices:h})),Y!==N&&!Gl(O.current,Y)&&(m&&K.stopPropagation(),(C||X||ae||I)&&K.preventDefault(),j(Y,!0),queueMicrotask(()=>{O.current[Y]?.focus()}))});return{props:{ref:R,onFocus(K){const X=E.current,B=sr(K.nativeEvent);!X||B==null||!qE(B)||B.setSelectionRange(0,B.value.length)},onKeyDown:z},highlightedIndex:N,onHighlightedIndexChange:j,elementsRef:O,onMapChange:D,relayKeyboardEvent:z}}function sV(e,t){let s=-1;for(let i=0;i<e.length;i+=1){const o=e[i];if(!(!o||Xl(e,i,t))){if(o.hasAttribute(Dg))return i;s===-1&&(s=i)}}return Math.max(s,0)}function iV(e,t){for(const s of Cz)if(!t.includes(s)&&e.getModifierState(s))return!0;return!1}function dx(e){const{render:t,className:s,style:i,refs:o=Ls,props:l=Ls,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:O,modifierKeys:T,highlightItemOnHover:A=!1,tag:N="div",...j}=e,D=tg(),{props:M,highlightedIndex:z,onHighlightedIndexChange:L,elementsRef:K,onMapChange:X,relayKeyboardEvent:B}=rV({grid:h,loopFocus:x,onLoop:S,orientation:m,highlightedIndex:f,onHighlightedIndexChange:g,rootRef:R,stopEventPropagation:E,enableHomeAndEndKeys:w,direction:D,disabledIndices:O,modifierKeys:T}),H=bt(N,e,{state:u,ref:o,props:[M,...l,j],stateAttributesMapping:d}),U=b.useMemo(()=>({highlightedIndex:z,onHighlightedIndexChange:L,highlightItemOnHover:A,relayKeyboardEvent:B}),[z,L,A,B]);return y.jsx(Bk.Provider,{value:U,children:y.jsx(Eg,{elementsRef:K,onMapChange:_=>{C?.(_),X(_)},children:H})})}const aV=b.createContext(void 0);function oV(){return b.useContext(aV)}const lV=b.forwardRef(function(t,s){const{defaultValue:i,disabled:o=!1,loopFocus:l=!0,onValueChange:u,orientation:d="horizontal",multiple:f=!1,value:g,className:m,render:h,style:x,...S}=t,w=dg(),C=oV(),E=i??Ls,R=g!==void 0||i!==void 0,O=(w?.disabled??!1)||(C?.disabled??!1)||o,[T,A]=Ci({controlled:g,default:E,name:"ToggleGroup",state:"value"}),N=Be((L,K,X)=>{let B;f?(B=T.slice(),K?B.push(L):B.splice(T.indexOf(L),1)):B=K?[L]:[],u?.(B,X),!X.isCanceled&&A(B)}),j={disabled:O,multiple:f,orientation:d},D=b.useMemo(()=>({disabled:O,setGroupValue:N,value:T,isValueInitialized:R}),[O,N,T,R]),M={role:"group"},z=bt("div",t,{enabled:!!w,state:j,ref:s,props:[M,S]});return y.jsx(HM.Provider,{value:D,children:w?z:y.jsx(dx,{render:h,className:m,style:x,state:j,refs:[s],props:[M,S],loopFocus:l,enableHomeAndEndKeys:!0,orientation:d})})}),cV=$o("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"}}),FM=b.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal"});function uV({className:e,variant:t,size:s,spacing:i=2,orientation:o="horizontal",children:l,...u}){return y.jsx(lV,{"data-slot":"toggle-group","data-variant":t,"data-size":s,"data-spacing":i,"data-orientation":o,style:{"--gap":i},className:He("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:y.jsx(FM.Provider,{value:{variant:t,size:s,spacing:i,orientation:o},children:l})})}function dV({className:e,children:t,variant:s="default",size:i="default",...o}){const l=b.useContext(FM);return y.jsx(nV,{"data-slot":"toggle-group-item","data-variant":l.variant||s,"data-size":l.size||i,"data-spacing":l.spacing,className:He("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",cV({variant:l.variant||s,size:l.size||i}),e),...o,children:t})}function BM({agents:e,value:t,onValueChange:s,label:i,disabled:o=!1,shouldShowNames:l=!1}){return y.jsx(uV,{multiple:!0,value:t,onValueChange:s,disabled:o,"aria-label":i,className:"max-w-full flex-wrap",children:e.map(u=>y.jsxs(dV,{value:u.id,"aria-label":u.name,title:u.name,className:He("disabled:opacity-100",!l&&"size-7 p-0"),children:[y.jsx(ax,{icon:u.icon,monochrome:!t.includes(u.id),className:"size-4 rounded-none bg-transparent"}),l&&y.jsx("span",{children:u.name})]},u.id))})}function VM({name:e}){const{t}=ht(),s=Or(),i=ri({queryKey:ic,queryFn:({signal:f})=>jM(f)}),o=["skill-assignment",e],l=fg({mutationKey:o})>0,u=Un({mutationKey:o,mutationFn:({id:f,assigned:g})=>IM(e,f,g),onSuccess:f=>{s.setQueryData(ic,g=>g&&{...g,skills:g.skills.map(m=>m.name===f.name?f:m)})},onError:f=>{Nt.error(t(f instanceof Qa&&f.code==="SKILL_LINK_CONFLICT"?"skills.linkConflict":"skills.assignmentError"))},onSettled:()=>s.invalidateQueries({queryKey:ic})});if(i.isPending)return y.jsx(Gn,{className:"h-7 w-16"});if(i.isError)return y.jsx(Ze,{variant:"ghost",onClick:()=>{i.refetch()},children:t("common.retry")});if(i.data.agents.length===0)return y.jsx("span",{className:"text-xs text-muted-foreground",children:t("skills.noAgents")});const d=i.data.skills.find(f=>f.name===e)?.agentIds??[];return y.jsx("div",{"aria-busy":l,children:y.jsx(BM,{agents:i.data.agents,value:d,disabled:l,label:t("skills.assignTitle",{name:e}),onValueChange:f=>{const g=i.data.agents.find(m=>f.includes(m.id)!==d.includes(m.id))?.id;g&&!l&&u.mutate({id:g,assigned:f.includes(g)})}})})}function fV({skill:e,isSelected:t,selectionDisabled:s,onSelectedChange:i,onEdit:o,onDelete:l,onAssign:u}){const{t:d}=ht();return y.jsxs(Id,{children:[y.jsx(Pd,{className:"contents",children:y.jsx(UM,{skill:e,to:`/library/skills/${encodeURIComponent(e.name)}`,isSelected:t,leading:y.jsx("div",{className:"flex w-8 shrink-0 items-center",children:y.jsx(_M,{checked:t,disabled:s,onCheckedChange:i,"aria-label":d("skills.selectAria",{name:e.name}),className:`
|
|
161
|
-
opacity-0
|
|
162
|
-
group-focus-within:opacity-100
|
|
163
|
-
group-hover:opacity-100
|
|
164
|
-
focus-visible:opacity-100
|
|
165
|
-
data-checked:opacity-100
|
|
166
|
-
[@media(hover:none)]:opacity-100
|
|
167
|
-
`})}),trailing:!t&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:`
|
|
168
|
-
ml-2 hidden shrink-0
|
|
169
|
-
md:block
|
|
170
|
-
`,children:y.jsx(VM,{name:e.name})}),y.jsx("div",{className:`
|
|
171
|
-
flex w-9 shrink-0 justify-end overflow-hidden
|
|
172
|
-
md:w-0
|
|
173
|
-
md:group-focus-within:w-9
|
|
174
|
-
md:group-hover:w-9
|
|
175
|
-
md:group-has-aria-expanded:w-9
|
|
176
|
-
[@media(hover:none)]:w-9
|
|
177
|
-
`,children:y.jsxs(Wa,{children:[y.jsx(eo,{render:y.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":d("skills.actionsAria",{name:e.name}),className:"shrink-0 text-muted-foreground"}),children:y.jsx(ag,{})}),y.jsx(to,{align:"end",className:"w-40",children:y.jsx(eC,{Item:$a,onEdit:o,onDelete:l,onAssign:u})})]})})]})})}),!t&&y.jsx(Ld,{children:y.jsx(eC,{Item:fc,onEdit:o,onDelete:l,onAssign:u})})]})}function eC({Item:e,onEdit:t,onDelete:s,onAssign:i}){const{t:o}=ht();return y.jsxs(y.Fragment,{children:[y.jsxs(e,{onClick:i,children:[y.jsx(Ok,{}),y.jsx("span",{children:o("skills.assign")})]}),y.jsxs(e,{onClick:t,children:[y.jsx(gk,{}),y.jsx("span",{children:o("skills.edit")})]}),y.jsxs(e,{variant:"destructive",onClick:s,children:[y.jsx(qu,{}),y.jsx("span",{children:o("skills.delete")})]})]})}function hV({skill:e,onClose:t}){const{t:s}=ht(),i=Or(),o=Un({mutationFn:()=>UB(e.name),onSuccess:()=>{i.removeQueries({queryKey:Uo(e.name),exact:!0}),i.invalidateQueries({queryKey:qo}),Nt.success(s("skills.deleted")),t()},onError:()=>Nt.error(s("skills.deleteError"))}),l=()=>{o.isPending||t()};return y.jsx(ii,{open:!0,onOpenChange:u=>{u||l()},children:y.jsxs(ai,{showCloseButton:!1,children:[y.jsxs(_s,{children:[y.jsx(Us,{children:s("skills.deleteConfirmTitle")}),y.jsx(ti,{children:y.jsx(gd,{i18nKey:"skills.deleteConfirmDescription",values:{name:e.name},components:{skillName:y.jsx("code",{className:`
|
|
178
|
-
rounded-sm bg-muted px-1 py-0.5 font-mono wrap-anywhere
|
|
179
|
-
`})}})})]}),y.jsxs(ei,{children:[y.jsx(Ze,{type:"button",variant:"ghost",disabled:o.isPending,onClick:l,children:s("common.cancel")}),y.jsxs(Ze,{type:"button",variant:"destructive",disabled:o.isPending,onClick:()=>o.mutate(),children:[o.isPending&&y.jsx(Pr,{className:"animate-spin"}),y.jsx("span",{children:s("skills.delete")})]})]})]})})}function pV({skill:e,onClose:t}){const{t:s}=ht();return y.jsx(ii,{open:!0,onOpenChange:i=>{i||t()},children:y.jsxs(ai,{children:[y.jsxs(_s,{children:[y.jsx(Us,{className:"pr-6 leading-relaxed",children:y.jsx(gd,{i18nKey:"skills.assignDialogTitle",values:{name:e.name},components:{skillName:y.jsx("code",{className:`
|
|
180
|
-
rounded-sm bg-muted px-1 py-0.5 font-mono text-sm
|
|
181
|
-
wrap-anywhere
|
|
182
|
-
`})}})}),y.jsx(ti,{children:s("skills.assignDescription")})]}),y.jsx(VM,{name:e.name})]})})}function gV(e,t,s,i){return s.flatMap(o=>t.filter(l=>(e.find(u=>u.name===l)?.agentIds.includes(o)??!1)!==i).map(l=>({name:l,agentId:o,isAssigned:i})))}function mV({names:e,onAssigned:t}){const{t:s}=ht(),i=Or(),[o,l]=b.useState(!1),[u,d]=b.useState([]),f=fg({mutationKey:["skill-assignment"]})>0,g=ri({queryKey:ic,queryFn:({signal:S})=>jM(S),enabled:o}),m=Un({mutationKey:PM,mutationFn:async S=>{let w=0;const C=[];for(const{name:E,agentId:R,isAssigned:O}of S)try{await IM(E,R,O),w+=1}catch(T){C.push(T)}return{completed:w,errors:C}},onSuccess:async({completed:S,errors:w})=>{if(await i.invalidateQueries({queryKey:ic}),w.length>0){Nt.error(s("skills.batchAssignPartial",{completed:S,failed:w.length}),{description:s(w.some(C=>C instanceof Qa&&C.code==="SKILL_LINK_CONFLICT")?"skills.linkConflict":"skills.assignmentError")});return}Nt.success(s("skills.batchAssigned")),l(!1),t()}}),h=!g.isSuccess||u.length===0||m.isPending||f;function x(S){h||m.mutate(gV(g.data.skills,e,u,S))}return y.jsxs(yb,{open:o,onOpenChange:S=>{m.isPending||(l(S),S||d([]))},children:[y.jsxs(Jk,{render:y.jsx(Ze,{variant:"outline",disabled:f||m.isPending}),children:[y.jsx(Ok,{}),y.jsx("span",{children:s("skills.batch")}),y.jsx("span",{className:"text-muted-foreground tabular-nums",children:e.length})]}),y.jsx(vb,{align:"end","aria-label":s("skills.batch"),children:y.jsxs("div",{className:"flex flex-col gap-4","aria-busy":m.isPending,children:[y.jsxs("div",{className:"flex flex-col gap-2",children:[g.isPending&&y.jsx(Gn,{className:"h-16 w-full"}),g.isError&&y.jsxs("div",{role:"alert",className:"space-y-2",children:[y.jsx("p",{className:"text-xs text-muted-foreground",children:s("skills.assignmentError")}),y.jsx(Ze,{type:"button",variant:"outline",disabled:g.isFetching,onClick:()=>{g.refetch()},children:s("common.retry")})]}),g.isSuccess&&g.data.agents.length===0&&y.jsx("p",{className:"text-xs text-muted-foreground",children:s("skills.noAgents")}),g.isSuccess&&y.jsx(BM,{agents:g.data.agents,value:u,onValueChange:d,label:s("skills.batch"),disabled:m.isPending,shouldShowNames:!0})]}),y.jsxs("div",{className:"flex justify-end gap-2",children:[y.jsxs(Ze,{type:"button",variant:"outline",disabled:h,onClick:()=>x(!1),children:[m.isPending&&!m.variables[0]?.isAssigned&&y.jsx(Pr,{className:"animate-spin"}),y.jsx("span",{children:s("skills.unassign")})]}),y.jsxs(Ze,{type:"button",disabled:h,onClick:()=>x(!0),children:[m.isPending&&m.variables[0]?.isAssigned&&y.jsx(Pr,{className:"animate-spin"}),y.jsx("span",{children:s("skills.assign")})]})]})]})})]})}const KM=b.createContext(void 0);function fx(){const e=b.useContext(KM);if(e===void 0)throw new Error(cn(64));return e}const yV="data-activation-direction",jg={tabActivationDirection:e=>({[yV]:e})},vV=b.forwardRef(function(t,s){const{className:i,defaultValue:o=0,onValueChange:l,orientation:u="horizontal",render:d,value:f,style:g,...m}=t,h=t.defaultValue!==void 0,x=b.useRef([]),[S,w]=b.useState(()=>new Map),[C,E]=Ci({controlled:f,default:o,name:"Tabs",state:"value"}),R=f!==void 0,[O,T]=b.useState(()=>new Map),A=b.useRef(void 0),N=b.useCallback(ye=>Ev(O,ye),[O]),[j,D]=b.useState(()=>({previousValue:C,tabActivationDirection:"none"})),{previousValue:M,tabActivationDirection:z}=j;let L=z,K=!1;M!==C&&(L=tC(M,C,u,O),K=M!=null&&C!=null&&N(C)==null);const X=K?M:C,B=M!==X||z!==L;Pe(()=>{B&&D({previousValue:X,tabActivationDirection:L})},[X,B,L]);const H=Be((ye,se)=>{const ge=tC(C,ye,u,O);se.activationDirection=ge,l?.(ye,se),!se.isCanceled&&E(()=>ye)}),U=Be((ye,se)=>{l?.(ye,lt(se,void 0,void 0,{activationDirection:"none"}))}),_=Be((ye,se)=>(w(ge=>{const fe=new Map(ge);return fe.set(ye,se),fe}),()=>{w(ge=>{if(ge.get(ye)!==se)return ge;const fe=new Map(ge);return fe.delete(ye),fe})})),Q=b.useCallback(ye=>S.get(ye),[S]),G=b.useCallback(ye=>{for(const se of O.values())if(ye===se.value)return se.id},[O]),q=b.useMemo(()=>({getTabElementBySelectedValue:N,getTabIdByPanelValue:G,getTabPanelIdByValue:Q,onValueChange:H,orientation:u,registerMountedTabPanel:_,setTabMap:T,tabActivationDirection:L,value:C}),[N,G,Q,H,u,_,T,L,C]),Y=b.useMemo(()=>{for(const ye of O.values())if(ye.value===C)return ye},[O,C]),ee=b.useMemo(()=>{for(const ye of O.values())if(!ye.disabled)return ye.value},[O]),$=b.useRef(!h),ae=b.useRef(o),I=b.useRef(h),F=b.useRef(!1);Pe(()=>{if(R)return;function ye(ce,Re){E(()=>ce),D({previousValue:ce,tabActivationDirection:"none"}),U(ce,Re),$.current=!1}if(O.size===0){F.current&&C!==null&&!A.current?.isConnected&&ye(null,Nw);return}F.current=!0,A.current=O.keys().next().value;const se=Y?.disabled,ge=Y==null&&C!==null;if(!se&&C===ae.current&&(I.current=!1),I.current&&se&&C===ae.current)return;const fe=$.current;if(se||ge){const ce=ee??null;if(C===ce){$.current=!1;return}let Re=Nw;fe?Re=Dw:se&&(Re=vC),ye(ce,Re);return}fe&&Y!=null&&(U(C,Dw),$.current=!1)},[ee,R,U,Y,E,O,C]);const ne=bt("div",t,{state:{orientation:u,tabActivationDirection:L},ref:s,props:m,stateAttributesMapping:jg});return y.jsx(KM.Provider,{value:q,children:y.jsx(Eg,{elementsRef:x,children:ne})})});function Ev(e,t){for(const[s,i]of e.entries())if(t===i.value)return s;return null}function tC(e,t,s,i){if(e==null||t==null)return"none";const[o,l,u]=s==="horizontal"?["left","left","right"]:["top","up","down"],d=Ev(i,e),f=Ev(i,t);if(d==null||f==null)return d!==f&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?u:l:"none";const g=d.getBoundingClientRect()[o],m=f.getBoundingClientRect()[o];return m<g?l:m>g?u:"none"}const qM=b.createContext(void 0);function bV(){const e=b.useContext(qM);if(e===void 0)throw new Error(cn(65));return e}const xV=b.forwardRef(function(t,s){const{className:i,disabled:o=!1,render:l,value:u,id:d,nativeButton:f=!0,style:g,...m}=t,{value:h,getTabPanelIdByValue:x,onValueChange:S,orientation:w,tabActivationDirection:C}=fx(),{activateOnFocus:E,registerTabResizeObserverElement:R,tabsListElement:O}=bV(),{highlightedIndex:T,onHighlightedIndexChange:A}=lg(),N=Qn(d),j=b.useMemo(()=>({disabled:o,id:N,value:u}),[o,N,u]),{compositeProps:D,compositeRef:M,index:z}=bA({metadata:j}),L=u===h,K=b.useRef(!1),X=b.useRef(null),B=Be(F=>{X.current?.(),X.current=F?R(F):null});Pe(()=>{if(K.current){K.current=!1;return}if(!(L&&z>-1&&T!==z))return;const F=O;if(F!=null){const Z=Vr(qt(F));if(Z&&st(F,Z))return}o||A(z)},[L,z,T,A,o,O]);const{getButtonProps:H,buttonRef:U}=ns({disabled:o,native:f,focusableWhenDisabled:!0}),_=x(u),Q=b.useRef(!1),G=b.useRef(!1);function q(F){S(u,lt(kr,F.nativeEvent,void 0,{activationDirection:"none"}))}function Y(F){L||o||q(F)}function ee(F){L||o||E&&(!Q.current||G.current)&&q(F)}function $(F){if(L||o)return;Q.current=!0,G.current=F.button===0;const Z=qt(F.currentTarget);function ne(){Q.current=!1,G.current=!1,Z.removeEventListener("pointerup",ne),Z.removeEventListener("pointercancel",ne)}Z.addEventListener("pointerup",ne),Z.addEventListener("pointercancel",ne)}return bt("button",t,{state:{disabled:o,active:L,orientation:w,tabActivationDirection:C},ref:[s,U,M,B],props:[D,{role:"tab","aria-controls":_,"aria-selected":L,id:N,onClick:Y,onFocus:ee,onPointerDown:$,[Dg]:L?"":void 0,onKeyDownCapture(){K.current=!0}},m,H],stateAttributesMapping:jg})}),SV=b.createContext(void 0),wV={disableStyleElements:!1};function EV(){return b.useContext(SV)??wV}const RV="data-index",CV={...jg,...ni},TV=b.forwardRef(function(t,s){const{className:i,value:o,render:l,keepMounted:u=!1,style:d,...f}=t,{value:g,getTabIdByPanelValue:m,orientation:h,tabActivationDirection:x,registerMountedTabPanel:S}=fx(),w=Qn(),{ref:C,index:E}=Rd(),R=o===g,{mounted:O,transitionStatus:T,setMounted:A}=Ja(R),N=!O,j=m(o),D={hidden:N,orientation:h,tabActivationDirection:x,transitionStatus:T},M=b.useRef(null),z=bt("div",t,{state:D,ref:[s,C,M],props:[{"aria-labelledby":j,hidden:N,id:w,role:"tabpanel",tabIndex:R?0:-1,inert:hd(!R),[RV]:E},f],stateAttributesMapping:CV});return bs({open:R,ref:M,onComplete(){R||A(!1)}}),Pe(()=>{if(!(w==null||N&&!u))return S(o,w)},[N,u,o,w,S]),u||O?z:null}),kV=b.forwardRef(function(t,s){const{activateOnFocus:i=!1,className:o,loopFocus:l=!0,render:u,style:d,...f}=t,{orientation:g,setTabMap:m,tabActivationDirection:h}=fx(),[x,S]=b.useState(0),[w,C]=b.useState(null),E=b.useRef(new Set),R=b.useRef(new Set),O=b.useRef(null);Pe(()=>{if(typeof ResizeObserver>"u")return;const M=new ResizeObserver(()=>{E.current.forEach(z=>{z()})});return O.current=M,w&&M.observe(w),R.current.forEach(z=>{M.observe(z)}),()=>{M.disconnect(),O.current=null}},[w]);const T=Be(M=>(E.current.add(M),()=>{E.current.delete(M)})),A=Be(M=>(R.current.add(M),O.current?.observe(M),()=>{R.current.delete(M),O.current?.unobserve(M)})),N={orientation:g,tabActivationDirection:h},j={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},D=b.useMemo(()=>({activateOnFocus:i,registerIndicatorUpdateListener:T,registerTabResizeObserverElement:A,tabsListElement:w}),[i,T,A,w]);return y.jsx(qM.Provider,{value:D,children:y.jsx(dx,{render:u,className:o,style:d,state:N,refs:[s,C],props:[j,f],stateAttributesMapping:jg,highlightedIndex:x,enableHomeAndEndKeys:!0,loopFocus:l,orientation:g,onHighlightedIndexChange:S,onMapChange:m,disabledIndices:Ls})})});function OV({className:e,...t}){return y.jsx(vV,{"data-slot":"tabs",className:He("flex flex-col gap-2",e),...t})}function AV({className:e,...t}){return y.jsx(kV,{"data-slot":"tabs-list",className:He("inline-flex h-8 w-fit items-center justify-center rounded-md bg-muted p-0.5 text-muted-foreground",e),...t})}function MV({className:e,...t}){return y.jsx(xV,{"data-slot":"tabs-trigger",className:He("inline-flex h-full flex-1 items-center justify-center gap-1.5 rounded-sm border border-transparent px-2 text-xs font-medium whitespace-nowrap transition-all outline-none hover:text-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 data-active:bg-background data-active:text-foreground data-active:shadow-xs [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",e),...t})}function NV({className:e,...t}){return y.jsx(TV,{"data-slot":"tabs-content",className:He("min-h-0 flex-1 outline-none",e),...t})}function DV(){const{t:e}=ht(),[t,s]=b.useState(!1),[i,o]=b.useState(null),l=ri({queryKey:Nr,queryFn:({signal:f})=>RM(f),enabled:t}),u=(l.data??[]).filter(({capabilities:f})=>f.skills),d=u.find(({id:f})=>f===i)??u.find(({id:f})=>f==="chatgpt")??u.at(0);return y.jsxs(Yb,{open:t,onOpenChange:f=>{s(f),f||o(null)},children:[y.jsxs(LA,{render:y.jsx(Ze,{type:"button",variant:"outline",className:"max-sm:size-7 max-sm:p-0",title:e("skills.inAgents")}),children:[y.jsx(ib,{}),y.jsx("span",{className:`
|
|
183
|
-
sr-only
|
|
184
|
-
sm:not-sr-only
|
|
185
|
-
`,children:e("skills.inAgents")})]}),y.jsxs($b,{className:`
|
|
186
|
-
data-[side=right]:w-full
|
|
187
|
-
data-[side=right]:sm:w-3/4 data-[side=right]:sm:max-w-none
|
|
188
|
-
`,children:[y.jsx(zA,{className:"pr-12",children:y.jsx(Gb,{children:e("skills.inAgents")})}),y.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 pb-4",children:[l.isPending&&y.jsxs("div",{className:"flex flex-col gap-2","aria-busy":"true",children:[y.jsx(Gn,{className:"h-8 w-full"}),[0,1,2].map(f=>y.jsx(Gn,{className:"h-9 w-full"},f))]}),l.isError&&y.jsxs("div",{role:"alert",className:"flex flex-1 flex-col items-center justify-center",children:[y.jsx(ea,{icon:Vo,title:e("skills.inAgentsLoadError"),className:"flex-none"}),y.jsx(Ze,{variant:"outline",onClick:()=>{l.refetch()},children:e("common.retry")})]}),l.isSuccess&&u.length===0&&y.jsx(ea,{icon:Vo,title:e("skills.noAgents")}),l.isSuccess&&d&&y.jsxs(OV,{value:d.id,onValueChange:f=>{typeof f=="string"&&o(f)},className:"flex min-h-0 flex-1 flex-col gap-3",children:[y.jsx(AV,{"aria-label":e("skills.inAgents"),className:"grid w-full grid-cols-2",children:u.map(f=>y.jsxs(MV,{value:f.id,className:"w-full",children:[y.jsx(ax,{icon:f.icon,monochrome:d.id!==f.id,className:"size-4 rounded-none bg-transparent"}),y.jsx("span",{children:f.name})]},f.id))}),y.jsx(NV,{value:d.id,className:"flex flex-col",children:y.jsx(jV,{agentId:d.id,enabled:t})})]})]})]})]})}function jV({agentId:e,enabled:t}){const{t:s}=ht(),i=Or(),[o,l]=b.useState(null),u=ri({queryKey:jy(e),queryFn:({signal:m})=>q9(e,m),enabled:t}),d=Un({mutationFn:ox,onError:()=>Nt.error(s("skills.openOriginError"))}),f=Un({mutationFn:m=>Y9(e,m.directoryName),onSuccess:(m,h)=>{Nt.success(s("skills.bringInSuccess",{name:h.name})),i.invalidateQueries({queryKey:jy(e)}),i.invalidateQueries({queryKey:qo})},onError:m=>{Nt.error(s(m instanceof EM&&m.code==="SKILL_LINK_CONFLICT"?"skills.linkConflict":"skills.bringInError"))}}),g=Un({mutationFn:m=>$9(e,m.directoryName),onSuccess:(m,h)=>{Nt.success(s("skills.deleteInstalledSuccess",{name:h.name})),l(null),i.invalidateQueries({queryKey:jy(e)}),i.invalidateQueries({queryKey:ic}),i.invalidateQueries({queryKey:qo})},onError:()=>Nt.error(s("skills.deleteInstalledError"))});return u.isPending?y.jsx("div",{className:"flex flex-col gap-2","aria-busy":"true",children:[0,1,2].map(m=>y.jsx(Gn,{className:"h-9 w-full"},m))}):u.isError?y.jsxs("div",{role:"alert",className:"flex flex-1 flex-col items-center justify-center",children:[y.jsx(ea,{icon:Vo,title:s("skills.inAgentsLoadError"),className:"flex-none"}),y.jsx(Ze,{variant:"outline",onClick:()=>{u.refetch()},children:s("common.retry")})]}):u.data.length===0?y.jsx(ea,{icon:Vo,title:s("skills.inAgentsEmptyTitle"),description:s("skills.inAgentsEmptyDescription")}):y.jsxs(y.Fragment,{children:[y.jsx("div",{role:"list",className:`
|
|
189
|
-
-mr-4 min-h-0 flex-1 space-y-2 divide-y divide-border overflow-y-auto
|
|
190
|
-
pr-4
|
|
191
|
-
`,children:u.data.map(m=>y.jsx(IV,{skill:m,isOpening:d.isPending&&d.variables===m.originPath,isBringingIn:f.isPending&&f.variables.directoryName===m.directoryName,isDeleting:g.isPending&&g.variables.directoryName===m.directoryName,onOpenOrigin:()=>{m.originPath&&d.mutate(m.originPath)},onBringIn:()=>{f.mutate(m)},onDelete:()=>{l(m)}},m.directoryName))}),o&&y.jsx(ii,{open:!0,onOpenChange:m=>{!m&&!g.isPending&&l(null)},children:y.jsxs(ai,{showCloseButton:!1,children:[y.jsxs(_s,{children:[y.jsx(Us,{children:s("skills.deleteInstalledTitle")}),y.jsx(ti,{children:y.jsx(gd,{i18nKey:"skills.deleteInstalledDescription",values:{name:o.name},components:{skillName:y.jsx("code",{className:`
|
|
192
|
-
rounded-sm bg-muted px-1 py-0.5 font-mono
|
|
193
|
-
wrap-anywhere
|
|
194
|
-
`})}})})]}),y.jsxs(ei,{children:[y.jsx(Ze,{type:"button",variant:"ghost",disabled:g.isPending,onClick:()=>{l(null)},children:s("common.cancel")}),y.jsxs(Ze,{type:"button",variant:"destructive",disabled:g.isPending,onClick:()=>{g.mutate(o)},children:[g.isPending&&y.jsx(Pr,{className:"animate-spin"}),y.jsx("span",{children:s("skills.deleteInstalled")})]})]})]})})]})}function IV({skill:e,isOpening:t,isBringingIn:s,isDeleting:i,onOpenOrigin:o,onBringIn:l,onDelete:u}){const{t:d}=ht();return y.jsxs(Id,{children:[y.jsx(Pd,{render:y.jsx(UM,{skill:e,className:e.originPath?"py-1.5":void 0,secondary:e.originPath&&y.jsx("div",{className:"flex min-w-0",children:y.jsxs("button",{type:"button",disabled:t,className:`
|
|
195
|
-
inline-flex w-fit max-w-full min-w-0 items-center gap-1
|
|
196
|
-
rounded-sm font-mono text-[11px] text-muted-foreground
|
|
197
|
-
hover:text-foreground hover:underline
|
|
198
|
-
focus-visible:outline-2 focus-visible:outline-ring
|
|
199
|
-
disabled:opacity-60
|
|
200
|
-
`,"aria-label":d("skills.openOriginAria",{path:e.originPath}),title:e.originPath,onClick:o,children:[y.jsx(cb,{className:"size-3 shrink-0"}),y.jsx("span",{className:"min-w-0 truncate",children:e.originPath})]})}),trailing:y.jsx("div",{className:`
|
|
201
|
-
ml-2 flex w-9 shrink-0 justify-end overflow-hidden
|
|
202
|
-
md:w-0
|
|
203
|
-
md:group-focus-within:w-9
|
|
204
|
-
md:group-hover:w-9
|
|
205
|
-
md:group-has-aria-expanded:w-9
|
|
206
|
-
[@media(hover:none)]:w-9
|
|
207
|
-
`,children:y.jsxs(Wa,{children:[y.jsx(eo,{render:y.jsx(Ze,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground","aria-label":d("skills.actionsAria",{name:e.name})}),children:y.jsx(ag,{})}),y.jsxs(to,{align:"end",className:"w-40",children:[y.jsxs($a,{disabled:e.isManaged||s,title:e.isManaged?d("skills.bringInManaged"):void 0,onClick:l,children:[y.jsx(wE,{}),y.jsx("span",{children:d("skills.bringIn")})]}),y.jsxs($a,{variant:"destructive",disabled:s||i,onClick:u,children:[y.jsx(qu,{}),y.jsx("span",{children:d("skills.deleteInstalled")})]})]})]})})})}),y.jsxs(Ld,{children:[y.jsxs(fc,{disabled:e.isManaged||s,title:e.isManaged?d("skills.bringInManaged"):void 0,onClick:l,children:[y.jsx(wE,{}),y.jsx("span",{children:d("skills.bringIn")})]}),y.jsxs(fc,{variant:"destructive",disabled:s||i,onClick:u,children:[y.jsx(qu,{}),y.jsx("span",{children:d("skills.deleteInstalled")})]})]})]})}function PV(){const{t:e}=ht(),[t,s]=b.useState(!1),[i,o]=b.useState(null),[l,u]=b.useState(null),[d,f]=b.useState(null),[g,m]=b.useState([]),h=fg({mutationKey:PM})>0,x=ri({queryKey:qo,queryFn:({signal:E})=>IB(E)}),S=x.isSuccess?x.data.filter(E=>g.includes(E.name)):[],w=x.isSuccess&&x.data.length>0&&S.length===x.data.length,C=e(w?"skills.deselectAll":"skills.selectAll");return y.jsxs(y.Fragment,{children:[y.jsxs(FA,{children:[S.length>0&&y.jsx(mV,{names:S.map(E=>E.name),onAssigned:()=>m([])}),y.jsxs(Ze,{type:"button",variant:"outline",className:"max-sm:size-7 max-sm:p-0",title:C,"aria-pressed":w,disabled:h||!x.isSuccess||x.data.length===0,onClick:()=>{x.isSuccess&&m(w?[]:x.data.map(E=>E.name))},children:[y.jsx(HL,{}),y.jsx("span",{className:`
|
|
208
|
-
sr-only
|
|
209
|
-
sm:not-sr-only
|
|
210
|
-
`,children:C})]}),y.jsx(qB,{onCreateManually:()=>{s(!0)}}),y.jsx(DV,{})]}),y.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-4",children:[x.isPending&&y.jsx(Gn,{className:"h-16 w-full"}),x.isError&&y.jsxs("div",{role:"alert",className:"flex flex-1 flex-col items-center justify-center",children:[y.jsx(ea,{icon:Vo,title:e("skills.loadError"),className:"flex-none"}),y.jsx(Ze,{variant:"outline",onClick:()=>{x.refetch()},children:e("common.retry")})]}),x.isSuccess&&x.data.length===0&&y.jsx(ea,{icon:Vo,title:e("skills.emptyTitle"),description:e("skills.emptyDescription")}),x.isSuccess&&x.data.length>0&&y.jsx("div",{role:"list",children:x.data.map(E=>y.jsx(fV,{skill:E,isSelected:g.includes(E.name),selectionDisabled:h,onSelectedChange:R=>{m(O=>R?[...O,E.name]:O.filter(T=>T!==E.name))},onEdit:()=>o(E),onDelete:()=>u(E),onAssign:()=>f(E)},E.name))})]}),t&&y.jsx(Sv,{onClose:()=>{s(!1)}}),i&&y.jsx(Sv,{skill:i,onClose:()=>o(null)}),l&&y.jsx(hV,{skill:l,onClose:()=>u(null)}),d&&y.jsx(pV,{skill:d,onClose:()=>f(null)})]})}function bp(e,t){for(const s of e){if(s.path===t)return s;if(!s.children)continue;const i=bp(s.children,t);if(i)return i}}function xp(e,t,s){return e.flatMap(i=>{if(i.path===t){const o=s(i);return o?[o]:[]}return i.children?[{...i,children:xp(i.children,t,s)}]:[i]})}function LV(e,t,s){return t?xp(e,t,i=>i.children?{...i,children:[...i.children,s]}:i):[...e,s]}function zV({files:e,parent:t,kind:s,onCreate:i,onCancel:o}){const{t:l}=ht(),[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=gB(S)&&!S.includes("/"),E=S!==""&&bp(e,w)!==void 0,R=E?l("skills.fileConflict"):f&&!C?l("skills.invalidEntryName"):null;b.useEffect(()=>{const T=requestAnimationFrame(()=>m.current?.focus());return()=>cancelAnimationFrame(T)},[]);const O=()=>{h.current||(g(!0),!(!C||E)&&(h.current=!0,i(s==="directory"?{path:w,children:[]}:{path:w,content:""})))};return y.jsxs("form",{onSubmit:T=>{T.preventDefault(),O()},onKeyDown:T=>{T.key==="Escape"&&(T.preventDefault(),T.stopPropagation(),h.current=!0,o())},children:[y.jsxs("div",{className:`
|
|
211
|
-
flex h-7 min-w-0 items-center gap-1.5 border-x border-transparent pl-2
|
|
212
|
-
`,children:[y.jsx("span",{className:"size-3 shrink-0"}),s==="directory"?y.jsx(ek,{className:"size-3.5 shrink-0"}):y.jsx(lb,{className:"size-3.5 shrink-0"}),y.jsx(Od,{ref:m,required:!0,"aria-label":l(s==="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:T=>{T.key==="Enter"&&T.nativeEvent.isComposing&&T.preventDefault()},onChange:T=>d(T.target.value),onBlur:()=>{S===""&&!h.current?(h.current=!0,o()):O()}})]}),R&&y.jsx("p",{id:x,role:"alert",className:"mt-1 px-2 text-xs text-destructive",children:R})]})}function _V({entry:e,anchor:t,isOpen:s,onOpenChange:i,onConfirm:o}){const{t:l}=ht(),u=b.useId(),d=b.useId();return y.jsx(yb,{open:s,onOpenChange:i,children:y.jsx(vb,{anchor:t,align:"start","aria-labelledby":u,"aria-describedby":d,finalFocus:()=>t.current?.querySelector("button")??!1,className:"max-w-[calc(100vw-1.5rem)]",children:y.jsxs("div",{className:"flex flex-col gap-3",children:[y.jsx("h2",{id:u,className:"text-sm font-medium",children:l("skills.delete")}),y.jsx("p",{id:d,className:"text-xs wrap-anywhere text-muted-foreground",children:y.jsx(gd,{i18nKey:"skills.deleteEntryDescription",values:{path:e.path},components:{entryPath:y.jsx("code",{className:`
|
|
213
|
-
rounded-sm bg-muted px-1 py-0.5 font-mono wrap-anywhere
|
|
214
|
-
`})}})}),y.jsxs("div",{className:"flex justify-end gap-2",children:[y.jsx(Ze,{variant:"ghost",onClick:()=>i(!1),children:l("common.cancel")}),y.jsx(Ze,{variant:"destructive",onClick:o,children:l("skills.delete")})]})]})})})}function Sp({entry:e,Item:t,onAction:s}){const{t:i}=ht(),o=e?.path??"";return y.jsxs(y.Fragment,{children:[(!e||e.children)&&y.jsxs(y.Fragment,{children:[y.jsxs(t,{onClick:()=>s({type:"create",parent:o,kind:"file"}),children:[y.jsx(jL,{}),i("skills.newFile")]}),y.jsxs(t,{onClick:()=>s({type:"create",parent:o,kind:"directory"}),children:[y.jsx(PL,{}),i("skills.newFolder")]})]}),e&&e.path!=="SKILL.md"&&y.jsxs(t,{variant:"destructive",onClick:()=>s({type:"delete",entry:e}),children:[y.jsx(qu,{}),i("skills.delete")]})]})}function UV({entry:e,onAction:t,children:s,isActive:i=!1}){const{t:o}=ht(),l=b.useRef(null),[u,d]=b.useState(!1),f=m=>{m.type==="delete"?d(!0):t(m)},g=He(Vk({variant:"ghost"}),`
|
|
215
|
-
group/file relative flex w-full min-w-0 justify-start p-0
|
|
216
|
-
data-active:bg-muted data-active:text-foreground
|
|
217
|
-
`);return e?.path==="SKILL.md"?y.jsx("div",{className:g,"data-active":i||void 0,children:s}):y.jsxs(y.Fragment,{children:[y.jsxs(Id,{children:[y.jsxs(Pd,{render:y.jsx("div",{ref:l,className:g,"data-active":i||void 0}),children:[s,y.jsxs(Wa,{children:[y.jsx(eo,{render:y.jsx(Ze,{variant:"link",size:"icon","aria-label":o("skills.fileActions",{path:e?.path??o("skills.files")}),className:`
|
|
218
|
-
absolute right-0 shrink-0 text-inherit
|
|
219
|
-
data-popup-open:opacity-100
|
|
220
|
-
md:opacity-0
|
|
221
|
-
md:group-focus-within/file:opacity-100
|
|
222
|
-
md:group-hover/file:opacity-100
|
|
223
|
-
[@media(hover:none)]:opacity-100
|
|
224
|
-
`}),children:y.jsx(ag,{})}),y.jsx(to,{align:"end",children:y.jsx(Sp,{Item:$a,entry:e,onAction:f})})]})]}),y.jsx(Ld,{children:y.jsx(Sp,{Item:fc,entry:e,onAction:f})})]}),e&&y.jsx(_V,{entry:e,anchor:l,isOpen:u,onOpenChange:d,onConfirm:()=>{d(!1),t({type:"delete",entry:e})}})]})}const hx=b.createContext({creation:null,render:()=>null});hx.displayName="InlineEntryContext";function HV({files:e,selectedPath:t,onSelect:s,onOverview:i,onAction:o,onCreate:l,overviewDisabled:u=!1}){const{t:d}=ht(),[f,g]=b.useState(!1),[m,h]=b.useState(null),x=Tb(),S=R=>{u||(R.type==="create"?h(R):(h(null),o(R)))},w=y.jsxs(Ze,{variant:"ghost",className:`
|
|
225
|
-
shrink-0 justify-start
|
|
226
|
-
md:gap-1.5 md:pl-6.5
|
|
227
|
-
`,"aria-haspopup":"dialog",disabled:u,onClick:()=>{g(!1),i()},children:[y.jsx(Ek,{}),y.jsx("span",{children:d("skills.overview")})]}),C=()=>m&&y.jsx(zV,{files:e,parent:m.parent,kind:m.kind,onCancel:()=>h(null),onCreate:R=>{l(R,m.parent),h(null),R.children||g(!1)}},`${m.parent}/${m.kind}`),E=y.jsxs(y.Fragment,{children:[y.jsx(hx,{value:{creation:m,render:C},children:y.jsx(YM,{parent:"",entries:e,selectedPath:t,onSelect:R=>{g(!1),s(R)},onAction:S})}),y.jsxs(Id,{children:[y.jsx(Pd,{render:y.jsx("div",{className:"min-h-16 flex-1"})}),y.jsx(Ld,{children:y.jsx(Sp,{Item:fc,onAction:S})})]})]});return y.jsxs(y.Fragment,{children:[y.jsxs("nav",{"aria-label":d("skills.fileNavigation"),className:`
|
|
228
|
-
hidden w-56 shrink-0 flex-col gap-2 overflow-y-auto border-r p-3
|
|
229
|
-
md:flex
|
|
230
|
-
`,children:[w,!x&&E]}),y.jsxs("div",{className:`
|
|
231
|
-
flex shrink-0 items-center gap-2 border-b p-2
|
|
232
|
-
md:hidden
|
|
233
|
-
`,children:[w,y.jsxs(Yb,{open:f,onOpenChange:R=>{g(R),R||h(null)},children:[y.jsxs(LA,{render:y.jsx(Ze,{variant:"outline"}),children:[y.jsx(IL,{}),y.jsx("span",{children:d("skills.files")})]}),y.jsxs($b,{side:"left","aria-describedby":void 0,children:[y.jsx(Gb,{className:"sr-only",children:d("skills.fileNavigation")}),y.jsxs("nav",{"aria-label":d("skills.fileNavigation"),className:`
|
|
234
|
-
flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-3 pt-14
|
|
235
|
-
pb-3
|
|
236
|
-
`,children:[y.jsxs(Wa,{children:[y.jsxs(eo,{render:y.jsx(Ze,{variant:"outline",className:"w-full shrink-0 justify-start"}),children:[y.jsx(gc,{}),y.jsx("span",{children:d("skills.newEntry")})]}),y.jsx(to,{align:"start",children:y.jsx(Sp,{Item:$a,onAction:S})})]}),E]})]})]})]})]})}function YM({entries:e,parent:t,selectedPath:s,onSelect:i,onAction:o}){const l=b.use(hx),u=e.toSorted((d,f)=>!!d.children==!!f.children?d.path.localeCompare(f.path):d.children?-1:1);return y.jsxs("ul",{className:"min-w-0 shrink-0",children:[l.creation?.parent===t&&y.jsx("li",{children:l.render()}),u.map(d=>y.jsx(FV,{entry:d,selectedPath:s,onSelect:i,onAction:o},d.path))]})}function FV({entry:e,selectedPath:t,onSelect:s,onAction:i}){const[o,l]=b.useState(!0),u=e.children!==void 0;return y.jsxs("li",{className:"min-w-0",children:[y.jsx(UV,{entry:e,isActive:t===e.path,onAction:d=>{d.type==="create"&&l(!0),i(d)},children:y.jsxs("button",{type:"button","aria-current":!u&&t===e.path?"page":void 0,"aria-expanded":u?o:void 0,className:`
|
|
237
|
-
flex h-7 w-full min-w-0 flex-1 items-center gap-1.5 rounded-md pr-9
|
|
238
|
-
pl-2 text-left text-xs font-normal outline-none
|
|
239
|
-
focus-visible:ring-2 focus-visible:ring-ring
|
|
240
|
-
`,onClick:()=>{u?l(!o):s(e.path)},children:[y.jsx("span",{className:"flex size-3 shrink-0 items-center justify-center",children:u&&y.jsx(ob,{className:He("size-3 transition-transform",o&&`
|
|
241
|
-
rotate-90
|
|
242
|
-
`)})}),u?y.jsx(ek,{className:"size-3.5 shrink-0"}):y.jsx(lb,{className:"size-3.5 shrink-0"}),y.jsx("span",{className:"truncate",title:e.path,children:e.path.split("/").at(-1)})]})}),u&&o&&y.jsx("div",{className:"ml-3 border-l pl-1",children:y.jsx(YM,{parent:e.path,entries:e.children,selectedPath:t,onSelect:s,onAction:i})})]})}function BV({skill:e}){const{t}=ht(),s=Xo(),i=Or(),[o,l]=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=bp(f,u),C=w?.content??"",E=JSON.stringify(f)!==JSON.stringify(m),R=Un({mutationFn:()=>HB(e.name,f),onSuccess:A=>{g(A.files),h(A.files),i.setQueryData(Uo(e.name),A),i.invalidateQueries({queryKey:qo}),Nt.success(t("skills.contentSaved"))},onError:()=>Nt.error(t("skills.contentSaveError"))}),O=t8(E||R.isPending);Q8(b.useCallback(A=>{(E||R.isPending)&&A.preventDefault()},[E,R.isPending]));const T=()=>{E&&!R.isPending&&R.mutate()};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:`
|
|
243
|
-
flex min-h-0 flex-1 flex-col border-t
|
|
244
|
-
md:flex-row
|
|
245
|
-
`,children:[y.jsx(HV,{files:f,overviewDisabled:R.isPending,selectedPath:u,onSelect:d,onCreate:(A,N)=>{R.isPending||(g(j=>LV(j,N,A)),A.children||d(A.path))},onAction:A=>{if(R.isPending||A.type!=="delete")return;const N=A.entry.path;g(j=>xp(j,N,()=>null)),(u===N||u.startsWith(`${N}/`))&&d("SKILL.md")},onOverview:()=>{E?S(!0):l(!0)}}),y.jsxs("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col","aria-labelledby":"skill-file-title",children:[y.jsxs("header",{className:`
|
|
246
|
-
flex h-10 shrink-0 items-center justify-between gap-2 border-b
|
|
247
|
-
px-4
|
|
248
|
-
`,children:[y.jsx("h1",{id:"skill-file-title",className:"min-w-0 truncate font-mono text-xs font-medium",title:u,children:u}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{role:"status",className:"text-xs text-muted-foreground",children:t(R.isPending?"skills.contentSaving":E?"skills.unsavedChanges":"skills.allChangesSaved")}),y.jsxs(Ze,{disabled:!E||R.isPending,onClick:T,children:[R.isPending?y.jsx(Pr,{className:"animate-spin"}):y.jsx(db,{}),y.jsx("span",{children:t("skills.saveContent")})]})]})]}),y.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:w?.content===null?y.jsx(ea,{title:t("skills.fileNotEditable")}):y.jsx(NM,{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=>xp(N,u,j=>({path:j.path,content:A}))),onSave:T},u)})]})]}),o&&y.jsx(Sv,{skill:e,onClose:()=>l(!1),onSaved:A=>{A.name===e.name?i.query({queryKey:Uo(e.name),queryFn:({signal:N})=>DM(e.name,N)}).then(N=>{g(N.files),h(N.files)}).catch(()=>Nt.error(t("skills.loadError"))):s(`/library/skills/${encodeURIComponent(A.name)}`,{replace:!0})}}),y.jsx(ii,{open:O.state==="blocked"||x,onOpenChange:A=>{A||(O.reset?.(),S(!1))},children:y.jsxs(ai,{showCloseButton:!1,children:[y.jsxs(_s,{children:[y.jsx(Us,{children:t("skills.leaveTitle")}),y.jsx(ti,{children:t("skills.leaveDescription")})]}),y.jsxs(ei,{children:[y.jsx(Ze,{variant:"ghost",onClick:()=>{O.reset?.(),S(!1)},children:t("skills.keepEditing")}),y.jsx(Ze,{variant:"destructive",disabled:R.isPending,onClick:()=>{g(m),bp(m,u)||d("SKILL.md"),x?(l(!0),S(!1)):O.proceed?.()},children:t("skills.discardChanges")})]})]})})]})}function VV(){const{t:e}=ht(),{name:t=""}=K6(),s=ri({queryKey:Uo(t),queryFn:({signal:i})=>DM(t,i),retry:(i,o)=>!(o instanceof Qa&&o.code==="SKILL_NOT_FOUND")&&i<2});if(s.isPending)return y.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 p-4","aria-busy":"true",children:[y.jsx(Gn,{className:"h-7 w-48"}),y.jsx(Gn,{className:"min-h-24 flex-1"})]});if(s.isError&&s.data===void 0){const i=s.error instanceof Qa&&s.error.code==="SKILL_NOT_FOUND";return y.jsxs("div",{role:"alert",className:"flex flex-1 flex-col items-center justify-center p-4",children:[y.jsx(ea,{icon:Vo,title:e(i?"skills.notFound":"skills.loadError"),className:"flex-none"}),y.jsxs("div",{className:"flex gap-2",children:[y.jsx(Ze,{variant:"outline",render:y.jsx(vc,{to:"/library/skills"}),children:e("skills.backToSkills")}),!i&&y.jsx(Ze,{onClick:()=>{s.refetch()},children:e("common.retry")})]})]})}return y.jsx(BV,{skill:s.data},s.data.name)}function ro({label:e,description:t,children:s,className:i,controlClassName:o}){return y.jsxs("div",{className:He(`
|
|
249
|
-
flex flex-col items-start gap-3 p-4
|
|
250
|
-
min-[680px]:min-h-16 min-[680px]:flex-row min-[680px]:items-center
|
|
251
|
-
min-[680px]:justify-between min-[680px]:gap-8
|
|
252
|
-
`,i),children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"text-sm font-medium",children:e}),t&&y.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t})]}),y.jsx("div",{className:He(`
|
|
253
|
-
min-w-0
|
|
254
|
-
max-[680px]:w-full
|
|
255
|
-
min-[680px]:shrink-0
|
|
256
|
-
`,o),children:s})]})}function KV({configFolder:e}){const{t}=ht(),s=b.useRef(null),i=Un({mutationFn:async f=>{await navigator.clipboard.writeText(f)},onSuccess:()=>{Nt.success(t("settings.configFolderCopied"))},onError:()=>{Nt.error(t("settings.errors.copyConfigFolder"))}}),o=Un({mutationFn:ox,onError:()=>{Nt.error(t("settings.errors.openConfigFolder"))}}),l=i.isSuccess&&i.variables===e,u=!e||i.isPending||o.isPending,d=t(l?"settings.configFolderCopied":"settings.copyConfigFolder");return y.jsx(ro,{label:t("settings.configFolder"),controlClassName:"min-[680px]:shrink",children:y.jsxs("div",{className:`
|
|
257
|
-
flex min-w-0 items-center justify-end gap-2
|
|
258
|
-
max-[680px]:justify-start
|
|
259
|
-
`,children:[e&&y.jsx("span",{className:`
|
|
260
|
-
min-w-0 font-mono text-xs break-all text-muted-foreground
|
|
261
|
-
select-text
|
|
262
|
-
`,children:e}),y.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":d,title:d,disabled:u,"aria-busy":i.isPending,onClick:()=>{!e||u||(s.current&&clearTimeout(s.current),i.mutate(e,{onSuccess:()=>{s.current=setTimeout(()=>i.reset(),2e3)}}))},children:l?y.jsx(pd,{}):y.jsx(UT,{})}),y.jsxs(Ze,{type:"button",variant:"outline",disabled:u,"aria-busy":o.isPending,onClick:()=>{!u&&e&&o.mutate(e)},children:[o.isPending?y.jsx(Pr,{className:"animate-spin"}):y.jsx(cb,{}),y.jsx("span",{children:t("settings.openFolder")})]})]})})}function qV({onClose:e}){const{t}=ht(),s=Or(),i=b.useId(),[o,l]=b.useState(["agents"]),u=ri({queryKey:["skill-targets"],queryFn:({signal:f})=>v_(f),retry:!1}),d=Un({mutationFn:b_,onSuccess:()=>{s.invalidateQueries({queryKey:uO}),Nt.success(t("settings.skillDownloaded")),e()},onError:()=>Nt.error(t("settings.errors.downloadSkill"))});return y.jsx(ii,{open:!0,onOpenChange:f=>{!f&&!d.isPending&&e()},children:y.jsxs(ai,{showCloseButton:!1,children:[y.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:[y.jsxs(_s,{children:[y.jsx(Us,{children:t("settings.downloadSkill")}),y.jsx(ti,{children:t("settings.downloadSkillDescription")})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(ta,{id:i,children:t("settings.skillTargets")}),u.isPending&&y.jsxs("div",{className:"space-y-2",children:[y.jsx(Gn,{className:"h-12 w-full"}),y.jsx(Gn,{className:"h-12 w-full"})]}),u.isError&&y.jsx(Ze,{type:"button",variant:"outline",disabled:u.isFetching,onClick:()=>{u.refetch()},children:t("common.retry")}),u.data&&y.jsx("div",{role:"group","aria-labelledby":i,"aria-required":"true",className:"flex flex-col gap-2",children:u.data.targets.map(({target:f,destination:g})=>y.jsxs(TM,{className:"flex items-start gap-3 rounded-lg border p-3",children:[y.jsx(_M,{checked:o.includes(f),disabled:d.isPending,onCheckedChange:m=>{l(h=>m?[...h,f]:h.filter(x=>x!==f))}}),y.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[y.jsx("span",{children:f==="agents"?".agents":".claude"}),y.jsx("span",{className:`
|
|
263
|
-
font-mono text-xs font-normal break-all
|
|
264
|
-
text-muted-foreground
|
|
265
|
-
`,children:g})]})]},f))})]}),y.jsxs(ei,{children:[y.jsx(Ze,{type:"button",variant:"ghost",disabled:d.isPending,onClick:e,children:t("common.cancel")}),y.jsxs(Ze,{type:"submit",disabled:o.length===0||!u.isSuccess||d.isPending,children:[d.isPending?y.jsx(Pr,{className:"animate-spin"}):y.jsx(ig,{}),y.jsx("span",{children:t(d.isPending?"settings.downloadingSkill":"settings.downloadSkill")})]})]})]}),y.jsxs(zd,{disabled:d.isPending,render:y.jsx(Ze,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[y.jsx(ra,{}),y.jsx("span",{className:"sr-only",children:t("a11y.close")})]})]})})}function YV({disabled:e=!1}){const{t}=ht(),[s,i]=b.useState(!1);return y.jsxs(ro,{label:y.jsxs("span",{className:"flex items-center gap-1",children:[t("settings.downloadSkill"),y.jsxs(ip,{children:[y.jsx(ap,{render:y.jsx(Ze,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground","aria-label":t("settings.aboutFoundrySkill")}),children:y.jsx(AL,{})}),y.jsx(op,{children:t("settings.foundrySkillHint")})]})]}),children:[y.jsxs(Ze,{type:"button",variant:"outline",disabled:e,onClick:()=>i(!0),children:[y.jsx(ig,{}),t("settings.downloadSkill")]}),s&&y.jsx(qV,{onClose:()=>i(!1)})]})}function $V({className:e,...t}){return y.jsx("div",{"data-slot":"input-group",role:"group",className:He("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 GV=$o("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 QV({className:e,align:t="inline-start",...s}){return y.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:He(GV({align:t}),e),onClick:i=>{i.target.closest("button")||i.currentTarget.parentElement?.querySelector("input")?.focus()},...s})}const XV=$o("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 ZV({className:e,type:t="button",variant:s="ghost",size:i="xs",...o}){return y.jsx(Ze,{type:t,"data-size":i,variant:s,className:He(XV({size:i}),e),...o})}function JV({className:e,...t}){return y.jsx(Od,{"data-slot":"input-group-control",className:He("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 Rv({id:e,disabled:t,...s}){const{t:i}=ht(),o=b.useId(),l=e??o,[u,d]=b.useState(!1),f=i(u?"a11y.hidePassword":"a11y.showPassword");return y.jsxs($V,{"data-disabled":t,children:[y.jsx(JV,{...s,id:l,type:u?"text":"password",disabled:t}),y.jsx(QV,{align:"inline-end",children:y.jsx(ZV,{type:"button",size:"icon-xs","aria-label":f,"aria-controls":l,title:f,disabled:t,onClick:()=>d(g=>!g),children:u?y.jsx(NL,{}):y.jsx(DL,{})})})]})}function WV(e,t){const s=URL.createObjectURL(e),i=document.createElement("a");i.href=s,i.download=t,document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(s),1e3)}async function eK(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 s=t.headers.get("content-disposition")??"",i=/filename="([^"]+)"/u.exec(s)?.[1]??"foundry.foundry-backup";WV(await t.blob(),i)}function tK({onClose:e}){const{t}=ht(),s=b.useId(),i=b.useId(),[o,l]=b.useState(""),[u,d]=b.useState(""),f=Un({mutationFn:eK,onSuccess:()=>{Nt.success(t("dataExport.exported")),e()},onError:()=>{Nt.error(t("dataExport.error"))}});return y.jsx(ii,{open:!0,onOpenChange:g=>{!g&&!f.isPending&&e()},children:y.jsxs(ai,{showCloseButton:!1,children:[y.jsxs("form",{className:"flex flex-col gap-4","aria-busy":f.isPending,onSubmit:g=>{if(g.preventDefault(),!(!o||!u||f.isPending)){if(o!==u){Nt.error(t("dataExport.passphraseMismatch"));return}f.mutate({passphrase:o})}},children:[y.jsxs(_s,{children:[y.jsx(Us,{children:t("dataExport.title")}),y.jsx(ti,{children:t("dataExport.description")})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(ta,{htmlFor:s,children:t("dataExport.passphrase")}),y.jsx(Rv,{id:s,autoComplete:"new-password",required:!0,value:o,disabled:f.isPending,onChange:g=>l(g.target.value)})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(ta,{htmlFor:i,children:t("dataExport.confirmPassphrase")}),y.jsx(Rv,{id:i,autoComplete:"new-password",required:!0,value:u,disabled:f.isPending,"aria-invalid":u.length>0&&o!==u,onChange:g=>d(g.target.value)})]}),y.jsxs("p",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[y.jsx(FL,{className:"size-4 shrink-0"}),y.jsx("span",{children:t("dataExport.passphraseHint")})]}),y.jsxs(ei,{children:[y.jsx(Ze,{type:"button",variant:"ghost",disabled:f.isPending,onClick:e,children:t("common.cancel")}),y.jsxs(Ze,{type:"submit",disabled:!o||!u||f.isPending,children:[f.isPending?y.jsx(Pr,{className:"animate-spin"}):y.jsx($T,{}),y.jsx("span",{children:t(f.isPending?"dataExport.exporting":"dataExport.action")})]})]})]}),y.jsxs(zd,{disabled:f.isPending,render:y.jsx(Ze,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[y.jsx(ra,{}),y.jsx("span",{className:"sr-only",children:t("a11y.close")})]})]})})}function nK({disabled:e=!1}){const{t}=ht(),[s,i]=b.useState(!1);return y.jsxs(ro,{label:t("settings.export"),children:[y.jsxs(Ze,{type:"button",variant:"outline",disabled:e,onClick:()=>i(!0),children:[y.jsx($T,{}),t("settings.export")]}),s&&y.jsx(tK,{onClose:()=>i(!1)})]})}class px extends Error{constructor(t){super(t),this.code=t}code}async function rK(e,t){const s=await fetch("/api/data-import",{method:"POST",headers:{"content-type":"application/octet-stream","x-foundry-passphrase":encodeURIComponent(t)},body:e});return await $M(s),s.json()}async function sK(e){const t=await fetch("/api/data-import/agents",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});await $M(t)}async function $M(e){if(e.ok)return;let t="IMPORT_FAILED";try{const i=(await e.json()).error?.code;(i==="INVALID_BACKUP"||i==="INVALID_PASSPHRASE"||i==="IMPORT_CHANGED"||i==="AGENT_APPLY_FAILED")&&(t=i)}catch{}throw new px(t)}function iK({file:e,onClose:t}){const{t:s}=ht(),i=b.useId(),[o,l]=b.useState(""),u=Un({mutationFn:()=>rK(e,o),onSuccess:()=>l(""),onError:h=>Nt.error(s(Py(h)))}),d=Un({mutationFn:h=>sK({apply:h,agentRevision:u.data.agentRevision}),onSuccess:()=>location.replace(`${location.pathname}${location.search}`),onError:h=>Nt.error(s(Py(h)))}),f=u.isPending||d.isPending||d.isSuccess,g=d.error instanceof px&&d.error.code==="IMPORT_CHANGED",m=()=>{f||(g?location.replace(`${location.pathname}${location.search}`):u.isSuccess?d.mutate(!1):t())};return y.jsx(ii,{open:!0,onOpenChange:h=>{h||m()},children:y.jsxs(ai,{showCloseButton:!1,children:[u.isSuccess?y.jsxs("div",{className:"flex flex-col gap-4","aria-busy":f,children:[y.jsxs(_s,{children:[y.jsx(Us,{children:s("dataImport.applyTitle")}),y.jsx(ti,{children:s("dataImport.applyDescription")})]}),d.isError&&y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:s(Py(d.error))}),y.jsxs(ei,{children:[y.jsx(Ze,{type:"button",variant:"ghost",disabled:f,onClick:m,children:s("dataImport.skipAgents")}),y.jsxs(Ze,{type:"button",disabled:f||g,onClick:()=>d.mutate(!0),children:[d.isPending&&y.jsx(Pr,{className:"animate-spin"}),y.jsx("span",{children:s("dataImport.applyAgents")})]})]})]}):y.jsxs("form",{className:"flex flex-col gap-4","aria-busy":f,onSubmit:h=>{h.preventDefault(),!f&&o&&u.mutate()},children:[y.jsxs(_s,{children:[y.jsx(Us,{children:s("dataImport.title")}),y.jsx(ti,{className:"break-all",children:e.name})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(ta,{htmlFor:i,children:s("dataImport.passphrase")}),y.jsx(Rv,{id:i,autoComplete:"current-password",required:!0,value:o,disabled:f,onChange:h=>l(h.target.value)})]}),y.jsx("p",{className:"text-xs text-muted-foreground",children:s("dataImport.replaceWarning")}),y.jsxs(ei,{children:[y.jsx(Ze,{type:"button",variant:"ghost",disabled:f,onClick:m,children:s("common.cancel")}),y.jsxs(Ze,{type:"submit",variant:"destructive",disabled:f||!o,children:[f?y.jsx(Pr,{className:"animate-spin"}):y.jsx(qT,{}),y.jsx("span",{children:s("dataImport.replaceAction")})]})]})]}),y.jsxs(Ze,{type:"button",disabled:f,onClick:m,variant:"ghost",size:"icon",className:"absolute top-2 right-2",children:[y.jsx(ra,{}),y.jsx("span",{className:"sr-only",children:s("a11y.close")})]})]})})}function Py(e){if(e instanceof px)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 aK({disabled:e=!1}){const{t}=ht(),s=b.useRef(null),[i,o]=b.useState(null);return y.jsxs(ro,{label:t("settings.import"),children:[y.jsx("input",{ref:s,type:"file",accept:".foundry-backup,application/octet-stream",hidden:!0,onChange:l=>{o(l.target.files?.[0]??null),l.target.value=""}}),y.jsxs(Ze,{type:"button",variant:"outline",disabled:e,onClick:()=>s.current?.click(),children:[y.jsx(qT,{}),t("settings.import")]}),i&&y.jsx(iK,{file:i,onClose:()=>o(null)})]})}const oK="data-checked",lK="data-unchecked",Cv={checked(e){return e?{[oK]:""}:{[lK]:""}},...ni,...bc},GM=b.createContext(void 0);function cK(){return b.useContext(GM)}const QM=b.createContext(void 0);function uK(){const e=b.useContext(QM);if(e===void 0)throw new Error(cn(52));return e}const dK=b.forwardRef(function(t,s){const{render:i,className:o,disabled:l=!1,readOnly:u=!1,required:d=!1,"aria-labelledby":f,value:g,inputRef:m,nativeButton:h=!1,id:x,style:S,...w}=t,C=cK(),{disabled:E,readOnly:R,required:O,form:T,checkedValue:A,touched:N=!1,validation:j,name:D,setCheckedValue:M=En,setTouched:z=En,registerInputRef:L=En}=C??{},{setTouched:K,setFilled:X,state:B,disabled:H}=ia(),U=TA(),{labelId:_,getDescriptionProps:Q}=Zo(),G=H||U.disabled||E||l,q=R||u,Y=O||d,ee=T,$=C?A===g:g==="",ae=b.useRef(null),I=Td(G,ae),F=b.useRef(null),Z=j?.registerInput,ne=b.useCallback(Je=>Z?.(Je,{controlRef:ae,value:void 0}),[Z]),ye=es(m,F,L,ne);Pe(()=>{F.current?.checked&&X(!0)},[X]),Pe(()=>{if(F.current){if(G&&$){L(null);return}L(F.current)}},[$,G,L]);const se=Qn(),ge=xc({id:x}),fe=h?void 0:ge,ce=qb(f,_,F,!h,fe,w["aria-label"]),Re={role:"radio","aria-checked":$,"aria-labelledby":ce,[Dg]:$?"":void 0,id:h?ge:se,onKeyDown(Je){Je.key==="Enter"&&Je.preventDefault()},onClick(Je){if(Je.defaultPrevented||G||q)return;Je.preventDefault();const ot=F.current;ot&&_o(ot,Je)},onFocus(Je){I(!0),!(Je.defaultPrevented||G||q||!N)&&(F.current?.click(),z(!1))},onBlur(){C||I(!1)}},{getButtonProps:be,buttonRef:Le}=ns({disabled:G,native:h,composite:!1}),Oe={type:"radio",ref:ye,form:ee,id:fe,name:D,tabIndex:-1,style:D?Pp:ld,"aria-hidden":!0,...g!==void 0?{value:fp(g)}:Xt,disabled:G,checked:$,required:Y,readOnly:q,onChange(Je){if(Je.nativeEvent.defaultPrevented||G||q||g===void 0)return;const ot=lt(kr,Je.nativeEvent);M(g,ot),!ot.isCanceled&&K(!0)},onClick(Je){Je.stopPropagation()},onFocus(){ae.current?.focus()}},ze=b.useMemo(()=>({...B,required:Y,disabled:G,readOnly:q,checked:$}),[B,G,q,$,Y]),Ve=ze,ke=C!==void 0,Ue=[s,ae,Le],xe=[Re,w,be,Q,j?Je=>j.getValidationProps(G,Je):Xt],Fe=bt("span",t,{enabled:!ke,state:ze,ref:Ue,props:xe,stateAttributesMapping:Cv});return y.jsxs(QM.Provider,{value:Ve,children:[ke?y.jsx(Bb,{tag:"span",render:i,className:o,style:S,state:ze,refs:Ue,props:xe,stateAttributesMapping:Cv}):Fe,y.jsx("input",{...Oe,suppressHydrationWarning:!0})]})}),fK=b.forwardRef(function(t,s){const{render:i,className:o,style:l,keepMounted:u=!1,...d}=t,f=uK(),g=f.checked,{mounted:m,transitionStatus:h,setMounted:x}=Ja(g),S={...f,transitionStatus:h},w=b.useRef(null),C=u||m,E=bt("span",t,{ref:[s,w],state:S,props:d,stateAttributesMapping:Cv});return bs({batch:!0,enabled:!g,open:g,ref:w,onComplete(){g||x(!1)}}),C?E:null}),hK=[Zk],pK=b.forwardRef(function(t,s){const{render:i,className:o,disabled:l,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:O,validationMode:T,name:A,disabled:N,state:j,validation:D,setDirty:M,setFilled:z,validityData:L}=ia(),{labelId:K}=Zo(),{clearErrors:X,elementRef:B}=Cd(),H=NH(!0),U=N||l,_=A??x,Q=Qn(w),[G,q]=Ci({controlled:g,default:m,name:"RadioGroup",state:"value"}),[Y,ee]=b.useState(!1),$=Be((Oe,ze)=>{f?.(Oe,ze),!ze.isCanceled&&q(Oe)}),ae=D.getInputControl,I=b.useMemo(()=>({get current(){return ae()}}),[ae]),F=b.useRef(null),Z=b.useRef(null),ne=es(F,S),ye=b.useRef(ne),se=Be(Oe=>{F.current===Oe&&ye.current===ne||(ye.current=ne,ne?.(Oe))});Pe(()=>{se(F.current)},[ne,se]);const ge=Be(Oe=>{if(Oe){if(!Oe.disabled){Z.current||(Z.current=Oe);const ze=F.current;(Oe.checked||ze==null||ze.disabled)&&se(Oe)}return()=>{Z.current===Oe&&(Z.current=null),F.current===Oe&&se(null)}}}),fe=Be(()=>{const Oe=B.current;if(!Oe)return G??null;for(const ze of D.registeredInputs.keys())if(ze.checked&&LH(ze,Oe))return G??null;return null});kd(I,Q,G??null,fe,!U,x),mc(G,()=>{X(_),M(G!==L.initialValue),z(G!=null),D.change(G);const Oe=Z.current;G==null&&Oe&&!Oe.disabled&&se(Oe)});const ce=K??H?.legendId,Re={...j,disabled:U??!1,required:d??!1,readOnly:u??!1},be=b.useMemo(()=>({checkedValue:G,disabled:U,form:h,validation:D,name:_,readOnly:u,registerInputRef:ge,required:d,setCheckedValue:$,setTouched:ee,touched:Y}),[G,U,h,D,_,u,ge,d,$,ee,Y]),Le={id:w,role:"radiogroup","aria-required":d||void 0,"aria-disabled":U||void 0,"aria-readonly":u||void 0,"aria-labelledby":ce,onBlur(Oe){st(Oe.currentTarget,Oe.relatedTarget)||(ee(!1),R(!0),O(!1),T==="onBlur"&&D.commit(G))},onKeyDownCapture(Oe){Oe.key.startsWith("Arrow")&&ee(!0)}};return y.jsx(GM.Provider,{value:be,children:y.jsx(dx,{render:i,className:o,style:C,state:Re,props:[Le,E,Oe=>D.getValidationProps(U??!1,Oe)],refs:[s],stateAttributesMapping:bc,enableHomeAndEndKeys:!1,modifierKeys:hK})})});function gK({className:e,...t}){return y.jsx(pK,{"data-slot":"radio-group",className:He("grid w-full gap-3",e),...t})}function mK({className:e,...t}){return y.jsx(dK,{"data-slot":"radio-group-item",className:He("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:y.jsx(fK,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:y.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 yK=[{value:"system",labelKey:"common.system"},{value:"light",labelKey:"theme.light"},{value:"dark",labelKey:"theme.dark"}];function vK({value:e,onValueChange:t,disabled:s=!1}){const{t:i}=ht();return y.jsx(ro,{label:i("settings.colorTheme"),children:y.jsx(gK,{"aria-label":i("settings.colorTheme"),value:e,onValueChange:t,disabled:s,"aria-busy":s,className:"flex w-auto flex-row flex-wrap items-center gap-x-6 gap-y-2",children:yK.map(o=>y.jsxs("label",{className:He("flex items-center gap-2 text-sm select-none",o.value===e?"font-medium text-foreground":"text-muted-foreground",s?"cursor-not-allowed opacity-60":"cursor-pointer"),children:[y.jsx(mK,{value:o.value,disabled:s}),y.jsx("span",{children:i(o.labelKey)})]},o.value))})})}function bK(e){const t=b.useRef(!0);t.current&&(t.current=!1,e())}const XM=b.createContext(void 0),ZM=b.createContext(void 0);function Ai(){const e=b.useContext(XM);if(e===void 0)throw new Error(cn(60));return e}function JM(){const e=b.useContext(ZM);if(e===void 0)throw new Error(cn(61));return e}function xK(e,t,s=Object.is){const{length:i}=e;if(i!==t.length)return!1;for(let o=0;o<i;o+=1)if(!s(e[o],t[o]))return!1;return!0}const WM=(e,t)=>Object.is(e,t);function Yo(e,t,s){return e==null||t==null?Object.is(e,t):s(e,t)}function SK(e,t,s){return Array.isArray(e)&&Array.isArray(t)?!xK(e,t,(i,o)=>Yo(i,o,s)):e!==t}function Tv(e,t,s){return e?e.some(i=>i===void 0?!1:Yo(t,i,s)):!1}function qh(e,t,s){return e?e.findIndex(i=>i===void 0?!1:Yo(i,t,s)):-1}function wK(e,t){if(t!==WM)return i=>Tv(e,i,t);const s=new Set(e);return s.delete(void 0),i=>s.has(i)&&(i!==0||e.some(o=>Object.is(i,o)))}function eN(e,t,s,i){const o=i&&Array.isArray(t)?e.findIndex(wK(t,s)):qh(e,t,s);return o===-1?null:o}function EK(e,t,s,i,o,l){return Tv(i,t,o)?l!=null&&e>l&&Tv(i,s[l],o)?l:e:e===l?eN(s,i,o,!0):l}function RK(e,t,s){return e.filter(i=>!Yo(t,i,s))}const CK={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:s,itemToStringValue:i}=e;return t==null?!1:s&&Array.isArray(t)?t.length>0:ql(t,i)!==""},hasNullItemLabel:(e,t)=>t?bH(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 s=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(o=>Yo(t,o,s)):Yo(t,i,s)},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 Mu(e,t=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,s))}const Xs=1;function gx(e,t){return Math.max(0,e-t)}function wp(e,t){if(t<=0)return 0;const s=Mu(e,0,t),i=s,o=t-s,l=i<=Xs,u=o<=Xs;return l&&u?i<=o?0:t:l?0:u?t:s}function TK(e){const{id:t,value:s,defaultValue:i=null,onValueChange:o,open:l,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:O,multiple:T=!1,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:j=WM,highlightItemOnHover:D=!0,children:M}=e,{clearErrors:z}=Cd(),{setDirty:L,setTouched:K,setFocused:X,validityData:B,setFilled:H,name:U,disabled:_,validation:Q,validationMode:G}=ia(),q=xc({id:t}),Y=_||h,ee=U??f,[$,ae]=Ci({controlled:s,default:T?i??Ls:i,name:"Select",state:"value"}),[I,F]=Ci({controlled:l,default:u,name:"Select",state:"open"}),Z=b.useRef([]),ne=b.useRef([]),ye=b.useRef(null),se=b.useRef(null),ge=b.useRef(0),fe=b.useRef(null),ce=b.useRef([]),Re=b.useRef(!1),be=b.useRef(null),Le=b.useRef(null),Oe=b.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ze=b.useRef(!1),Ve=b.useRef($),{openMethod:ke,triggerProps:Ue}=Yk(I),xe=rr(()=>new pc({id:q,labelId:void 0,modal:w,multiple:T,disabled:Y,readOnly:x,required:S,highlightItemOnHover:D,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:j,value:$,open:I,mounted:I,transitionStatus:void 0,items:O,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Xt,triggerProps:Xt,itemRoot:{props:Xt,multiple:T,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:Z,popupRef:ye,scrollHandlerRef:se,scrollArrowsMountedCountRef:ge,valueRef:fe,valuesRef:ce,labelsRef:ne,typingRef:Re,selectionRef:Oe,firstItemTextRef:be,selectedItemTextRef:Le,alignItemWithTriggerActiveRef:ze,initialValueRef:Ve},CK)).current,[Fe,Je]=b.useState(!1),{mounted:ot,transitionStatus:de,forceUnmount:Ee}=eT({open:I,ref:ye,preventUnmountOnClose:Fe,setPreventUnmountOnClose:Je,onUnmount(){xe.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),R?.(!1)}}),$e=xe.useState("activeIndex"),Me=xe.useState("selectedIndex"),De=xe.useState("triggerElement"),xt=xe.useState("positionerElement"),dt=oP(ke),gt=ke??dt,Dt=b.useMemo(()=>T?"":ql($,N),[T,$,N]),It=b.useMemo(()=>T&&Array.isArray($)?$.map(V=>ql(V,N)):ql($,N),[T,$,N]),tn=Ln(De),an=Be(()=>It);kd(tn,q,$,an,!Y,f);const nn=T?Array.isArray($)&&$.length>0:$!=null&&Dt!=="";Pe(()=>{H(nn)},[nn,H]),Pe(function(){const W=eN(ce.current,$,j,T);W===null&&(Le.current=null),!I&&xe.set("selectedIndex",W)},[T,I,$,j,xe]),mc($,()=>{z(ee),L(SK($,B.initialValue,j)),Q.change($)});const et=Be((V,W)=>{const re=W,ve=qp(re);d?.(V,re),!W.isCanceled&&(V||Je(ve()),F(V),!V&&(W.reason===Ba||W.reason===Ip)&&(K(!0),X(!1),G==="onBlur"&&Q.commit($)))});b.useImperativeHandle(C,()=>({unmount:Ee,close:()=>{xe.state.open&&et(!1,lt(od))}}),[Ee,et,xe]);const Et=Be((V,W)=>{o?.(V,W),!W.isCanceled&&ae(V)}),Zt=Be(V=>{const W=gx(V.scrollHeight,V.clientHeight),re=wp(V.scrollTop,W),ve=re>0,Se=re<W;xe.set("scrollUpArrowVisible",ve),xe.set("scrollDownArrowVisible",Se)}),pt=VI({open:I,onOpenChange:et,elements:{reference:De,floating:xt}}),St=Fp(pt,{enabled:!Y,event:"mousedown"}),yt=cd(pt),Ht=cT(pt,{enabled:!Y,listRef:Z,activeIndex:$e,selectedIndex:Me,disabledIndices:Ls,onNavigate(V){V===null&&!I||xe.set("activeIndex",V)},focusItemOnHover:D}),dn=uT(pt,{enabled:!Y&&(I||!x&&!T),listRef:ne,activeIndex:$e,selectedIndex:Me,disabledIndices:V=>xA(Z.current[V]),onMatch(V){I?xe.set("activeIndex",V):Et(ce.current[V],lt(kr))},onTyping(V){Re.current=V}}),je=b.useMemo(()=>Ir(dn.reference,Ht.reference,yt.reference,St.reference,Ue),[St.reference,dn.reference,Ht.reference,yt.reference,Ue]),at=b.useMemo(()=>Ir(ud,dn.floating,Ht.floating,yt.floating),[dn.floating,Ht.floating,yt.floating]),Ie=Ht.item??Xt,_e=b.useMemo(()=>({props:Ie,multiple:T,disabled:Y,readOnly:x,isItemEqualToValue:j}),[Ie,T,Y,x,j]);xe.useContextCallback("setValue",Et),xe.useContextCallback("setOpen",et),xe.useContextCallback("handleScrollArrowVisibility",Zt),xe.useContextCallback("onOpenChangeComplete",R),bK(()=>{xe.update({popupProps:at,triggerProps:je,itemRoot:_e})}),xe.useSyncedValues({id:q,modal:w,multiple:T,disabled:Y,readOnly:x,required:S,highlightItemOnHover:D,value:$,open:I,mounted:ot,transitionStatus:de,popupProps:at,triggerProps:je,itemRoot:_e,items:O,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:j,openMethod:gt});const Ge=es(E,Q.inputRef),tt=T?void 0:ee,kt=b.useMemo(()=>!T||!Array.isArray($)||!ee?null:$.map(V=>{const W=ql(V,N);return y.jsx("input",{type:"hidden",form:g,name:ee,value:W,disabled:Y},W)}),[T,$,g,ee,N,Y]);return y.jsxs(XM.Provider,{value:xe,children:[y.jsx(ZM.Provider,{value:pt,children:M}),y.jsx("input",{...Q.getValidationProps(Y,{onFocus(){xe.state.triggerElement?.focus({focusVisible:!0})},onChange(V){if(V.nativeEvent.defaultPrevented||Y||x)return;const W=V.currentTarget.value,re=lt(kr,V.nativeEvent);function ve(){if(T)return;const Se=W.toLowerCase();let qe=ce.current.findIndex(Xe=>ql(Xe,N).toLowerCase()===Se||wA(Xe,A).toLowerCase()===Se);qe===-1&&(qe=ce.current.findIndex((Xe,Qe)=>{const ct=ne.current[Qe];return ct!=null&&ct.toLowerCase()===Se}));const Ke=ce.current[qe];Ke!=null&&Et(Ke,re)}xe.set("forceMount",!0),queueMicrotask(ve)}}),id:q&&tt==null?`${q}-hidden-input`:void 0,form:g,name:tt,autoComplete:m,value:Dt,disabled:Y,required:S&&!(T&&nn),readOnly:x,ref:Ge,style:ee?Pp:ld,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),kt]})}function kK(e,t){return e??t}const OK="data-popup-side",AK=400,MK={...Vu,...bc,popupSide:e=>e?{[OK]:e}:null,value:()=>null},NK=b.forwardRef(function(t,s){const{render:i,className:o,id:l,disabled:u=!1,nativeButton:d=!0,style:f,...g}=t,{setTouched:m,validationMode:h,validation:x,state:S,disabled:w}=ia(),{labelId:C}=Zo(),E=Ai(),R=E.useState("readOnly"),O=E.useState("required"),T=E.useState("disabled"),A=w||T||u,N=E.useState("open"),j=E.useState("mounted"),D=E.useState("value"),M=E.useState("triggerProps"),z=E.useState("positionerElement"),L=E.useState("listElement"),K=E.useState("popupSide"),X=E.useState("id"),B=E.useState("labelId"),H=E.useState("hasSelectedValue"),U=j&&z?K:null,_=l??X,Q=kK(C,B);xc({id:l});const G=Ln(z),q=b.useRef(null),Y=Td(A,q),{getButtonProps:ee,buttonRef:$}=ns({disabled:A,native:d}),ae=E.useStateSetter("triggerElement"),I=Hn(),F=Hn(),Z=Hn();b.useEffect(()=>{if(N)return Z.start(AK,()=>{E.context.selectionRef.current.allowUnselectedMouseUp=!0,E.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{Z.clear()};E.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},F.clear()},[N,E,F,Z]);const ne=Ir(M,{id:_,role:"combobox","aria-expanded":N,"aria-haspopup":"listbox","aria-controls":N?L?.id??Gh(z)?.id:void 0,"aria-labelledby":Q,"aria-readonly":R||void 0,"aria-required":O||void 0,tabIndex:A?-1:0,onFocus(ge){Y(!0),N&&E.context.alignItemWithTriggerActiveRef.current&&E.context.setOpen(!1,lt(kr,ge.nativeEvent)),I.start(0,()=>{E.set("forceMount",!0)})},onBlur(ge){st(z,ge.relatedTarget)||(m(!0),Y(!1),h==="onBlur"&&x.commit(D))},onMouseDown(ge){if(N)return;const fe=qt(ge.currentTarget);function ce(Re){if(!q.current)return;const be=Re.target;st(q.current,be)||st(G.current,be)||vA(Re,q.current)||E.context.setOpen(!1,lt(_v,Re))}F.start(0,()=>{fe.addEventListener("mouseup",ce,{once:!0})})}},g,ee),ye=x.getValidationProps(A,ne);ye.role="combobox";const se={...S,open:N,disabled:A,value:D,readOnly:R,popupSide:U,placeholder:!H};return bt("button",t,{ref:[s,q,$,ae],state:se,stateAttributesMapping:MK,props:ye})}),DK={value:()=>null},jK=b.forwardRef(function(t,s){const{className:i,render:o,children:l,placeholder:u,style:d,...f}=t,g=Ai(),m=g.useState("value"),h=g.useState("items"),x=g.useState("itemToStringLabel"),S=g.useState("hasSelectedValue"),w=!S&&u!=null&&l==null,C=g.useState("hasNullItemLabel",w),E={value:m,placeholder:!S};let R=null;return typeof l=="function"?R=l(m):l!=null?R=l:w&&!C?R=u:Array.isArray(m)?R=xH(m,h,x):R=EA(m,h,x),bt("span",t,{state:E,ref:[s,g.context.valueRef],props:[{children:R},f],stateAttributesMapping:DK})}),IK=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,g={open:Ai().useState("open")};return bt("span",t,{state:g,ref:s,props:[{"aria-hidden":!0,children:"▼"},u],stateAttributesMapping:Dp})}),PK=b.forwardRef(function(t,s){const i=Ai(),o=i.useState("mounted"),l=i.useState("forceMount");return o||l?y.jsx(Up,{ref:s,...t}):null}),tN=b.createContext(void 0);function mx(){const e=b.useContext(tN);if(!e)throw new Error(cn(59));return e}function Ep(e,t){e&&Object.assign(e.style,t)}const nN={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},LK={position:"fixed"},zK=b.forwardRef(function(t,s){const{anchor:i,className:o,render:l,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=KC,style:O,...T}=t,A=Ai(),N=JM(),j=A.useState("open"),D=A.useState("mounted"),M=A.useState("modal"),z=A.useState("value"),L=A.useState("openMethod"),K=A.useState("positionerElement"),X=A.useState("triggerElement"),B=A.useState("isItemEqualToValue"),H=A.useState("transitionStatus"),U=b.useRef(null),_=b.useRef(null),[Q,G]=b.useState(E),q=D&&Q&&L!=="touch";!D&&Q!==E&&G(E),b.useImperativeHandle(A.context.alignItemWithTriggerActiveRef,()=>q),mb((q||M)&&j,L==="touch",K,X);const Y=ng({anchor:i,floatingRootContext:N,positionMethod:u,mounted:D,side:d,sideOffset:g,align:f,alignOffset:m,arrowPadding:S,collisionBoundary:h,collisionPadding:x,sticky:w,disableAnchorTracking:C??q,collisionAvoidance:R,keepMounted:!0}),ee=q?"none":Y.side,$=q?LK:Y.positionerStyles,ae={open:j,side:ee,align:Y.align,anchorHidden:Y.anchorHidden};Pe(()=>{A.set("popupSide",Y.side)},[A,Y.side]);const I=A.useStateSetter("positionerElement"),F=rg(t,ae,{styles:$,transitionStatus:H,props:T,refs:[s,I],hidden:!D,inert:!j}),Z=b.useRef(0),ne=Be(se=>{if(A.context.valuesRef.current.length===0)return;const ge=Z.current;Z.current=se.size;const fe=lt(kr);if(ge!==0&&!A.state.multiple&&z!==null&&qh(A.context.valuesRef.current,z,B)===-1){const Re=A.context.initialValueRef.current,Le=Re!=null&&qh(A.context.valuesRef.current,Re,B)!==-1?Re:null;A.context.setValue(Le,fe),Le===null&&(A.set("selectedIndex",null),A.context.selectedItemTextRef.current=null)}if(ge!==0&&A.state.multiple&&Array.isArray(z)){const ce=z.filter(Re=>qh(A.context.valuesRef.current,Re,B)!==-1);ce.length!==z.length&&(A.context.setValue(ce,fe),ce.length===0&&(A.set("selectedIndex",null),A.context.selectedItemTextRef.current=null))}if(j&&q){A.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ce={height:""};Ep(K,ce),Ep(A.context.popupRef.current,ce)}}),ye=b.useMemo(()=>({...Y,side:ee,alignItemWithTriggerActive:q,setControlledAlignItemWithTrigger:G,scrollUpArrowRef:U,scrollDownArrowRef:_}),[Y,ee,q,G]);return y.jsx(Eg,{elementsRef:A.context.listRef,labelsRef:A.context.labelsRef,onMapChange:ne,children:y.jsxs(tN.Provider,{value:ye,children:[D&&M&&y.jsx(cg,{inert:hd(!j),cutout:X}),F]})})}),Oh="base-ui-disable-scrollbar",kv={className:Oh,getElement(e){return y.jsx("style",{nonce:e,href:Oh,precedence:"base-ui:low",children:`.${Oh}{scrollbar-width:none}.${Oh}::-webkit-scrollbar{display:none}`})}},nC="--transform-origin",_K={...sd,...ni},UK=b.forwardRef(function(t,s){const{render:i,className:o,style:l,finalFocus:u,...d}=t,f=Ai(),g=f.useState("multiple"),m=f.useState("readOnly"),h=f.useState("highlightItemOnHover"),x=JM(),{side:S,align:w,alignItemWithTriggerActive:C,isPositioned:E,setControlledAlignItemWithTrigger:R}=mx(),O=dg()!=null,T=tg(),{nonce:A,disableStyleElements:N}=EV(),j=f.useState("id"),D=f.useState("open"),M=f.useState("openMethod"),z=f.useState("mounted"),L=f.useState("popupProps"),K=f.useState("transitionStatus"),X=f.useState("triggerElement"),B=f.useState("positionerElement"),H=f.useState("listElement"),U=b.useRef(!1),_=b.useRef(!1),Q=b.useRef({}),G=oc(),q=Be(ae=>{if(!B||!f.context.popupRef.current||!_.current)return;const I=B.style.top==="0px",F=B.style.bottom==="0px";if(U.current||!C||!I&&!F){f.context.handleScrollArrowVisibility(ae);return}const Z=sC(B),ne=Nu(B.getBoundingClientRect().height,"y",Z),ye=qt(B),se=Rn(B),ge=se.getComputedStyle(B),fe=parseFloat(ge.marginTop),ce=parseFloat(ge.marginBottom),Re=rC(se.getComputedStyle(f.context.popupRef.current)),be=Math.min(ye.documentElement.clientHeight-fe-ce,Re),Le=ae.scrollTop,Oe=Ah(ae);let ze=null;const Ve=Fe=>{B.style.height=`${Fe}px`},ke=I?Oe-Le:Le,Ue=Math.min(ne+ke,be);if(ke<=Xs){const Fe=Mu(ke,0,be-ne);Fe>0&&Ve(ne+Fe),ae.scrollTop=I?Oe:0,be-(ne+Fe)<=Xs&&(U.current=!0),f.context.handleScrollArrowVisibility(ae);return}if(be-Ue>Xs)ze=I?1/0:0;else if(F&&Le<Oe){const Fe=ne+ke-be;ze=Le-(ke-Fe)}const xe=Math.ceil(Ue);if(xe!==0&&Ve(xe),ze!=null){const Fe=Mu(ze,0,Ah(ae));Math.abs(ae.scrollTop-Fe)>Xs&&(ae.scrollTop=Fe)}xe>=be-Xs&&(U.current=!0),f.context.handleScrollArrowVisibility(ae)});b.useImperativeHandle(f.context.scrollHandlerRef,()=>q,[q]),bs({open:D,ref:f.context.popupRef,onComplete(){D&&f.context.onOpenChangeComplete(!0)}});const Y={open:D,transitionStatus:K,side:S,align:w};Pe(()=>{!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]),Pe(()=>{D||C||(_.current=!1,U.current=!1,Ep(B,Q.current))},[D,C,B]),Pe(()=>{const ae=f.context.popupRef.current;if(!D||!X||!B||!ae||C&&!E||f.state.transitionStatus==="ending")return;if(_.current=!0,ae.style.removeProperty(nC),!C){G.request(()=>f.context.handleScrollArrowVisibility(H||ae));return}const I=HK(ae);try{let F=f.context.selectedItemTextRef.current;F?.isConnected||(F=!f.select("hasSelectedValue")&&f.context.firstItemTextRef.current?.isConnected?f.context.firstItemTextRef.current:null);const Z=f.context.valueRef.current,ne=Rn(B),ye=ne.getComputedStyle(B),se=ne.getComputedStyle(ae),ge=qt(X),fe=sC(X),ce=Mh(X.getBoundingClientRect(),fe),Re=Mh(B.getBoundingClientRect(),fe),be=ce.height,Le=H||ae,Oe=Le.scrollHeight,ze=parseFloat(se.borderBottomWidth),Ve=parseFloat(ye.marginTop)||10,ke=parseFloat(ye.marginBottom)||10,Ue=parseFloat(ye.minHeight)||100,xe=rC(se),Fe=5,Je=5,ot=20,de=ge.documentElement.clientHeight-Ve-ke,Ee=ge.documentElement.clientWidth,$e=de-ce.bottom+be;let Me,De=T==="rtl"?ce.right-Re.width:ce.left,xt=0;if(F&&Z){const pt=Mh(Z.getBoundingClientRect(),fe);Me=Mh(F.getBoundingClientRect(),fe),De=Re.left+(T==="rtl"?pt.right-Me.right:pt.left-Me.left);const St=pt.top-ce.top+pt.height/2;xt=Me.top-Re.top+Me.height/2-St}const dt=$e+xt+ke+ze;let gt=Math.min(de,dt);const Dt=de-Ve-ke,It=dt-gt,tn=Ee-Je;B.style.left=`${Mu(De,Fe,tn-Re.width)}px`,B.style.height=`${gt}px`,B.style.maxHeight="none",B.style.marginTop=`${Ve}px`,B.style.marginBottom=`${ke}px`,ae.style.height="100%";const an=Ah(Le),nn=It>=an-Xs;nn&&(gt=Math.min(de,Re.height)-(It-an));const et=ce.top<ot||ce.bottom>de-ot||Math.ceil(gt)+Xs<Math.min(Oe,Ue),Et=(ne.visualViewport?.scale??1)!==1&&Ti;if(et||Et){Ep(B,Q.current),R(!1);return}const Zt=Math.max(Ue,gt);if(nn){const pt=Math.max(0,de-dt);B.style.top=Re.height>=Dt?"0":`${pt}px`,B.style.height=`${gt}px`,Le.scrollTop=Ah(Le)}else B.style.bottom="0",Le.scrollTop=It;if(Me){const pt=Re.top,St=Re.height,yt=Me.top+Me.height/2,Ht=Mu(St>0?(yt-pt)/St*100:50,0,100);ae.style.setProperty(nC,`50% ${Ht}%`)}(Zt===de||gt>=xe)&&(U.current=!0),f.context.handleScrollArrowVisibility(Le),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,G,H,h,T,E]),b.useEffect(()=>{if(!C||!B||!D)return;const ae=Rn(B);function I(F){f.context.setOpen(!1,lt(A4,F))}return zt(ae,"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(ae){O&&yd.has(ae.key)&&ae.stopPropagation()},onScroll(ae){H||q(ae.currentTarget)},...C&&{style:H?{height:"100%"}:nN},className:!H&&C?kv.className:void 0},$=bt("div",t,{ref:[s,f.context.popupRef],state:Y,stateAttributesMapping:_K,props:[L,ee,fd(K),d]});return y.jsxs(b.Fragment,{children:[!N&&kv.getElement(A),y.jsx(Hp,{context:x,modal:!1,disabled:!z,openInteractionType:M,returnFocus:u,restoreFocus:!0,children:$})]})});function rC(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function Ah(e){return gx(e.scrollHeight,e.clientHeight)}function sC(e){return mT.getScale(e)}function Nu(e,t,s){return e/s[t]}function Mh(e,t){return Ku({x:Nu(e.x,"x",t),y:Nu(e.y,"y",t),width:Nu(e.width,"x",t),height:Nu(e.height,"y",t)})}const iC=[["transform","none"],["scale","1"],["translate","0 0"]];function HK(e){const{style:t}=e,s={};for(const[i,o]of iC)s[i]=t.getPropertyValue(i),t.setProperty(i,o,"important");return()=>{for(const[i]of iC){const o=s[i];o?t.setProperty(i,o):t.removeProperty(i)}}}const FK=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,d=Ai(),f=d.useState("multiple"),g=d.useState("readOnly"),{alignItemWithTriggerActive:m}=mx(),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:nN},className:h&&x!=="touch"?kv.className:void 0},C=d.useStateSetter("listElement");return bt("div",t,{ref:[s,C],props:[w,u]})}),rN=b.createContext(void 0);function sN(){const e=b.useContext(rN);if(!e)throw new Error(cn(57));return e}const BK=b.memo(b.forwardRef(function(t,s){const{render:i,className:o,style:l,value:u=null,label:d,disabled:f=!1,nativeButton:g=!1,...m}=t,h=b.useRef(null),x=Rd({guess:!0,label:d,textRef:h}),S=Ai(),{props:w,multiple:C,disabled:E,readOnly:R,isItemEqualToValue:O}=S.useState("itemRoot"),T=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,z=b.useRef(null);Pe(()=>{const Y=S.context.valuesRef.current;return Y[M]=u,()=>{delete Y[M]}},[M,u,S]),Pe(()=>{const Y=S.state.value,ee=S.state.selectedIndex;let $=ee,ae;C&&Array.isArray(Y)?($=EK(M,u,S.context.valuesRef.current,Y,O,ee),ae=$===M,M===ee&&!ae&&(S.context.selectedItemTextRef.current=null)):(ae=Y!==void 0&&Yo(u,Y,O),ae&&($=M)),S.set("selectedIndex",$),ae&&h.current&&(S.context.selectedItemTextRef.current=h.current)},[M,C,O,S,u]);const L=b.useRef("mouse"),K=b.useRef(!1),{getButtonProps:X,buttonRef:B}=ns({disabled:T,focusableWhenDisabled:!0,native:g,composite:!0}),H={disabled:T,selected:j,highlighted:A};function U(Y){if(E||R)return;const ee=S.state.value;if(C){const $=Array.isArray(ee)?ee:[],ae=j?RK($,u,O):[...$,u];S.context.setValue(ae,lt(zo,Y))}else S.context.setValue(u,lt(zo,Y)),S.context.setOpen(!1,lt(zo,Y))}function _(){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",$=Y.nativeEvent.pointerType,ae=ee&&ac(Y.nativeEvent)&&($!==void 0||A),I=ee&&!ae&&!K.current;K.current=!1,!(T||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,K.current=!0,_()},onMouseUp(){if(_(),T||L.current==="touch"||K.current)return;const Y=!S.context.selectionRef.current.allowSelectedMouseUp&&j,ee=!S.context.selectionRef.current.allowUnselectedMouseUp&&!j;Y||ee||(K.current=!0,z.current?.click(),K.current=!1)}},G=bt("div",t,{ref:[B,s,x.ref,z],state:H,props:[w,Q,m,X]}),q=b.useMemo(()=>({selected:j,index:M,textRef:h,selectedByFocus:D}),[j,M,h,D]);return y.jsx(rN.Provider,{value:q,children:G})})),VK=b.memo(b.forwardRef(function(t,s){const{render:i,className:o,style:l,keepMounted:u,selected:d,...f}=t,g=b.useRef(null),{transitionStatus:m,setMounted:h}=Ja(d),S=bt("span",t,{ref:[s,g],state:{selected:d,transitionStatus:m},props:[{"aria-hidden":!0,children:"✔️"},f],stateAttributesMapping:ni});return bs({batch:!0,enabled:!d,open:d,ref:g,onComplete(){d||h(!1)}}),S})),KK=b.forwardRef(function(t,s){const{selected:i}=sN();return t.keepMounted||i?y.jsx(VK,{...t,selected:i,ref:s}):null}),qK=b.memo(b.forwardRef(function(t,s){const{index:i,textRef:o,selectedByFocus:l}=sN(),u=Ai(),{render:d,className:f,style:g,...m}=t,h=b.useCallback(S=>{S&&(i===0&&(u.context.firstItemTextRef.current=S),l&&(u.context.selectedItemTextRef.current=S))},[u,i,l]);return bt("div",t,{ref:[h,s,o],props:m})})),iN=b.forwardRef(function(t,s){const{render:i,className:o,style:l,direction:u,keepMounted:d,...f}=t,g=u==="up",m=Ai(),{side:h,scrollDownArrowRef:x,scrollUpArrowRef:S}=mx(),w=g?"scrollUpArrowVisible":"scrollDownArrowVisible",C=m.useState(w),E=m.useState("openMethod"),R=C&&E!=="touch",O=Hn(),T=g?S:x,{mounted:A,transitionStatus:N,setMounted:j}=Ja(R);Pe(()=>(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]),bs({open:R,ref:T,onComplete(){R||j(!1)}});const z=bt("div",t,{ref:[s,T],state:{direction:u,visible:R,side:h,transitionStatus:N},props:[{"aria-hidden":!0,children:g?"▲":"▼",style:{position:"absolute"},onMouseMove(K){if(K.movementX===0&&K.movementY===0||O.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=gx(B.scrollHeight,B.clientHeight),U=wp(B.scrollTop,H),_=U===(g?0:H),Q=m.context.listRef.current;if(U!==B.scrollTop&&(B.scrollTop=U),_){O.clear();return}if(Q.length>0){const G=T.current?.offsetHeight||0;B.scrollTop=YK(Q,g,U,B.clientHeight,G,H)}O.start(40,X)}O.start(40,X)},onMouseLeave(){O.clear()}},f],stateAttributesMapping:ni});return A||d?z:null});function YK(e,t,s,i,o,l){if(t){let m=0;const h=s+o-Xs;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?wp(S.offsetTop-o,l):0}let u=e.length-1;const d=s+i-o+Xs;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?wp(g.offsetTop+g.offsetHeight-i+o,l):l}const $K=b.forwardRef(function(t,s){return y.jsx(iN,{...t,ref:s,direction:"down"})}),GK=b.forwardRef(function(t,s){return y.jsx(iN,{...t,ref:s,direction:"up"})}),yx=TK;function vx({className:e,...t}){return y.jsx(jK,{"data-slot":"select-value",className:He("flex flex-1 text-left",e),...t})}function bx({className:e,size:t="default",children:s,...i}){return y.jsxs(NK,{"data-slot":"select-trigger","data-size":t,className:He("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),...i,children:[s,y.jsx(IK,{render:y.jsx(ab,{className:"pointer-events-none size-3.5 text-muted-foreground"})})]})}function xx({className:e,children:t,side:s="bottom",sideOffset:i=4,align:o="center",alignOffset:l=0,alignItemWithTrigger:u=!0,...d}){return y.jsx(PK,{children:y.jsx(zK,{side:s,sideOffset:i,align:o,alignOffset:l,alignItemWithTrigger:u,className:"isolate z-50",children:y.jsxs(UK,{"data-slot":"select-content","data-align-trigger":u,className:He("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:[y.jsx(QK,{}),y.jsx(FK,{children:t}),y.jsx(XK,{})]})})})}function Sx({className:e,children:t,...s}){return y.jsxs(BK,{"data-slot":"select-item",className:He("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),...s,children:[y.jsx(qK,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),y.jsx(KK,{render:y.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:y.jsx(pd,{className:"pointer-events-none"})})]})}function QK({className:e,...t}){return y.jsx(GK,{"data-slot":"select-scroll-up-button",className:He("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:y.jsx(OL,{})})}function XK({className:e,...t}){return y.jsx($K,{"data-slot":"select-scroll-down-button",className:He("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:y.jsx(ab,{})})}const aN=["en-US","zh-CN","zh-TW","ja-JP"],ZK={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語"},JK={"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.selectAria":"Select {{name}}","skills.selectAll":"Select all","skills.deselectAll":"Deselect all","skills.batch":"Batch","skills.batchAssigned":"Skill assignments updated.","skills.batchAssignPartial":"{{completed}} changes saved; {{failed}} failed. Retry to finish.","skills.unassign":"Unassign","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}}","skills.inAgents":"Skills in your agents","skills.inAgentsLoadError":"Unable to read agent skills. Please try again.","skills.inAgentsEmptyTitle":"No skills found","skills.inAgentsEmptyDescription":"This agent’s skills directory is empty.","skills.openOriginAria":"Open origin folder {{path}}","skills.openOriginError":"Unable to open the origin folder.","skills.bringIn":"Bring in","skills.bringInManaged":"Already managed by Foundry","skills.bringInSuccess":"Brought {{name}} into Foundry.","skills.bringInError":"Unable to bring the skill into Foundry. Please try again.","skills.deleteInstalled":"Delete from agent","skills.deleteInstalledTitle":"Delete installed skill","skills.deleteInstalledDescription":"Remove <skillName>{{name}}</skillName> from this agent. A symbolic link is unlinked without deleting its target; an ordinary file or folder is permanently deleted.","skills.deleteInstalledSuccess":"Removed {{name}} from the agent.","skills.deleteInstalledError":"Unable to delete the installed skill. Please try again.","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. Enabled agent files were synchronized.","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"},WK={"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.selectAria":"选择 {{name}}","skills.selectAll":"全选","skills.deselectAll":"取消全选","skills.batch":"批量操作","skills.batchAssigned":"技能分配已更新。","skills.batchAssignPartial":"{{completed}} 项更改已保存,{{failed}} 项失败,请重试以完成更改。","skills.unassign":"取消分配","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}} 的操作","skills.inAgents":"Agent 中的技能","skills.inAgentsLoadError":"无法读取 Agent 技能,请重试。","skills.inAgentsEmptyTitle":"未找到技能","skills.inAgentsEmptyDescription":"该 Agent 的技能目录为空。","skills.openOriginAria":"打开来源目录 {{path}}","skills.openOriginError":"无法打开来源目录。","skills.bringIn":"引入","skills.bringInManaged":"已由 Foundry 管理","skills.bringInSuccess":"已将 {{name}} 引入 Foundry。","skills.bringInError":"无法将技能引入 Foundry,请重试。","skills.deleteInstalled":"从 Agent 中删除","skills.deleteInstalledTitle":"删除已安装技能","skills.deleteInstalledDescription":"从该 Agent 中移除 <skillName>{{name}}</skillName>。符号链接只会取消链接,不会删除目标;普通文件或目录会被永久删除。","skills.deleteInstalledSuccess":"已从 Agent 中移除 {{name}}。","skills.deleteInstalledError":"无法删除已安装技能,请重试。","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":"切换侧边栏"},eq={"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.selectAria":"選擇 {{name}}","skills.selectAll":"全選","skills.deselectAll":"取消全選","skills.batch":"批次操作","skills.batchAssigned":"技能分配已更新。","skills.batchAssignPartial":"{{completed}} 項變更已儲存,{{failed}} 項失敗,請重試以完成變更。","skills.unassign":"取消分配","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}} 的操作","skills.inAgents":"Agent 中的技能","skills.inAgentsLoadError":"無法讀取 Agent 技能,請重試。","skills.inAgentsEmptyTitle":"找不到技能","skills.inAgentsEmptyDescription":"該 Agent 的技能目錄是空的。","skills.openOriginAria":"開啟來源目錄 {{path}}","skills.openOriginError":"無法開啟來源目錄。","skills.bringIn":"引入","skills.bringInManaged":"已由 Foundry 管理","skills.bringInSuccess":"已將 {{name}} 引入 Foundry。","skills.bringInError":"無法將技能引入 Foundry,請重試。","skills.deleteInstalled":"從 Agent 中刪除","skills.deleteInstalledTitle":"刪除已安裝技能","skills.deleteInstalledDescription":"從該 Agent 中移除 <skillName>{{name}}</skillName>。符號連結只會取消連結,不會刪除目標;一般檔案或目錄會被永久刪除。","skills.deleteInstalledSuccess":"已從 Agent 中移除 {{name}}。","skills.deleteInstalledError":"無法刪除已安裝技能,請重試。","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":"切換側邊欄"},tq={"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.selectAria":"{{name}} を選択","skills.selectAll":"すべて選択","skills.deselectAll":"すべての選択を解除","skills.batch":"一括操作","skills.batchAssigned":"スキルの割り当てを更新しました。","skills.batchAssignPartial":"{{completed}} 件成功、{{failed}} 件失敗しました。再試行して完了してください。","skills.unassign":"割り当て解除","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}} の操作","skills.inAgents":"エージェントのスキル","skills.inAgentsLoadError":"エージェントのスキルを読み込めませんでした。もう一度お試しください。","skills.inAgentsEmptyTitle":"スキルが見つかりません","skills.inAgentsEmptyDescription":"このエージェントのスキルディレクトリは空です。","skills.openOriginAria":"元のフォルダー {{path}} を開く","skills.openOriginError":"元のフォルダーを開けませんでした。","skills.bringIn":"取り込む","skills.bringInManaged":"Foundry で管理済み","skills.bringInSuccess":"{{name}} を Foundry に取り込みました。","skills.bringInError":"スキルを Foundry に取り込めませんでした。もう一度お試しください。","skills.deleteInstalled":"エージェントから削除","skills.deleteInstalledTitle":"インストール済みスキルを削除","skills.deleteInstalledDescription":"このエージェントから <skillName>{{name}}</skillName> を削除します。シンボリックリンクはリンクのみ解除し、対象は削除しません。通常のファイルやフォルダーは完全に削除されます。","skills.deleteInstalledSuccess":"{{name}} をエージェントから削除しました。","skills.deleteInstalledError":"インストール済みスキルを削除できませんでした。もう一度お試しください。","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":"サイドバーを切り替える"},nq={"en-US":{translation:JK},"zh-CN":{translation:WK},"zh-TW":{translation:eq},"ja-JP":{translation:tq}};function rq({value:e,onValueChange:t,disabled:s=!1}){const{t:i}=ht(),o=[{value:"system",label:i("common.system")},...aN.map(l=>({value:l,label:ZK[l]}))];return y.jsx(ro,{label:i("settings.language"),children:y.jsxs(yx,{items:o,value:e,onValueChange:l=>{l&&t(l)},disabled:s,children:[y.jsx(bx,{"aria-label":i("settings.language"),className:"w-52",children:y.jsx(vx,{})}),y.jsx(xx,{children:o.map(l=>y.jsx(Sx,{value:l.value,children:l.label},l.value))})]})})}const aC=iB.map(e=>({value:e,label:e}));function sq({value:e,onValueChange:t,disabled:s=!1}){const{t:i}=ht();return y.jsx(ro,{label:i("settings.timeFormat"),children:y.jsxs(yx,{items:aC,value:e,onValueChange:o=>{o&&t(o)},disabled:s,children:[y.jsx(bx,{"aria-label":i("settings.timeFormat"),className:"w-52",children:y.jsx(vx,{})}),y.jsx(xx,{children:aC.map(o=>y.jsx(Sx,{value:o.value,children:o.label},o.value))})]})})}const iq={"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 aq({value:e,onValueChange:t,disabled:s=!1}){const{t:i}=ht(),o=aB.map(l=>({value:l,label:i(iq[l])}));return y.jsx(ro,{label:i("settings.timeZone"),children:y.jsxs(yx,{items:o,value:e,onValueChange:l=>{l&&t(l)},disabled:s,children:[y.jsx(bx,{"aria-label":i("settings.timeZone"),className:"w-52",children:y.jsx(vx,{})}),y.jsx(xx,{children:o.map(l=>y.jsx(Sx,{value:l.value,children:l.label},l.value))})]})})}const Pa=["settings"],Yh=["settings","update"];function wx(){const{t:e}=ht(),t=Or(),s=fg({mutationKey:Yh})>0,i=ri({queryKey:Pa,queryFn:({signal:h})=>m_(h),staleTime:1/0,retry:!1}),o=Un({mutationKey:Yh,mutationFn:y_,onMutate:async h=>{await t.cancelQueries({queryKey:Pa});const x=t.getQueryData(Pa);return x&&t.setQueryData(Pa,oq(x,h)),{previous:x}},onSuccess:h=>{t.setQueryData(Pa,h)},onError:(h,x,S)=>{S?.previous&&t.setQueryData(Pa,S.previous),Nt.error(e(lq(x)))},onSettled:()=>t.invalidateQueries({queryKey:Pa})}),l=i.data??null,u=l?.workspace.appearance["color-theme"]??"system",d=l?.workspace["language-region"].language??"system",f=l?.workspace["language-region"]["time-format"]??"YYYY-MM-DD HH:mm:ss",g=l?.workspace["language-region"]["time-zone"]??"America/Los_Angeles";function m(h){!l||t.isMutating({mutationKey:Yh})>0||o.mutate(h)}return{settings:l,theme:u,language:d,timeFormat:f,timeZone:g,isLoading:i.isPending,isUpdating:s,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 oq(e,t){const s=e.workspace,i=s["language-region"];return{...e,workspace:{appearance:{"color-theme":t.theme??s.appearance["color-theme"]},"language-region":{language:t.language??i.language,"time-format":t.timeFormat??i["time-format"],"time-zone":t.timezone??i["time-zone"]}}}}function lq(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 Io=[{id:"appearance",labelKey:"settings.appearance",ariaKey:"settings.appearanceAria",icon:KL},{id:"language-region",labelKey:"settings.languageRegion",ariaKey:"settings.languageRegionAria",icon:zL},{id:"advanced",labelKey:"settings.advanced",ariaKey:"settings.advancedAria",icon:Ek}];function cq(){const{t:e}=ht(),{state:t}=gr(),[s,i]=K8(),o=Io.find(({id:T})=>T===s.get("panel"))?.id??Io[0].id,l=T=>{i(A=>{const N=new URLSearchParams(A);return N.set("panel",T),N},{state:t})},{settings:u,theme:d,language:f,timeFormat:g,timeZone:m,isLoading:h,isUpdating:x,setTheme:S,setLanguage:w,setTimeFormat:C,setTimeZone:E}=wx(),R=Io.find(T=>T.id===o)?.ariaKey??"settings.appearanceAria",O=Io.find(T=>T.id===o)?.labelKey??"settings.appearance";return y.jsxs("div",{className:`
|
|
266
|
-
grid h-full min-h-0 grid-cols-[260px_minmax(0,1fr)]
|
|
267
|
-
max-[680px]:grid-cols-1
|
|
268
|
-
`,children:[y.jsx("aside",{className:`
|
|
269
|
-
hidden min-h-0 overflow-y-auto p-4
|
|
270
|
-
min-[680px]:block
|
|
271
|
-
`,children:y.jsx(uq,{activeSection:o,onSectionChange:l})}),y.jsxs("section",{"aria-label":e(R),className:"min-h-0 overflow-y-auto p-4",children:[y.jsxs("div",{className:`
|
|
272
|
-
mb-3 flex items-center gap-3
|
|
273
|
-
min-[680px]:hidden
|
|
274
|
-
`,children:[y.jsxs(Wa,{children:[y.jsx(eo,{render:y.jsx(Ze,{type:"button",variant:"outline",size:"icon","aria-label":e("settings.openNavigation")}),children:y.jsx(BL,{})}),y.jsx(to,{side:"bottom",align:"start",sideOffset:8,"aria-label":e("settings.navigation"),className:"w-56",children:y.jsxs(RA,{children:[y.jsx(CA,{children:e("settings.workspace")}),y.jsx(SH,{value:o,onValueChange:T=>{const A=Io.find(({id:N})=>N===T);A&&l(A.id)},children:Io.map(({id:T,labelKey:A,icon:N})=>y.jsxs(wH,{value:T,closeOnClick:!0,children:[y.jsx(N,{}),e(A)]},T))})]})})]}),y.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:e(O)})]}),y.jsxs(Qi,{className:"gap-0 py-0",children:[h&&y.jsxs("div",{className:`
|
|
275
|
-
flex flex-col items-start gap-3 p-4
|
|
276
|
-
min-[680px]:min-h-16 min-[680px]:flex-row
|
|
277
|
-
min-[680px]:items-center min-[680px]:justify-between
|
|
278
|
-
min-[680px]:gap-8
|
|
279
|
-
`,children:[y.jsx(Gn,{className:"h-4 w-24"}),y.jsxs("div",{className:"flex items-center gap-6",children:[y.jsx(Gn,{className:"h-4 w-16"}),y.jsx(Gn,{className:"h-4 w-10"}),y.jsx(Gn,{className:"h-4 w-10"})]})]}),!h&&o==="appearance"&&y.jsx(vK,{value:d,onValueChange:T=>{S(T)},disabled:x||!u}),!h&&o==="language-region"&&y.jsxs("div",{className:"divide-y",children:[y.jsx(rq,{value:f,onValueChange:T=>{w(T)},disabled:x||!u}),y.jsx(aq,{value:m,onValueChange:T=>{E(T)},disabled:x||!u}),y.jsx(sq,{value:g,onValueChange:T=>{C(T)},disabled:x||!u})]}),!h&&o==="advanced"&&y.jsxs("div",{className:"divide-y",children:[y.jsx(nK,{disabled:x||!u}),y.jsx(aK,{disabled:x||!u}),y.jsx(KV,{configFolder:u?.configFolder}),y.jsx(YV,{disabled:x||!u})]})]})]})]})}function uq({activeSection:e,onSectionChange:t}){const{t:s}=ht();return y.jsx("nav",{"aria-label":s("settings.navigation"),children:y.jsxs(Qi,{size:"sm",children:[y.jsx(O9,{children:y.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:s("settings.workspace")})}),y.jsx(A9,{className:"flex flex-col gap-1",children:Io.map(({id:i,labelKey:o,icon:l})=>{const u=i===e;return y.jsxs(Ze,{type:"button",variant:u?"secondary":"ghost","aria-current":u?"page":void 0,onClick:()=>{t(i)},className:"w-full justify-start gap-2",children:[y.jsx(l,{className:u?void 0:"text-muted-foreground"}),y.jsx("span",{children:s(o)})]},i)})})]})})}pr.use(H5).init({resources:nq,lng:oN(),fallbackLng:"en-US",supportedLngs:[...aN],keySeparator:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1}});function oN(){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 dq(){const e=Or();b.useEffect(()=>{const t=new EventSource("/api/events"),s=()=>{e.invalidateQueries({queryKey:Pa,refetchType:e.isMutating({mutationKey:Yh})>0?"none":"active"})},i=o=>{try{const l=JSON.parse(o.data);typeof l=="object"&&l!==null&&"version"in l&&l.version===oB&&"type"in l&&l.type===lB&&s()}catch{}};return t.addEventListener("open",s),t.addEventListener("foundry",i),()=>{t.removeEventListener("open",s),t.removeEventListener("foundry",i),t.close()}},[e])}const Ov=matchMedia("(prefers-color-scheme: dark)");function fq(e){return Ov.addEventListener("change",e),()=>Ov.removeEventListener("change",e)}function hq(){return Ov.matches?"dark":"light"}function pq({children:e}){dq();const{theme:t,language:s}=wx(),i=b.useSyncExternalStore(fq,hq),o=t==="system"?i:t,l=s==="system"?oN():s;return b.useLayoutEffect(()=>{const u=document.documentElement;u.classList.toggle("dark",o==="dark"),u.style.colorScheme=o},[o]),b.useLayoutEffect(()=>{pr.changeLanguage(l),document.documentElement.lang=l},[l]),e}const gq=new n_({queryCache:new lO({onError:(e,t)=>{t.queryKey[0]==="skill-targets"?Nt.error(pr.t("settings.errors.skillTargets")):t.queryKey[0]==="settings"&&Nt.error(pr.t("settings.errors.load"))}})});function mq(){return null}function yq(e){switch(e){case"/library/instructions":return y.jsx(NB,{});case"/library/skills":return y.jsx(PV,{});default:return y.jsx(mq,{})}}const vq=_8([{element:y.jsx(Sq,{}),children:[{element:y.jsx(DF,{}),children:[...SF.map(e=>({path:e,element:yq(e)})),{path:"/library/skills/:name",element:y.jsx(VV,{})}]},{element:y.jsx(jF,{}),children:[{path:"/settings",element:y.jsx(cq,{})}]},{path:"*",element:y.jsx(f8,{to:"/dashboard",replace:!0})}]}]);function bq(){return y.jsx(Nz,{client:gq,children:y.jsx(zP,{children:y.jsx(pq,{children:y.jsx(xq,{})})})})}function xq(){const{theme:e}=wx();return y.jsxs(y.Fragment,{children:[y.jsx(Z8,{router:vq}),y.jsx(QL,{theme:e,position:"top-center"})]})}function Sq(){return y.jsxs(y.Fragment,{children:[y.jsx(zb,{}),y.jsx(eU,{})]})}Yj.createRoot(document.getElementById("root")).render(y.jsx(b.StrictMode,{children:y.jsx(bq,{})}));export{Ne as W,CB as _,y as j,b as r,ht as u};
|