var kw=e=>{throw TypeError(e)};var wg=(e,t,r)=>t.has(e)||kw("Cannot "+r);var F=(e,t,r)=>(wg(e,t,"read from private field"),r?r.call(e):t.get(e)),be=(e,t,r)=>t.has(e)?kw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),pe=(e,t,r,o)=>(wg(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r),Oe=(e,t,r)=>(wg(e,t,"access private method"),r);var df=(e,t,r,o)=>({set _(s){pe(e,t,s,r)},get _(){return F(e,t,o)}});function qA(e,t){for(var r=0;r<t.length;r++){const o=t[r];if(typeof o!="string"&&!Array.isArray(o)){for(const s in o)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(o,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>o[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function r(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(s){if(s.ep)return;s.ep=!0;const l=r(s);fetch(s.href,l)}})();function Eh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sg={exports:{}},zc={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var zw;function FA(){if(zw)return zc;zw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(o,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var f in s)f!=="key"&&(l[f]=s[f])}else l=s;return s=l.ref,{$$typeof:e,type:o,key:c,ref:s!==void 0?s:null,props:l}}return zc.Fragment=t,zc.jsx=r,zc.jsxs=r,zc}var Lw;function XA(){return Lw||(Lw=1,Sg.exports=FA()),Sg.exports}var d=XA(),Eg={exports:{}},ze={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Pw;function YA(){if(Pw)return ze;Pw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),v=Symbol.iterator;function x(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,_={};function C(k,L,Y){this.props=k,this.context=L,this.refs=_,this.updater=Y||E}C.prototype.isReactComponent={},C.prototype.setState=function(k,L){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,L,"setState")},C.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function j(){}j.prototype=C.prototype;function N(k,L,Y){this.props=k,this.context=L,this.refs=_,this.updater=Y||E}var R=N.prototype=new j;R.constructor=N,S(R,C.prototype),R.isPureReactComponent=!0;var O=Array.isArray;function A(){}var D={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function H(k,L,Y){var W=Y.ref;return{$$typeof:e,type:k,key:L,ref:W!==void 0?W:null,props:Y}}function Q(k,L){return H(k.type,L,k.props)}function V(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function q(k){var L={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(Y){return L[Y]})}var ee=/\/+/g;function B(k,L){return typeof k=="object"&&k!==null&&k.key!=null?q(""+k.key):L.toString(36)}function K(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(A,A):(k.status="pending",k.then(function(L){k.status==="pending"&&(k.status="fulfilled",k.value=L)},function(L){k.status==="pending"&&(k.status="rejected",k.reason=L)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function M(k,L,Y,W,J){var se=typeof k;(se==="undefined"||se==="boolean")&&(k=null);var ne=!1;if(k===null)ne=!0;else switch(se){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(k.$$typeof){case e:case t:ne=!0;break;case g:return ne=k._init,M(ne(k._payload),L,Y,W,J)}}if(ne)return J=J(k),ne=W===""?"."+B(k,0):W,O(J)?(Y="",ne!=null&&(Y=ne.replace(ee,"$&/")+"/"),M(J,L,Y,"",function(ve){return ve})):J!=null&&(V(J)&&(J=Q(J,Y+(J.key==null||k&&k.key===J.key?"":(""+J.key).replace(ee,"$&/")+"/")+ne)),L.push(J)),1;ne=0;var re=W===""?".":W+":";if(O(k))for(var le=0;le<k.length;le++)W=k[le],se=re+B(W,le),ne+=M(W,L,Y,se,J);else if(le=x(k),typeof le=="function")for(k=le.call(k),le=0;!(W=k.next()).done;)W=W.value,se=re+B(W,le++),ne+=M(W,L,Y,se,J);else if(se==="object"){if(typeof k.then=="function")return M(K(k),L,Y,W,J);throw L=String(k),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return ne}function I(k,L,Y){if(k==null)return k;var W=[],J=0;return M(k,W,"","",function(se){return L.call(Y,se,J++)}),W}function U(k){if(k._status===-1){var L=k._result;L=L(),L.then(function(Y){(k._status===0||k._status===-1)&&(k._status=1,k._result=Y)},function(Y){(k._status===0||k._status===-1)&&(k._status=2,k._result=Y)}),k._status===-1&&(k._status=0,k._result=L)}if(k._status===1)return k._result.default;throw k._result}var $=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},X={map:I,forEach:function(k,L,Y){I(k,function(){L.apply(this,arguments)},Y)},count:function(k){var L=0;return I(k,function(){L++}),L},toArray:function(k){return I(k,function(L){return L})||[]},only:function(k){if(!V(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return ze.Activity=p,ze.Children=X,ze.Component=C,ze.Fragment=r,ze.Profiler=s,ze.PureComponent=N,ze.StrictMode=o,ze.Suspense=m,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,ze.__COMPILER_RUNTIME={__proto__:null,c:function(k){return D.H.useMemoCache(k)}},ze.cache=function(k){return function(){return k.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(k,L,Y){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var W=S({},k.props),J=k.key;if(L!=null)for(se in L.key!==void 0&&(J=""+L.key),L)!P.call(L,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&L.ref===void 0||(W[se]=L[se]);var se=arguments.length-2;if(se===1)W.children=Y;else if(1<se){for(var ne=Array(se),re=0;re<se;re++)ne[re]=arguments[re+2];W.children=ne}return H(k.type,J,W)},ze.createContext=function(k){return k={$$typeof:c,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:l,_context:k},k},ze.createElement=function(k,L,Y){var W,J={},se=null;if(L!=null)for(W in L.key!==void 0&&(se=""+L.key),L)P.call(L,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(J[W]=L[W]);var ne=arguments.length-2;if(ne===1)J.children=Y;else if(1<ne){for(var re=Array(ne),le=0;le<ne;le++)re[le]=arguments[le+2];J.children=re}if(k&&k.defaultProps)for(W in ne=k.defaultProps,ne)J[W]===void 0&&(J[W]=ne[W]);return H(k,se,J)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(k){return{$$typeof:f,render:k}},ze.isValidElement=V,ze.lazy=function(k){return{$$typeof:g,_payload:{_status:-1,_result:k},_init:U}},ze.memo=function(k,L){return{$$typeof:h,type:k,compare:L===void 0?null:L}},ze.startTransition=function(k){var L=D.T,Y={};D.T=Y;try{var W=k(),J=D.S;J!==null&&J(Y,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(A,$)}catch(se){$(se)}finally{L!==null&&Y.types!==null&&(L.types=Y.types),D.T=L}},ze.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},ze.use=function(k){return D.H.use(k)},ze.useActionState=function(k,L,Y){return D.H.useActionState(k,L,Y)},ze.useCallback=function(k,L){return D.H.useCallback(k,L)},ze.useContext=function(k){return D.H.useContext(k)},ze.useDebugValue=function(){},ze.useDeferredValue=function(k,L){return D.H.useDeferredValue(k,L)},ze.useEffect=function(k,L){return D.H.useEffect(k,L)},ze.useEffectEvent=function(k){return D.H.useEffectEvent(k)},ze.useId=function(){return D.H.useId()},ze.useImperativeHandle=function(k,L,Y){return D.H.useImperativeHandle(k,L,Y)},ze.useInsertionEffect=function(k,L){return D.H.useInsertionEffect(k,L)},ze.useLayoutEffect=function(k,L){return D.H.useLayoutEffect(k,L)},ze.useMemo=function(k,L){return D.H.useMemo(k,L)},ze.useOptimistic=function(k,L){return D.H.useOptimistic(k,L)},ze.useReducer=function(k,L,Y){return D.H.useReducer(k,L,Y)},ze.useRef=function(k){return D.H.useRef(k)},ze.useState=function(k){return D.H.useState(k)},ze.useSyncExternalStore=function(k,L,Y){return D.H.useSyncExternalStore(k,L,Y)},ze.useTransition=function(){return D.H.useTransition()},ze.version="19.2.4",ze}var Hw;function Nu(){return Hw||(Hw=1,Eg.exports=YA()),Eg.exports}var b=Nu();const me=Eh(b),S_=qA({__proto__:null,default:me},[b]);var _g={exports:{}},Lc={},Cg={exports:{}},Ng={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Iw;function GA(){return Iw||(Iw=1,(function(e){function t(M,I){var U=M.length;M.push(I);e:for(;0<U;){var $=U-1>>>1,X=M[$];if(0<s(X,I))M[$]=I,M[U]=X,U=$;else break e}}function r(M){return M.length===0?null:M[0]}function o(M){if(M.length===0)return null;var I=M[0],U=M.pop();if(U!==I){M[0]=U;e:for(var $=0,X=M.length,k=X>>>1;$<k;){var L=2*($+1)-1,Y=M[L],W=L+1,J=M[W];if(0>s(Y,U))W<X&&0>s(J,Y)?(M[$]=J,M[W]=U,$=W):(M[$]=Y,M[L]=U,$=L);else if(W<X&&0>s(J,U))M[$]=J,M[W]=U,$=W;else break e}}return I}function s(M,I){var U=M.sortIndex-I.sortIndex;return U!==0?U:M.id-I.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 c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var m=[],h=[],g=1,p=null,v=3,x=!1,E=!1,S=!1,_=!1,C=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function R(M){for(var I=r(h);I!==null;){if(I.callback===null)o(h);else if(I.startTime<=M)o(h),I.sortIndex=I.expirationTime,t(m,I);else break;I=r(h)}}function O(M){if(S=!1,R(M),!E)if(r(m)!==null)E=!0,A||(A=!0,q());else{var I=r(h);I!==null&&K(O,I.startTime-M)}}var A=!1,D=-1,P=5,H=-1;function Q(){return _?!0:!(e.unstable_now()-H<P)}function V(){if(_=!1,A){var M=e.unstable_now();H=M;var I=!0;try{e:{E=!1,S&&(S=!1,j(D),D=-1),x=!0;var U=v;try{t:{for(R(M),p=r(m);p!==null&&!(p.expirationTime>M&&Q());){var $=p.callback;if(typeof $=="function"){p.callback=null,v=p.priorityLevel;var X=$(p.expirationTime<=M);if(M=e.unstable_now(),typeof X=="function"){p.callback=X,R(M),I=!0;break t}p===r(m)&&o(m),R(M)}else o(m);p=r(m)}if(p!==null)I=!0;else{var k=r(h);k!==null&&K(O,k.startTime-M),I=!1}}break e}finally{p=null,v=U,x=!1}I=void 0}}finally{I?q():A=!1}}}var q;if(typeof N=="function")q=function(){N(V)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,B=ee.port2;ee.port1.onmessage=V,q=function(){B.postMessage(null)}}else q=function(){C(V,0)};function K(M,I){D=C(function(){M(e.unstable_now())},I)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(M){switch(v){case 1:case 2:case 3:var I=3;break;default:I=v}var U=v;v=I;try{return M()}finally{v=U}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(M,I){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var U=v;v=M;try{return I()}finally{v=U}},e.unstable_scheduleCallback=function(M,I,U){var $=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?$+U:$):U=$,M){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=U+X,M={id:g++,callback:I,priorityLevel:M,startTime:U,expirationTime:X,sortIndex:-1},U>$?(M.sortIndex=U,t(h,M),r(m)===null&&M===r(h)&&(S?(j(D),D=-1):S=!0,K(O,U-$))):(M.sortIndex=X,t(m,M),E||x||(E=!0,A||(A=!0,q()))),M},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(M){var I=v;return function(){var U=v;v=I;try{return M.apply(this,arguments)}finally{v=U}}}})(Ng)),Ng}var Bw;function KA(){return Bw||(Bw=1,Cg.exports=GA()),Cg.exports}var jg={exports:{}},un={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Uw;function QA(){if(Uw)return un;Uw=1;var e=Nu();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}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 r(){}var o={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(m,h,g){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:m,containerInfo:h,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return un.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,un.createPortal=function(m,h){var g=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 l(m,h,null,g)},un.flushSync=function(m){var h=c.T,g=o.p;try{if(c.T=null,o.p=2,m)return m()}finally{c.T=h,o.p=g,o.d.f()}},un.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(m,h))},un.prefetchDNS=function(m){typeof m=="string"&&o.d.D(m)},un.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var g=h.as,p=f(g,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?o.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:v,fetchPriority:x}):g==="script"&&o.d.X(m,{crossOrigin:p,integrity:v,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},un.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);o.d.M(m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(m)},un.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,p=f(g,h.crossOrigin);o.d.L(m,g,{crossOrigin:p,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})}},un.preloadModule=function(m,h){if(typeof m=="string")if(h){var g=f(h.as,h.crossOrigin);o.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(m)},un.requestFormReset=function(m){o.d.r(m)},un.unstable_batchedUpdates=function(m,h){return m(h)},un.useFormState=function(m,h,g){return c.H.useFormState(m,h,g)},un.useFormStatus=function(){return c.H.useHostTransitionStatus()},un.version="19.2.4",un}var $w;function E_(){if($w)return jg.exports;$w=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(),jg.exports=QA(),jg.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Vw;function ZA(){if(Vw)return Lc;Vw=1;var e=KA(),t=Nu(),r=E_();function o(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)a+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var a=n,i=n;if(n.alternate)for(;a.return;)a=a.return;else{n=a;do a=n,(a.flags&4098)!==0&&(i=a.return),n=a.return;while(n)}return a.tag===3?i:null}function c(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function f(n){if(n.tag===31){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function m(n){if(l(n)!==n)throw Error(o(188))}function h(n){var a=n.alternate;if(!a){if(a=l(n),a===null)throw Error(o(188));return a!==n?null:n}for(var i=n,u=a;;){var y=i.return;if(y===null)break;var w=y.alternate;if(w===null){if(u=y.return,u!==null){i=u;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===i)return m(y),n;if(w===u)return m(y),a;w=w.sibling}throw Error(o(188))}if(i.return!==u.return)i=y,u=w;else{for(var T=!1,z=y.child;z;){if(z===i){T=!0,i=y,u=w;break}if(z===u){T=!0,u=y,i=w;break}z=z.sibling}if(!T){for(z=w.child;z;){if(z===i){T=!0,i=w,u=y;break}if(z===u){T=!0,u=w,i=y;break}z=z.sibling}if(!T)throw Error(o(189))}}if(i.alternate!==u)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?n:a}function g(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=g(n),a!==null)return a;n=n.sibling}return null}var p=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),N=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function q(n){return n===null||typeof n!="object"?null:(n=V&&n[V]||n["@@iterator"],typeof n=="function"?n:null)}var ee=Symbol.for("react.client.reference");function B(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ee?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case C:return"Profiler";case _:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case H:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case E:return"Portal";case N:return n.displayName||"Context";case j:return(n._context.displayName||"Context")+".Consumer";case R:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case D:return a=n.displayName||null,a!==null?a:B(n.type)||"Memo";case P:a=n._payload,n=n._init;try{return B(n(a))}catch{}}return null}var K=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},$=[],X=-1;function k(n){return{current:n}}function L(n){0>X||(n.current=$[X],$[X]=null,X--)}function Y(n,a){X++,$[X]=n.current,n.current=a}var W=k(null),J=k(null),se=k(null),ne=k(null);function re(n,a){switch(Y(se,a),Y(J,n),Y(W,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?rw(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=rw(a),n=aw(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}L(W),Y(W,n)}function le(){L(W),L(J),L(se)}function ve(n){n.memoizedState!==null&&Y(ne,n);var a=W.current,i=aw(a,n.type);a!==i&&(Y(J,n),Y(W,i))}function ge(n){J.current===n&&(L(W),L(J)),ne.current===n&&(L(ne),Ac._currentValue=U)}var he,ye;function Ne(n){if(he===void 0)try{throw Error()}catch(i){var a=i.stack.trim().match(/\n( *(at )?)/);he=a&&a[1]||"",ye=-1<i.stack.indexOf(`
    at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
`+he+n+ye}var Ue=!1;function ke(n,a){if(!n||Ue)return"";Ue=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(a){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ce){var ie=ce}Reflect.construct(n,[],fe)}else{try{fe.call()}catch(ce){ie=ce}n.call(fe.prototype)}}else{try{throw Error()}catch(ce){ie=ce}(fe=n())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ce){if(ce&&ie&&typeof ce.stack=="string")return[ce.stack,ie.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=u.DetermineComponentFrameRoot(),T=w[0],z=w[1];if(T&&z){var G=T.split(`
`),oe=z.split(`
`);for(y=u=0;u<G.length&&!G[u].includes("DetermineComponentFrameRoot");)u++;for(;y<oe.length&&!oe[y].includes("DetermineComponentFrameRoot");)y++;if(u===G.length||y===oe.length)for(u=G.length-1,y=oe.length-1;1<=u&&0<=y&&G[u]!==oe[y];)y--;for(;1<=u&&0<=y;u--,y--)if(G[u]!==oe[y]){if(u!==1||y!==1)do if(u--,y--,0>y||G[u]!==oe[y]){var ue=`
`+G[u].replace(" at new "," at ");return n.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",n.displayName)),ue}while(1<=u&&0<=y);break}}}finally{Ue=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?Ne(i):""}function nt(n,a){switch(n.tag){case 26:case 27:case 5:return Ne(n.type);case 16:return Ne("Lazy");case 13:return n.child!==a&&a!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("SuspenseList");case 0:case 15:return ke(n.type,!1);case 11:return ke(n.type.render,!1);case 1:return ke(n.type,!0);case 31:return Ne("Activity");default:return""}}function an(n){try{var a="",i=null;do a+=nt(n,i),i=n,n=n.return;while(n);return a}catch(u){return`
Error generating stack: `+u.message+`
`+u.stack}}var st=Object.prototype.hasOwnProperty,kn=e.unstable_scheduleCallback,pr=e.unstable_cancelCallback,Nt=e.unstable_shouldYield,vn=e.unstable_requestPaint,Ht=e.unstable_now,Ga=e.unstable_getCurrentPriorityLevel,yn=e.unstable_ImmediatePriority,Lr=e.unstable_UserBlockingPriority,Pr=e.unstable_NormalPriority,ss=e.unstable_LowPriority,zn=e.unstable_IdlePriority,hi=e.log,Hr=e.unstable_setDisableYieldValue,ca=null,Kt=null;function Ln(n){if(typeof hi=="function"&&Hr(n),Kt&&typeof Kt.setStrictMode=="function")try{Kt.setStrictMode(ca,n)}catch{}}var Vt=Math.clz32?Math.clz32:Zn,Vl=Math.log,is=Math.LN2;function Zn(n){return n>>>=0,n===0?32:31-(Vl(n)/is|0)|0}var Ka=256,Qa=262144,ua=4194304;function Wn(n){var a=n&42;if(a!==0)return a;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&261888;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 De(n,a,i){var u=n.pendingLanes;if(u===0)return 0;var y=0,w=n.suspendedLanes,T=n.pingedLanes;n=n.warmLanes;var z=u&134217727;return z!==0?(u=z&~w,u!==0?y=Wn(u):(T&=z,T!==0?y=Wn(T):i||(i=z&~n,i!==0&&(y=Wn(i))))):(z=u&~w,z!==0?y=Wn(z):T!==0?y=Wn(T):i||(i=u&~n,i!==0&&(y=Wn(i)))),y===0?0:a!==0&&a!==y&&(a&w)===0&&(w=y&-y,i=a&-a,w>=i||w===32&&(i&4194048)!==0)?a:y}function dt(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function Mt(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 qt(){var n=ua;return ua<<=1,(ua&62914560)===0&&(ua=4194304),n}function Ir(n){for(var a=[],i=0;31>i;i++)a.push(n);return a}function ht(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function on(n,a,i,u,y,w){var T=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var z=n.entanglements,G=n.expirationTimes,oe=n.hiddenUpdates;for(i=T&~i;0<i;){var ue=31-Vt(i),fe=1<<ue;z[ue]=0,G[ue]=-1;var ie=oe[ue];if(ie!==null)for(oe[ue]=null,ue=0;ue<ie.length;ue++){var ce=ie[ue];ce!==null&&(ce.lane&=-536870913)}i&=~fe}u!==0&&da(n,u,0),w!==0&&y===0&&n.tag!==0&&(n.suspendedLanes|=w&~(T&~a))}function da(n,a,i){n.pendingLanes|=a,n.suspendedLanes&=~a;var u=31-Vt(a);n.entangledLanes|=a,n.entanglements[u]=n.entanglements[u]|1073741824|i&261930}function sn(n,a){var i=n.entangledLanes|=a;for(n=n.entanglements;i;){var u=31-Vt(i),y=1<<u;y&a|n[u]&a&&(n[u]|=a),i&=~y}}function ln(n,a){var i=a&-a;return i=(i&42)!==0?1:Za(i),(i&(n.suspendedLanes|a))!==0?0:i}function Za(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 Pn(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function ql(){var n=I.p;return n!==0?n:(n=window.event,n===void 0?32:jw(n.type))}function Xu(n,a){var i=I.p;try{return I.p=n,a()}finally{I.p=i}}var Br=Math.random().toString(36).slice(2),It="__reactFiber$"+Br,cn="__reactProps$"+Br,fa="__reactContainer$"+Br,mi="__reactEvents$"+Br,Yu="__reactListeners$"+Br,fm="__reactHandles$"+Br,Gu="__reactResources$"+Br,ls="__reactMarker$"+Br;function Fl(n){delete n[It],delete n[cn],delete n[mi],delete n[Yu],delete n[fm]}function Wa(n){var a=n[It];if(a)return a;for(var i=n.parentNode;i;){if(a=i[fa]||i[It]){if(i=a.alternate,a.child!==null||i!==null&&i.child!==null)for(n=dw(n);n!==null;){if(i=n[It])return i;n=dw(n)}return a}n=i,i=n.parentNode}return null}function Ja(n){if(n=n[It]||n[fa]){var a=n.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return n}return null}function eo(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(o(33))}function to(n){var a=n[Gu];return a||(a=n[Gu]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function At(n){n[ls]=!0}var Ku=new Set,Qu={};function ha(n,a){no(n,a),no(n+"Capture",a)}function no(n,a){for(Qu[n]=a,n=0;n<a.length;n++)Ku.add(a[n])}var hm=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]*$"),Xl={},Zu={};function mm(n){return st.call(Zu,n)?!0:st.call(Xl,n)?!1:hm.test(n)?Zu[n]=!0:(Xl[n]=!0,!1)}function pi(n,a,i){if(mm(a))if(i===null)n.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(a);return;case"boolean":var u=a.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(a);return}}n.setAttribute(a,""+i)}}function gi(n,a,i){if(i===null)n.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttribute(a,""+i)}}function gr(n,a,i,u){if(u===null)n.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(a,i,""+u)}}function xn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Wu(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function pm(n,a,i){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,a);if(!n.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,w=u.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return y.call(this)},set:function(T){i=""+T,w.call(this,T)}}),Object.defineProperty(n,a,{enumerable:u.enumerable}),{getValue:function(){return i},setValue:function(T){i=""+T},stopTracking:function(){n._valueTracker=null,delete n[a]}}}}function ro(n){if(!n._valueTracker){var a=Wu(n)?"checked":"value";n._valueTracker=pm(n,a,""+n[a])}}function Ju(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var i=a.getValue(),u="";return n&&(u=Wu(n)?n.checked?"true":"false":n.value),n=u,n!==i?(a.setValue(n),!0):!1}function cs(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}}var gm=/[\n"\\]/g;function bn(n){return n.replace(gm,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function us(n,a,i,u,y,w,T,z){n.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?n.type=T:n.removeAttribute("type"),a!=null?T==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+xn(a)):n.value!==""+xn(a)&&(n.value=""+xn(a)):T!=="submit"&&T!=="reset"||n.removeAttribute("value"),a!=null?Yl(n,T,xn(a)):i!=null?Yl(n,T,xn(i)):u!=null&&n.removeAttribute("value"),y==null&&w!=null&&(n.defaultChecked=!!w),y!=null&&(n.checked=y&&typeof y!="function"&&typeof y!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?n.name=""+xn(z):n.removeAttribute("name")}function ed(n,a,i,u,y,w,T,z){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.type=w),a!=null||i!=null){if(!(w!=="submit"&&w!=="reset"||a!=null)){ro(n);return}i=i!=null?""+xn(i):"",a=a!=null?""+xn(a):i,z||a===n.value||(n.value=a),n.defaultValue=a}u=u??y,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=z?n.checked:!!u,n.defaultChecked=!!u,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(n.name=T),ro(n)}function Yl(n,a,i){a==="number"&&cs(n.ownerDocument)===n||n.defaultValue===""+i||(n.defaultValue=""+i)}function ma(n,a,i,u){if(n=n.options,a){a={};for(var y=0;y<i.length;y++)a["$"+i[y]]=!0;for(i=0;i<n.length;i++)y=a.hasOwnProperty("$"+n[i].value),n[i].selected!==y&&(n[i].selected=y),y&&u&&(n[i].defaultSelected=!0)}else{for(i=""+xn(i),a=null,y=0;y<n.length;y++){if(n[y].value===i){n[y].selected=!0,u&&(n[y].defaultSelected=!0);return}a!==null||n[y].disabled||(a=n[y])}a!==null&&(a.selected=!0)}}function W0(n,a,i){if(a!=null&&(a=""+xn(a),a!==n.value&&(n.value=a),i==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=i!=null?""+xn(i):""}function J0(n,a,i,u){if(a==null){if(u!=null){if(i!=null)throw Error(o(92));if(K(u)){if(1<u.length)throw Error(o(93));u=u[0]}i=u}i==null&&(i=""),a=i}i=xn(a),n.defaultValue=i,u=n.textContent,u===i&&u!==""&&u!==null&&(n.value=u),ro(n)}function vi(n,a){if(a){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=a;return}}n.textContent=a}var IR=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 ex(n,a,i){var u=a.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?u?n.setProperty(a,""):a==="float"?n.cssFloat="":n[a]="":u?n.setProperty(a,i):typeof i!="number"||i===0||IR.has(a)?a==="float"?n.cssFloat=i:n[a]=(""+i).trim():n[a]=i+"px"}function tx(n,a,i){if(a!=null&&typeof a!="object")throw Error(o(62));if(n=n.style,i!=null){for(var u in i)!i.hasOwnProperty(u)||a!=null&&a.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var y in a)u=a[y],a.hasOwnProperty(y)&&i[y]!==u&&ex(n,y,u)}else for(var w in a)a.hasOwnProperty(w)&&ex(n,w,a[w])}function vm(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 BR=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),UR=/^[\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 td(n){return UR.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function pa(){}var ym=null;function xm(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var yi=null,xi=null;function nx(n){var a=Ja(n);if(a&&(n=a.stateNode)){var i=n[cn]||null;e:switch(n=a.stateNode,a.type){case"input":if(us(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),a=i.name,i.type==="radio"&&a!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+bn(""+a)+'"][type="radio"]'),a=0;a<i.length;a++){var u=i[a];if(u!==n&&u.form===n.form){var y=u[cn]||null;if(!y)throw Error(o(90));us(u,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(a=0;a<i.length;a++)u=i[a],u.form===n.form&&Ju(u)}break e;case"textarea":W0(n,i.value,i.defaultValue);break e;case"select":a=i.value,a!=null&&ma(n,!!i.multiple,a,!1)}}}var bm=!1;function rx(n,a,i){if(bm)return n(a,i);bm=!0;try{var u=n(a);return u}finally{if(bm=!1,(yi!==null||xi!==null)&&($d(),yi&&(a=yi,n=xi,xi=yi=null,nx(a),n)))for(a=0;a<n.length;a++)nx(n[a])}}function Gl(n,a){var i=n.stateNode;if(i===null)return null;var u=i[cn]||null;if(u===null)return null;i=u[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(o(231,a,typeof i));return i}var ga=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wm=!1;if(ga)try{var Kl={};Object.defineProperty(Kl,"passive",{get:function(){wm=!0}}),window.addEventListener("test",Kl,Kl),window.removeEventListener("test",Kl,Kl)}catch{wm=!1}var ao=null,Sm=null,nd=null;function ax(){if(nd)return nd;var n,a=Sm,i=a.length,u,y="value"in ao?ao.value:ao.textContent,w=y.length;for(n=0;n<i&&a[n]===y[n];n++);var T=i-n;for(u=1;u<=T&&a[i-u]===y[w-u];u++);return nd=y.slice(n,1<u?1-u:void 0)}function rd(n){var a=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&a===13&&(n=13)):n=a,n===10&&(n=13),32<=n||n===13?n:0}function ad(){return!0}function ox(){return!1}function wn(n){function a(i,u,y,w,T){this._reactName=i,this._targetInst=y,this.type=u,this.nativeEvent=w,this.target=T,this.currentTarget=null;for(var z in n)n.hasOwnProperty(z)&&(i=n[z],this[z]=i?i(w):w[z]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?ad:ox,this.isPropagationStopped=ox,this}return p(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=ad)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=ad)},persist:function(){},isPersistent:ad}),a}var ds={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},od=wn(ds),Ql=p({},ds,{view:0,detail:0}),$R=wn(Ql),Em,_m,Zl,sd=p({},Ql,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nm,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!==Zl&&(Zl&&n.type==="mousemove"?(Em=n.screenX-Zl.screenX,_m=n.screenY-Zl.screenY):_m=Em=0,Zl=n),Em)},movementY:function(n){return"movementY"in n?n.movementY:_m}}),sx=wn(sd),VR=p({},sd,{dataTransfer:0}),qR=wn(VR),FR=p({},Ql,{relatedTarget:0}),Cm=wn(FR),XR=p({},ds,{animationName:0,elapsedTime:0,pseudoElement:0}),YR=wn(XR),GR=p({},ds,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),KR=wn(GR),QR=p({},ds,{data:0}),ix=wn(QR),ZR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},WR={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"},JR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eM(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=JR[n])?!!a[n]:!1}function Nm(){return eM}var tM=p({},Ql,{key:function(n){if(n.key){var a=ZR[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=rd(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?WR[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nm,charCode:function(n){return n.type==="keypress"?rd(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?rd(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),nM=wn(tM),rM=p({},sd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lx=wn(rM),aM=p({},Ql,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nm}),oM=wn(aM),sM=p({},ds,{propertyName:0,elapsedTime:0,pseudoElement:0}),iM=wn(sM),lM=p({},sd,{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}),cM=wn(lM),uM=p({},ds,{newState:0,oldState:0}),dM=wn(uM),fM=[9,13,27,32],jm=ga&&"CompositionEvent"in window,Wl=null;ga&&"documentMode"in document&&(Wl=document.documentMode);var hM=ga&&"TextEvent"in window&&!Wl,cx=ga&&(!jm||Wl&&8<Wl&&11>=Wl),ux=" ",dx=!1;function fx(n,a){switch(n){case"keyup":return fM.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hx(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var bi=!1;function mM(n,a){switch(n){case"compositionend":return hx(a);case"keypress":return a.which!==32?null:(dx=!0,ux);case"textInput":return n=a.data,n===ux&&dx?null:n;default:return null}}function pM(n,a){if(bi)return n==="compositionend"||!jm&&fx(n,a)?(n=ax(),nd=Sm=ao=null,bi=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return cx&&a.locale!=="ko"?null:a.data;default:return null}}var gM={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 mx(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!gM[n.type]:a==="textarea"}function px(n,a,i,u){yi?xi?xi.push(u):xi=[u]:yi=u,a=Kd(a,"onChange"),0<a.length&&(i=new od("onChange","change",null,i,u),n.push({event:i,listeners:a}))}var Jl=null,ec=null;function vM(n){Z1(n,0)}function id(n){var a=eo(n);if(Ju(a))return n}function gx(n,a){if(n==="change")return a}var vx=!1;if(ga){var Tm;if(ga){var Rm="oninput"in document;if(!Rm){var yx=document.createElement("div");yx.setAttribute("oninput","return;"),Rm=typeof yx.oninput=="function"}Tm=Rm}else Tm=!1;vx=Tm&&(!document.documentMode||9<document.documentMode)}function xx(){Jl&&(Jl.detachEvent("onpropertychange",bx),ec=Jl=null)}function bx(n){if(n.propertyName==="value"&&id(ec)){var a=[];px(a,ec,n,xm(n)),rx(vM,a)}}function yM(n,a,i){n==="focusin"?(xx(),Jl=a,ec=i,Jl.attachEvent("onpropertychange",bx)):n==="focusout"&&xx()}function xM(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return id(ec)}function bM(n,a){if(n==="click")return id(a)}function wM(n,a){if(n==="input"||n==="change")return id(a)}function SM(n,a){return n===a&&(n!==0||1/n===1/a)||n!==n&&a!==a}var Hn=typeof Object.is=="function"?Object.is:SM;function tc(n,a){if(Hn(n,a))return!0;if(typeof n!="object"||n===null||typeof a!="object"||a===null)return!1;var i=Object.keys(n),u=Object.keys(a);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var y=i[u];if(!st.call(a,y)||!Hn(n[y],a[y]))return!1}return!0}function wx(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Sx(n,a){var i=wx(n);n=0;for(var u;i;){if(i.nodeType===3){if(u=n+i.textContent.length,n<=a&&u>=a)return{node:i,offset:a-n};n=u}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=wx(i)}}function Ex(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?Ex(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function _x(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=cs(n.document);a instanceof n.HTMLIFrameElement;){try{var i=typeof a.contentWindow.location.href=="string"}catch{i=!1}if(i)n=a.contentWindow;else break;a=cs(n.document)}return a}function Mm(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var EM=ga&&"documentMode"in document&&11>=document.documentMode,wi=null,Am=null,nc=null,Om=!1;function Cx(n,a,i){var u=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Om||wi==null||wi!==cs(u)||(u=wi,"selectionStart"in u&&Mm(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),nc&&tc(nc,u)||(nc=u,u=Kd(Am,"onSelect"),0<u.length&&(a=new od("onSelect","select",null,a,i),n.push({event:a,listeners:u}),a.target=wi)))}function fs(n,a){var i={};return i[n.toLowerCase()]=a.toLowerCase(),i["Webkit"+n]="webkit"+a,i["Moz"+n]="moz"+a,i}var Si={animationend:fs("Animation","AnimationEnd"),animationiteration:fs("Animation","AnimationIteration"),animationstart:fs("Animation","AnimationStart"),transitionrun:fs("Transition","TransitionRun"),transitionstart:fs("Transition","TransitionStart"),transitioncancel:fs("Transition","TransitionCancel"),transitionend:fs("Transition","TransitionEnd")},Dm={},Nx={};ga&&(Nx=document.createElement("div").style,"AnimationEvent"in window||(delete Si.animationend.animation,delete Si.animationiteration.animation,delete Si.animationstart.animation),"TransitionEvent"in window||delete Si.transitionend.transition);function hs(n){if(Dm[n])return Dm[n];if(!Si[n])return n;var a=Si[n],i;for(i in a)if(a.hasOwnProperty(i)&&i in Nx)return Dm[n]=a[i];return n}var jx=hs("animationend"),Tx=hs("animationiteration"),Rx=hs("animationstart"),_M=hs("transitionrun"),CM=hs("transitionstart"),NM=hs("transitioncancel"),Mx=hs("transitionend"),Ax=new Map,km="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");km.push("scrollEnd");function vr(n,a){Ax.set(n,a),ha(a,[n])}var ld=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=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(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Jn=[],Ei=0,zm=0;function cd(){for(var n=Ei,a=zm=Ei=0;a<n;){var i=Jn[a];Jn[a++]=null;var u=Jn[a];Jn[a++]=null;var y=Jn[a];Jn[a++]=null;var w=Jn[a];if(Jn[a++]=null,u!==null&&y!==null){var T=u.pending;T===null?y.next=y:(y.next=T.next,T.next=y),u.pending=y}w!==0&&Ox(i,y,w)}}function ud(n,a,i,u){Jn[Ei++]=n,Jn[Ei++]=a,Jn[Ei++]=i,Jn[Ei++]=u,zm|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Lm(n,a,i,u){return ud(n,a,i,u),dd(n)}function ms(n,a){return ud(n,null,null,a),dd(n)}function Ox(n,a,i){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i);for(var y=!1,w=n.return;w!==null;)w.childLanes|=i,u=w.alternate,u!==null&&(u.childLanes|=i),w.tag===22&&(n=w.stateNode,n===null||n._visibility&1||(y=!0)),n=w,w=w.return;return n.tag===3?(w=n.stateNode,y&&a!==null&&(y=31-Vt(i),n=w.hiddenUpdates,u=n[y],u===null?n[y]=[a]:u.push(a),a.lane=i|536870912),w):null}function dd(n){if(50<_c)throw _c=0,Fp=null,Error(o(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var _i={};function jM(n,a,i,u){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(n,a,i,u){return new jM(n,a,i,u)}function Pm(n){return n=n.prototype,!(!n||!n.isReactComponent)}function va(n,a){var i=n.alternate;return i===null?(i=In(n.tag,a,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=a,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&65011712,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,a=n.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function Dx(n,a){n.flags&=65011714;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=a,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,a=i.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),n}function fd(n,a,i,u,y,w){var T=0;if(u=n,typeof n=="function")Pm(n)&&(T=1);else if(typeof n=="string")T=OA(n,i,W.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case H:return n=In(31,i,a,y),n.elementType=H,n.lanes=w,n;case S:return ps(i.children,y,w,a);case _:T=8,y|=24;break;case C:return n=In(12,i,a,y|2),n.elementType=C,n.lanes=w,n;case O:return n=In(13,i,a,y),n.elementType=O,n.lanes=w,n;case A:return n=In(19,i,a,y),n.elementType=A,n.lanes=w,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case N:T=10;break e;case j:T=9;break e;case R:T=11;break e;case D:T=14;break e;case P:T=16,u=null;break e}T=29,i=Error(o(130,n===null?"null":typeof n,"")),u=null}return a=In(T,i,a,y),a.elementType=n,a.type=u,a.lanes=w,a}function ps(n,a,i,u){return n=In(7,n,u,a),n.lanes=i,n}function Hm(n,a,i){return n=In(6,n,null,a),n.lanes=i,n}function kx(n){var a=In(18,null,null,0);return a.stateNode=n,a}function Im(n,a,i){return a=In(4,n.children!==null?n.children:[],n.key,a),a.lanes=i,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var zx=new WeakMap;function er(n,a){if(typeof n=="object"&&n!==null){var i=zx.get(n);return i!==void 0?i:(a={value:n,source:a,stack:an(a)},zx.set(n,a),a)}return{value:n,source:a,stack:an(a)}}var Ci=[],Ni=0,hd=null,rc=0,tr=[],nr=0,oo=null,Ur=1,$r="";function ya(n,a){Ci[Ni++]=rc,Ci[Ni++]=hd,hd=n,rc=a}function Lx(n,a,i){tr[nr++]=Ur,tr[nr++]=$r,tr[nr++]=oo,oo=n;var u=Ur;n=$r;var y=32-Vt(u)-1;u&=~(1<<y),i+=1;var w=32-Vt(a)+y;if(30<w){var T=y-y%5;w=(u&(1<<T)-1).toString(32),u>>=T,y-=T,Ur=1<<32-Vt(a)+y|i<<y|u,$r=w+n}else Ur=1<<w|i<<y|u,$r=n}function Bm(n){n.return!==null&&(ya(n,1),Lx(n,1,0))}function Um(n){for(;n===hd;)hd=Ci[--Ni],Ci[Ni]=null,rc=Ci[--Ni],Ci[Ni]=null;for(;n===oo;)oo=tr[--nr],tr[nr]=null,$r=tr[--nr],tr[nr]=null,Ur=tr[--nr],tr[nr]=null}function Px(n,a){tr[nr++]=Ur,tr[nr++]=$r,tr[nr++]=oo,Ur=a.id,$r=a.overflow,oo=n}var Qt=null,mt=null,Ge=!1,so=null,rr=!1,$m=Error(o(519));function io(n){var a=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ac(er(a,n)),$m}function Hx(n){var a=n.stateNode,i=n.type,u=n.memoizedProps;switch(a[It]=n,a[cn]=u,i){case"dialog":Ve("cancel",a),Ve("close",a);break;case"iframe":case"object":case"embed":Ve("load",a);break;case"video":case"audio":for(i=0;i<Nc.length;i++)Ve(Nc[i],a);break;case"source":Ve("error",a);break;case"img":case"image":case"link":Ve("error",a),Ve("load",a);break;case"details":Ve("toggle",a);break;case"input":Ve("invalid",a),ed(a,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ve("invalid",a);break;case"textarea":Ve("invalid",a),J0(a,u.value,u.defaultValue,u.children)}i=u.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||a.textContent===""+i||u.suppressHydrationWarning===!0||tw(a.textContent,i)?(u.popover!=null&&(Ve("beforetoggle",a),Ve("toggle",a)),u.onScroll!=null&&Ve("scroll",a),u.onScrollEnd!=null&&Ve("scrollend",a),u.onClick!=null&&(a.onclick=pa),a=!0):a=!1,a||io(n,!0)}function Ix(n){for(Qt=n.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:rr=!1;return;case 27:case 3:rr=!0;return;default:Qt=Qt.return}}function ji(n){if(n!==Qt)return!1;if(!Ge)return Ix(n),Ge=!0,!1;var a=n.tag,i;if((i=a!==3&&a!==27)&&((i=a===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||sg(n.type,n.memoizedProps)),i=!i),i&&mt&&io(n),Ix(n),a===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));mt=uw(n)}else if(a===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));mt=uw(n)}else a===27?(a=mt,So(n.type)?(n=dg,dg=null,mt=n):mt=a):mt=Qt?or(n.stateNode.nextSibling):null;return!0}function gs(){mt=Qt=null,Ge=!1}function Vm(){var n=so;return n!==null&&(Cn===null?Cn=n:Cn.push.apply(Cn,n),so=null),n}function ac(n){so===null?so=[n]:so.push(n)}var qm=k(null),vs=null,xa=null;function lo(n,a,i){Y(qm,a._currentValue),a._currentValue=i}function ba(n){n._currentValue=qm.current,L(qm)}function Fm(n,a,i){for(;n!==null;){var u=n.alternate;if((n.childLanes&a)!==a?(n.childLanes|=a,u!==null&&(u.childLanes|=a)):u!==null&&(u.childLanes&a)!==a&&(u.childLanes|=a),n===i)break;n=n.return}}function Xm(n,a,i,u){var y=n.child;for(y!==null&&(y.return=n);y!==null;){var w=y.dependencies;if(w!==null){var T=y.child;w=w.firstContext;e:for(;w!==null;){var z=w;w=y;for(var G=0;G<a.length;G++)if(z.context===a[G]){w.lanes|=i,z=w.alternate,z!==null&&(z.lanes|=i),Fm(w.return,i,n),u||(T=null);break e}w=z.next}}else if(y.tag===18){if(T=y.return,T===null)throw Error(o(341));T.lanes|=i,w=T.alternate,w!==null&&(w.lanes|=i),Fm(T,i,n),T=null}else T=y.child;if(T!==null)T.return=y;else for(T=y;T!==null;){if(T===n){T=null;break}if(y=T.sibling,y!==null){y.return=T.return,T=y;break}T=T.return}y=T}}function Ti(n,a,i,u){n=null;for(var y=a,w=!1;y!==null;){if(!w){if((y.flags&524288)!==0)w=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var T=y.alternate;if(T===null)throw Error(o(387));if(T=T.memoizedProps,T!==null){var z=y.type;Hn(y.pendingProps.value,T.value)||(n!==null?n.push(z):n=[z])}}else if(y===ne.current){if(T=y.alternate,T===null)throw Error(o(387));T.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(n!==null?n.push(Ac):n=[Ac])}y=y.return}n!==null&&Xm(a,n,i,u),a.flags|=262144}function md(n){for(n=n.firstContext;n!==null;){if(!Hn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ys(n){vs=n,xa=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Zt(n){return Bx(vs,n)}function pd(n,a){return vs===null&&ys(n),Bx(n,a)}function Bx(n,a){var i=a._currentValue;if(a={context:a,memoizedValue:i,next:null},xa===null){if(n===null)throw Error(o(308));xa=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else xa=xa.next=a;return i}var TM=typeof AbortController<"u"?AbortController:function(){var n=[],a=this.signal={aborted:!1,addEventListener:function(i,u){n.push(u)}};this.abort=function(){a.aborted=!0,n.forEach(function(i){return i()})}},RM=e.unstable_scheduleCallback,MM=e.unstable_NormalPriority,Ot={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ym(){return{controller:new TM,data:new Map,refCount:0}}function oc(n){n.refCount--,n.refCount===0&&RM(MM,function(){n.controller.abort()})}var sc=null,Gm=0,Ri=0,Mi=null;function AM(n,a){if(sc===null){var i=sc=[];Gm=0,Ri=Zp(),Mi={status:"pending",value:void 0,then:function(u){i.push(u)}}}return Gm++,a.then(Ux,Ux),a}function Ux(){if(--Gm===0&&sc!==null){Mi!==null&&(Mi.status="fulfilled");var n=sc;sc=null,Ri=0,Mi=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function OM(n,a){var i=[],u={status:"pending",value:null,reason:null,then:function(y){i.push(y)}};return n.then(function(){u.status="fulfilled",u.value=a;for(var y=0;y<i.length;y++)(0,i[y])(a)},function(y){for(u.status="rejected",u.reason=y,y=0;y<i.length;y++)(0,i[y])(void 0)}),u}var $x=M.S;M.S=function(n,a){C1=Ht(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&AM(n,a),$x!==null&&$x(n,a)};var xs=k(null);function Km(){var n=xs.current;return n!==null?n:ut.pooledCache}function gd(n,a){a===null?Y(xs,xs.current):Y(xs,a.pool)}function Vx(){var n=Km();return n===null?null:{parent:Ot._currentValue,pool:n}}var Ai=Error(o(460)),Qm=Error(o(474)),vd=Error(o(542)),yd={then:function(){}};function qx(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Fx(n,a,i){switch(i=n[i],i===void 0?n.push(a):i!==a&&(a.then(pa,pa),a=i),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,Yx(n),n;default:if(typeof a.status=="string")a.then(pa,pa);else{if(n=ut,n!==null&&100<n.shellSuspendCounter)throw Error(o(482));n=a,n.status="pending",n.then(function(u){if(a.status==="pending"){var y=a;y.status="fulfilled",y.value=u}},function(u){if(a.status==="pending"){var y=a;y.status="rejected",y.reason=u}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,Yx(n),n}throw ws=a,Ai}}function bs(n){try{var a=n._init;return a(n._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(ws=i,Ai):i}}var ws=null;function Xx(){if(ws===null)throw Error(o(459));var n=ws;return ws=null,n}function Yx(n){if(n===Ai||n===vd)throw Error(o(483))}var Oi=null,ic=0;function xd(n){var a=ic;return ic+=1,Oi===null&&(Oi=[]),Fx(Oi,n,a)}function lc(n,a){a=a.props.ref,n.ref=a!==void 0?a:null}function bd(n,a){throw a.$$typeof===v?Error(o(525)):(n=Object.prototype.toString.call(a),Error(o(31,n==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":n)))}function Gx(n){function a(te,Z){if(n){var ae=te.deletions;ae===null?(te.deletions=[Z],te.flags|=16):ae.push(Z)}}function i(te,Z){if(!n)return null;for(;Z!==null;)a(te,Z),Z=Z.sibling;return null}function u(te){for(var Z=new Map;te!==null;)te.key!==null?Z.set(te.key,te):Z.set(te.index,te),te=te.sibling;return Z}function y(te,Z){return te=va(te,Z),te.index=0,te.sibling=null,te}function w(te,Z,ae){return te.index=ae,n?(ae=te.alternate,ae!==null?(ae=ae.index,ae<Z?(te.flags|=67108866,Z):ae):(te.flags|=67108866,Z)):(te.flags|=1048576,Z)}function T(te){return n&&te.alternate===null&&(te.flags|=67108866),te}function z(te,Z,ae,de){return Z===null||Z.tag!==6?(Z=Hm(ae,te.mode,de),Z.return=te,Z):(Z=y(Z,ae),Z.return=te,Z)}function G(te,Z,ae,de){var Re=ae.type;return Re===S?ue(te,Z,ae.props.children,de,ae.key):Z!==null&&(Z.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===P&&bs(Re)===Z.type)?(Z=y(Z,ae.props),lc(Z,ae),Z.return=te,Z):(Z=fd(ae.type,ae.key,ae.props,null,te.mode,de),lc(Z,ae),Z.return=te,Z)}function oe(te,Z,ae,de){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ae.containerInfo||Z.stateNode.implementation!==ae.implementation?(Z=Im(ae,te.mode,de),Z.return=te,Z):(Z=y(Z,ae.children||[]),Z.return=te,Z)}function ue(te,Z,ae,de,Re){return Z===null||Z.tag!==7?(Z=ps(ae,te.mode,de,Re),Z.return=te,Z):(Z=y(Z,ae),Z.return=te,Z)}function fe(te,Z,ae){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Hm(""+Z,te.mode,ae),Z.return=te,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case x:return ae=fd(Z.type,Z.key,Z.props,null,te.mode,ae),lc(ae,Z),ae.return=te,ae;case E:return Z=Im(Z,te.mode,ae),Z.return=te,Z;case P:return Z=bs(Z),fe(te,Z,ae)}if(K(Z)||q(Z))return Z=ps(Z,te.mode,ae,null),Z.return=te,Z;if(typeof Z.then=="function")return fe(te,xd(Z),ae);if(Z.$$typeof===N)return fe(te,pd(te,Z),ae);bd(te,Z)}return null}function ie(te,Z,ae,de){var Re=Z!==null?Z.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Re!==null?null:z(te,Z,""+ae,de);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:return ae.key===Re?G(te,Z,ae,de):null;case E:return ae.key===Re?oe(te,Z,ae,de):null;case P:return ae=bs(ae),ie(te,Z,ae,de)}if(K(ae)||q(ae))return Re!==null?null:ue(te,Z,ae,de,null);if(typeof ae.then=="function")return ie(te,Z,xd(ae),de);if(ae.$$typeof===N)return ie(te,Z,pd(te,ae),de);bd(te,ae)}return null}function ce(te,Z,ae,de,Re){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return te=te.get(ae)||null,z(Z,te,""+de,Re);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case x:return te=te.get(de.key===null?ae:de.key)||null,G(Z,te,de,Re);case E:return te=te.get(de.key===null?ae:de.key)||null,oe(Z,te,de,Re);case P:return de=bs(de),ce(te,Z,ae,de,Re)}if(K(de)||q(de))return te=te.get(ae)||null,ue(Z,te,de,Re,null);if(typeof de.then=="function")return ce(te,Z,ae,xd(de),Re);if(de.$$typeof===N)return ce(te,Z,ae,pd(Z,de),Re);bd(Z,de)}return null}function we(te,Z,ae,de){for(var Re=null,Je=null,Ce=Z,Ie=Z=0,Fe=null;Ce!==null&&Ie<ae.length;Ie++){Ce.index>Ie?(Fe=Ce,Ce=null):Fe=Ce.sibling;var et=ie(te,Ce,ae[Ie],de);if(et===null){Ce===null&&(Ce=Fe);break}n&&Ce&&et.alternate===null&&a(te,Ce),Z=w(et,Z,Ie),Je===null?Re=et:Je.sibling=et,Je=et,Ce=Fe}if(Ie===ae.length)return i(te,Ce),Ge&&ya(te,Ie),Re;if(Ce===null){for(;Ie<ae.length;Ie++)Ce=fe(te,ae[Ie],de),Ce!==null&&(Z=w(Ce,Z,Ie),Je===null?Re=Ce:Je.sibling=Ce,Je=Ce);return Ge&&ya(te,Ie),Re}for(Ce=u(Ce);Ie<ae.length;Ie++)Fe=ce(Ce,te,Ie,ae[Ie],de),Fe!==null&&(n&&Fe.alternate!==null&&Ce.delete(Fe.key===null?Ie:Fe.key),Z=w(Fe,Z,Ie),Je===null?Re=Fe:Je.sibling=Fe,Je=Fe);return n&&Ce.forEach(function(jo){return a(te,jo)}),Ge&&ya(te,Ie),Re}function Ae(te,Z,ae,de){if(ae==null)throw Error(o(151));for(var Re=null,Je=null,Ce=Z,Ie=Z=0,Fe=null,et=ae.next();Ce!==null&&!et.done;Ie++,et=ae.next()){Ce.index>Ie?(Fe=Ce,Ce=null):Fe=Ce.sibling;var jo=ie(te,Ce,et.value,de);if(jo===null){Ce===null&&(Ce=Fe);break}n&&Ce&&jo.alternate===null&&a(te,Ce),Z=w(jo,Z,Ie),Je===null?Re=jo:Je.sibling=jo,Je=jo,Ce=Fe}if(et.done)return i(te,Ce),Ge&&ya(te,Ie),Re;if(Ce===null){for(;!et.done;Ie++,et=ae.next())et=fe(te,et.value,de),et!==null&&(Z=w(et,Z,Ie),Je===null?Re=et:Je.sibling=et,Je=et);return Ge&&ya(te,Ie),Re}for(Ce=u(Ce);!et.done;Ie++,et=ae.next())et=ce(Ce,te,Ie,et.value,de),et!==null&&(n&&et.alternate!==null&&Ce.delete(et.key===null?Ie:et.key),Z=w(et,Z,Ie),Je===null?Re=et:Je.sibling=et,Je=et);return n&&Ce.forEach(function(VA){return a(te,VA)}),Ge&&ya(te,Ie),Re}function ct(te,Z,ae,de){if(typeof ae=="object"&&ae!==null&&ae.type===S&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:e:{for(var Re=ae.key;Z!==null;){if(Z.key===Re){if(Re=ae.type,Re===S){if(Z.tag===7){i(te,Z.sibling),de=y(Z,ae.props.children),de.return=te,te=de;break e}}else if(Z.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===P&&bs(Re)===Z.type){i(te,Z.sibling),de=y(Z,ae.props),lc(de,ae),de.return=te,te=de;break e}i(te,Z);break}else a(te,Z);Z=Z.sibling}ae.type===S?(de=ps(ae.props.children,te.mode,de,ae.key),de.return=te,te=de):(de=fd(ae.type,ae.key,ae.props,null,te.mode,de),lc(de,ae),de.return=te,te=de)}return T(te);case E:e:{for(Re=ae.key;Z!==null;){if(Z.key===Re)if(Z.tag===4&&Z.stateNode.containerInfo===ae.containerInfo&&Z.stateNode.implementation===ae.implementation){i(te,Z.sibling),de=y(Z,ae.children||[]),de.return=te,te=de;break e}else{i(te,Z);break}else a(te,Z);Z=Z.sibling}de=Im(ae,te.mode,de),de.return=te,te=de}return T(te);case P:return ae=bs(ae),ct(te,Z,ae,de)}if(K(ae))return we(te,Z,ae,de);if(q(ae)){if(Re=q(ae),typeof Re!="function")throw Error(o(150));return ae=Re.call(ae),Ae(te,Z,ae,de)}if(typeof ae.then=="function")return ct(te,Z,xd(ae),de);if(ae.$$typeof===N)return ct(te,Z,pd(te,ae),de);bd(te,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,Z!==null&&Z.tag===6?(i(te,Z.sibling),de=y(Z,ae),de.return=te,te=de):(i(te,Z),de=Hm(ae,te.mode,de),de.return=te,te=de),T(te)):i(te,Z)}return function(te,Z,ae,de){try{ic=0;var Re=ct(te,Z,ae,de);return Oi=null,Re}catch(Ce){if(Ce===Ai||Ce===vd)throw Ce;var Je=In(29,Ce,null,te.mode);return Je.lanes=de,Je.return=te,Je}finally{}}}var Ss=Gx(!0),Kx=Gx(!1),co=!1;function Zm(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wm(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function uo(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function fo(n,a,i){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(tt&2)!==0){var y=u.pending;return y===null?a.next=a:(a.next=y.next,y.next=a),u.pending=a,a=dd(n),Ox(n,null,i),a}return ud(n,u,a,i),dd(n)}function cc(n,a,i){if(a=a.updateQueue,a!==null&&(a=a.shared,(i&4194048)!==0)){var u=a.lanes;u&=n.pendingLanes,i|=u,a.lanes=i,sn(n,i)}}function Jm(n,a){var i=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,i===u)){var y=null,w=null;if(i=i.firstBaseUpdate,i!==null){do{var T={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};w===null?y=w=T:w=w.next=T,i=i.next}while(i!==null);w===null?y=w=a:w=w.next=a}else y=w=a;i={baseState:u.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:u.shared,callbacks:u.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=a:n.next=a,i.lastBaseUpdate=a}var ep=!1;function uc(){if(ep){var n=Mi;if(n!==null)throw n}}function dc(n,a,i,u){ep=!1;var y=n.updateQueue;co=!1;var w=y.firstBaseUpdate,T=y.lastBaseUpdate,z=y.shared.pending;if(z!==null){y.shared.pending=null;var G=z,oe=G.next;G.next=null,T===null?w=oe:T.next=oe,T=G;var ue=n.alternate;ue!==null&&(ue=ue.updateQueue,z=ue.lastBaseUpdate,z!==T&&(z===null?ue.firstBaseUpdate=oe:z.next=oe,ue.lastBaseUpdate=G))}if(w!==null){var fe=y.baseState;T=0,ue=oe=G=null,z=w;do{var ie=z.lane&-536870913,ce=ie!==z.lane;if(ce?(qe&ie)===ie:(u&ie)===ie){ie!==0&&ie===Ri&&(ep=!0),ue!==null&&(ue=ue.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var we=n,Ae=z;ie=a;var ct=i;switch(Ae.tag){case 1:if(we=Ae.payload,typeof we=="function"){fe=we.call(ct,fe,ie);break e}fe=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Ae.payload,ie=typeof we=="function"?we.call(ct,fe,ie):we,ie==null)break e;fe=p({},fe,ie);break e;case 2:co=!0}}ie=z.callback,ie!==null&&(n.flags|=64,ce&&(n.flags|=8192),ce=y.callbacks,ce===null?y.callbacks=[ie]:ce.push(ie))}else ce={lane:ie,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ue===null?(oe=ue=ce,G=fe):ue=ue.next=ce,T|=ie;if(z=z.next,z===null){if(z=y.shared.pending,z===null)break;ce=z,z=ce.next,ce.next=null,y.lastBaseUpdate=ce,y.shared.pending=null}}while(!0);ue===null&&(G=fe),y.baseState=G,y.firstBaseUpdate=oe,y.lastBaseUpdate=ue,w===null&&(y.shared.lanes=0),vo|=T,n.lanes=T,n.memoizedState=fe}}function Qx(n,a){if(typeof n!="function")throw Error(o(191,n));n.call(a)}function Zx(n,a){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)Qx(i[n],a)}var Di=k(null),wd=k(0);function Wx(n,a){n=Ra,Y(wd,n),Y(Di,a),Ra=n|a.baseLanes}function tp(){Y(wd,Ra),Y(Di,Di.current)}function np(){Ra=wd.current,L(Di),L(wd)}var Bn=k(null),ar=null;function ho(n){var a=n.alternate;Y(jt,jt.current&1),Y(Bn,n),ar===null&&(a===null||Di.current!==null||a.memoizedState!==null)&&(ar=n)}function rp(n){Y(jt,jt.current),Y(Bn,n),ar===null&&(ar=n)}function Jx(n){n.tag===22?(Y(jt,jt.current),Y(Bn,n),ar===null&&(ar=n)):mo()}function mo(){Y(jt,jt.current),Y(Bn,Bn.current)}function Un(n){L(Bn),ar===n&&(ar=null),L(jt)}var jt=k(0);function Sd(n){for(var a=n;a!==null;){if(a.tag===13){var i=a.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||cg(i)||ug(i)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var wa=0,Pe=null,it=null,Dt=null,Ed=!1,ki=!1,Es=!1,_d=0,fc=0,zi=null,DM=0;function wt(){throw Error(o(321))}function ap(n,a){if(a===null)return!1;for(var i=0;i<a.length&&i<n.length;i++)if(!Hn(n[i],a[i]))return!1;return!0}function op(n,a,i,u,y,w){return wa=w,Pe=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,M.H=n===null||n.memoizedState===null?Lb:bp,Es=!1,w=i(u,y),Es=!1,ki&&(w=tb(a,i,u,y)),eb(n),w}function eb(n){M.H=pc;var a=it!==null&&it.next!==null;if(wa=0,Dt=it=Pe=null,Ed=!1,fc=0,zi=null,a)throw Error(o(300));n===null||kt||(n=n.dependencies,n!==null&&md(n)&&(kt=!0))}function tb(n,a,i,u){Pe=n;var y=0;do{if(ki&&(zi=null),fc=0,ki=!1,25<=y)throw Error(o(301));if(y+=1,Dt=it=null,n.updateQueue!=null){var w=n.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}M.H=Pb,w=a(i,u)}while(ki);return w}function kM(){var n=M.H,a=n.useState()[0];return a=typeof a.then=="function"?hc(a):a,n=n.useState()[0],(it!==null?it.memoizedState:null)!==n&&(Pe.flags|=1024),a}function sp(){var n=_d!==0;return _d=0,n}function ip(n,a,i){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~i}function lp(n){if(Ed){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Ed=!1}wa=0,Dt=it=Pe=null,ki=!1,fc=_d=0,zi=null}function mn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?Pe.memoizedState=Dt=n:Dt=Dt.next=n,Dt}function Tt(){if(it===null){var n=Pe.alternate;n=n!==null?n.memoizedState:null}else n=it.next;var a=Dt===null?Pe.memoizedState:Dt.next;if(a!==null)Dt=a,it=n;else{if(n===null)throw Pe.alternate===null?Error(o(467)):Error(o(310));it=n,n={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Dt===null?Pe.memoizedState=Dt=n:Dt=Dt.next=n}return Dt}function Cd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hc(n){var a=fc;return fc+=1,zi===null&&(zi=[]),n=Fx(zi,n,a),a=Pe,(Dt===null?a.memoizedState:Dt.next)===null&&(a=a.alternate,M.H=a===null||a.memoizedState===null?Lb:bp),n}function Nd(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return hc(n);if(n.$$typeof===N)return Zt(n)}throw Error(o(438,String(n)))}function cp(n){var a=null,i=Pe.updateQueue;if(i!==null&&(a=i.memoCache),a==null){var u=Pe.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(a={data:u.data.map(function(y){return y.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),i===null&&(i=Cd(),Pe.updateQueue=i),i.memoCache=a,i=a.data[a.index],i===void 0)for(i=a.data[a.index]=Array(n),u=0;u<n;u++)i[u]=Q;return a.index++,i}function Sa(n,a){return typeof a=="function"?a(n):a}function jd(n){var a=Tt();return up(a,it,n)}function up(n,a,i){var u=n.queue;if(u===null)throw Error(o(311));u.lastRenderedReducer=i;var y=n.baseQueue,w=u.pending;if(w!==null){if(y!==null){var T=y.next;y.next=w.next,w.next=T}a.baseQueue=y=w,u.pending=null}if(w=n.baseState,y===null)n.memoizedState=w;else{a=y.next;var z=T=null,G=null,oe=a,ue=!1;do{var fe=oe.lane&-536870913;if(fe!==oe.lane?(qe&fe)===fe:(wa&fe)===fe){var ie=oe.revertLane;if(ie===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),fe===Ri&&(ue=!0);else if((wa&ie)===ie){oe=oe.next,ie===Ri&&(ue=!0);continue}else fe={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},G===null?(z=G=fe,T=w):G=G.next=fe,Pe.lanes|=ie,vo|=ie;fe=oe.action,Es&&i(w,fe),w=oe.hasEagerState?oe.eagerState:i(w,fe)}else ie={lane:fe,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},G===null?(z=G=ie,T=w):G=G.next=ie,Pe.lanes|=fe,vo|=fe;oe=oe.next}while(oe!==null&&oe!==a);if(G===null?T=w:G.next=z,!Hn(w,n.memoizedState)&&(kt=!0,ue&&(i=Mi,i!==null)))throw i;n.memoizedState=w,n.baseState=T,n.baseQueue=G,u.lastRenderedState=w}return y===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function dp(n){var a=Tt(),i=a.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=n;var u=i.dispatch,y=i.pending,w=a.memoizedState;if(y!==null){i.pending=null;var T=y=y.next;do w=n(w,T.action),T=T.next;while(T!==y);Hn(w,a.memoizedState)||(kt=!0),a.memoizedState=w,a.baseQueue===null&&(a.baseState=w),i.lastRenderedState=w}return[w,u]}function nb(n,a,i){var u=Pe,y=Tt(),w=Ge;if(w){if(i===void 0)throw Error(o(407));i=i()}else i=a();var T=!Hn((it||y).memoizedState,i);if(T&&(y.memoizedState=i,kt=!0),y=y.queue,mp(ob.bind(null,u,y,n),[n]),y.getSnapshot!==a||T||Dt!==null&&Dt.memoizedState.tag&1){if(u.flags|=2048,Li(9,{destroy:void 0},ab.bind(null,u,y,i,a),null),ut===null)throw Error(o(349));w||(wa&127)!==0||rb(u,a,i)}return i}function rb(n,a,i){n.flags|=16384,n={getSnapshot:a,value:i},a=Pe.updateQueue,a===null?(a=Cd(),Pe.updateQueue=a,a.stores=[n]):(i=a.stores,i===null?a.stores=[n]:i.push(n))}function ab(n,a,i,u){a.value=i,a.getSnapshot=u,sb(a)&&ib(n)}function ob(n,a,i){return i(function(){sb(a)&&ib(n)})}function sb(n){var a=n.getSnapshot;n=n.value;try{var i=a();return!Hn(n,i)}catch{return!0}}function ib(n){var a=ms(n,2);a!==null&&Nn(a,n,2)}function fp(n){var a=mn();if(typeof n=="function"){var i=n;if(n=i(),Es){Ln(!0);try{i()}finally{Ln(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:n},a}function lb(n,a,i,u){return n.baseState=i,up(n,it,typeof u=="function"?u:Sa)}function zM(n,a,i,u,y){if(Md(n))throw Error(o(485));if(n=a.action,n!==null){var w={payload:y,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){w.listeners.push(T)}};M.T!==null?i(!0):w.isTransition=!1,u(w),i=a.pending,i===null?(w.next=a.pending=w,cb(a,w)):(w.next=i.next,a.pending=i.next=w)}}function cb(n,a){var i=a.action,u=a.payload,y=n.state;if(a.isTransition){var w=M.T,T={};M.T=T;try{var z=i(y,u),G=M.S;G!==null&&G(T,z),ub(n,a,z)}catch(oe){hp(n,a,oe)}finally{w!==null&&T.types!==null&&(w.types=T.types),M.T=w}}else try{w=i(y,u),ub(n,a,w)}catch(oe){hp(n,a,oe)}}function ub(n,a,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(u){db(n,a,u)},function(u){return hp(n,a,u)}):db(n,a,i)}function db(n,a,i){a.status="fulfilled",a.value=i,fb(a),n.state=i,a=n.pending,a!==null&&(i=a.next,i===a?n.pending=null:(i=i.next,a.next=i,cb(n,i)))}function hp(n,a,i){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do a.status="rejected",a.reason=i,fb(a),a=a.next;while(a!==u)}n.action=null}function fb(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function hb(n,a){return a}function mb(n,a){if(Ge){var i=ut.formState;if(i!==null){e:{var u=Pe;if(Ge){if(mt){t:{for(var y=mt,w=rr;y.nodeType!==8;){if(!w){y=null;break t}if(y=or(y.nextSibling),y===null){y=null;break t}}w=y.data,y=w==="F!"||w==="F"?y:null}if(y){mt=or(y.nextSibling),u=y.data==="F!";break e}}io(u)}u=!1}u&&(a=i[0])}}return i=mn(),i.memoizedState=i.baseState=a,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hb,lastRenderedState:a},i.queue=u,i=Db.bind(null,Pe,u),u.dispatch=i,u=fp(!1),w=xp.bind(null,Pe,!1,u.queue),u=mn(),y={state:a,dispatch:null,action:n,pending:null},u.queue=y,i=zM.bind(null,Pe,y,w,i),y.dispatch=i,u.memoizedState=n,[a,i,!1]}function pb(n){var a=Tt();return gb(a,it,n)}function gb(n,a,i){if(a=up(n,a,hb)[0],n=jd(Sa)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var u=hc(a)}catch(T){throw T===Ai?vd:T}else u=a;a=Tt();var y=a.queue,w=y.dispatch;return i!==a.memoizedState&&(Pe.flags|=2048,Li(9,{destroy:void 0},LM.bind(null,y,i),null)),[u,w,n]}function LM(n,a){n.action=a}function vb(n){var a=Tt(),i=it;if(i!==null)return gb(a,i,n);Tt(),a=a.memoizedState,i=Tt();var u=i.queue.dispatch;return i.memoizedState=n,[a,u,!1]}function Li(n,a,i,u){return n={tag:n,create:i,deps:u,inst:a,next:null},a=Pe.updateQueue,a===null&&(a=Cd(),Pe.updateQueue=a),i=a.lastEffect,i===null?a.lastEffect=n.next=n:(u=i.next,i.next=n,n.next=u,a.lastEffect=n),n}function yb(){return Tt().memoizedState}function Td(n,a,i,u){var y=mn();Pe.flags|=n,y.memoizedState=Li(1|a,{destroy:void 0},i,u===void 0?null:u)}function Rd(n,a,i,u){var y=Tt();u=u===void 0?null:u;var w=y.memoizedState.inst;it!==null&&u!==null&&ap(u,it.memoizedState.deps)?y.memoizedState=Li(a,w,i,u):(Pe.flags|=n,y.memoizedState=Li(1|a,w,i,u))}function xb(n,a){Td(8390656,8,n,a)}function mp(n,a){Rd(2048,8,n,a)}function PM(n){Pe.flags|=4;var a=Pe.updateQueue;if(a===null)a=Cd(),Pe.updateQueue=a,a.events=[n];else{var i=a.events;i===null?a.events=[n]:i.push(n)}}function bb(n){var a=Tt().memoizedState;return PM({ref:a,nextImpl:n}),function(){if((tt&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}function wb(n,a){return Rd(4,2,n,a)}function Sb(n,a){return Rd(4,4,n,a)}function Eb(n,a){if(typeof a=="function"){n=n();var i=a(n);return function(){typeof i=="function"?i():a(null)}}if(a!=null)return n=n(),a.current=n,function(){a.current=null}}function _b(n,a,i){i=i!=null?i.concat([n]):null,Rd(4,4,Eb.bind(null,a,n),i)}function pp(){}function Cb(n,a){var i=Tt();a=a===void 0?null:a;var u=i.memoizedState;return a!==null&&ap(a,u[1])?u[0]:(i.memoizedState=[n,a],n)}function Nb(n,a){var i=Tt();a=a===void 0?null:a;var u=i.memoizedState;if(a!==null&&ap(a,u[1]))return u[0];if(u=n(),Es){Ln(!0);try{n()}finally{Ln(!1)}}return i.memoizedState=[u,a],u}function gp(n,a,i){return i===void 0||(wa&1073741824)!==0&&(qe&261930)===0?n.memoizedState=a:(n.memoizedState=i,n=j1(),Pe.lanes|=n,vo|=n,i)}function jb(n,a,i,u){return Hn(i,a)?i:Di.current!==null?(n=gp(n,i,u),Hn(n,a)||(kt=!0),n):(wa&42)===0||(wa&1073741824)!==0&&(qe&261930)===0?(kt=!0,n.memoizedState=i):(n=j1(),Pe.lanes|=n,vo|=n,a)}function Tb(n,a,i,u,y){var w=I.p;I.p=w!==0&&8>w?w:8;var T=M.T,z={};M.T=z,xp(n,!1,a,i);try{var G=y(),oe=M.S;if(oe!==null&&oe(z,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ue=OM(G,u);mc(n,a,ue,qn(n))}else mc(n,a,u,qn(n))}catch(fe){mc(n,a,{then:function(){},status:"rejected",reason:fe},qn())}finally{I.p=w,T!==null&&z.types!==null&&(T.types=z.types),M.T=T}}function HM(){}function vp(n,a,i,u){if(n.tag!==5)throw Error(o(476));var y=Rb(n).queue;Tb(n,y,a,U,i===null?HM:function(){return Mb(n),i(u)})}function Rb(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:U},next:null};var i={};return a.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:i},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function Mb(n){var a=Rb(n);a.next===null&&(a=n.alternate.memoizedState),mc(n,a.next.queue,{},qn())}function yp(){return Zt(Ac)}function Ab(){return Tt().memoizedState}function Ob(){return Tt().memoizedState}function IM(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var i=qn();n=uo(i);var u=fo(a,n,i);u!==null&&(Nn(u,a,i),cc(u,a,i)),a={cache:Ym()},n.payload=a;return}a=a.return}}function BM(n,a,i){var u=qn();i={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Md(n)?kb(a,i):(i=Lm(n,a,i,u),i!==null&&(Nn(i,n,u),zb(i,a,u)))}function Db(n,a,i){var u=qn();mc(n,a,i,u)}function mc(n,a,i,u){var y={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Md(n))kb(a,y);else{var w=n.alternate;if(n.lanes===0&&(w===null||w.lanes===0)&&(w=a.lastRenderedReducer,w!==null))try{var T=a.lastRenderedState,z=w(T,i);if(y.hasEagerState=!0,y.eagerState=z,Hn(z,T))return ud(n,a,y,0),ut===null&&cd(),!1}catch{}finally{}if(i=Lm(n,a,y,u),i!==null)return Nn(i,n,u),zb(i,a,u),!0}return!1}function xp(n,a,i,u){if(u={lane:2,revertLane:Zp(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Md(n)){if(a)throw Error(o(479))}else a=Lm(n,i,u,2),a!==null&&Nn(a,n,2)}function Md(n){var a=n.alternate;return n===Pe||a!==null&&a===Pe}function kb(n,a){ki=Ed=!0;var i=n.pending;i===null?a.next=a:(a.next=i.next,i.next=a),n.pending=a}function zb(n,a,i){if((i&4194048)!==0){var u=a.lanes;u&=n.pendingLanes,i|=u,a.lanes=i,sn(n,i)}}var pc={readContext:Zt,use:Nd,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt};pc.useEffectEvent=wt;var Lb={readContext:Zt,use:Nd,useCallback:function(n,a){return mn().memoizedState=[n,a===void 0?null:a],n},useContext:Zt,useEffect:xb,useImperativeHandle:function(n,a,i){i=i!=null?i.concat([n]):null,Td(4194308,4,Eb.bind(null,a,n),i)},useLayoutEffect:function(n,a){return Td(4194308,4,n,a)},useInsertionEffect:function(n,a){Td(4,2,n,a)},useMemo:function(n,a){var i=mn();a=a===void 0?null:a;var u=n();if(Es){Ln(!0);try{n()}finally{Ln(!1)}}return i.memoizedState=[u,a],u},useReducer:function(n,a,i){var u=mn();if(i!==void 0){var y=i(a);if(Es){Ln(!0);try{i(a)}finally{Ln(!1)}}}else y=a;return u.memoizedState=u.baseState=y,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:y},u.queue=n,n=n.dispatch=BM.bind(null,Pe,n),[u.memoizedState,n]},useRef:function(n){var a=mn();return n={current:n},a.memoizedState=n},useState:function(n){n=fp(n);var a=n.queue,i=Db.bind(null,Pe,a);return a.dispatch=i,[n.memoizedState,i]},useDebugValue:pp,useDeferredValue:function(n,a){var i=mn();return gp(i,n,a)},useTransition:function(){var n=fp(!1);return n=Tb.bind(null,Pe,n.queue,!0,!1),mn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,i){var u=Pe,y=mn();if(Ge){if(i===void 0)throw Error(o(407));i=i()}else{if(i=a(),ut===null)throw Error(o(349));(qe&127)!==0||rb(u,a,i)}y.memoizedState=i;var w={value:i,getSnapshot:a};return y.queue=w,xb(ob.bind(null,u,w,n),[n]),u.flags|=2048,Li(9,{destroy:void 0},ab.bind(null,u,w,i,a),null),i},useId:function(){var n=mn(),a=ut.identifierPrefix;if(Ge){var i=$r,u=Ur;i=(u&~(1<<32-Vt(u)-1)).toString(32)+i,a="_"+a+"R_"+i,i=_d++,0<i&&(a+="H"+i.toString(32)),a+="_"}else i=DM++,a="_"+a+"r_"+i.toString(32)+"_";return n.memoizedState=a},useHostTransitionStatus:yp,useFormState:mb,useActionState:mb,useOptimistic:function(n){var a=mn();a.memoizedState=a.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=i,a=xp.bind(null,Pe,!0,i),i.dispatch=a,[n,a]},useMemoCache:cp,useCacheRefresh:function(){return mn().memoizedState=IM.bind(null,Pe)},useEffectEvent:function(n){var a=mn(),i={impl:n};return a.memoizedState=i,function(){if((tt&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},bp={readContext:Zt,use:Nd,useCallback:Cb,useContext:Zt,useEffect:mp,useImperativeHandle:_b,useInsertionEffect:wb,useLayoutEffect:Sb,useMemo:Nb,useReducer:jd,useRef:yb,useState:function(){return jd(Sa)},useDebugValue:pp,useDeferredValue:function(n,a){var i=Tt();return jb(i,it.memoizedState,n,a)},useTransition:function(){var n=jd(Sa)[0],a=Tt().memoizedState;return[typeof n=="boolean"?n:hc(n),a]},useSyncExternalStore:nb,useId:Ab,useHostTransitionStatus:yp,useFormState:pb,useActionState:pb,useOptimistic:function(n,a){var i=Tt();return lb(i,it,n,a)},useMemoCache:cp,useCacheRefresh:Ob};bp.useEffectEvent=bb;var Pb={readContext:Zt,use:Nd,useCallback:Cb,useContext:Zt,useEffect:mp,useImperativeHandle:_b,useInsertionEffect:wb,useLayoutEffect:Sb,useMemo:Nb,useReducer:dp,useRef:yb,useState:function(){return dp(Sa)},useDebugValue:pp,useDeferredValue:function(n,a){var i=Tt();return it===null?gp(i,n,a):jb(i,it.memoizedState,n,a)},useTransition:function(){var n=dp(Sa)[0],a=Tt().memoizedState;return[typeof n=="boolean"?n:hc(n),a]},useSyncExternalStore:nb,useId:Ab,useHostTransitionStatus:yp,useFormState:vb,useActionState:vb,useOptimistic:function(n,a){var i=Tt();return it!==null?lb(i,it,n,a):(i.baseState=n,[n,i.queue.dispatch])},useMemoCache:cp,useCacheRefresh:Ob};Pb.useEffectEvent=bb;function wp(n,a,i,u){a=n.memoizedState,i=i(u,a),i=i==null?a:p({},a,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var Sp={enqueueSetState:function(n,a,i){n=n._reactInternals;var u=qn(),y=uo(u);y.payload=a,i!=null&&(y.callback=i),a=fo(n,y,u),a!==null&&(Nn(a,n,u),cc(a,n,u))},enqueueReplaceState:function(n,a,i){n=n._reactInternals;var u=qn(),y=uo(u);y.tag=1,y.payload=a,i!=null&&(y.callback=i),a=fo(n,y,u),a!==null&&(Nn(a,n,u),cc(a,n,u))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var i=qn(),u=uo(i);u.tag=2,a!=null&&(u.callback=a),a=fo(n,u,i),a!==null&&(Nn(a,n,i),cc(a,n,i))}};function Hb(n,a,i,u,y,w,T){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,w,T):a.prototype&&a.prototype.isPureReactComponent?!tc(i,u)||!tc(y,w):!0}function Ib(n,a,i,u){n=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(i,u),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(i,u),a.state!==n&&Sp.enqueueReplaceState(a,a.state,null)}function _s(n,a){var i=a;if("ref"in a){i={};for(var u in a)u!=="ref"&&(i[u]=a[u])}if(n=n.defaultProps){i===a&&(i=p({},i));for(var y in n)i[y]===void 0&&(i[y]=n[y])}return i}function Bb(n){ld(n)}function Ub(n){console.error(n)}function $b(n){ld(n)}function Ad(n,a){try{var i=n.onUncaughtError;i(a.value,{componentStack:a.stack})}catch(u){setTimeout(function(){throw u})}}function Vb(n,a,i){try{var u=n.onCaughtError;u(i.value,{componentStack:i.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Ep(n,a,i){return i=uo(i),i.tag=3,i.payload={element:null},i.callback=function(){Ad(n,a)},i}function qb(n){return n=uo(n),n.tag=3,n}function Fb(n,a,i,u){var y=i.type.getDerivedStateFromError;if(typeof y=="function"){var w=u.value;n.payload=function(){return y(w)},n.callback=function(){Vb(a,i,u)}}var T=i.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(n.callback=function(){Vb(a,i,u),typeof y!="function"&&(yo===null?yo=new Set([this]):yo.add(this));var z=u.stack;this.componentDidCatch(u.value,{componentStack:z!==null?z:""})})}function UM(n,a,i,u,y){if(i.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(a=i.alternate,a!==null&&Ti(a,i,y,!0),i=Bn.current,i!==null){switch(i.tag){case 31:case 13:return ar===null?Vd():i.alternate===null&&St===0&&(St=3),i.flags&=-257,i.flags|=65536,i.lanes=y,u===yd?i.flags|=16384:(a=i.updateQueue,a===null?i.updateQueue=new Set([u]):a.add(u),Gp(n,u,y)),!1;case 22:return i.flags|=65536,u===yd?i.flags|=16384:(a=i.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([u])},i.updateQueue=a):(i=a.retryQueue,i===null?a.retryQueue=new Set([u]):i.add(u)),Gp(n,u,y)),!1}throw Error(o(435,i.tag))}return Gp(n,u,y),Vd(),!1}if(Ge)return a=Bn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=y,u!==$m&&(n=Error(o(422),{cause:u}),ac(er(n,i)))):(u!==$m&&(a=Error(o(423),{cause:u}),ac(er(a,i))),n=n.current.alternate,n.flags|=65536,y&=-y,n.lanes|=y,u=er(u,i),y=Ep(n.stateNode,u,y),Jm(n,y),St!==4&&(St=2)),!1;var w=Error(o(520),{cause:u});if(w=er(w,i),Ec===null?Ec=[w]:Ec.push(w),St!==4&&(St=2),a===null)return!0;u=er(u,i),i=a;do{switch(i.tag){case 3:return i.flags|=65536,n=y&-y,i.lanes|=n,n=Ep(i.stateNode,u,n),Jm(i,n),!1;case 1:if(a=i.type,w=i.stateNode,(i.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(yo===null||!yo.has(w))))return i.flags|=65536,y&=-y,i.lanes|=y,y=qb(y),Fb(y,n,i,u),Jm(i,y),!1}i=i.return}while(i!==null);return!1}var _p=Error(o(461)),kt=!1;function Wt(n,a,i,u){a.child=n===null?Kx(a,null,i,u):Ss(a,n.child,i,u)}function Xb(n,a,i,u,y){i=i.render;var w=a.ref;if("ref"in u){var T={};for(var z in u)z!=="ref"&&(T[z]=u[z])}else T=u;return ys(a),u=op(n,a,i,T,w,y),z=sp(),n!==null&&!kt?(ip(n,a,y),Ea(n,a,y)):(Ge&&z&&Bm(a),a.flags|=1,Wt(n,a,u,y),a.child)}function Yb(n,a,i,u,y){if(n===null){var w=i.type;return typeof w=="function"&&!Pm(w)&&w.defaultProps===void 0&&i.compare===null?(a.tag=15,a.type=w,Gb(n,a,w,u,y)):(n=fd(i.type,null,u,a,a.mode,y),n.ref=a.ref,n.return=a,a.child=n)}if(w=n.child,!Op(n,y)){var T=w.memoizedProps;if(i=i.compare,i=i!==null?i:tc,i(T,u)&&n.ref===a.ref)return Ea(n,a,y)}return a.flags|=1,n=va(w,u),n.ref=a.ref,n.return=a,a.child=n}function Gb(n,a,i,u,y){if(n!==null){var w=n.memoizedProps;if(tc(w,u)&&n.ref===a.ref)if(kt=!1,a.pendingProps=u=w,Op(n,y))(n.flags&131072)!==0&&(kt=!0);else return a.lanes=n.lanes,Ea(n,a,y)}return Cp(n,a,i,u,y)}function Kb(n,a,i,u){var y=u.children,w=n!==null?n.memoizedState:null;if(n===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((a.flags&128)!==0){if(w=w!==null?w.baseLanes|i:i,n!==null){for(u=a.child=n.child,y=0;u!==null;)y=y|u.lanes|u.childLanes,u=u.sibling;u=y&~w}else u=0,a.child=null;return Qb(n,a,w,i,u)}if((i&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&gd(a,w!==null?w.cachePool:null),w!==null?Wx(a,w):tp(),Jx(a);else return u=a.lanes=536870912,Qb(n,a,w!==null?w.baseLanes|i:i,i,u)}else w!==null?(gd(a,w.cachePool),Wx(a,w),mo(),a.memoizedState=null):(n!==null&&gd(a,null),tp(),mo());return Wt(n,a,y,i),a.child}function gc(n,a){return n!==null&&n.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Qb(n,a,i,u,y){var w=Km();return w=w===null?null:{parent:Ot._currentValue,pool:w},a.memoizedState={baseLanes:i,cachePool:w},n!==null&&gd(a,null),tp(),Jx(a),n!==null&&Ti(n,a,u,!0),a.childLanes=y,null}function Od(n,a){return a=kd({mode:a.mode,children:a.children},n.mode),a.ref=n.ref,n.child=a,a.return=n,a}function Zb(n,a,i){return Ss(a,n.child,null,i),n=Od(a,a.pendingProps),n.flags|=2,Un(a),a.memoizedState=null,n}function $M(n,a,i){var u=a.pendingProps,y=(a.flags&128)!==0;if(a.flags&=-129,n===null){if(Ge){if(u.mode==="hidden")return n=Od(a,u),a.lanes=536870912,gc(null,n);if(rp(a),(n=mt)?(n=cw(n,rr),n=n!==null&&n.data==="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:oo!==null?{id:Ur,overflow:$r}:null,retryLane:536870912,hydrationErrors:null},i=kx(n),i.return=a,a.child=i,Qt=a,mt=null)):n=null,n===null)throw io(a);return a.lanes=536870912,null}return Od(a,u)}var w=n.memoizedState;if(w!==null){var T=w.dehydrated;if(rp(a),y)if(a.flags&256)a.flags&=-257,a=Zb(n,a,i);else if(a.memoizedState!==null)a.child=n.child,a.flags|=128,a=null;else throw Error(o(558));else if(kt||Ti(n,a,i,!1),y=(i&n.childLanes)!==0,kt||y){if(u=ut,u!==null&&(T=ln(u,i),T!==0&&T!==w.retryLane))throw w.retryLane=T,ms(n,T),Nn(u,n,T),_p;Vd(),a=Zb(n,a,i)}else n=w.treeContext,mt=or(T.nextSibling),Qt=a,Ge=!0,so=null,rr=!1,n!==null&&Px(a,n),a=Od(a,u),a.flags|=4096;return a}return n=va(n.child,{mode:u.mode,children:u.children}),n.ref=a.ref,a.child=n,n.return=a,n}function Dd(n,a){var i=a.ref;if(i===null)n!==null&&n.ref!==null&&(a.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(n===null||n.ref!==i)&&(a.flags|=4194816)}}function Cp(n,a,i,u,y){return ys(a),i=op(n,a,i,u,void 0,y),u=sp(),n!==null&&!kt?(ip(n,a,y),Ea(n,a,y)):(Ge&&u&&Bm(a),a.flags|=1,Wt(n,a,i,y),a.child)}function Wb(n,a,i,u,y,w){return ys(a),a.updateQueue=null,i=tb(a,u,i,y),eb(n),u=sp(),n!==null&&!kt?(ip(n,a,w),Ea(n,a,w)):(Ge&&u&&Bm(a),a.flags|=1,Wt(n,a,i,w),a.child)}function Jb(n,a,i,u,y){if(ys(a),a.stateNode===null){var w=_i,T=i.contextType;typeof T=="object"&&T!==null&&(w=Zt(T)),w=new i(u,w),a.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Sp,a.stateNode=w,w._reactInternals=a,w=a.stateNode,w.props=u,w.state=a.memoizedState,w.refs={},Zm(a),T=i.contextType,w.context=typeof T=="object"&&T!==null?Zt(T):_i,w.state=a.memoizedState,T=i.getDerivedStateFromProps,typeof T=="function"&&(wp(a,i,T,u),w.state=a.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(T=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),T!==w.state&&Sp.enqueueReplaceState(w,w.state,null),dc(a,u,w,y),uc(),w.state=a.memoizedState),typeof w.componentDidMount=="function"&&(a.flags|=4194308),u=!0}else if(n===null){w=a.stateNode;var z=a.memoizedProps,G=_s(i,z);w.props=G;var oe=w.context,ue=i.contextType;T=_i,typeof ue=="object"&&ue!==null&&(T=Zt(ue));var fe=i.getDerivedStateFromProps;ue=typeof fe=="function"||typeof w.getSnapshotBeforeUpdate=="function",z=a.pendingProps!==z,ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(z||oe!==T)&&Ib(a,w,u,T),co=!1;var ie=a.memoizedState;w.state=ie,dc(a,u,w,y),uc(),oe=a.memoizedState,z||ie!==oe||co?(typeof fe=="function"&&(wp(a,i,fe,u),oe=a.memoizedState),(G=co||Hb(a,i,G,u,ie,oe,T))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(a.flags|=4194308)):(typeof w.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=u,a.memoizedState=oe),w.props=u,w.state=oe,w.context=T,u=G):(typeof w.componentDidMount=="function"&&(a.flags|=4194308),u=!1)}else{w=a.stateNode,Wm(n,a),T=a.memoizedProps,ue=_s(i,T),w.props=ue,fe=a.pendingProps,ie=w.context,oe=i.contextType,G=_i,typeof oe=="object"&&oe!==null&&(G=Zt(oe)),z=i.getDerivedStateFromProps,(oe=typeof z=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==fe||ie!==G)&&Ib(a,w,u,G),co=!1,ie=a.memoizedState,w.state=ie,dc(a,u,w,y),uc();var ce=a.memoizedState;T!==fe||ie!==ce||co||n!==null&&n.dependencies!==null&&md(n.dependencies)?(typeof z=="function"&&(wp(a,i,z,u),ce=a.memoizedState),(ue=co||Hb(a,i,ue,u,ie,ce,G)||n!==null&&n.dependencies!==null&&md(n.dependencies))?(oe||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(u,ce,G),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(u,ce,G)),typeof w.componentDidUpdate=="function"&&(a.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof w.componentDidUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(a.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(a.flags|=1024),a.memoizedProps=u,a.memoizedState=ce),w.props=u,w.state=ce,w.context=G,u=ue):(typeof w.componentDidUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(a.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(a.flags|=1024),u=!1)}return w=u,Dd(n,a),u=(a.flags&128)!==0,w||u?(w=a.stateNode,i=u&&typeof i.getDerivedStateFromError!="function"?null:w.render(),a.flags|=1,n!==null&&u?(a.child=Ss(a,n.child,null,y),a.child=Ss(a,null,i,y)):Wt(n,a,i,y),a.memoizedState=w.state,n=a.child):n=Ea(n,a,y),n}function e1(n,a,i,u){return gs(),a.flags|=256,Wt(n,a,i,u),a.child}var Np={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jp(n){return{baseLanes:n,cachePool:Vx()}}function Tp(n,a,i){return n=n!==null?n.childLanes&~i:0,a&&(n|=Vn),n}function t1(n,a,i){var u=a.pendingProps,y=!1,w=(a.flags&128)!==0,T;if((T=w)||(T=n!==null&&n.memoizedState===null?!1:(jt.current&2)!==0),T&&(y=!0,a.flags&=-129),T=(a.flags&32)!==0,a.flags&=-33,n===null){if(Ge){if(y?ho(a):mo(),(n=mt)?(n=cw(n,rr),n=n!==null&&n.data!=="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:oo!==null?{id:Ur,overflow:$r}:null,retryLane:536870912,hydrationErrors:null},i=kx(n),i.return=a,a.child=i,Qt=a,mt=null)):n=null,n===null)throw io(a);return ug(n)?a.lanes=32:a.lanes=536870912,null}var z=u.children;return u=u.fallback,y?(mo(),y=a.mode,z=kd({mode:"hidden",children:z},y),u=ps(u,y,i,null),z.return=a,u.return=a,z.sibling=u,a.child=z,u=a.child,u.memoizedState=jp(i),u.childLanes=Tp(n,T,i),a.memoizedState=Np,gc(null,u)):(ho(a),Rp(a,z))}var G=n.memoizedState;if(G!==null&&(z=G.dehydrated,z!==null)){if(w)a.flags&256?(ho(a),a.flags&=-257,a=Mp(n,a,i)):a.memoizedState!==null?(mo(),a.child=n.child,a.flags|=128,a=null):(mo(),z=u.fallback,y=a.mode,u=kd({mode:"visible",children:u.children},y),z=ps(z,y,i,null),z.flags|=2,u.return=a,z.return=a,u.sibling=z,a.child=u,Ss(a,n.child,null,i),u=a.child,u.memoizedState=jp(i),u.childLanes=Tp(n,T,i),a.memoizedState=Np,a=gc(null,u));else if(ho(a),ug(z)){if(T=z.nextSibling&&z.nextSibling.dataset,T)var oe=T.dgst;T=oe,u=Error(o(419)),u.stack="",u.digest=T,ac({value:u,source:null,stack:null}),a=Mp(n,a,i)}else if(kt||Ti(n,a,i,!1),T=(i&n.childLanes)!==0,kt||T){if(T=ut,T!==null&&(u=ln(T,i),u!==0&&u!==G.retryLane))throw G.retryLane=u,ms(n,u),Nn(T,n,u),_p;cg(z)||Vd(),a=Mp(n,a,i)}else cg(z)?(a.flags|=192,a.child=n.child,a=null):(n=G.treeContext,mt=or(z.nextSibling),Qt=a,Ge=!0,so=null,rr=!1,n!==null&&Px(a,n),a=Rp(a,u.children),a.flags|=4096);return a}return y?(mo(),z=u.fallback,y=a.mode,G=n.child,oe=G.sibling,u=va(G,{mode:"hidden",children:u.children}),u.subtreeFlags=G.subtreeFlags&65011712,oe!==null?z=va(oe,z):(z=ps(z,y,i,null),z.flags|=2),z.return=a,u.return=a,u.sibling=z,a.child=u,gc(null,u),u=a.child,z=n.child.memoizedState,z===null?z=jp(i):(y=z.cachePool,y!==null?(G=Ot._currentValue,y=y.parent!==G?{parent:G,pool:G}:y):y=Vx(),z={baseLanes:z.baseLanes|i,cachePool:y}),u.memoizedState=z,u.childLanes=Tp(n,T,i),a.memoizedState=Np,gc(n.child,u)):(ho(a),i=n.child,n=i.sibling,i=va(i,{mode:"visible",children:u.children}),i.return=a,i.sibling=null,n!==null&&(T=a.deletions,T===null?(a.deletions=[n],a.flags|=16):T.push(n)),a.child=i,a.memoizedState=null,i)}function Rp(n,a){return a=kd({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function kd(n,a){return n=In(22,n,null,a),n.lanes=0,n}function Mp(n,a,i){return Ss(a,n.child,null,i),n=Rp(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function n1(n,a,i){n.lanes|=a;var u=n.alternate;u!==null&&(u.lanes|=a),Fm(n.return,a,i)}function Ap(n,a,i,u,y,w){var T=n.memoizedState;T===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:y,treeForkCount:w}:(T.isBackwards=a,T.rendering=null,T.renderingStartTime=0,T.last=u,T.tail=i,T.tailMode=y,T.treeForkCount=w)}function r1(n,a,i){var u=a.pendingProps,y=u.revealOrder,w=u.tail;u=u.children;var T=jt.current,z=(T&2)!==0;if(z?(T=T&1|2,a.flags|=128):T&=1,Y(jt,T),Wt(n,a,u,i),u=Ge?rc:0,!z&&n!==null&&(n.flags&128)!==0)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&n1(n,i,a);else if(n.tag===19)n1(n,i,a);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break e;for(;n.sibling===null;){if(n.return===null||n.return===a)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(y){case"forwards":for(i=a.child,y=null;i!==null;)n=i.alternate,n!==null&&Sd(n)===null&&(y=i),i=i.sibling;i=y,i===null?(y=a.child,a.child=null):(y=i.sibling,i.sibling=null),Ap(a,!1,y,i,w,u);break;case"backwards":case"unstable_legacy-backwards":for(i=null,y=a.child,a.child=null;y!==null;){if(n=y.alternate,n!==null&&Sd(n)===null){a.child=y;break}n=y.sibling,y.sibling=i,i=y,y=n}Ap(a,!0,i,null,w,u);break;case"together":Ap(a,!1,null,null,void 0,u);break;default:a.memoizedState=null}return a.child}function Ea(n,a,i){if(n!==null&&(a.dependencies=n.dependencies),vo|=a.lanes,(i&a.childLanes)===0)if(n!==null){if(Ti(n,a,i,!1),(i&a.childLanes)===0)return null}else return null;if(n!==null&&a.child!==n.child)throw Error(o(153));if(a.child!==null){for(n=a.child,i=va(n,n.pendingProps),a.child=i,i.return=a;n.sibling!==null;)n=n.sibling,i=i.sibling=va(n,n.pendingProps),i.return=a;i.sibling=null}return a.child}function Op(n,a){return(n.lanes&a)!==0?!0:(n=n.dependencies,!!(n!==null&&md(n)))}function VM(n,a,i){switch(a.tag){case 3:re(a,a.stateNode.containerInfo),lo(a,Ot,n.memoizedState.cache),gs();break;case 27:case 5:ve(a);break;case 4:re(a,a.stateNode.containerInfo);break;case 10:lo(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,rp(a),null;break;case 13:var u=a.memoizedState;if(u!==null)return u.dehydrated!==null?(ho(a),a.flags|=128,null):(i&a.child.childLanes)!==0?t1(n,a,i):(ho(a),n=Ea(n,a,i),n!==null?n.sibling:null);ho(a);break;case 19:var y=(n.flags&128)!==0;if(u=(i&a.childLanes)!==0,u||(Ti(n,a,i,!1),u=(i&a.childLanes)!==0),y){if(u)return r1(n,a,i);a.flags|=128}if(y=a.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),Y(jt,jt.current),u)break;return null;case 22:return a.lanes=0,Kb(n,a,i,a.pendingProps);case 24:lo(a,Ot,n.memoizedState.cache)}return Ea(n,a,i)}function a1(n,a,i){if(n!==null)if(n.memoizedProps!==a.pendingProps)kt=!0;else{if(!Op(n,i)&&(a.flags&128)===0)return kt=!1,VM(n,a,i);kt=(n.flags&131072)!==0}else kt=!1,Ge&&(a.flags&1048576)!==0&&Lx(a,rc,a.index);switch(a.lanes=0,a.tag){case 16:e:{var u=a.pendingProps;if(n=bs(a.elementType),a.type=n,typeof n=="function")Pm(n)?(u=_s(n,u),a.tag=1,a=Jb(null,a,n,u,i)):(a.tag=0,a=Cp(null,a,n,u,i));else{if(n!=null){var y=n.$$typeof;if(y===R){a.tag=11,a=Xb(null,a,n,u,i);break e}else if(y===D){a.tag=14,a=Yb(null,a,n,u,i);break e}}throw a=B(n)||n,Error(o(306,a,""))}}return a;case 0:return Cp(n,a,a.type,a.pendingProps,i);case 1:return u=a.type,y=_s(u,a.pendingProps),Jb(n,a,u,y,i);case 3:e:{if(re(a,a.stateNode.containerInfo),n===null)throw Error(o(387));u=a.pendingProps;var w=a.memoizedState;y=w.element,Wm(n,a),dc(a,u,null,i);var T=a.memoizedState;if(u=T.cache,lo(a,Ot,u),u!==w.cache&&Xm(a,[Ot],i,!0),uc(),u=T.element,w.isDehydrated)if(w={element:u,isDehydrated:!1,cache:T.cache},a.updateQueue.baseState=w,a.memoizedState=w,a.flags&256){a=e1(n,a,u,i);break e}else if(u!==y){y=er(Error(o(424)),a),ac(y),a=e1(n,a,u,i);break e}else{switch(n=a.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(mt=or(n.firstChild),Qt=a,Ge=!0,so=null,rr=!0,i=Kx(a,null,u,i),a.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(gs(),u===y){a=Ea(n,a,i);break e}Wt(n,a,u,i)}a=a.child}return a;case 26:return Dd(n,a),n===null?(i=pw(a.type,null,a.pendingProps,null))?a.memoizedState=i:Ge||(i=a.type,n=a.pendingProps,u=Qd(se.current).createElement(i),u[It]=a,u[cn]=n,Jt(u,i,n),At(u),a.stateNode=u):a.memoizedState=pw(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return ve(a),n===null&&Ge&&(u=a.stateNode=fw(a.type,a.pendingProps,se.current),Qt=a,rr=!0,y=mt,So(a.type)?(dg=y,mt=or(u.firstChild)):mt=y),Wt(n,a,a.pendingProps.children,i),Dd(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&Ge&&((y=u=mt)&&(u=xA(u,a.type,a.pendingProps,rr),u!==null?(a.stateNode=u,Qt=a,mt=or(u.firstChild),rr=!1,y=!0):y=!1),y||io(a)),ve(a),y=a.type,w=a.pendingProps,T=n!==null?n.memoizedProps:null,u=w.children,sg(y,w)?u=null:T!==null&&sg(y,T)&&(a.flags|=32),a.memoizedState!==null&&(y=op(n,a,kM,null,null,i),Ac._currentValue=y),Dd(n,a),Wt(n,a,u,i),a.child;case 6:return n===null&&Ge&&((n=i=mt)&&(i=bA(i,a.pendingProps,rr),i!==null?(a.stateNode=i,Qt=a,mt=null,n=!0):n=!1),n||io(a)),null;case 13:return t1(n,a,i);case 4:return re(a,a.stateNode.containerInfo),u=a.pendingProps,n===null?a.child=Ss(a,null,u,i):Wt(n,a,u,i),a.child;case 11:return Xb(n,a,a.type,a.pendingProps,i);case 7:return Wt(n,a,a.pendingProps,i),a.child;case 8:return Wt(n,a,a.pendingProps.children,i),a.child;case 12:return Wt(n,a,a.pendingProps.children,i),a.child;case 10:return u=a.pendingProps,lo(a,a.type,u.value),Wt(n,a,u.children,i),a.child;case 9:return y=a.type._context,u=a.pendingProps.children,ys(a),y=Zt(y),u=u(y),a.flags|=1,Wt(n,a,u,i),a.child;case 14:return Yb(n,a,a.type,a.pendingProps,i);case 15:return Gb(n,a,a.type,a.pendingProps,i);case 19:return r1(n,a,i);case 31:return $M(n,a,i);case 22:return Kb(n,a,i,a.pendingProps);case 24:return ys(a),u=Zt(Ot),n===null?(y=Km(),y===null&&(y=ut,w=Ym(),y.pooledCache=w,w.refCount++,w!==null&&(y.pooledCacheLanes|=i),y=w),a.memoizedState={parent:u,cache:y},Zm(a),lo(a,Ot,y)):((n.lanes&i)!==0&&(Wm(n,a),dc(a,null,null,i),uc()),y=n.memoizedState,w=a.memoizedState,y.parent!==u?(y={parent:u,cache:u},a.memoizedState=y,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=y),lo(a,Ot,u)):(u=w.cache,lo(a,Ot,u),u!==y.cache&&Xm(a,[Ot],i,!0))),Wt(n,a,a.pendingProps.children,i),a.child;case 29:throw a.pendingProps}throw Error(o(156,a.tag))}function _a(n){n.flags|=4}function Dp(n,a,i,u,y){if((a=(n.mode&32)!==0)&&(a=!1),a){if(n.flags|=16777216,(y&335544128)===y)if(n.stateNode.complete)n.flags|=8192;else if(A1())n.flags|=8192;else throw ws=yd,Qm}else n.flags&=-16777217}function o1(n,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!bw(a))if(A1())n.flags|=8192;else throw ws=yd,Qm}function zd(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag!==22?qt():536870912,n.lanes|=a,Bi|=a)}function vc(n,a){if(!Ge)switch(n.tailMode){case"hidden":a=n.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?a||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function pt(n){var a=n.alternate!==null&&n.alternate.child===n.child,i=0,u=0;if(a)for(var y=n.child;y!==null;)i|=y.lanes|y.childLanes,u|=y.subtreeFlags&65011712,u|=y.flags&65011712,y.return=n,y=y.sibling;else for(y=n.child;y!==null;)i|=y.lanes|y.childLanes,u|=y.subtreeFlags,u|=y.flags,y.return=n,y=y.sibling;return n.subtreeFlags|=u,n.childLanes=i,a}function qM(n,a,i){var u=a.pendingProps;switch(Um(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(a),null;case 1:return pt(a),null;case 3:return i=a.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),ba(Ot),le(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(ji(a)?_a(a):n===null||n.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Vm())),pt(a),null;case 26:var y=a.type,w=a.memoizedState;return n===null?(_a(a),w!==null?(pt(a),o1(a,w)):(pt(a),Dp(a,y,null,u,i))):w?w!==n.memoizedState?(_a(a),pt(a),o1(a,w)):(pt(a),a.flags&=-16777217):(n=n.memoizedProps,n!==u&&_a(a),pt(a),Dp(a,y,n,u,i)),null;case 27:if(ge(a),i=se.current,y=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==u&&_a(a);else{if(!u){if(a.stateNode===null)throw Error(o(166));return pt(a),null}n=W.current,ji(a)?Hx(a):(n=fw(y,u,i),a.stateNode=n,_a(a))}return pt(a),null;case 5:if(ge(a),y=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==u&&_a(a);else{if(!u){if(a.stateNode===null)throw Error(o(166));return pt(a),null}if(w=W.current,ji(a))Hx(a);else{var T=Qd(se.current);switch(w){case 1:w=T.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:w=T.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":w=T.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":w=T.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":w=T.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof u.is=="string"?T.createElement("select",{is:u.is}):T.createElement("select"),u.multiple?w.multiple=!0:u.size&&(w.size=u.size);break;default:w=typeof u.is=="string"?T.createElement(y,{is:u.is}):T.createElement(y)}}w[It]=a,w[cn]=u;e:for(T=a.child;T!==null;){if(T.tag===5||T.tag===6)w.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===a)break e;for(;T.sibling===null;){if(T.return===null||T.return===a)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}a.stateNode=w;e:switch(Jt(w,y,u),y){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&_a(a)}}return pt(a),Dp(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,i),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==u&&_a(a);else{if(typeof u!="string"&&a.stateNode===null)throw Error(o(166));if(n=se.current,ji(a)){if(n=a.stateNode,i=a.memoizedProps,u=null,y=Qt,y!==null)switch(y.tag){case 27:case 5:u=y.memoizedProps}n[It]=a,n=!!(n.nodeValue===i||u!==null&&u.suppressHydrationWarning===!0||tw(n.nodeValue,i)),n||io(a,!0)}else n=Qd(n).createTextNode(u),n[It]=a,a.stateNode=n}return pt(a),null;case 31:if(i=a.memoizedState,n===null||n.memoizedState!==null){if(u=ji(a),i!==null){if(n===null){if(!u)throw Error(o(318));if(n=a.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(557));n[It]=a}else gs(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),n=!1}else i=Vm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=i),n=!0;if(!n)return a.flags&256?(Un(a),a):(Un(a),null);if((a.flags&128)!==0)throw Error(o(558))}return pt(a),null;case 13:if(u=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(y=ji(a),u!==null&&u.dehydrated!==null){if(n===null){if(!y)throw Error(o(318));if(y=a.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(o(317));y[It]=a}else gs(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),y=!1}else y=Vm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=y),y=!0;if(!y)return a.flags&256?(Un(a),a):(Un(a),null)}return Un(a),(a.flags&128)!==0?(a.lanes=i,a):(i=u!==null,n=n!==null&&n.memoizedState!==null,i&&(u=a.child,y=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(y=u.alternate.memoizedState.cachePool.pool),w=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(w=u.memoizedState.cachePool.pool),w!==y&&(u.flags|=2048)),i!==n&&i&&(a.child.flags|=8192),zd(a,a.updateQueue),pt(a),null);case 4:return le(),n===null&&tg(a.stateNode.containerInfo),pt(a),null;case 10:return ba(a.type),pt(a),null;case 19:if(L(jt),u=a.memoizedState,u===null)return pt(a),null;if(y=(a.flags&128)!==0,w=u.rendering,w===null)if(y)vc(u,!1);else{if(St!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(w=Sd(n),w!==null){for(a.flags|=128,vc(u,!1),n=w.updateQueue,a.updateQueue=n,zd(a,n),a.subtreeFlags=0,n=i,i=a.child;i!==null;)Dx(i,n),i=i.sibling;return Y(jt,jt.current&1|2),Ge&&ya(a,u.treeForkCount),a.child}n=n.sibling}u.tail!==null&&Ht()>Bd&&(a.flags|=128,y=!0,vc(u,!1),a.lanes=4194304)}else{if(!y)if(n=Sd(w),n!==null){if(a.flags|=128,y=!0,n=n.updateQueue,a.updateQueue=n,zd(a,n),vc(u,!0),u.tail===null&&u.tailMode==="hidden"&&!w.alternate&&!Ge)return pt(a),null}else 2*Ht()-u.renderingStartTime>Bd&&i!==536870912&&(a.flags|=128,y=!0,vc(u,!1),a.lanes=4194304);u.isBackwards?(w.sibling=a.child,a.child=w):(n=u.last,n!==null?n.sibling=w:a.child=w,u.last=w)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=Ht(),n.sibling=null,i=jt.current,Y(jt,y?i&1|2:i&1),Ge&&ya(a,u.treeForkCount),n):(pt(a),null);case 22:case 23:return Un(a),np(),u=a.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(a.flags|=8192):u&&(a.flags|=8192),u?(i&536870912)!==0&&(a.flags&128)===0&&(pt(a),a.subtreeFlags&6&&(a.flags|=8192)):pt(a),i=a.updateQueue,i!==null&&zd(a,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==i&&(a.flags|=2048),n!==null&&L(xs),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),ba(Ot),pt(a),null;case 25:return null;case 30:return null}throw Error(o(156,a.tag))}function FM(n,a){switch(Um(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return ba(Ot),le(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return ge(a),null;case 31:if(a.memoizedState!==null){if(Un(a),a.alternate===null)throw Error(o(340));gs()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(Un(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(o(340));gs()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return L(jt),null;case 4:return le(),null;case 10:return ba(a.type),null;case 22:case 23:return Un(a),np(),n!==null&&L(xs),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return ba(Ot),null;case 25:return null;default:return null}}function s1(n,a){switch(Um(a),a.tag){case 3:ba(Ot),le();break;case 26:case 27:case 5:ge(a);break;case 4:le();break;case 31:a.memoizedState!==null&&Un(a);break;case 13:Un(a);break;case 19:L(jt);break;case 10:ba(a.type);break;case 22:case 23:Un(a),np(),n!==null&&L(xs);break;case 24:ba(Ot)}}function yc(n,a){try{var i=a.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var y=u.next;i=y;do{if((i.tag&n)===n){u=void 0;var w=i.create,T=i.inst;u=w(),T.destroy=u}i=i.next}while(i!==y)}}catch(z){ot(a,a.return,z)}}function po(n,a,i){try{var u=a.updateQueue,y=u!==null?u.lastEffect:null;if(y!==null){var w=y.next;u=w;do{if((u.tag&n)===n){var T=u.inst,z=T.destroy;if(z!==void 0){T.destroy=void 0,y=a;var G=i,oe=z;try{oe()}catch(ue){ot(y,G,ue)}}}u=u.next}while(u!==w)}}catch(ue){ot(a,a.return,ue)}}function i1(n){var a=n.updateQueue;if(a!==null){var i=n.stateNode;try{Zx(a,i)}catch(u){ot(n,n.return,u)}}}function l1(n,a,i){i.props=_s(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(u){ot(n,a,u)}}function xc(n,a){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof i=="function"?n.refCleanup=i(u):i.current=u}}catch(y){ot(n,a,y)}}function Vr(n,a){var i=n.ref,u=n.refCleanup;if(i!==null)if(typeof u=="function")try{u()}catch(y){ot(n,a,y)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(y){ot(n,a,y)}else i.current=null}function c1(n){var a=n.type,i=n.memoizedProps,u=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":i.autoFocus&&u.focus();break e;case"img":i.src?u.src=i.src:i.srcSet&&(u.srcset=i.srcSet)}}catch(y){ot(n,n.return,y)}}function kp(n,a,i){try{var u=n.stateNode;hA(u,n.type,i,a),u[cn]=a}catch(y){ot(n,n.return,y)}}function u1(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&So(n.type)||n.tag===4}function zp(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||u1(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&&So(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 Lp(n,a,i){var u=n.tag;if(u===5||u===6)n=n.stateNode,a?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(n,a):(a=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.appendChild(n),i=i._reactRootContainer,i!=null||a.onclick!==null||(a.onclick=pa));else if(u!==4&&(u===27&&So(n.type)&&(i=n.stateNode,a=null),n=n.child,n!==null))for(Lp(n,a,i),n=n.sibling;n!==null;)Lp(n,a,i),n=n.sibling}function Ld(n,a,i){var u=n.tag;if(u===5||u===6)n=n.stateNode,a?i.insertBefore(n,a):i.appendChild(n);else if(u!==4&&(u===27&&So(n.type)&&(i=n.stateNode),n=n.child,n!==null))for(Ld(n,a,i),n=n.sibling;n!==null;)Ld(n,a,i),n=n.sibling}function d1(n){var a=n.stateNode,i=n.memoizedProps;try{for(var u=n.type,y=a.attributes;y.length;)a.removeAttributeNode(y[0]);Jt(a,u,i),a[It]=n,a[cn]=i}catch(w){ot(n,n.return,w)}}var Ca=!1,zt=!1,Pp=!1,f1=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function XM(n,a){if(n=n.containerInfo,ag=rf,n=_x(n),Mm(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var y=u.anchorOffset,w=u.focusNode;u=u.focusOffset;try{i.nodeType,w.nodeType}catch{i=null;break e}var T=0,z=-1,G=-1,oe=0,ue=0,fe=n,ie=null;t:for(;;){for(var ce;fe!==i||y!==0&&fe.nodeType!==3||(z=T+y),fe!==w||u!==0&&fe.nodeType!==3||(G=T+u),fe.nodeType===3&&(T+=fe.nodeValue.length),(ce=fe.firstChild)!==null;)ie=fe,fe=ce;for(;;){if(fe===n)break t;if(ie===i&&++oe===y&&(z=T),ie===w&&++ue===u&&(G=T),(ce=fe.nextSibling)!==null)break;fe=ie,ie=fe.parentNode}fe=ce}i=z===-1||G===-1?null:{start:z,end:G}}else i=null}i=i||{start:0,end:0}}else i=null;for(og={focusedElem:n,selectionRange:i},rf=!1,Ft=a;Ft!==null;)if(a=Ft,n=a.child,(a.subtreeFlags&1028)!==0&&n!==null)n.return=a,Ft=n;else for(;Ft!==null;){switch(a=Ft,w=a.alternate,n=a.flags,a.tag){case 0:if((n&4)!==0&&(n=a.updateQueue,n=n!==null?n.events:null,n!==null))for(i=0;i<n.length;i++)y=n[i],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&w!==null){n=void 0,i=a,y=w.memoizedProps,w=w.memoizedState,u=i.stateNode;try{var we=_s(i.type,y);n=u.getSnapshotBeforeUpdate(we,w),u.__reactInternalSnapshotBeforeUpdate=n}catch(Ae){ot(i,i.return,Ae)}}break;case 3:if((n&1024)!==0){if(n=a.stateNode.containerInfo,i=n.nodeType,i===9)lg(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":lg(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(o(163))}if(n=a.sibling,n!==null){n.return=a.return,Ft=n;break}Ft=a.return}}function h1(n,a,i){var u=i.flags;switch(i.tag){case 0:case 11:case 15:ja(n,i),u&4&&yc(5,i);break;case 1:if(ja(n,i),u&4)if(n=i.stateNode,a===null)try{n.componentDidMount()}catch(T){ot(i,i.return,T)}else{var y=_s(i.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(y,a,n.__reactInternalSnapshotBeforeUpdate)}catch(T){ot(i,i.return,T)}}u&64&&i1(i),u&512&&xc(i,i.return);break;case 3:if(ja(n,i),u&64&&(n=i.updateQueue,n!==null)){if(a=null,i.child!==null)switch(i.child.tag){case 27:case 5:a=i.child.stateNode;break;case 1:a=i.child.stateNode}try{Zx(n,a)}catch(T){ot(i,i.return,T)}}break;case 27:a===null&&u&4&&d1(i);case 26:case 5:ja(n,i),a===null&&u&4&&c1(i),u&512&&xc(i,i.return);break;case 12:ja(n,i);break;case 31:ja(n,i),u&4&&g1(n,i);break;case 13:ja(n,i),u&4&&v1(n,i),u&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=tA.bind(null,i),wA(n,i))));break;case 22:if(u=i.memoizedState!==null||Ca,!u){a=a!==null&&a.memoizedState!==null||zt,y=Ca;var w=zt;Ca=u,(zt=a)&&!w?Ta(n,i,(i.subtreeFlags&8772)!==0):ja(n,i),Ca=y,zt=w}break;case 30:break;default:ja(n,i)}}function m1(n){var a=n.alternate;a!==null&&(n.alternate=null,m1(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&Fl(a)),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 vt=null,Sn=!1;function Na(n,a,i){for(i=i.child;i!==null;)p1(n,a,i),i=i.sibling}function p1(n,a,i){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(ca,i)}catch{}switch(i.tag){case 26:zt||Vr(i,a),Na(n,a,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:zt||Vr(i,a);var u=vt,y=Sn;So(i.type)&&(vt=i.stateNode,Sn=!1),Na(n,a,i),Tc(i.stateNode),vt=u,Sn=y;break;case 5:zt||Vr(i,a);case 6:if(u=vt,y=Sn,vt=null,Na(n,a,i),vt=u,Sn=y,vt!==null)if(Sn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(i.stateNode)}catch(w){ot(i,a,w)}else try{vt.removeChild(i.stateNode)}catch(w){ot(i,a,w)}break;case 18:vt!==null&&(Sn?(n=vt,iw(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),Gi(n)):iw(vt,i.stateNode));break;case 4:u=vt,y=Sn,vt=i.stateNode.containerInfo,Sn=!0,Na(n,a,i),vt=u,Sn=y;break;case 0:case 11:case 14:case 15:po(2,i,a),zt||po(4,i,a),Na(n,a,i);break;case 1:zt||(Vr(i,a),u=i.stateNode,typeof u.componentWillUnmount=="function"&&l1(i,a,u)),Na(n,a,i);break;case 21:Na(n,a,i);break;case 22:zt=(u=zt)||i.memoizedState!==null,Na(n,a,i),zt=u;break;default:Na(n,a,i)}}function g1(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Gi(n)}catch(i){ot(a,a.return,i)}}}function v1(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Gi(n)}catch(i){ot(a,a.return,i)}}function YM(n){switch(n.tag){case 31:case 13:case 19:var a=n.stateNode;return a===null&&(a=n.stateNode=new f1),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new f1),a;default:throw Error(o(435,n.tag))}}function Pd(n,a){var i=YM(n);a.forEach(function(u){if(!i.has(u)){i.add(u);var y=nA.bind(null,n,u);u.then(y,y)}})}function En(n,a){var i=a.deletions;if(i!==null)for(var u=0;u<i.length;u++){var y=i[u],w=n,T=a,z=T;e:for(;z!==null;){switch(z.tag){case 27:if(So(z.type)){vt=z.stateNode,Sn=!1;break e}break;case 5:vt=z.stateNode,Sn=!1;break e;case 3:case 4:vt=z.stateNode.containerInfo,Sn=!0;break e}z=z.return}if(vt===null)throw Error(o(160));p1(w,T,y),vt=null,Sn=!1,w=y.alternate,w!==null&&(w.return=null),y.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)y1(a,n),a=a.sibling}var yr=null;function y1(n,a){var i=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:En(a,n),_n(n),u&4&&(po(3,n,n.return),yc(3,n),po(5,n,n.return));break;case 1:En(a,n),_n(n),u&512&&(zt||i===null||Vr(i,i.return)),u&64&&Ca&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?u:i.concat(u))));break;case 26:var y=yr;if(En(a,n),_n(n),u&512&&(zt||i===null||Vr(i,i.return)),u&4){var w=i!==null?i.memoizedState:null;if(u=n.memoizedState,i===null)if(u===null)if(n.stateNode===null){e:{u=n.type,i=n.memoizedProps,y=y.ownerDocument||y;t:switch(u){case"title":w=y.getElementsByTagName("title")[0],(!w||w[ls]||w[It]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=y.createElement(u),y.head.insertBefore(w,y.querySelector("head > title"))),Jt(w,u,i),w[It]=n,At(w),u=w;break e;case"link":var T=yw("link","href",y).get(u+(i.href||""));if(T){for(var z=0;z<T.length;z++)if(w=T[z],w.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&w.getAttribute("rel")===(i.rel==null?null:i.rel)&&w.getAttribute("title")===(i.title==null?null:i.title)&&w.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){T.splice(z,1);break t}}w=y.createElement(u),Jt(w,u,i),y.head.appendChild(w);break;case"meta":if(T=yw("meta","content",y).get(u+(i.content||""))){for(z=0;z<T.length;z++)if(w=T[z],w.getAttribute("content")===(i.content==null?null:""+i.content)&&w.getAttribute("name")===(i.name==null?null:i.name)&&w.getAttribute("property")===(i.property==null?null:i.property)&&w.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&w.getAttribute("charset")===(i.charSet==null?null:i.charSet)){T.splice(z,1);break t}}w=y.createElement(u),Jt(w,u,i),y.head.appendChild(w);break;default:throw Error(o(468,u))}w[It]=n,At(w),u=w}n.stateNode=u}else xw(y,n.type,n.stateNode);else n.stateNode=vw(y,u,n.memoizedProps);else w!==u?(w===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):w.count--,u===null?xw(y,n.type,n.stateNode):vw(y,u,n.memoizedProps)):u===null&&n.stateNode!==null&&kp(n,n.memoizedProps,i.memoizedProps)}break;case 27:En(a,n),_n(n),u&512&&(zt||i===null||Vr(i,i.return)),i!==null&&u&4&&kp(n,n.memoizedProps,i.memoizedProps);break;case 5:if(En(a,n),_n(n),u&512&&(zt||i===null||Vr(i,i.return)),n.flags&32){y=n.stateNode;try{vi(y,"")}catch(we){ot(n,n.return,we)}}u&4&&n.stateNode!=null&&(y=n.memoizedProps,kp(n,y,i!==null?i.memoizedProps:y)),u&1024&&(Pp=!0);break;case 6:if(En(a,n),_n(n),u&4){if(n.stateNode===null)throw Error(o(162));u=n.memoizedProps,i=n.stateNode;try{i.nodeValue=u}catch(we){ot(n,n.return,we)}}break;case 3:if(Jd=null,y=yr,yr=Zd(a.containerInfo),En(a,n),yr=y,_n(n),u&4&&i!==null&&i.memoizedState.isDehydrated)try{Gi(a.containerInfo)}catch(we){ot(n,n.return,we)}Pp&&(Pp=!1,x1(n));break;case 4:u=yr,yr=Zd(n.stateNode.containerInfo),En(a,n),_n(n),yr=u;break;case 12:En(a,n),_n(n);break;case 31:En(a,n),_n(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Pd(n,u)));break;case 13:En(a,n),_n(n),n.child.flags&8192&&n.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Id=Ht()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Pd(n,u)));break;case 22:y=n.memoizedState!==null;var G=i!==null&&i.memoizedState!==null,oe=Ca,ue=zt;if(Ca=oe||y,zt=ue||G,En(a,n),zt=ue,Ca=oe,_n(n),u&8192)e:for(a=n.stateNode,a._visibility=y?a._visibility&-2:a._visibility|1,y&&(i===null||G||Ca||zt||Cs(n)),i=null,a=n;;){if(a.tag===5||a.tag===26){if(i===null){G=i=a;try{if(w=G.stateNode,y)T=w.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{z=G.stateNode;var fe=G.memoizedProps.style,ie=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;z.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(we){ot(G,G.return,we)}}}else if(a.tag===6){if(i===null){G=a;try{G.stateNode.nodeValue=y?"":G.memoizedProps}catch(we){ot(G,G.return,we)}}}else if(a.tag===18){if(i===null){G=a;try{var ce=G.stateNode;y?lw(ce,!0):lw(G.stateNode,!1)}catch(we){ot(G,G.return,we)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===n)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break e;for(;a.sibling===null;){if(a.return===null||a.return===n)break e;i===a&&(i=null),a=a.return}i===a&&(i=null),a.sibling.return=a.return,a=a.sibling}u&4&&(u=n.updateQueue,u!==null&&(i=u.retryQueue,i!==null&&(u.retryQueue=null,Pd(n,i))));break;case 19:En(a,n),_n(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Pd(n,u)));break;case 30:break;case 21:break;default:En(a,n),_n(n)}}function _n(n){var a=n.flags;if(a&2){try{for(var i,u=n.return;u!==null;){if(u1(u)){i=u;break}u=u.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var y=i.stateNode,w=zp(n);Ld(n,w,y);break;case 5:var T=i.stateNode;i.flags&32&&(vi(T,""),i.flags&=-33);var z=zp(n);Ld(n,z,T);break;case 3:case 4:var G=i.stateNode.containerInfo,oe=zp(n);Lp(n,oe,G);break;default:throw Error(o(161))}}catch(ue){ot(n,n.return,ue)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function x1(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;x1(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),n=n.sibling}}function ja(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)h1(n,a.alternate,a),a=a.sibling}function Cs(n){for(n=n.child;n!==null;){var a=n;switch(a.tag){case 0:case 11:case 14:case 15:po(4,a,a.return),Cs(a);break;case 1:Vr(a,a.return);var i=a.stateNode;typeof i.componentWillUnmount=="function"&&l1(a,a.return,i),Cs(a);break;case 27:Tc(a.stateNode);case 26:case 5:Vr(a,a.return),Cs(a);break;case 22:a.memoizedState===null&&Cs(a);break;case 30:Cs(a);break;default:Cs(a)}n=n.sibling}}function Ta(n,a,i){for(i=i&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var u=a.alternate,y=n,w=a,T=w.flags;switch(w.tag){case 0:case 11:case 15:Ta(y,w,i),yc(4,w);break;case 1:if(Ta(y,w,i),u=w,y=u.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(oe){ot(u,u.return,oe)}if(u=w,y=u.updateQueue,y!==null){var z=u.stateNode;try{var G=y.shared.hiddenCallbacks;if(G!==null)for(y.shared.hiddenCallbacks=null,y=0;y<G.length;y++)Qx(G[y],z)}catch(oe){ot(u,u.return,oe)}}i&&T&64&&i1(w),xc(w,w.return);break;case 27:d1(w);case 26:case 5:Ta(y,w,i),i&&u===null&&T&4&&c1(w),xc(w,w.return);break;case 12:Ta(y,w,i);break;case 31:Ta(y,w,i),i&&T&4&&g1(y,w);break;case 13:Ta(y,w,i),i&&T&4&&v1(y,w);break;case 22:w.memoizedState===null&&Ta(y,w,i),xc(w,w.return);break;case 30:break;default:Ta(y,w,i)}a=a.sibling}}function Hp(n,a){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&oc(i))}function Ip(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&oc(n))}function xr(n,a,i,u){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)b1(n,a,i,u),a=a.sibling}function b1(n,a,i,u){var y=a.flags;switch(a.tag){case 0:case 11:case 15:xr(n,a,i,u),y&2048&&yc(9,a);break;case 1:xr(n,a,i,u);break;case 3:xr(n,a,i,u),y&2048&&(n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&oc(n)));break;case 12:if(y&2048){xr(n,a,i,u),n=a.stateNode;try{var w=a.memoizedProps,T=w.id,z=w.onPostCommit;typeof z=="function"&&z(T,a.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(G){ot(a,a.return,G)}}else xr(n,a,i,u);break;case 31:xr(n,a,i,u);break;case 13:xr(n,a,i,u);break;case 23:break;case 22:w=a.stateNode,T=a.alternate,a.memoizedState!==null?w._visibility&2?xr(n,a,i,u):bc(n,a):w._visibility&2?xr(n,a,i,u):(w._visibility|=2,Pi(n,a,i,u,(a.subtreeFlags&10256)!==0||!1)),y&2048&&Hp(T,a);break;case 24:xr(n,a,i,u),y&2048&&Ip(a.alternate,a);break;default:xr(n,a,i,u)}}function Pi(n,a,i,u,y){for(y=y&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var w=n,T=a,z=i,G=u,oe=T.flags;switch(T.tag){case 0:case 11:case 15:Pi(w,T,z,G,y),yc(8,T);break;case 23:break;case 22:var ue=T.stateNode;T.memoizedState!==null?ue._visibility&2?Pi(w,T,z,G,y):bc(w,T):(ue._visibility|=2,Pi(w,T,z,G,y)),y&&oe&2048&&Hp(T.alternate,T);break;case 24:Pi(w,T,z,G,y),y&&oe&2048&&Ip(T.alternate,T);break;default:Pi(w,T,z,G,y)}a=a.sibling}}function bc(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var i=n,u=a,y=u.flags;switch(u.tag){case 22:bc(i,u),y&2048&&Hp(u.alternate,u);break;case 24:bc(i,u),y&2048&&Ip(u.alternate,u);break;default:bc(i,u)}a=a.sibling}}var wc=8192;function Hi(n,a,i){if(n.subtreeFlags&wc)for(n=n.child;n!==null;)w1(n,a,i),n=n.sibling}function w1(n,a,i){switch(n.tag){case 26:Hi(n,a,i),n.flags&wc&&n.memoizedState!==null&&DA(i,yr,n.memoizedState,n.memoizedProps);break;case 5:Hi(n,a,i);break;case 3:case 4:var u=yr;yr=Zd(n.stateNode.containerInfo),Hi(n,a,i),yr=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=wc,wc=16777216,Hi(n,a,i),wc=u):Hi(n,a,i));break;default:Hi(n,a,i)}}function S1(n){var a=n.alternate;if(a!==null&&(n=a.child,n!==null)){a.child=null;do a=n.sibling,n.sibling=null,n=a;while(n!==null)}}function Sc(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var u=a[i];Ft=u,_1(u,n)}S1(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)E1(n),n=n.sibling}function E1(n){switch(n.tag){case 0:case 11:case 15:Sc(n),n.flags&2048&&po(9,n,n.return);break;case 3:Sc(n);break;case 12:Sc(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,Hd(n)):Sc(n);break;default:Sc(n)}}function Hd(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var u=a[i];Ft=u,_1(u,n)}S1(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:po(8,a,a.return),Hd(a);break;case 22:i=a.stateNode,i._visibility&2&&(i._visibility&=-3,Hd(a));break;default:Hd(a)}n=n.sibling}}function _1(n,a){for(;Ft!==null;){var i=Ft;switch(i.tag){case 0:case 11:case 15:po(8,i,a);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var u=i.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:oc(i.memoizedState.cache)}if(u=i.child,u!==null)u.return=i,Ft=u;else e:for(i=n;Ft!==null;){u=Ft;var y=u.sibling,w=u.return;if(m1(u),u===i){Ft=null;break e}if(y!==null){y.return=w,Ft=y;break e}Ft=w}}}var GM={getCacheForType:function(n){var a=Zt(Ot),i=a.data.get(n);return i===void 0&&(i=n(),a.data.set(n,i)),i},cacheSignal:function(){return Zt(Ot).controller.signal}},KM=typeof WeakMap=="function"?WeakMap:Map,tt=0,ut=null,$e=null,qe=0,at=0,$n=null,go=!1,Ii=!1,Bp=!1,Ra=0,St=0,vo=0,Ns=0,Up=0,Vn=0,Bi=0,Ec=null,Cn=null,$p=!1,Id=0,C1=0,Bd=1/0,Ud=null,yo=null,Bt=0,xo=null,Ui=null,Ma=0,Vp=0,qp=null,N1=null,_c=0,Fp=null;function qn(){return(tt&2)!==0&&qe!==0?qe&-qe:M.T!==null?Zp():ql()}function j1(){if(Vn===0)if((qe&536870912)===0||Ge){var n=Qa;Qa<<=1,(Qa&3932160)===0&&(Qa=262144),Vn=n}else Vn=536870912;return n=Bn.current,n!==null&&(n.flags|=32),Vn}function Nn(n,a,i){(n===ut&&(at===2||at===9)||n.cancelPendingCommit!==null)&&($i(n,0),bo(n,qe,Vn,!1)),ht(n,i),((tt&2)===0||n!==ut)&&(n===ut&&((tt&2)===0&&(Ns|=i),St===4&&bo(n,qe,Vn,!1)),qr(n))}function T1(n,a,i){if((tt&6)!==0)throw Error(o(327));var u=!i&&(a&127)===0&&(a&n.expiredLanes)===0||dt(n,a),y=u?WM(n,a):Yp(n,a,!0),w=u;do{if(y===0){Ii&&!u&&bo(n,a,0,!1);break}else{if(i=n.current.alternate,w&&!QM(i)){y=Yp(n,a,!1),w=!1;continue}if(y===2){if(w=a,n.errorRecoveryDisabledLanes&w)var T=0;else T=n.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){a=T;e:{var z=n;y=Ec;var G=z.current.memoizedState.isDehydrated;if(G&&($i(z,T).flags|=256),T=Yp(z,T,!1),T!==2){if(Bp&&!G){z.errorRecoveryDisabledLanes|=w,Ns|=w,y=4;break e}w=Cn,Cn=y,w!==null&&(Cn===null?Cn=w:Cn.push.apply(Cn,w))}y=T}if(w=!1,y!==2)continue}}if(y===1){$i(n,0),bo(n,a,0,!0);break}e:{switch(u=n,w=y,w){case 0:case 1:throw Error(o(345));case 4:if((a&4194048)!==a)break;case 6:bo(u,a,Vn,!go);break e;case 2:Cn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((a&62914560)===a&&(y=Id+300-Ht(),10<y)){if(bo(u,a,Vn,!go),De(u,0,!0)!==0)break e;Ma=a,u.timeoutHandle=ow(R1.bind(null,u,i,Cn,Ud,$p,a,Vn,Ns,Bi,go,w,"Throttled",-0,0),y);break e}R1(u,i,Cn,Ud,$p,a,Vn,Ns,Bi,go,w,null,-0,0)}}break}while(!0);qr(n)}function R1(n,a,i,u,y,w,T,z,G,oe,ue,fe,ie,ce){if(n.timeoutHandle=-1,fe=a.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pa},w1(a,w,fe);var we=(w&62914560)===w?Id-Ht():(w&4194048)===w?C1-Ht():0;if(we=kA(fe,we),we!==null){Ma=w,n.cancelPendingCommit=we(P1.bind(null,n,a,w,i,u,y,T,z,G,ue,fe,null,ie,ce)),bo(n,w,T,!oe);return}}P1(n,a,w,i,u,y,T,z,G)}function QM(n){for(var a=n;;){var i=a.tag;if((i===0||i===11||i===15)&&a.flags&16384&&(i=a.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var u=0;u<i.length;u++){var y=i[u],w=y.getSnapshot;y=y.value;try{if(!Hn(w(),y))return!1}catch{return!1}}if(i=a.child,a.subtreeFlags&16384&&i!==null)i.return=a,a=i;else{if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function bo(n,a,i,u){a&=~Up,a&=~Ns,n.suspendedLanes|=a,n.pingedLanes&=~a,u&&(n.warmLanes|=a),u=n.expirationTimes;for(var y=a;0<y;){var w=31-Vt(y),T=1<<w;u[w]=-1,y&=~T}i!==0&&da(n,i,a)}function $d(){return(tt&6)===0?(Cc(0),!1):!0}function Xp(){if($e!==null){if(at===0)var n=$e.return;else n=$e,xa=vs=null,lp(n),Oi=null,ic=0,n=$e;for(;n!==null;)s1(n.alternate,n),n=n.return;$e=null}}function $i(n,a){var i=n.timeoutHandle;i!==-1&&(n.timeoutHandle=-1,gA(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),Ma=0,Xp(),ut=n,$e=i=va(n.current,null),qe=a,at=0,$n=null,go=!1,Ii=dt(n,a),Bp=!1,Bi=Vn=Up=Ns=vo=St=0,Cn=Ec=null,$p=!1,(a&8)!==0&&(a|=a&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=a;0<u;){var y=31-Vt(u),w=1<<y;a|=n[y],u&=~w}return Ra=a,cd(),i}function M1(n,a){Pe=null,M.H=pc,a===Ai||a===vd?(a=Xx(),at=3):a===Qm?(a=Xx(),at=4):at=a===_p?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,$n=a,$e===null&&(St=1,Ad(n,er(a,n.current)))}function A1(){var n=Bn.current;return n===null?!0:(qe&4194048)===qe?ar===null:(qe&62914560)===qe||(qe&536870912)!==0?n===ar:!1}function O1(){var n=M.H;return M.H=pc,n===null?pc:n}function D1(){var n=M.A;return M.A=GM,n}function Vd(){St=4,go||(qe&4194048)!==qe&&Bn.current!==null||(Ii=!0),(vo&134217727)===0&&(Ns&134217727)===0||ut===null||bo(ut,qe,Vn,!1)}function Yp(n,a,i){var u=tt;tt|=2;var y=O1(),w=D1();(ut!==n||qe!==a)&&(Ud=null,$i(n,a)),a=!1;var T=St;e:do try{if(at!==0&&$e!==null){var z=$e,G=$n;switch(at){case 8:Xp(),T=6;break e;case 3:case 2:case 9:case 6:Bn.current===null&&(a=!0);var oe=at;if(at=0,$n=null,Vi(n,z,G,oe),i&&Ii){T=0;break e}break;default:oe=at,at=0,$n=null,Vi(n,z,G,oe)}}ZM(),T=St;break}catch(ue){M1(n,ue)}while(!0);return a&&n.shellSuspendCounter++,xa=vs=null,tt=u,M.H=y,M.A=w,$e===null&&(ut=null,qe=0,cd()),T}function ZM(){for(;$e!==null;)k1($e)}function WM(n,a){var i=tt;tt|=2;var u=O1(),y=D1();ut!==n||qe!==a?(Ud=null,Bd=Ht()+500,$i(n,a)):Ii=dt(n,a);e:do try{if(at!==0&&$e!==null){a=$e;var w=$n;t:switch(at){case 1:at=0,$n=null,Vi(n,a,w,1);break;case 2:case 9:if(qx(w)){at=0,$n=null,z1(a);break}a=function(){at!==2&&at!==9||ut!==n||(at=7),qr(n)},w.then(a,a);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:qx(w)?(at=0,$n=null,z1(a)):(at=0,$n=null,Vi(n,a,w,7));break;case 5:var T=null;switch($e.tag){case 26:T=$e.memoizedState;case 5:case 27:var z=$e;if(T?bw(T):z.stateNode.complete){at=0,$n=null;var G=z.sibling;if(G!==null)$e=G;else{var oe=z.return;oe!==null?($e=oe,qd(oe)):$e=null}break t}}at=0,$n=null,Vi(n,a,w,5);break;case 6:at=0,$n=null,Vi(n,a,w,6);break;case 8:Xp(),St=6;break e;default:throw Error(o(462))}}JM();break}catch(ue){M1(n,ue)}while(!0);return xa=vs=null,M.H=u,M.A=y,tt=i,$e!==null?0:(ut=null,qe=0,cd(),St)}function JM(){for(;$e!==null&&!Nt();)k1($e)}function k1(n){var a=a1(n.alternate,n,Ra);n.memoizedProps=n.pendingProps,a===null?qd(n):$e=a}function z1(n){var a=n,i=a.alternate;switch(a.tag){case 15:case 0:a=Wb(i,a,a.pendingProps,a.type,void 0,qe);break;case 11:a=Wb(i,a,a.pendingProps,a.type.render,a.ref,qe);break;case 5:lp(a);default:s1(i,a),a=$e=Dx(a,Ra),a=a1(i,a,Ra)}n.memoizedProps=n.pendingProps,a===null?qd(n):$e=a}function Vi(n,a,i,u){xa=vs=null,lp(a),Oi=null,ic=0;var y=a.return;try{if(UM(n,y,a,i,qe)){St=1,Ad(n,er(i,n.current)),$e=null;return}}catch(w){if(y!==null)throw $e=y,w;St=1,Ad(n,er(i,n.current)),$e=null;return}a.flags&32768?(Ge||u===1?n=!0:Ii||(qe&536870912)!==0?n=!1:(go=n=!0,(u===2||u===9||u===3||u===6)&&(u=Bn.current,u!==null&&u.tag===13&&(u.flags|=16384))),L1(a,n)):qd(a)}function qd(n){var a=n;do{if((a.flags&32768)!==0){L1(a,go);return}n=a.return;var i=qM(a.alternate,a,Ra);if(i!==null){$e=i;return}if(a=a.sibling,a!==null){$e=a;return}$e=a=n}while(a!==null);St===0&&(St=5)}function L1(n,a){do{var i=FM(n.alternate,n);if(i!==null){i.flags&=32767,$e=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!a&&(n=n.sibling,n!==null)){$e=n;return}$e=n=i}while(n!==null);St=6,$e=null}function P1(n,a,i,u,y,w,T,z,G){n.cancelPendingCommit=null;do Fd();while(Bt!==0);if((tt&6)!==0)throw Error(o(327));if(a!==null){if(a===n.current)throw Error(o(177));if(w=a.lanes|a.childLanes,w|=zm,on(n,i,w,T,z,G),n===ut&&($e=ut=null,qe=0),Ui=a,xo=n,Ma=i,Vp=w,qp=y,N1=u,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,rA(Pr,function(){return $1(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||u){u=M.T,M.T=null,y=I.p,I.p=2,T=tt,tt|=4;try{XM(n,a,i)}finally{tt=T,I.p=y,M.T=u}}Bt=1,H1(),I1(),B1()}}function H1(){if(Bt===1){Bt=0;var n=xo,a=Ui,i=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||i){i=M.T,M.T=null;var u=I.p;I.p=2;var y=tt;tt|=4;try{y1(a,n);var w=og,T=_x(n.containerInfo),z=w.focusedElem,G=w.selectionRange;if(T!==z&&z&&z.ownerDocument&&Ex(z.ownerDocument.documentElement,z)){if(G!==null&&Mm(z)){var oe=G.start,ue=G.end;if(ue===void 0&&(ue=oe),"selectionStart"in z)z.selectionStart=oe,z.selectionEnd=Math.min(ue,z.value.length);else{var fe=z.ownerDocument||document,ie=fe&&fe.defaultView||window;if(ie.getSelection){var ce=ie.getSelection(),we=z.textContent.length,Ae=Math.min(G.start,we),ct=G.end===void 0?Ae:Math.min(G.end,we);!ce.extend&&Ae>ct&&(T=ct,ct=Ae,Ae=T);var te=Sx(z,Ae),Z=Sx(z,ct);if(te&&Z&&(ce.rangeCount!==1||ce.anchorNode!==te.node||ce.anchorOffset!==te.offset||ce.focusNode!==Z.node||ce.focusOffset!==Z.offset)){var ae=fe.createRange();ae.setStart(te.node,te.offset),ce.removeAllRanges(),Ae>ct?(ce.addRange(ae),ce.extend(Z.node,Z.offset)):(ae.setEnd(Z.node,Z.offset),ce.addRange(ae))}}}}for(fe=[],ce=z;ce=ce.parentNode;)ce.nodeType===1&&fe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<fe.length;z++){var de=fe[z];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}rf=!!ag,og=ag=null}finally{tt=y,I.p=u,M.T=i}}n.current=a,Bt=2}}function I1(){if(Bt===2){Bt=0;var n=xo,a=Ui,i=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||i){i=M.T,M.T=null;var u=I.p;I.p=2;var y=tt;tt|=4;try{h1(n,a.alternate,a)}finally{tt=y,I.p=u,M.T=i}}Bt=3}}function B1(){if(Bt===4||Bt===3){Bt=0,vn();var n=xo,a=Ui,i=Ma,u=N1;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Bt=5:(Bt=0,Ui=xo=null,U1(n,n.pendingLanes));var y=n.pendingLanes;if(y===0&&(yo=null),Pn(i),a=a.stateNode,Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(ca,a,void 0,(a.current.flags&128)===128)}catch{}if(u!==null){a=M.T,y=I.p,I.p=2,M.T=null;try{for(var w=n.onRecoverableError,T=0;T<u.length;T++){var z=u[T];w(z.value,{componentStack:z.stack})}}finally{M.T=a,I.p=y}}(Ma&3)!==0&&Fd(),qr(n),y=n.pendingLanes,(i&261930)!==0&&(y&42)!==0?n===Fp?_c++:(_c=0,Fp=n):_c=0,Cc(0)}}function U1(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,oc(a)))}function Fd(){return H1(),I1(),B1(),$1()}function $1(){if(Bt!==5)return!1;var n=xo,a=Vp;Vp=0;var i=Pn(Ma),u=M.T,y=I.p;try{I.p=32>i?32:i,M.T=null,i=qp,qp=null;var w=xo,T=Ma;if(Bt=0,Ui=xo=null,Ma=0,(tt&6)!==0)throw Error(o(331));var z=tt;if(tt|=4,E1(w.current),b1(w,w.current,T,i),tt=z,Cc(0,!1),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(ca,w)}catch{}return!0}finally{I.p=y,M.T=u,U1(n,a)}}function V1(n,a,i){a=er(i,a),a=Ep(n.stateNode,a,2),n=fo(n,a,2),n!==null&&(ht(n,2),qr(n))}function ot(n,a,i){if(n.tag===3)V1(n,n,i);else for(;a!==null;){if(a.tag===3){V1(a,n,i);break}else if(a.tag===1){var u=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(yo===null||!yo.has(u))){n=er(i,n),i=qb(2),u=fo(a,i,2),u!==null&&(Fb(i,u,a,n),ht(u,2),qr(u));break}}a=a.return}}function Gp(n,a,i){var u=n.pingCache;if(u===null){u=n.pingCache=new KM;var y=new Set;u.set(a,y)}else y=u.get(a),y===void 0&&(y=new Set,u.set(a,y));y.has(i)||(Bp=!0,y.add(i),n=eA.bind(null,n,a,i),a.then(n,n))}function eA(n,a,i){var u=n.pingCache;u!==null&&u.delete(a),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,ut===n&&(qe&i)===i&&(St===4||St===3&&(qe&62914560)===qe&&300>Ht()-Id?(tt&2)===0&&$i(n,0):Up|=i,Bi===qe&&(Bi=0)),qr(n)}function q1(n,a){a===0&&(a=qt()),n=ms(n,a),n!==null&&(ht(n,a),qr(n))}function tA(n){var a=n.memoizedState,i=0;a!==null&&(i=a.retryLane),q1(n,i)}function nA(n,a){var i=0;switch(n.tag){case 31:case 13:var u=n.stateNode,y=n.memoizedState;y!==null&&(i=y.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(o(314))}u!==null&&u.delete(a),q1(n,i)}function rA(n,a){return kn(n,a)}var Xd=null,qi=null,Kp=!1,Yd=!1,Qp=!1,wo=0;function qr(n){n!==qi&&n.next===null&&(qi===null?Xd=qi=n:qi=qi.next=n),Yd=!0,Kp||(Kp=!0,oA())}function Cc(n,a){if(!Qp&&Yd){Qp=!0;do for(var i=!1,u=Xd;u!==null;){if(n!==0){var y=u.pendingLanes;if(y===0)var w=0;else{var T=u.suspendedLanes,z=u.pingedLanes;w=(1<<31-Vt(42|n)+1)-1,w&=y&~(T&~z),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(i=!0,G1(u,w))}else w=qe,w=De(u,u===ut?w:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(w&3)===0||dt(u,w)||(i=!0,G1(u,w));u=u.next}while(i);Qp=!1}}function aA(){F1()}function F1(){Yd=Kp=!1;var n=0;wo!==0&&pA()&&(n=wo);for(var a=Ht(),i=null,u=Xd;u!==null;){var y=u.next,w=X1(u,a);w===0?(u.next=null,i===null?Xd=y:i.next=y,y===null&&(qi=i)):(i=u,(n!==0||(w&3)!==0)&&(Yd=!0)),u=y}Bt!==0&&Bt!==5||Cc(n),wo!==0&&(wo=0)}function X1(n,a){for(var i=n.suspendedLanes,u=n.pingedLanes,y=n.expirationTimes,w=n.pendingLanes&-62914561;0<w;){var T=31-Vt(w),z=1<<T,G=y[T];G===-1?((z&i)===0||(z&u)!==0)&&(y[T]=Mt(z,a)):G<=a&&(n.expiredLanes|=z),w&=~z}if(a=ut,i=qe,i=De(n,n===a?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,i===0||n===a&&(at===2||at===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&pr(u),n.callbackNode=null,n.callbackPriority=0;if((i&3)===0||dt(n,i)){if(a=i&-i,a===n.callbackPriority)return a;switch(u!==null&&pr(u),Pn(i)){case 2:case 8:i=Lr;break;case 32:i=Pr;break;case 268435456:i=zn;break;default:i=Pr}return u=Y1.bind(null,n),i=kn(i,u),n.callbackPriority=a,n.callbackNode=i,a}return u!==null&&u!==null&&pr(u),n.callbackPriority=2,n.callbackNode=null,2}function Y1(n,a){if(Bt!==0&&Bt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if(Fd()&&n.callbackNode!==i)return null;var u=qe;return u=De(n,n===ut?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(T1(n,u,a),X1(n,Ht()),n.callbackNode!=null&&n.callbackNode===i?Y1.bind(null,n):null)}function G1(n,a){if(Fd())return null;T1(n,a,!0)}function oA(){vA(function(){(tt&6)!==0?kn(yn,aA):F1()})}function Zp(){if(wo===0){var n=Ri;n===0&&(n=Ka,Ka<<=1,(Ka&261888)===0&&(Ka=256)),wo=n}return wo}function K1(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:td(""+n)}function Q1(n,a){var i=a.ownerDocument.createElement("input");return i.name=a.name,i.value=a.value,n.id&&i.setAttribute("form",n.id),a.parentNode.insertBefore(i,a),n=new FormData(n),i.parentNode.removeChild(i),n}function sA(n,a,i,u,y){if(a==="submit"&&i&&i.stateNode===y){var w=K1((y[cn]||null).action),T=u.submitter;T&&(a=(a=T[cn]||null)?K1(a.formAction):T.getAttribute("formAction"),a!==null&&(w=a,T=null));var z=new od("action","action",null,u,y);n.push({event:z,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(wo!==0){var G=T?Q1(y,T):new FormData(y);vp(i,{pending:!0,data:G,method:y.method,action:w},null,G)}}else typeof w=="function"&&(z.preventDefault(),G=T?Q1(y,T):new FormData(y),vp(i,{pending:!0,data:G,method:y.method,action:w},w,G))},currentTarget:y}]})}}for(var Wp=0;Wp<km.length;Wp++){var Jp=km[Wp],iA=Jp.toLowerCase(),lA=Jp[0].toUpperCase()+Jp.slice(1);vr(iA,"on"+lA)}vr(jx,"onAnimationEnd"),vr(Tx,"onAnimationIteration"),vr(Rx,"onAnimationStart"),vr("dblclick","onDoubleClick"),vr("focusin","onFocus"),vr("focusout","onBlur"),vr(_M,"onTransitionRun"),vr(CM,"onTransitionStart"),vr(NM,"onTransitionCancel"),vr(Mx,"onTransitionEnd"),no("onMouseEnter",["mouseout","mouseover"]),no("onMouseLeave",["mouseout","mouseover"]),no("onPointerEnter",["pointerout","pointerover"]),no("onPointerLeave",["pointerout","pointerover"]),ha("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ha("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ha("onBeforeInput",["compositionend","keypress","textInput","paste"]),ha("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ha("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ha("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nc="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(" "),cA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nc));function Z1(n,a){a=(a&4)!==0;for(var i=0;i<n.length;i++){var u=n[i],y=u.event;u=u.listeners;e:{var w=void 0;if(a)for(var T=u.length-1;0<=T;T--){var z=u[T],G=z.instance,oe=z.currentTarget;if(z=z.listener,G!==w&&y.isPropagationStopped())break e;w=z,y.currentTarget=oe;try{w(y)}catch(ue){ld(ue)}y.currentTarget=null,w=G}else for(T=0;T<u.length;T++){if(z=u[T],G=z.instance,oe=z.currentTarget,z=z.listener,G!==w&&y.isPropagationStopped())break e;w=z,y.currentTarget=oe;try{w(y)}catch(ue){ld(ue)}y.currentTarget=null,w=G}}}}function Ve(n,a){var i=a[mi];i===void 0&&(i=a[mi]=new Set);var u=n+"__bubble";i.has(u)||(W1(a,n,2,!1),i.add(u))}function eg(n,a,i){var u=0;a&&(u|=4),W1(i,n,u,a)}var Gd="_reactListening"+Math.random().toString(36).slice(2);function tg(n){if(!n[Gd]){n[Gd]=!0,Ku.forEach(function(i){i!=="selectionchange"&&(cA.has(i)||eg(i,!1,n),eg(i,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[Gd]||(a[Gd]=!0,eg("selectionchange",!1,a))}}function W1(n,a,i,u){switch(jw(a)){case 2:var y=PA;break;case 8:y=HA;break;default:y=gg}i=y.bind(null,a,i,n),y=void 0,!wm||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(y=!0),u?y!==void 0?n.addEventListener(a,i,{capture:!0,passive:y}):n.addEventListener(a,i,!0):y!==void 0?n.addEventListener(a,i,{passive:y}):n.addEventListener(a,i,!1)}function ng(n,a,i,u,y){var w=u;if((a&1)===0&&(a&2)===0&&u!==null)e:for(;;){if(u===null)return;var T=u.tag;if(T===3||T===4){var z=u.stateNode.containerInfo;if(z===y)break;if(T===4)for(T=u.return;T!==null;){var G=T.tag;if((G===3||G===4)&&T.stateNode.containerInfo===y)return;T=T.return}for(;z!==null;){if(T=Wa(z),T===null)return;if(G=T.tag,G===5||G===6||G===26||G===27){u=w=T;continue e}z=z.parentNode}}u=u.return}rx(function(){var oe=w,ue=xm(i),fe=[];e:{var ie=Ax.get(n);if(ie!==void 0){var ce=od,we=n;switch(n){case"keypress":if(rd(i)===0)break e;case"keydown":case"keyup":ce=nM;break;case"focusin":we="focus",ce=Cm;break;case"focusout":we="blur",ce=Cm;break;case"beforeblur":case"afterblur":ce=Cm;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=sx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=qR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=oM;break;case jx:case Tx:case Rx:ce=YR;break;case Mx:ce=iM;break;case"scroll":case"scrollend":ce=$R;break;case"wheel":ce=cM;break;case"copy":case"cut":case"paste":ce=KR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=lx;break;case"toggle":case"beforetoggle":ce=dM}var Ae=(a&4)!==0,ct=!Ae&&(n==="scroll"||n==="scrollend"),te=Ae?ie!==null?ie+"Capture":null:ie;Ae=[];for(var Z=oe,ae;Z!==null;){var de=Z;if(ae=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ae===null||te===null||(de=Gl(Z,te),de!=null&&Ae.push(jc(Z,de,ae))),ct)break;Z=Z.return}0<Ae.length&&(ie=new ce(ie,we,null,i,ue),fe.push({event:ie,listeners:Ae}))}}if((a&7)===0){e:{if(ie=n==="mouseover"||n==="pointerover",ce=n==="mouseout"||n==="pointerout",ie&&i!==ym&&(we=i.relatedTarget||i.fromElement)&&(Wa(we)||we[fa]))break e;if((ce||ie)&&(ie=ue.window===ue?ue:(ie=ue.ownerDocument)?ie.defaultView||ie.parentWindow:window,ce?(we=i.relatedTarget||i.toElement,ce=oe,we=we?Wa(we):null,we!==null&&(ct=l(we),Ae=we.tag,we!==ct||Ae!==5&&Ae!==27&&Ae!==6)&&(we=null)):(ce=null,we=oe),ce!==we)){if(Ae=sx,de="onMouseLeave",te="onMouseEnter",Z="mouse",(n==="pointerout"||n==="pointerover")&&(Ae=lx,de="onPointerLeave",te="onPointerEnter",Z="pointer"),ct=ce==null?ie:eo(ce),ae=we==null?ie:eo(we),ie=new Ae(de,Z+"leave",ce,i,ue),ie.target=ct,ie.relatedTarget=ae,de=null,Wa(ue)===oe&&(Ae=new Ae(te,Z+"enter",we,i,ue),Ae.target=ae,Ae.relatedTarget=ct,de=Ae),ct=de,ce&&we)t:{for(Ae=uA,te=ce,Z=we,ae=0,de=te;de;de=Ae(de))ae++;de=0;for(var Re=Z;Re;Re=Ae(Re))de++;for(;0<ae-de;)te=Ae(te),ae--;for(;0<de-ae;)Z=Ae(Z),de--;for(;ae--;){if(te===Z||Z!==null&&te===Z.alternate){Ae=te;break t}te=Ae(te),Z=Ae(Z)}Ae=null}else Ae=null;ce!==null&&J1(fe,ie,ce,Ae,!1),we!==null&&ct!==null&&J1(fe,ct,we,Ae,!0)}}e:{if(ie=oe?eo(oe):window,ce=ie.nodeName&&ie.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ie.type==="file")var Je=gx;else if(mx(ie))if(vx)Je=wM;else{Je=xM;var Ce=yM}else ce=ie.nodeName,!ce||ce.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?oe&&vm(oe.elementType)&&(Je=gx):Je=bM;if(Je&&(Je=Je(n,oe))){px(fe,Je,i,ue);break e}Ce&&Ce(n,ie,oe),n==="focusout"&&oe&&ie.type==="number"&&oe.memoizedProps.value!=null&&Yl(ie,"number",ie.value)}switch(Ce=oe?eo(oe):window,n){case"focusin":(mx(Ce)||Ce.contentEditable==="true")&&(wi=Ce,Am=oe,nc=null);break;case"focusout":nc=Am=wi=null;break;case"mousedown":Om=!0;break;case"contextmenu":case"mouseup":case"dragend":Om=!1,Cx(fe,i,ue);break;case"selectionchange":if(EM)break;case"keydown":case"keyup":Cx(fe,i,ue)}var Ie;if(jm)e:{switch(n){case"compositionstart":var Fe="onCompositionStart";break e;case"compositionend":Fe="onCompositionEnd";break e;case"compositionupdate":Fe="onCompositionUpdate";break e}Fe=void 0}else bi?fx(n,i)&&(Fe="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(Fe="onCompositionStart");Fe&&(cx&&i.locale!=="ko"&&(bi||Fe!=="onCompositionStart"?Fe==="onCompositionEnd"&&bi&&(Ie=ax()):(ao=ue,Sm="value"in ao?ao.value:ao.textContent,bi=!0)),Ce=Kd(oe,Fe),0<Ce.length&&(Fe=new ix(Fe,n,null,i,ue),fe.push({event:Fe,listeners:Ce}),Ie?Fe.data=Ie:(Ie=hx(i),Ie!==null&&(Fe.data=Ie)))),(Ie=hM?mM(n,i):pM(n,i))&&(Fe=Kd(oe,"onBeforeInput"),0<Fe.length&&(Ce=new ix("onBeforeInput","beforeinput",null,i,ue),fe.push({event:Ce,listeners:Fe}),Ce.data=Ie)),sA(fe,n,oe,i,ue)}Z1(fe,a)})}function jc(n,a,i){return{instance:n,listener:a,currentTarget:i}}function Kd(n,a){for(var i=a+"Capture",u=[];n!==null;){var y=n,w=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||w===null||(y=Gl(n,i),y!=null&&u.unshift(jc(n,y,w)),y=Gl(n,a),y!=null&&u.push(jc(n,y,w))),n.tag===3)return u;n=n.return}return[]}function uA(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function J1(n,a,i,u,y){for(var w=a._reactName,T=[];i!==null&&i!==u;){var z=i,G=z.alternate,oe=z.stateNode;if(z=z.tag,G!==null&&G===u)break;z!==5&&z!==26&&z!==27||oe===null||(G=oe,y?(oe=Gl(i,w),oe!=null&&T.unshift(jc(i,oe,G))):y||(oe=Gl(i,w),oe!=null&&T.push(jc(i,oe,G)))),i=i.return}T.length!==0&&n.push({event:a,listeners:T})}var dA=/\r\n?/g,fA=/\u0000|\uFFFD/g;function ew(n){return(typeof n=="string"?n:""+n).replace(dA,`
`).replace(fA,"")}function tw(n,a){return a=ew(a),ew(n)===a}function lt(n,a,i,u,y,w){switch(i){case"children":typeof u=="string"?a==="body"||a==="textarea"&&u===""||vi(n,u):(typeof u=="number"||typeof u=="bigint")&&a!=="body"&&vi(n,""+u);break;case"className":gi(n,"class",u);break;case"tabIndex":gi(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":gi(n,i,u);break;case"style":tx(n,u,w);break;case"data":if(a!=="object"){gi(n,"data",u);break}case"src":case"href":if(u===""&&(a!=="a"||i!=="href")){n.removeAttribute(i);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(i);break}u=td(""+u),n.setAttribute(i,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(i==="formAction"?(a!=="input"&&lt(n,a,"name",y.name,y,null),lt(n,a,"formEncType",y.formEncType,y,null),lt(n,a,"formMethod",y.formMethod,y,null),lt(n,a,"formTarget",y.formTarget,y,null)):(lt(n,a,"encType",y.encType,y,null),lt(n,a,"method",y.method,y,null),lt(n,a,"target",y.target,y,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(i);break}u=td(""+u),n.setAttribute(i,u);break;case"onClick":u!=null&&(n.onclick=pa);break;case"onScroll":u!=null&&Ve("scroll",n);break;case"onScrollEnd":u!=null&&Ve("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(y.children!=null)throw Error(o(60));n.innerHTML=i}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}i=td(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(i,""+u):n.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":u===!0?n.setAttribute(i,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(i,u):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(i,u):n.removeAttribute(i);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(i):n.setAttribute(i,u);break;case"popover":Ve("beforetoggle",n),Ve("toggle",n),pi(n,"popover",u);break;case"xlinkActuate":gr(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":gr(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":gr(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":gr(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":gr(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":gr(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":gr(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":gr(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":gr(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":pi(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=BR.get(i)||i,pi(n,i,u))}}function rg(n,a,i,u,y,w){switch(i){case"style":tx(n,u,w);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(y.children!=null)throw Error(o(60));n.innerHTML=i}}break;case"children":typeof u=="string"?vi(n,u):(typeof u=="number"||typeof u=="bigint")&&vi(n,""+u);break;case"onScroll":u!=null&&Ve("scroll",n);break;case"onScrollEnd":u!=null&&Ve("scrollend",n);break;case"onClick":u!=null&&(n.onclick=pa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qu.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(y=i.endsWith("Capture"),a=i.slice(2,y?i.length-7:void 0),w=n[cn]||null,w=w!=null?w[i]:null,typeof w=="function"&&n.removeEventListener(a,w,y),typeof u=="function")){typeof w!="function"&&w!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(a,u,y);break e}i in n?n[i]=u:u===!0?n.setAttribute(i,""):pi(n,i,u)}}}function Jt(n,a,i){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",n),Ve("load",n);var u=!1,y=!1,w;for(w in i)if(i.hasOwnProperty(w)){var T=i[w];if(T!=null)switch(w){case"src":u=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:lt(n,a,w,T,i,null)}}y&&lt(n,a,"srcSet",i.srcSet,i,null),u&&lt(n,a,"src",i.src,i,null);return;case"input":Ve("invalid",n);var z=w=T=y=null,G=null,oe=null;for(u in i)if(i.hasOwnProperty(u)){var ue=i[u];if(ue!=null)switch(u){case"name":y=ue;break;case"type":T=ue;break;case"checked":G=ue;break;case"defaultChecked":oe=ue;break;case"value":w=ue;break;case"defaultValue":z=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(o(137,a));break;default:lt(n,a,u,ue,i,null)}}ed(n,w,z,G,oe,T,y,!1);return;case"select":Ve("invalid",n),u=T=w=null;for(y in i)if(i.hasOwnProperty(y)&&(z=i[y],z!=null))switch(y){case"value":w=z;break;case"defaultValue":T=z;break;case"multiple":u=z;default:lt(n,a,y,z,i,null)}a=w,i=T,n.multiple=!!u,a!=null?ma(n,!!u,a,!1):i!=null&&ma(n,!!u,i,!0);return;case"textarea":Ve("invalid",n),w=y=u=null;for(T in i)if(i.hasOwnProperty(T)&&(z=i[T],z!=null))switch(T){case"value":u=z;break;case"defaultValue":y=z;break;case"children":w=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(91));break;default:lt(n,a,T,z,i,null)}J0(n,u,y,w);return;case"option":for(G in i)if(i.hasOwnProperty(G)&&(u=i[G],u!=null))switch(G){case"selected":n.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:lt(n,a,G,u,i,null)}return;case"dialog":Ve("beforetoggle",n),Ve("toggle",n),Ve("cancel",n),Ve("close",n);break;case"iframe":case"object":Ve("load",n);break;case"video":case"audio":for(u=0;u<Nc.length;u++)Ve(Nc[u],n);break;case"image":Ve("error",n),Ve("load",n);break;case"details":Ve("toggle",n);break;case"embed":case"source":case"link":Ve("error",n),Ve("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(oe in i)if(i.hasOwnProperty(oe)&&(u=i[oe],u!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:lt(n,a,oe,u,i,null)}return;default:if(vm(a)){for(ue in i)i.hasOwnProperty(ue)&&(u=i[ue],u!==void 0&&rg(n,a,ue,u,i,void 0));return}}for(z in i)i.hasOwnProperty(z)&&(u=i[z],u!=null&&lt(n,a,z,u,i,null))}function hA(n,a,i,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,w=null,T=null,z=null,G=null,oe=null,ue=null;for(ce in i){var fe=i[ce];if(i.hasOwnProperty(ce)&&fe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":G=fe;default:u.hasOwnProperty(ce)||lt(n,a,ce,null,u,fe)}}for(var ie in u){var ce=u[ie];if(fe=i[ie],u.hasOwnProperty(ie)&&(ce!=null||fe!=null))switch(ie){case"type":w=ce;break;case"name":y=ce;break;case"checked":oe=ce;break;case"defaultChecked":ue=ce;break;case"value":T=ce;break;case"defaultValue":z=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(o(137,a));break;default:ce!==fe&&lt(n,a,ie,ce,u,fe)}}us(n,T,z,G,oe,ue,w,y);return;case"select":ce=T=z=ie=null;for(w in i)if(G=i[w],i.hasOwnProperty(w)&&G!=null)switch(w){case"value":break;case"multiple":ce=G;default:u.hasOwnProperty(w)||lt(n,a,w,null,u,G)}for(y in u)if(w=u[y],G=i[y],u.hasOwnProperty(y)&&(w!=null||G!=null))switch(y){case"value":ie=w;break;case"defaultValue":z=w;break;case"multiple":T=w;default:w!==G&&lt(n,a,y,w,u,G)}a=z,i=T,u=ce,ie!=null?ma(n,!!i,ie,!1):!!u!=!!i&&(a!=null?ma(n,!!i,a,!0):ma(n,!!i,i?[]:"",!1));return;case"textarea":ce=ie=null;for(z in i)if(y=i[z],i.hasOwnProperty(z)&&y!=null&&!u.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:lt(n,a,z,null,u,y)}for(T in u)if(y=u[T],w=i[T],u.hasOwnProperty(T)&&(y!=null||w!=null))switch(T){case"value":ie=y;break;case"defaultValue":ce=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(o(91));break;default:y!==w&&lt(n,a,T,y,u,w)}W0(n,ie,ce);return;case"option":for(var we in i)if(ie=i[we],i.hasOwnProperty(we)&&ie!=null&&!u.hasOwnProperty(we))switch(we){case"selected":n.selected=!1;break;default:lt(n,a,we,null,u,ie)}for(G in u)if(ie=u[G],ce=i[G],u.hasOwnProperty(G)&&ie!==ce&&(ie!=null||ce!=null))switch(G){case"selected":n.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:lt(n,a,G,ie,u,ce)}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 Ae in i)ie=i[Ae],i.hasOwnProperty(Ae)&&ie!=null&&!u.hasOwnProperty(Ae)&&lt(n,a,Ae,null,u,ie);for(oe in u)if(ie=u[oe],ce=i[oe],u.hasOwnProperty(oe)&&ie!==ce&&(ie!=null||ce!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(o(137,a));break;default:lt(n,a,oe,ie,u,ce)}return;default:if(vm(a)){for(var ct in i)ie=i[ct],i.hasOwnProperty(ct)&&ie!==void 0&&!u.hasOwnProperty(ct)&&rg(n,a,ct,void 0,u,ie);for(ue in u)ie=u[ue],ce=i[ue],!u.hasOwnProperty(ue)||ie===ce||ie===void 0&&ce===void 0||rg(n,a,ue,ie,u,ce);return}}for(var te in i)ie=i[te],i.hasOwnProperty(te)&&ie!=null&&!u.hasOwnProperty(te)&&lt(n,a,te,null,u,ie);for(fe in u)ie=u[fe],ce=i[fe],!u.hasOwnProperty(fe)||ie===ce||ie==null&&ce==null||lt(n,a,fe,ie,u,ce)}function nw(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mA(){if(typeof performance.getEntriesByType=="function"){for(var n=0,a=0,i=performance.getEntriesByType("resource"),u=0;u<i.length;u++){var y=i[u],w=y.transferSize,T=y.initiatorType,z=y.duration;if(w&&z&&nw(T)){for(T=0,z=y.responseEnd,u+=1;u<i.length;u++){var G=i[u],oe=G.startTime;if(oe>z)break;var ue=G.transferSize,fe=G.initiatorType;ue&&nw(fe)&&(G=G.responseEnd,T+=ue*(G<z?1:(z-oe)/(G-oe)))}if(--u,a+=8*(w+T)/(y.duration/1e3),n++,10<n)break}}if(0<n)return a/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var ag=null,og=null;function Qd(n){return n.nodeType===9?n:n.ownerDocument}function rw(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 aw(n,a){if(n===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&a==="foreignObject"?0:n}function sg(n,a){return n==="textarea"||n==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var ig=null;function pA(){var n=window.event;return n&&n.type==="popstate"?n===ig?!1:(ig=n,!0):(ig=null,!1)}var ow=typeof setTimeout=="function"?setTimeout:void 0,gA=typeof clearTimeout=="function"?clearTimeout:void 0,sw=typeof Promise=="function"?Promise:void 0,vA=typeof queueMicrotask=="function"?queueMicrotask:typeof sw<"u"?function(n){return sw.resolve(null).then(n).catch(yA)}:ow;function yA(n){setTimeout(function(){throw n})}function So(n){return n==="head"}function iw(n,a){var i=a,u=0;do{var y=i.nextSibling;if(n.removeChild(i),y&&y.nodeType===8)if(i=y.data,i==="/$"||i==="/&"){if(u===0){n.removeChild(y),Gi(a);return}u--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")u++;else if(i==="html")Tc(n.ownerDocument.documentElement);else if(i==="head"){i=n.ownerDocument.head,Tc(i);for(var w=i.firstChild;w;){var T=w.nextSibling,z=w.nodeName;w[ls]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&w.rel.toLowerCase()==="stylesheet"||i.removeChild(w),w=T}}else i==="body"&&Tc(n.ownerDocument.body);i=y}while(i);Gi(a)}function lw(n,a){var i=n;n=0;do{var u=i.nextSibling;if(i.nodeType===1?a?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(a?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),u&&u.nodeType===8)if(i=u.data,i==="/$"){if(n===0)break;n--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||n++;i=u}while(i)}function lg(n){var a=n.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var i=a;switch(a=a.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":lg(i),Fl(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function xA(n,a,i,u){for(;n.nodeType===1;){var y=i;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[ls])switch(a){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(w=n.getAttribute("rel"),w==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(w!==y.rel||n.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||n.getAttribute("title")!==(y.title==null?null:y.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(w=n.getAttribute("src"),(w!==(y.src==null?null:y.src)||n.getAttribute("type")!==(y.type==null?null:y.type)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&w&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var w=y.name==null?null:""+y.name;if(y.type==="hidden"&&n.getAttribute("name")===w)return n}else return n;if(n=or(n.nextSibling),n===null)break}return null}function bA(n,a,i){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=or(n.nextSibling),n===null))return null;return n}function cw(n,a){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=or(n.nextSibling),n===null))return null;return n}function cg(n){return n.data==="$?"||n.data==="$~"}function ug(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function wA(n,a){var i=n.ownerDocument;if(n.data==="$~")n._reactRetry=a;else if(n.data!=="$?"||i.readyState!=="loading")a();else{var u=function(){a(),i.removeEventListener("DOMContentLoaded",u)};i.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function or(n){for(;n!=null;n=n.nextSibling){var a=n.nodeType;if(a===1||a===3)break;if(a===8){if(a=n.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return n}var dg=null;function uw(n){n=n.nextSibling;for(var a=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"||i==="/&"){if(a===0)return or(n.nextSibling);a--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||a++}n=n.nextSibling}return null}function dw(n){n=n.previousSibling;for(var a=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(a===0)return n;a--}else i!=="/$"&&i!=="/&"||a++}n=n.previousSibling}return null}function fw(n,a,i){switch(a=Qd(i),n){case"html":if(n=a.documentElement,!n)throw Error(o(452));return n;case"head":if(n=a.head,!n)throw Error(o(453));return n;case"body":if(n=a.body,!n)throw Error(o(454));return n;default:throw Error(o(451))}}function Tc(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);Fl(n)}var sr=new Map,hw=new Set;function Zd(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Aa=I.d;I.d={f:SA,r:EA,D:_A,C:CA,L:NA,m:jA,X:RA,S:TA,M:MA};function SA(){var n=Aa.f(),a=$d();return n||a}function EA(n){var a=Ja(n);a!==null&&a.tag===5&&a.type==="form"?Mb(a):Aa.r(n)}var Fi=typeof document>"u"?null:document;function mw(n,a,i){var u=Fi;if(u&&typeof a=="string"&&a){var y=bn(a);y='link[rel="'+n+'"][href="'+y+'"]',typeof i=="string"&&(y+='[crossorigin="'+i+'"]'),hw.has(y)||(hw.add(y),n={rel:n,crossOrigin:i,href:a},u.querySelector(y)===null&&(a=u.createElement("link"),Jt(a,"link",n),At(a),u.head.appendChild(a)))}}function _A(n){Aa.D(n),mw("dns-prefetch",n,null)}function CA(n,a){Aa.C(n,a),mw("preconnect",n,a)}function NA(n,a,i){Aa.L(n,a,i);var u=Fi;if(u&&n&&a){var y='link[rel="preload"][as="'+bn(a)+'"]';a==="image"&&i&&i.imageSrcSet?(y+='[imagesrcset="'+bn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(y+='[imagesizes="'+bn(i.imageSizes)+'"]')):y+='[href="'+bn(n)+'"]';var w=y;switch(a){case"style":w=Xi(n);break;case"script":w=Yi(n)}sr.has(w)||(n=p({rel:"preload",href:a==="image"&&i&&i.imageSrcSet?void 0:n,as:a},i),sr.set(w,n),u.querySelector(y)!==null||a==="style"&&u.querySelector(Rc(w))||a==="script"&&u.querySelector(Mc(w))||(a=u.createElement("link"),Jt(a,"link",n),At(a),u.head.appendChild(a)))}}function jA(n,a){Aa.m(n,a);var i=Fi;if(i&&n){var u=a&&typeof a.as=="string"?a.as:"script",y='link[rel="modulepreload"][as="'+bn(u)+'"][href="'+bn(n)+'"]',w=y;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Yi(n)}if(!sr.has(w)&&(n=p({rel:"modulepreload",href:n},a),sr.set(w,n),i.querySelector(y)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Mc(w)))return}u=i.createElement("link"),Jt(u,"link",n),At(u),i.head.appendChild(u)}}}function TA(n,a,i){Aa.S(n,a,i);var u=Fi;if(u&&n){var y=to(u).hoistableStyles,w=Xi(n);a=a||"default";var T=y.get(w);if(!T){var z={loading:0,preload:null};if(T=u.querySelector(Rc(w)))z.loading=5;else{n=p({rel:"stylesheet",href:n,"data-precedence":a},i),(i=sr.get(w))&&fg(n,i);var G=T=u.createElement("link");At(G),Jt(G,"link",n),G._p=new Promise(function(oe,ue){G.onload=oe,G.onerror=ue}),G.addEventListener("load",function(){z.loading|=1}),G.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Wd(T,a,u)}T={type:"stylesheet",instance:T,count:1,state:z},y.set(w,T)}}}function RA(n,a){Aa.X(n,a);var i=Fi;if(i&&n){var u=to(i).hoistableScripts,y=Yi(n),w=u.get(y);w||(w=i.querySelector(Mc(y)),w||(n=p({src:n,async:!0},a),(a=sr.get(y))&&hg(n,a),w=i.createElement("script"),At(w),Jt(w,"link",n),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},u.set(y,w))}}function MA(n,a){Aa.M(n,a);var i=Fi;if(i&&n){var u=to(i).hoistableScripts,y=Yi(n),w=u.get(y);w||(w=i.querySelector(Mc(y)),w||(n=p({src:n,async:!0,type:"module"},a),(a=sr.get(y))&&hg(n,a),w=i.createElement("script"),At(w),Jt(w,"link",n),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},u.set(y,w))}}function pw(n,a,i,u){var y=(y=se.current)?Zd(y):null;if(!y)throw Error(o(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(a=Xi(i.href),i=to(y).hoistableStyles,u=i.get(a),u||(u={type:"style",instance:null,count:0,state:null},i.set(a,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=Xi(i.href);var w=to(y).hoistableStyles,T=w.get(n);if(T||(y=y.ownerDocument||y,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(n,T),(w=y.querySelector(Rc(n)))&&!w._p&&(T.instance=w,T.state.loading=5),sr.has(n)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},sr.set(n,i),w||AA(y,n,i,T.state))),a&&u===null)throw Error(o(528,""));return T}if(a&&u!==null)throw Error(o(529,""));return null;case"script":return a=i.async,i=i.src,typeof i=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Yi(i),i=to(y).hoistableScripts,u=i.get(a),u||(u={type:"script",instance:null,count:0,state:null},i.set(a,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,n))}}function Xi(n){return'href="'+bn(n)+'"'}function Rc(n){return'link[rel="stylesheet"]['+n+"]"}function gw(n){return p({},n,{"data-precedence":n.precedence,precedence:null})}function AA(n,a,i,u){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?u.loading=1:(a=n.createElement("link"),u.preload=a,a.addEventListener("load",function(){return u.loading|=1}),a.addEventListener("error",function(){return u.loading|=2}),Jt(a,"link",i),At(a),n.head.appendChild(a))}function Yi(n){return'[src="'+bn(n)+'"]'}function Mc(n){return"script[async]"+n}function vw(n,a,i){if(a.count++,a.instance===null)switch(a.type){case"style":var u=n.querySelector('style[data-href~="'+bn(i.href)+'"]');if(u)return a.instance=u,At(u),u;var y=p({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),At(u),Jt(u,"style",y),Wd(u,i.precedence,n),a.instance=u;case"stylesheet":y=Xi(i.href);var w=n.querySelector(Rc(y));if(w)return a.state.loading|=4,a.instance=w,At(w),w;u=gw(i),(y=sr.get(y))&&fg(u,y),w=(n.ownerDocument||n).createElement("link"),At(w);var T=w;return T._p=new Promise(function(z,G){T.onload=z,T.onerror=G}),Jt(w,"link",u),a.state.loading|=4,Wd(w,i.precedence,n),a.instance=w;case"script":return w=Yi(i.src),(y=n.querySelector(Mc(w)))?(a.instance=y,At(y),y):(u=i,(y=sr.get(w))&&(u=p({},i),hg(u,y)),n=n.ownerDocument||n,y=n.createElement("script"),At(y),Jt(y,"link",u),n.head.appendChild(y),a.instance=y);case"void":return null;default:throw Error(o(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(u=a.instance,a.state.loading|=4,Wd(u,i.precedence,n));return a.instance}function Wd(n,a,i){for(var u=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=u.length?u[u.length-1]:null,w=y,T=0;T<u.length;T++){var z=u[T];if(z.dataset.precedence===a)w=z;else if(w!==y)break}w?w.parentNode.insertBefore(n,w.nextSibling):(a=i.nodeType===9?i.head:i,a.insertBefore(n,a.firstChild))}function fg(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.title==null&&(n.title=a.title)}function hg(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.integrity==null&&(n.integrity=a.integrity)}var Jd=null;function yw(n,a,i){if(Jd===null){var u=new Map,y=Jd=new Map;y.set(i,u)}else y=Jd,u=y.get(i),u||(u=new Map,y.set(i,u));if(u.has(n))return u;for(u.set(n,null),i=i.getElementsByTagName(n),y=0;y<i.length;y++){var w=i[y];if(!(w[ls]||w[It]||n==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var T=w.getAttribute(a)||"";T=n+T;var z=u.get(T);z?z.push(w):u.set(T,[w])}}return u}function xw(n,a,i){n=n.ownerDocument||n,n.head.insertBefore(i,a==="title"?n.querySelector("head > title"):null)}function OA(n,a,i){if(i===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return n=a.disabled,typeof a.precedence=="string"&&n==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function bw(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function DA(n,a,i,u){if(i.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var y=Xi(u.href),w=a.querySelector(Rc(y));if(w){a=w._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=ef.bind(n),a.then(n,n)),i.state.loading|=4,i.instance=w,At(w);return}w=a.ownerDocument||a,u=gw(u),(y=sr.get(y))&&fg(u,y),w=w.createElement("link"),At(w);var T=w;T._p=new Promise(function(z,G){T.onload=z,T.onerror=G}),Jt(w,"link",u),i.instance=w}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(i,a),(a=i.state.preload)&&(i.state.loading&3)===0&&(n.count++,i=ef.bind(n),a.addEventListener("load",i),a.addEventListener("error",i))}}var mg=0;function kA(n,a){return n.stylesheets&&n.count===0&&nf(n,n.stylesheets),0<n.count||0<n.imgCount?function(i){var u=setTimeout(function(){if(n.stylesheets&&nf(n,n.stylesheets),n.unsuspend){var w=n.unsuspend;n.unsuspend=null,w()}},6e4+a);0<n.imgBytes&&mg===0&&(mg=62500*mA());var y=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&nf(n,n.stylesheets),n.unsuspend)){var w=n.unsuspend;n.unsuspend=null,w()}},(n.imgBytes>mg?50:800)+a);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(y)}}:null}function ef(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nf(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var tf=null;function nf(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,tf=new Map,a.forEach(zA,n),tf=null,ef.call(n))}function zA(n,a){if(!(a.state.loading&4)){var i=tf.get(n);if(i)var u=i.get(null);else{i=new Map,tf.set(n,i);for(var y=n.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<y.length;w++){var T=y[w];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(i.set(T.dataset.precedence,T),u=T)}u&&i.set(null,u)}y=a.instance,T=y.getAttribute("data-precedence"),w=i.get(T)||u,w===u&&i.set(null,y),i.set(T,y),this.count++,u=ef.bind(this),y.addEventListener("load",u),y.addEventListener("error",u),w?w.parentNode.insertBefore(y,w.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(y,n.firstChild)),a.state.loading|=4}}var Ac={$$typeof:N,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function LA(n,a,i,u,y,w,T,z,G){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=Ir(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ir(0),this.hiddenUpdates=Ir(null),this.identifierPrefix=u,this.onUncaughtError=y,this.onCaughtError=w,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function ww(n,a,i,u,y,w,T,z,G,oe,ue,fe){return n=new LA(n,a,i,T,G,oe,ue,fe,z),a=1,w===!0&&(a|=24),w=In(3,null,null,a),n.current=w,w.stateNode=n,a=Ym(),a.refCount++,n.pooledCache=a,a.refCount++,w.memoizedState={element:u,isDehydrated:i,cache:a},Zm(w),n}function Sw(n){return n?(n=_i,n):_i}function Ew(n,a,i,u,y,w){y=Sw(y),u.context===null?u.context=y:u.pendingContext=y,u=uo(a),u.payload={element:i},w=w===void 0?null:w,w!==null&&(u.callback=w),i=fo(n,u,a),i!==null&&(Nn(i,n,a),cc(i,n,a))}function _w(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<a?i:a}}function pg(n,a){_w(n,a),(n=n.alternate)&&_w(n,a)}function Cw(n){if(n.tag===13||n.tag===31){var a=ms(n,67108864);a!==null&&Nn(a,n,67108864),pg(n,67108864)}}function Nw(n){if(n.tag===13||n.tag===31){var a=qn();a=Za(a);var i=ms(n,a);i!==null&&Nn(i,n,a),pg(n,a)}}var rf=!0;function PA(n,a,i,u){var y=M.T;M.T=null;var w=I.p;try{I.p=2,gg(n,a,i,u)}finally{I.p=w,M.T=y}}function HA(n,a,i,u){var y=M.T;M.T=null;var w=I.p;try{I.p=8,gg(n,a,i,u)}finally{I.p=w,M.T=y}}function gg(n,a,i,u){if(rf){var y=vg(u);if(y===null)ng(n,a,u,af,i),Tw(n,u);else if(BA(y,n,a,i,u))u.stopPropagation();else if(Tw(n,u),a&4&&-1<IA.indexOf(n)){for(;y!==null;){var w=Ja(y);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var T=Wn(w.pendingLanes);if(T!==0){var z=w;for(z.pendingLanes|=2,z.entangledLanes|=2;T;){var G=1<<31-Vt(T);z.entanglements[1]|=G,T&=~G}qr(w),(tt&6)===0&&(Bd=Ht()+500,Cc(0))}}break;case 31:case 13:z=ms(w,2),z!==null&&Nn(z,w,2),$d(),pg(w,2)}if(w=vg(u),w===null&&ng(n,a,u,af,i),w===y)break;y=w}y!==null&&u.stopPropagation()}else ng(n,a,u,null,i)}}function vg(n){return n=xm(n),yg(n)}var af=null;function yg(n){if(af=null,n=Wa(n),n!==null){var a=l(n);if(a===null)n=null;else{var i=a.tag;if(i===13){if(n=c(a),n!==null)return n;n=null}else if(i===31){if(n=f(a),n!==null)return n;n=null}else if(i===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}return af=n,null}function jw(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"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ga()){case yn:return 2;case Lr:return 8;case Pr:case ss:return 32;case zn:return 268435456;default:return 32}default:return 32}}var xg=!1,Eo=null,_o=null,Co=null,Oc=new Map,Dc=new Map,No=[],IA="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 Tw(n,a){switch(n){case"focusin":case"focusout":Eo=null;break;case"dragenter":case"dragleave":_o=null;break;case"mouseover":case"mouseout":Co=null;break;case"pointerover":case"pointerout":Oc.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dc.delete(a.pointerId)}}function kc(n,a,i,u,y,w){return n===null||n.nativeEvent!==w?(n={blockedOn:a,domEventName:i,eventSystemFlags:u,nativeEvent:w,targetContainers:[y]},a!==null&&(a=Ja(a),a!==null&&Cw(a)),n):(n.eventSystemFlags|=u,a=n.targetContainers,y!==null&&a.indexOf(y)===-1&&a.push(y),n)}function BA(n,a,i,u,y){switch(a){case"focusin":return Eo=kc(Eo,n,a,i,u,y),!0;case"dragenter":return _o=kc(_o,n,a,i,u,y),!0;case"mouseover":return Co=kc(Co,n,a,i,u,y),!0;case"pointerover":var w=y.pointerId;return Oc.set(w,kc(Oc.get(w)||null,n,a,i,u,y)),!0;case"gotpointercapture":return w=y.pointerId,Dc.set(w,kc(Dc.get(w)||null,n,a,i,u,y)),!0}return!1}function Rw(n){var a=Wa(n.target);if(a!==null){var i=l(a);if(i!==null){if(a=i.tag,a===13){if(a=c(i),a!==null){n.blockedOn=a,Xu(n.priority,function(){Nw(i)});return}}else if(a===31){if(a=f(i),a!==null){n.blockedOn=a,Xu(n.priority,function(){Nw(i)});return}}else if(a===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function of(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var i=vg(n.nativeEvent);if(i===null){i=n.nativeEvent;var u=new i.constructor(i.type,i);ym=u,i.target.dispatchEvent(u),ym=null}else return a=Ja(i),a!==null&&Cw(a),n.blockedOn=i,!1;a.shift()}return!0}function Mw(n,a,i){of(n)&&i.delete(a)}function UA(){xg=!1,Eo!==null&&of(Eo)&&(Eo=null),_o!==null&&of(_o)&&(_o=null),Co!==null&&of(Co)&&(Co=null),Oc.forEach(Mw),Dc.forEach(Mw)}function sf(n,a){n.blockedOn===a&&(n.blockedOn=null,xg||(xg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,UA)))}var lf=null;function Aw(n){lf!==n&&(lf=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){lf===n&&(lf=null);for(var a=0;a<n.length;a+=3){var i=n[a],u=n[a+1],y=n[a+2];if(typeof u!="function"){if(yg(u||i)===null)continue;break}var w=Ja(i);w!==null&&(n.splice(a,3),a-=3,vp(w,{pending:!0,data:y,method:i.method,action:u},u,y))}}))}function Gi(n){function a(G){return sf(G,n)}Eo!==null&&sf(Eo,n),_o!==null&&sf(_o,n),Co!==null&&sf(Co,n),Oc.forEach(a),Dc.forEach(a);for(var i=0;i<No.length;i++){var u=No[i];u.blockedOn===n&&(u.blockedOn=null)}for(;0<No.length&&(i=No[0],i.blockedOn===null);)Rw(i),i.blockedOn===null&&No.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(u=0;u<i.length;u+=3){var y=i[u],w=i[u+1],T=y[cn]||null;if(typeof w=="function")T||Aw(i);else if(T){var z=null;if(w&&w.hasAttribute("formAction")){if(y=w,T=w[cn]||null)z=T.formAction;else if(yg(y)!==null)continue}else z=T.action;typeof z=="function"?i[u+1]=z:(i.splice(u,3),u-=3),Aw(i)}}}function Ow(){function n(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(T){return y=T})},focusReset:"manual",scroll:"manual"})}function a(){y!==null&&(y(),y=null),u||setTimeout(i,20)}function i(){if(!u&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,y=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(i,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),y!==null&&(y(),y=null)}}}function bg(n){this._internalRoot=n}cf.prototype.render=bg.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(o(409));var i=a.current,u=qn();Ew(i,u,n,a,null,null)},cf.prototype.unmount=bg.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;Ew(n.current,2,null,n,null,null),$d(),a[fa]=null}};function cf(n){this._internalRoot=n}cf.prototype.unstable_scheduleHydration=function(n){if(n){var a=ql();n={blockedOn:null,target:n,priority:a};for(var i=0;i<No.length&&a!==0&&a<No[i].priority;i++);No.splice(i,0,n),i===0&&Rw(n)}};var Dw=t.version;if(Dw!=="19.2.4")throw Error(o(527,Dw,"19.2.4"));I.findDOMNode=function(n){var a=n._reactInternals;if(a===void 0)throw typeof n.render=="function"?Error(o(188)):(n=Object.keys(n).join(","),Error(o(268,n)));return n=h(a),n=n!==null?g(n):null,n=n===null?null:n.stateNode,n};var $A={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uf.isDisabled&&uf.supportsFiber)try{ca=uf.inject($A),Kt=uf}catch{}}return Lc.createRoot=function(n,a){if(!s(n))throw Error(o(299));var i=!1,u="",y=Bb,w=Ub,T=$b;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(w=a.onCaughtError),a.onRecoverableError!==void 0&&(T=a.onRecoverableError)),a=ww(n,1,!1,null,null,i,u,null,y,w,T,Ow),n[fa]=a.current,tg(n),new bg(a)},Lc.hydrateRoot=function(n,a,i){if(!s(n))throw Error(o(299));var u=!1,y="",w=Bb,T=Ub,z=$b,G=null;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(y=i.identifierPrefix),i.onUncaughtError!==void 0&&(w=i.onUncaughtError),i.onCaughtError!==void 0&&(T=i.onCaughtError),i.onRecoverableError!==void 0&&(z=i.onRecoverableError),i.formState!==void 0&&(G=i.formState)),a=ww(n,1,!0,a,i??null,u,y,G,w,T,z,Ow),a.context=Sw(null),i=a.current,u=qn(),u=Za(u),y=uo(u),y.callback=null,fo(i,y,u),i=u,a.current.lanes=i,ht(a,i),qr(a),n[fa]=a.current,tg(n),new cf(a)},Lc.version="19.2.4",Lc}var qw;function WA(){if(qw)return _g.exports;qw=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(),_g.exports=ZA(),_g.exports}var JA=WA();/**
 * react-router v7.13.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var Fw="popstate";function Xw(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function eO(e={}){function t(o,s){var h;let l=(h=s.state)==null?void 0:h.masked,{pathname:c,search:f,hash:m}=l||o.location;return dv("",{pathname:c,search:f,hash:m},s.state&&s.state.usr||null,s.state&&s.state.key||"default",l?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function r(o,s){return typeof s=="string"?s:Jc(s)}return nO(t,r,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Tr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function tO(){return Math.random().toString(36).substring(2,10)}function Yw(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function dv(e,t,r=null,o,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?kl(t):t,state:r,key:t&&t.key||o||tO(),unstable_mask:s}}function Jc({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function kl(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let o=e.indexOf("?");o>=0&&(t.search=e.substring(o),e=e.substring(0,o)),e&&(t.pathname=e)}return t}function nO(e,t,r,o={}){let{window:s=document.defaultView,v5Compat:l=!1}=o,c=s.history,f="POP",m=null,h=g();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function g(){return(c.state||{idx:null}).idx}function p(){f="POP";let _=g(),C=_==null?null:_-h;h=_,m&&m({action:f,location:S.location,delta:C})}function v(_,C){f="PUSH";let j=Xw(_)?_:dv(S.location,_,C);h=g()+1;let N=Yw(j,h),R=S.createHref(j.unstable_mask||j);try{c.pushState(N,"",R)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;s.location.assign(R)}l&&m&&m({action:f,location:S.location,delta:1})}function x(_,C){f="REPLACE";let j=Xw(_)?_:dv(S.location,_,C);h=g();let N=Yw(j,h),R=S.createHref(j.unstable_mask||j);c.replaceState(N,"",R),l&&m&&m({action:f,location:S.location,delta:0})}function E(_){return rO(_)}let S={get action(){return f},get location(){return e(s,c)},listen(_){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(Fw,p),m=_,()=>{s.removeEventListener(Fw,p),m=null}},createHref(_){return t(s,_)},createURL:E,encodeLocation(_){let C=E(_);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:v,replace:x,go(_){return c.go(_)}};return S}function rO(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),bt(r,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:Jc(e);return o=o.replace(/ $/,"%20"),!t&&o.startsWith("//")&&(o=r+o),new URL(o,r)}function __(e,t,r="/"){return aO(e,t,r,!1)}function aO(e,t,r,o){let s=typeof t=="string"?kl(t):t,l=Ua(s.pathname||"/",r);if(l==null)return null;let c=C_(e);oO(c);let f=null;for(let m=0;f==null&&m<c.length;++m){let h=gO(l);f=mO(c[m],h,o)}return f}function C_(e,t=[],r=[],o="",s=!1){let l=(c,f,m=s,h)=>{let g={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(o)&&m)return;bt(g.relativePath.startsWith(o),`Absolute route path "${g.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(o.length)}let p=ta([o,g.relativePath]),v=r.concat(g);c.children&&c.children.length>0&&(bt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),C_(c.children,t,v,p,m)),!(c.path==null&&!c.index)&&t.push({path:p,score:fO(p,c.index),routesMeta:v})};return e.forEach((c,f)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))l(c,f);else for(let h of N_(c.path))l(c,f,!0,h)}),t}function N_(e){let t=e.split("/");if(t.length===0)return[];let[r,...o]=t,s=r.endsWith("?"),l=r.replace(/\?$/,"");if(o.length===0)return s?[l,""]:[l];let c=N_(o.join("/")),f=[];return f.push(...c.map(m=>m===""?l:[l,m].join("/"))),s&&f.push(...c),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function oO(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:hO(t.routesMeta.map(o=>o.childrenIndex),r.routesMeta.map(o=>o.childrenIndex)))}var sO=/^:[\w-]+$/,iO=3,lO=2,cO=1,uO=10,dO=-2,Gw=e=>e==="*";function fO(e,t){let r=e.split("/"),o=r.length;return r.some(Gw)&&(o+=dO),t&&(o+=lO),r.filter(s=>!Gw(s)).reduce((s,l)=>s+(sO.test(l)?iO:l===""?cO:uO),o)}function hO(e,t){return e.length===t.length&&e.slice(0,-1).every((o,s)=>o===t[s])?e[e.length-1]-t[t.length-1]:0}function mO(e,t,r=!1){let{routesMeta:o}=e,s={},l="/",c=[];for(let f=0;f<o.length;++f){let m=o[f],h=f===o.length-1,g=l==="/"?t:t.slice(l.length)||"/",p=Xf({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},g),v=m.route;if(!p&&h&&r&&!o[o.length-1].route.index&&(p=Xf({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!p)return null;Object.assign(s,p.params),c.push({params:s,pathname:ta([l,p.pathname]),pathnameBase:bO(ta([l,p.pathnameBase])),route:v}),p.pathnameBase!=="/"&&(l=ta([l,p.pathnameBase]))}return c}function Xf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,o]=pO(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let l=s[0],c=l.replace(/(.)\/+$/,"$1"),f=s.slice(1);return{params:o.reduce((h,{paramName:g,isOptional:p},v)=>{if(g==="*"){let E=f[v]||"";c=l.slice(0,l.length-E.length).replace(/(.)\/+$/,"$1")}const x=f[v];return p&&!x?h[g]=void 0:h[g]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:c,pattern:e}}function pO(e,t=!1,r=!0){Tr(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 o=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,m,h,g)=>{if(o.push({paramName:f,isOptional:m!=null}),m){let p=g.charAt(h+c.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(o.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),o]}function gO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Tr(!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 Ua(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,o=e.charAt(r);return o&&o!=="/"?null:e.slice(r)||"/"}var vO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function yO(e,t="/"){let{pathname:r,search:o="",hash:s=""}=typeof e=="string"?kl(e):e,l;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?l=Kw(r.substring(1),"/"):l=Kw(r,t)):l=t,{pathname:l,search:wO(o),hash:SO(s)}}function Kw(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Tg(e,t,r,o){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(o)}].  Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function xO(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function j_(e){let t=xO(e);return t.map((r,o)=>o===t.length-1?r.pathname:r.pathnameBase)}function yy(e,t,r,o=!1){let s;typeof e=="string"?s=kl(e):(s={...e},bt(!s.pathname||!s.pathname.includes("?"),Tg("?","pathname","search",s)),bt(!s.pathname||!s.pathname.includes("#"),Tg("#","pathname","hash",s)),bt(!s.search||!s.search.includes("#"),Tg("#","search","hash",s)));let l=e===""||s.pathname==="",c=l?"/":s.pathname,f;if(c==null)f=r;else{let p=t.length-1;if(!o&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),p-=1;s.pathname=v.join("/")}f=p>=0?t[p]:"/"}let m=yO(s,f),h=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(h||g)&&(m.pathname+="/"),m}var ta=e=>e.join("/").replace(/\/\/+/g,"/"),bO=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,SO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,EO=class{constructor(e,t,r,o=!1){this.status=e,this.statusText=t||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function _O(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function CO(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var T_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function R_(e,t){let r=e;if(typeof r!="string"||!vO.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let o=r,s=!1;if(T_)try{let l=new URL(window.location.href),c=r.startsWith("//")?new URL(l.protocol+r):new URL(r),f=Ua(c.pathname,t);c.origin===l.origin&&f!=null?r=f+c.search+c.hash:s=!0}catch{Tr(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var M_=["POST","PUT","PATCH","DELETE"];new Set(M_);var NO=["GET",...M_];new Set(NO);var zl=b.createContext(null);zl.displayName="DataRouter";var _h=b.createContext(null);_h.displayName="DataRouterState";var jO=b.createContext(!1),A_=b.createContext({isTransitioning:!1});A_.displayName="ViewTransition";var TO=b.createContext(new Map);TO.displayName="Fetchers";var RO=b.createContext(null);RO.displayName="Await";var hr=b.createContext(null);hr.displayName="Navigation";var ju=b.createContext(null);ju.displayName="Location";var Or=b.createContext({outlet:null,matches:[],isDataRoute:!1});Or.displayName="Route";var xy=b.createContext(null);xy.displayName="RouteError";var O_="REACT_ROUTER_ERROR",MO="REDIRECT",AO="ROUTE_ERROR_RESPONSE";function OO(e){if(e.startsWith(`${O_}:${MO}:{`))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 DO(e){if(e.startsWith(`${O_}:${AO}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new EO(t.status,t.statusText,t.data)}catch{}}function kO(e,{relative:t}={}){bt(Tu(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:o}=b.useContext(hr),{hash:s,pathname:l,search:c}=Ru(e,{relative:t}),f=l;return r!=="/"&&(f=l==="/"?r:ta([r,l])),o.createHref({pathname:f,search:c,hash:s})}function Tu(){return b.useContext(ju)!=null}function oa(){return bt(Tu(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(ju).location}var D_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function k_(e){b.useContext(hr).static||b.useLayoutEffect(e)}function Ll(){let{isDataRoute:e}=b.useContext(Or);return e?KO():zO()}function zO(){bt(Tu(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(zl),{basename:t,navigator:r}=b.useContext(hr),{matches:o}=b.useContext(Or),{pathname:s}=oa(),l=JSON.stringify(j_(o)),c=b.useRef(!1);return k_(()=>{c.current=!0}),b.useCallback((m,h={})=>{if(Tr(c.current,D_),!c.current)return;if(typeof m=="number"){r.go(m);return}let g=yy(m,JSON.parse(l),s,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:ta([t,g.pathname])),(h.replace?r.replace:r.push)(g,h.state,h)},[t,r,l,s,e])}var LO=b.createContext(null);function PO(e){let t=b.useContext(Or).outlet;return b.useMemo(()=>t&&b.createElement(LO.Provider,{value:e},t),[t,e])}function by(){let{matches:e}=b.useContext(Or),t=e[e.length-1];return t?t.params:{}}function Ru(e,{relative:t}={}){let{matches:r}=b.useContext(Or),{pathname:o}=oa(),s=JSON.stringify(j_(r));return b.useMemo(()=>yy(e,JSON.parse(s),o,t==="path"),[e,s,o,t])}function HO(e,t){return z_(e,t)}function z_(e,t,r){var _;bt(Tu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=b.useContext(hr),{matches:s}=b.useContext(Or),l=s[s.length-1],c=l?l.params:{},f=l?l.pathname:"/",m=l?l.pathnameBase:"/",h=l&&l.route;{let C=h&&h.path||"";P_(f,!h||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) 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.

Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let g=oa(),p;if(t){let C=typeof t=="string"?kl(t):t;bt(m==="/"||((_=C.pathname)==null?void 0:_.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),p=C}else p=g;let v=p.pathname||"/",x=v;if(m!=="/"){let C=m.replace(/^\//,"").split("/");x="/"+v.replace(/^\//,"").split("/").slice(C.length).join("/")}let E=__(e,{pathname:x});Tr(h||E!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Tr(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.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.`);let S=VO(E&&E.map(C=>Object.assign({},C,{params:Object.assign({},c,C.params),pathname:ta([m,o.encodeLocation?o.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:ta([m,o.encodeLocation?o.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),s,r);return t&&S?b.createElement(ju.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},S):S}function IO(){let e=GO(),t=_O(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:o},l={padding:"2px 4px",backgroundColor:o},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=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),r?b.createElement("pre",{style:s},r):null,c)}var BO=b.createElement(IO,null),L_=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 r=DO(e.digest);r&&(e=r)}let t=e!==void 0?b.createElement(Or.Provider,{value:this.props.routeContext},b.createElement(xy.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(UO,{error:e},t):t}};L_.contextType=jO;var Rg=new WeakMap;function UO({children:e,error:t}){let{basename:r}=b.useContext(hr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=OO(t.digest);if(o){let s=Rg.get(t);if(s)throw s;let l=R_(o.location,r);if(T_&&!Rg.get(t))if(l.isExternal||o.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:o.replace}));throw Rg.set(t,c),c}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function $O({routeContext:e,match:t,children:r}){let o=b.useContext(zl);return o&&o.static&&o.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(Or.Provider,{value:e},r)}function VO(e,t=[],r){let o=r==null?void 0:r.state;if(e==null){if(!o)return null;if(o.errors)e=o.matches;else if(t.length===0&&!o.initialized&&o.matches.length>0)e=o.matches;else return null}let s=e,l=o==null?void 0:o.errors;if(l!=null){let g=s.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);bt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,g+1))}let c=!1,f=-1;if(r&&o){c=o.renderFallback;for(let g=0;g<s.length;g++){let p=s[g];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=g),p.route.id){let{loaderData:v,errors:x}=o,E=p.route.loader&&!v.hasOwnProperty(p.route.id)&&(!x||x[p.route.id]===void 0);if(p.route.lazy||E){r.isStatic&&(c=!0),f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}}let m=r==null?void 0:r.onError,h=o&&m?(g,p)=>{var v,x;m(g,{location:o.location,params:((x=(v=o.matches)==null?void 0:v[0])==null?void 0:x.params)??{},unstable_pattern:CO(o.matches),errorInfo:p})}:void 0;return s.reduceRight((g,p,v)=>{let x,E=!1,S=null,_=null;o&&(x=l&&p.route.id?l[p.route.id]:void 0,S=p.route.errorElement||BO,c&&(f<0&&v===0?(P_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,_=null):f===v&&(E=!0,_=p.route.hydrateFallbackElement||null)));let C=t.concat(s.slice(0,v+1)),j=()=>{let N;return x?N=S:E?N=_:p.route.Component?N=b.createElement(p.route.Component,null):p.route.element?N=p.route.element:N=g,b.createElement($O,{match:p,routeContext:{outlet:g,matches:C,isDataRoute:o!=null},children:N})};return o&&(p.route.ErrorBoundary||p.route.errorElement||v===0)?b.createElement(L_,{location:o.location,revalidation:o.revalidation,component:S,error:x,children:j(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):j()},null)}function wy(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function qO(e){let t=b.useContext(zl);return bt(t,wy(e)),t}function FO(e){let t=b.useContext(_h);return bt(t,wy(e)),t}function XO(e){let t=b.useContext(Or);return bt(t,wy(e)),t}function Sy(e){let t=XO(e),r=t.matches[t.matches.length-1];return bt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function YO(){return Sy("useRouteId")}function GO(){var o;let e=b.useContext(xy),t=FO("useRouteError"),r=Sy("useRouteError");return e!==void 0?e:(o=t.errors)==null?void 0:o[r]}function KO(){let{router:e}=qO("useNavigate"),t=Sy("useNavigate"),r=b.useRef(!1);return k_(()=>{r.current=!0}),b.useCallback(async(s,l={})=>{Tr(r.current,D_),r.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var Qw={};function P_(e,t,r){!t&&!Qw[e]&&(Qw[e]=!0,Tr(!1,r))}b.memo(QO);function QO({routes:e,future:t,state:r,isStatic:o,onError:s}){return z_(e,void 0,{state:r,isStatic:o,onError:s})}function ZO(e){return PO(e.context)}function Xr(e){bt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function WO({basename:e="/",children:t=null,location:r,navigationType:o="POP",navigator:s,static:l=!1,unstable_useTransitions:c}){bt(!Tu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=b.useMemo(()=>({basename:f,navigator:s,static:l,unstable_useTransitions:c,future:{}}),[f,s,l,c]);typeof r=="string"&&(r=kl(r));let{pathname:h="/",search:g="",hash:p="",state:v=null,key:x="default",unstable_mask:E}=r,S=b.useMemo(()=>{let _=Ua(h,f);return _==null?null:{location:{pathname:_,search:g,hash:p,state:v,key:x,unstable_mask:E},navigationType:o}},[f,h,g,p,v,x,o,E]);return Tr(S!=null,`<Router basename="${f}"> is not able to match the URL "${h}${g}${p}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:b.createElement(hr.Provider,{value:m},b.createElement(ju.Provider,{children:t,value:S}))}function JO({children:e,location:t}){return HO(fv(e),t)}function fv(e,t=[]){let r=[];return b.Children.forEach(e,(o,s)=>{if(!b.isValidElement(o))return;let l=[...t,s];if(o.type===b.Fragment){r.push.apply(r,fv(o.props.children,l));return}bt(o.type===Xr,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let c={id:o.props.id||l.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(c.children=fv(o.props.children,l)),r.push(c)}),r}var Of="get",Df="application/x-www-form-urlencoded";function Ch(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function eD(e){return Ch(e)&&e.tagName.toLowerCase()==="button"}function tD(e){return Ch(e)&&e.tagName.toLowerCase()==="form"}function nD(e){return Ch(e)&&e.tagName.toLowerCase()==="input"}function rD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function aD(e,t){return e.button===0&&(!t||t==="_self")&&!rD(e)}function hv(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let o=e[r];return t.concat(Array.isArray(o)?o.map(s=>[r,s]):[[r,o]])},[]))}function oD(e,t){let r=hv(e);return t&&t.forEach((o,s)=>{r.has(s)||t.getAll(s).forEach(l=>{r.append(s,l)})}),r}var ff=null;function sD(){if(ff===null)try{new FormData(document.createElement("form"),0),ff=!1}catch{ff=!0}return ff}var iD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mg(e){return e!=null&&!iD.has(e)?(Tr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Df}"`),null):e}function lD(e,t){let r,o,s,l,c;if(tD(e)){let f=e.getAttribute("action");o=f?Ua(f,t):null,r=e.getAttribute("method")||Of,s=Mg(e.getAttribute("enctype"))||Df,l=new FormData(e)}else if(eD(e)||nD(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(o=m?Ua(m,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||Of,s=Mg(e.getAttribute("formenctype"))||Mg(f.getAttribute("enctype"))||Df,l=new FormData(f,e),!sD()){let{name:h,type:g,value:p}=e;if(g==="image"){let v=h?`${h}.`:"";l.append(`${v}x`,"0"),l.append(`${v}y`,"0")}else h&&l.append(h,p)}}else{if(Ch(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Of,o=null,s=Df,c=e}return l&&s==="text/plain"&&(c=l,l=void 0),{action:o,method:r.toLowerCase(),encType:s,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ey(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function cD(e,t,r,o){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${o}`:s.pathname=`${s.pathname}.${o}`:s.pathname==="/"?s.pathname=`_root.${o}`:t&&Ua(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${o}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${o}`,s}async function uD(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function dD(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 fD(e,t,r){let o=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let c=await uD(l,r);return c.links?c.links():[]}return[]}));return gD(o.flat(1).filter(dD).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Zw(e,t,r,o,s,l){let c=(m,h)=>r[h]?m.route.id!==r[h].route.id:!0,f=(m,h)=>{var g;return r[h].pathname!==m.pathname||((g=r[h].route.path)==null?void 0:g.endsWith("*"))&&r[h].params["*"]!==m.params["*"]};return l==="assets"?t.filter((m,h)=>c(m,h)||f(m,h)):l==="data"?t.filter((m,h)=>{var p;let g=o.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(c(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let v=m.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((p=r[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function hD(e,t,{includeHydrateFallback:r}={}){return mD(e.map(o=>{let s=t.routes[o.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),r&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function mD(e){return[...new Set(e)]}function pD(e){let t={},r=Object.keys(e).sort();for(let o of r)t[o]=e[o];return t}function gD(e,t){let r=new Set;return new Set(t),e.reduce((o,s)=>{let l=JSON.stringify(pD(s));return r.has(l)||(r.add(l),o.push({key:l,link:s})),o},[])}function H_(){let e=b.useContext(zl);return Ey(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function vD(){let e=b.useContext(_h);return Ey(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var _y=b.createContext(void 0);_y.displayName="FrameworkContext";function I_(){let e=b.useContext(_y);return Ey(e,"You must render this element inside a <HydratedRouter> element"),e}function yD(e,t){let r=b.useContext(_y),[o,s]=b.useState(!1),[l,c]=b.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:g,onTouchStart:p}=t,v=b.useRef(null);b.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=C=>{C.forEach(j=>{c(j.isIntersecting)})},_=new IntersectionObserver(S,{threshold:.5});return v.current&&_.observe(v.current),()=>{_.disconnect()}}},[e]),b.useEffect(()=>{if(o){let S=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(S)}}},[o]);let x=()=>{s(!0)},E=()=>{s(!1),c(!1)};return r?e!=="intent"?[l,v,{}]:[l,v,{onFocus:Pc(f,x),onBlur:Pc(m,E),onMouseEnter:Pc(h,x),onMouseLeave:Pc(g,E),onTouchStart:Pc(p,x)}]:[!1,v,{}]}function Pc(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function xD({page:e,...t}){let{router:r}=H_(),o=b.useMemo(()=>__(r.routes,e,r.basename),[r.routes,e,r.basename]);return o?b.createElement(wD,{page:e,matches:o,...t}):null}function bD(e){let{manifest:t,routeModules:r}=I_(),[o,s]=b.useState([]);return b.useEffect(()=>{let l=!1;return fD(e,t,r).then(c=>{l||s(c)}),()=>{l=!0}},[e,t,r]),o}function wD({page:e,matches:t,...r}){let o=oa(),{future:s,manifest:l,routeModules:c}=I_(),{basename:f}=H_(),{loaderData:m,matches:h}=vD(),g=b.useMemo(()=>Zw(e,t,h,l,o,"data"),[e,t,h,l,o]),p=b.useMemo(()=>Zw(e,t,h,l,o,"assets"),[e,t,h,l,o]),v=b.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let S=new Set,_=!1;if(t.forEach(j=>{var R;let N=l.routes[j.route.id];!N||!N.hasLoader||(!g.some(O=>O.route.id===j.route.id)&&j.route.id in m&&((R=c[j.route.id])!=null&&R.shouldRevalidate)||N.hasClientLoader?_=!0:S.add(j.route.id))}),S.size===0)return[];let C=cD(e,f,s.unstable_trailingSlashAwareDataRequests,"data");return _&&S.size>0&&C.searchParams.set("_routes",t.filter(j=>S.has(j.route.id)).map(j=>j.route.id).join(",")),[C.pathname+C.search]},[f,s.unstable_trailingSlashAwareDataRequests,m,o,l,g,t,e,c]),x=b.useMemo(()=>hD(p,l),[p,l]),E=bD(p);return b.createElement(b.Fragment,null,v.map(S=>b.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...r})),x.map(S=>b.createElement("link",{key:S,rel:"modulepreload",href:S,...r})),E.map(({key:S,link:_})=>b.createElement("link",{key:S,nonce:r.nonce,..._,crossOrigin:_.crossOrigin??r.crossOrigin})))}function SD(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var ED=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ED&&(window.__reactRouterVersion="7.13.1")}catch{}function _D({basename:e,children:t,unstable_useTransitions:r,window:o}){let s=b.useRef();s.current==null&&(s.current=eO({window:o,v5Compat:!0}));let l=s.current,[c,f]=b.useState({action:l.action,location:l.location}),m=b.useCallback(h=>{r===!1?f(h):b.startTransition(()=>f(h))},[r]);return b.useLayoutEffect(()=>l.listen(m),[l,m]),b.createElement(WO,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:l,unstable_useTransitions:r})}var B_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rr=b.forwardRef(function({onClick:t,discover:r="render",prefetch:o="none",relative:s,reloadDocument:l,replace:c,unstable_mask:f,state:m,target:h,to:g,preventScrollReset:p,viewTransition:v,unstable_defaultShouldRevalidate:x,...E},S){let{basename:_,navigator:C,unstable_useTransitions:j}=b.useContext(hr),N=typeof g=="string"&&B_.test(g),R=R_(g,_);g=R.to;let O=kO(g,{relative:s}),A=oa(),D=null;if(f){let K=yy(f,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);_!=="/"&&(K.pathname=K.pathname==="/"?_:ta([_,K.pathname])),D=C.createHref(K)}let[P,H,Q]=yD(o,E),V=jD(g,{replace:c,unstable_mask:f,state:m,target:h,preventScrollReset:p,relative:s,viewTransition:v,unstable_defaultShouldRevalidate:x,unstable_useTransitions:j});function q(K){t&&t(K),K.defaultPrevented||V(K)}let ee=!(R.isExternal||l),B=b.createElement("a",{...E,...Q,href:(ee?D:void 0)||R.absoluteURL||O,onClick:ee?q:t,ref:SD(S,H),target:h,"data-discover":!N&&r==="render"?"true":void 0});return P&&!N?b.createElement(b.Fragment,null,B,b.createElement(xD,{page:O})):B});Rr.displayName="Link";var mv=b.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:o="",end:s=!1,style:l,to:c,viewTransition:f,children:m,...h},g){let p=Ru(c,{relative:h.relative}),v=oa(),x=b.useContext(_h),{navigator:E,basename:S}=b.useContext(hr),_=x!=null&&DD(p)&&f===!0,C=E.encodeLocation?E.encodeLocation(p).pathname:p.pathname,j=v.pathname,N=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;r||(j=j.toLowerCase(),N=N?N.toLowerCase():null,C=C.toLowerCase()),N&&S&&(N=Ua(N,S)||N);const R=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let O=j===C||!s&&j.startsWith(C)&&j.charAt(R)==="/",A=N!=null&&(N===C||!s&&N.startsWith(C)&&N.charAt(C.length)==="/"),D={isActive:O,isPending:A,isTransitioning:_},P=O?t:void 0,H;typeof o=="function"?H=o(D):H=[o,O?"active":null,A?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let Q=typeof l=="function"?l(D):l;return b.createElement(Rr,{...h,"aria-current":P,className:H,ref:g,style:Q,to:c,viewTransition:f},typeof m=="function"?m(D):m)});mv.displayName="NavLink";var CD=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:o,replace:s,state:l,method:c=Of,action:f,onSubmit:m,relative:h,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:v,...x},E)=>{let{unstable_useTransitions:S}=b.useContext(hr),_=AD(),C=OD(f,{relative:h}),j=c.toLowerCase()==="get"?"get":"post",N=typeof f=="string"&&B_.test(f),R=O=>{if(m&&m(O),O.defaultPrevented)return;O.preventDefault();let A=O.nativeEvent.submitter,D=(A==null?void 0:A.getAttribute("formmethod"))||c,P=()=>_(A||O.currentTarget,{fetcherKey:t,method:D,navigate:r,replace:s,state:l,relative:h,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:v});S&&r!==!1?b.startTransition(()=>P()):P()};return b.createElement("form",{ref:E,method:j,action:C,onSubmit:o?m:R,...x,"data-discover":!N&&e==="render"?"true":void 0})});CD.displayName="Form";function ND(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function U_(e){let t=b.useContext(zl);return bt(t,ND(e)),t}function jD(e,{target:t,replace:r,unstable_mask:o,state:s,preventScrollReset:l,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let g=Ll(),p=oa(),v=Ru(e,{relative:c});return b.useCallback(x=>{if(aD(x,t)){x.preventDefault();let E=r!==void 0?r:Jc(p)===Jc(v),S=()=>g(e,{replace:E,unstable_mask:o,state:s,preventScrollReset:l,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m});h?b.startTransition(()=>S()):S()}},[p,g,v,r,o,s,t,e,l,c,f,m,h])}function TD(e){Tr(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(hv(e)),r=b.useRef(!1),o=oa(),s=b.useMemo(()=>oD(o.search,r.current?null:t.current),[o.search]),l=Ll(),c=b.useCallback((f,m)=>{const h=hv(typeof f=="function"?f(new URLSearchParams(s)):f);r.current=!0,l("?"+h,m)},[l,s]);return[s,c]}var RD=0,MD=()=>`__${String(++RD)}__`;function AD(){let{router:e}=U_("useSubmit"),{basename:t}=b.useContext(hr),r=YO(),o=e.fetch,s=e.navigate;return b.useCallback(async(l,c={})=>{let{action:f,method:m,encType:h,formData:g,body:p}=lD(l,t);if(c.navigate===!1){let v=c.fetcherKey||MD();await o(v,r,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:p,formMethod:c.method||m,formEncType:c.encType||h,flushSync:c.flushSync})}else await s(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:p,formMethod:c.method||m,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:r,flushSync:c.flushSync,viewTransition:c.viewTransition})},[o,s,t,r])}function OD(e,{relative:t}={}){let{basename:r}=b.useContext(hr),o=b.useContext(Or);bt(o,"useFormAction must be used inside a RouteContext");let[s]=o.matches.slice(-1),l={...Ru(e||".",{relative:t})},c=oa();if(e==null){l.search=c.search;let f=new URLSearchParams(l.search),m=f.getAll("index");if(m.some(g=>g==="")){f.delete("index"),m.filter(p=>p).forEach(p=>f.append("index",p));let g=f.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(l.pathname=l.pathname==="/"?r:ta([r,l.pathname])),Jc(l)}function DD(e,{relative:t}={}){let r=b.useContext(A_);bt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=U_("useViewTransitionState"),s=Ru(e,{relative:t});if(!r.isTransitioning)return!1;let l=Ua(r.currentLocation.pathname,o)||r.currentLocation.pathname,c=Ua(r.nextLocation.pathname,o)||r.nextLocation.pathname;return Xf(s.pathname,c)!=null||Xf(s.pathname,l)!=null}var Mu=E_();const $_=Eh(Mu);var ni=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(){}},kD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Lo,vy,u_,zD=(u_=class{constructor(){be(this,Lo,kD);be(this,vy,!1)}setTimeoutProvider(e){pe(this,Lo,e)}setTimeout(e,t){return F(this,Lo).setTimeout(e,t)}clearTimeout(e){F(this,Lo).clearTimeout(e)}setInterval(e,t){return F(this,Lo).setInterval(e,t)}clearInterval(e){F(this,Lo).clearInterval(e)}},Lo=new WeakMap,vy=new WeakMap,u_),As=new zD;function LD(e){setTimeout(e,0)}var qs=typeof window>"u"||"Deno"in globalThis;function fn(){}function PD(e,t){return typeof e=="function"?e(t):e}function pv(e){return typeof e=="number"&&e>=0&&e!==1/0}function V_(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xo(e,t){return typeof e=="function"?e(t):e}function dr(e,t){return typeof e=="function"?e(t):e}function Ww(e,t){const{type:r="all",exact:o,fetchStatus:s,predicate:l,queryKey:c,stale:f}=e;if(c){if(o){if(t.queryHash!==Cy(c,t.options))return!1}else if(!eu(t.queryKey,c))return!1}if(r!=="all"){const m=t.isActive();if(r==="active"&&!m||r==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||s&&s!==t.state.fetchStatus||l&&!l(t))}function Jw(e,t){const{exact:r,status:o,predicate:s,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(r){if(Fs(t.options.mutationKey)!==Fs(l))return!1}else if(!eu(t.options.mutationKey,l))return!1}return!(o&&t.state.status!==o||s&&!s(t))}function Cy(e,t){return((t==null?void 0:t.queryKeyHashFn)||Fs)(e)}function Fs(e){return JSON.stringify(e,(t,r)=>gv(r)?Object.keys(r).sort().reduce((o,s)=>(o[s]=r[s],o),{}):r)}function eu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>eu(e[r],t[r])):!1}var HD=Object.prototype.hasOwnProperty;function Ny(e,t,r=0){if(e===t)return e;if(r>500)return t;const o=eS(e)&&eS(t);if(!o&&!(gv(e)&&gv(t)))return t;const l=(o?e:Object.keys(e)).length,c=o?t:Object.keys(t),f=c.length,m=o?new Array(f):{};let h=0;for(let g=0;g<f;g++){const p=o?g:c[g],v=e[p],x=t[p];if(v===x){m[p]=v,(o?g<l:HD.call(e,p))&&h++;continue}if(v===null||x===null||typeof v!="object"||typeof x!="object"){m[p]=x;continue}const E=Ny(v,x,r+1);m[p]=E,E===v&&h++}return l===f&&h===l?e:m}function tu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function eS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gv(e){if(!tS(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!tS(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function tS(e){return Object.prototype.toString.call(e)==="[object Object]"}function ID(e){return new Promise(t=>{As.setTimeout(t,e)})}function vv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Ny(e,t):t}function BD(e,t,r=0){const o=[...e,t];return r&&o.length>r?o.slice(1):o}function UD(e,t,r=0){const o=[t,...e];return r&&o.length>r?o.slice(0,-1):o}var jy=Symbol();function q_(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===jy?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ty(e,t){return typeof e=="function"?e(...t):!!e}function $D(e,t,r){let o=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),o||(o=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Ds,Po,il,d_,VD=(d_=class extends ni{constructor(){super();be(this,Ds);be(this,Po);be(this,il);pe(this,il,t=>{if(!qs&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){F(this,Po)||this.setEventListener(F(this,il))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Po))==null||t.call(this),pe(this,Po,void 0))}setEventListener(t){var r;pe(this,il,t),(r=F(this,Po))==null||r.call(this),pe(this,Po,t(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(t){F(this,Ds)!==t&&(pe(this,Ds,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof F(this,Ds)=="boolean"?F(this,Ds):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ds=new WeakMap,Po=new WeakMap,il=new WeakMap,d_),Ry=new VD;function yv(){let e,t;const r=new Promise((s,l)=>{e=s,t=l});r.status="pending",r.catch(()=>{});function o(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{o({status:"fulfilled",value:s}),e(s)},r.reject=s=>{o({status:"rejected",reason:s}),t(s)},r}var qD=LD;function FD(){let e=[],t=0,r=f=>{f()},o=f=>{f()},s=qD;const l=f=>{t?e.push(f):s(()=>{r(f)})},c=()=>{const f=e;e=[],f.length&&s(()=>{o(()=>{f.forEach(m=>{r(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||c()}return m},batchCalls:f=>(...m)=>{l(()=>{f(...m)})},schedule:l,setNotifyFunction:f=>{r=f},setBatchNotifyFunction:f=>{o=f},setScheduler:f=>{s=f}}}var _t=FD(),ll,Ho,cl,f_,XD=(f_=class extends ni{constructor(){super();be(this,ll,!0);be(this,Ho);be(this,cl);pe(this,cl,t=>{if(!qs&&window.addEventListener){const r=()=>t(!0),o=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",o)}}})}onSubscribe(){F(this,Ho)||this.setEventListener(F(this,cl))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Ho))==null||t.call(this),pe(this,Ho,void 0))}setEventListener(t){var r;pe(this,cl,t),(r=F(this,Ho))==null||r.call(this),pe(this,Ho,t(this.setOnline.bind(this)))}setOnline(t){F(this,ll)!==t&&(pe(this,ll,t),this.listeners.forEach(o=>{o(t)}))}isOnline(){return F(this,ll)}},ll=new WeakMap,Ho=new WeakMap,cl=new WeakMap,f_),Yf=new XD;function YD(e){return Math.min(1e3*2**e,3e4)}function F_(e){return(e??"online")==="online"?Yf.isOnline():!0}var xv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function X_(e){let t=!1,r=0,o;const s=yv(),l=()=>s.status!=="pending",c=S=>{var _;if(!l()){const C=new xv(S);v(C),(_=e.onCancel)==null||_.call(e,C)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>Ry.isFocused()&&(e.networkMode==="always"||Yf.isOnline())&&e.canRun(),g=()=>F_(e.networkMode)&&e.canRun(),p=S=>{l()||(o==null||o(),s.resolve(S))},v=S=>{l()||(o==null||o(),s.reject(S))},x=()=>new Promise(S=>{var _;o=C=>{(l()||h())&&S(C)},(_=e.onPause)==null||_.call(e)}).then(()=>{var S;o=void 0,l()||(S=e.onContinue)==null||S.call(e)}),E=()=>{if(l())return;let S;const _=r===0?e.initialPromise:void 0;try{S=_??e.fn()}catch(C){S=Promise.reject(C)}Promise.resolve(S).then(p).catch(C=>{var A;if(l())return;const j=e.retry??(qs?0:3),N=e.retryDelay??YD,R=typeof N=="function"?N(r,C):N,O=j===!0||typeof j=="number"&&r<j||typeof j=="function"&&j(r,C);if(t||!O){v(C);return}r++,(A=e.onFail)==null||A.call(e,r,C),ID(R).then(()=>h()?void 0:x()).then(()=>{t?v(C):E()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(o==null||o(),s),cancelRetry:f,continueRetry:m,canStart:g,start:()=>(g()?E():x().then(E),s)}}var ks,h_,Y_=(h_=class{constructor(){be(this,ks)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pv(this.gcTime)&&pe(this,ks,As.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qs?1/0:300*1e3))}clearGcTimeout(){F(this,ks)&&(As.clearTimeout(F(this,ks)),pe(this,ks,void 0))}},ks=new WeakMap,h_),zs,ul,cr,Ls,Xt,vu,Ps,Sr,ka,m_,GD=(m_=class extends Y_{constructor(t){super();be(this,Sr);be(this,zs);be(this,ul);be(this,cr);be(this,Ls);be(this,Xt);be(this,vu);be(this,Ps);pe(this,Ps,!1),pe(this,vu,t.defaultOptions),this.setOptions(t.options),this.observers=[],pe(this,Ls,t.client),pe(this,cr,F(this,Ls).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,pe(this,zs,rS(this.options)),this.state=t.state??F(this,zs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=F(this,Xt))==null?void 0:t.promise}setOptions(t){if(this.options={...F(this,vu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=rS(this.options);r.data!==void 0&&(this.setState(nS(r.data,r.dataUpdatedAt)),pe(this,zs,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,cr).remove(this)}setData(t,r){const o=vv(this.state.data,t,this.options);return Oe(this,Sr,ka).call(this,{data:o,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),o}setState(t,r){Oe(this,Sr,ka).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var o,s;const r=(o=F(this,Xt))==null?void 0:o.promise;return(s=F(this,Xt))==null||s.cancel(t),r?r.then(fn).catch(fn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(F(this,zs))}isActive(){return this.observers.some(t=>dr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jy||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Xo(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!V_(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(o=>o.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,Xt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(o=>o.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,Xt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,cr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(F(this,Xt)&&(F(this,Ps)?F(this,Xt).cancel({revert:!0}):F(this,Xt).cancelRetry()),this.scheduleGc()),F(this,cr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,Sr,ka).call(this,{type:"invalidate"})}async fetch(t,r){var m,h,g,p,v,x,E,S,_,C,j,N;if(this.state.fetchStatus!=="idle"&&((m=F(this,Xt))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(F(this,Xt))return F(this,Xt).continueRetry(),F(this,Xt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const R=this.observers.find(O=>O.options.queryFn);R&&this.setOptions(R.options)}const o=new AbortController,s=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>(pe(this,Ps,!0),o.signal)})},l=()=>{const R=q_(this.options,r),A=(()=>{const D={client:F(this,Ls),queryKey:this.queryKey,meta:this.meta};return s(D),D})();return pe(this,Ps,!1),this.options.persister?this.options.persister(R,A,this):R(A)},f=(()=>{const R={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:F(this,Ls),state:this.state,fetchFn:l};return s(R),R})();(h=this.options.behavior)==null||h.onFetch(f,this),pe(this,ul,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=f.fetchOptions)==null?void 0:g.meta))&&Oe(this,Sr,ka).call(this,{type:"fetch",meta:(p=f.fetchOptions)==null?void 0:p.meta}),pe(this,Xt,X_({initialPromise:r==null?void 0:r.initialPromise,fn:f.fetchFn,onCancel:R=>{R instanceof xv&&R.revert&&this.setState({...F(this,ul),fetchStatus:"idle"}),o.abort()},onFail:(R,O)=>{Oe(this,Sr,ka).call(this,{type:"failed",failureCount:R,error:O})},onPause:()=>{Oe(this,Sr,ka).call(this,{type:"pause"})},onContinue:()=>{Oe(this,Sr,ka).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const R=await F(this,Xt).start();if(R===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(R),(x=(v=F(this,cr).config).onSuccess)==null||x.call(v,R,this),(S=(E=F(this,cr).config).onSettled)==null||S.call(E,R,this.state.error,this),R}catch(R){if(R instanceof xv){if(R.silent)return F(this,Xt).promise;if(R.revert){if(this.state.data===void 0)throw R;return this.state.data}}throw Oe(this,Sr,ka).call(this,{type:"error",error:R}),(C=(_=F(this,cr).config).onError)==null||C.call(_,R,this),(N=(j=F(this,cr).config).onSettled)==null||N.call(j,this.state.data,R,this),R}finally{this.scheduleGc()}}},zs=new WeakMap,ul=new WeakMap,cr=new WeakMap,Ls=new WeakMap,Xt=new WeakMap,vu=new WeakMap,Ps=new WeakMap,Sr=new WeakSet,ka=function(t){const r=o=>{switch(t.type){case"failed":return{...o,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...G_(o.data,this.options),fetchMeta:t.meta??null};case"success":const s={...o,...nS(t.data,t.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return pe(this,ul,t.manual?s:void 0),s;case"error":const l=t.error;return{...o,error:l,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...t.state}}};this.state=r(this.state),_t.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),F(this,cr).notify({query:this,type:"updated",action:t})})},m_);function G_(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:F_(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function nS(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rS(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,o=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var jn,Ke,yu,pn,Hs,dl,za,Io,xu,fl,hl,Is,Bs,Bo,ml,rt,Fc,bv,wv,Sv,Ev,_v,Cv,Nv,K_,p_,My=(p_=class extends ni{constructor(t,r){super();be(this,rt);be(this,jn);be(this,Ke);be(this,yu);be(this,pn);be(this,Hs);be(this,dl);be(this,za);be(this,Io);be(this,xu);be(this,fl);be(this,hl);be(this,Is);be(this,Bs);be(this,Bo);be(this,ml,new Set);this.options=r,pe(this,jn,t),pe(this,Io,null),pe(this,za,yv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Ke).addObserver(this),aS(F(this,Ke),this.options)?Oe(this,rt,Fc).call(this):this.updateResult(),Oe(this,rt,Ev).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jv(F(this,Ke),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jv(F(this,Ke),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Oe(this,rt,_v).call(this),Oe(this,rt,Cv).call(this),F(this,Ke).removeObserver(this)}setOptions(t){const r=this.options,o=F(this,Ke);if(this.options=F(this,jn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof dr(this.options.enabled,F(this,Ke))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Oe(this,rt,Nv).call(this),F(this,Ke).setOptions(this.options),r._defaulted&&!tu(this.options,r)&&F(this,jn).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Ke),observer:this});const s=this.hasListeners();s&&oS(F(this,Ke),o,this.options,r)&&Oe(this,rt,Fc).call(this),this.updateResult(),s&&(F(this,Ke)!==o||dr(this.options.enabled,F(this,Ke))!==dr(r.enabled,F(this,Ke))||Xo(this.options.staleTime,F(this,Ke))!==Xo(r.staleTime,F(this,Ke)))&&Oe(this,rt,bv).call(this);const l=Oe(this,rt,wv).call(this);s&&(F(this,Ke)!==o||dr(this.options.enabled,F(this,Ke))!==dr(r.enabled,F(this,Ke))||l!==F(this,Bo))&&Oe(this,rt,Sv).call(this,l)}getOptimisticResult(t){const r=F(this,jn).getQueryCache().build(F(this,jn),t),o=this.createResult(r,t);return QD(this,o)&&(pe(this,pn,o),pe(this,dl,this.options),pe(this,Hs,F(this,Ke).state)),o}getCurrentResult(){return F(this,pn)}trackResult(t,r){return new Proxy(t,{get:(o,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&F(this,za).status==="pending"&&F(this,za).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,s))})}trackProp(t){F(this,ml).add(t)}getCurrentQuery(){return F(this,Ke)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=F(this,jn).defaultQueryOptions(t),o=F(this,jn).getQueryCache().build(F(this,jn),r);return o.fetch().then(()=>this.createResult(o,r))}fetch(t){return Oe(this,rt,Fc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,pn)))}createResult(t,r){var H;const o=F(this,Ke),s=this.options,l=F(this,pn),c=F(this,Hs),f=F(this,dl),h=t!==o?t.state:F(this,yu),{state:g}=t;let p={...g},v=!1,x;if(r._optimisticResults){const Q=this.hasListeners(),V=!Q&&aS(t,r),q=Q&&oS(t,o,r,s);(V||q)&&(p={...p,...G_(g.data,t.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:E,errorUpdatedAt:S,status:_}=p;x=p.data;let C=!1;if(r.placeholderData!==void 0&&x===void 0&&_==="pending"){let Q;l!=null&&l.isPlaceholderData&&r.placeholderData===(f==null?void 0:f.placeholderData)?(Q=l.data,C=!0):Q=typeof r.placeholderData=="function"?r.placeholderData((H=F(this,hl))==null?void 0:H.state.data,F(this,hl)):r.placeholderData,Q!==void 0&&(_="success",x=vv(l==null?void 0:l.data,Q,r),v=!0)}if(r.select&&x!==void 0&&!C)if(l&&x===(c==null?void 0:c.data)&&r.select===F(this,xu))x=F(this,fl);else try{pe(this,xu,r.select),x=r.select(x),x=vv(l==null?void 0:l.data,x,r),pe(this,fl,x),pe(this,Io,null)}catch(Q){pe(this,Io,Q)}F(this,Io)&&(E=F(this,Io),x=F(this,fl),S=Date.now(),_="error");const j=p.fetchStatus==="fetching",N=_==="pending",R=_==="error",O=N&&j,A=x!==void 0,P={status:_,fetchStatus:p.fetchStatus,isPending:N,isSuccess:_==="success",isError:R,isInitialLoading:O,isLoading:O,data:x,dataUpdatedAt:p.dataUpdatedAt,error:E,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>h.dataUpdateCount||p.errorUpdateCount>h.errorUpdateCount,isFetching:j,isRefetching:j&&!N,isLoadingError:R&&!A,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:R&&A,isStale:Ay(t,r),refetch:this.refetch,promise:F(this,za),isEnabled:dr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const Q=P.data!==void 0,V=P.status==="error"&&!Q,q=K=>{V?K.reject(P.error):Q&&K.resolve(P.data)},ee=()=>{const K=pe(this,za,P.promise=yv());q(K)},B=F(this,za);switch(B.status){case"pending":t.queryHash===o.queryHash&&q(B);break;case"fulfilled":(V||P.data!==B.value)&&ee();break;case"rejected":(!V||P.error!==B.reason)&&ee();break}}return P}updateResult(){const t=F(this,pn),r=this.createResult(F(this,Ke),this.options);if(pe(this,Hs,F(this,Ke).state),pe(this,dl,this.options),F(this,Hs).data!==void 0&&pe(this,hl,F(this,Ke)),tu(r,t))return;pe(this,pn,r);const o=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!F(this,ml).size)return!0;const c=new Set(l??F(this,ml));return this.options.throwOnError&&c.add("error"),Object.keys(F(this,pn)).some(f=>{const m=f;return F(this,pn)[m]!==t[m]&&c.has(m)})};Oe(this,rt,K_).call(this,{listeners:o()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Oe(this,rt,Ev).call(this)}},jn=new WeakMap,Ke=new WeakMap,yu=new WeakMap,pn=new WeakMap,Hs=new WeakMap,dl=new WeakMap,za=new WeakMap,Io=new WeakMap,xu=new WeakMap,fl=new WeakMap,hl=new WeakMap,Is=new WeakMap,Bs=new WeakMap,Bo=new WeakMap,ml=new WeakMap,rt=new WeakSet,Fc=function(t){Oe(this,rt,Nv).call(this);let r=F(this,Ke).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(fn)),r},bv=function(){Oe(this,rt,_v).call(this);const t=Xo(this.options.staleTime,F(this,Ke));if(qs||F(this,pn).isStale||!pv(t))return;const o=V_(F(this,pn).dataUpdatedAt,t)+1;pe(this,Is,As.setTimeout(()=>{F(this,pn).isStale||this.updateResult()},o))},wv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,Ke)):this.options.refetchInterval)??!1},Sv=function(t){Oe(this,rt,Cv).call(this),pe(this,Bo,t),!(qs||dr(this.options.enabled,F(this,Ke))===!1||!pv(F(this,Bo))||F(this,Bo)===0)&&pe(this,Bs,As.setInterval(()=>{(this.options.refetchIntervalInBackground||Ry.isFocused())&&Oe(this,rt,Fc).call(this)},F(this,Bo)))},Ev=function(){Oe(this,rt,bv).call(this),Oe(this,rt,Sv).call(this,Oe(this,rt,wv).call(this))},_v=function(){F(this,Is)&&(As.clearTimeout(F(this,Is)),pe(this,Is,void 0))},Cv=function(){F(this,Bs)&&(As.clearInterval(F(this,Bs)),pe(this,Bs,void 0))},Nv=function(){const t=F(this,jn).getQueryCache().build(F(this,jn),this.options);if(t===F(this,Ke))return;const r=F(this,Ke);pe(this,Ke,t),pe(this,yu,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},K_=function(t){_t.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(F(this,pn))}),F(this,jn).getQueryCache().notify({query:F(this,Ke),type:"observerResultsUpdated"})})},p_);function KD(e,t){return dr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function aS(e,t){return KD(e,t)||e.state.data!==void 0&&jv(e,t,t.refetchOnMount)}function jv(e,t,r){if(dr(t.enabled,e)!==!1&&Xo(t.staleTime,e)!=="static"){const o=typeof r=="function"?r(e):r;return o==="always"||o!==!1&&Ay(e,t)}return!1}function oS(e,t,r,o){return(e!==t||dr(o.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ay(e,r)}function Ay(e,t){return dr(t.enabled,e)!==!1&&e.isStaleByTime(Xo(t.staleTime,e))}function QD(e,t){return!tu(e.getCurrentResult(),t)}function sS(e){return{onFetch:(t,r)=>{var g,p,v,x,E;const o=t.options,s=(v=(p=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,l=((x=t.state.data)==null?void 0:x.pages)||[],c=((E=t.state.data)==null?void 0:E.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let S=!1;const _=N=>{$D(N,()=>t.signal,()=>S=!0)},C=q_(t.options,t.fetchOptions),j=async(N,R,O)=>{if(S)return Promise.reject();if(R==null&&N.pages.length)return Promise.resolve(N);const D=(()=>{const V={client:t.client,queryKey:t.queryKey,pageParam:R,direction:O?"backward":"forward",meta:t.options.meta};return _(V),V})(),P=await C(D),{maxPages:H}=t.options,Q=O?UD:BD;return{pages:Q(N.pages,P,H),pageParams:Q(N.pageParams,R,H)}};if(s&&l.length){const N=s==="backward",R=N?ZD:iS,O={pages:l,pageParams:c},A=R(o,O);f=await j(O,A,N)}else{const N=e??l.length;do{const R=m===0?c[0]??o.initialPageParam:iS(o,f);if(m>0&&R==null)break;f=await j(f,R),m++}while(m<N)}return f};t.options.persister?t.fetchFn=()=>{var S,_;return(_=(S=t.options).persister)==null?void 0:_.call(S,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=h}}}function iS(e,{pages:t,pageParams:r}){const o=t.length-1;return t.length>0?e.getNextPageParam(t[o],t,r[o],r):void 0}function ZD(e,{pages:t,pageParams:r}){var o;return t.length>0?(o=e.getPreviousPageParam)==null?void 0:o.call(e,t[0],t,r[0],r):void 0}var bu,Yr,dn,Us,Gr,Oo,g_,WD=(g_=class extends Y_{constructor(t){super();be(this,Gr);be(this,bu);be(this,Yr);be(this,dn);be(this,Us);pe(this,bu,t.client),this.mutationId=t.mutationId,pe(this,dn,t.mutationCache),pe(this,Yr,[]),this.state=t.state||Q_(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,Yr).includes(t)||(F(this,Yr).push(t),this.clearGcTimeout(),F(this,dn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){pe(this,Yr,F(this,Yr).filter(r=>r!==t)),this.scheduleGc(),F(this,dn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,Yr).length||(this.state.status==="pending"?this.scheduleGc():F(this,dn).remove(this))}continue(){var t;return((t=F(this,Us))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,m,h,g,p,v,x,E,S,_,C,j,N,R,O,A,D;const r=()=>{Oe(this,Gr,Oo).call(this,{type:"continue"})},o={client:F(this,bu),meta:this.options.meta,mutationKey:this.options.mutationKey};pe(this,Us,X_({fn:()=>this.options.mutationFn?this.options.mutationFn(t,o):Promise.reject(new Error("No mutationFn found")),onFail:(P,H)=>{Oe(this,Gr,Oo).call(this,{type:"failed",failureCount:P,error:H})},onPause:()=>{Oe(this,Gr,Oo).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,dn).canRun(this)}));const s=this.state.status==="pending",l=!F(this,Us).canStart();try{if(s)r();else{Oe(this,Gr,Oo).call(this,{type:"pending",variables:t,isPaused:l}),F(this,dn).config.onMutate&&await F(this,dn).config.onMutate(t,this,o);const H=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,o));H!==this.state.context&&Oe(this,Gr,Oo).call(this,{type:"pending",context:H,variables:t,isPaused:l})}const P=await F(this,Us).start();return await((h=(m=F(this,dn).config).onSuccess)==null?void 0:h.call(m,P,t,this.state.context,this,o)),await((p=(g=this.options).onSuccess)==null?void 0:p.call(g,P,t,this.state.context,o)),await((x=(v=F(this,dn).config).onSettled)==null?void 0:x.call(v,P,null,this.state.variables,this.state.context,this,o)),await((S=(E=this.options).onSettled)==null?void 0:S.call(E,P,null,t,this.state.context,o)),Oe(this,Gr,Oo).call(this,{type:"success",data:P}),P}catch(P){try{await((C=(_=F(this,dn).config).onError)==null?void 0:C.call(_,P,t,this.state.context,this,o))}catch(H){Promise.reject(H)}try{await((N=(j=this.options).onError)==null?void 0:N.call(j,P,t,this.state.context,o))}catch(H){Promise.reject(H)}try{await((O=(R=F(this,dn).config).onSettled)==null?void 0:O.call(R,void 0,P,this.state.variables,this.state.context,this,o))}catch(H){Promise.reject(H)}try{await((D=(A=this.options).onSettled)==null?void 0:D.call(A,void 0,P,t,this.state.context,o))}catch(H){Promise.reject(H)}throw Oe(this,Gr,Oo).call(this,{type:"error",error:P}),P}finally{F(this,dn).runNext(this)}}},bu=new WeakMap,Yr=new WeakMap,dn=new WeakMap,Us=new WeakMap,Gr=new WeakSet,Oo=function(t){const r=o=>{switch(t.type){case"failed":return{...o,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...o,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:t.error,failureCount:o.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),_t.batch(()=>{F(this,Yr).forEach(o=>{o.onMutationUpdate(t)}),F(this,dn).notify({mutation:this,type:"updated",action:t})})},g_);function Q_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var La,Er,wu,v_,JD=(v_=class extends ni{constructor(t={}){super();be(this,La);be(this,Er);be(this,wu);this.config=t,pe(this,La,new Set),pe(this,Er,new Map),pe(this,wu,0)}build(t,r,o){const s=new WD({client:t,mutationCache:this,mutationId:++df(this,wu)._,options:t.defaultMutationOptions(r),state:o});return this.add(s),s}add(t){F(this,La).add(t);const r=hf(t);if(typeof r=="string"){const o=F(this,Er).get(r);o?o.push(t):F(this,Er).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,La).delete(t)){const r=hf(t);if(typeof r=="string"){const o=F(this,Er).get(r);if(o)if(o.length>1){const s=o.indexOf(t);s!==-1&&o.splice(s,1)}else o[0]===t&&F(this,Er).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=hf(t);if(typeof r=="string"){const o=F(this,Er).get(r),s=o==null?void 0:o.find(l=>l.state.status==="pending");return!s||s===t}else return!0}runNext(t){var o;const r=hf(t);if(typeof r=="string"){const s=(o=F(this,Er).get(r))==null?void 0:o.find(l=>l!==t&&l.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){_t.batch(()=>{F(this,La).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,La).clear(),F(this,Er).clear()})}getAll(){return Array.from(F(this,La))}find(t){const r={exact:!0,...t};return this.getAll().find(o=>Jw(r,o))}findAll(t={}){return this.getAll().filter(r=>Jw(t,r))}notify(t){_t.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return _t.batch(()=>Promise.all(t.map(r=>r.continue().catch(fn))))}},La=new WeakMap,Er=new WeakMap,wu=new WeakMap,v_);function hf(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Pa,Uo,Tn,Ha,Ba,kf,Tv,y_,e3=(y_=class extends ni{constructor(r,o){super();be(this,Ba);be(this,Pa);be(this,Uo);be(this,Tn);be(this,Ha);pe(this,Pa,r),this.setOptions(o),this.bindMethods(),Oe(this,Ba,kf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const o=this.options;this.options=F(this,Pa).defaultMutationOptions(r),tu(this.options,o)||F(this,Pa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,Tn),observer:this}),o!=null&&o.mutationKey&&this.options.mutationKey&&Fs(o.mutationKey)!==Fs(this.options.mutationKey)?this.reset():((s=F(this,Tn))==null?void 0:s.state.status)==="pending"&&F(this,Tn).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=F(this,Tn))==null||r.removeObserver(this)}onMutationUpdate(r){Oe(this,Ba,kf).call(this),Oe(this,Ba,Tv).call(this,r)}getCurrentResult(){return F(this,Uo)}reset(){var r;(r=F(this,Tn))==null||r.removeObserver(this),pe(this,Tn,void 0),Oe(this,Ba,kf).call(this),Oe(this,Ba,Tv).call(this)}mutate(r,o){var s;return pe(this,Ha,o),(s=F(this,Tn))==null||s.removeObserver(this),pe(this,Tn,F(this,Pa).getMutationCache().build(F(this,Pa),this.options)),F(this,Tn).addObserver(this),F(this,Tn).execute(r)}},Pa=new WeakMap,Uo=new WeakMap,Tn=new WeakMap,Ha=new WeakMap,Ba=new WeakSet,kf=function(){var o;const r=((o=F(this,Tn))==null?void 0:o.state)??Q_();pe(this,Uo,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Tv=function(r){_t.batch(()=>{var o,s,l,c,f,m,h,g;if(F(this,Ha)&&this.hasListeners()){const p=F(this,Uo).variables,v=F(this,Uo).context,x={client:F(this,Pa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(s=(o=F(this,Ha)).onSuccess)==null||s.call(o,r.data,p,v,x)}catch(E){Promise.reject(E)}try{(c=(l=F(this,Ha)).onSettled)==null||c.call(l,r.data,null,p,v,x)}catch(E){Promise.reject(E)}}else if((r==null?void 0:r.type)==="error"){try{(m=(f=F(this,Ha)).onError)==null||m.call(f,r.error,p,v,x)}catch(E){Promise.reject(E)}try{(g=(h=F(this,Ha)).onSettled)==null||g.call(h,void 0,r.error,p,v,x)}catch(E){Promise.reject(E)}}}this.listeners.forEach(p=>{p(F(this,Uo))})})},y_);function lS(e,t){const r=new Set(t);return e.filter(o=>!r.has(o))}function t3(e,t,r){const o=e.slice(0);return o[t]=r,o}var pl,Fn,gl,vl,ur,$o,Su,Eu,_u,Cu,nn,Rv,Mv,Av,Ov,Dv,x_,n3=(x_=class extends ni{constructor(t,r,o){super();be(this,nn);be(this,pl);be(this,Fn);be(this,gl);be(this,vl);be(this,ur);be(this,$o);be(this,Su);be(this,Eu);be(this,_u);be(this,Cu,[]);pe(this,pl,t),pe(this,vl,o),pe(this,gl,[]),pe(this,ur,[]),pe(this,Fn,[]),this.setQueries(r)}onSubscribe(){this.listeners.size===1&&F(this,ur).forEach(t=>{t.subscribe(r=>{Oe(this,nn,Ov).call(this,t,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,F(this,ur).forEach(t=>{t.destroy()})}setQueries(t,r){pe(this,gl,t),pe(this,vl,r),_t.batch(()=>{const o=F(this,ur),s=Oe(this,nn,Av).call(this,F(this,gl));s.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const l=s.map(p=>p.observer),c=l.map(p=>p.getCurrentResult()),f=o.length!==l.length,m=l.some((p,v)=>p!==o[v]),h=f||m,g=h?!0:c.some((p,v)=>{const x=F(this,Fn)[v];return!x||!tu(p,x)});!h&&!g||(h&&(pe(this,Cu,s),pe(this,ur,l)),pe(this,Fn,c),this.hasListeners()&&(h&&(lS(o,l).forEach(p=>{p.destroy()}),lS(l,o).forEach(p=>{p.subscribe(v=>{Oe(this,nn,Ov).call(this,p,v)})})),Oe(this,nn,Dv).call(this)))})}getCurrentResult(){return F(this,Fn)}getQueries(){return F(this,ur).map(t=>t.getCurrentQuery())}getObservers(){return F(this,ur)}getOptimisticResult(t,r){const o=Oe(this,nn,Av).call(this,t),s=o.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),l=o.map(c=>c.defaultedQueryOptions.queryHash);return[s,c=>Oe(this,nn,Mv).call(this,c??s,r,l),()=>Oe(this,nn,Rv).call(this,s,o)]}},pl=new WeakMap,Fn=new WeakMap,gl=new WeakMap,vl=new WeakMap,ur=new WeakMap,$o=new WeakMap,Su=new WeakMap,Eu=new WeakMap,_u=new WeakMap,Cu=new WeakMap,nn=new WeakSet,Rv=function(t,r){return r.map((o,s)=>{const l=t[s];return o.defaultedQueryOptions.notifyOnChangeProps?l:o.observer.trackResult(l,c=>{r.forEach(f=>{f.observer.trackProp(c)})})})},Mv=function(t,r,o){if(r){const s=F(this,_u),l=o!==void 0&&s!==void 0&&(s.length!==o.length||o.some((c,f)=>c!==s[f]));return(!F(this,$o)||F(this,Fn)!==F(this,Eu)||l||r!==F(this,Su))&&(pe(this,Su,r),pe(this,Eu,F(this,Fn)),o!==void 0&&pe(this,_u,o),pe(this,$o,Ny(F(this,$o),r(t)))),F(this,$o)}return t},Av=function(t){const r=new Map;F(this,ur).forEach(s=>{const l=s.options.queryHash;if(!l)return;const c=r.get(l);c?c.push(s):r.set(l,[s])});const o=[];return t.forEach(s=>{var m;const l=F(this,pl).defaultQueryOptions(s),f=((m=r.get(l.queryHash))==null?void 0:m.shift())??new My(F(this,pl),l);o.push({defaultedQueryOptions:l,observer:f})}),o},Ov=function(t,r){const o=F(this,ur).indexOf(t);o!==-1&&(pe(this,Fn,t3(F(this,Fn),o,r)),Oe(this,nn,Dv).call(this))},Dv=function(){var t;if(this.hasListeners()){const r=F(this,$o),o=Oe(this,nn,Rv).call(this,F(this,Fn),F(this,Cu)),s=Oe(this,nn,Mv).call(this,o,(t=F(this,vl))==null?void 0:t.combine);r!==s&&_t.batch(()=>{this.listeners.forEach(l=>{l(F(this,Fn))})})}},x_),Kr,b_,r3=(b_=class extends ni{constructor(t={}){super();be(this,Kr);this.config=t,pe(this,Kr,new Map)}build(t,r,o){const s=r.queryKey,l=r.queryHash??Cy(s,r);let c=this.get(l);return c||(c=new GD({client:t,queryKey:s,queryHash:l,options:t.defaultQueryOptions(r),state:o,defaultOptions:t.getQueryDefaults(s)}),this.add(c)),c}add(t){F(this,Kr).has(t.queryHash)||(F(this,Kr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=F(this,Kr).get(t.queryHash);r&&(t.destroy(),r===t&&F(this,Kr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){_t.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,Kr).get(t)}getAll(){return[...F(this,Kr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(o=>Ww(r,o))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(o=>Ww(t,o)):r}notify(t){_t.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){_t.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){_t.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Kr=new WeakMap,b_),Et,Vo,qo,yl,xl,Fo,bl,wl,w_,a3=(w_=class{constructor(e={}){be(this,Et);be(this,Vo);be(this,qo);be(this,yl);be(this,xl);be(this,Fo);be(this,bl);be(this,wl);pe(this,Et,e.queryCache||new r3),pe(this,Vo,e.mutationCache||new JD),pe(this,qo,e.defaultOptions||{}),pe(this,yl,new Map),pe(this,xl,new Map),pe(this,Fo,0)}mount(){df(this,Fo)._++,F(this,Fo)===1&&(pe(this,bl,Ry.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,Et).onFocus())})),pe(this,wl,Yf.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,Et).onOnline())})))}unmount(){var e,t;df(this,Fo)._--,F(this,Fo)===0&&((e=F(this,bl))==null||e.call(this),pe(this,bl,void 0),(t=F(this,wl))==null||t.call(this),pe(this,wl,void 0))}isFetching(e){return F(this,Et).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,Vo).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,Et).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=F(this,Et).build(this,t),o=r.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Xo(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return F(this,Et).findAll(e).map(({queryKey:t,state:r})=>{const o=r.data;return[t,o]})}setQueryData(e,t,r){const o=this.defaultQueryOptions({queryKey:e}),s=F(this,Et).get(o.queryHash),l=s==null?void 0:s.state.data,c=PD(t,l);if(c!==void 0)return F(this,Et).build(this,o).setData(c,{...r,manual:!0})}setQueriesData(e,t,r){return _t.batch(()=>F(this,Et).findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,Et).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=F(this,Et);_t.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=F(this,Et);return _t.batch(()=>(r.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},o=_t.batch(()=>F(this,Et).findAll(e).map(s=>s.cancel(r)));return Promise.all(o).then(fn).catch(fn)}invalidateQueries(e,t={}){return _t.batch(()=>(F(this,Et).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},o=_t.batch(()=>F(this,Et).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let l=s.fetch(void 0,r);return r.throwOnError||(l=l.catch(fn)),s.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(o).then(fn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=F(this,Et).build(this,t);return r.isStaleByTime(Xo(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(fn).catch(fn)}fetchInfiniteQuery(e){return e.behavior=sS(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(fn).catch(fn)}ensureInfiniteQueryData(e){return e.behavior=sS(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Yf.isOnline()?F(this,Vo).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,Et)}getMutationCache(){return F(this,Vo)}getDefaultOptions(){return F(this,qo)}setDefaultOptions(e){pe(this,qo,e)}setQueryDefaults(e,t){F(this,yl).set(Fs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,yl).values()],r={};return t.forEach(o=>{eu(e,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(e,t){F(this,xl).set(Fs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,xl).values()],r={};return t.forEach(o=>{eu(e,o.mutationKey)&&Object.assign(r,o.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,qo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Cy(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===jy&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,qo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,Et).clear(),F(this,Vo).clear()}},Et=new WeakMap,Vo=new WeakMap,qo=new WeakMap,yl=new WeakMap,xl=new WeakMap,Fo=new WeakMap,bl=new WeakMap,wl=new WeakMap,w_),Z_=b.createContext(void 0),ft=e=>{const t=b.useContext(Z_);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},o3=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(Z_.Provider,{value:e,children:t})),W_=b.createContext(!1),J_=()=>b.useContext(W_);W_.Provider;function s3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var i3=b.createContext(s3()),eC=()=>b.useContext(i3),tC=(e,t,r)=>{const o=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Ty(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||o)&&(t.isReset()||(e.retryOnMount=!1))},nC=e=>{b.useEffect(()=>{e.clearReset()},[e])},rC=({result:e,errorResetBoundary:t,throwOnError:r,query:o,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&o&&(s&&e.data===void 0||Ty(r,[e.error,o])),aC=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...s)=>r(o(...s)):r(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},l3=(e,t)=>e.isLoading&&e.isFetching&&!t,kv=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,zv=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function c3({queries:e,...t},r){const o=ft(),s=J_(),l=eC(),c=b.useMemo(()=>e.map(S=>{const _=o.defaultQueryOptions(S);return _._optimisticResults=s?"isRestoring":"optimistic",_}),[e,o,s]);c.forEach(S=>{aC(S);const _=o.getQueryCache().get(S.queryHash);tC(S,l,_)}),nC(l);const[f]=b.useState(()=>new n3(o,c,t)),[m,h,g]=f.getOptimisticResult(c,t.combine),p=!s&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(S=>p?f.subscribe(_t.batchCalls(S)):fn,[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setQueries(c,t)},[c,t,f]);const x=m.some((S,_)=>kv(c[_],S))?m.flatMap((S,_)=>{const C=c[_];if(C&&kv(C,S)){const j=new My(o,C);return zv(C,j,l)}return[]}):[];if(x.length>0)throw Promise.all(x);const E=m.find((S,_)=>{const C=c[_];return C&&rC({result:S,errorResetBoundary:l,throwOnError:C.throwOnError,query:o.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(E!=null&&E.error)throw E.error;return h(g())}function u3(e,t,r){var v,x,E,S;const o=J_(),s=eC(),l=ft(),c=l.defaultQueryOptions(e);(x=(v=l.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||x.call(v,c);const f=l.getQueryCache().get(c.queryHash);c._optimisticResults=o?"isRestoring":"optimistic",aC(c),tC(c,s,f),nC(s);const m=!l.getQueryCache().get(c.queryHash),[h]=b.useState(()=>new t(l,c)),g=h.getOptimisticResult(c),p=!o&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(_=>{const C=p?h.subscribe(_t.batchCalls(_)):fn;return h.updateResult(),C},[h,p]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),b.useEffect(()=>{h.setOptions(c)},[c,h]),kv(c,g))throw zv(c,h,s);if(rC({result:g,errorResetBoundary:s,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw g.error;if((S=(E=l.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||S.call(E,c,g),c.experimental_prefetchInRender&&!qs&&l3(g,o)){const _=m?zv(c,h,s):f==null?void 0:f.promise;_==null||_.catch(fn).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?g:h.trackResult(g)}function rn(e,t){return u3(e,My)}function Ct(e,t){const r=ft(),[o]=b.useState(()=>new e3(r,e));b.useEffect(()=>{o.setOptions(e)},[o,e]);const s=b.useSyncExternalStore(b.useCallback(c=>o.subscribe(_t.batchCalls(c)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),l=b.useCallback((c,f)=>{o.mutate(c,f).catch(fn)},[o]);if(s.error&&Ty(o.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:l,mutateAsync:s.mutate}}var d3=(e,t,r,o,s,l,c,f)=>{let m=document.documentElement,h=["light","dark"];function g(x){(Array.isArray(e)?e:[e]).forEach(E=>{let S=E==="class",_=S&&l?s.map(C=>l[C]||C):s;S?(m.classList.remove(..._),m.classList.add(l&&l[x]?l[x]:x)):m.setAttribute(E,x)}),p(x)}function p(x){f&&h.includes(x)&&(m.style.colorScheme=x)}function v(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)g(o);else try{let x=localStorage.getItem(t)||r,E=c&&x==="system"?v():x;g(E)}catch{}},cS=["light","dark"],oC="(prefers-color-scheme: dark)",f3=typeof window>"u",Oy=b.createContext(void 0),h3={setTheme:e=>{},themes:[]},Dy=()=>{var e;return(e=b.useContext(Oy))!=null?e:h3},m3=e=>b.useContext(Oy)?b.createElement(b.Fragment,null,e.children):b.createElement(g3,{...e}),p3=["light","dark"],g3=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:o=!0,storageKey:s="theme",themes:l=p3,defaultTheme:c=r?"system":"light",attribute:f="data-theme",value:m,children:h,nonce:g,scriptProps:p})=>{let[v,x]=b.useState(()=>y3(s,c)),[E,S]=b.useState(()=>v==="system"?Ag():v),_=m?Object.values(m):l,C=b.useCallback(O=>{let A=O;if(!A)return;O==="system"&&r&&(A=Ag());let D=m?m[A]:A,P=t?x3(g):null,H=document.documentElement,Q=V=>{V==="class"?(H.classList.remove(..._),D&&H.classList.add(D)):V.startsWith("data-")&&(D?H.setAttribute(V,D):H.removeAttribute(V))};if(Array.isArray(f)?f.forEach(Q):Q(f),o){let V=cS.includes(c)?c:null,q=cS.includes(A)?A:V;H.style.colorScheme=q}P==null||P()},[g]),j=b.useCallback(O=>{let A=typeof O=="function"?O(v):O;x(A);try{localStorage.setItem(s,A)}catch{}},[v]),N=b.useCallback(O=>{let A=Ag(O);S(A),v==="system"&&r&&!e&&C("system")},[v,e]);b.useEffect(()=>{let O=window.matchMedia(oC);return O.addListener(N),N(O),()=>O.removeListener(N)},[N]),b.useEffect(()=>{let O=A=>{A.key===s&&(A.newValue?x(A.newValue):j(c))};return window.addEventListener("storage",O),()=>window.removeEventListener("storage",O)},[j]),b.useEffect(()=>{C(e??v)},[e,v]);let R=b.useMemo(()=>({theme:v,setTheme:j,forcedTheme:e,resolvedTheme:v==="system"?E:v,themes:r?[...l,"system"]:l,systemTheme:r?E:void 0}),[v,j,e,E,r,l]);return b.createElement(Oy.Provider,{value:R},b.createElement(v3,{forcedTheme:e,storageKey:s,attribute:f,enableSystem:r,enableColorScheme:o,defaultTheme:c,value:m,themes:l,nonce:g,scriptProps:p}),h)},v3=b.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:o,enableColorScheme:s,defaultTheme:l,value:c,themes:f,nonce:m,scriptProps:h})=>{let g=JSON.stringify([r,t,l,e,f,c,o,s]).slice(1,-1);return b.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?m:"",dangerouslySetInnerHTML:{__html:`(${d3.toString()})(${g})`}})}),y3=(e,t)=>{if(f3)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},x3=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Ag=e=>(e||(e=window.matchMedia(oC)),e.matches?"dark":"light");function uS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function $a(...e){return t=>{let r=!1;const o=e.map(s=>{const l=uS(s,t);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let s=0;s<o.length;s++){const l=o[s];typeof l=="function"?l():uS(e[s],null)}}}}function Xe(...e){return b.useCallback($a(...e),e)}function Xs(e){const t=b3(e),r=b.forwardRef((o,s)=>{const{children:l,...c}=o,f=b.Children.toArray(l),m=f.find(S3);if(m){const h=m.props.children,g=f.map(p=>p===m?b.Children.count(h)>1?b.Children.only(null):b.isValidElement(h)?h.props.children:null:p);return d.jsx(t,{...c,ref:s,children:b.isValidElement(h)?b.cloneElement(h,void 0,g):null})}return d.jsx(t,{...c,ref:s,children:l})});return r.displayName=`${e}.Slot`,r}var ky=Xs("Slot");function b3(e){const t=b.forwardRef((r,o)=>{const{children:s,...l}=r;if(b.isValidElement(s)){const c=_3(s),f=E3(l,s.props);return s.type!==b.Fragment&&(f.ref=o?$a(o,c):c),b.cloneElement(s,f)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sC=Symbol("radix.slottable");function w3(e){const t=({children:r})=>d.jsx(d.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=sC,t}function S3(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sC}function E3(e,t){const r={...t};for(const o in t){const s=e[o],l=t[o];/^on[A-Z]/.test(o)?s&&l?r[o]=(...f)=>{const m=l(...f);return s(...f),m}:s&&(r[o]=s):o==="style"?r[o]={...s,...l}:o==="className"&&(r[o]=[s,l].filter(Boolean).join(" "))}return{...e,...r}}function _3(e){var o,s;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var C3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],je=C3.reduce((e,t)=>{const r=Xs(`Primitive.${t}`),o=b.forwardRef((s,l)=>{const{asChild:c,...f}=s,m=c?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:l})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function iC(e,t){e&&Mu.flushSync(()=>e.dispatchEvent(t))}var lC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),N3="VisuallyHidden",cC=b.forwardRef((e,t)=>d.jsx(je.span,{...e,ref:t,style:{...lC,...e.style}}));cC.displayName=N3;var j3=cC;function T3(e,t){const r=b.createContext(t),o=l=>{const{children:c,...f}=l,m=b.useMemo(()=>f,Object.values(f));return d.jsx(r.Provider,{value:m,children:c})};o.displayName=e+"Provider";function s(l){const c=b.useContext(r);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[o,s]}function Dr(e,t=[]){let r=[];function o(l,c){const f=b.createContext(c),m=r.length;r=[...r,c];const h=p=>{var C;const{scope:v,children:x,...E}=p,S=((C=v==null?void 0:v[e])==null?void 0:C[m])||f,_=b.useMemo(()=>E,Object.values(E));return d.jsx(S.Provider,{value:_,children:x})};h.displayName=l+"Provider";function g(p,v){var S;const x=((S=v==null?void 0:v[e])==null?void 0:S[m])||f,E=b.useContext(x);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[h,g]}const s=()=>{const l=r.map(c=>b.createContext(c));return function(f){const m=(f==null?void 0:f[e])||l;return b.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return s.scopeName=e,[o,R3(s,...t)]}function R3(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const c=o.reduce((f,{useScope:m,scopeName:h})=>{const p=m(l)[`__scope${h}`];return{...f,...p}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return r.scopeName=t.scopeName,r}function zy(e){const t=e+"CollectionProvider",[r,o]=Dr(t),[s,l]=r(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:_,children:C}=S,j=me.useRef(null),N=me.useRef(new Map).current;return d.jsx(s,{scope:_,itemMap:N,collectionRef:j,children:C})};c.displayName=t;const f=e+"CollectionSlot",m=Xs(f),h=me.forwardRef((S,_)=>{const{scope:C,children:j}=S,N=l(f,C),R=Xe(_,N.collectionRef);return d.jsx(m,{ref:R,children:j})});h.displayName=f;const g=e+"CollectionItemSlot",p="data-radix-collection-item",v=Xs(g),x=me.forwardRef((S,_)=>{const{scope:C,children:j,...N}=S,R=me.useRef(null),O=Xe(_,R),A=l(g,C);return me.useEffect(()=>(A.itemMap.set(R,{ref:R,...N}),()=>void A.itemMap.delete(R))),d.jsx(v,{[p]:"",ref:O,children:j})});x.displayName=g;function E(S){const _=l(e+"CollectionConsumer",S);return me.useCallback(()=>{const j=_.collectionRef.current;if(!j)return[];const N=Array.from(j.querySelectorAll(`[${p}]`));return Array.from(_.itemMap.values()).sort((A,D)=>N.indexOf(A.ref.current)-N.indexOf(D.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:c,Slot:h,ItemSlot:x},E,o]}function xe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}var Gt=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},M3=S_[" useInsertionEffect ".trim().toString()]||Gt;function Go({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[s,l,c]=A3({defaultProp:t,onChange:r}),f=e!==void 0,m=f?e:s;{const g=b.useRef(e!==void 0);b.useEffect(()=>{const p=g.current;p!==f&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=f},[f,o])}const h=b.useCallback(g=>{var p;if(f){const v=O3(g)?g(e):g;v!==e&&((p=c.current)==null||p.call(c,v))}else l(g)},[f,e,l,c]);return[m,h]}function A3({defaultProp:e,onChange:t}){const[r,o]=b.useState(e),s=b.useRef(r),l=b.useRef(t);return M3(()=>{l.current=t},[t]),b.useEffect(()=>{var c;s.current!==r&&((c=l.current)==null||c.call(l,r),s.current=r)},[r,s]),[r,o,l]}function O3(e){return typeof e=="function"}function D3(e,t){return b.useReducer((r,o)=>t[r][o]??r,e)}var hn=e=>{const{present:t,children:r}=e,o=k3(t),s=typeof r=="function"?r({present:o.isPresent}):b.Children.only(r),l=Xe(o.ref,z3(s));return typeof r=="function"||o.isPresent?b.cloneElement(s,{ref:l}):null};hn.displayName="Presence";function k3(e){const[t,r]=b.useState(),o=b.useRef(null),s=b.useRef(e),l=b.useRef("none"),c=e?"mounted":"unmounted",[f,m]=D3(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const h=mf(o.current);l.current=f==="mounted"?h:"none"},[f]),Gt(()=>{const h=o.current,g=s.current;if(g!==e){const v=l.current,x=mf(h);e?m("MOUNT"):x==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(g&&v!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,m]),Gt(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,p=x=>{const S=mf(o.current).includes(CSS.escape(x.animationName));if(x.target===t&&S&&(m("ANIMATION_END"),!s.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},v=x=>{x.target===t&&(l.current=mf(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{g.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:b.useCallback(h=>{o.current=h?getComputedStyle(h):null,r(h)},[])}}function mf(e){return(e==null?void 0:e.animationName)||"none"}function z3(e){var o,s;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var L3=S_[" useId ".trim().toString()]||(()=>{}),P3=0;function Yt(e){const[t,r]=b.useState(L3());return Gt(()=>{r(o=>o??String(P3++))},[e]),e||(t?`radix-${t}`:"")}var Nh="Collapsible",[H3]=Dr(Nh),[I3,Ly]=H3(Nh),uC=b.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:o,defaultOpen:s,disabled:l,onOpenChange:c,...f}=e,[m,h]=Go({prop:o,defaultProp:s??!1,onChange:c,caller:Nh});return d.jsx(I3,{scope:r,disabled:l,contentId:Yt(),open:m,onOpenToggle:b.useCallback(()=>h(g=>!g),[h]),children:d.jsx(je.div,{"data-state":Hy(m),"data-disabled":l?"":void 0,...f,ref:t})})});uC.displayName=Nh;var dC="CollapsibleTrigger",fC=b.forwardRef((e,t)=>{const{__scopeCollapsible:r,...o}=e,s=Ly(dC,r);return d.jsx(je.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Hy(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...o,ref:t,onClick:xe(e.onClick,s.onOpenToggle)})});fC.displayName=dC;var Py="CollapsibleContent",hC=b.forwardRef((e,t)=>{const{forceMount:r,...o}=e,s=Ly(Py,e.__scopeCollapsible);return d.jsx(hn,{present:r||s.open,children:({present:l})=>d.jsx(B3,{...o,ref:t,present:l})})});hC.displayName=Py;var B3=b.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:o,children:s,...l}=e,c=Ly(Py,r),[f,m]=b.useState(o),h=b.useRef(null),g=Xe(t,h),p=b.useRef(0),v=p.current,x=b.useRef(0),E=x.current,S=c.open||f,_=b.useRef(S),C=b.useRef(void 0);return b.useEffect(()=>{const j=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(j)},[]),Gt(()=>{const j=h.current;if(j){C.current=C.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const N=j.getBoundingClientRect();p.current=N.height,x.current=N.width,_.current||(j.style.transitionDuration=C.current.transitionDuration,j.style.animationName=C.current.animationName),m(o)}},[c.open,o]),d.jsx(je.div,{"data-state":Hy(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!S,...l,ref:g,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":E?`${E}px`:void 0,...e.style},children:S&&s})});function Hy(e){return e?"open":"closed"}var U3=uC,$3=b.createContext(void 0);function Au(e){const t=b.useContext($3);return e||t||"ltr"}function en(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[])}function V3(e,t=globalThis==null?void 0:globalThis.document){const r=en(e);b.useEffect(()=>{const o=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var q3="DismissableLayer",Lv="dismissableLayer.update",F3="dismissableLayer.pointerDownOutside",X3="dismissableLayer.focusOutside",dS,mC=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ou=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:f,...m}=e,h=b.useContext(mC),[g,p]=b.useState(null),v=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=b.useState({}),E=Xe(t,D=>p(D)),S=Array.from(h.layers),[_]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S.indexOf(_),j=g?S.indexOf(g):-1,N=h.layersWithOutsidePointerEventsDisabled.size>0,R=j>=C,O=K3(D=>{const P=D.target,H=[...h.branches].some(Q=>Q.contains(P));!R||H||(s==null||s(D),c==null||c(D),D.defaultPrevented||f==null||f())},v),A=Q3(D=>{const P=D.target;[...h.branches].some(Q=>Q.contains(P))||(l==null||l(D),c==null||c(D),D.defaultPrevented||f==null||f())},v);return V3(D=>{j===h.layers.size-1&&(o==null||o(D),!D.defaultPrevented&&f&&(D.preventDefault(),f()))},v),b.useEffect(()=>{if(g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(dS=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),fS(),()=>{r&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=dS)}},[g,v,r,h]),b.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),fS())},[g,h]),b.useEffect(()=>{const D=()=>x({});return document.addEventListener(Lv,D),()=>document.removeEventListener(Lv,D)},[]),d.jsx(je.div,{...m,ref:E,style:{pointerEvents:N?R?"auto":"none":void 0,...e.style},onFocusCapture:xe(e.onFocusCapture,A.onFocusCapture),onBlurCapture:xe(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:xe(e.onPointerDownCapture,O.onPointerDownCapture)})});Ou.displayName=q3;var Y3="DismissableLayerBranch",G3=b.forwardRef((e,t)=>{const r=b.useContext(mC),o=b.useRef(null),s=Xe(t,o);return b.useEffect(()=>{const l=o.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),d.jsx(je.div,{...e,ref:s})});G3.displayName=Y3;function K3(e,t=globalThis==null?void 0:globalThis.document){const r=en(e),o=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const l=f=>{if(f.target&&!o.current){let m=function(){pC(F3,r,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=m,t.addEventListener("click",s.current,{once:!0})):m()}else t.removeEventListener("click",s.current);o.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function Q3(e,t=globalThis==null?void 0:globalThis.document){const r=en(e),o=b.useRef(!1);return b.useEffect(()=>{const s=l=>{l.target&&!o.current&&pC(X3,r,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function fS(){const e=new CustomEvent(Lv);document.dispatchEvent(e)}function pC(e,t,r,{discrete:o}){const s=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),o?iC(s,l):s.dispatchEvent(l)}var Og="focusScope.autoFocusOnMount",Dg="focusScope.autoFocusOnUnmount",hS={bubbles:!1,cancelable:!0},Z3="FocusScope",jh=b.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...c}=e,[f,m]=b.useState(null),h=en(s),g=en(l),p=b.useRef(null),v=Xe(t,S=>m(S)),x=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(o){let S=function(N){if(x.paused||!f)return;const R=N.target;f.contains(R)?p.current=R:Do(p.current,{select:!0})},_=function(N){if(x.paused||!f)return;const R=N.relatedTarget;R!==null&&(f.contains(R)||Do(p.current,{select:!0}))},C=function(N){if(document.activeElement===document.body)for(const O of N)O.removedNodes.length>0&&Do(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",_);const j=new MutationObserver(C);return f&&j.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",_),j.disconnect()}}},[o,f,x.paused]),b.useEffect(()=>{if(f){pS.add(x);const S=document.activeElement;if(!f.contains(S)){const C=new CustomEvent(Og,hS);f.addEventListener(Og,h),f.dispatchEvent(C),C.defaultPrevented||(W3(rk(gC(f)),{select:!0}),document.activeElement===S&&Do(f))}return()=>{f.removeEventListener(Og,h),setTimeout(()=>{const C=new CustomEvent(Dg,hS);f.addEventListener(Dg,g),f.dispatchEvent(C),C.defaultPrevented||Do(S??document.body,{select:!0}),f.removeEventListener(Dg,g),pS.remove(x)},0)}}},[f,h,g,x]);const E=b.useCallback(S=>{if(!r&&!o||x.paused)return;const _=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,C=document.activeElement;if(_&&C){const j=S.currentTarget,[N,R]=J3(j);N&&R?!S.shiftKey&&C===R?(S.preventDefault(),r&&Do(N,{select:!0})):S.shiftKey&&C===N&&(S.preventDefault(),r&&Do(R,{select:!0})):C===j&&S.preventDefault()}},[r,o,x.paused]);return d.jsx(je.div,{tabIndex:-1,...c,ref:v,onKeyDown:E})});jh.displayName=Z3;function W3(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(Do(o,{select:t}),document.activeElement!==r)return}function J3(e){const t=gC(e),r=mS(t,e),o=mS(t.reverse(),e);return[r,o]}function gC(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const s=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||s?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function mS(e,t){for(const r of e)if(!ek(r,{upTo:t}))return r}function ek(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function tk(e){return e instanceof HTMLInputElement&&"select"in e}function Do(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&tk(e)&&t&&e.select()}}var pS=nk();function nk(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=gS(e,t),e.unshift(t)},remove(t){var r;e=gS(e,t),(r=e[0])==null||r.resume()}}}function gS(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function rk(e){return e.filter(t=>t.tagName!=="A")}var ak="Portal",Du=b.forwardRef((e,t)=>{var f;const{container:r,...o}=e,[s,l]=b.useState(!1);Gt(()=>l(!0),[]);const c=r||s&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?$_.createPortal(d.jsx(je.div,{...o,ref:t}),c):null});Du.displayName=ak;var kg=0;function Iy(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??vS()),document.body.insertAdjacentElement("beforeend",e[1]??vS()),kg++,()=>{kg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),kg--}},[])}function vS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Zr=function(){return Zr=Object.assign||function(t){for(var r,o=1,s=arguments.length;o<s;o++){r=arguments[o];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(t[l]=r[l])}return t},Zr.apply(this,arguments)};function vC(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(e);s<o.length;s++)t.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(e,o[s])&&(r[o[s]]=e[o[s]]);return r}function ok(e,t,r){if(r||arguments.length===2)for(var o=0,s=t.length,l;o<s;o++)(l||!(o in t))&&(l||(l=Array.prototype.slice.call(t,0,o)),l[o]=t[o]);return e.concat(l||Array.prototype.slice.call(t))}var zf="right-scroll-bar-position",Lf="width-before-scroll-bar",sk="with-scroll-bars-hidden",ik="--removed-body-scroll-bar-size";function zg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function lk(e,t){var r=b.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var s=r.value;s!==o&&(r.value=o,r.callback(o,s))}}}})[0];return r.callback=t,r.facade}var ck=typeof window<"u"?b.useLayoutEffect:b.useEffect,yS=new WeakMap;function uk(e,t){var r=lk(null,function(o){return e.forEach(function(s){return zg(s,o)})});return ck(function(){var o=yS.get(r);if(o){var s=new Set(o),l=new Set(e),c=r.current;s.forEach(function(f){l.has(f)||zg(f,null)}),l.forEach(function(f){s.has(f)||zg(f,c)})}yS.set(r,e)},[e]),r}function dk(e){return e}function fk(e,t){t===void 0&&(t=dk);var r=[],o=!1,s={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(l){var c=t(l,o);return r.push(c),function(){r=r.filter(function(f){return f!==c})}},assignSyncMedium:function(l){for(o=!0;r.length;){var c=r;r=[],c.forEach(l)}r={push:function(f){return l(f)},filter:function(){return r}}},assignMedium:function(l){o=!0;var c=[];if(r.length){var f=r;r=[],f.forEach(l),c=r}var m=function(){var g=c;c=[],g.forEach(l)},h=function(){return Promise.resolve().then(m)};h(),r={push:function(g){c.push(g),h()},filter:function(g){return c=c.filter(g),r}}}};return s}function hk(e){e===void 0&&(e={});var t=fk(null);return t.options=Zr({async:!0,ssr:!1},e),t}var yC=function(e){var t=e.sideCar,r=vC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return b.createElement(o,Zr({},r))};yC.isSideCarExport=!0;function mk(e,t){return e.useMedium(t),yC}var xC=hk(),Lg=function(){},Th=b.forwardRef(function(e,t){var r=b.useRef(null),o=b.useState({onScrollCapture:Lg,onWheelCapture:Lg,onTouchMoveCapture:Lg}),s=o[0],l=o[1],c=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,g=e.enabled,p=e.shards,v=e.sideCar,x=e.noRelative,E=e.noIsolation,S=e.inert,_=e.allowPinchZoom,C=e.as,j=C===void 0?"div":C,N=e.gapMode,R=vC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=v,A=uk([r,t]),D=Zr(Zr({},R),s);return b.createElement(b.Fragment,null,g&&b.createElement(O,{sideCar:xC,removeScrollBar:h,shards:p,noRelative:x,noIsolation:E,inert:S,setCallbacks:l,allowPinchZoom:!!_,lockRef:r,gapMode:N}),c?b.cloneElement(b.Children.only(f),Zr(Zr({},D),{ref:A})):b.createElement(j,Zr({},D,{className:m,ref:A}),f))});Th.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Th.classNames={fullWidth:Lf,zeroRight:zf};var pk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pk();return t&&e.setAttribute("nonce",t),e}function vk(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function yk(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xk=function(){var e=0,t=null;return{add:function(r){e==0&&(t=gk())&&(vk(t,r),yk(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bk=function(){var e=xk();return function(t,r){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},bC=function(){var e=bk(),t=function(r){var o=r.styles,s=r.dynamic;return e(o,s),null};return t},wk={left:0,top:0,right:0,gap:0},Pg=function(e){return parseInt(e||"",10)||0},Sk=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Pg(r),Pg(o),Pg(s)]},Ek=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return wk;var t=Sk(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},_k=bC(),rl="data-scroll-locked",Ck=function(e,t,r,o){var s=e.left,l=e.top,c=e.right,f=e.gap;return r===void 0&&(r="margin"),`
  .`.concat(sk,` {
   overflow: hidden `).concat(o,`;
   padding-right: `).concat(f,"px ").concat(o,`;
  }
  body[`).concat(rl,`] {
    overflow: hidden `).concat(o,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(o,";"),r==="margin"&&`
    padding-left: `.concat(s,`px;
    padding-top: `).concat(l,`px;
    padding-right: `).concat(c,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(f,"px ").concat(o,`;
    `),r==="padding"&&"padding-right: ".concat(f,"px ").concat(o,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(zf,` {
    right: `).concat(f,"px ").concat(o,`;
  }
  
  .`).concat(Lf,` {
    margin-right: `).concat(f,"px ").concat(o,`;
  }
  
  .`).concat(zf," .").concat(zf,` {
    right: 0 `).concat(o,`;
  }
  
  .`).concat(Lf," .").concat(Lf,` {
    margin-right: 0 `).concat(o,`;
  }
  
  body[`).concat(rl,`] {
    `).concat(ik,": ").concat(f,`px;
  }
`)},xS=function(){var e=parseInt(document.body.getAttribute(rl)||"0",10);return isFinite(e)?e:0},Nk=function(){b.useEffect(function(){return document.body.setAttribute(rl,(xS()+1).toString()),function(){var e=xS()-1;e<=0?document.body.removeAttribute(rl):document.body.setAttribute(rl,e.toString())}},[])},jk=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,s=o===void 0?"margin":o;Nk();var l=b.useMemo(function(){return Ek(s)},[s]);return b.createElement(_k,{styles:Ck(l,!t,s,r?"":"!important")})},Pv=!1;if(typeof window<"u")try{var pf=Object.defineProperty({},"passive",{get:function(){return Pv=!0,!0}});window.addEventListener("test",pf,pf),window.removeEventListener("test",pf,pf)}catch{Pv=!1}var Ki=Pv?{passive:!1}:!1,Tk=function(e){return e.tagName==="TEXTAREA"},wC=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Tk(e)&&r[t]==="visible")},Rk=function(e){return wC(e,"overflowY")},Mk=function(e){return wC(e,"overflowX")},bS=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var s=SC(e,o);if(s){var l=EC(e,o),c=l[1],f=l[2];if(c>f)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},Ak=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},Ok=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},SC=function(e,t){return e==="v"?Rk(t):Mk(t)},EC=function(e,t){return e==="v"?Ak(t):Ok(t)},Dk=function(e,t){return e==="h"&&t==="rtl"?-1:1},kk=function(e,t,r,o,s){var l=Dk(e,window.getComputedStyle(t).direction),c=l*o,f=r.target,m=t.contains(f),h=!1,g=c>0,p=0,v=0;do{if(!f)break;var x=EC(e,f),E=x[0],S=x[1],_=x[2],C=S-_-l*E;(E||C)&&SC(e,f)&&(p+=C,v+=E);var j=f.parentNode;f=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(g&&Math.abs(p)<1||!g&&Math.abs(v)<1)&&(h=!0),h},gf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wS=function(e){return[e.deltaX,e.deltaY]},SS=function(e){return e&&"current"in e?e.current:e},zk=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Lk=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Pk=0,Qi=[];function Hk(e){var t=b.useRef([]),r=b.useRef([0,0]),o=b.useRef(),s=b.useState(Pk++)[0],l=b.useState(bC)[0],c=b.useRef(e);b.useEffect(function(){c.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var S=ok([e.lockRef.current],(e.shards||[]).map(SS),!0).filter(Boolean);return S.forEach(function(_){return _.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),S.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var f=b.useCallback(function(S,_){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!c.current.allowPinchZoom;var C=gf(S),j=r.current,N="deltaX"in S?S.deltaX:j[0]-C[0],R="deltaY"in S?S.deltaY:j[1]-C[1],O,A=S.target,D=Math.abs(N)>Math.abs(R)?"h":"v";if("touches"in S&&D==="h"&&A.type==="range")return!1;var P=window.getSelection(),H=P&&P.anchorNode,Q=H?H===A||H.contains(A):!1;if(Q)return!1;var V=bS(D,A);if(!V)return!0;if(V?O=D:(O=D==="v"?"h":"v",V=bS(D,A)),!V)return!1;if(!o.current&&"changedTouches"in S&&(N||R)&&(o.current=O),!O)return!0;var q=o.current||O;return kk(q,_,S,q==="h"?N:R)},[]),m=b.useCallback(function(S){var _=S;if(!(!Qi.length||Qi[Qi.length-1]!==l)){var C="deltaY"in _?wS(_):gf(_),j=t.current.filter(function(O){return O.name===_.type&&(O.target===_.target||_.target===O.shadowParent)&&zk(O.delta,C)})[0];if(j&&j.should){_.cancelable&&_.preventDefault();return}if(!j){var N=(c.current.shards||[]).map(SS).filter(Boolean).filter(function(O){return O.contains(_.target)}),R=N.length>0?f(_,N[0]):!c.current.noIsolation;R&&_.cancelable&&_.preventDefault()}}},[]),h=b.useCallback(function(S,_,C,j){var N={name:S,delta:_,target:C,should:j,shadowParent:Ik(C)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(R){return R!==N})},1)},[]),g=b.useCallback(function(S){r.current=gf(S),o.current=void 0},[]),p=b.useCallback(function(S){h(S.type,wS(S),S.target,f(S,e.lockRef.current))},[]),v=b.useCallback(function(S){h(S.type,gf(S),S.target,f(S,e.lockRef.current))},[]);b.useEffect(function(){return Qi.push(l),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",m,Ki),document.addEventListener("touchmove",m,Ki),document.addEventListener("touchstart",g,Ki),function(){Qi=Qi.filter(function(S){return S!==l}),document.removeEventListener("wheel",m,Ki),document.removeEventListener("touchmove",m,Ki),document.removeEventListener("touchstart",g,Ki)}},[]);var x=e.removeScrollBar,E=e.inert;return b.createElement(b.Fragment,null,E?b.createElement(l,{styles:Lk(s)}):null,x?b.createElement(jk,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ik(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Bk=mk(xC,Hk);var Rh=b.forwardRef(function(e,t){return b.createElement(Th,Zr({},e,{ref:t,sideCar:Bk}))});Rh.classNames=Th.classNames;var Uk=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zi=new WeakMap,vf=new WeakMap,yf={},Hg=0,_C=function(e){return e&&(e.host||_C(e.parentNode))},$k=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=_C(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Vk=function(e,t,r,o){var s=$k(t,Array.isArray(e)?e:[e]);yf[r]||(yf[r]=new WeakMap);var l=yf[r],c=[],f=new Set,m=new Set(s),h=function(p){!p||f.has(p)||(f.add(p),h(p.parentNode))};s.forEach(h);var g=function(p){!p||m.has(p)||Array.prototype.forEach.call(p.children,function(v){if(f.has(v))g(v);else try{var x=v.getAttribute(o),E=x!==null&&x!=="false",S=(Zi.get(v)||0)+1,_=(l.get(v)||0)+1;Zi.set(v,S),l.set(v,_),c.push(v),S===1&&E&&vf.set(v,!0),_===1&&v.setAttribute(r,"true"),E||v.setAttribute(o,"true")}catch(C){console.error("aria-hidden: cannot operate on ",v,C)}})};return g(t),f.clear(),Hg++,function(){c.forEach(function(p){var v=Zi.get(p)-1,x=l.get(p)-1;Zi.set(p,v),l.set(p,x),v||(vf.has(p)||p.removeAttribute(o),vf.delete(p)),x||p.removeAttribute(r)}),Hg--,Hg||(Zi=new WeakMap,Zi=new WeakMap,vf=new WeakMap,yf={})}},By=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),s=Uk(e);return s?(o.push.apply(o,Array.from(s.querySelectorAll("[aria-live], script"))),Vk(o,s,r,"aria-hidden")):function(){return null}},Mh="Dialog",[CC]=Dr(Mh),[qk,kr]=CC(Mh),NC=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,f=b.useRef(null),m=b.useRef(null),[h,g]=Go({prop:o,defaultProp:s??!1,onChange:l,caller:Mh});return d.jsx(qk,{scope:t,triggerRef:f,contentRef:m,contentId:Yt(),titleId:Yt(),descriptionId:Yt(),open:h,onOpenChange:g,onOpenToggle:b.useCallback(()=>g(p=>!p),[g]),modal:c,children:r})};NC.displayName=Mh;var jC="DialogTrigger",Fk=b.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,s=kr(jC,r),l=Xe(t,s.triggerRef);return d.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Vy(s.open),...o,ref:l,onClick:xe(e.onClick,s.onOpenToggle)})});Fk.displayName=jC;var Uy="DialogPortal",[Xk,TC]=CC(Uy,{forceMount:void 0}),RC=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:s}=e,l=kr(Uy,t);return d.jsx(Xk,{scope:t,forceMount:r,children:b.Children.map(o,c=>d.jsx(hn,{present:r||l.open,children:d.jsx(Du,{asChild:!0,container:s,children:c})}))})};RC.displayName=Uy;var Gf="DialogOverlay",MC=b.forwardRef((e,t)=>{const r=TC(Gf,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,l=kr(Gf,e.__scopeDialog);return l.modal?d.jsx(hn,{present:o||l.open,children:d.jsx(Gk,{...s,ref:t})}):null});MC.displayName=Gf;var Yk=Xs("DialogOverlay.RemoveScroll"),Gk=b.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,s=kr(Gf,r);return d.jsx(Rh,{as:Yk,allowPinchZoom:!0,shards:[s.contentRef],children:d.jsx(je.div,{"data-state":Vy(s.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Ys="DialogContent",AC=b.forwardRef((e,t)=>{const r=TC(Ys,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,l=kr(Ys,e.__scopeDialog);return d.jsx(hn,{present:o||l.open,children:l.modal?d.jsx(Kk,{...s,ref:t}):d.jsx(Qk,{...s,ref:t})})});AC.displayName=Ys;var Kk=b.forwardRef((e,t)=>{const r=kr(Ys,e.__scopeDialog),o=b.useRef(null),s=Xe(t,r.contentRef,o);return b.useEffect(()=>{const l=o.current;if(l)return By(l)},[]),d.jsx(OC,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xe(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:xe(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&l.preventDefault()}),onFocusOutside:xe(e.onFocusOutside,l=>l.preventDefault())})}),Qk=b.forwardRef((e,t)=>{const r=kr(Ys,e.__scopeDialog),o=b.useRef(!1),s=b.useRef(!1);return d.jsx(OC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,f;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(o.current||(f=r.triggerRef.current)==null||f.focus(),l.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:l=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,l),l.defaultPrevented||(o.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((h=r.triggerRef.current)==null?void 0:h.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),OC=b.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:l,...c}=e,f=kr(Ys,r),m=b.useRef(null),h=Xe(t,m);return Iy(),d.jsxs(d.Fragment,{children:[d.jsx(jh,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:l,children:d.jsx(Ou,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Vy(f.open),...c,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Zk,{titleId:f.titleId}),d.jsx(Jk,{contentRef:m,descriptionId:f.descriptionId})]})]})}),$y="DialogTitle",DC=b.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,s=kr($y,r);return d.jsx(je.h2,{id:s.titleId,...o,ref:t})});DC.displayName=$y;var kC="DialogDescription",zC=b.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,s=kr(kC,r);return d.jsx(je.p,{id:s.descriptionId,...o,ref:t})});zC.displayName=kC;var LC="DialogClose",PC=b.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,s=kr(LC,r);return d.jsx(je.button,{type:"button",...o,ref:t,onClick:xe(e.onClick,()=>s.onOpenChange(!1))})});PC.displayName=LC;function Vy(e){return e?"open":"closed"}var HC="DialogTitleWarning",[uX,IC]=T3(HC,{contentName:Ys,titleName:$y,docsSlug:"dialog"}),Zk=({titleId:e})=>{const t=IC(HC),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Wk="DialogDescriptionWarning",Jk=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${IC(Wk).contentName}}.`;return b.useEffect(()=>{var l;const s=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},qy=NC,Fy=RC,Xy=MC,Yy=AC,BC=DC,UC=zC,Gy=PC,Ig={exports:{}},Bg={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ES;function e4(){if(ES)return Bg;ES=1;var e=Nu();function t(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var r=typeof Object.is=="function"?Object.is:t,o=e.useState,s=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue;function f(p,v){var x=v(),E=o({inst:{value:x,getSnapshot:v}}),S=E[0].inst,_=E[1];return l(function(){S.value=x,S.getSnapshot=v,m(S)&&_({inst:S})},[p,x,v]),s(function(){return m(S)&&_({inst:S}),p(function(){m(S)&&_({inst:S})})},[p]),c(x),x}function m(p){var v=p.getSnapshot;p=p.value;try{var x=v();return!r(p,x)}catch{return!0}}function h(p,v){return v()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return Bg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Bg}var _S;function t4(){return _S||(_S=1,Ig.exports=e4()),Ig.exports}function n4(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function r4(e){const[t,r]=b.useState(void 0);return Gt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let c,f;if("borderBoxSize"in l){const m=l.borderBoxSize,h=Array.isArray(m)?m[0]:m;c=h.inlineSize,f=h.blockSize}else c=e.offsetWidth,f=e.offsetHeight;r({width:c,height:f})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}const a4=["top","right","bottom","left"],Ko=Math.min,Xn=Math.max,Kf=Math.round,xf=Math.floor,na=e=>({x:e,y:e}),o4={left:"right",right:"left",bottom:"top",top:"bottom"};function Hv(e,t,r){return Xn(e,Ko(t,r))}function Va(e,t){return typeof e=="function"?e(t):e}function qa(e){return e.split("-")[0]}function Pl(e){return e.split("-")[1]}function Ky(e){return e==="x"?"y":"x"}function Qy(e){return e==="y"?"height":"width"}function ea(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Zy(e){return Ky(ea(e))}function s4(e,t,r){r===void 0&&(r=!1);const o=Pl(e),s=Zy(e),l=Qy(s);let c=s==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=Qf(c)),[c,Qf(c)]}function i4(e){const t=Qf(e);return[Iv(e),t,Iv(t)]}function Iv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const CS=["left","right"],NS=["right","left"],l4=["top","bottom"],c4=["bottom","top"];function u4(e,t,r){switch(e){case"top":case"bottom":return r?t?NS:CS:t?CS:NS;case"left":case"right":return t?l4:c4;default:return[]}}function d4(e,t,r,o){const s=Pl(e);let l=u4(qa(e),r==="start",o);return s&&(l=l.map(c=>c+"-"+s),t&&(l=l.concat(l.map(Iv)))),l}function Qf(e){const t=qa(e);return o4[t]+e.slice(t.length)}function f4(e){return{top:0,right:0,bottom:0,left:0,...e}}function $C(e){return typeof e!="number"?f4(e):{top:e,right:e,bottom:e,left:e}}function Zf(e){const{x:t,y:r,width:o,height:s}=e;return{width:o,height:s,top:r,left:t,right:t+o,bottom:r+s,x:t,y:r}}function jS(e,t,r){let{reference:o,floating:s}=e;const l=ea(t),c=Zy(t),f=Qy(c),m=qa(t),h=l==="y",g=o.x+o.width/2-s.width/2,p=o.y+o.height/2-s.height/2,v=o[f]/2-s[f]/2;let x;switch(m){case"top":x={x:g,y:o.y-s.height};break;case"bottom":x={x:g,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:p};break;case"left":x={x:o.x-s.width,y:p};break;default:x={x:o.x,y:o.y}}switch(Pl(t)){case"start":x[c]-=v*(r&&h?-1:1);break;case"end":x[c]+=v*(r&&h?-1:1);break}return x}async function h4(e,t){var r;t===void 0&&(t={});const{x:o,y:s,platform:l,rects:c,elements:f,strategy:m}=e,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:p="floating",altBoundary:v=!1,padding:x=0}=Va(t,e),E=$C(x),_=f[v?p==="floating"?"reference":"floating":p],C=Zf(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(_)))==null||r?_:_.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(f.floating)),boundary:h,rootBoundary:g,strategy:m})),j=p==="floating"?{x:o,y:s,width:c.floating.width,height:c.floating.height}:c.reference,N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f.floating)),R=await(l.isElement==null?void 0:l.isElement(N))?await(l.getScale==null?void 0:l.getScale(N))||{x:1,y:1}:{x:1,y:1},O=Zf(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:j,offsetParent:N,strategy:m}):j);return{top:(C.top-O.top+E.top)/R.y,bottom:(O.bottom-C.bottom+E.bottom)/R.y,left:(C.left-O.left+E.left)/R.x,right:(O.right-C.right+E.right)/R.x}}const m4=50,p4=async(e,t,r)=>{const{placement:o="bottom",strategy:s="absolute",middleware:l=[],platform:c}=r,f=c.detectOverflow?c:{...c,detectOverflow:h4},m=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y:p}=jS(h,o,m),v=o,x=0;const E={};for(let S=0;S<l.length;S++){const _=l[S];if(!_)continue;const{name:C,fn:j}=_,{x:N,y:R,data:O,reset:A}=await j({x:g,y:p,initialPlacement:o,placement:v,strategy:s,middlewareData:E,rects:h,platform:f,elements:{reference:e,floating:t}});g=N??g,p=R??p,E[C]={...E[C],...O},A&&x<m4&&(x++,typeof A=="object"&&(A.placement&&(v=A.placement),A.rects&&(h=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:g,y:p}=jS(h,v,m)),S=-1)}return{x:g,y:p,placement:v,strategy:s,middlewareData:E}},g4=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:o,placement:s,rects:l,platform:c,elements:f,middlewareData:m}=t,{element:h,padding:g=0}=Va(e,t)||{};if(h==null)return{};const p=$C(g),v={x:r,y:o},x=Zy(s),E=Qy(x),S=await c.getDimensions(h),_=x==="y",C=_?"top":"left",j=_?"bottom":"right",N=_?"clientHeight":"clientWidth",R=l.reference[E]+l.reference[x]-v[x]-l.floating[E],O=v[x]-l.reference[x],A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let D=A?A[N]:0;(!D||!await(c.isElement==null?void 0:c.isElement(A)))&&(D=f.floating[N]||l.floating[E]);const P=R/2-O/2,H=D/2-S[E]/2-1,Q=Ko(p[C],H),V=Ko(p[j],H),q=Q,ee=D-S[E]-V,B=D/2-S[E]/2+P,K=Hv(q,B,ee),M=!m.arrow&&Pl(s)!=null&&B!==K&&l.reference[E]/2-(B<q?Q:V)-S[E]/2<0,I=M?B<q?B-q:B-ee:0;return{[x]:v[x]+I,data:{[x]:K,centerOffset:B-K-I,...M&&{alignmentOffset:I}},reset:M}}}),v4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;const{placement:s,middlewareData:l,rects:c,initialPlacement:f,platform:m,elements:h}=t,{mainAxis:g=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,..._}=Va(e,t);if((r=l.arrow)!=null&&r.alignmentOffset)return{};const C=qa(s),j=ea(f),N=qa(f)===f,R=await(m.isRTL==null?void 0:m.isRTL(h.floating)),O=v||(N||!S?[Qf(f)]:i4(f)),A=E!=="none";!v&&A&&O.push(...d4(f,S,E,R));const D=[f,...O],P=await m.detectOverflow(t,_),H=[];let Q=((o=l.flip)==null?void 0:o.overflows)||[];if(g&&H.push(P[C]),p){const B=s4(s,c,R);H.push(P[B[0]],P[B[1]])}if(Q=[...Q,{placement:s,overflows:H}],!H.every(B=>B<=0)){var V,q;const B=(((V=l.flip)==null?void 0:V.index)||0)+1,K=D[B];if(K&&(!(p==="alignment"?j!==ea(K):!1)||Q.every(U=>ea(U.placement)===j?U.overflows[0]>0:!0)))return{data:{index:B,overflows:Q},reset:{placement:K}};let M=(q=Q.filter(I=>I.overflows[0]<=0).sort((I,U)=>I.overflows[1]-U.overflows[1])[0])==null?void 0:q.placement;if(!M)switch(x){case"bestFit":{var ee;const I=(ee=Q.filter(U=>{if(A){const $=ea(U.placement);return $===j||$==="y"}return!0}).map(U=>[U.placement,U.overflows.filter($=>$>0).reduce(($,X)=>$+X,0)]).sort((U,$)=>U[1]-$[1])[0])==null?void 0:ee[0];I&&(M=I);break}case"initialPlacement":M=f;break}if(s!==M)return{reset:{placement:M}}}return{}}}};function TS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function RS(e){return a4.some(t=>e[t]>=0)}const y4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:o}=t,{strategy:s="referenceHidden",...l}=Va(e,t);switch(s){case"referenceHidden":{const c=await o.detectOverflow(t,{...l,elementContext:"reference"}),f=TS(c,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:RS(f)}}}case"escaped":{const c=await o.detectOverflow(t,{...l,altBoundary:!0}),f=TS(c,r.floating);return{data:{escapedOffsets:f,escaped:RS(f)}}}default:return{}}}}},VC=new Set(["left","top"]);async function x4(e,t){const{placement:r,platform:o,elements:s}=e,l=await(o.isRTL==null?void 0:o.isRTL(s.floating)),c=qa(r),f=Pl(r),m=ea(r)==="y",h=VC.has(c)?-1:1,g=l&&m?-1:1,p=Va(t,e);let{mainAxis:v,crossAxis:x,alignmentAxis:E}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return f&&typeof E=="number"&&(x=f==="end"?E*-1:E),m?{x:x*g,y:v*h}:{x:v*h,y:x*g}}const b4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;const{x:s,y:l,placement:c,middlewareData:f}=t,m=await x4(t,e);return c===((r=f.offset)==null?void 0:r.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:s+m.x,y:l+m.y,data:{...m,placement:c}}}}},w4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:o,placement:s,platform:l}=t,{mainAxis:c=!0,crossAxis:f=!1,limiter:m={fn:C=>{let{x:j,y:N}=C;return{x:j,y:N}}},...h}=Va(e,t),g={x:r,y:o},p=await l.detectOverflow(t,h),v=ea(qa(s)),x=Ky(v);let E=g[x],S=g[v];if(c){const C=x==="y"?"top":"left",j=x==="y"?"bottom":"right",N=E+p[C],R=E-p[j];E=Hv(N,E,R)}if(f){const C=v==="y"?"top":"left",j=v==="y"?"bottom":"right",N=S+p[C],R=S-p[j];S=Hv(N,S,R)}const _=m.fn({...t,[x]:E,[v]:S});return{..._,data:{x:_.x-r,y:_.y-o,enabled:{[x]:c,[v]:f}}}}}},S4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:o,placement:s,rects:l,middlewareData:c}=t,{offset:f=0,mainAxis:m=!0,crossAxis:h=!0}=Va(e,t),g={x:r,y:o},p=ea(s),v=Ky(p);let x=g[v],E=g[p];const S=Va(f,t),_=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(m){const N=v==="y"?"height":"width",R=l.reference[v]-l.floating[N]+_.mainAxis,O=l.reference[v]+l.reference[N]-_.mainAxis;x<R?x=R:x>O&&(x=O)}if(h){var C,j;const N=v==="y"?"width":"height",R=VC.has(qa(s)),O=l.reference[p]-l.floating[N]+(R&&((C=c.offset)==null?void 0:C[p])||0)+(R?0:_.crossAxis),A=l.reference[p]+l.reference[N]+(R?0:((j=c.offset)==null?void 0:j[p])||0)-(R?_.crossAxis:0);E<O?E=O:E>A&&(E=A)}return{[v]:x,[p]:E}}}},E4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;const{placement:s,rects:l,platform:c,elements:f}=t,{apply:m=()=>{},...h}=Va(e,t),g=await c.detectOverflow(t,h),p=qa(s),v=Pl(s),x=ea(s)==="y",{width:E,height:S}=l.floating;let _,C;p==="top"||p==="bottom"?(_=p,C=v===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(C=p,_=v==="end"?"top":"bottom");const j=S-g.top-g.bottom,N=E-g.left-g.right,R=Ko(S-g[_],j),O=Ko(E-g[C],N),A=!t.middlewareData.shift;let D=R,P=O;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=N),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(D=j),A&&!v){const Q=Xn(g.left,0),V=Xn(g.right,0),q=Xn(g.top,0),ee=Xn(g.bottom,0);x?P=E-2*(Q!==0||V!==0?Q+V:Xn(g.left,g.right)):D=S-2*(q!==0||ee!==0?q+ee:Xn(g.top,g.bottom))}await m({...t,availableWidth:P,availableHeight:D});const H=await c.getDimensions(f.floating);return E!==H.width||S!==H.height?{reset:{rects:!0}}:{}}}};function Ah(){return typeof window<"u"}function Hl(e){return qC(e)?(e.nodeName||"").toLowerCase():"#document"}function Kn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sa(e){var t;return(t=(qC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qC(e){return Ah()?e instanceof Node||e instanceof Kn(e).Node:!1}function Mr(e){return Ah()?e instanceof Element||e instanceof Kn(e).Element:!1}function Xa(e){return Ah()?e instanceof HTMLElement||e instanceof Kn(e).HTMLElement:!1}function MS(e){return!Ah()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Kn(e).ShadowRoot}function ku(e){const{overflow:t,overflowX:r,overflowY:o,display:s}=Ar(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&s!=="inline"&&s!=="contents"}function _4(e){return/^(table|td|th)$/.test(Hl(e))}function Oh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const C4=/transform|translate|scale|rotate|perspective|filter/,N4=/paint|layout|strict|content/,js=e=>!!e&&e!=="none";let Ug;function Wy(e){const t=Mr(e)?Ar(e):e;return js(t.transform)||js(t.translate)||js(t.scale)||js(t.rotate)||js(t.perspective)||!Jy()&&(js(t.backdropFilter)||js(t.filter))||C4.test(t.willChange||"")||N4.test(t.contain||"")}function j4(e){let t=Qo(e);for(;Xa(t)&&!Sl(t);){if(Wy(t))return t;if(Oh(t))return null;t=Qo(t)}return null}function Jy(){return Ug==null&&(Ug=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ug}function Sl(e){return/^(html|body|#document)$/.test(Hl(e))}function Ar(e){return Kn(e).getComputedStyle(e)}function Dh(e){return Mr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qo(e){if(Hl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||MS(e)&&e.host||sa(e);return MS(t)?t.host:t}function FC(e){const t=Qo(e);return Sl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xa(t)&&ku(t)?t:FC(t)}function nu(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=FC(e),l=s===((o=e.ownerDocument)==null?void 0:o.body),c=Kn(s);if(l){const f=Bv(c);return t.concat(c,c.visualViewport||[],ku(s)?s:[],f&&r?nu(f):[])}else return t.concat(s,nu(s,[],r))}function Bv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function XC(e){const t=Ar(e);let r=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const s=Xa(e),l=s?e.offsetWidth:r,c=s?e.offsetHeight:o,f=Kf(r)!==l||Kf(o)!==c;return f&&(r=l,o=c),{width:r,height:o,$:f}}function e0(e){return Mr(e)?e:e.contextElement}function al(e){const t=e0(e);if(!Xa(t))return na(1);const r=t.getBoundingClientRect(),{width:o,height:s,$:l}=XC(t);let c=(l?Kf(r.width):r.width)/o,f=(l?Kf(r.height):r.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!f||!Number.isFinite(f))&&(f=1),{x:c,y:f}}const T4=na(0);function YC(e){const t=Kn(e);return!Jy()||!t.visualViewport?T4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function R4(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Kn(e)?!1:t}function Gs(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),l=e0(e);let c=na(1);t&&(o?Mr(o)&&(c=al(o)):c=al(e));const f=R4(l,r,o)?YC(l):na(0);let m=(s.left+f.x)/c.x,h=(s.top+f.y)/c.y,g=s.width/c.x,p=s.height/c.y;if(l){const v=Kn(l),x=o&&Mr(o)?Kn(o):o;let E=v,S=Bv(E);for(;S&&o&&x!==E;){const _=al(S),C=S.getBoundingClientRect(),j=Ar(S),N=C.left+(S.clientLeft+parseFloat(j.paddingLeft))*_.x,R=C.top+(S.clientTop+parseFloat(j.paddingTop))*_.y;m*=_.x,h*=_.y,g*=_.x,p*=_.y,m+=N,h+=R,E=Kn(S),S=Bv(E)}}return Zf({width:g,height:p,x:m,y:h})}function kh(e,t){const r=Dh(e).scrollLeft;return t?t.left+r:Gs(sa(e)).left+r}function GC(e,t){const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-kh(e,r),s=r.top+t.scrollTop;return{x:o,y:s}}function M4(e){let{elements:t,rect:r,offsetParent:o,strategy:s}=e;const l=s==="fixed",c=sa(o),f=t?Oh(t.floating):!1;if(o===c||f&&l)return r;let m={scrollLeft:0,scrollTop:0},h=na(1);const g=na(0),p=Xa(o);if((p||!p&&!l)&&((Hl(o)!=="body"||ku(c))&&(m=Dh(o)),p)){const x=Gs(o);h=al(o),g.x=x.x+o.clientLeft,g.y=x.y+o.clientTop}const v=c&&!p&&!l?GC(c,m):na(0);return{width:r.width*h.x,height:r.height*h.y,x:r.x*h.x-m.scrollLeft*h.x+g.x+v.x,y:r.y*h.y-m.scrollTop*h.y+g.y+v.y}}function A4(e){return Array.from(e.getClientRects())}function O4(e){const t=sa(e),r=Dh(e),o=e.ownerDocument.body,s=Xn(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),l=Xn(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let c=-r.scrollLeft+kh(e);const f=-r.scrollTop;return Ar(o).direction==="rtl"&&(c+=Xn(t.clientWidth,o.clientWidth)-s),{width:s,height:l,x:c,y:f}}const AS=25;function D4(e,t){const r=Kn(e),o=sa(e),s=r.visualViewport;let l=o.clientWidth,c=o.clientHeight,f=0,m=0;if(s){l=s.width,c=s.height;const g=Jy();(!g||g&&t==="fixed")&&(f=s.offsetLeft,m=s.offsetTop)}const h=kh(o);if(h<=0){const g=o.ownerDocument,p=g.body,v=getComputedStyle(p),x=g.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,E=Math.abs(o.clientWidth-p.clientWidth-x);E<=AS&&(l-=E)}else h<=AS&&(l+=h);return{width:l,height:c,x:f,y:m}}function k4(e,t){const r=Gs(e,!0,t==="fixed"),o=r.top+e.clientTop,s=r.left+e.clientLeft,l=Xa(e)?al(e):na(1),c=e.clientWidth*l.x,f=e.clientHeight*l.y,m=s*l.x,h=o*l.y;return{width:c,height:f,x:m,y:h}}function OS(e,t,r){let o;if(t==="viewport")o=D4(e,r);else if(t==="document")o=O4(sa(e));else if(Mr(t))o=k4(t,r);else{const s=YC(e);o={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Zf(o)}function KC(e,t){const r=Qo(e);return r===t||!Mr(r)||Sl(r)?!1:Ar(r).position==="fixed"||KC(r,t)}function z4(e,t){const r=t.get(e);if(r)return r;let o=nu(e,[],!1).filter(f=>Mr(f)&&Hl(f)!=="body"),s=null;const l=Ar(e).position==="fixed";let c=l?Qo(e):e;for(;Mr(c)&&!Sl(c);){const f=Ar(c),m=Wy(c);!m&&f.position==="fixed"&&(s=null),(l?!m&&!s:!m&&f.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||ku(c)&&!m&&KC(e,c))?o=o.filter(g=>g!==c):s=f,c=Qo(c)}return t.set(e,o),o}function L4(e){let{element:t,boundary:r,rootBoundary:o,strategy:s}=e;const c=[...r==="clippingAncestors"?Oh(t)?[]:z4(t,this._c):[].concat(r),o],f=OS(t,c[0],s);let m=f.top,h=f.right,g=f.bottom,p=f.left;for(let v=1;v<c.length;v++){const x=OS(t,c[v],s);m=Xn(x.top,m),h=Ko(x.right,h),g=Ko(x.bottom,g),p=Xn(x.left,p)}return{width:h-p,height:g-m,x:p,y:m}}function P4(e){const{width:t,height:r}=XC(e);return{width:t,height:r}}function H4(e,t,r){const o=Xa(t),s=sa(t),l=r==="fixed",c=Gs(e,!0,l,t);let f={scrollLeft:0,scrollTop:0};const m=na(0);function h(){m.x=kh(s)}if(o||!o&&!l)if((Hl(t)!=="body"||ku(s))&&(f=Dh(t)),o){const x=Gs(t,!0,l,t);m.x=x.x+t.clientLeft,m.y=x.y+t.clientTop}else s&&h();l&&!o&&s&&h();const g=s&&!o&&!l?GC(s,f):na(0),p=c.left+f.scrollLeft-m.x-g.x,v=c.top+f.scrollTop-m.y-g.y;return{x:p,y:v,width:c.width,height:c.height}}function $g(e){return Ar(e).position==="static"}function DS(e,t){if(!Xa(e)||Ar(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return sa(e)===r&&(r=r.ownerDocument.body),r}function QC(e,t){const r=Kn(e);if(Oh(e))return r;if(!Xa(e)){let s=Qo(e);for(;s&&!Sl(s);){if(Mr(s)&&!$g(s))return s;s=Qo(s)}return r}let o=DS(e,t);for(;o&&_4(o)&&$g(o);)o=DS(o,t);return o&&Sl(o)&&$g(o)&&!Wy(o)?r:o||j4(e)||r}const I4=async function(e){const t=this.getOffsetParent||QC,r=this.getDimensions,o=await r(e.floating);return{reference:H4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function B4(e){return Ar(e).direction==="rtl"}const U4={convertOffsetParentRelativeRectToViewportRelativeRect:M4,getDocumentElement:sa,getClippingRect:L4,getOffsetParent:QC,getElementRects:I4,getClientRects:A4,getDimensions:P4,getScale:al,isElement:Mr,isRTL:B4};function ZC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $4(e,t){let r=null,o;const s=sa(e);function l(){var f;clearTimeout(o),(f=r)==null||f.disconnect(),r=null}function c(f,m){f===void 0&&(f=!1),m===void 0&&(m=1),l();const h=e.getBoundingClientRect(),{left:g,top:p,width:v,height:x}=h;if(f||t(),!v||!x)return;const E=xf(p),S=xf(s.clientWidth-(g+v)),_=xf(s.clientHeight-(p+x)),C=xf(g),N={rootMargin:-E+"px "+-S+"px "+-_+"px "+-C+"px",threshold:Xn(0,Ko(1,m))||1};let R=!0;function O(A){const D=A[0].intersectionRatio;if(D!==m){if(!R)return c();D?c(!1,D):o=setTimeout(()=>{c(!1,1e-7)},1e3)}D===1&&!ZC(h,e.getBoundingClientRect())&&c(),R=!1}try{r=new IntersectionObserver(O,{...N,root:s.ownerDocument})}catch{r=new IntersectionObserver(O,N)}r.observe(e)}return c(!0),l}function V4(e,t,r,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,h=e0(e),g=s||l?[...h?nu(h):[],...t?nu(t):[]]:[];g.forEach(C=>{s&&C.addEventListener("scroll",r,{passive:!0}),l&&C.addEventListener("resize",r)});const p=h&&f?$4(h,r):null;let v=-1,x=null;c&&(x=new ResizeObserver(C=>{let[j]=C;j&&j.target===h&&x&&t&&(x.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(t)})),r()}),h&&!m&&x.observe(h),t&&x.observe(t));let E,S=m?Gs(e):null;m&&_();function _(){const C=Gs(e);S&&!ZC(S,C)&&r(),S=C,E=requestAnimationFrame(_)}return r(),()=>{var C;g.forEach(j=>{s&&j.removeEventListener("scroll",r),l&&j.removeEventListener("resize",r)}),p==null||p(),(C=x)==null||C.disconnect(),x=null,m&&cancelAnimationFrame(E)}}const q4=b4,F4=w4,X4=v4,Y4=E4,G4=y4,kS=g4,K4=S4,Q4=(e,t,r)=>{const o=new Map,s={platform:U4,...r},l={...s.platform,_c:o};return p4(e,t,{...s,platform:l})};var Z4=typeof document<"u",W4=function(){},Pf=Z4?b.useLayoutEffect:W4;function Wf(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 r,o,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!Wf(e[o],t[o]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,s[o]))return!1;for(o=r;o--!==0;){const l=s[o];if(!(l==="_owner"&&e.$$typeof)&&!Wf(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function WC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zS(e,t){const r=WC(e);return Math.round(t*r)/r}function Vg(e){const t=b.useRef(e);return Pf(()=>{t.current=e}),t}function J4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:s,elements:{reference:l,floating:c}={},transform:f=!0,whileElementsMounted:m,open:h}=e,[g,p]=b.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,x]=b.useState(o);Wf(v,o)||x(o);const[E,S]=b.useState(null),[_,C]=b.useState(null),j=b.useCallback(U=>{U!==A.current&&(A.current=U,S(U))},[]),N=b.useCallback(U=>{U!==D.current&&(D.current=U,C(U))},[]),R=l||E,O=c||_,A=b.useRef(null),D=b.useRef(null),P=b.useRef(g),H=m!=null,Q=Vg(m),V=Vg(s),q=Vg(h),ee=b.useCallback(()=>{if(!A.current||!D.current)return;const U={placement:t,strategy:r,middleware:v};V.current&&(U.platform=V.current),Q4(A.current,D.current,U).then($=>{const X={...$,isPositioned:q.current!==!1};B.current&&!Wf(P.current,X)&&(P.current=X,Mu.flushSync(()=>{p(X)}))})},[v,t,r,V,q]);Pf(()=>{h===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(U=>({...U,isPositioned:!1})))},[h]);const B=b.useRef(!1);Pf(()=>(B.current=!0,()=>{B.current=!1}),[]),Pf(()=>{if(R&&(A.current=R),O&&(D.current=O),R&&O){if(Q.current)return Q.current(R,O,ee);ee()}},[R,O,ee,Q,H]);const K=b.useMemo(()=>({reference:A,floating:D,setReference:j,setFloating:N}),[j,N]),M=b.useMemo(()=>({reference:R,floating:O}),[R,O]),I=b.useMemo(()=>{const U={position:r,left:0,top:0};if(!M.floating)return U;const $=zS(M.floating,g.x),X=zS(M.floating,g.y);return f?{...U,transform:"translate("+$+"px, "+X+"px)",...WC(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:X}},[r,f,M.floating,g.x,g.y]);return b.useMemo(()=>({...g,update:ee,refs:K,elements:M,floatingStyles:I}),[g,ee,K,M,I])}const e5=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:o,padding:s}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?kS({element:o.current,padding:s}).fn(r):{}:o?kS({element:o,padding:s}).fn(r):{}}}},t5=(e,t)=>{const r=q4(e);return{name:r.name,fn:r.fn,options:[e,t]}},n5=(e,t)=>{const r=F4(e);return{name:r.name,fn:r.fn,options:[e,t]}},r5=(e,t)=>({fn:K4(e).fn,options:[e,t]}),a5=(e,t)=>{const r=X4(e);return{name:r.name,fn:r.fn,options:[e,t]}},o5=(e,t)=>{const r=Y4(e);return{name:r.name,fn:r.fn,options:[e,t]}},s5=(e,t)=>{const r=G4(e);return{name:r.name,fn:r.fn,options:[e,t]}},i5=(e,t)=>{const r=e5(e);return{name:r.name,fn:r.fn,options:[e,t]}};var l5="Arrow",JC=b.forwardRef((e,t)=>{const{children:r,width:o=10,height:s=5,...l}=e;return d.jsx(je.svg,{...l,ref:t,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});JC.displayName=l5;var c5=JC,t0="Popper",[e2,Il]=Dr(t0),[u5,t2]=e2(t0),n2=e=>{const{__scopePopper:t,children:r}=e,[o,s]=b.useState(null);return d.jsx(u5,{scope:t,anchor:o,onAnchorChange:s,children:r})};n2.displayName=t0;var r2="PopperAnchor",a2=b.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:o,...s}=e,l=t2(r2,r),c=b.useRef(null),f=Xe(t,c),m=b.useRef(null);return b.useEffect(()=>{const h=m.current;m.current=(o==null?void 0:o.current)||c.current,h!==m.current&&l.onAnchorChange(m.current)}),o?null:d.jsx(je.div,{...s,ref:f})});a2.displayName=r2;var n0="PopperContent",[d5,f5]=e2(n0),o2=b.forwardRef((e,t)=>{var ne,re,le,ve,ge,he;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:f=0,avoidCollisions:m=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:x="optimized",onPlaced:E,...S}=e,_=t2(n0,r),[C,j]=b.useState(null),N=Xe(t,ye=>j(ye)),[R,O]=b.useState(null),A=r4(R),D=(A==null?void 0:A.width)??0,P=(A==null?void 0:A.height)??0,H=o+(l!=="center"?"-"+l:""),Q=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},V=Array.isArray(h)?h:[h],q=V.length>0,ee={padding:Q,boundary:V.filter(m5),altBoundary:q},{refs:B,floatingStyles:K,placement:M,isPositioned:I,middlewareData:U}=J4({strategy:"fixed",placement:H,whileElementsMounted:(...ye)=>V4(...ye,{animationFrame:x==="always"}),elements:{reference:_.anchor},middleware:[t5({mainAxis:s+P,alignmentAxis:c}),m&&n5({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?r5():void 0,...ee}),m&&a5({...ee}),o5({...ee,apply:({elements:ye,rects:Ne,availableWidth:Ue,availableHeight:ke})=>{const{width:nt,height:an}=Ne.reference,st=ye.floating.style;st.setProperty("--radix-popper-available-width",`${Ue}px`),st.setProperty("--radix-popper-available-height",`${ke}px`),st.setProperty("--radix-popper-anchor-width",`${nt}px`),st.setProperty("--radix-popper-anchor-height",`${an}px`)}}),R&&i5({element:R,padding:f}),p5({arrowWidth:D,arrowHeight:P}),v&&s5({strategy:"referenceHidden",...ee})]}),[$,X]=l2(M),k=en(E);Gt(()=>{I&&(k==null||k())},[I,k]);const L=(ne=U.arrow)==null?void 0:ne.x,Y=(re=U.arrow)==null?void 0:re.y,W=((le=U.arrow)==null?void 0:le.centerOffset)!==0,[J,se]=b.useState();return Gt(()=>{C&&se(window.getComputedStyle(C).zIndex)},[C]),d.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:I?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(ve=U.transformOrigin)==null?void 0:ve.x,(ge=U.transformOrigin)==null?void 0:ge.y].join(" "),...((he=U.hide)==null?void 0:he.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(d5,{scope:r,placedSide:$,onArrowChange:O,arrowX:L,arrowY:Y,shouldHideArrow:W,children:d.jsx(je.div,{"data-side":$,"data-align":X,...S,ref:N,style:{...S.style,animation:I?void 0:"none"}})})})});o2.displayName=n0;var s2="PopperArrow",h5={top:"bottom",right:"left",bottom:"top",left:"right"},i2=b.forwardRef(function(t,r){const{__scopePopper:o,...s}=t,l=f5(s2,o),c=h5[l.placedSide];return d.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:d.jsx(c5,{...s,ref:r,style:{...s.style,display:"block"}})})});i2.displayName=s2;function m5(e){return e!==null}var p5=e=>({name:"transformOrigin",options:e,fn(t){var _,C,j;const{placement:r,rects:o,middlewareData:s}=t,c=((_=s.arrow)==null?void 0:_.centerOffset)!==0,f=c?0:e.arrowWidth,m=c?0:e.arrowHeight,[h,g]=l2(r),p={start:"0%",center:"50%",end:"100%"}[g],v=(((C=s.arrow)==null?void 0:C.x)??0)+f/2,x=(((j=s.arrow)==null?void 0:j.y)??0)+m/2;let E="",S="";return h==="bottom"?(E=c?p:`${v}px`,S=`${-m}px`):h==="top"?(E=c?p:`${v}px`,S=`${o.floating.height+m}px`):h==="right"?(E=`${-m}px`,S=c?p:`${x}px`):h==="left"&&(E=`${o.floating.width+m}px`,S=c?p:`${x}px`),{data:{x:E,y:S}}}});function l2(e){const[t,r="center"]=e.split("-");return[t,r]}var r0=n2,a0=a2,o0=o2,s0=i2,qg="rovingFocusGroup.onEntryFocus",g5={bubbles:!1,cancelable:!0},zu="RovingFocusGroup",[Uv,c2,v5]=zy(zu),[y5,zh]=Dr(zu,[v5]),[x5,b5]=y5(zu),u2=b.forwardRef((e,t)=>d.jsx(Uv.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Uv.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(w5,{...e,ref:t})})}));u2.displayName=zu;var w5=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:m,onEntryFocus:h,preventScrollOnEntryFocus:g=!1,...p}=e,v=b.useRef(null),x=Xe(t,v),E=Au(l),[S,_]=Go({prop:c,defaultProp:f??null,onChange:m,caller:zu}),[C,j]=b.useState(!1),N=en(h),R=c2(r),O=b.useRef(!1),[A,D]=b.useState(0);return b.useEffect(()=>{const P=v.current;if(P)return P.addEventListener(qg,N),()=>P.removeEventListener(qg,N)},[N]),d.jsx(x5,{scope:r,orientation:o,dir:E,loop:s,currentTabStopId:S,onItemFocus:b.useCallback(P=>_(P),[_]),onItemShiftTab:b.useCallback(()=>j(!0),[]),onFocusableItemAdd:b.useCallback(()=>D(P=>P+1),[]),onFocusableItemRemove:b.useCallback(()=>D(P=>P-1),[]),children:d.jsx(je.div,{tabIndex:C||A===0?-1:0,"data-orientation":o,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:xe(e.onMouseDown,()=>{O.current=!0}),onFocus:xe(e.onFocus,P=>{const H=!O.current;if(P.target===P.currentTarget&&H&&!C){const Q=new CustomEvent(qg,g5);if(P.currentTarget.dispatchEvent(Q),!Q.defaultPrevented){const V=R().filter(M=>M.focusable),q=V.find(M=>M.active),ee=V.find(M=>M.id===S),K=[q,ee,...V].filter(Boolean).map(M=>M.ref.current);h2(K,g)}}O.current=!1}),onBlur:xe(e.onBlur,()=>j(!1))})})}),d2="RovingFocusGroupItem",f2=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:l,children:c,...f}=e,m=Yt(),h=l||m,g=b5(d2,r),p=g.currentTabStopId===h,v=c2(r),{onFocusableItemAdd:x,onFocusableItemRemove:E,currentTabStopId:S}=g;return b.useEffect(()=>{if(o)return x(),()=>E()},[o,x,E]),d.jsx(Uv.ItemSlot,{scope:r,id:h,focusable:o,active:s,children:d.jsx(je.span,{tabIndex:p?0:-1,"data-orientation":g.orientation,...f,ref:t,onMouseDown:xe(e.onMouseDown,_=>{o?g.onItemFocus(h):_.preventDefault()}),onFocus:xe(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:xe(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){g.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const C=_5(_,g.orientation,g.dir);if(C!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let N=v().filter(R=>R.focusable).map(R=>R.ref.current);if(C==="last")N.reverse();else if(C==="prev"||C==="next"){C==="prev"&&N.reverse();const R=N.indexOf(_.currentTarget);N=g.loop?C5(N,R+1):N.slice(R+1)}setTimeout(()=>h2(N))}}),children:typeof c=="function"?c({isCurrentTabStop:p,hasTabStop:S!=null}):c})})});f2.displayName=d2;var S5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function E5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _5(e,t,r){const o=E5(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return S5[o]}function h2(e,t=!1){const r=document.activeElement;for(const o of e)if(o===r||(o.focus({preventScroll:t}),document.activeElement!==r))return}function C5(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var m2=u2,p2=f2,$v=["Enter"," "],N5=["ArrowDown","PageUp","Home"],g2=["ArrowUp","PageDown","End"],j5=[...N5,...g2],T5={ltr:[...$v,"ArrowRight"],rtl:[...$v,"ArrowLeft"]},R5={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Lu="Menu",[ru,M5,A5]=zy(Lu),[ri,v2]=Dr(Lu,[A5,Il,zh]),Lh=Il(),y2=zh(),[O5,ai]=ri(Lu),[D5,Pu]=ri(Lu),x2=e=>{const{__scopeMenu:t,open:r=!1,children:o,dir:s,onOpenChange:l,modal:c=!0}=e,f=Lh(t),[m,h]=b.useState(null),g=b.useRef(!1),p=en(l),v=Au(s);return b.useEffect(()=>{const x=()=>{g.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>g.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),d.jsx(r0,{...f,children:d.jsx(O5,{scope:t,open:r,onOpenChange:p,content:m,onContentChange:h,children:d.jsx(D5,{scope:t,onClose:b.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:g,dir:v,modal:c,children:o})})})};x2.displayName=Lu;var k5="MenuAnchor",i0=b.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,s=Lh(r);return d.jsx(a0,{...s,...o,ref:t})});i0.displayName=k5;var l0="MenuPortal",[z5,b2]=ri(l0,{forceMount:void 0}),w2=e=>{const{__scopeMenu:t,forceMount:r,children:o,container:s}=e,l=ai(l0,t);return d.jsx(z5,{scope:t,forceMount:r,children:d.jsx(hn,{present:r||l.open,children:d.jsx(Du,{asChild:!0,container:s,children:o})})})};w2.displayName=l0;var fr="MenuContent",[L5,c0]=ri(fr),S2=b.forwardRef((e,t)=>{const r=b2(fr,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,l=ai(fr,e.__scopeMenu),c=Pu(fr,e.__scopeMenu);return d.jsx(ru.Provider,{scope:e.__scopeMenu,children:d.jsx(hn,{present:o||l.open,children:d.jsx(ru.Slot,{scope:e.__scopeMenu,children:c.modal?d.jsx(P5,{...s,ref:t}):d.jsx(H5,{...s,ref:t})})})})}),P5=b.forwardRef((e,t)=>{const r=ai(fr,e.__scopeMenu),o=b.useRef(null),s=Xe(t,o);return b.useEffect(()=>{const l=o.current;if(l)return By(l)},[]),d.jsx(u0,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:xe(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),H5=b.forwardRef((e,t)=>{const r=ai(fr,e.__scopeMenu);return d.jsx(u0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),I5=Xs("MenuContent.ScrollLock"),u0=b.forwardRef((e,t)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:f,onEntryFocus:m,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:p,onInteractOutside:v,onDismiss:x,disableOutsideScroll:E,...S}=e,_=ai(fr,r),C=Pu(fr,r),j=Lh(r),N=y2(r),R=M5(r),[O,A]=b.useState(null),D=b.useRef(null),P=Xe(t,D,_.onContentChange),H=b.useRef(0),Q=b.useRef(""),V=b.useRef(0),q=b.useRef(null),ee=b.useRef("right"),B=b.useRef(0),K=E?Rh:b.Fragment,M=E?{as:I5,allowPinchZoom:!0}:void 0,I=$=>{var ne,re;const X=Q.current+$,k=R().filter(le=>!le.disabled),L=document.activeElement,Y=(ne=k.find(le=>le.ref.current===L))==null?void 0:ne.textValue,W=k.map(le=>le.textValue),J=Z5(W,X,Y),se=(re=k.find(le=>le.textValue===J))==null?void 0:re.ref.current;(function le(ve){Q.current=ve,window.clearTimeout(H.current),ve!==""&&(H.current=window.setTimeout(()=>le(""),1e3))})(X),se&&setTimeout(()=>se.focus())};b.useEffect(()=>()=>window.clearTimeout(H.current),[]),Iy();const U=b.useCallback($=>{var k,L;return ee.current===((k=q.current)==null?void 0:k.side)&&J5($,(L=q.current)==null?void 0:L.area)},[]);return d.jsx(L5,{scope:r,searchRef:Q,onItemEnter:b.useCallback($=>{U($)&&$.preventDefault()},[U]),onItemLeave:b.useCallback($=>{var X;U($)||((X=D.current)==null||X.focus(),A(null))},[U]),onTriggerLeave:b.useCallback($=>{U($)&&$.preventDefault()},[U]),pointerGraceTimerRef:V,onPointerGraceIntentChange:b.useCallback($=>{q.current=$},[]),children:d.jsx(K,{...M,children:d.jsx(jh,{asChild:!0,trapped:s,onMountAutoFocus:xe(l,$=>{var X;$.preventDefault(),(X=D.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:d.jsx(Ou,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:p,onInteractOutside:v,onDismiss:x,children:d.jsx(m2,{asChild:!0,...N,dir:C.dir,orientation:"vertical",loop:o,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:xe(m,$=>{C.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(o0,{role:"menu","aria-orientation":"vertical","data-state":H2(_.open),"data-radix-menu-content":"",dir:C.dir,...j,...S,ref:P,style:{outline:"none",...S.style},onKeyDown:xe(S.onKeyDown,$=>{const k=$.target.closest("[data-radix-menu-content]")===$.currentTarget,L=$.ctrlKey||$.altKey||$.metaKey,Y=$.key.length===1;k&&($.key==="Tab"&&$.preventDefault(),!L&&Y&&I($.key));const W=D.current;if($.target!==W||!j5.includes($.key))return;$.preventDefault();const se=R().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);g2.includes($.key)&&se.reverse(),K5(se)}),onBlur:xe(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(H.current),Q.current="")}),onPointerMove:xe(e.onPointerMove,au($=>{const X=$.target,k=B.current!==$.clientX;if($.currentTarget.contains(X)&&k){const L=$.clientX>B.current?"right":"left";ee.current=L,B.current=$.clientX}}))})})})})})})});S2.displayName=fr;var B5="MenuGroup",d0=b.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return d.jsx(je.div,{role:"group",...o,ref:t})});d0.displayName=B5;var U5="MenuLabel",E2=b.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return d.jsx(je.div,{...o,ref:t})});E2.displayName=U5;var Jf="MenuItem",LS="menu.itemSelect",Ph=b.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:o,...s}=e,l=b.useRef(null),c=Pu(Jf,e.__scopeMenu),f=c0(Jf,e.__scopeMenu),m=Xe(t,l),h=b.useRef(!1),g=()=>{const p=l.current;if(!r&&p){const v=new CustomEvent(LS,{bubbles:!0,cancelable:!0});p.addEventListener(LS,x=>o==null?void 0:o(x),{once:!0}),iC(p,v),v.defaultPrevented?h.current=!1:c.onClose()}};return d.jsx(_2,{...s,ref:m,disabled:r,onClick:xe(e.onClick,g),onPointerDown:p=>{var v;(v=e.onPointerDown)==null||v.call(e,p),h.current=!0},onPointerUp:xe(e.onPointerUp,p=>{var v;h.current||(v=p.currentTarget)==null||v.click()}),onKeyDown:xe(e.onKeyDown,p=>{const v=f.searchRef.current!=="";r||v&&p.key===" "||$v.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Ph.displayName=Jf;var _2=b.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:o=!1,textValue:s,...l}=e,c=c0(Jf,r),f=y2(r),m=b.useRef(null),h=Xe(t,m),[g,p]=b.useState(!1),[v,x]=b.useState("");return b.useEffect(()=>{const E=m.current;E&&x((E.textContent??"").trim())},[l.children]),d.jsx(ru.ItemSlot,{scope:r,disabled:o,textValue:s??v,children:d.jsx(p2,{asChild:!0,...f,focusable:!o,children:d.jsx(je.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...l,ref:h,onPointerMove:xe(e.onPointerMove,au(E=>{o?c.onItemLeave(E):(c.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:xe(e.onPointerLeave,au(E=>c.onItemLeave(E))),onFocus:xe(e.onFocus,()=>p(!0)),onBlur:xe(e.onBlur,()=>p(!1))})})})}),$5="MenuCheckboxItem",C2=b.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:o,...s}=e;return d.jsx(M2,{scope:e.__scopeMenu,checked:r,children:d.jsx(Ph,{role:"menuitemcheckbox","aria-checked":eh(r)?"mixed":r,...s,ref:t,"data-state":h0(r),onSelect:xe(s.onSelect,()=>o==null?void 0:o(eh(r)?!0:!r),{checkForDefaultPrevented:!1})})})});C2.displayName=$5;var N2="MenuRadioGroup",[V5,q5]=ri(N2,{value:void 0,onValueChange:()=>{}}),j2=b.forwardRef((e,t)=>{const{value:r,onValueChange:o,...s}=e,l=en(o);return d.jsx(V5,{scope:e.__scopeMenu,value:r,onValueChange:l,children:d.jsx(d0,{...s,ref:t})})});j2.displayName=N2;var T2="MenuRadioItem",R2=b.forwardRef((e,t)=>{const{value:r,...o}=e,s=q5(T2,e.__scopeMenu),l=r===s.value;return d.jsx(M2,{scope:e.__scopeMenu,checked:l,children:d.jsx(Ph,{role:"menuitemradio","aria-checked":l,...o,ref:t,"data-state":h0(l),onSelect:xe(o.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,r)},{checkForDefaultPrevented:!1})})})});R2.displayName=T2;var f0="MenuItemIndicator",[M2,F5]=ri(f0,{checked:!1}),A2=b.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:o,...s}=e,l=F5(f0,r);return d.jsx(hn,{present:o||eh(l.checked)||l.checked===!0,children:d.jsx(je.span,{...s,ref:t,"data-state":h0(l.checked)})})});A2.displayName=f0;var X5="MenuSeparator",O2=b.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return d.jsx(je.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});O2.displayName=X5;var Y5="MenuArrow",D2=b.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,s=Lh(r);return d.jsx(s0,{...s,...o,ref:t})});D2.displayName=Y5;var G5="MenuSub",[dX,k2]=ri(G5),Xc="MenuSubTrigger",z2=b.forwardRef((e,t)=>{const r=ai(Xc,e.__scopeMenu),o=Pu(Xc,e.__scopeMenu),s=k2(Xc,e.__scopeMenu),l=c0(Xc,e.__scopeMenu),c=b.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:m}=l,h={__scopeMenu:e.__scopeMenu},g=b.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return b.useEffect(()=>g,[g]),b.useEffect(()=>{const p=f.current;return()=>{window.clearTimeout(p),m(null)}},[f,m]),d.jsx(i0,{asChild:!0,...h,children:d.jsx(_2,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":H2(r.open),...e,ref:$a(t,s.onTriggerChange),onClick:p=>{var v;(v=e.onClick)==null||v.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:xe(e.onPointerMove,au(p=>{l.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:xe(e.onPointerLeave,au(p=>{var x,E;g();const v=(x=r.content)==null?void 0:x.getBoundingClientRect();if(v){const S=(E=r.content)==null?void 0:E.dataset.side,_=S==="right",C=_?-5:5,j=v[_?"left":"right"],N=v[_?"right":"left"];l.onPointerGraceIntentChange({area:[{x:p.clientX+C,y:p.clientY},{x:j,y:v.top},{x:N,y:v.top},{x:N,y:v.bottom},{x:j,y:v.bottom}],side:S}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(p),p.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:xe(e.onKeyDown,p=>{var x;const v=l.searchRef.current!=="";e.disabled||v&&p.key===" "||T5[o.dir].includes(p.key)&&(r.onOpenChange(!0),(x=r.content)==null||x.focus(),p.preventDefault())})})})});z2.displayName=Xc;var L2="MenuSubContent",P2=b.forwardRef((e,t)=>{const r=b2(fr,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,l=ai(fr,e.__scopeMenu),c=Pu(fr,e.__scopeMenu),f=k2(L2,e.__scopeMenu),m=b.useRef(null),h=Xe(t,m);return d.jsx(ru.Provider,{scope:e.__scopeMenu,children:d.jsx(hn,{present:o||l.open,children:d.jsx(ru.Slot,{scope:e.__scopeMenu,children:d.jsx(u0,{id:f.contentId,"aria-labelledby":f.triggerId,...s,ref:h,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var p;c.isUsingKeyboardRef.current&&((p=m.current)==null||p.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:xe(e.onFocusOutside,g=>{g.target!==f.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:xe(e.onEscapeKeyDown,g=>{c.onClose(),g.preventDefault()}),onKeyDown:xe(e.onKeyDown,g=>{var x;const p=g.currentTarget.contains(g.target),v=R5[c.dir].includes(g.key);p&&v&&(l.onOpenChange(!1),(x=f.trigger)==null||x.focus(),g.preventDefault())})})})})})});P2.displayName=L2;function H2(e){return e?"open":"closed"}function eh(e){return e==="indeterminate"}function h0(e){return eh(e)?"indeterminate":e?"checked":"unchecked"}function K5(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Q5(e,t){return e.map((r,o)=>e[(t+o)%e.length])}function Z5(e,t,r){const s=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=r?e.indexOf(r):-1;let c=Q5(e,Math.max(l,0));s.length===1&&(c=c.filter(h=>h!==r));const m=c.find(h=>h.toLowerCase().startsWith(s.toLowerCase()));return m!==r?m:void 0}function W5(e,t){const{x:r,y:o}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const f=t[l],m=t[c],h=f.x,g=f.y,p=m.x,v=m.y;g>o!=v>o&&r<(p-h)*(o-g)/(v-g)+h&&(s=!s)}return s}function J5(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return W5(r,t)}function au(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ez=x2,tz=i0,nz=w2,rz=S2,az=d0,oz=E2,sz=Ph,iz=C2,lz=j2,cz=R2,uz=A2,dz=O2,fz=D2,hz=z2,mz=P2,Hh="DropdownMenu",[pz]=Dr(Hh,[v2]),gn=v2(),[gz,I2]=pz(Hh),B2=e=>{const{__scopeDropdownMenu:t,children:r,dir:o,open:s,defaultOpen:l,onOpenChange:c,modal:f=!0}=e,m=gn(t),h=b.useRef(null),[g,p]=Go({prop:s,defaultProp:l??!1,onChange:c,caller:Hh});return d.jsx(gz,{scope:t,triggerId:Yt(),triggerRef:h,contentId:Yt(),open:g,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(v=>!v),[p]),modal:f,children:d.jsx(ez,{...m,open:g,onOpenChange:p,dir:o,modal:f,children:r})})};B2.displayName=Hh;var U2="DropdownMenuTrigger",$2=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,l=I2(U2,r),c=gn(r);return d.jsx(tz,{asChild:!0,...c,children:d.jsx(je.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:$a(t,l.triggerRef),onPointerDown:xe(e.onPointerDown,f=>{!o&&f.button===0&&f.ctrlKey===!1&&(l.onOpenToggle(),l.open||f.preventDefault())}),onKeyDown:xe(e.onKeyDown,f=>{o||(["Enter"," "].includes(f.key)&&l.onOpenToggle(),f.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});$2.displayName=U2;var vz="DropdownMenuPortal",V2=e=>{const{__scopeDropdownMenu:t,...r}=e,o=gn(t);return d.jsx(nz,{...o,...r})};V2.displayName=vz;var q2="DropdownMenuContent",F2=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=I2(q2,r),l=gn(r),c=b.useRef(!1);return d.jsx(rz,{id:s.contentId,"aria-labelledby":s.triggerId,...l,...o,ref:t,onCloseAutoFocus:xe(e.onCloseAutoFocus,f=>{var m;c.current||(m=s.triggerRef.current)==null||m.focus(),c.current=!1,f.preventDefault()}),onInteractOutside:xe(e.onInteractOutside,f=>{const m=f.detail.originalEvent,h=m.button===0&&m.ctrlKey===!0,g=m.button===2||h;(!s.modal||g)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});F2.displayName=q2;var yz="DropdownMenuGroup",xz=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=gn(r);return d.jsx(az,{...s,...o,ref:t})});xz.displayName=yz;var bz="DropdownMenuLabel",wz=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=gn(r);return d.jsx(oz,{...s,...o,ref:t})});wz.displayName=bz;var Sz="DropdownMenuItem",X2=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=gn(r);return d.jsx(sz,{...s,...o,ref:t})});X2.displayName=Sz;var Ez="DropdownMenuCheckboxItem",Y2=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=gn(r);return d.jsx(iz,{...s,...o,ref:t})});Y2.displayName=Ez;var _z="DropdownMenuRadioGroup",Cz=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=gn(r);return d.jsx(lz,{...s,...o,ref:t})});Cz.displayName=_z;var Nz="DropdownMenuRadioItem",jz=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=gn(r);return d.jsx(cz,{...s,...o,ref:t})});jz.displayName=Nz;var Tz="DropdownMenuItemIndicator",G2=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=gn(r);return d.jsx(uz,{...s,...o,ref:t})});G2.displayName=Tz;var Rz="DropdownMenuSeparator",Mz=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=gn(r);return d.jsx(dz,{...s,...o,ref:t})});Mz.displayName=Rz;var Az="DropdownMenuArrow",Oz=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=gn(r);return d.jsx(fz,{...s,...o,ref:t})});Oz.displayName=Az;var Dz="DropdownMenuSubTrigger",kz=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=gn(r);return d.jsx(hz,{...s,...o,ref:t})});kz.displayName=Dz;var zz="DropdownMenuSubContent",Lz=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,s=gn(r);return d.jsx(mz,{...s,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Lz.displayName=zz;var Pz=B2,Hz=$2,Iz=V2,Bz=F2,Uz=X2,$z=Y2,Vz=G2,qz="Label",K2=b.forwardRef((e,t)=>d.jsx(je.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));K2.displayName=qz;var Fz=K2;function Vv(e,[t,r]){return Math.min(r,Math.max(t,e))}function Xz(e,t){return b.useReducer((r,o)=>t[r][o]??r,e)}var m0="ScrollArea",[Q2]=Dr(m0),[Yz,mr]=Q2(m0),Z2=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:o="hover",dir:s,scrollHideDelay:l=600,...c}=e,[f,m]=b.useState(null),[h,g]=b.useState(null),[p,v]=b.useState(null),[x,E]=b.useState(null),[S,_]=b.useState(null),[C,j]=b.useState(0),[N,R]=b.useState(0),[O,A]=b.useState(!1),[D,P]=b.useState(!1),H=Xe(t,V=>m(V)),Q=Au(s);return d.jsx(Yz,{scope:r,type:o,dir:Q,scrollHideDelay:l,scrollArea:f,viewport:h,onViewportChange:g,content:p,onContentChange:v,scrollbarX:x,onScrollbarXChange:E,scrollbarXEnabled:O,onScrollbarXEnabledChange:A,scrollbarY:S,onScrollbarYChange:_,scrollbarYEnabled:D,onScrollbarYEnabledChange:P,onCornerWidthChange:j,onCornerHeightChange:R,children:d.jsx(je.div,{dir:Q,...c,ref:H,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});Z2.displayName=m0;var W2="ScrollAreaViewport",J2=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:o,nonce:s,...l}=e,c=mr(W2,r),f=b.useRef(null),m=Xe(t,f,c.onViewportChange);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),d.jsx(je.div,{"data-radix-scroll-area-viewport":"",...l,ref:m,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:d.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});J2.displayName=W2;var ia="ScrollAreaScrollbar",eN=b.forwardRef((e,t)=>{const{forceMount:r,...o}=e,s=mr(ia,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=s,f=e.orientation==="horizontal";return b.useEffect(()=>(f?l(!0):c(!0),()=>{f?l(!1):c(!1)}),[f,l,c]),s.type==="hover"?d.jsx(Gz,{...o,ref:t,forceMount:r}):s.type==="scroll"?d.jsx(Kz,{...o,ref:t,forceMount:r}):s.type==="auto"?d.jsx(tN,{...o,ref:t,forceMount:r}):s.type==="always"?d.jsx(p0,{...o,ref:t}):null});eN.displayName=ia;var Gz=b.forwardRef((e,t)=>{const{forceMount:r,...o}=e,s=mr(ia,e.__scopeScrollArea),[l,c]=b.useState(!1);return b.useEffect(()=>{const f=s.scrollArea;let m=0;if(f){const h=()=>{window.clearTimeout(m),c(!0)},g=()=>{m=window.setTimeout(()=>c(!1),s.scrollHideDelay)};return f.addEventListener("pointerenter",h),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(m),f.removeEventListener("pointerenter",h),f.removeEventListener("pointerleave",g)}}},[s.scrollArea,s.scrollHideDelay]),d.jsx(hn,{present:r||l,children:d.jsx(tN,{"data-state":l?"visible":"hidden",...o,ref:t})})}),Kz=b.forwardRef((e,t)=>{const{forceMount:r,...o}=e,s=mr(ia,e.__scopeScrollArea),l=e.orientation==="horizontal",c=Bh(()=>m("SCROLL_END"),100),[f,m]=Xz("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(f==="idle"){const h=window.setTimeout(()=>m("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(h)}},[f,s.scrollHideDelay,m]),b.useEffect(()=>{const h=s.viewport,g=l?"scrollLeft":"scrollTop";if(h){let p=h[g];const v=()=>{const x=h[g];p!==x&&(m("SCROLL"),c()),p=x};return h.addEventListener("scroll",v),()=>h.removeEventListener("scroll",v)}},[s.viewport,l,m,c]),d.jsx(hn,{present:r||f!=="hidden",children:d.jsx(p0,{"data-state":f==="hidden"?"hidden":"visible",...o,ref:t,onPointerEnter:xe(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:xe(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),tN=b.forwardRef((e,t)=>{const r=mr(ia,e.__scopeScrollArea),{forceMount:o,...s}=e,[l,c]=b.useState(!1),f=e.orientation==="horizontal",m=Bh(()=>{if(r.viewport){const h=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;c(f?h:g)}},10);return El(r.viewport,m),El(r.content,m),d.jsx(hn,{present:o||l,children:d.jsx(p0,{"data-state":l?"visible":"hidden",...s,ref:t})})}),p0=b.forwardRef((e,t)=>{const{orientation:r="vertical",...o}=e,s=mr(ia,e.__scopeScrollArea),l=b.useRef(null),c=b.useRef(0),[f,m]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=sN(f.viewport,f.content),g={...o,sizes:f,onSizesChange:m,hasThumb:h>0&&h<1,onThumbChange:v=>l.current=v,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:v=>c.current=v};function p(v,x){return t8(v,c.current,f,x)}return r==="horizontal"?d.jsx(Qz,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const v=s.viewport.scrollLeft,x=PS(v,f,s.dir);l.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:v=>{s.viewport&&(s.viewport.scrollLeft=v)},onDragScroll:v=>{s.viewport&&(s.viewport.scrollLeft=p(v,s.dir))}}):r==="vertical"?d.jsx(Zz,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const v=s.viewport.scrollTop,x=PS(v,f);l.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:v=>{s.viewport&&(s.viewport.scrollTop=v)},onDragScroll:v=>{s.viewport&&(s.viewport.scrollTop=p(v))}}):null}),Qz=b.forwardRef((e,t)=>{const{sizes:r,onSizesChange:o,...s}=e,l=mr(ia,e.__scopeScrollArea),[c,f]=b.useState(),m=b.useRef(null),h=Xe(t,m,l.onScrollbarXChange);return b.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),d.jsx(rN,{"data-orientation":"horizontal",...s,ref:h,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ih(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,p)=>{if(l.viewport){const v=l.viewport.scrollLeft+g.deltaX;e.onWheelScroll(v),lN(v,p)&&g.preventDefault()}},onResize:()=>{m.current&&l.viewport&&c&&o({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:nh(c.paddingLeft),paddingEnd:nh(c.paddingRight)}})}})}),Zz=b.forwardRef((e,t)=>{const{sizes:r,onSizesChange:o,...s}=e,l=mr(ia,e.__scopeScrollArea),[c,f]=b.useState(),m=b.useRef(null),h=Xe(t,m,l.onScrollbarYChange);return b.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),d.jsx(rN,{"data-orientation":"vertical",...s,ref:h,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ih(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,p)=>{if(l.viewport){const v=l.viewport.scrollTop+g.deltaY;e.onWheelScroll(v),lN(v,p)&&g.preventDefault()}},onResize:()=>{m.current&&l.viewport&&c&&o({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:nh(c.paddingTop),paddingEnd:nh(c.paddingBottom)}})}})}),[Wz,nN]=Q2(ia),rN=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:o,hasThumb:s,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:f,onThumbPositionChange:m,onDragScroll:h,onWheelScroll:g,onResize:p,...v}=e,x=mr(ia,r),[E,S]=b.useState(null),_=Xe(t,H=>S(H)),C=b.useRef(null),j=b.useRef(""),N=x.viewport,R=o.content-o.viewport,O=en(g),A=en(m),D=Bh(p,10);function P(H){if(C.current){const Q=H.clientX-C.current.left,V=H.clientY-C.current.top;h({x:Q,y:V})}}return b.useEffect(()=>{const H=Q=>{const V=Q.target;(E==null?void 0:E.contains(V))&&O(Q,R)};return document.addEventListener("wheel",H,{passive:!1}),()=>document.removeEventListener("wheel",H,{passive:!1})},[N,E,R,O]),b.useEffect(A,[o,A]),El(E,D),El(x.content,D),d.jsx(Wz,{scope:r,scrollbar:E,hasThumb:s,onThumbChange:en(l),onThumbPointerUp:en(c),onThumbPositionChange:A,onThumbPointerDown:en(f),children:d.jsx(je.div,{...v,ref:_,style:{position:"absolute",...v.style},onPointerDown:xe(e.onPointerDown,H=>{H.button===0&&(H.target.setPointerCapture(H.pointerId),C.current=E.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),P(H))}),onPointerMove:xe(e.onPointerMove,P),onPointerUp:xe(e.onPointerUp,H=>{const Q=H.target;Q.hasPointerCapture(H.pointerId)&&Q.releasePointerCapture(H.pointerId),document.body.style.webkitUserSelect=j.current,x.viewport&&(x.viewport.style.scrollBehavior=""),C.current=null})})})}),th="ScrollAreaThumb",aN=b.forwardRef((e,t)=>{const{forceMount:r,...o}=e,s=nN(th,e.__scopeScrollArea);return d.jsx(hn,{present:r||s.hasThumb,children:d.jsx(Jz,{ref:t,...o})})}),Jz=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:o,...s}=e,l=mr(th,r),c=nN(th,r),{onThumbPositionChange:f}=c,m=Xe(t,p=>c.onThumbChange(p)),h=b.useRef(void 0),g=Bh(()=>{h.current&&(h.current(),h.current=void 0)},100);return b.useEffect(()=>{const p=l.viewport;if(p){const v=()=>{if(g(),!h.current){const x=n8(p,f);h.current=x,f()}};return f(),p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[l.viewport,g,f]),d.jsx(je.div,{"data-state":c.hasThumb?"visible":"hidden",...s,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:xe(e.onPointerDownCapture,p=>{const x=p.target.getBoundingClientRect(),E=p.clientX-x.left,S=p.clientY-x.top;c.onThumbPointerDown({x:E,y:S})}),onPointerUp:xe(e.onPointerUp,c.onThumbPointerUp)})});aN.displayName=th;var g0="ScrollAreaCorner",oN=b.forwardRef((e,t)=>{const r=mr(g0,e.__scopeScrollArea),o=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&o?d.jsx(e8,{...e,ref:t}):null});oN.displayName=g0;var e8=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,...o}=e,s=mr(g0,r),[l,c]=b.useState(0),[f,m]=b.useState(0),h=!!(l&&f);return El(s.scrollbarX,()=>{var p;const g=((p=s.scrollbarX)==null?void 0:p.offsetHeight)||0;s.onCornerHeightChange(g),m(g)}),El(s.scrollbarY,()=>{var p;const g=((p=s.scrollbarY)==null?void 0:p.offsetWidth)||0;s.onCornerWidthChange(g),c(g)}),h?d.jsx(je.div,{...o,ref:t,style:{width:l,height:f,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function nh(e){return e?parseInt(e,10):0}function sN(e,t){const r=e/t;return isNaN(r)?0:r}function Ih(e){const t=sN(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-r)*t;return Math.max(o,18)}function t8(e,t,r,o="ltr"){const s=Ih(r),l=s/2,c=t||l,f=s-c,m=r.scrollbar.paddingStart+c,h=r.scrollbar.size-r.scrollbar.paddingEnd-f,g=r.content-r.viewport,p=o==="ltr"?[0,g]:[g*-1,0];return iN([m,h],p)(e)}function PS(e,t,r="ltr"){const o=Ih(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-s,c=t.content-t.viewport,f=l-o,m=r==="ltr"?[0,c]:[c*-1,0],h=Vv(e,m);return iN([0,c],[0,f])(h)}function iN(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(r-e[0])}}function lN(e,t){return e>0&&e<t}var n8=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},o=0;return(function s(){const l={left:e.scrollLeft,top:e.scrollTop},c=r.left!==l.left,f=r.top!==l.top;(c||f)&&t(),r=l,o=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(o)};function Bh(e,t){const r=en(e),o=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(o.current),[]),b.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(r,t)},[r,t])}function El(e,t){const r=en(t);Gt(()=>{let o=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(o),s.unobserve(e)}}},[e,r])}var r8=Z2,a8=J2,o8=oN,s8=[" ","Enter","ArrowUp","ArrowDown"],i8=[" ","Enter"],Ks="Select",[Uh,$h,l8]=zy(Ks),[Bl]=Dr(Ks,[l8,Il]),Vh=Il(),[c8,rs]=Bl(Ks),[u8,d8]=Bl(Ks),cN=e=>{const{__scopeSelect:t,children:r,open:o,defaultOpen:s,onOpenChange:l,value:c,defaultValue:f,onValueChange:m,dir:h,name:g,autoComplete:p,disabled:v,required:x,form:E}=e,S=Vh(t),[_,C]=b.useState(null),[j,N]=b.useState(null),[R,O]=b.useState(!1),A=Au(h),[D,P]=Go({prop:o,defaultProp:s??!1,onChange:l,caller:Ks}),[H,Q]=Go({prop:c,defaultProp:f,onChange:m,caller:Ks}),V=b.useRef(null),q=_?E||!!_.closest("form"):!0,[ee,B]=b.useState(new Set),K=Array.from(ee).map(M=>M.props.value).join(";");return d.jsx(r0,{...S,children:d.jsxs(c8,{required:x,scope:t,trigger:_,onTriggerChange:C,valueNode:j,onValueNodeChange:N,valueNodeHasChildren:R,onValueNodeHasChildrenChange:O,contentId:Yt(),value:H,onValueChange:Q,open:D,onOpenChange:P,dir:A,triggerPointerDownPosRef:V,disabled:v,children:[d.jsx(Uh.Provider,{scope:t,children:d.jsx(u8,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(M=>{B(I=>new Set(I).add(M))},[]),onNativeOptionRemove:b.useCallback(M=>{B(I=>{const U=new Set(I);return U.delete(M),U})},[]),children:r})}),q?d.jsxs(AN,{"aria-hidden":!0,required:x,tabIndex:-1,name:g,autoComplete:p,value:H,onChange:M=>Q(M.target.value),disabled:v,form:E,children:[H===void 0?d.jsx("option",{value:""}):null,Array.from(ee)]},K):null]})})};cN.displayName=Ks;var uN="SelectTrigger",dN=b.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:o=!1,...s}=e,l=Vh(r),c=rs(uN,r),f=c.disabled||o,m=Xe(t,c.onTriggerChange),h=$h(r),g=b.useRef("touch"),[p,v,x]=DN(S=>{const _=h().filter(N=>!N.disabled),C=_.find(N=>N.value===c.value),j=kN(_,S,C);j!==void 0&&c.onValueChange(j.value)}),E=S=>{f||(c.onOpenChange(!0),x()),S&&(c.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return d.jsx(a0,{asChild:!0,...l,children:d.jsx(je.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":ON(c.value)?"":void 0,...s,ref:m,onClick:xe(s.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&E(S)}),onPointerDown:xe(s.onPointerDown,S=>{g.current=S.pointerType;const _=S.target;_.hasPointerCapture(S.pointerId)&&_.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(E(S),S.preventDefault())}),onKeyDown:xe(s.onKeyDown,S=>{const _=p.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&v(S.key),!(_&&S.key===" ")&&s8.includes(S.key)&&(E(),S.preventDefault())})})})});dN.displayName=uN;var fN="SelectValue",hN=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:s,children:l,placeholder:c="",...f}=e,m=rs(fN,r),{onValueNodeHasChildrenChange:h}=m,g=l!==void 0,p=Xe(t,m.onValueNodeChange);return Gt(()=>{h(g)},[h,g]),d.jsx(je.span,{...f,ref:p,style:{pointerEvents:"none"},children:ON(m.value)?d.jsx(d.Fragment,{children:c}):l})});hN.displayName=fN;var f8="SelectIcon",mN=b.forwardRef((e,t)=>{const{__scopeSelect:r,children:o,...s}=e;return d.jsx(je.span,{"aria-hidden":!0,...s,ref:t,children:o||"▼"})});mN.displayName=f8;var h8="SelectPortal",pN=e=>d.jsx(Du,{asChild:!0,...e});pN.displayName=h8;var Qs="SelectContent",gN=b.forwardRef((e,t)=>{const r=rs(Qs,e.__scopeSelect),[o,s]=b.useState();if(Gt(()=>{s(new DocumentFragment)},[]),!r.open){const l=o;return l?Mu.createPortal(d.jsx(vN,{scope:e.__scopeSelect,children:d.jsx(Uh.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),l):null}return d.jsx(yN,{...e,ref:t})});gN.displayName=Qs;var wr=10,[vN,as]=Bl(Qs),m8="SelectContentImpl",p8=Xs("SelectContent.RemoveScroll"),yN=b.forwardRef((e,t)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:c,side:f,sideOffset:m,align:h,alignOffset:g,arrowPadding:p,collisionBoundary:v,collisionPadding:x,sticky:E,hideWhenDetached:S,avoidCollisions:_,...C}=e,j=rs(Qs,r),[N,R]=b.useState(null),[O,A]=b.useState(null),D=Xe(t,ne=>R(ne)),[P,H]=b.useState(null),[Q,V]=b.useState(null),q=$h(r),[ee,B]=b.useState(!1),K=b.useRef(!1);b.useEffect(()=>{if(N)return By(N)},[N]),Iy();const M=b.useCallback(ne=>{const[re,...le]=q().map(he=>he.ref.current),[ve]=le.slice(-1),ge=document.activeElement;for(const he of ne)if(he===ge||(he==null||he.scrollIntoView({block:"nearest"}),he===re&&O&&(O.scrollTop=0),he===ve&&O&&(O.scrollTop=O.scrollHeight),he==null||he.focus(),document.activeElement!==ge))return},[q,O]),I=b.useCallback(()=>M([P,N]),[M,P,N]);b.useEffect(()=>{ee&&I()},[ee,I]);const{onOpenChange:U,triggerPointerDownPosRef:$}=j;b.useEffect(()=>{if(N){let ne={x:0,y:0};const re=ve=>{var ge,he;ne={x:Math.abs(Math.round(ve.pageX)-(((ge=$.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(ve.pageY)-(((he=$.current)==null?void 0:he.y)??0))}},le=ve=>{ne.x<=10&&ne.y<=10?ve.preventDefault():N.contains(ve.target)||U(!1),document.removeEventListener("pointermove",re),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",le,{capture:!0})}}},[N,U,$]),b.useEffect(()=>{const ne=()=>U(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[U]);const[X,k]=DN(ne=>{const re=q().filter(ge=>!ge.disabled),le=re.find(ge=>ge.ref.current===document.activeElement),ve=kN(re,ne,le);ve&&setTimeout(()=>ve.ref.current.focus())}),L=b.useCallback((ne,re,le)=>{const ve=!K.current&&!le;(j.value!==void 0&&j.value===re||ve)&&(H(ne),ve&&(K.current=!0))},[j.value]),Y=b.useCallback(()=>N==null?void 0:N.focus(),[N]),W=b.useCallback((ne,re,le)=>{const ve=!K.current&&!le;(j.value!==void 0&&j.value===re||ve)&&V(ne)},[j.value]),J=o==="popper"?qv:xN,se=J===qv?{side:f,sideOffset:m,align:h,alignOffset:g,arrowPadding:p,collisionBoundary:v,collisionPadding:x,sticky:E,hideWhenDetached:S,avoidCollisions:_}:{};return d.jsx(vN,{scope:r,content:N,viewport:O,onViewportChange:A,itemRefCallback:L,selectedItem:P,onItemLeave:Y,itemTextRefCallback:W,focusSelectedItem:I,selectedItemText:Q,position:o,isPositioned:ee,searchRef:X,children:d.jsx(Rh,{as:p8,allowPinchZoom:!0,children:d.jsx(jh,{asChild:!0,trapped:j.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:xe(s,ne=>{var re;(re=j.trigger)==null||re.focus({preventScroll:!0}),ne.preventDefault()}),children:d.jsx(Ou,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:d.jsx(J,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:ne=>ne.preventDefault(),...C,...se,onPlaced:()=>B(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:xe(C.onKeyDown,ne=>{const re=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!re&&ne.key.length===1&&k(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let ve=q().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const ge=ne.target,he=ve.indexOf(ge);ve=ve.slice(he+1)}setTimeout(()=>M(ve)),ne.preventDefault()}})})})})})})});yN.displayName=m8;var g8="SelectItemAlignedPosition",xN=b.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:o,...s}=e,l=rs(Qs,r),c=as(Qs,r),[f,m]=b.useState(null),[h,g]=b.useState(null),p=Xe(t,D=>g(D)),v=$h(r),x=b.useRef(!1),E=b.useRef(!0),{viewport:S,selectedItem:_,selectedItemText:C,focusSelectedItem:j}=c,N=b.useCallback(()=>{if(l.trigger&&l.valueNode&&f&&h&&S&&_&&C){const D=l.trigger.getBoundingClientRect(),P=h.getBoundingClientRect(),H=l.valueNode.getBoundingClientRect(),Q=C.getBoundingClientRect();if(l.dir!=="rtl"){const ge=Q.left-P.left,he=H.left-ge,ye=D.left-he,Ne=D.width+ye,Ue=Math.max(Ne,P.width),ke=window.innerWidth-wr,nt=Vv(he,[wr,Math.max(wr,ke-Ue)]);f.style.minWidth=Ne+"px",f.style.left=nt+"px"}else{const ge=P.right-Q.right,he=window.innerWidth-H.right-ge,ye=window.innerWidth-D.right-he,Ne=D.width+ye,Ue=Math.max(Ne,P.width),ke=window.innerWidth-wr,nt=Vv(he,[wr,Math.max(wr,ke-Ue)]);f.style.minWidth=Ne+"px",f.style.right=nt+"px"}const V=v(),q=window.innerHeight-wr*2,ee=S.scrollHeight,B=window.getComputedStyle(h),K=parseInt(B.borderTopWidth,10),M=parseInt(B.paddingTop,10),I=parseInt(B.borderBottomWidth,10),U=parseInt(B.paddingBottom,10),$=K+M+ee+U+I,X=Math.min(_.offsetHeight*5,$),k=window.getComputedStyle(S),L=parseInt(k.paddingTop,10),Y=parseInt(k.paddingBottom,10),W=D.top+D.height/2-wr,J=q-W,se=_.offsetHeight/2,ne=_.offsetTop+se,re=K+M+ne,le=$-re;if(re<=W){const ge=V.length>0&&_===V[V.length-1].ref.current;f.style.bottom="0px";const he=h.clientHeight-S.offsetTop-S.offsetHeight,ye=Math.max(J,se+(ge?Y:0)+he+I),Ne=re+ye;f.style.height=Ne+"px"}else{const ge=V.length>0&&_===V[0].ref.current;f.style.top="0px";const ye=Math.max(W,K+S.offsetTop+(ge?L:0)+se)+le;f.style.height=ye+"px",S.scrollTop=re-W+S.offsetTop}f.style.margin=`${wr}px 0`,f.style.minHeight=X+"px",f.style.maxHeight=q+"px",o==null||o(),requestAnimationFrame(()=>x.current=!0)}},[v,l.trigger,l.valueNode,f,h,S,_,C,l.dir,o]);Gt(()=>N(),[N]);const[R,O]=b.useState();Gt(()=>{h&&O(window.getComputedStyle(h).zIndex)},[h]);const A=b.useCallback(D=>{D&&E.current===!0&&(N(),j==null||j(),E.current=!1)},[N,j]);return d.jsx(y8,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:x,onScrollButtonChange:A,children:d.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:d.jsx(je.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});xN.displayName=g8;var v8="SelectPopperPosition",qv=b.forwardRef((e,t)=>{const{__scopeSelect:r,align:o="start",collisionPadding:s=wr,...l}=e,c=Vh(r);return d.jsx(o0,{...c,...l,ref:t,align:o,collisionPadding:s,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});qv.displayName=v8;var[y8,v0]=Bl(Qs,{}),Fv="SelectViewport",bN=b.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:o,...s}=e,l=as(Fv,r),c=v0(Fv,r),f=Xe(t,l.onViewportChange),m=b.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(Uh.Slot,{scope:r,children:d.jsx(je.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:xe(s.onScroll,h=>{const g=h.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:v}=c;if(v!=null&&v.current&&p){const x=Math.abs(m.current-g.scrollTop);if(x>0){const E=window.innerHeight-wr*2,S=parseFloat(p.style.minHeight),_=parseFloat(p.style.height),C=Math.max(S,_);if(C<E){const j=C+x,N=Math.min(E,j),R=j-N;p.style.height=N+"px",p.style.bottom==="0px"&&(g.scrollTop=R>0?R:0,p.style.justifyContent="flex-end")}}}m.current=g.scrollTop})})})]})});bN.displayName=Fv;var wN="SelectGroup",[x8,b8]=Bl(wN),w8=b.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,s=Yt();return d.jsx(x8,{scope:r,id:s,children:d.jsx(je.div,{role:"group","aria-labelledby":s,...o,ref:t})})});w8.displayName=wN;var SN="SelectLabel",S8=b.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,s=b8(SN,r);return d.jsx(je.div,{id:s.id,...o,ref:t})});S8.displayName=SN;var rh="SelectItem",[E8,EN]=Bl(rh),_N=b.forwardRef((e,t)=>{const{__scopeSelect:r,value:o,disabled:s=!1,textValue:l,...c}=e,f=rs(rh,r),m=as(rh,r),h=f.value===o,[g,p]=b.useState(l??""),[v,x]=b.useState(!1),E=Xe(t,j=>{var N;return(N=m.itemRefCallback)==null?void 0:N.call(m,j,o,s)}),S=Yt(),_=b.useRef("touch"),C=()=>{s||(f.onValueChange(o),f.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(E8,{scope:r,value:o,disabled:s,textId:S,isSelected:h,onItemTextChange:b.useCallback(j=>{p(N=>N||((j==null?void 0:j.textContent)??"").trim())},[]),children:d.jsx(Uh.ItemSlot,{scope:r,value:o,disabled:s,textValue:g,children:d.jsx(je.div,{role:"option","aria-labelledby":S,"data-highlighted":v?"":void 0,"aria-selected":h&&v,"data-state":h?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:E,onFocus:xe(c.onFocus,()=>x(!0)),onBlur:xe(c.onBlur,()=>x(!1)),onClick:xe(c.onClick,()=>{_.current!=="mouse"&&C()}),onPointerUp:xe(c.onPointerUp,()=>{_.current==="mouse"&&C()}),onPointerDown:xe(c.onPointerDown,j=>{_.current=j.pointerType}),onPointerMove:xe(c.onPointerMove,j=>{var N;_.current=j.pointerType,s?(N=m.onItemLeave)==null||N.call(m):_.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:xe(c.onPointerLeave,j=>{var N;j.currentTarget===document.activeElement&&((N=m.onItemLeave)==null||N.call(m))}),onKeyDown:xe(c.onKeyDown,j=>{var R;((R=m.searchRef)==null?void 0:R.current)!==""&&j.key===" "||(i8.includes(j.key)&&C(),j.key===" "&&j.preventDefault())})})})})});_N.displayName=rh;var Yc="SelectItemText",CN=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:s,...l}=e,c=rs(Yc,r),f=as(Yc,r),m=EN(Yc,r),h=d8(Yc,r),[g,p]=b.useState(null),v=Xe(t,C=>p(C),m.onItemTextChange,C=>{var j;return(j=f.itemTextRefCallback)==null?void 0:j.call(f,C,m.value,m.disabled)}),x=g==null?void 0:g.textContent,E=b.useMemo(()=>d.jsx("option",{value:m.value,disabled:m.disabled,children:x},m.value),[m.disabled,m.value,x]),{onNativeOptionAdd:S,onNativeOptionRemove:_}=h;return Gt(()=>(S(E),()=>_(E)),[S,_,E]),d.jsxs(d.Fragment,{children:[d.jsx(je.span,{id:m.textId,...l,ref:v}),m.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Mu.createPortal(l.children,c.valueNode):null]})});CN.displayName=Yc;var NN="SelectItemIndicator",jN=b.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return EN(NN,r).isSelected?d.jsx(je.span,{"aria-hidden":!0,...o,ref:t}):null});jN.displayName=NN;var Xv="SelectScrollUpButton",TN=b.forwardRef((e,t)=>{const r=as(Xv,e.__scopeSelect),o=v0(Xv,e.__scopeSelect),[s,l]=b.useState(!1),c=Xe(t,o.onScrollButtonChange);return Gt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const h=m.scrollTop>0;l(h)};const m=r.viewport;return f(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),s?d.jsx(MN,{...e,ref:c,onAutoScroll:()=>{const{viewport:f,selectedItem:m}=r;f&&m&&(f.scrollTop=f.scrollTop-m.offsetHeight)}}):null});TN.displayName=Xv;var Yv="SelectScrollDownButton",RN=b.forwardRef((e,t)=>{const r=as(Yv,e.__scopeSelect),o=v0(Yv,e.__scopeSelect),[s,l]=b.useState(!1),c=Xe(t,o.onScrollButtonChange);return Gt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const h=m.scrollHeight-m.clientHeight,g=Math.ceil(m.scrollTop)<h;l(g)};const m=r.viewport;return f(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),s?d.jsx(MN,{...e,ref:c,onAutoScroll:()=>{const{viewport:f,selectedItem:m}=r;f&&m&&(f.scrollTop=f.scrollTop+m.offsetHeight)}}):null});RN.displayName=Yv;var MN=b.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:o,...s}=e,l=as("SelectScrollButton",r),c=b.useRef(null),f=$h(r),m=b.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return b.useEffect(()=>()=>m(),[m]),Gt(()=>{var g;const h=f().find(p=>p.ref.current===document.activeElement);(g=h==null?void 0:h.ref.current)==null||g.scrollIntoView({block:"nearest"})},[f]),d.jsx(je.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:xe(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(o,50))}),onPointerMove:xe(s.onPointerMove,()=>{var h;(h=l.onItemLeave)==null||h.call(l),c.current===null&&(c.current=window.setInterval(o,50))}),onPointerLeave:xe(s.onPointerLeave,()=>{m()})})}),_8="SelectSeparator",C8=b.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return d.jsx(je.div,{"aria-hidden":!0,...o,ref:t})});C8.displayName=_8;var Gv="SelectArrow",N8=b.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,s=Vh(r),l=rs(Gv,r),c=as(Gv,r);return l.open&&c.position==="popper"?d.jsx(s0,{...s,...o,ref:t}):null});N8.displayName=Gv;var j8="SelectBubbleInput",AN=b.forwardRef(({__scopeSelect:e,value:t,...r},o)=>{const s=b.useRef(null),l=Xe(o,s),c=n4(t);return b.useEffect(()=>{const f=s.current;if(!f)return;const m=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(m,"value").set;if(c!==t&&g){const p=new Event("change",{bubbles:!0});g.call(f,t),f.dispatchEvent(p)}},[c,t]),d.jsx(je.select,{...r,style:{...lC,...r.style},ref:l,defaultValue:t})});AN.displayName=j8;function ON(e){return e===""||e===void 0}function DN(e){const t=en(e),r=b.useRef(""),o=b.useRef(0),s=b.useCallback(c=>{const f=r.current+c;t(f),(function m(h){r.current=h,window.clearTimeout(o.current),h!==""&&(o.current=window.setTimeout(()=>m(""),1e3))})(f)},[t]),l=b.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,s,l]}function kN(e,t,r){const s=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=r?e.indexOf(r):-1;let c=T8(e,Math.max(l,0));s.length===1&&(c=c.filter(h=>h!==r));const m=c.find(h=>h.textValue.toLowerCase().startsWith(s.toLowerCase()));return m!==r?m:void 0}function T8(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var R8=cN,M8=dN,A8=hN,O8=mN,D8=pN,k8=gN,z8=bN,L8=_N,P8=CN,H8=jN,I8=TN,B8=RN,U8="Separator",HS="horizontal",$8=["horizontal","vertical"],zN=b.forwardRef((e,t)=>{const{decorative:r,orientation:o=HS,...s}=e,l=V8(o)?o:HS,f=r?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return d.jsx(je.div,{"data-orientation":l,...f,...s,ref:t})});zN.displayName=U8;function V8(e){return $8.includes(e)}var q8=zN,qh="Tabs",[F8]=Dr(qh,[zh]),LN=zh(),[X8,y0]=F8(qh),PN=b.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,onValueChange:s,defaultValue:l,orientation:c="horizontal",dir:f,activationMode:m="automatic",...h}=e,g=Au(f),[p,v]=Go({prop:o,onChange:s,defaultProp:l??"",caller:qh});return d.jsx(X8,{scope:r,baseId:Yt(),value:p,onValueChange:v,orientation:c,dir:g,activationMode:m,children:d.jsx(je.div,{dir:g,"data-orientation":c,...h,ref:t})})});PN.displayName=qh;var HN="TabsList",IN=b.forwardRef((e,t)=>{const{__scopeTabs:r,loop:o=!0,...s}=e,l=y0(HN,r),c=LN(r);return d.jsx(m2,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:o,children:d.jsx(je.div,{role:"tablist","aria-orientation":l.orientation,...s,ref:t})})});IN.displayName=HN;var BN="TabsTrigger",UN=b.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,disabled:s=!1,...l}=e,c=y0(BN,r),f=LN(r),m=qN(c.baseId,o),h=FN(c.baseId,o),g=o===c.value;return d.jsx(p2,{asChild:!0,...f,focusable:!s,active:g,children:d.jsx(je.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":h,"data-state":g?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:m,...l,ref:t,onMouseDown:xe(e.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?c.onValueChange(o):p.preventDefault()}),onKeyDown:xe(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&c.onValueChange(o)}),onFocus:xe(e.onFocus,()=>{const p=c.activationMode!=="manual";!g&&!s&&p&&c.onValueChange(o)})})})});UN.displayName=BN;var $N="TabsContent",VN=b.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,forceMount:s,children:l,...c}=e,f=y0($N,r),m=qN(f.baseId,o),h=FN(f.baseId,o),g=o===f.value,p=b.useRef(g);return b.useEffect(()=>{const v=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(v)},[]),d.jsx(hn,{present:s||g,children:({present:v})=>d.jsx(je.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":m,hidden:!v,id:h,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:v&&l})})});VN.displayName=$N;function qN(e,t){return`${e}-trigger-${t}`}function FN(e,t){return`${e}-content-${t}`}var Y8=PN,G8=IN,K8=UN,Q8=VN,[Fh]=Dr("Tooltip",[Il]),Xh=Il(),XN="TooltipProvider",Z8=700,Kv="tooltip.open",[W8,x0]=Fh(XN),YN=e=>{const{__scopeTooltip:t,delayDuration:r=Z8,skipDelayDuration:o=300,disableHoverableContent:s=!1,children:l}=e,c=b.useRef(!0),f=b.useRef(!1),m=b.useRef(0);return b.useEffect(()=>{const h=m.current;return()=>window.clearTimeout(h)},[]),d.jsx(W8,{scope:t,isOpenDelayedRef:c,delayDuration:r,onOpen:b.useCallback(()=>{window.clearTimeout(m.current),c.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>c.current=!0,o)},[o]),isPointerInTransitRef:f,onPointerInTransitChange:b.useCallback(h=>{f.current=h},[]),disableHoverableContent:s,children:l})};YN.displayName=XN;var ou="Tooltip",[J8,Hu]=Fh(ou),GN=e=>{const{__scopeTooltip:t,children:r,open:o,defaultOpen:s,onOpenChange:l,disableHoverableContent:c,delayDuration:f}=e,m=x0(ou,e.__scopeTooltip),h=Xh(t),[g,p]=b.useState(null),v=Yt(),x=b.useRef(0),E=c??m.disableHoverableContent,S=f??m.delayDuration,_=b.useRef(!1),[C,j]=Go({prop:o,defaultProp:s??!1,onChange:D=>{D?(m.onOpen(),document.dispatchEvent(new CustomEvent(Kv))):m.onClose(),l==null||l(D)},caller:ou}),N=b.useMemo(()=>C?_.current?"delayed-open":"instant-open":"closed",[C]),R=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,_.current=!1,j(!0)},[j]),O=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,j(!1)},[j]),A=b.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{_.current=!0,j(!0),x.current=0},S)},[S,j]);return b.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),d.jsx(r0,{...h,children:d.jsx(J8,{scope:t,contentId:v,open:C,stateAttribute:N,trigger:g,onTriggerChange:p,onTriggerEnter:b.useCallback(()=>{m.isOpenDelayedRef.current?A():R()},[m.isOpenDelayedRef,A,R]),onTriggerLeave:b.useCallback(()=>{E?O():(window.clearTimeout(x.current),x.current=0)},[O,E]),onOpen:R,onClose:O,disableHoverableContent:E,children:r})})};GN.displayName=ou;var Qv="TooltipTrigger",KN=b.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,s=Hu(Qv,r),l=x0(Qv,r),c=Xh(r),f=b.useRef(null),m=Xe(t,f,s.onTriggerChange),h=b.useRef(!1),g=b.useRef(!1),p=b.useCallback(()=>h.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),d.jsx(a0,{asChild:!0,...c,children:d.jsx(je.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:m,onPointerMove:xe(e.onPointerMove,v=>{v.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:xe(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:xe(e.onPointerDown,()=>{s.open&&s.onClose(),h.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:xe(e.onFocus,()=>{h.current||s.onOpen()}),onBlur:xe(e.onBlur,s.onClose),onClick:xe(e.onClick,s.onClose)})})});KN.displayName=Qv;var b0="TooltipPortal",[eL,tL]=Fh(b0,{forceMount:void 0}),QN=e=>{const{__scopeTooltip:t,forceMount:r,children:o,container:s}=e,l=Hu(b0,t);return d.jsx(eL,{scope:t,forceMount:r,children:d.jsx(hn,{present:r||l.open,children:d.jsx(Du,{asChild:!0,container:s,children:o})})})};QN.displayName=b0;var _l="TooltipContent",ZN=b.forwardRef((e,t)=>{const r=tL(_l,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...l}=e,c=Hu(_l,e.__scopeTooltip);return d.jsx(hn,{present:o||c.open,children:c.disableHoverableContent?d.jsx(WN,{side:s,...l,ref:t}):d.jsx(nL,{side:s,...l,ref:t})})}),nL=b.forwardRef((e,t)=>{const r=Hu(_l,e.__scopeTooltip),o=x0(_l,e.__scopeTooltip),s=b.useRef(null),l=Xe(t,s),[c,f]=b.useState(null),{trigger:m,onClose:h}=r,g=s.current,{onPointerInTransitChange:p}=o,v=b.useCallback(()=>{f(null),p(!1)},[p]),x=b.useCallback((E,S)=>{const _=E.currentTarget,C={x:E.clientX,y:E.clientY},j=sL(C,_.getBoundingClientRect()),N=iL(C,j),R=lL(S.getBoundingClientRect()),O=uL([...N,...R]);f(O),p(!0)},[p]);return b.useEffect(()=>()=>v(),[v]),b.useEffect(()=>{if(m&&g){const E=_=>x(_,g),S=_=>x(_,m);return m.addEventListener("pointerleave",E),g.addEventListener("pointerleave",S),()=>{m.removeEventListener("pointerleave",E),g.removeEventListener("pointerleave",S)}}},[m,g,x,v]),b.useEffect(()=>{if(c){const E=S=>{const _=S.target,C={x:S.clientX,y:S.clientY},j=(m==null?void 0:m.contains(_))||(g==null?void 0:g.contains(_)),N=!cL(C,c);j?v():N&&(v(),h())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[m,g,c,h,v]),d.jsx(WN,{...e,ref:l})}),[rL,aL]=Fh(ou,{isInside:!1}),oL=w3("TooltipContent"),WN=b.forwardRef((e,t)=>{const{__scopeTooltip:r,children:o,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...f}=e,m=Hu(_l,r),h=Xh(r),{onClose:g}=m;return b.useEffect(()=>(document.addEventListener(Kv,g),()=>document.removeEventListener(Kv,g)),[g]),b.useEffect(()=>{if(m.trigger){const p=v=>{const x=v.target;x!=null&&x.contains(m.trigger)&&g()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[m.trigger,g]),d.jsx(Ou,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:p=>p.preventDefault(),onDismiss:g,children:d.jsxs(o0,{"data-state":m.stateAttribute,...h,...f,ref:t,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(oL,{children:o}),d.jsx(rL,{scope:r,isInside:!0,children:d.jsx(j3,{id:m.contentId,role:"tooltip",children:s||o})})]})})});ZN.displayName=_l;var JN="TooltipArrow",ej=b.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,s=Xh(r);return aL(JN,r).isInside?null:d.jsx(s0,{...s,...o,ref:t})});ej.displayName=JN;function sL(e,t){const r=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(r,o,s,l)){case l:return"left";case s:return"right";case r:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function iL(e,t,r=5){const o=[];switch(t){case"top":o.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":o.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":o.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":o.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return o}function lL(e){const{top:t,right:r,bottom:o,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:o},{x:s,y:o}]}function cL(e,t){const{x:r,y:o}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const f=t[l],m=t[c],h=f.x,g=f.y,p=m.x,v=m.y;g>o!=v>o&&r<(p-h)*(o-g)/(v-g)+h&&(s=!s)}return s}function uL(e){const t=e.slice();return t.sort((r,o)=>r.x<o.x?-1:r.x>o.x?1:r.y<o.y?-1:r.y>o.y?1:0),dL(t)}function dL(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const s=e[o];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let o=e.length-1;o>=0;o--){const s=e[o];for(;r.length>=2;){const l=r[r.length-1],c=r[r.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var fL=YN,hL=GN,mL=KN,pL=QN,gL=ZN,vL=ej;function tj(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=tj(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function nj(){for(var e,t,r=0,o="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=tj(e))&&(o&&(o+=" "),o+=t);return o}const yL=(e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r},xL=(e,t)=>({classGroupId:e,validator:t}),rj=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),ah="-",IS=[],bL="arbitrary..",wL=e=>{const t=EL(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return SL(c);const f=c.split(ah),m=f[0]===""&&f.length>1?1:0;return aj(f,m,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=o[c],h=r[c];return m?h?yL(h,m):m:h||IS}return r[c]||IS}}},aj=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],l=r.nextPart.get(s);if(l){const h=aj(e,t+1,l);if(h)return h}const c=r.validators;if(c===null)return;const f=t===0?e.join(ah):e.slice(t).join(ah),m=c.length;for(let h=0;h<m;h++){const g=c[h];if(g.validator(f))return g.classGroupId}},SL=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?bL+o:void 0})(),EL=e=>{const{theme:t,classGroups:r}=e;return _L(r,t)},_L=(e,t)=>{const r=rj();for(const o in e){const s=e[o];w0(s,r,o,t)}return r},w0=(e,t,r,o)=>{const s=e.length;for(let l=0;l<s;l++){const c=e[l];CL(c,t,r,o)}},CL=(e,t,r,o)=>{if(typeof e=="string"){NL(e,t,r);return}if(typeof e=="function"){jL(e,t,r,o);return}TL(e,t,r,o)},NL=(e,t,r)=>{const o=e===""?t:oj(t,e);o.classGroupId=r},jL=(e,t,r,o)=>{if(RL(e)){w0(e(o),t,r,o);return}t.validators===null&&(t.validators=[]),t.validators.push(xL(r,e))},TL=(e,t,r,o)=>{const s=Object.entries(e),l=s.length;for(let c=0;c<l;c++){const[f,m]=s[c];w0(m,oj(t,f),r,o)}},oj=(e,t)=>{let r=e;const o=t.split(ah),s=o.length;for(let l=0;l<s;l++){const c=o[l];let f=r.nextPart.get(c);f||(f=rj(),r.nextPart.set(c,f)),r=f}return r},RL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ML=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null);const s=(l,c)=>{r[l]=c,t++,t>e&&(t=0,o=r,r=Object.create(null))};return{get(l){let c=r[l];if(c!==void 0)return c;if((c=o[l])!==void 0)return s(l,c),c},set(l,c){l in r?r[l]=c:s(l,c)}}},Zv="!",BS=":",AL=[],US=(e,t,r,o,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:s}),OL=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=s=>{const l=[];let c=0,f=0,m=0,h;const g=s.length;for(let S=0;S<g;S++){const _=s[S];if(c===0&&f===0){if(_===BS){l.push(s.slice(m,S)),m=S+1;continue}if(_==="/"){h=S;continue}}_==="["?c++:_==="]"?c--:_==="("?f++:_===")"&&f--}const p=l.length===0?s:s.slice(m);let v=p,x=!1;p.endsWith(Zv)?(v=p.slice(0,-1),x=!0):p.startsWith(Zv)&&(v=p.slice(1),x=!0);const E=h&&h>m?h-m:void 0;return US(l,x,v,E)};if(t){const s=t+BS,l=o;o=c=>c.startsWith(s)?l(c.slice(s.length)):US(AL,!1,c,void 0,!0)}if(r){const s=o;o=l=>r({className:l,parseClassName:s})}return o},DL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,o)=>{t.set(r,1e6+o)}),r=>{const o=[];let s=[];for(let l=0;l<r.length;l++){const c=r[l],f=c[0]==="[",m=t.has(c);f||m?(s.length>0&&(s.sort(),o.push(...s),s=[]),o.push(c)):s.push(c)}return s.length>0&&(s.sort(),o.push(...s)),o}},kL=e=>({cache:ML(e.cacheSize),parseClassName:OL(e),sortModifiers:DL(e),...wL(e)}),zL=/\s+/,LL=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:s,sortModifiers:l}=t,c=[],f=e.trim().split(zL);let m="";for(let h=f.length-1;h>=0;h-=1){const g=f[h],{isExternal:p,modifiers:v,hasImportantModifier:x,baseClassName:E,maybePostfixModifierPosition:S}=r(g);if(p){m=g+(m.length>0?" "+m:m);continue}let _=!!S,C=o(_?E.substring(0,S):E);if(!C){if(!_){m=g+(m.length>0?" "+m:m);continue}if(C=o(E),!C){m=g+(m.length>0?" "+m:m);continue}_=!1}const j=v.length===0?"":v.length===1?v[0]:l(v).join(":"),N=x?j+Zv:j,R=N+C;if(c.indexOf(R)>-1)continue;c.push(R);const O=s(C,_);for(let A=0;A<O.length;++A){const D=O[A];c.push(N+D)}m=g+(m.length>0?" "+m:m)}return m},PL=(...e)=>{let t=0,r,o,s="";for(;t<e.length;)(r=e[t++])&&(o=sj(r))&&(s&&(s+=" "),s+=o);return s},sj=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=sj(e[o]))&&(r&&(r+=" "),r+=t);return r},HL=(e,...t)=>{let r,o,s,l;const c=m=>{const h=t.reduce((g,p)=>p(g),e());return r=kL(h),o=r.cache.get,s=r.cache.set,l=f,f(m)},f=m=>{const h=o(m);if(h)return h;const g=LL(m,r);return s(m,g),g};return l=c,(...m)=>l(PL(...m))},IL=[],Ut=e=>{const t=r=>r[e]||IL;return t.isThemeGetter=!0,t},ij=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,BL=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,UL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$L=/\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$/,VL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,To=e=>BL.test(e),Be=e=>!!e&&!Number.isNaN(Number(e)),Ro=e=>!!e&&Number.isInteger(Number(e)),Fg=e=>e.endsWith("%")&&Be(e.slice(0,-1)),Oa=e=>UL.test(e),cj=()=>!0,XL=e=>$L.test(e)&&!VL.test(e),S0=()=>!1,YL=e=>qL.test(e),GL=e=>FL.test(e),KL=e=>!Se(e)&&!_e(e),QL=e=>os(e,fj,S0),Se=e=>ij.test(e),Ts=e=>os(e,hj,XL),$S=e=>os(e,a6,Be),ZL=e=>os(e,pj,cj),WL=e=>os(e,mj,S0),VS=e=>os(e,uj,S0),JL=e=>os(e,dj,GL),bf=e=>os(e,gj,YL),_e=e=>lj.test(e),Hc=e=>oi(e,hj),e6=e=>oi(e,mj),qS=e=>oi(e,uj),t6=e=>oi(e,fj),n6=e=>oi(e,dj),wf=e=>oi(e,gj,!0),r6=e=>oi(e,pj,!0),os=(e,t,r)=>{const o=ij.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},oi=(e,t,r=!1)=>{const o=lj.exec(e);return o?o[1]?t(o[1]):r:!1},uj=e=>e==="position"||e==="percentage",dj=e=>e==="image"||e==="url",fj=e=>e==="length"||e==="size"||e==="bg-size",hj=e=>e==="length",a6=e=>e==="number",mj=e=>e==="family-name",pj=e=>e==="number"||e==="weight",gj=e=>e==="shadow",o6=()=>{const e=Ut("color"),t=Ut("font"),r=Ut("text"),o=Ut("font-weight"),s=Ut("tracking"),l=Ut("leading"),c=Ut("breakpoint"),f=Ut("container"),m=Ut("spacing"),h=Ut("radius"),g=Ut("shadow"),p=Ut("inset-shadow"),v=Ut("text-shadow"),x=Ut("drop-shadow"),E=Ut("blur"),S=Ut("perspective"),_=Ut("aspect"),C=Ut("ease"),j=Ut("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...R(),_e,Se],A=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],P=()=>[_e,Se,m],H=()=>[To,"full","auto",...P()],Q=()=>[Ro,"none","subgrid",_e,Se],V=()=>["auto",{span:["full",Ro,_e,Se]},Ro,_e,Se],q=()=>[Ro,"auto",_e,Se],ee=()=>["auto","min","max","fr",_e,Se],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...P()],I=()=>[To,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],U=()=>[To,"screen","full","dvw","lvw","svw","min","max","fit",...P()],$=()=>[To,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],X=()=>[e,_e,Se],k=()=>[...R(),qS,VS,{position:[_e,Se]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Y=()=>["auto","cover","contain",t6,QL,{size:[_e,Se]}],W=()=>[Fg,Hc,Ts],J=()=>["","none","full",h,_e,Se],se=()=>["",Be,Hc,Ts],ne=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[Be,Fg,qS,VS],ve=()=>["","none",E,_e,Se],ge=()=>["none",Be,_e,Se],he=()=>["none",Be,_e,Se],ye=()=>[Be,_e,Se],Ne=()=>[To,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oa],breakpoint:[Oa],color:[cj],container:[Oa],"drop-shadow":[Oa],ease:["in","out","in-out"],font:[KL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oa],shadow:[Oa],spacing:["px",Be],text:[Oa],"text-shadow":[Oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",To,Se,_e,_]}],container:["container"],columns:[{columns:[Be,Se,_e,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{"inset-s":H(),start:H()}],end:[{"inset-e":H(),end:H()}],"inset-bs":[{"inset-bs":H()}],"inset-be":[{"inset-be":H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[Ro,"auto",_e,Se]}],basis:[{basis:[To,"full","auto",f,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,To,"auto","initial","none",Se]}],grow:[{grow:["",Be,_e,Se]}],shrink:[{shrink:["",Be,_e,Se]}],order:[{order:[Ro,"first","last","none",_e,Se]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...$()]}],"min-block-size":[{"min-block":["auto",...$()]}],"max-block-size":[{"max-block":["none",...$()]}],w:[{w:[f,"screen",...I()]}],"min-w":[{"min-w":[f,"screen","none",...I()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",r,Hc,Ts]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,r6,ZL]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Fg,Se]}],"font-family":[{font:[e6,WL,t]}],"font-features":[{"font-features":[Se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,_e,Se]}],"line-clamp":[{"line-clamp":[Be,"none",_e,$S]}],leading:[{leading:[l,...P()]}],"list-image":[{"list-image":["none",_e,Se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_e,Se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",_e,Ts]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[Be,"auto",_e,Se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e,Se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",_e,Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:Y()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ro,_e,Se],radial:["",_e,Se],conic:[Ro,_e,Se]},n6,JL]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-bs":[{"border-bs":X()}],"border-color-be":[{"border-be":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,_e,Se]}],"outline-w":[{outline:["",Be,Hc,Ts]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",g,wf,bf]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",p,wf,bf]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[Be,Ts]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",v,wf,bf]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[Be,_e,Se]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Be]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[_e,Se]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[Be]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:Y()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_e,Se]}],filter:[{filter:["","none",_e,Se]}],blur:[{blur:ve()}],brightness:[{brightness:[Be,_e,Se]}],contrast:[{contrast:[Be,_e,Se]}],"drop-shadow":[{"drop-shadow":["","none",x,wf,bf]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",Be,_e,Se]}],"hue-rotate":[{"hue-rotate":[Be,_e,Se]}],invert:[{invert:["",Be,_e,Se]}],saturate:[{saturate:[Be,_e,Se]}],sepia:[{sepia:["",Be,_e,Se]}],"backdrop-filter":[{"backdrop-filter":["","none",_e,Se]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[Be,_e,Se]}],"backdrop-contrast":[{"backdrop-contrast":[Be,_e,Se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,_e,Se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,_e,Se]}],"backdrop-invert":[{"backdrop-invert":["",Be,_e,Se]}],"backdrop-opacity":[{"backdrop-opacity":[Be,_e,Se]}],"backdrop-saturate":[{"backdrop-saturate":[Be,_e,Se]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,_e,Se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_e,Se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",_e,Se]}],ease:[{ease:["linear","initial",C,_e,Se]}],delay:[{delay:[Be,_e,Se]}],animate:[{animate:["none",j,_e,Se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,_e,Se]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[_e,Se,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ne()}],"translate-x":[{"translate-x":Ne()}],"translate-y":[{"translate-y":Ne()}],"translate-z":[{"translate-z":Ne()}],"translate-none":["translate-none"],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",_e,Se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_e,Se]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[Be,Hc,Ts,$S]}],stroke:[{stroke:["none",...X()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},s6=HL(o6);function Ee(...e){return s6(nj(e))}function vj({delayDuration:e=0,...t}){return d.jsx(fL,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function i6({...e}){return d.jsx(hL,{"data-slot":"tooltip",...e})}function l6({...e}){return d.jsx(mL,{"data-slot":"tooltip-trigger",...e})}function c6({className:e,sideOffset:t=0,children:r,...o}){return d.jsx(pL,{children:d.jsxs(gL,{"data-slot":"tooltip-content",sideOffset:t,className:Ee("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...o,children:[r,d.jsx(vL,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yj=(...e)=>e.filter((t,r,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===r).join(" ").trim();/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const u6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const d6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,o)=>o?o.toUpperCase():r.toLowerCase());/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FS=e=>{const t=d6(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var f6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const h6=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const m6=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:s="",children:l,iconNode:c,...f},m)=>b.createElement("svg",{ref:m,...f6,width:t,height:t,stroke:e,strokeWidth:o?Number(r)*24/Number(t):r,className:yj("lucide",s),...!l&&!h6(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,g])=>b.createElement(h,g)),...Array.isArray(l)?l:[l]]));/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Le=(e,t)=>{const r=b.forwardRef(({className:o,...s},l)=>b.createElement(m6,{ref:l,iconNode:t,className:yj(`lucide-${u6(FS(e))}`,`lucide-${e}`,o),...s}));return r.displayName=FS(e),r};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const p6=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],g6=Le("arrow-down",p6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const v6=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],xj=Le("arrow-left",v6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const y6=[["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"}]],bj=Le("bot",y6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const x6=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],wj=Le("brain",x6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const b6=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],E0=Le("check",b6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const w6=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],su=Le("chevron-down",w6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const S6=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],E6=Le("chevron-left",S6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _6=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yh=Le("chevron-right",_6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const C6=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],N6=Le("chevron-up",C6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const j6=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],T6=Le("chevrons-up-down",j6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const R6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Zo=Le("circle-alert",R6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Sj=Le("circle-check",M6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const A6=[["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"}]],O6=Le("circle-x",A6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const D6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],k6=Le("clock",D6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z6=[["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"}]],Gh=Le("download",z6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const L6=[["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"}]],P6=Le("eye-off",L6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const H6=[["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"}]],I6=Le("eye",H6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const B6=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],oh=Le("folder-kanban",B6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const U6=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]],$6=Le("folder-up",U6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const V6=[["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"}]],q6=Le("folder",V6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const F6=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],X6=Le("house",F6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Y6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],G6=Le("info",Y6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const K6=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Q6=Le("key-round",K6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Z6=[["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"}]],Ej=Le("layout-dashboard",Z6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const W6=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],J6=Le("loader-circle",W6);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eP=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],tP=Le("monitor",eP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nP=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],_j=Le("moon",nP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rP=[["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"}]],Cj=Le("octagon-x",rP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aP=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],oP=Le("paperclip",aP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sP=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],iP=Le("pause",sP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lP=[["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"}]],cP=Le("pencil",lP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uP=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],_0=Le("play",uP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Wv=Le("plus",dP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fP=[["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"}]],Nj=Le("save",fP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hP=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],jj=Le("search",hP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mP=[["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"}]],pP=Le("settings",mP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gP=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Tj=Le("sun",gP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vP=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],yP=Le("terminal",vP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xP=[["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"}]],C0=Le("trash-2",xP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bP=[["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"}]],wP=Le("triangle-alert",bP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SP=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],EP=Le("upload",SP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _P=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Rj=Le("users",_P);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CP=[["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"}]],Mj=Le("wrench",CP);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],N0=Le("x",NP);function jP(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const TP=e=>{switch(e){case"success":return AP;case"info":return DP;case"warning":return OP;case"error":return kP;default:return null}},RP=Array(12).fill(0),MP=({visible:e,className:t})=>me.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},me.createElement("div",{className:"sonner-spinner"},RP.map((r,o)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),AP=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),OP=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},me.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"})),DP=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),kP=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),zP=me.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"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),LP=()=>{const[e,t]=me.useState(document.hidden);return me.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Jv=1;class PP{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:o,...s}=t,l=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Jv++,c=this.toasts.find(m=>m.id===l),f=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),c?this.toasts=this.toasts.map(m=>m.id===l?(this.publish({...m,...t,id:l,title:o}),{...m,...t,id:l,dismissible:f,title:o}):m):this.addToast({title:o,...s,dismissible:f,id:l}),l},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(o=>o({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let o;r.loading!==void 0&&(o=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let l=o!==void 0,c;const f=s.then(async h=>{if(c=["resolve",h],me.isValidElement(h))l=!1,this.create({id:o,type:"default",message:h});else if(IP(h)&&!h.ok){l=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${h.status}`):r.error,v=typeof r.description=="function"?await r.description(`HTTP error! status: ${h.status}`):r.description,E=typeof p=="object"&&!me.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:v,...E})}else if(h instanceof Error){l=!1;const p=typeof r.error=="function"?await r.error(h):r.error,v=typeof r.description=="function"?await r.description(h):r.description,E=typeof p=="object"&&!me.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:v,...E})}else if(r.success!==void 0){l=!1;const p=typeof r.success=="function"?await r.success(h):r.success,v=typeof r.description=="function"?await r.description(h):r.description,E=typeof p=="object"&&!me.isValidElement(p)?p:{message:p};this.create({id:o,type:"success",description:v,...E})}}).catch(async h=>{if(c=["reject",h],r.error!==void 0){l=!1;const g=typeof r.error=="function"?await r.error(h):r.error,p=typeof r.description=="function"?await r.description(h):r.description,x=typeof g=="object"&&!me.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:p,...x})}}).finally(()=>{l&&(this.dismiss(o),o=void 0),r.finally==null||r.finally.call(r)}),m=()=>new Promise((h,g)=>f.then(()=>c[0]==="reject"?g(c[1]):h(c[1])).catch(g));return typeof o!="string"&&typeof o!="number"?{unwrap:m}:Object.assign(o,{unwrap:m})},this.custom=(t,r)=>{const o=(r==null?void 0:r.id)||Jv++;return this.create({jsx:t(o),id:o,...r}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Rn=new PP,HP=(e,t)=>{const r=(t==null?void 0:t.id)||Jv++;return Rn.addToast({title:e,...t,id:r}),r},IP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",BP=HP,UP=()=>Rn.toasts,$P=()=>Rn.getActiveToasts(),gt=Object.assign(BP,{success:Rn.success,info:Rn.info,warning:Rn.warning,error:Rn.error,custom:Rn.custom,message:Rn.message,promise:Rn.promise,dismiss:Rn.dismiss,loading:Rn.loading},{getHistory:UP,getToasts:$P});jP("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Sf(e){return e.label!==void 0}const VP=3,qP="24px",FP="16px",XS=4e3,XP=356,YP=14,GP=45,KP=200;function Fr(...e){return e.filter(Boolean).join(" ")}function QP(e){const[t,r]=e.split("-"),o=[];return t&&o.push(t),r&&o.push(r),o}const ZP=e=>{var t,r,o,s,l,c,f,m,h;const{invert:g,toast:p,unstyled:v,interacting:x,setHeights:E,visibleToasts:S,heights:_,index:C,toasts:j,expanded:N,removeToast:R,defaultRichColors:O,closeButton:A,style:D,cancelButtonStyle:P,actionButtonStyle:H,className:Q="",descriptionClassName:V="",duration:q,position:ee,gap:B,expandByDefault:K,classNames:M,icons:I,closeButtonAriaLabel:U="Close toast"}=e,[$,X]=me.useState(null),[k,L]=me.useState(null),[Y,W]=me.useState(!1),[J,se]=me.useState(!1),[ne,re]=me.useState(!1),[le,ve]=me.useState(!1),[ge,he]=me.useState(!1),[ye,Ne]=me.useState(0),[Ue,ke]=me.useState(0),nt=me.useRef(p.duration||q||XS),an=me.useRef(null),st=me.useRef(null),kn=C===0,pr=C+1<=S,Nt=p.type,vn=p.dismissible!==!1,Ht=p.className||"",Ga=p.descriptionClassName||"",yn=me.useMemo(()=>_.findIndex(De=>De.toastId===p.id)||0,[_,p.id]),Lr=me.useMemo(()=>{var De;return(De=p.closeButton)!=null?De:A},[p.closeButton,A]),Pr=me.useMemo(()=>p.duration||q||XS,[p.duration,q]),ss=me.useRef(0),zn=me.useRef(0),hi=me.useRef(0),Hr=me.useRef(null),[ca,Kt]=ee.split("-"),Ln=me.useMemo(()=>_.reduce((De,dt,Mt)=>Mt>=yn?De:De+dt.height,0),[_,yn]),Vt=LP(),Vl=p.invert||g,is=Nt==="loading";zn.current=me.useMemo(()=>yn*B+Ln,[yn,Ln]),me.useEffect(()=>{nt.current=Pr},[Pr]),me.useEffect(()=>{W(!0)},[]),me.useEffect(()=>{const De=st.current;if(De){const dt=De.getBoundingClientRect().height;return ke(dt),E(Mt=>[{toastId:p.id,height:dt,position:p.position},...Mt]),()=>E(Mt=>Mt.filter(qt=>qt.toastId!==p.id))}},[E,p.id]),me.useLayoutEffect(()=>{if(!Y)return;const De=st.current,dt=De.style.height;De.style.height="auto";const Mt=De.getBoundingClientRect().height;De.style.height=dt,ke(Mt),E(qt=>qt.find(ht=>ht.toastId===p.id)?qt.map(ht=>ht.toastId===p.id?{...ht,height:Mt}:ht):[{toastId:p.id,height:Mt,position:p.position},...qt])},[Y,p.title,p.description,E,p.id,p.jsx,p.action,p.cancel]);const Zn=me.useCallback(()=>{se(!0),Ne(zn.current),E(De=>De.filter(dt=>dt.toastId!==p.id)),setTimeout(()=>{R(p)},KP)},[p,R,E,zn]);me.useEffect(()=>{if(p.promise&&Nt==="loading"||p.duration===1/0||p.type==="loading")return;let De;return N||x||Vt?(()=>{if(hi.current<ss.current){const qt=new Date().getTime()-ss.current;nt.current=nt.current-qt}hi.current=new Date().getTime()})():(()=>{nt.current!==1/0&&(ss.current=new Date().getTime(),De=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Zn()},nt.current))})(),()=>clearTimeout(De)},[N,x,p,Nt,Vt,Zn]),me.useEffect(()=>{p.delete&&(Zn(),p.onDismiss==null||p.onDismiss.call(p,p))},[Zn,p.delete]);function Ka(){var De;if(I!=null&&I.loading){var dt;return me.createElement("div",{className:Fr(M==null?void 0:M.loader,p==null||(dt=p.classNames)==null?void 0:dt.loader,"sonner-loader"),"data-visible":Nt==="loading"},I.loading)}return me.createElement(MP,{className:Fr(M==null?void 0:M.loader,p==null||(De=p.classNames)==null?void 0:De.loader),visible:Nt==="loading"})}const Qa=p.icon||(I==null?void 0:I[Nt])||TP(Nt);var ua,Wn;return me.createElement("li",{tabIndex:0,ref:st,className:Fr(Q,Ht,M==null?void 0:M.toast,p==null||(t=p.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[Nt],p==null||(r=p.classNames)==null?void 0:r[Nt]),"data-sonner-toast":"","data-rich-colors":(ua=p.richColors)!=null?ua:O,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":Y,"data-promise":!!p.promise,"data-swiped":ge,"data-removed":J,"data-visible":pr,"data-y-position":ca,"data-x-position":Kt,"data-index":C,"data-front":kn,"data-swiping":ne,"data-dismissible":vn,"data-type":Nt,"data-invert":Vl,"data-swipe-out":le,"data-swipe-direction":k,"data-expanded":!!(N||K&&Y),"data-testid":p.testId,style:{"--index":C,"--toasts-before":C,"--z-index":j.length-C,"--offset":`${J?ye:zn.current}px`,"--initial-height":K?"auto":`${Ue}px`,...D,...p.style},onDragEnd:()=>{re(!1),X(null),Hr.current=null},onPointerDown:De=>{De.button!==2&&(is||!vn||(an.current=new Date,Ne(zn.current),De.target.setPointerCapture(De.pointerId),De.target.tagName!=="BUTTON"&&(re(!0),Hr.current={x:De.clientX,y:De.clientY})))},onPointerUp:()=>{var De,dt,Mt;if(le||!vn)return;Hr.current=null;const qt=Number(((De=st.current)==null?void 0:De.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ir=Number(((dt=st.current)==null?void 0:dt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ht=new Date().getTime()-((Mt=an.current)==null?void 0:Mt.getTime()),on=$==="x"?qt:Ir,da=Math.abs(on)/ht;if(Math.abs(on)>=GP||da>.11){Ne(zn.current),p.onDismiss==null||p.onDismiss.call(p,p),L($==="x"?qt>0?"right":"left":Ir>0?"down":"up"),Zn(),ve(!0);return}else{var sn,ln;(sn=st.current)==null||sn.style.setProperty("--swipe-amount-x","0px"),(ln=st.current)==null||ln.style.setProperty("--swipe-amount-y","0px")}he(!1),re(!1),X(null)},onPointerMove:De=>{var dt,Mt,qt;if(!Hr.current||!vn||((dt=window.getSelection())==null?void 0:dt.toString().length)>0)return;const ht=De.clientY-Hr.current.y,on=De.clientX-Hr.current.x;var da;const sn=(da=e.swipeDirections)!=null?da:QP(ee);!$&&(Math.abs(on)>1||Math.abs(ht)>1)&&X(Math.abs(on)>Math.abs(ht)?"x":"y");let ln={x:0,y:0};const Za=Pn=>1/(1.5+Math.abs(Pn)/20);if($==="y"){if(sn.includes("top")||sn.includes("bottom"))if(sn.includes("top")&&ht<0||sn.includes("bottom")&&ht>0)ln.y=ht;else{const Pn=ht*Za(ht);ln.y=Math.abs(Pn)<Math.abs(ht)?Pn:ht}}else if($==="x"&&(sn.includes("left")||sn.includes("right")))if(sn.includes("left")&&on<0||sn.includes("right")&&on>0)ln.x=on;else{const Pn=on*Za(on);ln.x=Math.abs(Pn)<Math.abs(on)?Pn:on}(Math.abs(ln.x)>0||Math.abs(ln.y)>0)&&he(!0),(Mt=st.current)==null||Mt.style.setProperty("--swipe-amount-x",`${ln.x}px`),(qt=st.current)==null||qt.style.setProperty("--swipe-amount-y",`${ln.y}px`)}},Lr&&!p.jsx&&Nt!=="loading"?me.createElement("button",{"aria-label":U,"data-disabled":is,"data-close-button":!0,onClick:is||!vn?()=>{}:()=>{Zn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Fr(M==null?void 0:M.closeButton,p==null||(o=p.classNames)==null?void 0:o.closeButton)},(Wn=I==null?void 0:I.close)!=null?Wn:zP):null,(Nt||p.icon||p.promise)&&p.icon!==null&&((I==null?void 0:I[Nt])!==null||p.icon)?me.createElement("div",{"data-icon":"",className:Fr(M==null?void 0:M.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Ka():null,p.type!=="loading"?Qa:null):null,me.createElement("div",{"data-content":"",className:Fr(M==null?void 0:M.content,p==null||(l=p.classNames)==null?void 0:l.content)},me.createElement("div",{"data-title":"",className:Fr(M==null?void 0:M.title,p==null||(c=p.classNames)==null?void 0:c.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?me.createElement("div",{"data-description":"",className:Fr(V,Ga,M==null?void 0:M.description,p==null||(f=p.classNames)==null?void 0:f.description)},typeof p.description=="function"?p.description():p.description):null),me.isValidElement(p.cancel)?p.cancel:p.cancel&&Sf(p.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||P,onClick:De=>{Sf(p.cancel)&&vn&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,De),Zn())},className:Fr(M==null?void 0:M.cancelButton,p==null||(m=p.classNames)==null?void 0:m.cancelButton)},p.cancel.label):null,me.isValidElement(p.action)?p.action:p.action&&Sf(p.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||H,onClick:De=>{Sf(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,De),!De.defaultPrevented&&Zn())},className:Fr(M==null?void 0:M.actionButton,p==null||(h=p.classNames)==null?void 0:h.actionButton)},p.action.label):null)};function YS(){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 WP(e,t){const r={};return[e,t].forEach((o,s)=>{const l=s===1,c=l?"--mobile-offset":"--offset",f=l?FP:qP;function m(h){["top","right","bottom","left"].forEach(g=>{r[`${c}-${g}`]=typeof h=="number"?`${h}px`:h})}typeof o=="number"||typeof o=="string"?m(o):typeof o=="object"?["top","right","bottom","left"].forEach(h=>{o[h]===void 0?r[`${c}-${h}`]=f:r[`${c}-${h}`]=typeof o[h]=="number"?`${o[h]}px`:o[h]}):m(f)}),r}const JP=me.forwardRef(function(t,r){const{id:o,invert:s,position:l="bottom-right",hotkey:c=["altKey","KeyT"],expand:f,closeButton:m,className:h,offset:g,mobileOffset:p,theme:v="light",richColors:x,duration:E,style:S,visibleToasts:_=VP,toastOptions:C,dir:j=YS(),gap:N=YP,icons:R,containerAriaLabel:O="Notifications"}=t,[A,D]=me.useState([]),P=me.useMemo(()=>o?A.filter(Y=>Y.toasterId===o):A.filter(Y=>!Y.toasterId),[A,o]),H=me.useMemo(()=>Array.from(new Set([l].concat(P.filter(Y=>Y.position).map(Y=>Y.position)))),[P,l]),[Q,V]=me.useState([]),[q,ee]=me.useState(!1),[B,K]=me.useState(!1),[M,I]=me.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=me.useRef(null),$=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=me.useRef(null),k=me.useRef(!1),L=me.useCallback(Y=>{D(W=>{var J;return(J=W.find(se=>se.id===Y.id))!=null&&J.delete||Rn.dismiss(Y.id),W.filter(({id:se})=>se!==Y.id)})},[]);return me.useEffect(()=>Rn.subscribe(Y=>{if(Y.dismiss){requestAnimationFrame(()=>{D(W=>W.map(J=>J.id===Y.id?{...J,delete:!0}:J))});return}setTimeout(()=>{$_.flushSync(()=>{D(W=>{const J=W.findIndex(se=>se.id===Y.id);return J!==-1?[...W.slice(0,J),{...W[J],...Y},...W.slice(J+1)]:[Y,...W]})})})}),[A]),me.useEffect(()=>{if(v!=="system"){I(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?I("dark"):I("light")),typeof window>"u")return;const Y=window.matchMedia("(prefers-color-scheme: dark)");try{Y.addEventListener("change",({matches:W})=>{I(W?"dark":"light")})}catch{Y.addListener(({matches:J})=>{try{I(J?"dark":"light")}catch(se){console.error(se)}})}},[v]),me.useEffect(()=>{A.length<=1&&ee(!1)},[A]),me.useEffect(()=>{const Y=W=>{var J;if(c.every(re=>W[re]||W.code===re)){var ne;ee(!0),(ne=U.current)==null||ne.focus()}W.code==="Escape"&&(document.activeElement===U.current||(J=U.current)!=null&&J.contains(document.activeElement))&&ee(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[c]),me.useEffect(()=>{if(U.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,k.current=!1)}},[U.current]),me.createElement("section",{ref:r,"aria-label":`${O} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},H.map((Y,W)=>{var J;const[se,ne]=Y.split("-");return P.length?me.createElement("ol",{key:Y,dir:j==="auto"?YS():j,tabIndex:-1,ref:U,className:h,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":se,"data-x-position":ne,style:{"--front-toast-height":`${((J=Q[0])==null?void 0:J.height)||0}px`,"--width":`${XP}px`,"--gap":`${N}px`,...S,...WP(g,p)},onBlur:re=>{k.current&&!re.currentTarget.contains(re.relatedTarget)&&(k.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||k.current||(k.current=!0,X.current=re.relatedTarget)},onMouseEnter:()=>ee(!0),onMouseMove:()=>ee(!0),onMouseLeave:()=>{B||ee(!1)},onDragEnd:()=>ee(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},P.filter(re=>!re.position&&W===0||re.position===Y).map((re,le)=>{var ve,ge;return me.createElement(ZP,{key:re.id,icons:R,index:le,toast:re,defaultRichColors:x,duration:(ve=C==null?void 0:C.duration)!=null?ve:E,className:C==null?void 0:C.className,descriptionClassName:C==null?void 0:C.descriptionClassName,invert:s,visibleToasts:_,closeButton:(ge=C==null?void 0:C.closeButton)!=null?ge:m,interacting:B,position:Y,style:C==null?void 0:C.style,unstyled:C==null?void 0:C.unstyled,classNames:C==null?void 0:C.classNames,cancelButtonStyle:C==null?void 0:C.cancelButtonStyle,actionButtonStyle:C==null?void 0:C.actionButtonStyle,closeButtonAriaLabel:C==null?void 0:C.closeButtonAriaLabel,removeToast:L,toasts:P.filter(he=>he.position==re.position),heights:Q.filter(he=>he.position==re.position),setHeights:V,expandByDefault:f,gap:N,expanded:q,swipeDirections:t.swipeDirections})})):null}))}),eH=({...e})=>{const{theme:t="system"}=Dy();return d.jsx(JP,{theme:t,className:"toaster group",icons:{success:d.jsx(Sj,{className:"size-4"}),info:d.jsx(G6,{className:"size-4"}),warning:d.jsx(wP,{className:"size-4"}),error:d.jsx(Cj,{className:"size-4"}),loading:d.jsx(J6,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},tH=new a3({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,refetchOnWindowFocus:!0,retry:1}}}),Aj="/api";class Oj extends Error{constructor(t,r,o){super(`${t} ${r}`),this.status=t,this.statusText=r,this.body=o,this.name="ApiError"}}async function Ic(e,t){const r=`${Aj}${e}`,o=new AbortController,s=setTimeout(()=>o.abort(),3e4);let l;try{l=await fetch(r,{...t,signal:(t==null?void 0:t.signal)??o.signal,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}})}finally{clearTimeout(s)}if(!l.ok){const c=await l.json().catch(()=>null);throw new Oj(l.status,l.statusText,c)}return l.json()}async function nH(e,t){const r=`${Aj}${e}`,o=new AbortController,s=setTimeout(()=>o.abort(),6e4);let l;try{l=await fetch(r,{method:"POST",body:t,signal:o.signal})}finally{clearTimeout(s)}if(!l.ok){const c=await l.json().catch(()=>null);throw new Oj(l.status,l.statusText,c)}return l.json()}const He={get:e=>Ic(e),post:(e,t)=>Ic(e,{method:"POST",body:t!=null?JSON.stringify(t):void 0}),put:(e,t)=>Ic(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Ic(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Ic(e,{method:"DELETE"}),upload:(e,t)=>{const r=new FormData;return t.forEach(o=>r.append("files",o)),nH(e,r)}},Ye={projects:{all:["projects"],detail:e=>["projects",e],config:e=>["projects",e,"config"],sessions:e=>["projects",e,"sessions"],files:e=>["projects",e,"files"],resources:e=>["projects",e,"resources"],resourceDetail:(e,t,r)=>["projects",e,"resources",t,r],resourceConfig:(e,t,r)=>["projects",e,"resources",t,r,"config"]},sessions:{all:e=>["sessions",e],detail:(e,t)=>["sessions",e,t],running:()=>["sessions",{status:"running"}]},roles:{all:["roles"]},config:{global:["config","global"]},registry:{list:e=>["registry",e],detail:(e,t)=>["registry",e,t],config:(e,t)=>["registry",e,t,"config"],validate:e=>["registry","agents",e,"validate"]},schedules:{all:["schedules"],detail:e=>["schedules",e],history:e=>["schedules",e,"history"]}};function Ul(){return rn({queryKey:Ye.projects.all,queryFn:()=>He.get("/projects")})}function Dj(e,t){return rn({queryKey:Ye.projects.detail(e),queryFn:()=>He.get(`/projects/${e}`),enabled:t==null?void 0:t.enabled})}function kj(e){return rn({queryKey:Ye.projects.files(e),queryFn:()=>He.get(`/projects/${e}/files`)})}function zj(e,t){return rn({queryKey:Ye.projects.config(e),queryFn:()=>He.get(`/projects/${e}/config`),enabled:t==null?void 0:t.enabled})}const rH=500;function aH({onCommandPalette:e,onShortcutsHelp:t}){const r=Ll(),o=b.useRef(null),s=b.useRef(void 0);b.useEffect(()=>{function l(c){const f=c.target;if(!(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable)){if((c.metaKey||c.ctrlKey)&&c.key==="k"){c.preventDefault(),e();return}if(!(c.metaKey||c.ctrlKey||c.altKey)){if(c.key==="?"){c.preventDefault(),t();return}if(o.current==="g"){if(o.current=null,clearTimeout(s.current),c.key==="d"){c.preventDefault(),r("/");return}if(c.key==="p"){c.preventDefault(),r("/projects");return}}if(c.key==="g"){o.current="g",s.current=setTimeout(()=>{o.current=null},rH);return}}}}return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l),clearTimeout(s.current)}},[r,e,t])}function Lj(e){const t=e?"?"+new URLSearchParams(e).toString():"";return rn({queryKey:Ye.sessions.all(e),queryFn:()=>He.get(`/sessions${t}`)})}function j0(){return Lj({status:"running",per_page:"50"})}function oH(){return Lj({per_page:"10"})}function sH(e,t=1,r=20){return rn({queryKey:[...Ye.projects.sessions(e),t,r],queryFn:()=>He.get(`/projects/${e}/sessions?page=${t}&per_page=${r}`)})}function iH(e,t,r){return rn({queryKey:Ye.sessions.detail(e,t),queryFn:()=>He.get(`/projects/${e}/sessions/${t}`),...r})}var GS=1,lH=.9,cH=.8,uH=.17,Xg=.1,Yg=.999,dH=.9999,fH=.99,hH=/[\\\/_+.#"@\[\(\{&]/,mH=/[\\\/_+.#"@\[\(\{&]/g,pH=/[\s-]/,Pj=/[\s-]/g;function ey(e,t,r,o,s,l,c){if(l===t.length)return s===e.length?GS:fH;var f=`${s},${l}`;if(c[f]!==void 0)return c[f];for(var m=o.charAt(l),h=r.indexOf(m,s),g=0,p,v,x,E;h>=0;)p=ey(e,t,r,o,h+1,l+1,c),p>g&&(h===s?p*=GS:hH.test(e.charAt(h-1))?(p*=cH,x=e.slice(s,h-1).match(mH),x&&s>0&&(p*=Math.pow(Yg,x.length))):pH.test(e.charAt(h-1))?(p*=lH,E=e.slice(s,h-1).match(Pj),E&&s>0&&(p*=Math.pow(Yg,E.length))):(p*=uH,s>0&&(p*=Math.pow(Yg,h-s))),e.charAt(h)!==t.charAt(l)&&(p*=dH)),(p<Xg&&r.charAt(h-1)===o.charAt(l+1)||o.charAt(l+1)===o.charAt(l)&&r.charAt(h-1)!==o.charAt(l))&&(v=ey(e,t,r,o,h+1,l+2,c),v*Xg>p&&(p=v*Xg)),p>g&&(g=p),h=r.indexOf(m,h+1);return c[f]=g,g}function KS(e){return e.toLowerCase().replace(Pj," ")}function gH(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,ey(e,t,KS(e),KS(t),0,0,{})}var Bc='[cmdk-group=""]',Gg='[cmdk-group-items=""]',vH='[cmdk-group-heading=""]',Hj='[cmdk-item=""]',QS=`${Hj}:not([aria-disabled="true"])`,ty="cmdk-item-select",Ji="data-value",yH=(e,t,r)=>gH(e,t,r),Ij=b.createContext(void 0),Iu=()=>b.useContext(Ij),Bj=b.createContext(void 0),T0=()=>b.useContext(Bj),Uj=b.createContext(void 0),$j=b.forwardRef((e,t)=>{let r=el(()=>{var L,Y;return{search:"",value:(Y=(L=e.value)!=null?L:e.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=el(()=>new Set),s=el(()=>new Map),l=el(()=>new Map),c=el(()=>new Set),f=Vj(e),{label:m,children:h,value:g,onValueChange:p,filter:v,shouldFilter:x,loop:E,disablePointerSelection:S=!1,vimBindings:_=!0,...C}=e,j=Yt(),N=Yt(),R=Yt(),O=b.useRef(null),A=RH();Zs(()=>{if(g!==void 0){let L=g.trim();r.current.value=L,D.emit()}},[g]),Zs(()=>{A(6,ee)},[]);let D=b.useMemo(()=>({subscribe:L=>(c.current.add(L),()=>c.current.delete(L)),snapshot:()=>r.current,setState:(L,Y,W)=>{var J,se,ne,re;if(!Object.is(r.current[L],Y)){if(r.current[L]=Y,L==="search")q(),Q(),A(1,V);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let le=document.getElementById(R);le?le.focus():(J=document.getElementById(j))==null||J.focus()}if(A(7,()=>{var le;r.current.selectedItemId=(le=B())==null?void 0:le.id,D.emit()}),W||A(5,ee),((se=f.current)==null?void 0:se.value)!==void 0){let le=Y??"";(re=(ne=f.current).onValueChange)==null||re.call(ne,le);return}}D.emit()}},emit:()=>{c.current.forEach(L=>L())}}),[]),P=b.useMemo(()=>({value:(L,Y,W)=>{var J;Y!==((J=l.current.get(L))==null?void 0:J.value)&&(l.current.set(L,{value:Y,keywords:W}),r.current.filtered.items.set(L,H(Y,W)),A(2,()=>{Q(),D.emit()}))},item:(L,Y)=>(o.current.add(L),Y&&(s.current.has(Y)?s.current.get(Y).add(L):s.current.set(Y,new Set([L]))),A(3,()=>{q(),Q(),r.current.value||V(),D.emit()}),()=>{l.current.delete(L),o.current.delete(L),r.current.filtered.items.delete(L);let W=B();A(4,()=>{q(),(W==null?void 0:W.getAttribute("id"))===L&&V(),D.emit()})}),group:L=>(s.current.has(L)||s.current.set(L,new Set),()=>{l.current.delete(L),s.current.delete(L)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:j,inputId:R,labelId:N,listInnerRef:O}),[]);function H(L,Y){var W,J;let se=(J=(W=f.current)==null?void 0:W.filter)!=null?J:yH;return L?se(L,r.current.search,Y):0}function Q(){if(!r.current.search||f.current.shouldFilter===!1)return;let L=r.current.filtered.items,Y=[];r.current.filtered.groups.forEach(J=>{let se=s.current.get(J),ne=0;se.forEach(re=>{let le=L.get(re);ne=Math.max(le,ne)}),Y.push([J,ne])});let W=O.current;K().sort((J,se)=>{var ne,re;let le=J.getAttribute("id"),ve=se.getAttribute("id");return((ne=L.get(ve))!=null?ne:0)-((re=L.get(le))!=null?re:0)}).forEach(J=>{let se=J.closest(Gg);se?se.appendChild(J.parentElement===se?J:J.closest(`${Gg} > *`)):W.appendChild(J.parentElement===W?J:J.closest(`${Gg} > *`))}),Y.sort((J,se)=>se[1]-J[1]).forEach(J=>{var se;let ne=(se=O.current)==null?void 0:se.querySelector(`${Bc}[${Ji}="${encodeURIComponent(J[0])}"]`);ne==null||ne.parentElement.appendChild(ne)})}function V(){let L=K().find(W=>W.getAttribute("aria-disabled")!=="true"),Y=L==null?void 0:L.getAttribute(Ji);D.setState("value",Y||void 0)}function q(){var L,Y,W,J;if(!r.current.search||f.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let se=0;for(let ne of o.current){let re=(Y=(L=l.current.get(ne))==null?void 0:L.value)!=null?Y:"",le=(J=(W=l.current.get(ne))==null?void 0:W.keywords)!=null?J:[],ve=H(re,le);r.current.filtered.items.set(ne,ve),ve>0&&se++}for(let[ne,re]of s.current)for(let le of re)if(r.current.filtered.items.get(le)>0){r.current.filtered.groups.add(ne);break}r.current.filtered.count=se}function ee(){var L,Y,W;let J=B();J&&(((L=J.parentElement)==null?void 0:L.firstChild)===J&&((W=(Y=J.closest(Bc))==null?void 0:Y.querySelector(vH))==null||W.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function B(){var L;return(L=O.current)==null?void 0:L.querySelector(`${Hj}[aria-selected="true"]`)}function K(){var L;return Array.from(((L=O.current)==null?void 0:L.querySelectorAll(QS))||[])}function M(L){let Y=K()[L];Y&&D.setState("value",Y.getAttribute(Ji))}function I(L){var Y;let W=B(),J=K(),se=J.findIndex(re=>re===W),ne=J[se+L];(Y=f.current)!=null&&Y.loop&&(ne=se+L<0?J[J.length-1]:se+L===J.length?J[0]:J[se+L]),ne&&D.setState("value",ne.getAttribute(Ji))}function U(L){let Y=B(),W=Y==null?void 0:Y.closest(Bc),J;for(;W&&!J;)W=L>0?jH(W,Bc):TH(W,Bc),J=W==null?void 0:W.querySelector(QS);J?D.setState("value",J.getAttribute(Ji)):I(L)}let $=()=>M(K().length-1),X=L=>{L.preventDefault(),L.metaKey?$():L.altKey?U(1):I(1)},k=L=>{L.preventDefault(),L.metaKey?M(0):L.altKey?U(-1):I(-1)};return b.createElement(je.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:L=>{var Y;(Y=C.onKeyDown)==null||Y.call(C,L);let W=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||W))switch(L.key){case"n":case"j":{_&&L.ctrlKey&&X(L);break}case"ArrowDown":{X(L);break}case"p":case"k":{_&&L.ctrlKey&&k(L);break}case"ArrowUp":{k(L);break}case"Home":{L.preventDefault(),M(0);break}case"End":{L.preventDefault(),$();break}case"Enter":{L.preventDefault();let J=B();if(J){let se=new Event(ty);J.dispatchEvent(se)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:AH},m),Kh(e,L=>b.createElement(Bj.Provider,{value:D},b.createElement(Ij.Provider,{value:P},L))))}),xH=b.forwardRef((e,t)=>{var r,o;let s=Yt(),l=b.useRef(null),c=b.useContext(Uj),f=Iu(),m=Vj(e),h=(o=(r=m.current)==null?void 0:r.forceMount)!=null?o:c==null?void 0:c.forceMount;Zs(()=>{if(!h)return f.item(s,c==null?void 0:c.id)},[h]);let g=qj(s,l,[e.value,e.children,l],e.keywords),p=T0(),v=Wo(A=>A.value&&A.value===g.current),x=Wo(A=>h||f.filter()===!1?!0:A.search?A.filtered.items.get(s)>0:!0);b.useEffect(()=>{let A=l.current;if(!(!A||e.disabled))return A.addEventListener(ty,E),()=>A.removeEventListener(ty,E)},[x,e.onSelect,e.disabled]);function E(){var A,D;S(),(D=(A=m.current).onSelect)==null||D.call(A,g.current)}function S(){p.setState("value",g.current,!0)}if(!x)return null;let{disabled:_,value:C,onSelect:j,forceMount:N,keywords:R,...O}=e;return b.createElement(je.div,{ref:$a(l,t),...O,id:s,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!v,"data-disabled":!!_,"data-selected":!!v,onPointerMove:_||f.getDisablePointerSelection()?void 0:S,onClick:_?void 0:E},e.children)}),bH=b.forwardRef((e,t)=>{let{heading:r,children:o,forceMount:s,...l}=e,c=Yt(),f=b.useRef(null),m=b.useRef(null),h=Yt(),g=Iu(),p=Wo(x=>s||g.filter()===!1?!0:x.search?x.filtered.groups.has(c):!0);Zs(()=>g.group(c),[]),qj(c,f,[e.value,e.heading,m]);let v=b.useMemo(()=>({id:c,forceMount:s}),[s]);return b.createElement(je.div,{ref:$a(f,t),...l,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},r&&b.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),Kh(e,x=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},b.createElement(Uj.Provider,{value:v},x))))}),wH=b.forwardRef((e,t)=>{let{alwaysRender:r,...o}=e,s=b.useRef(null),l=Wo(c=>!c.search);return!r&&!l?null:b.createElement(je.div,{ref:$a(s,t),...o,"cmdk-separator":"",role:"separator"})}),SH=b.forwardRef((e,t)=>{let{onValueChange:r,...o}=e,s=e.value!=null,l=T0(),c=Wo(h=>h.search),f=Wo(h=>h.selectedItemId),m=Iu();return b.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),b.createElement(je.input,{ref:t,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:s?e.value:c,onChange:h=>{s||l.setState("search",h.target.value),r==null||r(h.target.value)}})}),EH=b.forwardRef((e,t)=>{let{children:r,label:o="Suggestions",...s}=e,l=b.useRef(null),c=b.useRef(null),f=Wo(h=>h.selectedItemId),m=Iu();return b.useEffect(()=>{if(c.current&&l.current){let h=c.current,g=l.current,p,v=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let x=h.offsetHeight;g.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return v.observe(h),()=>{cancelAnimationFrame(p),v.unobserve(h)}}},[]),b.createElement(je.div,{ref:$a(l,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":o,id:m.listId},Kh(e,h=>b.createElement("div",{ref:$a(c,m.listInnerRef),"cmdk-list-sizer":""},h)))}),_H=b.forwardRef((e,t)=>{let{open:r,onOpenChange:o,overlayClassName:s,contentClassName:l,container:c,...f}=e;return b.createElement(qy,{open:r,onOpenChange:o},b.createElement(Fy,{container:c},b.createElement(Xy,{"cmdk-overlay":"",className:s}),b.createElement(Yy,{"aria-label":e.label,"cmdk-dialog":"",className:l},b.createElement($j,{ref:t,...f}))))}),CH=b.forwardRef((e,t)=>Wo(r=>r.filtered.count===0)?b.createElement(je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),NH=b.forwardRef((e,t)=>{let{progress:r,children:o,label:s="Loading...",...l}=e;return b.createElement(je.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Kh(e,c=>b.createElement("div",{"aria-hidden":!0},c)))}),$l=Object.assign($j,{List:EH,Item:xH,Input:SH,Group:bH,Separator:wH,Dialog:_H,Empty:CH,Loading:NH});function jH(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function TH(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Vj(e){let t=b.useRef(e);return Zs(()=>{t.current=e}),t}var Zs=typeof window>"u"?b.useEffect:b.useLayoutEffect;function el(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function Wo(e){let t=T0(),r=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,r,r)}function qj(e,t,r,o=[]){let s=b.useRef(),l=Iu();return Zs(()=>{var c;let f=(()=>{var h;for(let g of r){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(h=g.current.textContent)==null?void 0:h.trim():s.current}})(),m=o.map(h=>h.trim());l.value(e,f,m),(c=t.current)==null||c.setAttribute(Ji,f),s.current=f}),s}var RH=()=>{let[e,t]=b.useState(),r=el(()=>new Map);return Zs(()=>{r.current.forEach(o=>o()),r.current=new Map},[e]),(o,s)=>{r.current.set(o,s),t({})}};function MH(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Kh({asChild:e,children:t},r){return e&&b.isValidElement(t)?b.cloneElement(MH(t),{ref:t.ref},r(t.props.children)):r(t)}var AH={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ZS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,WS=nj,Qh=(e,t)=>r=>{var o;if((t==null?void 0:t.variants)==null)return WS(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:l}=t,c=Object.keys(s).map(h=>{const g=r==null?void 0:r[h],p=l==null?void 0:l[h];if(g===null)return null;const v=ZS(g)||ZS(p);return s[h][v]}),f=r&&Object.entries(r).reduce((h,g)=>{let[p,v]=g;return v===void 0||(h[p]=v),h},{}),m=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((h,g)=>{let{class:p,className:v,...x}=g;return Object.entries(x).every(E=>{let[S,_]=E;return Array.isArray(_)?_.includes({...l,...f}[S]):{...l,...f}[S]===_})?[...h,p,v]:h},[]);return WS(e,c,m,r==null?void 0:r.class,r==null?void 0:r.className)},OH=Qh("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none 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 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/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Me({className:e,variant:t="default",size:r="default",asChild:o=!1,...s}){const l=o?ky:"button";return d.jsx(l,{"data-slot":"button","data-variant":t,"data-size":r,className:Ee(OH({variant:t,size:r,className:e})),...s})}function si({...e}){return d.jsx(qy,{"data-slot":"dialog",...e})}function DH({...e}){return d.jsx(Fy,{"data-slot":"dialog-portal",...e})}function kH({className:e,...t}){return d.jsx(Xy,{"data-slot":"dialog-overlay",className:Ee("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function ii({className:e,children:t,showCloseButton:r=!0,...o}){return d.jsxs(DH,{"data-slot":"dialog-portal",children:[d.jsx(kH,{}),d.jsxs(Yy,{"data-slot":"dialog-content",className:Ee("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...o,children:[t,r&&d.jsxs(Gy,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[d.jsx(N0,{}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function li({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-header",className:Ee("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Fj({className:e,showCloseButton:t=!1,children:r,...o}){return d.jsxs("div",{"data-slot":"dialog-footer",className:Ee("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...o,children:[r,t&&d.jsx(Gy,{asChild:!0,children:d.jsx(Me,{variant:"outline",children:"Close"})})]})}function ci({className:e,...t}){return d.jsx(BC,{"data-slot":"dialog-title",className:Ee("text-lg leading-none font-semibold",e),...t})}function Xj({className:e,...t}){return d.jsx(UC,{"data-slot":"dialog-description",className:Ee("text-sm text-muted-foreground",e),...t})}function zH({className:e,...t}){return d.jsx($l,{"data-slot":"command",className:Ee("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function LH({title:e="Command Palette",description:t="Search for a command to run...",children:r,className:o,showCloseButton:s=!0,...l}){return d.jsxs(si,{...l,children:[d.jsxs(li,{className:"sr-only",children:[d.jsx(ci,{children:e}),d.jsx(Xj,{children:t})]}),d.jsx(ii,{className:Ee("overflow-hidden p-0",o),showCloseButton:s,children:d.jsx(zH,{className:"**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:r})})]})}function PH({className:e,...t}){return d.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[d.jsx(jj,{className:"size-4 shrink-0 opacity-50"}),d.jsx($l.Input,{"data-slot":"command-input",className:Ee("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function HH({className:e,...t}){return d.jsx($l.List,{"data-slot":"command-list",className:Ee("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function IH({...e}){return d.jsx($l.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Uc({className:e,...t}){return d.jsx($l.Group,{"data-slot":"command-group",className:Ee("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})}function br({className:e,...t}){return d.jsx($l.Item,{"data-slot":"command-item",className:Ee("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...t})}function JS({className:e,...t}){return d.jsx("span",{"data-slot":"command-shortcut",className:Ee("ml-auto text-xs tracking-widest text-muted-foreground",e),...t})}function BH({open:e,onOpenChange:t}){var h;const r=Ll(),{setTheme:o}=Dy(),s=Ul(),l=j0(),c=s.data??[],f=((h=l.data)==null?void 0:h.items)??[],m=g=>{t(!1),r(g)};return d.jsxs(LH,{open:e,onOpenChange:t,showCloseButton:!1,children:[d.jsx(PH,{placeholder:"Type a command or search..."}),d.jsxs(HH,{children:[d.jsx(IH,{children:"No results found."}),d.jsxs(Uc,{heading:"Navigation",children:[d.jsxs(br,{onSelect:()=>m("/"),children:[d.jsx(Ej,{}),"Dashboard",d.jsx(JS,{children:"G D"})]}),d.jsxs(br,{onSelect:()=>m("/projects"),children:[d.jsx(oh,{}),"Projects",d.jsx(JS,{children:"G P"})]})]}),c.length>0&&d.jsx(Uc,{heading:"Projects",children:c.map(g=>d.jsxs(br,{onSelect:()=>m(`/projects/${g.id}`),children:[d.jsx(oh,{}),g.display_name]},g.id))}),f.length>0&&d.jsx(Uc,{heading:"Running Sessions",children:f.map(g=>d.jsxs(br,{onSelect:()=>m(`/projects/${g.project_id}/sessions/${g.run_id}`),children:[d.jsx(_0,{}),g.role," (",g.run_id.slice(0,8),")"]},g.run_id))}),d.jsxs(Uc,{heading:"Resources",children:[d.jsxs(br,{onSelect:()=>m("/resources/roles"),children:[d.jsx(Rj,{}),"Roles"]}),d.jsxs(br,{onSelect:()=>m("/resources/skills"),children:[d.jsx(Mj,{}),"Skills"]}),d.jsxs(br,{onSelect:()=>m("/resources/agents"),children:[d.jsx(bj,{}),"Agents"]}),d.jsxs(br,{onSelect:()=>m("/resources/memories"),children:[d.jsx(wj,{}),"Memory"]})]}),d.jsxs(Uc,{heading:"Theme",children:[d.jsxs(br,{onSelect:()=>{o("light"),t(!1)},children:[d.jsx(Tj,{}),"Light"]}),d.jsxs(br,{onSelect:()=>{o("dark"),t(!1)},children:[d.jsx(_j,{}),"Dark"]}),d.jsxs(br,{onSelect:()=>{o("system"),t(!1)},children:[d.jsx(tP,{}),"System"]})]})]})]})}const UH=[{keys:["⌘","K"],description:"Open command palette"},{keys:["G","D"],description:"Go to Dashboard"},{keys:["G","P"],description:"Go to Projects"},{keys:["?"],description:"Show keyboard shortcuts"}];function $H({open:e,onOpenChange:t}){return d.jsx(si,{open:e,onOpenChange:t,children:d.jsxs(ii,{className:"max-w-sm",children:[d.jsx(li,{children:d.jsx(ci,{children:"Keyboard Shortcuts"})}),d.jsx("div",{className:"space-y-2",children:UH.map(r=>d.jsxs("div",{className:"flex items-center justify-between text-sm",children:[d.jsx("span",{className:"text-muted-foreground",children:r.description}),d.jsx("div",{className:"flex gap-1",children:r.keys.map(o=>d.jsx("kbd",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-xs",children:o},o))})]},r.description))})]})})}function VH({...e}){return d.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function qH({className:e,...t}){return d.jsx("ol",{"data-slot":"breadcrumb-list",className:Ee("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",e),...t})}function FH({className:e,...t}){return d.jsx("li",{"data-slot":"breadcrumb-item",className:Ee("inline-flex items-center gap-1.5",e),...t})}function XH({asChild:e,className:t,...r}){const o=e?ky:"a";return d.jsx(o,{"data-slot":"breadcrumb-link",className:Ee("transition-colors hover:text-foreground",t),...r})}function YH({className:e,...t}){return d.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Ee("font-normal text-foreground",e),...t})}function GH({children:e,className:t,...r}){return d.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Ee("[&>svg]:size-3.5",t),...r,children:e??d.jsx(Yh,{})})}function sh({...e}){return d.jsx(Pz,{"data-slot":"dropdown-menu",...e})}function ih({...e}){return d.jsx(Hz,{"data-slot":"dropdown-menu-trigger",...e})}function lh({className:e,sideOffset:t=4,...r}){return d.jsx(Iz,{children:d.jsx(Bz,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Ee("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...r})})}function Gc({className:e,inset:t,variant:r="default",...o}){return d.jsx(Uz,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:Ee("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...o})}function KH({className:e,children:t,checked:r,...o}){return d.jsxs($z,{"data-slot":"dropdown-menu-checkbox-item",className:Ee("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent 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-4",e),checked:r,...o,children:[d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(Vz,{children:d.jsx(E0,{className:"size-4"})})}),t]})}function ko({className:e,orientation:t="horizontal",decorative:r=!0,...o}){return d.jsx(q8,{"data-slot":"separator",decorative:r,orientation:t,className:Ee("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...o})}const QH=[{to:"/",label:"Dashboard",icon:Ej,end:!0},{to:"/projects",label:"Projects",icon:oh},{to:"/schedules",label:"Schedules",icon:k6},{to:"/settings",label:"Settings",icon:pP}],ZH=[{to:"/resources/roles",label:"Roles",icon:Rj},{to:"/resources/skills",label:"Skills",icon:Mj},{to:"/resources/agents",label:"Agents",icon:bj},{to:"/resources/memories",label:"Memory",icon:wj}];function WH(){const t=oa().pathname.split("/").filter(Boolean),r=t[0]==="projects"&&t[1]?Number(t[1]):0,{data:o}=Dj(r,{enabled:r>0}),s=[{label:"Dashboard",href:"/"}];if(t[0]==="projects"&&(s.push({label:"Projects",href:"/projects"}),t[1])){const l=`/projects/${t[1]}`,c=(o==null?void 0:o.display_name)??`Project #${t[1]}`;s.push({label:c,href:l,projectSwitcher:!0}),t[2]==="sessions"&&t[3]&&s.push({label:`Session ${t[3].slice(0,8)}…`})}if(t[0]==="schedules"&&s.push({label:"Scheduled Tasks"}),t[0]==="settings"&&s.push({label:"Settings"}),t[0]==="resources"){const l={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory"};s.push({label:"Resources"}),t[1]&&(s[s.length-1].href=`/resources/${t[1]}`,s.push({label:l[t[1]]??t[1]}))}return s}function JH(){const e=WH(),t=Ll(),r=Ul(),{setTheme:o}=Dy(),[s,l]=b.useState(!1),[c,f]=b.useState(!1);return aH({onCommandPalette:()=>l(!0),onShortcutsHelp:()=>f(!0)}),d.jsxs("div",{className:"flex min-h-screen",children:[d.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[d.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:d.jsx(Rr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),d.jsxs("nav",{className:"flex flex-col gap-1 p-3",children:[QH.map(({to:m,label:h,icon:g,end:p})=>d.jsxs(mv,{to:m,end:p,className:({isActive:v})=>Ee("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",v?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[d.jsx(g,{className:"h-4 w-4"}),h]},m)),d.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Resources"}),ZH.map(({to:m,label:h,icon:g})=>d.jsxs(mv,{to:m,className:({isActive:p})=>Ee("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",p?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[d.jsx(g,{className:"h-4 w-4"}),h]},m))]})]}),d.jsxs("div",{className:"flex flex-1 flex-col",children:[d.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border px-6",children:[d.jsx(VH,{children:d.jsx(qH,{children:e.map((m,h)=>{const g=h===e.length-1;return d.jsxs(FH,{children:[h>0&&d.jsx(GH,{}),m.projectSwitcher?d.jsxs(sh,{children:[d.jsxs(ih,{className:"flex items-center gap-1 text-sm font-medium text-foreground hover:text-foreground/80 transition-colors",children:[m.label,d.jsx(T6,{className:"h-3 w-3 text-muted-foreground"})]}),d.jsx(lh,{align:"start",children:(r.data??[]).map(p=>d.jsxs(Gc,{onClick:()=>t(`/projects/${p.id}`),children:[m.href===`/projects/${p.id}`?d.jsx(E0,{className:"mr-2 h-3.5 w-3.5"}):d.jsx("span",{className:"mr-2 inline-block w-3.5"}),p.display_name]},p.id))})]}):g?d.jsx(YH,{children:m.label}):d.jsx(XH,{href:m.href,children:m.label})]},m.label)})})}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("button",{onClick:()=>l(!0),className:"flex items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted",children:d.jsx("kbd",{className:"font-mono",children:"⌘K"})}),d.jsxs(sh,{children:[d.jsx(ih,{asChild:!0,children:d.jsxs(Me,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[d.jsx(Tj,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),d.jsx(_j,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),d.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),d.jsxs(lh,{align:"end",children:[d.jsx(Gc,{onClick:()=>o("light"),children:"Light"}),d.jsx(Gc,{onClick:()=>o("dark"),children:"Dark"}),d.jsx(Gc,{onClick:()=>o("system"),children:"System"})]})]})]})]}),d.jsx(ko,{}),d.jsx("main",{className:"flex-1 overflow-auto p-6",children:d.jsx(ZO,{})})]}),d.jsx(BH,{open:s,onOpenChange:l}),d.jsx($H,{open:c,onOpenChange:f})]})}const e9=Qh("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function $t({className:e,variant:t="default",asChild:r=!1,...o}){const s=r?ky:"span";return d.jsx(s,{"data-slot":"badge","data-variant":t,className:Ee(e9({variant:t}),e),...o})}function ui({className:e,...t}){return d.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:d.jsx("table",{"data-slot":"table",className:Ee("w-full caption-bottom text-sm",e),...t})})}function di({className:e,...t}){return d.jsx("thead",{"data-slot":"table-header",className:Ee("[&_tr]:border-b",e),...t})}function fi({className:e,...t}){return d.jsx("tbody",{"data-slot":"table-body",className:Ee("[&_tr:last-child]:border-0",e),...t})}function Dn({className:e,...t}){return d.jsx("tr",{"data-slot":"table-row",className:Ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function Qe({className:e,...t}){return d.jsx("th",{"data-slot":"table-head",className:Ee("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Ze({className:e,...t}){return d.jsx("td",{"data-slot":"table-cell",className:Ee("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ny({sessions:e,projectNames:t}){return d.jsxs(ui,{children:[d.jsx(di,{children:d.jsxs(Dn,{children:[d.jsx(Qe,{children:"Run ID"}),t&&d.jsx(Qe,{children:"Project"}),d.jsx(Qe,{children:"Role"}),d.jsx(Qe,{children:"Status"}),d.jsx(Qe,{children:"Started"}),d.jsx(Qe,{children:"Duration"}),d.jsx(Qe,{children:"Task"})]})}),d.jsx(fi,{children:e.map(r=>d.jsxs(Dn,{children:[d.jsx(Ze,{children:d.jsx(Rr,{to:`/projects/${r.project_id}/sessions/${r.run_id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:r.run_id.slice(0,16)})}),t&&d.jsx(Ze,{children:d.jsx(Rr,{to:`/projects/${r.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:t.get(r.project_id)??`#${r.project_id}`})}),d.jsx(Ze,{className:"text-sm",children:r.role}),d.jsx(Ze,{children:d.jsx(t9,{status:r.status})}),d.jsx(Ze,{className:"text-sm text-muted-foreground",children:ch(r.started_at)}),d.jsx(Ze,{className:"text-sm text-muted-foreground",children:Zh(r.duration_ms)}),d.jsx(Ze,{className:"max-w-[300px] truncate text-sm",children:r.task??"—"})]},r.run_id))})]})}function t9({status:e}){const t=Yj(e);return d.jsxs($t,{variant:"outline",className:Ee("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&d.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}const eE=Yj;function Yj(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":return"warning";default:return"default"}}function ch(e){try{return new Date(e).toLocaleString()}catch{return e}}function Zh(e){if(e==null)return"—";const t=Math.round(e/1e3);if(t<60)return`${t}s`;const r=Math.floor(t/60),o=t%60;return`${r}m ${o}s`}function An({className:e,...t}){return d.jsx("div",{"data-slot":"card",className:Ee("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function n9({className:e,...t}){return d.jsx("div",{"data-slot":"card-header",className:Ee("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function r9({className:e,...t}){return d.jsx("div",{"data-slot":"card-title",className:Ee("leading-none font-semibold",e),...t})}function On({className:e,...t}){return d.jsx("div",{"data-slot":"card-content",className:Ee("px-6",e),...t})}const Kg=1e4;function Gj(e,t,r){const[o,s]=b.useState([]),[l,c]=b.useState(!1),[f,m]=b.useState(!1),h=b.useRef(null),g=b.useRef(void 0),p=b.useRef(1e3),v=b.useRef("");return b.useEffect(()=>{if(!t)return;const x=`${e}:${t}`;v.current!==x&&(s([]),m(!1),v.current=x);function E(){const S=new EventSource(`/api/sessions/${e}/logs/${t}`);h.current=S,S.onopen=()=>{c(!0),p.current=1e3},S.addEventListener("snapshot",_=>{try{const C=JSON.parse(_.data);Array.isArray(C.lines)&&s(C.lines.slice(-Kg))}catch{}}),S.addEventListener("append",_=>{try{const C=JSON.parse(_.data);Array.isArray(C.lines)&&C.lines.length>0&&s(j=>{const N=[...j,...C.lines];return N.length>Kg?N.slice(-Kg):N})}catch{}}),S.addEventListener("done",()=>{m(!0),S.close(),h.current=null}),S.onerror=()=>{S.close(),h.current=null,c(!1),g.current=setTimeout(()=>{p.current=Math.min(p.current*2,15e3),E()},p.current)}}return E(),()=>{var S;(S=h.current)==null||S.close(),h.current=null,g.current&&clearTimeout(g.current)}},[e,t,r]),{lines:o,connected:l,done:f}}const a9=5e3;function o9({runId:e,projectId:t,agentId:r,role:o,runtime:s,startedAt:l}){const{lines:c,done:f}=Gj(e,r,!0),m=c.slice(-4),[h,g]=b.useState("");b.useEffect(()=>{const S=new Date(l).getTime(),_=()=>{const j=Date.now()-S,N=Math.floor(j/1e3)%60,R=Math.floor(j/6e4)%60,O=Math.floor(j/36e5);g(O>0?`${O}h ${R}m`:`${R}m ${N}s`)};_();const C=setInterval(_,1e3);return()=>clearInterval(C)},[l]);const p=b.useRef(c.length),v=b.useRef(Date.now()),[x,E]=b.useState(!1);return b.useEffect(()=>{c.length!==p.current&&(p.current=c.length,v.current=Date.now(),E(!1))},[c.length]),b.useEffect(()=>{const S=setInterval(()=>{Date.now()-v.current>a9&&E(!0)},1e3);return()=>clearInterval(S)},[]),d.jsx(An,{className:"overflow-hidden",children:d.jsxs(On,{className:"space-y-2 pt-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${f?"bg-muted-foreground":x?"bg-green-300":"animate-pulse bg-green-500"}`}),d.jsx("span",{className:"font-medium text-sm",children:o})]}),d.jsx($t,{variant:"outline",className:"text-xs",children:s.replace("strawpot-","")})]}),d.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[d.jsxs("span",{children:["Session: ",e.slice(0,12)]}),d.jsx("span",{children:"·"}),d.jsx("span",{children:h})]}),d.jsx("div",{className:"rounded bg-[#1e1e1e] px-2 py-1.5 font-mono text-[11px] leading-[16px] text-[#d4d4d4]",children:m.length>0?m.map((S,_)=>d.jsxs("div",{className:"truncate",children:[d.jsx("span",{className:"text-[#666]",children:"> "}),S]},_)):d.jsx("div",{className:"text-[#555]",children:"Waiting for output..."})}),d.jsx("div",{className:"flex justify-end",children:d.jsxs(Rr,{to:`/projects/${t}/sessions/${e}?tab=logs`,className:"inline-flex items-center gap-0.5 text-xs text-primary hover:underline",children:["View Session",d.jsx(Yh,{className:"h-3 w-3"})]})})]})})}const Qg=8;function s9(){var c;const t=((c=j0().data)==null?void 0:c.items)??[],r=c3({queries:t.slice(0,Qg).map(f=>({queryKey:Ye.sessions.detail(f.project_id,f.run_id),queryFn:()=>He.get(`/projects/${f.project_id}/sessions/${f.run_id}`),staleTime:1e4}))}),o=[];for(const f of r){if(!f.data)continue;const m=f.data;for(const[h,g]of Object.entries(m.agents))o.push({runId:m.run_id,projectId:m.project_id,agentId:h,role:g.role,runtime:g.runtime,startedAt:g.started_at})}if(o.length===0)return null;const s=o.slice(0,Qg),l=o.length-Qg;return d.jsxs("section",{className:"space-y-3",children:[d.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Active Agents (",o.length,")"]}),d.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:s.map(f=>d.jsx(o9,{runId:f.runId,projectId:f.projectId,agentId:f.agentId,role:f.role,runtime:f.runtime,startedAt:f.startedAt},`${f.runId}:${f.agentId}`))}),l>0&&d.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",l," more agent",l!==1?"s":""," running"]})]})}function tn({className:e,...t}){return d.jsx("div",{"data-slot":"skeleton",className:Ee("animate-pulse rounded-md bg-accent",e),...t})}function i9(){return d.jsxs("div",{className:"space-y-8",children:[d.jsx(tn,{className:"h-8 w-40"}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(tn,{className:"h-4 w-24"}),d.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-3",children:[1,2,3].map(e=>d.jsx(tn,{className:"h-28 rounded-lg"},e))})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(tn,{className:"h-4 w-32"}),d.jsx(tn,{className:"h-48 rounded-lg"})]})]})}function l9(){var g,p;const e=Ul(),t=j0(),r=oH(),o=e.isLoading||t.isLoading||r.isLoading,s=e.error||t.error||r.error;if(o)return d.jsx(i9,{});if(s)return d.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[d.jsx(Zo,{className:"h-4 w-4"}),d.jsxs("span",{children:["Error: ",s.message]})]});const l=e.data??[],c=((g=t.data)==null?void 0:g.items)??[],f=((p=r.data)==null?void 0:p.items)??[],m=new Map;for(const v of l)m.set(v.id,v.display_name);const h=new Map;for(const v of c)h.set(v.project_id,(h.get(v.project_id)??0)+1);return d.jsxs("div",{className:"space-y-8",children:[d.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Dashboard"}),d.jsx(s9,{}),d.jsxs("section",{className:"space-y-3",children:[d.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Projects (",l.length,")"]}),l.length===0?d.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered."}):d.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-3",children:l.map(v=>d.jsx(Rr,{to:`/projects/${v.id}`,className:"group",children:d.jsxs(An,{className:"transition-colors group-hover:border-foreground/20",children:[d.jsx(n9,{className:"pb-2",children:d.jsxs(r9,{className:"flex items-center gap-2 text-base",children:[d.jsx(oh,{className:"h-4 w-4 text-muted-foreground"}),v.display_name]})}),d.jsxs(On,{children:[d.jsx("p",{className:"break-all text-sm text-muted-foreground",children:v.working_dir}),d.jsxs("div",{className:"mt-2 flex gap-1.5",children:[!v.dir_exists&&d.jsx($t,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Directory missing"}),(h.get(v.id)??0)>0&&d.jsxs($t,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:[d.jsx("span",{className:"mr-1 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),h.get(v.id)," running"]})]})]})]})},v.id))})]}),c.length>0&&d.jsxs("section",{className:"space-y-3",children:[d.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Running Sessions (",c.length,")"]}),d.jsx(An,{children:d.jsx(On,{className:"p-0",children:d.jsx(ny,{sessions:c,projectNames:m})})})]}),d.jsxs("section",{className:"space-y-3",children:[d.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"}),f.length===0?d.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):d.jsx(An,{children:d.jsx(On,{className:"p-0",children:d.jsx(ny,{sessions:f,projectNames:m})})})]})]})}function c9(){const e=ft();return Ct({mutationFn:t=>He.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Ye.projects.all})}})}function u9(){const e=ft();return Ct({mutationFn:t=>He.delete(`/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ye.projects.all})}})}function d9(){const e=ft();return Ct({mutationFn:({projectId:t,files:r})=>He.upload(`/projects/${t}/files`,r),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:Ye.projects.files(r.projectId)})}})}function f9(){const e=ft();return Ct({mutationFn:({projectId:t,filePath:r})=>He.delete(`/projects/${t}/files/${r}`),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:Ye.projects.files(r.projectId)})}})}function Lt({className:e,type:t,...r}){return d.jsx("input",{type:t,"data-slot":"input",className:Ee("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...r})}function Wh({className:e,children:t,...r}){return d.jsxs(r8,{"data-slot":"scroll-area",className:Ee("relative",e),...r,children:[d.jsx(a8,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:t}),d.jsx(h9,{}),d.jsx(o8,{})]})}function h9({className:e,orientation:t="vertical",...r}){return d.jsx(eN,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Ee("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:d.jsx(aN,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function m9({initialPath:e,onSelect:t,onCancel:r}){const[o,s]=b.useState(null),[l,c]=b.useState(!0),[f,m]=b.useState(null),[h,g]=b.useState(null),p=x=>{c(!0),m(null);const E=x?`?path=${encodeURIComponent(x)}`:"";He.get(`/fs/browse${E}`).then(s).catch(S=>m(S.message??"Failed to browse")).finally(()=>c(!1))},v=async()=>{if(!(!o||!(h!=null&&h.trim())))try{const x=await He.post("/fs/mkdir",{path:o.path,name:h.trim()});g(null),p(x.path)}catch(x){m(x instanceof Error?x.message:"Failed to create folder")}};return b.useEffect(()=>{p(e||void 0)},[]),d.jsx(si,{open:!0,onOpenChange:x=>!x&&r(),children:d.jsxs(ii,{className:"sm:max-w-[480px]",children:[d.jsx(li,{children:d.jsx(ci,{children:"Select Directory"})}),o&&d.jsx("div",{className:"break-all rounded-md bg-muted px-3 py-1.5 font-mono text-xs",children:o.path}),f&&d.jsx("p",{className:"text-sm text-destructive",children:f}),l&&!o?d.jsx("p",{className:"py-4 text-sm text-muted-foreground",children:"Loading..."}):d.jsx(Wh,{className:"h-[300px]",children:d.jsxs("div",{className:"space-y-0.5",children:[(o==null?void 0:o.parent)&&d.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>p(o.parent),children:[d.jsx($6,{className:"h-4 w-4"}),".."]}),o==null?void 0:o.entries.map(x=>d.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>p(x.path),children:[d.jsx(q6,{className:"h-4 w-4"}),x.name]},x.path)),(o==null?void 0:o.entries.length)===0&&d.jsx("p",{className:"px-3 py-4 text-sm italic text-muted-foreground",children:"No subdirectories"})]})}),d.jsx(Fj,{children:h!==null?d.jsxs("div",{className:"flex w-full gap-2",children:[d.jsx(Lt,{value:h,onChange:x=>g(x.target.value),onKeyDown:x=>{x.key==="Enter"&&v(),x.key==="Escape"&&g(null)},placeholder:"Folder name",autoFocus:!0,className:"flex-1"}),d.jsx(Me,{size:"sm",onClick:v,children:"Create"}),d.jsx(Me,{size:"sm",variant:"outline",onClick:()=>g(null),children:"Cancel"})]}):d.jsxs(d.Fragment,{children:[d.jsx(Me,{variant:"outline",onClick:()=>g(""),disabled:!o,children:"New Folder"}),d.jsx("div",{className:"flex-1"}),d.jsx(Me,{onClick:()=>o&&t(o.path),disabled:!o,children:"Select"}),d.jsx(Me,{variant:"outline",onClick:r,children:"Cancel"})]})})]})})}function Rt({className:e,...t}){return d.jsx(Fz,{"data-slot":"label",className:Ee("flex items-center gap-2 text-sm 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 p9(){const{data:e,isLoading:t,error:r}=Ul(),[o,s]=b.useState(!1);if(t)return d.jsxs("div",{className:"space-y-6",children:[d.jsx(tn,{className:"h-8 w-32"}),d.jsx(tn,{className:"h-64 rounded-lg"})]});if(r)return d.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[d.jsx(Zo,{className:"h-4 w-4"}),d.jsxs("span",{children:["Error: ",r.message]})]});const l=e??[];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Projects"}),d.jsxs(Me,{onClick:()=>s(!0),children:[d.jsx(Wv,{className:"mr-2 h-4 w-4"}),"New Project"]})]}),o&&d.jsx(g9,{onDone:()=>s(!1),onCancel:()=>s(!1)}),l.length===0?d.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered yet."}):d.jsx(An,{children:d.jsx(On,{className:"p-0",children:d.jsxs(ui,{children:[d.jsx(di,{children:d.jsxs(Dn,{children:[d.jsx(Qe,{children:"Name"}),d.jsx(Qe,{children:"Directory"}),d.jsx(Qe,{children:"Created"}),d.jsx(Qe,{children:"Status"}),d.jsx(Qe,{className:"w-[80px]"})]})}),d.jsx(fi,{children:l.map(c=>d.jsxs(Dn,{children:[d.jsx(Ze,{children:d.jsx(Rr,{to:`/projects/${c.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:c.display_name})}),d.jsx(Ze,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:c.working_dir}),d.jsx(Ze,{className:"text-sm text-muted-foreground",children:y9(c.created_at)}),d.jsx(Ze,{children:c.dir_exists?d.jsx($t,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:"OK"}):d.jsx($t,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Missing"})}),d.jsx(Ze,{children:d.jsx(v9,{projectId:c.id})})]},c.id))})]})})})]})}function g9({onDone:e,onCancel:t}){const[r,o]=b.useState(""),[s,l]=b.useState(""),[c,f]=b.useState(!1),m=c9(),h=async g=>{g.preventDefault();try{await m.mutateAsync({display_name:r.trim(),working_dir:s.trim()}),e()}catch{}};return d.jsx(An,{children:d.jsx(On,{className:"pt-6",children:d.jsxs("form",{onSubmit:h,className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Rt,{htmlFor:"display-name",children:"Display Name"}),d.jsx(Lt,{id:"display-name",value:r,onChange:g=>o(g.target.value),required:!0,autoFocus:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Rt,{htmlFor:"working-dir",children:"Working Directory"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Lt,{id:"working-dir",value:s,onChange:g=>l(g.target.value),placeholder:"/path/to/project",required:!0}),d.jsx(Me,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!c),children:"Browse"})]})]})]}),c&&d.jsx(m9,{initialPath:s||void 0,onSelect:g=>{l(g),f(!1)},onCancel:()=>f(!1)}),m.error&&d.jsx("p",{className:"text-sm text-destructive",children:m.error.message}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Me,{type:"submit",disabled:m.isPending,children:m.isPending?"Creating...":"Create"}),d.jsx(Me,{type:"button",variant:"outline",onClick:t,children:"Cancel"})]})]})})})}function v9({projectId:e}){const[t,r]=b.useState(!1),o=u9(),s=async()=>{try{await o.mutateAsync(e)}catch{}};return t?d.jsxs("div",{className:"flex gap-1",children:[d.jsx(Me,{size:"sm",variant:"destructive",onClick:s,disabled:o.isPending,children:"Confirm"}),d.jsx(Me,{size:"sm",variant:"outline",onClick:()=>r(!1),children:"No"})]}):d.jsx(Me,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>r(!0),children:d.jsx(C0,{className:"h-4 w-4"})})}function y9(e){try{return new Date(e).toLocaleDateString()}catch{return e}}function Kj(e){return rn({queryKey:Ye.projects.resources(e),queryFn:()=>He.get(`/projects/${e}/resources`)})}function x9(e,t,r,o){return rn({queryKey:Ye.projects.resourceDetail(e,t,r),queryFn:()=>He.get(`/projects/${e}/resources/${t}/${r}`),enabled:(o==null?void 0:o.enabled)??!!r})}function b9(e,t,r,o){return rn({queryKey:Ye.projects.resourceConfig(e,t,r),queryFn:()=>He.get(`/projects/${e}/resources/${t}/${r}/config`),enabled:(o==null?void 0:o.enabled)??!!r})}function w9(e,t){if(t<=7)return Array.from({length:t},(l,c)=>c+1);const r=[1];e>3&&r.push("...");const o=Math.max(2,e-1),s=Math.min(t-1,e+1);for(let l=o;l<=s;l++)r.push(l);return e<t-2&&r.push("..."),r.push(t),r}function S9({page:e,totalPages:t,onPageChange:r}){if(t<=1)return null;const o=w9(e,t);return d.jsxs("div",{className:"flex items-center justify-center gap-1 pt-2",children:[d.jsx(Me,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e<=1,onClick:()=>r(e-1),children:d.jsx(E6,{className:"h-4 w-4"})}),o.map((s,l)=>s==="..."?d.jsx("span",{className:"px-1 text-sm text-muted-foreground",children:"..."},`ellipsis-${l}`):d.jsx(Me,{variant:s===e?"default":"outline",size:"icon",className:"h-8 w-8 text-xs",onClick:()=>r(s),children:s},s)),d.jsx(Me,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e>=t,onClick:()=>r(e+1),children:d.jsx(Yh,{className:"h-4 w-4"})})]})}function Qj(){return rn({queryKey:Ye.roles.all,queryFn:()=>He.get("/roles")})}function E9(e){return rn({queryKey:Ye.registry.validate(e??""),queryFn:()=>He.get(`/registry/agents/${e}/validate`),enabled:!!e})}function iu(e,t){return rn({queryKey:Ye.registry.list(e),queryFn:()=>He.get(`/registry/${e}`),enabled:t==null?void 0:t.enabled})}function _9(e,t,r){return rn({queryKey:Ye.registry.detail(e,t),queryFn:()=>He.get(`/registry/${e}/${t}`),enabled:(r==null?void 0:r.enabled)??!!t})}function C9(){const e=ft();return Ct({mutationFn:t=>He.post("/sessions",t),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:Ye.projects.sessions(r.project_id)}),e.invalidateQueries({queryKey:["sessions"]})}})}function N9(){const e=ft();return Ct({mutationFn:t=>He.post(`/sessions/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function Jo({...e}){return d.jsx(R8,{"data-slot":"select",...e})}function es({...e}){return d.jsx(A8,{"data-slot":"select-value",...e})}function ts({className:e,size:t="default",children:r,...o}){return d.jsxs(M8,{"data-slot":"select-trigger","data-size":t,className:Ee("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...o,children:[r,d.jsx(O8,{asChild:!0,children:d.jsx(su,{className:"size-4 opacity-50"})})]})}function ns({className:e,children:t,position:r="item-aligned",align:o="center",...s}){return d.jsx(D8,{children:d.jsxs(k8,{"data-slot":"select-content",className:Ee("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:o,...s,children:[d.jsx(j9,{}),d.jsx(z8,{className:Ee("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),d.jsx(T9,{})]})})}function Yn({className:e,children:t,...r}){return d.jsxs(L8,{"data-slot":"select-item",className:Ee("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent 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-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[d.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(H8,{children:d.jsx(E0,{className:"size-4"})})}),d.jsx(P8,{children:t})]})}function j9({className:e,...t}){return d.jsx(I8,{"data-slot":"select-scroll-up-button",className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(N6,{className:"size-4"})})}function T9({className:e,...t}){return d.jsx(B8,{"data-slot":"select-scroll-down-button",className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(su,{className:"size-4"})})}function uh({className:e,...t}){return d.jsx("textarea",{"data-slot":"textarea",className:Ee("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...t})}function R0({...e}){return d.jsx(U3,{"data-slot":"collapsible",...e})}function M0({...e}){return d.jsx(fC,{"data-slot":"collapsible-trigger",...e})}function A0({...e}){return d.jsx(hC,{"data-slot":"collapsible-content",...e})}function R9({projectId:e,open:t,onOpenChange:r}){var X;const o=Ll(),s=zj(e),l=Qj(),{data:c}=iu("agents"),f=kj(e),m=C9(),h=(X=s.data)==null?void 0:X.merged,[g,p]=b.useState(""),[v,x]=b.useState(""),[E,S]=b.useState(""),[_,C]=b.useState(""),[j,N]=b.useState(""),[R,O]=b.useState(""),[A,D]=b.useState([]),[P,H]=b.useState(""),Q=()=>{p(""),x(""),S(""),C(""),N(""),O(""),D([])},V=k=>{D(L=>L.includes(k)?L.filter(Y=>Y!==k):[...L,k])},q=async k=>{k.preventDefault();try{const L={project_id:e,task:g.trim()};v.trim()&&(L.role=v.trim());const Y={};E.trim()&&(Y.runtime=E.trim()),_.trim()&&(Y.isolation=_.trim()),j.trim()&&(Y.merge_strategy=j.trim()),Object.keys(Y).length>0&&(L.overrides=Y),A.length>0&&(L.context_files=A),R.trim()&&(L.system_prompt=R.trim());const W=await m.mutateAsync(L);Q(),r(!1),o(`/projects/${e}/sessions/${W.run_id}`)}catch{}},ee=(h==null?void 0:h.orchestrator_role)??"orchestrator",B=(l.data??[]).filter(k=>k!==ee),K=[ee,...B],M=(c??[]).map(k=>k.name),I=v.trim()&&!K.includes(v.trim())?"Role not found in installed roles":"",U=E.trim()&&M.length>0&&!M.includes(E.trim())?"Runtime not found in installed agents":"",$=!!I||!!U;return d.jsx(si,{open:t,onOpenChange:r,children:d.jsxs(ii,{className:"max-w-2xl",children:[d.jsx(li,{children:d.jsx(ci,{children:"Launch Session"})}),d.jsxs("form",{onSubmit:q,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Rt,{htmlFor:"task",children:["Task ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx(uh,{id:"task",value:g,onChange:k=>p(k.target.value),placeholder:"Describe what the agent should do...",required:!0,autoFocus:!0,rows:3})]}),(f.data??[]).length>0&&d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(sh,{children:[d.jsx(ih,{asChild:!0,children:d.jsxs(Me,{type:"button",variant:"outline",size:"sm",children:[d.jsx(oP,{className:"mr-1 h-3.5 w-3.5"}),"@ Attach Files"]})}),d.jsxs(lh,{align:"start",className:"w-64",onCloseAutoFocus:k=>k.preventDefault(),children:[d.jsx("div",{className:"px-2 py-1.5",children:d.jsx(Lt,{placeholder:"Filter files...",value:P,onChange:k=>H(k.target.value),className:"h-7 text-xs",onKeyDown:k=>k.stopPropagation()})}),d.jsx("div",{className:"max-h-48 overflow-y-auto",children:(f.data??[]).filter(k=>k.path.toLowerCase().includes(P.toLowerCase())).map(k=>d.jsx(KH,{checked:A.includes(k.path),onCheckedChange:()=>V(k.path),onSelect:L=>L.preventDefault(),children:d.jsx("span",{className:"font-mono text-xs",children:k.path})},k.path))})]})]}),A.length>0&&d.jsxs("span",{className:"text-xs text-muted-foreground",children:[A.length," file(s) attached"]})]}),A.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:A.map(k=>d.jsxs($t,{variant:"secondary",className:"gap-1 font-mono text-xs",children:["@",k,d.jsx("button",{type:"button",onClick:()=>V(k),className:"ml-0.5 rounded-sm hover:bg-muted",children:d.jsx(N0,{className:"h-3 w-3"})})]},k))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Rt,{htmlFor:"role",children:"Role"}),d.jsx(Lt,{id:"role",list:"datalist-role",value:v,onChange:k=>x(k.target.value),placeholder:ee}),d.jsxs("datalist",{id:"datalist-role",children:[d.jsx("option",{value:ee}),B.map(k=>d.jsx("option",{value:k},k))]}),I&&d.jsx("p",{className:"text-xs text-destructive",children:I})]}),d.jsxs(R0,{children:[d.jsx(M0,{asChild:!0,children:d.jsxs(Me,{type:"button",variant:"ghost",size:"sm",children:[d.jsx(su,{className:"mr-1 h-4 w-4"}),"Advanced Options"]})}),d.jsxs(A0,{className:"mt-3 space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Rt,{htmlFor:"runtime",children:"Runtime"}),d.jsx(Lt,{id:"runtime",list:"datalist-runtime",value:E,onChange:k=>S(k.target.value),placeholder:(h==null?void 0:h.runtime)??"strawpot-claude-code"}),c&&d.jsx("datalist",{id:"datalist-runtime",children:c.map(k=>d.jsx("option",{value:k.name},k.name))}),U&&d.jsx("p",{className:"text-xs text-destructive",children:U})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Rt,{htmlFor:"isolation",children:"Isolation"}),d.jsxs(Jo,{value:_,onValueChange:C,children:[d.jsx(ts,{id:"isolation",children:d.jsx(es,{placeholder:(h==null?void 0:h.isolation)??"none"})}),d.jsxs(ns,{children:[d.jsx(Yn,{value:"none",children:"none"}),d.jsx(Yn,{value:"worktree",children:"worktree"})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Rt,{htmlFor:"merge-strategy",children:"Merge Strategy"}),d.jsxs(Jo,{value:j,onValueChange:N,children:[d.jsx(ts,{id:"merge-strategy",children:d.jsx(es,{placeholder:(h==null?void 0:h.merge_strategy)??"auto"})}),d.jsxs(ns,{children:[d.jsx(Yn,{value:"auto",children:"auto"}),d.jsx(Yn,{value:"local",children:"local"}),d.jsx(Yn,{value:"pr",children:"pr"})]})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Rt,{htmlFor:"system-prompt",children:"System Prompt"}),d.jsx(uh,{id:"system-prompt",value:R,onChange:k=>O(k.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})]})]}),m.error&&d.jsx("p",{className:"text-sm text-destructive",children:m.error.message}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Me,{type:"submit",disabled:m.isPending||$,children:m.isPending?"Launching...":"Launch"}),d.jsx(Me,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"})]})]})]})})}function M9(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function A9({projectId:e}){const t=kj(e),r=d9(),o=f9(),s=b.useRef(null),[l,c]=b.useState(!1),f=b.useCallback(S=>{const _=Array.from(S);_.length!==0&&r.mutate({projectId:e,files:_},{onSuccess:()=>gt.success(`Uploaded ${_.length} file(s)`),onError:()=>gt.error("Upload failed")})},[e,r]),m=b.useCallback(S=>{S.preventDefault(),c(!1),f(S.dataTransfer.files)},[f]),h=b.useCallback(S=>{S.preventDefault(),c(!0)},[]),g=b.useCallback(S=>{S.preventDefault(),c(!1)},[]),p=b.useCallback(()=>{var S;(S=s.current)==null||S.click()},[]),v=b.useCallback(S=>{S.target.files&&(f(S.target.files),S.target.value="")},[f]),x=b.useCallback(S=>{o.mutate({projectId:e,filePath:S},{onSuccess:()=>gt.success("File deleted"),onError:()=>gt.error("Failed to delete file")})},[e,o]),E=t.data??[];return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{onDrop:m,onDragOver:h,onDragLeave:g,className:`flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-8 transition-colors ${l?"border-primary bg-primary/5":"border-muted-foreground/25"}`,children:[d.jsx(EP,{className:"h-8 w-8 text-muted-foreground"}),d.jsxs("p",{className:"text-sm text-muted-foreground",children:["Drag & drop files here, or"," ",d.jsx("button",{type:"button",onClick:p,className:"font-medium text-primary underline-offset-4 hover:underline",children:"browse"})]}),r.isPending&&d.jsx("p",{className:"text-xs text-muted-foreground",children:"Uploading..."}),d.jsx("input",{ref:s,type:"file",multiple:!0,className:"hidden",onChange:v})]}),E.length===0?d.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No files uploaded yet."}):d.jsx(An,{children:d.jsx(On,{className:"p-0",children:d.jsxs(ui,{children:[d.jsx(di,{children:d.jsxs(Dn,{children:[d.jsx(Qe,{children:"Name"}),d.jsx(Qe,{className:"w-24",children:"Size"}),d.jsx(Qe,{className:"w-44",children:"Modified"}),d.jsx(Qe,{className:"w-12"})]})}),d.jsx(fi,{children:E.map(S=>d.jsxs(Dn,{children:[d.jsx(Ze,{className:"font-mono text-xs",children:S.path}),d.jsx(Ze,{className:"text-xs text-muted-foreground",children:M9(S.size)}),d.jsx(Ze,{className:"text-xs text-muted-foreground",children:new Date(S.modified_at).toLocaleString()}),d.jsx(Ze,{children:d.jsx(Me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>x(S.path),disabled:o.isPending,children:d.jsx(C0,{className:"h-3.5 w-3.5 text-muted-foreground"})})})]},S.path))})]})})})]})}function O9(){const e=ft();return Ct({mutationFn:t=>He.post("/registry/install",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function D9(){const e=ft();return Ct({mutationFn:({type:t,name:r})=>He.delete(`/registry/${t}/${r}`),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function k9(){const e=ft();return Ct({mutationFn:t=>He.post("/registry/update",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function z9(){const e=ft();return Ct({mutationFn:t=>He.post("/registry/reinstall",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function L9(){const e=ft();return Ct({mutationFn:({type:t,name:r,env_values:o,params_values:s})=>He.put(`/registry/${t}/${r}/config`,{env_values:o,params_values:s}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:Ye.registry.config(r.type,r.name)})}})}function P9(e){const t=ft();return Ct({mutationFn:r=>He.post(`/projects/${e}/resources/install`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Ye.projects.resources(e)})}})}function H9(e){const t=ft();return Ct({mutationFn:({type:r,name:o})=>He.delete(`/projects/${e}/resources/${r}/${o}`),onSuccess:()=>{t.invalidateQueries({queryKey:Ye.projects.resources(e)})}})}function I9(e){const t=ft();return Ct({mutationFn:r=>He.post(`/projects/${e}/resources/update`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Ye.projects.resources(e)})}})}function B9(e){const t=ft();return Ct({mutationFn:r=>He.post(`/projects/${e}/resources/reinstall`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Ye.projects.resources(e)})}})}function U9(e){const t=ft();return Ct({mutationFn:({type:r,name:o,env_values:s,params_values:l})=>He.put(`/projects/${e}/resources/${r}/${o}/config`,{env_values:s,params_values:l}),onSuccess:(r,o)=>{t.invalidateQueries({queryKey:Ye.projects.resourceConfig(e,o.type,o.name)})}})}function $9({...e}){return d.jsx(qy,{"data-slot":"sheet",...e})}function V9({...e}){return d.jsx(Fy,{"data-slot":"sheet-portal",...e})}function q9({className:e,...t}){return d.jsx(Xy,{"data-slot":"sheet-overlay",className:Ee("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function F9({className:e,children:t,side:r="right",showCloseButton:o=!0,...s}){return d.jsxs(V9,{children:[d.jsx(q9,{}),d.jsxs(Yy,{"data-slot":"sheet-content",className:Ee("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",r==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",r==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",r==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",r==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",e),...s,children:[t,o&&d.jsxs(Gy,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary",children:[d.jsx(N0,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function X9({className:e,...t}){return d.jsx("div",{"data-slot":"sheet-header",className:Ee("flex flex-col gap-1.5 p-4",e),...t})}function Y9({className:e,...t}){return d.jsx(BC,{"data-slot":"sheet-title",className:Ee("font-semibold text-foreground",e),...t})}function G9({className:e,...t}){return d.jsx(UC,{"data-slot":"sheet-description",className:Ee("text-sm text-muted-foreground",e),...t})}const K9=Qh("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Hf({className:e,variant:t,...r}){return d.jsx("div",{"data-slot":"alert",role:"alert",className:Ee(K9({variant:t}),e),...r})}function If({className:e,...t}){return d.jsx("div",{"data-slot":"alert-title",className:Ee("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Bf({className:e,...t}){return d.jsx("div",{"data-slot":"alert-description",className:Ee("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function Q9({agentName:e}){const{data:t}=E9(e);return!t||!(!t.tools_ok||t.setup_command||!t.env_ok)?null:d.jsxs("div",{className:"mb-4 space-y-3",children:[!t.tools_ok&&d.jsxs(Hf,{variant:"destructive",children:[d.jsx(Zo,{className:"h-4 w-4"}),d.jsx(If,{children:"Missing Prerequisites"}),d.jsx(Bf,{children:t.missing_tools.map(o=>d.jsxs("div",{className:"mt-1",children:[d.jsx("strong",{children:o.name})," not found on PATH.",o.install_hint&&d.jsx("code",{className:"ml-2 rounded bg-muted px-1.5 py-0.5 text-xs",children:o.install_hint})]},o.name))})]}),t.setup_command&&d.jsxs(Hf,{children:[d.jsx(yP,{className:"h-4 w-4"}),d.jsx(If,{children:"Setup"}),d.jsxs(Bf,{children:[d.jsx("p",{children:t.setup_description||"Run initial authentication in your terminal:"}),d.jsx("code",{className:"mt-1 block rounded bg-muted px-2 py-1 text-xs",children:t.setup_command}),d.jsx("p",{className:"mt-2 text-muted-foreground",children:"Or set the API key in the config below instead."})]})]}),!t.env_ok&&!t.setup_command&&t.missing_env.length>0&&d.jsxs(Hf,{children:[d.jsx(Q6,{className:"h-4 w-4"}),d.jsx(If,{children:"API Key Required"}),d.jsx(Bf,{children:d.jsxs("p",{children:["Set"," ",t.missing_env.map((o,s)=>d.jsxs("span",{children:[s>0&&", ",d.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:o})]},o))," ","in the config below to authenticate."]})})]})]})}function Z9(e,t,r){return rn({queryKey:Ye.registry.config(e,t),queryFn:()=>He.get(`/registry/${e}/${t}/config`),enabled:(r==null?void 0:r.enabled)??!!t})}function W9({resourceType:e,resourceName:t,enabled:r,projectId:o}){const s=Z9(e,t,{enabled:r&&!o}),l=b9(o??0,e,t,{enabled:r&&!!o}),{data:c,isLoading:f}=o?l:s,m=L9(),h=U9(o??0),g=o?h:m,{data:p}=iu("agents",{enabled:r&&e==="roles"}),[v,x]=b.useState({}),[E,S]=b.useState({}),[_,C]=b.useState(new Set);if(b.useEffect(()=>{c&&(x({...c.env_values}),S({...c.params_values}))},[c]),f||!c)return null;const j=Object.keys(c.env_schema),N=Object.keys(c.params_schema);if(j.length===0&&N.length===0)return null;const R=H=>C(Q=>{const V=new Set(Q);return V.has(H)?V.delete(H):V.add(H),V}),O=(p??[]).map(H=>H.name),A=String(E.default_agent??"").trim(),D=e==="roles"&&A&&O.length>0&&!O.includes(A)?"Agent not found in installed agents":"",P=()=>{g.mutate({type:e,name:t,env_values:j.length>0?v:void 0,params_values:N.length>0?E:void 0},{onSuccess:()=>gt.success("Configuration saved"),onError:()=>gt.error("Failed to save configuration")})};return d.jsxs("div",{className:"flex flex-col gap-4",children:[j.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(ko,{}),d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsx("h4",{className:"text-sm font-semibold",children:"Environment Variables"}),j.map(H=>{const Q=c.env_schema[H],V=_.has(H);return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Rt,{className:"text-xs font-mono",children:H}),Q.required&&d.jsx($t,{variant:"outline",className:"h-4 px-1 text-[10px] text-red-500 border-red-200",children:"required"})]}),Q.description&&d.jsx("p",{className:"text-xs text-muted-foreground",children:Q.description}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx(Lt,{type:V?"text":"password",value:v[H]??"",onChange:q=>x(ee=>({...ee,[H]:q.target.value})),placeholder:H,className:"h-8 text-xs font-mono"}),d.jsx(Me,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 shrink-0 p-0",onClick:()=>R(H),children:V?d.jsx(P6,{className:"h-3.5 w-3.5"}):d.jsx(I6,{className:"h-3.5 w-3.5"})})]})]},H)})]})]}),N.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(ko,{}),d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsx("h4",{className:"text-sm font-semibold",children:"Parameters"}),N.map(H=>{const Q=c.params_schema[H],V=E[H],q=Q.default;if(Q.type==="boolean")return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(Rt,{className:"text-xs font-mono",children:H}),Q.description&&d.jsx("p",{className:"text-xs text-muted-foreground",children:Q.description}),d.jsxs(Jo,{value:V!=null?String(V):q!=null?String(q):"",onValueChange:I=>S(U=>({...U,[H]:I==="true"})),children:[d.jsx(ts,{className:"h-8 text-xs",children:d.jsx(es,{})}),d.jsxs(ns,{children:[d.jsx(Yn,{value:"true",children:"true"}),d.jsx(Yn,{value:"false",children:"false"})]})]})]},H);const ee=Q.type==="int"||Q.type==="float"?"number":"text",B=Q.type==="float"?"any":void 0,K=H==="default_agent"&&p?p.map(I=>I.name):void 0,M=K?`datalist-${H}`:void 0;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(Rt,{className:"text-xs font-mono",children:H}),Q.description&&d.jsx("p",{className:"text-xs text-muted-foreground",children:Q.description}),d.jsx(Lt,{type:ee,step:B,list:M,value:V!=null?String(V):"",onChange:I=>S(U=>({...U,[H]:ee==="number"&&I.target.value!==""?Number(I.target.value):I.target.value})),placeholder:q!=null?String(q):void 0,className:"h-8 text-xs font-mono"}),K&&d.jsx("datalist",{id:M,children:K.map(I=>d.jsx("option",{value:I},I))}),H==="default_agent"&&D&&d.jsx("p",{className:"text-xs text-destructive",children:D})]},H)})]})]}),d.jsxs(Me,{size:"sm",onClick:P,disabled:g.isPending||!!D,className:"self-start",children:[d.jsx(Nj,{className:"mr-2 h-3.5 w-3.5"}),g.isPending?"Saving...":"Save Configuration"]})]})}function Zj({resource:e,resourceType:t,open:r,onOpenChange:o,projectId:s}){var O;const l=D9(),c=k9(),f=z9(),m=H9(s??0),h=I9(s??0),g=B9(s??0),p=s?m:l,v=s?h:c,x=s?g:f,[E,S]=b.useState(!1),_=v.isPending||x.isPending||p.isPending;if(!e)return null;const C=()=>{if(!E){S(!0);return}p.mutate({type:t,name:e.name},{onSuccess:A=>{A.exit_code===0?(gt.success(`Uninstalled ${e.name}`),o(!1)):gt.error(`Uninstall failed: ${A.stderr||A.stdout}`),S(!1)},onError:()=>{gt.error("Uninstall request failed"),S(!1)}})},j=()=>{v.mutate({type:t,name:e.name},{onSuccess:A=>{A.exit_code===0?gt.success(`Updated ${e.name}`):gt.error(`Update failed: ${A.stderr||A.stdout}`)},onError:()=>gt.error("Update request failed")})},N=()=>{x.mutate({type:t,name:e.name},{onSuccess:A=>{A.exit_code===0?gt.success(`Reinstalled ${e.name}`):gt.error(`Reinstall failed: ${A.stderr||A.stdout}`)},onError:()=>gt.error("Reinstall request failed")})},R=(O=e.frontmatter)==null?void 0:O.metadata;return d.jsx($9,{open:r,onOpenChange:A=>{o(A),S(!1)},children:d.jsxs(F9,{side:"right",className:"flex h-full flex-col sm:max-w-lg",children:[d.jsxs(X9,{className:"shrink-0",children:[d.jsxs(Y9,{className:"flex items-center gap-2",children:[e.name,e.version&&d.jsxs($t,{variant:"outline",className:"text-xs font-normal",children:["v",e.version]})]}),d.jsx(G9,{children:e.description||"No description"})]}),d.jsxs("div",{className:"shrink-0 flex flex-col gap-4 px-4",children:[d.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[d.jsxs("span",{children:["Source: ",d.jsx("strong",{children:e.source})]}),d.jsxs("span",{children:["Path: ",d.jsx("code",{className:"rounded bg-muted px-1",children:e.path})]})]}),R&&Object.keys(R).length>0&&d.jsxs("details",{className:"text-sm",children:[d.jsx("summary",{className:"cursor-pointer font-medium text-muted-foreground",children:"Metadata"}),d.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:JSON.stringify(R,null,2)})]})]}),d.jsxs(Wh,{className:"min-h-0 flex-1 px-4",children:[t==="agents"&&d.jsx(Q9,{agentName:e.name}),d.jsx(W9,{resourceType:t,resourceName:e.name,enabled:r,projectId:s}),d.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap mt-4",children:e.body||"No content."})]}),d.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[d.jsx(Me,{size:"sm",onClick:j,disabled:_,children:v.isPending?"Updating...":"Update"}),d.jsx(Me,{variant:"outline",size:"sm",onClick:N,disabled:_,children:x.isPending?"Reinstalling...":"Reinstall"}),d.jsx("div",{className:"flex-1"}),d.jsx(Me,{variant:E?"destructive":"outline",size:"sm",onClick:C,disabled:_,children:p.isPending?"Uninstalling...":E?"Confirm Uninstall":"Uninstall"}),E&&!p.isPending&&d.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>S(!1),children:"Cancel"})]})]})})}const J9=[{value:"roles",label:"Role"},{value:"skills",label:"Skill"},{value:"agents",label:"Agent"},{value:"memories",label:"Memory"}];function O0({open:e,onOpenChange:t,defaultType:r,projectId:o}){const[s,l]=b.useState(r??"roles"),[c,f]=b.useState(""),[m,h]=b.useState(null),[g,p]=b.useState(null);b.useEffect(()=>{e&&r&&l(r)},[e,r]);const v=O9(),x=P9(o??0),E=o?x:v,S=(m==null?void 0:m.status)==="success",_=()=>{c.trim()&&(h(null),p(null),E.mutate({type:s,name:c.trim()},{onSuccess:j=>{j.exit_code===0?(gt.success(`Installed ${c.trim()}`),h({status:"success",message:`Successfully installed ${c.trim()}`}),p(j.stdout||null)):(h({status:"error",message:"Installation failed"}),p(j.stderr||j.stdout||"Unknown error."))},onError:()=>{h({status:"error",message:"Install request failed"}),gt.error("Install request failed")}}))},C=j=>{j||(h(null),p(null),f("")),t(j)};return d.jsx(si,{open:e,onOpenChange:C,children:d.jsxs(ii,{className:"sm:max-w-md",children:[d.jsxs(li,{children:[d.jsx(ci,{children:o?"Install Resource to Project":"Install Resource"}),d.jsx(Xj,{children:"Install a resource from StrawHub by name."})]}),d.jsxs("div",{className:"flex flex-col gap-4",children:[m&&d.jsxs(Hf,{variant:m.status==="error"?"destructive":"default",className:m.status==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-300":"",children:[m.status==="success"?d.jsx(Sj,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):d.jsx(O6,{className:"h-4 w-4"}),d.jsx(If,{children:m.status==="success"?"Installed":"Error"}),d.jsx(Bf,{children:m.message})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Rt,{htmlFor:"install-type",children:"Type"}),d.jsxs(Jo,{value:s,onValueChange:l,disabled:S,children:[d.jsx(ts,{id:"install-type",children:d.jsx(es,{})}),d.jsx(ns,{children:J9.map(j=>d.jsx(Yn,{value:j.value,children:j.label},j.value))})]})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Rt,{htmlFor:"install-name",children:"Package Name"}),d.jsx(Lt,{id:"install-name",autoFocus:!0,value:c,onChange:j=>f(j.target.value),placeholder:"e.g. strawpot-claude-code",readOnly:S,onKeyDown:j=>{j.key==="Enter"&&_()}})]}),g&&d.jsxs("details",{className:"text-sm",children:[d.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),d.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:g})]})]}),d.jsx(Fj,{children:(m==null?void 0:m.status)==="success"?d.jsx(Me,{onClick:()=>C(!1),children:"Done"}):d.jsx(Me,{onClick:_,disabled:!c.trim()||E.isPending,children:E.isPending?"Installing...":"Install"})})]})})}const eI={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function tI({projectId:e,installOpen:t,onInstallOpenChange:r}){const{data:o,isLoading:s}=Kj(e),[l,c]=b.useState(null),[f,m]=b.useState(""),[h,g]=b.useState(!1),[p,v]=b.useState(!1),x=t??p,E=r??v,{data:S}=x9(e,f,l??"",{enabled:h&&!!l&&!!f});return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Resources installed to this project"}),d.jsxs(Me,{onClick:()=>E(!0),size:"sm",children:[d.jsx(Gh,{className:"mr-2 h-4 w-4"}),"Install"]})]}),s?d.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((_,C)=>d.jsx(tn,{className:"h-12 w-full"},C))}):!o||o.length===0?d.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No project resources installed yet."}):d.jsx(An,{children:d.jsx(On,{className:"p-0",children:d.jsxs(ui,{children:[d.jsx(di,{children:d.jsxs(Dn,{children:[d.jsx(Qe,{children:"Name"}),d.jsx(Qe,{children:"Type"}),d.jsx(Qe,{children:"Version"}),d.jsx(Qe,{children:"Description"})]})}),d.jsx(fi,{children:o.map(_=>d.jsxs(Dn,{className:"cursor-pointer",onClick:()=>{c(_.name),m(_.type),g(!0)},children:[d.jsx(Ze,{className:"font-medium",children:_.name}),d.jsx(Ze,{children:d.jsx($t,{variant:"outline",className:"text-xs",children:eI[_.type]??_.type})}),d.jsx(Ze,{className:"text-sm text-muted-foreground",children:_.version??"—"}),d.jsx(Ze,{className:"max-w-[300px] truncate text-sm",children:_.description||"—"})]},`${_.type}-${_.name}`))})]})})}),d.jsx(Zj,{resource:S??null,resourceType:f,open:h,onOpenChange:g,projectId:e}),d.jsx(O0,{open:x,onOpenChange:E,projectId:e})]})}function D0({className:e,orientation:t="horizontal",...r}){return d.jsx(Y8,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Ee("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...r})}const nI=Qh("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function k0({className:e,variant:t="default",...r}){return d.jsx(G8,{"data-slot":"tabs-list","data-variant":t,className:Ee(nI({variant:t}),e),...r})}function Wr({className:e,...t}){return d.jsx(K8,{"data-slot":"tabs-trigger",className:Ee("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Jr({className:e,...t}){return d.jsx(Q8,{"data-slot":"tabs-content",className:Ee("flex-1 outline-none",e),...t})}function rI(){return d.jsxs("div",{className:"space-y-6",children:[d.jsx(tn,{className:"h-8 w-48"}),d.jsx(tn,{className:"h-24 rounded-lg"}),d.jsx(tn,{className:"h-64 rounded-lg"})]})}const tE={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function aI(){const{projectId:e}=by(),t=Number(e),r=Dj(t),[o,s]=b.useState(1),l=sH(t,o),c=Kj(t),[f,m]=b.useState(!1),[h,g]=b.useState(!1),[p,v]=b.useState("sessions"),x=r.isLoading||l.isLoading,E=r.error||l.error;if(x)return d.jsx(rI,{});if(E)return d.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[d.jsx(Zo,{className:"h-4 w-4"}),d.jsxs("span",{children:["Error: ",E.message]})]});if(!r.data)return d.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[d.jsx(Zo,{className:"h-4 w-4"}),d.jsx("span",{children:"Project not found"})]});const S=r.data,_=l.data,C=(_==null?void 0:_.items)??[],j=(_==null?void 0:_.total)??0,N=_?Math.ceil(_.total/_.per_page):0,R=c.data??[],O=R.reduce((A,D)=>(A[D.type]=(A[D.type]||0)+1,A),{});return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:S.display_name}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Me,{onClick:()=>m(!0),disabled:!S.dir_exists,children:[d.jsx(_0,{className:"mr-2 h-4 w-4"}),"Launch Session"]}),d.jsxs(Me,{variant:"outline",onClick:()=>{v("resources"),g(!0)},children:[d.jsx(Gh,{className:"mr-2 h-4 w-4"}),"Install Resource"]}),d.jsx(Me,{variant:"outline",asChild:!0,children:d.jsxs(Rr,{to:"/projects",children:[d.jsx(xj,{className:"mr-2 h-4 w-4"}),"Back"]})})]})]}),d.jsx(An,{children:d.jsx(On,{className:"pt-6",children:d.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[d.jsx("dt",{className:"font-medium text-muted-foreground",children:"Directory"}),d.jsxs("dd",{className:"flex items-center gap-2 break-all",children:[S.working_dir,S.dir_exists?d.jsx($t,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:"OK"}):d.jsx($t,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Missing"})]}),d.jsx("dt",{className:"font-medium text-muted-foreground",children:"Created"}),d.jsx("dd",{children:new Date(S.created_at).toLocaleString()}),d.jsx("dt",{className:"font-medium text-muted-foreground",children:"Resources"}),d.jsx("dd",{children:R.length===0?d.jsx("span",{className:"text-sm text-muted-foreground",children:"None installed"}):d.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(O).map(([A,D])=>d.jsxs($t,{variant:"secondary",className:"cursor-pointer text-xs",onClick:()=>v("resources"),children:[D," ",D===1?tE[A]??A:`${tE[A]??A}s`]},A))})})]})})}),d.jsx(R9,{projectId:t,open:f,onOpenChange:m}),d.jsx(O0,{open:h,onOpenChange:g,projectId:t}),d.jsxs(D0,{value:p,onValueChange:v,children:[d.jsxs(k0,{children:[d.jsxs(Wr,{value:"sessions",children:["Sessions (",j,")"]}),d.jsxs(Wr,{value:"resources",children:["Resources (",R.length,")"]}),d.jsx(Wr,{value:"files",children:"Files"})]}),d.jsx(Jr,{value:"sessions",className:"mt-4 space-y-3",children:j===0?d.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):d.jsxs(d.Fragment,{children:[d.jsx(An,{children:d.jsx(On,{className:"p-0",children:d.jsx(ny,{sessions:C})})}),d.jsx(S9,{page:o,totalPages:N,onPageChange:s})]})}),d.jsx(Jr,{value:"resources",className:"mt-4",children:d.jsx(tI,{projectId:t,installOpen:h,onInstallOpenChange:g})}),d.jsx(Jr,{value:"files",className:"mt-4",children:d.jsx(A9,{projectId:t})})]})]})}function Pt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,o;r<e.length;r++)(o=Pt(e[r]))!==""&&(t+=(t&&" ")+o);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var oI={value:()=>{}};function Jh(){for(var e=0,t=arguments.length,r={},o;e<t;++e){if(!(o=arguments[e]+"")||o in r||/[\s.]/.test(o))throw new Error("illegal type: "+o);r[o]=[]}return new Uf(r)}function Uf(e){this._=e}function sI(e,t){return e.trim().split(/^|\s+/).map(function(r){var o="",s=r.indexOf(".");if(s>=0&&(o=r.slice(s+1),r=r.slice(0,s)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:o}})}Uf.prototype=Jh.prototype={constructor:Uf,on:function(e,t){var r=this._,o=sI(e+"",r),s,l=-1,c=o.length;if(arguments.length<2){for(;++l<c;)if((s=(e=o[l]).type)&&(s=iI(r[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<c;)if(s=(e=o[l]).type)r[s]=nE(r[s],e.name,t);else if(t==null)for(s in r)r[s]=nE(r[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Uf(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var r=new Array(s),o=0,s,l;o<s;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],o=0,s=l.length;o<s;++o)l[o].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],s=0,l=o.length;s<l;++s)o[s].value.apply(t,r)}};function iI(e,t){for(var r=0,o=e.length,s;r<o;++r)if((s=e[r]).name===t)return s.value}function nE(e,t,r){for(var o=0,s=e.length;o<s;++o)if(e[o].name===t){e[o]=oI,e=e.slice(0,o).concat(e.slice(o+1));break}return r!=null&&e.push({name:t,value:r}),e}var ry="http://www.w3.org/1999/xhtml";const rE={svg:"http://www.w3.org/2000/svg",xhtml:ry,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function em(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),rE.hasOwnProperty(t)?{space:rE[t],local:e}:e}function lI(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===ry&&t.documentElement.namespaceURI===ry?t.createElement(e):t.createElementNS(r,e)}}function cI(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Wj(e){var t=em(e);return(t.local?cI:lI)(t)}function uI(){}function z0(e){return e==null?uI:function(){return this.querySelector(e)}}function dI(e){typeof e!="function"&&(e=z0(e));for(var t=this._groups,r=t.length,o=new Array(r),s=0;s<r;++s)for(var l=t[s],c=l.length,f=o[s]=new Array(c),m,h,g=0;g<c;++g)(m=l[g])&&(h=e.call(m,m.__data__,g,l))&&("__data__"in m&&(h.__data__=m.__data__),f[g]=h);return new Qn(o,this._parents)}function fI(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function hI(){return[]}function Jj(e){return e==null?hI:function(){return this.querySelectorAll(e)}}function mI(e){return function(){return fI(e.apply(this,arguments))}}function pI(e){typeof e=="function"?e=mI(e):e=Jj(e);for(var t=this._groups,r=t.length,o=[],s=[],l=0;l<r;++l)for(var c=t[l],f=c.length,m,h=0;h<f;++h)(m=c[h])&&(o.push(e.call(m,m.__data__,h,c)),s.push(m));return new Qn(o,s)}function eT(e){return function(){return this.matches(e)}}function tT(e){return function(t){return t.matches(e)}}var gI=Array.prototype.find;function vI(e){return function(){return gI.call(this.children,e)}}function yI(){return this.firstElementChild}function xI(e){return this.select(e==null?yI:vI(typeof e=="function"?e:tT(e)))}var bI=Array.prototype.filter;function wI(){return Array.from(this.children)}function SI(e){return function(){return bI.call(this.children,e)}}function EI(e){return this.selectAll(e==null?wI:SI(typeof e=="function"?e:tT(e)))}function _I(e){typeof e!="function"&&(e=eT(e));for(var t=this._groups,r=t.length,o=new Array(r),s=0;s<r;++s)for(var l=t[s],c=l.length,f=o[s]=[],m,h=0;h<c;++h)(m=l[h])&&e.call(m,m.__data__,h,l)&&f.push(m);return new Qn(o,this._parents)}function nT(e){return new Array(e.length)}function CI(){return new Qn(this._enter||this._groups.map(nT),this._parents)}function dh(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}dh.prototype={constructor:dh,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function NI(e){return function(){return e}}function jI(e,t,r,o,s,l){for(var c=0,f,m=t.length,h=l.length;c<h;++c)(f=t[c])?(f.__data__=l[c],o[c]=f):r[c]=new dh(e,l[c]);for(;c<m;++c)(f=t[c])&&(s[c]=f)}function TI(e,t,r,o,s,l,c){var f,m,h=new Map,g=t.length,p=l.length,v=new Array(g),x;for(f=0;f<g;++f)(m=t[f])&&(v[f]=x=c.call(m,m.__data__,f,t)+"",h.has(x)?s[f]=m:h.set(x,m));for(f=0;f<p;++f)x=c.call(e,l[f],f,l)+"",(m=h.get(x))?(o[f]=m,m.__data__=l[f],h.delete(x)):r[f]=new dh(e,l[f]);for(f=0;f<g;++f)(m=t[f])&&h.get(v[f])===m&&(s[f]=m)}function RI(e){return e.__data__}function MI(e,t){if(!arguments.length)return Array.from(this,RI);var r=t?TI:jI,o=this._parents,s=this._groups;typeof e!="function"&&(e=NI(e));for(var l=s.length,c=new Array(l),f=new Array(l),m=new Array(l),h=0;h<l;++h){var g=o[h],p=s[h],v=p.length,x=AI(e.call(g,g&&g.__data__,h,o)),E=x.length,S=f[h]=new Array(E),_=c[h]=new Array(E),C=m[h]=new Array(v);r(g,p,S,_,C,x,t);for(var j=0,N=0,R,O;j<E;++j)if(R=S[j]){for(j>=N&&(N=j+1);!(O=_[N])&&++N<E;);R._next=O||null}}return c=new Qn(c,o),c._enter=f,c._exit=m,c}function AI(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function OI(){return new Qn(this._exit||this._groups.map(nT),this._parents)}function DI(e,t,r){var o=this.enter(),s=this,l=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),r==null?l.remove():r(l),o&&s?o.merge(s).order():s}function kI(e){for(var t=e.selection?e.selection():e,r=this._groups,o=t._groups,s=r.length,l=o.length,c=Math.min(s,l),f=new Array(s),m=0;m<c;++m)for(var h=r[m],g=o[m],p=h.length,v=f[m]=new Array(p),x,E=0;E<p;++E)(x=h[E]||g[E])&&(v[E]=x);for(;m<s;++m)f[m]=r[m];return new Qn(f,this._parents)}function zI(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var o=e[t],s=o.length-1,l=o[s],c;--s>=0;)(c=o[s])&&(l&&c.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(c,l),l=c);return this}function LI(e){e||(e=PI);function t(p,v){return p&&v?e(p.__data__,v.__data__):!p-!v}for(var r=this._groups,o=r.length,s=new Array(o),l=0;l<o;++l){for(var c=r[l],f=c.length,m=s[l]=new Array(f),h,g=0;g<f;++g)(h=c[g])&&(m[g]=h);m.sort(t)}return new Qn(s,this._parents).order()}function PI(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function HI(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function II(){return Array.from(this)}function BI(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var o=e[t],s=0,l=o.length;s<l;++s){var c=o[s];if(c)return c}return null}function UI(){let e=0;for(const t of this)++e;return e}function $I(){return!this.node()}function VI(e){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var s=t[r],l=0,c=s.length,f;l<c;++l)(f=s[l])&&e.call(f,f.__data__,l,s);return this}function qI(e){return function(){this.removeAttribute(e)}}function FI(e){return function(){this.removeAttributeNS(e.space,e.local)}}function XI(e,t){return function(){this.setAttribute(e,t)}}function YI(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function GI(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function KI(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function QI(e,t){var r=em(e);if(arguments.length<2){var o=this.node();return r.local?o.getAttributeNS(r.space,r.local):o.getAttribute(r)}return this.each((t==null?r.local?FI:qI:typeof t=="function"?r.local?KI:GI:r.local?YI:XI)(r,t))}function rT(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ZI(e){return function(){this.style.removeProperty(e)}}function WI(e,t,r){return function(){this.style.setProperty(e,t,r)}}function JI(e,t,r){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,r)}}function eB(e,t,r){return arguments.length>1?this.each((t==null?ZI:typeof t=="function"?JI:WI)(e,t,r??"")):Cl(this.node(),e)}function Cl(e,t){return e.style.getPropertyValue(t)||rT(e).getComputedStyle(e,null).getPropertyValue(t)}function tB(e){return function(){delete this[e]}}function nB(e,t){return function(){this[e]=t}}function rB(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function aB(e,t){return arguments.length>1?this.each((t==null?tB:typeof t=="function"?rB:nB)(e,t)):this.node()[e]}function aT(e){return e.trim().split(/^|\s+/)}function L0(e){return e.classList||new oT(e)}function oT(e){this._node=e,this._names=aT(e.getAttribute("class")||"")}oT.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function sT(e,t){for(var r=L0(e),o=-1,s=t.length;++o<s;)r.add(t[o])}function iT(e,t){for(var r=L0(e),o=-1,s=t.length;++o<s;)r.remove(t[o])}function oB(e){return function(){sT(this,e)}}function sB(e){return function(){iT(this,e)}}function iB(e,t){return function(){(t.apply(this,arguments)?sT:iT)(this,e)}}function lB(e,t){var r=aT(e+"");if(arguments.length<2){for(var o=L0(this.node()),s=-1,l=r.length;++s<l;)if(!o.contains(r[s]))return!1;return!0}return this.each((typeof t=="function"?iB:t?oB:sB)(r,t))}function cB(){this.textContent=""}function uB(e){return function(){this.textContent=e}}function dB(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function fB(e){return arguments.length?this.each(e==null?cB:(typeof e=="function"?dB:uB)(e)):this.node().textContent}function hB(){this.innerHTML=""}function mB(e){return function(){this.innerHTML=e}}function pB(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function gB(e){return arguments.length?this.each(e==null?hB:(typeof e=="function"?pB:mB)(e)):this.node().innerHTML}function vB(){this.nextSibling&&this.parentNode.appendChild(this)}function yB(){return this.each(vB)}function xB(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function bB(){return this.each(xB)}function wB(e){var t=typeof e=="function"?e:Wj(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function SB(){return null}function EB(e,t){var r=typeof e=="function"?e:Wj(e),o=t==null?SB:typeof t=="function"?t:z0(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),o.apply(this,arguments)||null)})}function _B(){var e=this.parentNode;e&&e.removeChild(this)}function CB(){return this.each(_B)}function NB(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jB(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function TB(e){return this.select(e?jB:NB)}function RB(e){return arguments.length?this.property("__data__",e):this.node().__data__}function MB(e){return function(t){e.call(this,t,this.__data__)}}function AB(e){return e.trim().split(/^|\s+/).map(function(t){var r="",o=t.indexOf(".");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{type:t,name:r}})}function OB(e){return function(){var t=this.__on;if(t){for(var r=0,o=-1,s=t.length,l;r<s;++r)l=t[r],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++o]=l;++o?t.length=o:delete this.__on}}}function DB(e,t,r){return function(){var o=this.__on,s,l=MB(t);if(o){for(var c=0,f=o.length;c<f;++c)if((s=o[c]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=l,s.options=r),s.value=t;return}}this.addEventListener(e.type,l,r),s={type:e.type,name:e.name,value:t,listener:l,options:r},o?o.push(s):this.__on=[s]}}function kB(e,t,r){var o=AB(e+""),s,l=o.length,c;if(arguments.length<2){var f=this.node().__on;if(f){for(var m=0,h=f.length,g;m<h;++m)for(s=0,g=f[m];s<l;++s)if((c=o[s]).type===g.type&&c.name===g.name)return g.value}return}for(f=t?DB:OB,s=0;s<l;++s)this.each(f(o[s],t,r));return this}function lT(e,t,r){var o=rT(e),s=o.CustomEvent;typeof s=="function"?s=new s(t,r):(s=o.document.createEvent("Event"),r?(s.initEvent(t,r.bubbles,r.cancelable),s.detail=r.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function zB(e,t){return function(){return lT(this,e,t)}}function LB(e,t){return function(){return lT(this,e,t.apply(this,arguments))}}function PB(e,t){return this.each((typeof t=="function"?LB:zB)(e,t))}function*HB(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var o=e[t],s=0,l=o.length,c;s<l;++s)(c=o[s])&&(yield c)}var cT=[null];function Qn(e,t){this._groups=e,this._parents=t}function Bu(){return new Qn([[document.documentElement]],cT)}function IB(){return this}Qn.prototype=Bu.prototype={constructor:Qn,select:dI,selectAll:pI,selectChild:xI,selectChildren:EI,filter:_I,data:MI,enter:CI,exit:OI,join:DI,merge:kI,selection:IB,order:zI,sort:LI,call:HI,nodes:II,node:BI,size:UI,empty:$I,each:VI,attr:QI,style:eB,property:aB,classed:lB,text:fB,html:gB,raise:yB,lower:bB,append:wB,insert:EB,remove:CB,clone:TB,datum:RB,on:kB,dispatch:PB,[Symbol.iterator]:HB};function Gn(e){return typeof e=="string"?new Qn([[document.querySelector(e)]],[document.documentElement]):new Qn([[e]],cT)}function BB(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _r(e,t){if(e=BB(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var o=r.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const UB={passive:!1},lu={capture:!0,passive:!1};function Zg(e){e.stopImmediatePropagation()}function ol(e){e.preventDefault(),e.stopImmediatePropagation()}function uT(e){var t=e.document.documentElement,r=Gn(e).on("dragstart.drag",ol,lu);"onselectstart"in t?r.on("selectstart.drag",ol,lu):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function dT(e,t){var r=e.document.documentElement,o=Gn(e).on("dragstart.drag",null);t&&(o.on("click.drag",ol,lu),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in r?o.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Ef=e=>()=>e;function ay(e,{sourceEvent:t,subject:r,target:o,identifier:s,active:l,x:c,y:f,dx:m,dy:h,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:g}})}ay.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function $B(e){return!e.ctrlKey&&!e.button}function VB(){return this.parentNode}function qB(e,t){return t??{x:e.x,y:e.y}}function FB(){return navigator.maxTouchPoints||"ontouchstart"in this}function fT(){var e=$B,t=VB,r=qB,o=FB,s={},l=Jh("start","drag","end"),c=0,f,m,h,g,p=0;function v(R){R.on("mousedown.drag",x).filter(o).on("touchstart.drag",_).on("touchmove.drag",C,UB).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(R,O){if(!(g||!e.call(this,R,O))){var A=N(this,t.call(this,R,O),R,O,"mouse");A&&(Gn(R.view).on("mousemove.drag",E,lu).on("mouseup.drag",S,lu),uT(R.view),Zg(R),h=!1,f=R.clientX,m=R.clientY,A("start",R))}}function E(R){if(ol(R),!h){var O=R.clientX-f,A=R.clientY-m;h=O*O+A*A>p}s.mouse("drag",R)}function S(R){Gn(R.view).on("mousemove.drag mouseup.drag",null),dT(R.view,h),ol(R),s.mouse("end",R)}function _(R,O){if(e.call(this,R,O)){var A=R.changedTouches,D=t.call(this,R,O),P=A.length,H,Q;for(H=0;H<P;++H)(Q=N(this,D,R,O,A[H].identifier,A[H]))&&(Zg(R),Q("start",R,A[H]))}}function C(R){var O=R.changedTouches,A=O.length,D,P;for(D=0;D<A;++D)(P=s[O[D].identifier])&&(ol(R),P("drag",R,O[D]))}function j(R){var O=R.changedTouches,A=O.length,D,P;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),D=0;D<A;++D)(P=s[O[D].identifier])&&(Zg(R),P("end",R,O[D]))}function N(R,O,A,D,P,H){var Q=l.copy(),V=_r(H||A,O),q,ee,B;if((B=r.call(R,new ay("beforestart",{sourceEvent:A,target:v,identifier:P,active:c,x:V[0],y:V[1],dx:0,dy:0,dispatch:Q}),D))!=null)return q=B.x-V[0]||0,ee=B.y-V[1]||0,function K(M,I,U){var $=V,X;switch(M){case"start":s[P]=K,X=c++;break;case"end":delete s[P],--c;case"drag":V=_r(U||I,O),X=c;break}Q.call(M,R,new ay(M,{sourceEvent:I,subject:B,target:v,identifier:P,active:X,x:V[0]+q,y:V[1]+ee,dx:V[0]-$[0],dy:V[1]-$[1],dispatch:Q}),D)}}return v.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Ef(!!R),v):e},v.container=function(R){return arguments.length?(t=typeof R=="function"?R:Ef(R),v):t},v.subject=function(R){return arguments.length?(r=typeof R=="function"?R:Ef(R),v):r},v.touchable=function(R){return arguments.length?(o=typeof R=="function"?R:Ef(!!R),v):o},v.on=function(){var R=l.on.apply(l,arguments);return R===l?v:R},v.clickDistance=function(R){return arguments.length?(p=(R=+R)*R,v):Math.sqrt(p)},v}function P0(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function hT(e,t){var r=Object.create(e.prototype);for(var o in t)r[o]=t[o];return r}function Uu(){}var cu=.7,fh=1/cu,sl="\\s*([+-]?\\d+)\\s*",uu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ra="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",XB=/^#([0-9a-f]{3,8})$/,YB=new RegExp(`^rgb\\(${sl},${sl},${sl}\\)$`),GB=new RegExp(`^rgb\\(${ra},${ra},${ra}\\)$`),KB=new RegExp(`^rgba\\(${sl},${sl},${sl},${uu}\\)$`),QB=new RegExp(`^rgba\\(${ra},${ra},${ra},${uu}\\)$`),ZB=new RegExp(`^hsl\\(${uu},${ra},${ra}\\)$`),WB=new RegExp(`^hsla\\(${uu},${ra},${ra},${uu}\\)$`),aE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};P0(Uu,Ws,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oE,formatHex:oE,formatHex8:JB,formatHsl:eU,formatRgb:sE,toString:sE});function oE(){return this.rgb().formatHex()}function JB(){return this.rgb().formatHex8()}function eU(){return mT(this).formatHsl()}function sE(){return this.rgb().formatRgb()}function Ws(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=XB.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?iE(t):r===3?new Mn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?_f(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?_f(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=YB.exec(e))?new Mn(t[1],t[2],t[3],1):(t=GB.exec(e))?new Mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=KB.exec(e))?_f(t[1],t[2],t[3],t[4]):(t=QB.exec(e))?_f(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ZB.exec(e))?uE(t[1],t[2]/100,t[3]/100,1):(t=WB.exec(e))?uE(t[1],t[2]/100,t[3]/100,t[4]):aE.hasOwnProperty(e)?iE(aE[e]):e==="transparent"?new Mn(NaN,NaN,NaN,0):null}function iE(e){return new Mn(e>>16&255,e>>8&255,e&255,1)}function _f(e,t,r,o){return o<=0&&(e=t=r=NaN),new Mn(e,t,r,o)}function tU(e){return e instanceof Uu||(e=Ws(e)),e?(e=e.rgb(),new Mn(e.r,e.g,e.b,e.opacity)):new Mn}function oy(e,t,r,o){return arguments.length===1?tU(e):new Mn(e,t,r,o??1)}function Mn(e,t,r,o){this.r=+e,this.g=+t,this.b=+r,this.opacity=+o}P0(Mn,oy,hT(Uu,{brighter(e){return e=e==null?fh:Math.pow(fh,e),new Mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?cu:Math.pow(cu,e),new Mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mn($s(this.r),$s(this.g),$s(this.b),hh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:lE,formatHex:lE,formatHex8:nU,formatRgb:cE,toString:cE}));function lE(){return`#${Os(this.r)}${Os(this.g)}${Os(this.b)}`}function nU(){return`#${Os(this.r)}${Os(this.g)}${Os(this.b)}${Os((isNaN(this.opacity)?1:this.opacity)*255)}`}function cE(){const e=hh(this.opacity);return`${e===1?"rgb(":"rgba("}${$s(this.r)}, ${$s(this.g)}, ${$s(this.b)}${e===1?")":`, ${e})`}`}function hh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $s(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Os(e){return e=$s(e),(e<16?"0":"")+e.toString(16)}function uE(e,t,r,o){return o<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Cr(e,t,r,o)}function mT(e){if(e instanceof Cr)return new Cr(e.h,e.s,e.l,e.opacity);if(e instanceof Uu||(e=Ws(e)),!e)return new Cr;if(e instanceof Cr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,o=e.b/255,s=Math.min(t,r,o),l=Math.max(t,r,o),c=NaN,f=l-s,m=(l+s)/2;return f?(t===l?c=(r-o)/f+(r<o)*6:r===l?c=(o-t)/f+2:c=(t-r)/f+4,f/=m<.5?l+s:2-l-s,c*=60):f=m>0&&m<1?0:c,new Cr(c,f,m,e.opacity)}function rU(e,t,r,o){return arguments.length===1?mT(e):new Cr(e,t,r,o??1)}function Cr(e,t,r,o){this.h=+e,this.s=+t,this.l=+r,this.opacity=+o}P0(Cr,rU,hT(Uu,{brighter(e){return e=e==null?fh:Math.pow(fh,e),new Cr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cu:Math.pow(cu,e),new Cr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,o=r+(r<.5?r:1-r)*t,s=2*r-o;return new Mn(Wg(e>=240?e-240:e+120,s,o),Wg(e,s,o),Wg(e<120?e+240:e-120,s,o),this.opacity)},clamp(){return new Cr(dE(this.h),Cf(this.s),Cf(this.l),hh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=hh(this.opacity);return`${e===1?"hsl(":"hsla("}${dE(this.h)}, ${Cf(this.s)*100}%, ${Cf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dE(e){return e=(e||0)%360,e<0?e+360:e}function Cf(e){return Math.max(0,Math.min(1,e||0))}function Wg(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const H0=e=>()=>e;function aU(e,t){return function(r){return e+r*t}}function oU(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(o){return Math.pow(e+o*t,r)}}function sU(e){return(e=+e)==1?pT:function(t,r){return r-t?oU(t,r,e):H0(isNaN(t)?r:t)}}function pT(e,t){var r=t-e;return r?aU(e,r):H0(isNaN(e)?t:e)}const mh=(function e(t){var r=sU(t);function o(s,l){var c=r((s=oy(s)).r,(l=oy(l)).r),f=r(s.g,l.g),m=r(s.b,l.b),h=pT(s.opacity,l.opacity);return function(g){return s.r=c(g),s.g=f(g),s.b=m(g),s.opacity=h(g),s+""}}return o.gamma=e,o})(1);function iU(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,o=t.slice(),s;return function(l){for(s=0;s<r;++s)o[s]=e[s]*(1-l)+t[s]*l;return o}}function lU(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cU(e,t){var r=t?t.length:0,o=e?Math.min(r,e.length):0,s=new Array(o),l=new Array(r),c;for(c=0;c<o;++c)s[c]=Zc(e[c],t[c]);for(;c<r;++c)l[c]=t[c];return function(f){for(c=0;c<o;++c)l[c]=s[c](f);return l}}function uU(e,t){var r=new Date;return e=+e,t=+t,function(o){return r.setTime(e*(1-o)+t*o),r}}function Qr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function dU(e,t){var r={},o={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=Zc(e[s],t[s]):o[s]=t[s];return function(l){for(s in r)o[s]=r[s](l);return o}}var sy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Jg=new RegExp(sy.source,"g");function fU(e){return function(){return e}}function hU(e){return function(t){return e(t)+""}}function gT(e,t){var r=sy.lastIndex=Jg.lastIndex=0,o,s,l,c=-1,f=[],m=[];for(e=e+"",t=t+"";(o=sy.exec(e))&&(s=Jg.exec(t));)(l=s.index)>r&&(l=t.slice(r,l),f[c]?f[c]+=l:f[++c]=l),(o=o[0])===(s=s[0])?f[c]?f[c]+=s:f[++c]=s:(f[++c]=null,m.push({i:c,x:Qr(o,s)})),r=Jg.lastIndex;return r<t.length&&(l=t.slice(r),f[c]?f[c]+=l:f[++c]=l),f.length<2?m[0]?hU(m[0].x):fU(t):(t=m.length,function(h){for(var g=0,p;g<t;++g)f[(p=m[g]).i]=p.x(h);return f.join("")})}function Zc(e,t){var r=typeof t,o;return t==null||r==="boolean"?H0(t):(r==="number"?Qr:r==="string"?(o=Ws(t))?(t=o,mh):gT:t instanceof Ws?mh:t instanceof Date?uU:lU(t)?iU:Array.isArray(t)?cU:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?dU:Qr)(e,t)}var fE=180/Math.PI,iy={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vT(e,t,r,o,s,l){var c,f,m;return(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c),(m=e*r+t*o)&&(r-=e*m,o-=t*m),(f=Math.sqrt(r*r+o*o))&&(r/=f,o/=f,m/=f),e*o<t*r&&(e=-e,t=-t,m=-m,c=-c),{translateX:s,translateY:l,rotate:Math.atan2(t,e)*fE,skewX:Math.atan(m)*fE,scaleX:c,scaleY:f}}var Nf;function mU(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?iy:vT(t.a,t.b,t.c,t.d,t.e,t.f)}function pU(e){return e==null||(Nf||(Nf=document.createElementNS("http://www.w3.org/2000/svg","g")),Nf.setAttribute("transform",e),!(e=Nf.transform.baseVal.consolidate()))?iy:(e=e.matrix,vT(e.a,e.b,e.c,e.d,e.e,e.f))}function yT(e,t,r,o){function s(h){return h.length?h.pop()+" ":""}function l(h,g,p,v,x,E){if(h!==p||g!==v){var S=x.push("translate(",null,t,null,r);E.push({i:S-4,x:Qr(h,p)},{i:S-2,x:Qr(g,v)})}else(p||v)&&x.push("translate("+p+t+v+r)}function c(h,g,p,v){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),v.push({i:p.push(s(p)+"rotate(",null,o)-2,x:Qr(h,g)})):g&&p.push(s(p)+"rotate("+g+o)}function f(h,g,p,v){h!==g?v.push({i:p.push(s(p)+"skewX(",null,o)-2,x:Qr(h,g)}):g&&p.push(s(p)+"skewX("+g+o)}function m(h,g,p,v,x,E){if(h!==p||g!==v){var S=x.push(s(x)+"scale(",null,",",null,")");E.push({i:S-4,x:Qr(h,p)},{i:S-2,x:Qr(g,v)})}else(p!==1||v!==1)&&x.push(s(x)+"scale("+p+","+v+")")}return function(h,g){var p=[],v=[];return h=e(h),g=e(g),l(h.translateX,h.translateY,g.translateX,g.translateY,p,v),c(h.rotate,g.rotate,p,v),f(h.skewX,g.skewX,p,v),m(h.scaleX,h.scaleY,g.scaleX,g.scaleY,p,v),h=g=null,function(x){for(var E=-1,S=v.length,_;++E<S;)p[(_=v[E]).i]=_.x(x);return p.join("")}}}var gU=yT(mU,"px, ","px)","deg)"),vU=yT(pU,", ",")",")"),yU=1e-12;function hE(e){return((e=Math.exp(e))+1/e)/2}function xU(e){return((e=Math.exp(e))-1/e)/2}function bU(e){return((e=Math.exp(2*e))-1)/(e+1)}const $f=(function e(t,r,o){function s(l,c){var f=l[0],m=l[1],h=l[2],g=c[0],p=c[1],v=c[2],x=g-f,E=p-m,S=x*x+E*E,_,C;if(S<yU)C=Math.log(v/h)/t,_=function(D){return[f+D*x,m+D*E,h*Math.exp(t*D*C)]};else{var j=Math.sqrt(S),N=(v*v-h*h+o*S)/(2*h*r*j),R=(v*v-h*h-o*S)/(2*v*r*j),O=Math.log(Math.sqrt(N*N+1)-N),A=Math.log(Math.sqrt(R*R+1)-R);C=(A-O)/t,_=function(D){var P=D*C,H=hE(O),Q=h/(r*j)*(H*bU(t*P+O)-xU(O));return[f+Q*x,m+Q*E,h*H/hE(t*P+O)]}}return _.duration=C*1e3*t/Math.SQRT2,_}return s.rho=function(l){var c=Math.max(.001,+l),f=c*c,m=f*f;return e(c,f,m)},s})(Math.SQRT2,2,4);var Nl=0,Kc=0,$c=0,xT=1e3,ph,Qc,gh=0,Js=0,tm=0,du=typeof performance=="object"&&performance.now?performance:Date,bT=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function I0(){return Js||(bT(wU),Js=du.now()+tm)}function wU(){Js=0}function vh(){this._call=this._time=this._next=null}vh.prototype=wT.prototype={constructor:vh,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?I0():+r)+(t==null?0:+t),!this._next&&Qc!==this&&(Qc?Qc._next=this:ph=this,Qc=this),this._call=e,this._time=r,ly()},stop:function(){this._call&&(this._call=null,this._time=1/0,ly())}};function wT(e,t,r){var o=new vh;return o.restart(e,t,r),o}function SU(){I0(),++Nl;for(var e=ph,t;e;)(t=Js-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Nl}function mE(){Js=(gh=du.now())+tm,Nl=Kc=0;try{SU()}finally{Nl=0,_U(),Js=0}}function EU(){var e=du.now(),t=e-gh;t>xT&&(tm-=t,gh=e)}function _U(){for(var e,t=ph,r,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:ph=r);Qc=e,ly(o)}function ly(e){if(!Nl){Kc&&(Kc=clearTimeout(Kc));var t=e-Js;t>24?(e<1/0&&(Kc=setTimeout(mE,e-du.now()-tm)),$c&&($c=clearInterval($c))):($c||(gh=du.now(),$c=setInterval(EU,xT)),Nl=1,bT(mE))}}function pE(e,t,r){var o=new vh;return t=t==null?0:+t,o.restart(s=>{o.stop(),e(s+t)},t,r),o}var CU=Jh("start","end","cancel","interrupt"),NU=[],ST=0,gE=1,cy=2,Vf=3,vE=4,uy=5,qf=6;function nm(e,t,r,o,s,l){var c=e.__transition;if(!c)e.__transition={};else if(r in c)return;jU(e,r,{name:t,index:o,group:s,on:CU,tween:NU,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:ST})}function B0(e,t){var r=zr(e,t);if(r.state>ST)throw new Error("too late; already scheduled");return r}function la(e,t){var r=zr(e,t);if(r.state>Vf)throw new Error("too late; already running");return r}function zr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function jU(e,t,r){var o=e.__transition,s;o[t]=r,r.timer=wT(l,0,r.time);function l(h){r.state=gE,r.timer.restart(c,r.delay,r.time),r.delay<=h&&c(h-r.delay)}function c(h){var g,p,v,x;if(r.state!==gE)return m();for(g in o)if(x=o[g],x.name===r.name){if(x.state===Vf)return pE(c);x.state===vE?(x.state=qf,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete o[g]):+g<t&&(x.state=qf,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete o[g])}if(pE(function(){r.state===Vf&&(r.state=vE,r.timer.restart(f,r.delay,r.time),f(h))}),r.state=cy,r.on.call("start",e,e.__data__,r.index,r.group),r.state===cy){for(r.state=Vf,s=new Array(v=r.tween.length),g=0,p=-1;g<v;++g)(x=r.tween[g].value.call(e,e.__data__,r.index,r.group))&&(s[++p]=x);s.length=p+1}}function f(h){for(var g=h<r.duration?r.ease.call(null,h/r.duration):(r.timer.restart(m),r.state=uy,1),p=-1,v=s.length;++p<v;)s[p].call(e,g);r.state===uy&&(r.on.call("end",e,e.__data__,r.index,r.group),m())}function m(){r.state=qf,r.timer.stop(),delete o[t];for(var h in o)return;delete e.__transition}}function Ff(e,t){var r=e.__transition,o,s,l=!0,c;if(r){t=t==null?null:t+"";for(c in r){if((o=r[c]).name!==t){l=!1;continue}s=o.state>cy&&o.state<uy,o.state=qf,o.timer.stop(),o.on.call(s?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete r[c]}l&&delete e.__transition}}function TU(e){return this.each(function(){Ff(this,e)})}function RU(e,t){var r,o;return function(){var s=la(this,e),l=s.tween;if(l!==r){o=r=l;for(var c=0,f=o.length;c<f;++c)if(o[c].name===t){o=o.slice(),o.splice(c,1);break}}s.tween=o}}function MU(e,t,r){var o,s;if(typeof r!="function")throw new Error;return function(){var l=la(this,e),c=l.tween;if(c!==o){s=(o=c).slice();for(var f={name:t,value:r},m=0,h=s.length;m<h;++m)if(s[m].name===t){s[m]=f;break}m===h&&s.push(f)}l.tween=s}}function AU(e,t){var r=this._id;if(e+="",arguments.length<2){for(var o=zr(this.node(),r).tween,s=0,l=o.length,c;s<l;++s)if((c=o[s]).name===e)return c.value;return null}return this.each((t==null?RU:MU)(r,e,t))}function U0(e,t,r){var o=e._id;return e.each(function(){var s=la(this,o);(s.value||(s.value={}))[t]=r.apply(this,arguments)}),function(s){return zr(s,o).value[t]}}function ET(e,t){var r;return(typeof t=="number"?Qr:t instanceof Ws?mh:(r=Ws(t))?(t=r,mh):gT)(e,t)}function OU(e){return function(){this.removeAttribute(e)}}function DU(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kU(e,t,r){var o,s=r+"",l;return function(){var c=this.getAttribute(e);return c===s?null:c===o?l:l=t(o=c,r)}}function zU(e,t,r){var o,s=r+"",l;return function(){var c=this.getAttributeNS(e.space,e.local);return c===s?null:c===o?l:l=t(o=c,r)}}function LU(e,t,r){var o,s,l;return function(){var c,f=r(this),m;return f==null?void this.removeAttribute(e):(c=this.getAttribute(e),m=f+"",c===m?null:c===o&&m===s?l:(s=m,l=t(o=c,f)))}}function PU(e,t,r){var o,s,l;return function(){var c,f=r(this),m;return f==null?void this.removeAttributeNS(e.space,e.local):(c=this.getAttributeNS(e.space,e.local),m=f+"",c===m?null:c===o&&m===s?l:(s=m,l=t(o=c,f)))}}function HU(e,t){var r=em(e),o=r==="transform"?vU:ET;return this.attrTween(e,typeof t=="function"?(r.local?PU:LU)(r,o,U0(this,"attr."+e,t)):t==null?(r.local?DU:OU)(r):(r.local?zU:kU)(r,o,t))}function IU(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function BU(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function UU(e,t){var r,o;function s(){var l=t.apply(this,arguments);return l!==o&&(r=(o=l)&&BU(e,l)),r}return s._value=t,s}function $U(e,t){var r,o;function s(){var l=t.apply(this,arguments);return l!==o&&(r=(o=l)&&IU(e,l)),r}return s._value=t,s}function VU(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var o=em(e);return this.tween(r,(o.local?UU:$U)(o,t))}function qU(e,t){return function(){B0(this,e).delay=+t.apply(this,arguments)}}function FU(e,t){return t=+t,function(){B0(this,e).delay=t}}function XU(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qU:FU)(t,e)):zr(this.node(),t).delay}function YU(e,t){return function(){la(this,e).duration=+t.apply(this,arguments)}}function GU(e,t){return t=+t,function(){la(this,e).duration=t}}function KU(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?YU:GU)(t,e)):zr(this.node(),t).duration}function QU(e,t){if(typeof t!="function")throw new Error;return function(){la(this,e).ease=t}}function ZU(e){var t=this._id;return arguments.length?this.each(QU(t,e)):zr(this.node(),t).ease}function WU(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;la(this,e).ease=r}}function JU(e){if(typeof e!="function")throw new Error;return this.each(WU(this._id,e))}function e7(e){typeof e!="function"&&(e=eT(e));for(var t=this._groups,r=t.length,o=new Array(r),s=0;s<r;++s)for(var l=t[s],c=l.length,f=o[s]=[],m,h=0;h<c;++h)(m=l[h])&&e.call(m,m.__data__,h,l)&&f.push(m);return new Fa(o,this._parents,this._name,this._id)}function t7(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,o=t.length,s=r.length,l=Math.min(o,s),c=new Array(o),f=0;f<l;++f)for(var m=t[f],h=r[f],g=m.length,p=c[f]=new Array(g),v,x=0;x<g;++x)(v=m[x]||h[x])&&(p[x]=v);for(;f<o;++f)c[f]=t[f];return new Fa(c,this._parents,this._name,this._id)}function n7(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function r7(e,t,r){var o,s,l=n7(t)?B0:la;return function(){var c=l(this,e),f=c.on;f!==o&&(s=(o=f).copy()).on(t,r),c.on=s}}function a7(e,t){var r=this._id;return arguments.length<2?zr(this.node(),r).on.on(e):this.each(r7(r,e,t))}function o7(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function s7(){return this.on("end.remove",o7(this._id))}function i7(e){var t=this._name,r=this._id;typeof e!="function"&&(e=z0(e));for(var o=this._groups,s=o.length,l=new Array(s),c=0;c<s;++c)for(var f=o[c],m=f.length,h=l[c]=new Array(m),g,p,v=0;v<m;++v)(g=f[v])&&(p=e.call(g,g.__data__,v,f))&&("__data__"in g&&(p.__data__=g.__data__),h[v]=p,nm(h[v],t,r,v,h,zr(g,r)));return new Fa(l,this._parents,t,r)}function l7(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Jj(e));for(var o=this._groups,s=o.length,l=[],c=[],f=0;f<s;++f)for(var m=o[f],h=m.length,g,p=0;p<h;++p)if(g=m[p]){for(var v=e.call(g,g.__data__,p,m),x,E=zr(g,r),S=0,_=v.length;S<_;++S)(x=v[S])&&nm(x,t,r,S,v,E);l.push(v),c.push(g)}return new Fa(l,c,t,r)}var c7=Bu.prototype.constructor;function u7(){return new c7(this._groups,this._parents)}function d7(e,t){var r,o,s;return function(){var l=Cl(this,e),c=(this.style.removeProperty(e),Cl(this,e));return l===c?null:l===r&&c===o?s:s=t(r=l,o=c)}}function _T(e){return function(){this.style.removeProperty(e)}}function f7(e,t,r){var o,s=r+"",l;return function(){var c=Cl(this,e);return c===s?null:c===o?l:l=t(o=c,r)}}function h7(e,t,r){var o,s,l;return function(){var c=Cl(this,e),f=r(this),m=f+"";return f==null&&(m=f=(this.style.removeProperty(e),Cl(this,e))),c===m?null:c===o&&m===s?l:(s=m,l=t(o=c,f))}}function m7(e,t){var r,o,s,l="style."+t,c="end."+l,f;return function(){var m=la(this,e),h=m.on,g=m.value[l]==null?f||(f=_T(t)):void 0;(h!==r||s!==g)&&(o=(r=h).copy()).on(c,s=g),m.on=o}}function p7(e,t,r){var o=(e+="")=="transform"?gU:ET;return t==null?this.styleTween(e,d7(e,o)).on("end.style."+e,_T(e)):typeof t=="function"?this.styleTween(e,h7(e,o,U0(this,"style."+e,t))).each(m7(this._id,e)):this.styleTween(e,f7(e,o,t),r).on("end.style."+e,null)}function g7(e,t,r){return function(o){this.style.setProperty(e,t.call(this,o),r)}}function v7(e,t,r){var o,s;function l(){var c=t.apply(this,arguments);return c!==s&&(o=(s=c)&&g7(e,c,r)),o}return l._value=t,l}function y7(e,t,r){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,v7(e,t,r??""))}function x7(e){return function(){this.textContent=e}}function b7(e){return function(){var t=e(this);this.textContent=t??""}}function w7(e){return this.tween("text",typeof e=="function"?b7(U0(this,"text",e)):x7(e==null?"":e+""))}function S7(e){return function(t){this.textContent=e.call(this,t)}}function E7(e){var t,r;function o(){var s=e.apply(this,arguments);return s!==r&&(t=(r=s)&&S7(s)),t}return o._value=e,o}function _7(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,E7(e))}function C7(){for(var e=this._name,t=this._id,r=CT(),o=this._groups,s=o.length,l=0;l<s;++l)for(var c=o[l],f=c.length,m,h=0;h<f;++h)if(m=c[h]){var g=zr(m,t);nm(m,e,r,h,c,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Fa(o,this._parents,e,r)}function N7(){var e,t,r=this,o=r._id,s=r.size();return new Promise(function(l,c){var f={value:c},m={value:function(){--s===0&&l()}};r.each(function(){var h=la(this,o),g=h.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(m)),h.on=t}),s===0&&l()})}var j7=0;function Fa(e,t,r,o){this._groups=e,this._parents=t,this._name=r,this._id=o}function CT(){return++j7}var Da=Bu.prototype;Fa.prototype={constructor:Fa,select:i7,selectAll:l7,selectChild:Da.selectChild,selectChildren:Da.selectChildren,filter:e7,merge:t7,selection:u7,transition:C7,call:Da.call,nodes:Da.nodes,node:Da.node,size:Da.size,empty:Da.empty,each:Da.each,on:a7,attr:HU,attrTween:VU,style:p7,styleTween:y7,text:w7,textTween:_7,remove:s7,tween:AU,delay:XU,duration:KU,ease:ZU,easeVarying:JU,end:N7,[Symbol.iterator]:Da[Symbol.iterator]};function T7(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var R7={time:null,delay:0,duration:250,ease:T7};function M7(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function A7(e){var t,r;e instanceof Fa?(t=e._id,e=e._name):(t=CT(),(r=R7).time=I0(),e=e==null?null:e+"");for(var o=this._groups,s=o.length,l=0;l<s;++l)for(var c=o[l],f=c.length,m,h=0;h<f;++h)(m=c[h])&&nm(m,e,t,h,c,r||M7(m,t));return new Fa(o,this._parents,e,t)}Bu.prototype.interrupt=TU;Bu.prototype.transition=A7;const jf=e=>()=>e;function O7(e,{sourceEvent:t,target:r,transform:o,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:s}})}function Ia(e,t,r){this.k=e,this.x=t,this.y=r}Ia.prototype={constructor:Ia,scale:function(e){return e===1?this:new Ia(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ia(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var rm=new Ia(1,0,0);NT.prototype=Ia.prototype;function NT(e){for(;!e.__zoom;)if(!(e=e.parentNode))return rm;return e.__zoom}function ev(e){e.stopImmediatePropagation()}function Vc(e){e.preventDefault(),e.stopImmediatePropagation()}function D7(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function k7(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function yE(){return this.__zoom||rm}function z7(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function L7(){return navigator.maxTouchPoints||"ontouchstart"in this}function P7(e,t,r){var o=e.invertX(t[0][0])-r[0][0],s=e.invertX(t[1][0])-r[1][0],l=e.invertY(t[0][1])-r[0][1],c=e.invertY(t[1][1])-r[1][1];return e.translate(s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s),c>l?(l+c)/2:Math.min(0,l)||Math.max(0,c))}function jT(){var e=D7,t=k7,r=P7,o=z7,s=L7,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,m=$f,h=Jh("start","zoom","end"),g,p,v,x=500,E=150,S=0,_=10;function C(B){B.property("__zoom",yE).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",H).on("dblclick.zoom",Q).filter(s).on("touchstart.zoom",V).on("touchmove.zoom",q).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(B,K,M,I){var U=B.selection?B.selection():B;U.property("__zoom",yE),B!==U?O(B,K,M,I):U.interrupt().each(function(){A(this,arguments).event(I).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},C.scaleBy=function(B,K,M,I){C.scaleTo(B,function(){var U=this.__zoom.k,$=typeof K=="function"?K.apply(this,arguments):K;return U*$},M,I)},C.scaleTo=function(B,K,M,I){C.transform(B,function(){var U=t.apply(this,arguments),$=this.__zoom,X=M==null?R(U):typeof M=="function"?M.apply(this,arguments):M,k=$.invert(X),L=typeof K=="function"?K.apply(this,arguments):K;return r(N(j($,L),X,k),U,c)},M,I)},C.translateBy=function(B,K,M,I){C.transform(B,function(){return r(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),c)},null,I)},C.translateTo=function(B,K,M,I,U){C.transform(B,function(){var $=t.apply(this,arguments),X=this.__zoom,k=I==null?R($):typeof I=="function"?I.apply(this,arguments):I;return r(rm.translate(k[0],k[1]).scale(X.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof M=="function"?-M.apply(this,arguments):-M),$,c)},I,U)};function j(B,K){return K=Math.max(l[0],Math.min(l[1],K)),K===B.k?B:new Ia(K,B.x,B.y)}function N(B,K,M){var I=K[0]-M[0]*B.k,U=K[1]-M[1]*B.k;return I===B.x&&U===B.y?B:new Ia(B.k,I,U)}function R(B){return[(+B[0][0]+ +B[1][0])/2,(+B[0][1]+ +B[1][1])/2]}function O(B,K,M,I){B.on("start.zoom",function(){A(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(I).end()}).tween("zoom",function(){var U=this,$=arguments,X=A(U,$).event(I),k=t.apply(U,$),L=M==null?R(k):typeof M=="function"?M.apply(U,$):M,Y=Math.max(k[1][0]-k[0][0],k[1][1]-k[0][1]),W=U.__zoom,J=typeof K=="function"?K.apply(U,$):K,se=m(W.invert(L).concat(Y/W.k),J.invert(L).concat(Y/J.k));return function(ne){if(ne===1)ne=J;else{var re=se(ne),le=Y/re[2];ne=new Ia(le,L[0]-re[0]*le,L[1]-re[1]*le)}X.zoom(null,ne)}})}function A(B,K,M){return!M&&B.__zooming||new D(B,K)}function D(B,K){this.that=B,this.args=K,this.active=0,this.sourceEvent=null,this.extent=t.apply(B,K),this.taps=0}D.prototype={event:function(B){return B&&(this.sourceEvent=B),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(B,K){return this.mouse&&B!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&B!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&B!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(B){var K=Gn(this.that).datum();h.call(B,this.that,new O7(B,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:h}),K)}};function P(B,...K){if(!e.apply(this,arguments))return;var M=A(this,K).event(B),I=this.__zoom,U=Math.max(l[0],Math.min(l[1],I.k*Math.pow(2,o.apply(this,arguments)))),$=_r(B);if(M.wheel)(M.mouse[0][0]!==$[0]||M.mouse[0][1]!==$[1])&&(M.mouse[1]=I.invert(M.mouse[0]=$)),clearTimeout(M.wheel);else{if(I.k===U)return;M.mouse=[$,I.invert($)],Ff(this),M.start()}Vc(B),M.wheel=setTimeout(X,E),M.zoom("mouse",r(N(j(I,U),M.mouse[0],M.mouse[1]),M.extent,c));function X(){M.wheel=null,M.end()}}function H(B,...K){if(v||!e.apply(this,arguments))return;var M=B.currentTarget,I=A(this,K,!0).event(B),U=Gn(B.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",Y,!0),$=_r(B,M),X=B.clientX,k=B.clientY;uT(B.view),ev(B),I.mouse=[$,this.__zoom.invert($)],Ff(this),I.start();function L(W){if(Vc(W),!I.moved){var J=W.clientX-X,se=W.clientY-k;I.moved=J*J+se*se>S}I.event(W).zoom("mouse",r(N(I.that.__zoom,I.mouse[0]=_r(W,M),I.mouse[1]),I.extent,c))}function Y(W){U.on("mousemove.zoom mouseup.zoom",null),dT(W.view,I.moved),Vc(W),I.event(W).end()}}function Q(B,...K){if(e.apply(this,arguments)){var M=this.__zoom,I=_r(B.changedTouches?B.changedTouches[0]:B,this),U=M.invert(I),$=M.k*(B.shiftKey?.5:2),X=r(N(j(M,$),I,U),t.apply(this,K),c);Vc(B),f>0?Gn(this).transition().duration(f).call(O,X,I,B):Gn(this).call(C.transform,X,I,B)}}function V(B,...K){if(e.apply(this,arguments)){var M=B.touches,I=M.length,U=A(this,K,B.changedTouches.length===I).event(B),$,X,k,L;for(ev(B),X=0;X<I;++X)k=M[X],L=_r(k,this),L=[L,this.__zoom.invert(L),k.identifier],U.touch0?!U.touch1&&U.touch0[2]!==L[2]&&(U.touch1=L,U.taps=0):(U.touch0=L,$=!0,U.taps=1+!!g);g&&(g=clearTimeout(g)),$&&(U.taps<2&&(p=L[0],g=setTimeout(function(){g=null},x)),Ff(this),U.start())}}function q(B,...K){if(this.__zooming){var M=A(this,K).event(B),I=B.changedTouches,U=I.length,$,X,k,L;for(Vc(B),$=0;$<U;++$)X=I[$],k=_r(X,this),M.touch0&&M.touch0[2]===X.identifier?M.touch0[0]=k:M.touch1&&M.touch1[2]===X.identifier&&(M.touch1[0]=k);if(X=M.that.__zoom,M.touch1){var Y=M.touch0[0],W=M.touch0[1],J=M.touch1[0],se=M.touch1[1],ne=(ne=J[0]-Y[0])*ne+(ne=J[1]-Y[1])*ne,re=(re=se[0]-W[0])*re+(re=se[1]-W[1])*re;X=j(X,Math.sqrt(ne/re)),k=[(Y[0]+J[0])/2,(Y[1]+J[1])/2],L=[(W[0]+se[0])/2,(W[1]+se[1])/2]}else if(M.touch0)k=M.touch0[0],L=M.touch0[1];else return;M.zoom("touch",r(N(X,k,L),M.extent,c))}}function ee(B,...K){if(this.__zooming){var M=A(this,K).event(B),I=B.changedTouches,U=I.length,$,X;for(ev(B),v&&clearTimeout(v),v=setTimeout(function(){v=null},x),$=0;$<U;++$)X=I[$],M.touch0&&M.touch0[2]===X.identifier?delete M.touch0:M.touch1&&M.touch1[2]===X.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(X=_r(X,this),Math.hypot(p[0]-X[0],p[1]-X[1])<_)){var k=Gn(this).on("dblclick.zoom");k&&k.apply(this,arguments)}}}return C.wheelDelta=function(B){return arguments.length?(o=typeof B=="function"?B:jf(+B),C):o},C.filter=function(B){return arguments.length?(e=typeof B=="function"?B:jf(!!B),C):e},C.touchable=function(B){return arguments.length?(s=typeof B=="function"?B:jf(!!B),C):s},C.extent=function(B){return arguments.length?(t=typeof B=="function"?B:jf([[+B[0][0],+B[0][1]],[+B[1][0],+B[1][1]]]),C):t},C.scaleExtent=function(B){return arguments.length?(l[0]=+B[0],l[1]=+B[1],C):[l[0],l[1]]},C.translateExtent=function(B){return arguments.length?(c[0][0]=+B[0][0],c[1][0]=+B[1][0],c[0][1]=+B[0][1],c[1][1]=+B[1][1],C):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},C.constrain=function(B){return arguments.length?(r=B,C):r},C.duration=function(B){return arguments.length?(f=+B,C):f},C.interpolate=function(B){return arguments.length?(m=B,C):m},C.on=function(){var B=h.on.apply(h,arguments);return B===h?C:B},C.clickDistance=function(B){return arguments.length?(S=(B=+B)*B,C):Math.sqrt(S)},C.tapDistance=function(B){return arguments.length?(_=+B,C):_},C}const aa={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:r,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},fu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],TT=["Enter"," ","Escape"],RT={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:r})=>`Moved selected node ${e}. New position, x: ${t}, y: ${r}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var jl;(function(e){e.Strict="strict",e.Loose="loose"})(jl||(jl={}));var Vs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Vs||(Vs={}));var hu;(function(e){e.Partial="partial",e.Full="full"})(hu||(hu={}));const MT={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var zo;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(zo||(zo={}));var Tl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Tl||(Tl={}));var Te;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Te||(Te={}));const xE={[Te.Left]:Te.Right,[Te.Right]:Te.Left,[Te.Top]:Te.Bottom,[Te.Bottom]:Te.Top};function AT(e){return e===null?null:e?"valid":"invalid"}const OT=e=>"id"in e&&"source"in e&&"target"in e,H7=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),$0=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),$u=(e,t=[0,0])=>{const{width:r,height:o}=Ya(e),s=e.origin??t,l=r*s[0],c=o*s[1];return{x:e.position.x-l,y:e.position.y-c}},I7=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((o,s)=>{const l=typeof s=="string";let c=!t.nodeLookup&&!l?s:void 0;t.nodeLookup&&(c=l?t.nodeLookup.get(s):$0(s)?s:t.nodeLookup.get(s.id));const f=c?yh(c,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return am(o,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return om(r)},Vu=(e,t={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(r=am(r,yh(s)),o=!0)}),o?om(r):{x:0,y:0,width:0,height:0}},V0=(e,t,[r,o,s]=[0,0,1],l=!1,c=!1)=>{const f={...Fu(t,[r,o,s]),width:t.width/s,height:t.height/s},m=[];for(const h of e.values()){const{measured:g,selectable:p=!0,hidden:v=!1}=h;if(c&&!p||v)continue;const x=g.width??h.width??h.initialWidth??null,E=g.height??h.height??h.initialHeight??null,S=mu(f,Ml(h)),_=(x??0)*(E??0),C=l&&S>0;(!h.internals.handleBounds||C||S>=_||h.dragging)&&m.push(h)}return m},B7=(e,t)=>{const r=new Set;return e.forEach(o=>{r.add(o.id)}),t.filter(o=>r.has(o.source)||r.has(o.target))};function U7(e,t){const r=new Map,o=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!o||o.has(s.id))&&r.set(s.id,s)}),r}async function $7({nodes:e,width:t,height:r,panZoom:o,minZoom:s,maxZoom:l},c){if(e.size===0)return Promise.resolve(!0);const f=U7(e,c),m=Vu(f),h=q0(m,t,r,(c==null?void 0:c.minZoom)??s,(c==null?void 0:c.maxZoom)??l,(c==null?void 0:c.padding)??.1);return await o.setViewport(h,{duration:c==null?void 0:c.duration,ease:c==null?void 0:c.ease,interpolate:c==null?void 0:c.interpolate}),Promise.resolve(!0)}function DT({nodeId:e,nextPosition:t,nodeLookup:r,nodeOrigin:o=[0,0],nodeExtent:s,onError:l}){const c=r.get(e),f=c.parentId?r.get(c.parentId):void 0,{x:m,y:h}=f?f.internals.positionAbsolute:{x:0,y:0},g=c.origin??o;let p=c.extent||s;if(c.extent==="parent"&&!c.expandParent)if(!f)l==null||l("005",aa.error005());else{const x=f.measured.width,E=f.measured.height;x&&E&&(p=[[m,h],[m+x,h+E]])}else f&&Al(c.extent)&&(p=[[c.extent[0][0]+m,c.extent[0][1]+h],[c.extent[1][0]+m,c.extent[1][1]+h]]);const v=Al(p)?ei(t,p,c.measured):t;return(c.measured.width===void 0||c.measured.height===void 0)&&(l==null||l("015",aa.error015())),{position:{x:v.x-m+(c.measured.width??0)*g[0],y:v.y-h+(c.measured.height??0)*g[1]},positionAbsolute:v}}async function V7({nodesToRemove:e=[],edgesToRemove:t=[],nodes:r,edges:o,onBeforeDelete:s}){const l=new Set(e.map(v=>v.id)),c=[];for(const v of r){if(v.deletable===!1)continue;const x=l.has(v.id),E=!x&&v.parentId&&c.find(S=>S.id===v.parentId);(x||E)&&c.push(v)}const f=new Set(t.map(v=>v.id)),m=o.filter(v=>v.deletable!==!1),g=B7(c,m);for(const v of m)f.has(v.id)&&!g.find(E=>E.id===v.id)&&g.push(v);if(!s)return{edges:g,nodes:c};const p=await s({nodes:c,edges:g});return typeof p=="boolean"?p?{edges:g,nodes:c}:{edges:[],nodes:[]}:p}const Rl=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),ei=(e={x:0,y:0},t,r)=>({x:Rl(e.x,t[0][0],t[1][0]-((r==null?void 0:r.width)??0)),y:Rl(e.y,t[0][1],t[1][1]-((r==null?void 0:r.height)??0))});function kT(e,t,r){const{width:o,height:s}=Ya(r),{x:l,y:c}=r.internals.positionAbsolute;return ei(e,[[l,c],[l+o,c+s]],t)}const bE=(e,t,r)=>e<t?Rl(Math.abs(e-t),1,t)/t:e>r?-Rl(Math.abs(e-r),1,t)/t:0,zT=(e,t,r=15,o=40)=>{const s=bE(e.x,o,t.width-o)*r,l=bE(e.y,o,t.height-o)*r;return[s,l]},am=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),dy=({x:e,y:t,width:r,height:o})=>({x:e,y:t,x2:e+r,y2:t+o}),om=({x:e,y:t,x2:r,y2:o})=>({x:e,y:t,width:r-e,height:o-t}),Ml=(e,t=[0,0])=>{var s,l;const{x:r,y:o}=$0(e)?e.internals.positionAbsolute:$u(e,t);return{x:r,y:o,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},yh=(e,t=[0,0])=>{var s,l;const{x:r,y:o}=$0(e)?e.internals.positionAbsolute:$u(e,t);return{x:r,y:o,x2:r+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:o+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},LT=(e,t)=>om(am(dy(e),dy(t))),mu=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*o)},wE=e=>Nr(e.width)&&Nr(e.height)&&Nr(e.x)&&Nr(e.y),Nr=e=>!isNaN(e)&&isFinite(e),q7=(e,t)=>{},qu=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Fu=({x:e,y:t},[r,o,s],l=!1,c=[1,1])=>{const f={x:(e-r)/s,y:(t-o)/s};return l?qu(f,c):f},xh=({x:e,y:t},[r,o,s])=>({x:e*s+r,y:t*s+o});function Wi(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(t*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function F7(e,t,r){if(typeof e=="string"||typeof e=="number"){const o=Wi(e,r),s=Wi(e,t);return{top:o,right:s,bottom:o,left:s,x:s*2,y:o*2}}if(typeof e=="object"){const o=Wi(e.top??e.y??0,r),s=Wi(e.bottom??e.y??0,r),l=Wi(e.left??e.x??0,t),c=Wi(e.right??e.x??0,t);return{top:o,right:c,bottom:s,left:l,x:l+c,y:o+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function X7(e,t,r,o,s,l){const{x:c,y:f}=xh(e,[t,r,o]),{x:m,y:h}=xh({x:e.x+e.width,y:e.y+e.height},[t,r,o]),g=s-m,p=l-h;return{left:Math.floor(c),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(p)}}const q0=(e,t,r,o,s,l)=>{const c=F7(l,t,r),f=(t-c.x)/e.width,m=(r-c.y)/e.height,h=Math.min(f,m),g=Rl(h,o,s),p=e.x+e.width/2,v=e.y+e.height/2,x=t/2-p*g,E=r/2-v*g,S=X7(e,x,E,g,t,r),_={left:Math.min(S.left-c.left,0),top:Math.min(S.top-c.top,0),right:Math.min(S.right-c.right,0),bottom:Math.min(S.bottom-c.bottom,0)};return{x:x-_.left+_.right,y:E-_.top+_.bottom,zoom:g}},pu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Al(e){return e!=null&&e!=="parent"}function Ya(e){var t,r;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}}function PT(e){var t,r;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight)!==void 0}function HT(e,t={width:0,height:0},r,o,s){const l={...e},c=o.get(r);if(c){const f=c.origin||s;l.x+=c.internals.positionAbsolute.x-(t.width??0)*f[0],l.y+=c.internals.positionAbsolute.y-(t.height??0)*f[1]}return l}function SE(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function Y7(){let e,t;return{promise:new Promise((o,s)=>{e=o,t=s}),resolve:e,reject:t}}function G7(e){return{...RT,...e||{}}}function Wc(e,{snapGrid:t=[0,0],snapToGrid:r=!1,transform:o,containerBounds:s}){const{x:l,y:c}=jr(e),f=Fu({x:l-((s==null?void 0:s.left)??0),y:c-((s==null?void 0:s.top)??0)},o),{x:m,y:h}=r?qu(f,t):f;return{xSnapped:m,ySnapped:h,...f}}const F0=e=>({width:e.offsetWidth,height:e.offsetHeight}),IT=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},K7=["INPUT","SELECT","TEXTAREA"];function BT(e){var o,s;const t=((s=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:K7.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const UT=e=>"clientX"in e,jr=(e,t)=>{var l,c;const r=UT(e),o=r?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,s=r?e.clientY:(c=e.touches)==null?void 0:c[0].clientY;return{x:o-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},EE=(e,t,r,o,s)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(c=>{const f=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:e,nodeId:s,position:c.getAttribute("data-handlepos"),x:(f.left-r.left)/o,y:(f.top-r.top)/o,...F0(c)}})};function $T({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:f}){const m=e*.125+s*.375+c*.375+r*.125,h=t*.125+l*.375+f*.375+o*.125,g=Math.abs(m-e),p=Math.abs(h-t);return[m,h,g,p]}function Tf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function _E({pos:e,x1:t,y1:r,x2:o,y2:s,c:l}){switch(e){case Te.Left:return[t-Tf(t-o,l),r];case Te.Right:return[t+Tf(o-t,l),r];case Te.Top:return[t,r-Tf(r-s,l)];case Te.Bottom:return[t,r+Tf(s-r,l)]}}function VT({sourceX:e,sourceY:t,sourcePosition:r=Te.Bottom,targetX:o,targetY:s,targetPosition:l=Te.Top,curvature:c=.25}){const[f,m]=_E({pos:r,x1:e,y1:t,x2:o,y2:s,c}),[h,g]=_E({pos:l,x1:o,y1:s,x2:e,y2:t,c}),[p,v,x,E]=$T({sourceX:e,sourceY:t,targetX:o,targetY:s,sourceControlX:f,sourceControlY:m,targetControlX:h,targetControlY:g});return[`M${e},${t} C${f},${m} ${h},${g} ${o},${s}`,p,v,x,E]}function qT({sourceX:e,sourceY:t,targetX:r,targetY:o}){const s=Math.abs(r-e)/2,l=r<e?r+s:r-s,c=Math.abs(o-t)/2,f=o<t?o+c:o-c;return[l,f,s,c]}function Q7({sourceNode:e,targetNode:t,selected:r=!1,zIndex:o=0,elevateOnSelect:s=!1,zIndexMode:l="basic"}){if(l==="manual")return o;const c=s&&r?o+1e3:o,f=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return c+f}function Z7({sourceNode:e,targetNode:t,width:r,height:o,transform:s}){const l=am(yh(e),yh(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const c={x:-s[0]/s[2],y:-s[1]/s[2],width:r/s[2],height:o/s[2]};return mu(c,om(l))>0}const W7=({source:e,sourceHandle:t,target:r,targetHandle:o})=>`xy-edge__${e}${t||""}-${r}${o||""}`,J7=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),e$=(e,t,r={})=>{if(!e.source||!e.target)return t;const o=r.getEdgeId||W7;let s;return OT(e)?s={...e}:s={...e,id:o(e)},J7(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function FT({sourceX:e,sourceY:t,targetX:r,targetY:o}){const[s,l,c,f]=qT({sourceX:e,sourceY:t,targetX:r,targetY:o});return[`M ${e},${t}L ${r},${o}`,s,l,c,f]}const CE={[Te.Left]:{x:-1,y:0},[Te.Right]:{x:1,y:0},[Te.Top]:{x:0,y:-1},[Te.Bottom]:{x:0,y:1}},t$=({source:e,sourcePosition:t=Te.Bottom,target:r})=>t===Te.Left||t===Te.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},NE=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function n$({source:e,sourcePosition:t=Te.Bottom,target:r,targetPosition:o=Te.Top,center:s,offset:l,stepPosition:c}){const f=CE[t],m=CE[o],h={x:e.x+f.x*l,y:e.y+f.y*l},g={x:r.x+m.x*l,y:r.y+m.y*l},p=t$({source:h,sourcePosition:t,target:g}),v=p.x!==0?"x":"y",x=p[v];let E=[],S,_;const C={x:0,y:0},j={x:0,y:0},[,,N,R]=qT({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(f[v]*m[v]===-1){v==="x"?(S=s.x??h.x+(g.x-h.x)*c,_=s.y??(h.y+g.y)/2):(S=s.x??(h.x+g.x)/2,_=s.y??h.y+(g.y-h.y)*c);const A=[{x:S,y:h.y},{x:S,y:g.y}],D=[{x:h.x,y:_},{x:g.x,y:_}];f[v]===x?E=v==="x"?A:D:E=v==="x"?D:A}else{const A=[{x:h.x,y:g.y}],D=[{x:g.x,y:h.y}];if(v==="x"?E=f.x===x?D:A:E=f.y===x?A:D,t===o){const q=Math.abs(e[v]-r[v]);if(q<=l){const ee=Math.min(l-1,l-q);f[v]===x?C[v]=(h[v]>e[v]?-1:1)*ee:j[v]=(g[v]>r[v]?-1:1)*ee}}if(t!==o){const q=v==="x"?"y":"x",ee=f[v]===m[q],B=h[q]>g[q],K=h[q]<g[q];(f[v]===1&&(!ee&&B||ee&&K)||f[v]!==1&&(!ee&&K||ee&&B))&&(E=v==="x"?A:D)}const P={x:h.x+C.x,y:h.y+C.y},H={x:g.x+j.x,y:g.y+j.y},Q=Math.max(Math.abs(P.x-E[0].x),Math.abs(H.x-E[0].x)),V=Math.max(Math.abs(P.y-E[0].y),Math.abs(H.y-E[0].y));Q>=V?(S=(P.x+H.x)/2,_=E[0].y):(S=E[0].x,_=(P.y+H.y)/2)}return[[e,{x:h.x+C.x,y:h.y+C.y},...E,{x:g.x+j.x,y:g.y+j.y},r],S,_,N,R]}function r$(e,t,r,o){const s=Math.min(NE(e,t)/2,NE(t,r)/2,o),{x:l,y:c}=t;if(e.x===l&&l===r.x||e.y===c&&c===r.y)return`L${l} ${c}`;if(e.y===c){const h=e.x<r.x?-1:1,g=e.y<r.y?1:-1;return`L ${l+s*h},${c}Q ${l},${c} ${l},${c+s*g}`}const f=e.x<r.x?1:-1,m=e.y<r.y?-1:1;return`L ${l},${c+s*m}Q ${l},${c} ${l+s*f},${c}`}function fy({sourceX:e,sourceY:t,sourcePosition:r=Te.Bottom,targetX:o,targetY:s,targetPosition:l=Te.Top,borderRadius:c=5,centerX:f,centerY:m,offset:h=20,stepPosition:g=.5}){const[p,v,x,E,S]=n$({source:{x:e,y:t},sourcePosition:r,target:{x:o,y:s},targetPosition:l,center:{x:f,y:m},offset:h,stepPosition:g});return[p.reduce((C,j,N)=>{let R="";return N>0&&N<p.length-1?R=r$(p[N-1],j,p[N+1],c):R=`${N===0?"M":"L"}${j.x} ${j.y}`,C+=R,C},""),v,x,E,S]}function jE(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function a$(e){var p;const{sourceNode:t,targetNode:r}=e;if(!jE(t)||!jE(r))return null;const o=t.internals.handleBounds||TE(t.handles),s=r.internals.handleBounds||TE(r.handles),l=RE((o==null?void 0:o.source)??[],e.sourceHandle),c=RE(e.connectionMode===jl.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!l||!c)return(p=e.onError)==null||p.call(e,"008",aa.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=(l==null?void 0:l.position)||Te.Bottom,m=(c==null?void 0:c.position)||Te.Top,h=ti(t,l,f),g=ti(r,c,m);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:m}}function TE(e){if(!e)return null;const t=[],r=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&r.push(o);return{source:t,target:r}}function ti(e,t,r=Te.Left,o=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:c,height:f}=t??Ya(e);if(o)return{x:s+c/2,y:l+f/2};switch((t==null?void 0:t.position)??r){case Te.Top:return{x:s+c/2,y:l};case Te.Right:return{x:s+c,y:l+f/2};case Te.Bottom:return{x:s+c/2,y:l+f};case Te.Left:return{x:s,y:l+f/2}}}function RE(e,t){return e&&(t?e.find(r=>r.id===t):e[0])||null}function hy(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function o$(e,{id:t,defaultColor:r,defaultMarkerStart:o,defaultMarkerEnd:s}){const l=new Set;return e.reduce((c,f)=>([f.markerStart||o,f.markerEnd||s].forEach(m=>{if(m&&typeof m=="object"){const h=hy(m,t);l.has(h)||(c.push({id:h,color:m.color||r,...m}),l.add(h))}}),c),[]).sort((c,f)=>c.id.localeCompare(f.id))}const XT=1e3,s$=10,X0={nodeOrigin:[0,0],nodeExtent:fu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},i$={...X0,checkEquality:!0};function Y0(e,t){const r={...e};for(const o in t)t[o]!==void 0&&(r[o]=t[o]);return r}function l$(e,t,r){const o=Y0(X0,r);for(const s of e.values())if(s.parentId)K0(s,e,t,o);else{const l=$u(s,o.nodeOrigin),c=Al(s.extent)?s.extent:o.nodeExtent,f=ei(l,c,Ya(s));s.internals.positionAbsolute=f}}function c$(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const r=[],o=[];for(const s of e.handles){const l={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?r.push(l):s.type==="target"&&o.push(l)}return{source:r,target:o}}function G0(e){return e==="manual"}function my(e,t,r,o={}){var h,g;const s=Y0(i$,o),l={i:0},c=new Map(t),f=s!=null&&s.elevateNodesOnSelect&&!G0(s.zIndexMode)?XT:0;let m=e.length>0;t.clear(),r.clear();for(const p of e){let v=c.get(p.id);if(s.checkEquality&&p===(v==null?void 0:v.internals.userNode))t.set(p.id,v);else{const x=$u(p,s.nodeOrigin),E=Al(p.extent)?p.extent:s.nodeExtent,S=ei(x,E,Ya(p));v={...s.defaults,...p,measured:{width:(h=p.measured)==null?void 0:h.width,height:(g=p.measured)==null?void 0:g.height},internals:{positionAbsolute:S,handleBounds:c$(p,v),z:YT(p,f,s.zIndexMode),userNode:p}},t.set(p.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(m=!1),p.parentId&&K0(v,t,r,o,l)}return m}function u$(e,t){if(!e.parentId)return;const r=t.get(e.parentId);r?r.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function K0(e,t,r,o,s){const{elevateNodesOnSelect:l,nodeOrigin:c,nodeExtent:f,zIndexMode:m}=Y0(X0,o),h=e.parentId,g=t.get(h);if(!g){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}u$(e,r),s&&!g.parentId&&g.internals.rootParentIndex===void 0&&m==="auto"&&(g.internals.rootParentIndex=++s.i,g.internals.z=g.internals.z+s.i*s$),s&&g.internals.rootParentIndex!==void 0&&(s.i=g.internals.rootParentIndex);const p=l&&!G0(m)?XT:0,{x:v,y:x,z:E}=d$(e,g,c,f,p,m),{positionAbsolute:S}=e.internals,_=v!==S.x||x!==S.y;(_||E!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:_?{x:v,y:x}:S,z:E}})}function YT(e,t,r){const o=Nr(e.zIndex)?e.zIndex:0;return G0(r)?o:o+(e.selected?t:0)}function d$(e,t,r,o,s,l){const{x:c,y:f}=t.internals.positionAbsolute,m=Ya(e),h=$u(e,r),g=Al(e.extent)?ei(h,e.extent,m):h;let p=ei({x:c+g.x,y:f+g.y},o,m);e.extent==="parent"&&(p=kT(p,m,t));const v=YT(e,s,l),x=t.internals.z??0;return{x:p.x,y:p.y,z:x>=v?x+1:v}}function Q0(e,t,r,o=[0,0]){var c;const s=[],l=new Map;for(const f of e){const m=t.get(f.parentId);if(!m)continue;const h=((c=l.get(f.parentId))==null?void 0:c.expandedRect)??Ml(m),g=LT(h,f.rect);l.set(f.parentId,{expandedRect:g,parent:m})}return l.size>0&&l.forEach(({expandedRect:f,parent:m},h)=>{var N;const g=m.internals.positionAbsolute,p=Ya(m),v=m.origin??o,x=f.x<g.x?Math.round(Math.abs(g.x-f.x)):0,E=f.y<g.y?Math.round(Math.abs(g.y-f.y)):0,S=Math.max(p.width,Math.round(f.width)),_=Math.max(p.height,Math.round(f.height)),C=(S-p.width)*v[0],j=(_-p.height)*v[1];(x>0||E>0||C||j)&&(s.push({id:h,type:"position",position:{x:m.position.x-x+C,y:m.position.y-E+j}}),(N=r.get(h))==null||N.forEach(R=>{e.some(O=>O.id===R.id)||s.push({id:R.id,type:"position",position:{x:R.position.x+x,y:R.position.y+E}})})),(p.width<f.width||p.height<f.height||x||E)&&s.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:S+(x?v[0]*x-C:0),height:_+(E?v[1]*E-j:0)}})}),s}function f$(e,t,r,o,s,l,c){const f=o==null?void 0:o.querySelector(".xyflow__viewport");let m=!1;if(!f)return{changes:[],updatedInternals:m};const h=[],g=window.getComputedStyle(f),{m22:p}=new window.DOMMatrixReadOnly(g.transform),v=[];for(const x of e.values()){const E=t.get(x.id);if(!E)continue;if(E.hidden){t.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),m=!0;continue}const S=F0(x.nodeElement),_=E.measured.width!==S.width||E.measured.height!==S.height;if(!!(S.width&&S.height&&(_||!E.internals.handleBounds||x.force))){const j=x.nodeElement.getBoundingClientRect(),N=Al(E.extent)?E.extent:l;let{positionAbsolute:R}=E.internals;E.parentId&&E.extent==="parent"?R=kT(R,S,t.get(E.parentId)):N&&(R=ei(R,N,S));const O={...E,measured:S,internals:{...E.internals,positionAbsolute:R,handleBounds:{source:EE("source",x.nodeElement,j,p,E.id),target:EE("target",x.nodeElement,j,p,E.id)}}};t.set(E.id,O),E.parentId&&K0(O,t,r,{nodeOrigin:s,zIndexMode:c}),m=!0,_&&(h.push({id:E.id,type:"dimensions",dimensions:S}),E.expandParent&&E.parentId&&v.push({id:E.id,parentId:E.parentId,rect:Ml(O,s)}))}}if(v.length>0){const x=Q0(v,t,r,s);h.push(...x)}return{changes:h,updatedInternals:m}}async function h$({delta:e,panZoom:t,transform:r,translateExtent:o,width:s,height:l}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const c=await t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[s,l]],o),f=!!c&&(c.x!==r[0]||c.y!==r[1]||c.k!==r[2]);return Promise.resolve(f)}function ME(e,t,r,o,s,l){let c=s;const f=o.get(c)||new Map;o.set(c,f.set(r,t)),c=`${s}-${e}`;const m=o.get(c)||new Map;if(o.set(c,m.set(r,t)),l){c=`${s}-${e}-${l}`;const h=o.get(c)||new Map;o.set(c,h.set(r,t))}}function GT(e,t,r){e.clear(),t.clear();for(const o of r){const{source:s,target:l,sourceHandle:c=null,targetHandle:f=null}=o,m={edgeId:o.id,source:s,target:l,sourceHandle:c,targetHandle:f},h=`${s}-${c}--${l}-${f}`,g=`${l}-${f}--${s}-${c}`;ME("source",m,g,e,s,c),ME("target",m,h,e,l,f),t.set(o.id,o)}}function KT(e,t){if(!e.parentId)return!1;const r=t.get(e.parentId);return r?r.selected?!0:KT(r,t):!1}function AE(e,t,r){var s;let o=e;do{if((s=o==null?void 0:o.matches)!=null&&s.call(o,t))return!0;if(o===r)return!1;o=o==null?void 0:o.parentElement}while(o);return!1}function m$(e,t,r,o){const s=new Map;for(const[l,c]of e)if((c.selected||c.id===o)&&(!c.parentId||!KT(c,e))&&(c.draggable||t&&typeof c.draggable>"u")){const f=e.get(l);f&&s.set(l,{id:l,position:f.position||{x:0,y:0},distance:{x:r.x-f.internals.positionAbsolute.x,y:r.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return s}function tv({nodeId:e,dragItems:t,nodeLookup:r,dragging:o=!0}){var c,f,m;const s=[];for(const[h,g]of t){const p=(c=r.get(h))==null?void 0:c.internals.userNode;p&&s.push({...p,position:g.position,dragging:o})}if(!e)return[s[0],s];const l=(f=r.get(e))==null?void 0:f.internals.userNode;return[l?{...l,position:((m=t.get(e))==null?void 0:m.position)||l.position,dragging:o}:s[0],s]}function p$({dragItems:e,snapGrid:t,x:r,y:o}){const s=e.values().next().value;if(!s)return null;const l={x:r-s.distance.x,y:o-s.distance.y},c=qu(l,t);return{x:c.x-l.x,y:c.y-l.y}}function g$({onNodeMouseDown:e,getStoreItems:t,onDragStart:r,onDrag:o,onDragStop:s}){let l={x:null,y:null},c=0,f=new Map,m=!1,h={x:0,y:0},g=null,p=!1,v=null,x=!1,E=!1,S=null;function _({noDragClassName:j,handleSelector:N,domNode:R,isSelectable:O,nodeId:A,nodeClickDistance:D=0}){v=Gn(R);function P({x:q,y:ee}){const{nodeLookup:B,nodeExtent:K,snapGrid:M,snapToGrid:I,nodeOrigin:U,onNodeDrag:$,onSelectionDrag:X,onError:k,updateNodePositions:L}=t();l={x:q,y:ee};let Y=!1;const W=f.size>1,J=W&&K?dy(Vu(f)):null,se=W&&I?p$({dragItems:f,snapGrid:M,x:q,y:ee}):null;for(const[ne,re]of f){if(!B.has(ne))continue;let le={x:q-re.distance.x,y:ee-re.distance.y};I&&(le=se?{x:Math.round(le.x+se.x),y:Math.round(le.y+se.y)}:qu(le,M));let ve=null;if(W&&K&&!re.extent&&J){const{positionAbsolute:ye}=re.internals,Ne=ye.x-J.x+K[0][0],Ue=ye.x+re.measured.width-J.x2+K[1][0],ke=ye.y-J.y+K[0][1],nt=ye.y+re.measured.height-J.y2+K[1][1];ve=[[Ne,ke],[Ue,nt]]}const{position:ge,positionAbsolute:he}=DT({nodeId:ne,nextPosition:le,nodeLookup:B,nodeExtent:ve||K,nodeOrigin:U,onError:k});Y=Y||re.position.x!==ge.x||re.position.y!==ge.y,re.position=ge,re.internals.positionAbsolute=he}if(E=E||Y,!!Y&&(L(f,!0),S&&(o||$||!A&&X))){const[ne,re]=tv({nodeId:A,dragItems:f,nodeLookup:B});o==null||o(S,f,ne,re),$==null||$(S,ne,re),A||X==null||X(S,re)}}async function H(){if(!g)return;const{transform:q,panBy:ee,autoPanSpeed:B,autoPanOnNodeDrag:K}=t();if(!K){m=!1,cancelAnimationFrame(c);return}const[M,I]=zT(h,g,B);(M!==0||I!==0)&&(l.x=(l.x??0)-M/q[2],l.y=(l.y??0)-I/q[2],await ee({x:M,y:I})&&P(l)),c=requestAnimationFrame(H)}function Q(q){var W;const{nodeLookup:ee,multiSelectionActive:B,nodesDraggable:K,transform:M,snapGrid:I,snapToGrid:U,selectNodesOnDrag:$,onNodeDragStart:X,onSelectionDragStart:k,unselectNodesAndEdges:L}=t();p=!0,(!$||!O)&&!B&&A&&((W=ee.get(A))!=null&&W.selected||L()),O&&$&&A&&(e==null||e(A));const Y=Wc(q.sourceEvent,{transform:M,snapGrid:I,snapToGrid:U,containerBounds:g});if(l=Y,f=m$(ee,K,Y,A),f.size>0&&(r||X||!A&&k)){const[J,se]=tv({nodeId:A,dragItems:f,nodeLookup:ee});r==null||r(q.sourceEvent,f,J,se),X==null||X(q.sourceEvent,J,se),A||k==null||k(q.sourceEvent,se)}}const V=fT().clickDistance(D).on("start",q=>{const{domNode:ee,nodeDragThreshold:B,transform:K,snapGrid:M,snapToGrid:I}=t();g=(ee==null?void 0:ee.getBoundingClientRect())||null,x=!1,E=!1,S=q.sourceEvent,B===0&&Q(q),l=Wc(q.sourceEvent,{transform:K,snapGrid:M,snapToGrid:I,containerBounds:g}),h=jr(q.sourceEvent,g)}).on("drag",q=>{const{autoPanOnNodeDrag:ee,transform:B,snapGrid:K,snapToGrid:M,nodeDragThreshold:I,nodeLookup:U}=t(),$=Wc(q.sourceEvent,{transform:B,snapGrid:K,snapToGrid:M,containerBounds:g});if(S=q.sourceEvent,(q.sourceEvent.type==="touchmove"&&q.sourceEvent.touches.length>1||A&&!U.has(A))&&(x=!0),!x){if(!m&&ee&&p&&(m=!0,H()),!p){const X=jr(q.sourceEvent,g),k=X.x-h.x,L=X.y-h.y;Math.sqrt(k*k+L*L)>I&&Q(q)}(l.x!==$.xSnapped||l.y!==$.ySnapped)&&f&&p&&(h=jr(q.sourceEvent,g),P($))}}).on("end",q=>{if(!(!p||x)&&(m=!1,p=!1,cancelAnimationFrame(c),f.size>0)){const{nodeLookup:ee,updateNodePositions:B,onNodeDragStop:K,onSelectionDragStop:M}=t();if(E&&(B(f,!1),E=!1),s||K||!A&&M){const[I,U]=tv({nodeId:A,dragItems:f,nodeLookup:ee,dragging:!1});s==null||s(q.sourceEvent,f,I,U),K==null||K(q.sourceEvent,I,U),A||M==null||M(q.sourceEvent,U)}}}).filter(q=>{const ee=q.target;return!q.button&&(!j||!AE(ee,`.${j}`,R))&&(!N||AE(ee,N,R))});v.call(V)}function C(){v==null||v.on(".drag",null)}return{update:_,destroy:C}}function v$(e,t,r){const o=[],s={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const l of t.values())mu(s,Ml(l))>0&&o.push(l);return o}const y$=250;function x$(e,t,r,o){var f,m;let s=[],l=1/0;const c=v$(e,r,t+y$);for(const h of c){const g=[...((f=h.internals.handleBounds)==null?void 0:f.source)??[],...((m=h.internals.handleBounds)==null?void 0:m.target)??[]];for(const p of g){if(o.nodeId===p.nodeId&&o.type===p.type&&o.id===p.id)continue;const{x:v,y:x}=ti(h,p,p.position,!0),E=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(x-e.y,2));E>t||(E<l?(s=[{...p,x:v,y:x}],l=E):E===l&&s.push({...p,x:v,y:x}))}}if(!s.length)return null;if(s.length>1){const h=o.type==="source"?"target":"source";return s.find(g=>g.type===h)??s[0]}return s[0]}function QT(e,t,r,o,s,l=!1){var h,g,p;const c=o.get(e);if(!c)return null;const f=s==="strict"?(h=c.internals.handleBounds)==null?void 0:h[t]:[...((g=c.internals.handleBounds)==null?void 0:g.source)??[],...((p=c.internals.handleBounds)==null?void 0:p.target)??[]],m=(r?f==null?void 0:f.find(v=>v.id===r):f==null?void 0:f[0])??null;return m&&l?{...m,...ti(c,m,m.position,!0)}:m}function ZT(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function b$(e,t){let r=null;return t?r=!0:e&&!t&&(r=!1),r}const WT=()=>!0;function w$(e,{connectionMode:t,connectionRadius:r,handleId:o,nodeId:s,edgeUpdaterType:l,isTarget:c,domNode:f,nodeLookup:m,lib:h,autoPanOnConnect:g,flowId:p,panBy:v,cancelConnection:x,onConnectStart:E,onConnect:S,onConnectEnd:_,isValidConnection:C=WT,onReconnectEnd:j,updateConnection:N,getTransform:R,getFromHandle:O,autoPanSpeed:A,dragThreshold:D=1,handleDomNode:P}){const H=IT(e.target);let Q=0,V;const{x:q,y:ee}=jr(e),B=ZT(l,P),K=f==null?void 0:f.getBoundingClientRect();let M=!1;if(!K||!B)return;const I=QT(s,B,o,m,t);if(!I)return;let U=jr(e,K),$=!1,X=null,k=!1,L=null;function Y(){if(!g||!K)return;const[ge,he]=zT(U,K,A);v({x:ge,y:he}),Q=requestAnimationFrame(Y)}const W={...I,nodeId:s,type:B,position:I.position},J=m.get(s);let ne={inProgress:!0,isValid:null,from:ti(J,W,Te.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:J,to:U,toHandle:null,toPosition:xE[W.position],toNode:null,pointer:U};function re(){M=!0,N(ne),E==null||E(e,{nodeId:s,handleId:o,handleType:B})}D===0&&re();function le(ge){if(!M){const{x:nt,y:an}=jr(ge),st=nt-q,kn=an-ee;if(!(st*st+kn*kn>D*D))return;re()}if(!O()||!W){ve(ge);return}const he=R();U=jr(ge,K),V=x$(Fu(U,he,!1,[1,1]),r,m,W),$||(Y(),$=!0);const ye=JT(ge,{handle:V,connectionMode:t,fromNodeId:s,fromHandleId:o,fromType:c?"target":"source",isValidConnection:C,doc:H,lib:h,flowId:p,nodeLookup:m});L=ye.handleDomNode,X=ye.connection,k=b$(!!V,ye.isValid);const Ne=m.get(s),Ue=Ne?ti(Ne,W,Te.Left,!0):ne.from,ke={...ne,from:Ue,isValid:k,to:ye.toHandle&&k?xh({x:ye.toHandle.x,y:ye.toHandle.y},he):U,toHandle:ye.toHandle,toPosition:k&&ye.toHandle?ye.toHandle.position:xE[W.position],toNode:ye.toHandle?m.get(ye.toHandle.nodeId):null,pointer:U};N(ke),ne=ke}function ve(ge){if(!("touches"in ge&&ge.touches.length>0)){if(M){(V||L)&&X&&k&&(S==null||S(X));const{inProgress:he,...ye}=ne,Ne={...ye,toPosition:ne.toHandle?ne.toPosition:null};_==null||_(ge,Ne),l&&(j==null||j(ge,Ne))}x(),cancelAnimationFrame(Q),$=!1,k=!1,X=null,L=null,H.removeEventListener("mousemove",le),H.removeEventListener("mouseup",ve),H.removeEventListener("touchmove",le),H.removeEventListener("touchend",ve)}}H.addEventListener("mousemove",le),H.addEventListener("mouseup",ve),H.addEventListener("touchmove",le),H.addEventListener("touchend",ve)}function JT(e,{handle:t,connectionMode:r,fromNodeId:o,fromHandleId:s,fromType:l,doc:c,lib:f,flowId:m,isValidConnection:h=WT,nodeLookup:g}){const p=l==="target",v=t?c.querySelector(`.${f}-flow__handle[data-id="${m}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x,y:E}=jr(e),S=c.elementFromPoint(x,E),_=S!=null&&S.classList.contains(`${f}-flow__handle`)?S:v,C={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const j=ZT(void 0,_),N=_.getAttribute("data-nodeid"),R=_.getAttribute("data-handleid"),O=_.classList.contains("connectable"),A=_.classList.contains("connectableend");if(!N||!j)return C;const D={source:p?N:o,sourceHandle:p?R:s,target:p?o:N,targetHandle:p?s:R};C.connection=D;const H=O&&A&&(r===jl.Strict?p&&j==="source"||!p&&j==="target":N!==o||R!==s);C.isValid=H&&h(D),C.toHandle=QT(N,j,R,g,r,!0)}return C}const py={onPointerDown:w$,isValid:JT};function S$({domNode:e,panZoom:t,getTransform:r,getViewScale:o}){const s=Gn(e);function l({translateExtent:f,width:m,height:h,zoomStep:g=1,pannable:p=!0,zoomable:v=!0,inversePan:x=!1}){const E=N=>{if(N.sourceEvent.type!=="wheel"||!t)return;const R=r(),O=N.sourceEvent.ctrlKey&&pu()?10:1,A=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*g,D=R[2]*Math.pow(2,A*O);t.scaleTo(D)};let S=[0,0];const _=N=>{(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")&&(S=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY])},C=N=>{const R=r();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!t)return;const O=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],A=[O[0]-S[0],O[1]-S[1]];S=O;const D=o()*Math.max(R[2],Math.log(R[2]))*(x?-1:1),P={x:R[0]-A[0]*D,y:R[1]-A[1]*D},H=[[0,0],[m,h]];t.setViewportConstrained({x:P.x,y:P.y,zoom:R[2]},H,f)},j=jT().on("start",_).on("zoom",p?C:null).on("zoom.wheel",v?E:null);s.call(j,{})}function c(){s.on("zoom",null)}return{update:l,destroy:c,pointer:_r}}const sm=e=>({x:e.x,y:e.y,zoom:e.k}),nv=({x:e,y:t,zoom:r})=>rm.translate(e,t).scale(r),tl=(e,t)=>e.target.closest(`.${t}`),eR=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),E$=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,rv=(e,t=0,r=E$,o=()=>{})=>{const s=typeof t=="number"&&t>0;return s||o(),s?e.transition().duration(t).ease(r).on("end",o):e},tR=e=>{const t=e.ctrlKey&&pu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function _$({zoomPanValues:e,noWheelClassName:t,d3Selection:r,d3Zoom:o,panOnScrollMode:s,panOnScrollSpeed:l,zoomOnPinch:c,onPanZoomStart:f,onPanZoom:m,onPanZoomEnd:h}){return g=>{if(tl(g,t))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const p=r.property("__zoom").k||1;if(g.ctrlKey&&c){const _=_r(g),C=tR(g),j=p*Math.pow(2,C);o.scaleTo(r,j,_,g);return}const v=g.deltaMode===1?20:1;let x=s===Vs.Vertical?0:g.deltaX*v,E=s===Vs.Horizontal?0:g.deltaY*v;!pu()&&g.shiftKey&&s!==Vs.Vertical&&(x=g.deltaY*v,E=0),o.translateBy(r,-(x/p)*l,-(E/p)*l,{internal:!0});const S=sm(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(m==null||m(g,S),e.panScrollTimeout=setTimeout(()=>{h==null||h(g,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f==null||f(g,S))}}function C$({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:r}){return function(o,s){const l=o.type==="wheel",c=!t&&l&&!o.ctrlKey,f=tl(o,e);if(o.ctrlKey&&l&&f&&o.preventDefault(),c||f)return null;o.preventDefault(),r.call(this,o,s)}}function N$({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:r}){return o=>{var l,c,f;if((l=o.sourceEvent)!=null&&l.internal)return;const s=sm(o.transform);e.mouseButton=((c=o.sourceEvent)==null?void 0:c.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((f=o.sourceEvent)==null?void 0:f.type)==="mousedown"&&t(!0),r&&(r==null||r(o.sourceEvent,s))}}function j$({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:r,onTransformChange:o,onPanZoom:s}){return l=>{var c,f;e.usedRightMouseButton=!!(r&&eR(t,e.mouseButton??0)),(c=l.sourceEvent)!=null&&c.sync||o([l.transform.x,l.transform.y,l.transform.k]),s&&!((f=l.sourceEvent)!=null&&f.internal)&&(s==null||s(l.sourceEvent,sm(l.transform)))}}function T$({zoomPanValues:e,panOnDrag:t,panOnScroll:r,onDraggingChange:o,onPanZoomEnd:s,onPaneContextMenu:l}){return c=>{var f;if(!((f=c.sourceEvent)!=null&&f.internal)&&(e.isZoomingOrPanning=!1,l&&eR(t,e.mouseButton??0)&&!e.usedRightMouseButton&&c.sourceEvent&&l(c.sourceEvent),e.usedRightMouseButton=!1,o(!1),s)){const m=sm(c.transform);e.prevViewport=m,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(c.sourceEvent,m)},r?150:0)}}}function R$({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:r,panOnDrag:o,panOnScroll:s,zoomOnDoubleClick:l,userSelectionActive:c,noWheelClassName:f,noPanClassName:m,lib:h,connectionInProgress:g}){return p=>{var _;const v=e||t,x=r&&p.ctrlKey,E=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(tl(p,`${h}-flow__node`)||tl(p,`${h}-flow__edge`)))return!0;if(!o&&!v&&!s&&!l&&!r||c||g&&!E||tl(p,f)&&E||tl(p,m)&&(!E||s&&E&&!e)||!r&&p.ctrlKey&&E)return!1;if(!r&&p.type==="touchstart"&&((_=p.touches)==null?void 0:_.length)>1)return p.preventDefault(),!1;if(!v&&!s&&!x&&E||!o&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(o)&&!o.includes(p.button)&&p.type==="mousedown")return!1;const S=Array.isArray(o)&&o.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||E)&&S}}function M$({domNode:e,minZoom:t,maxZoom:r,translateExtent:o,viewport:s,onPanZoom:l,onPanZoomStart:c,onPanZoomEnd:f,onDraggingChange:m}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),p=jT().scaleExtent([t,r]).translateExtent(o),v=Gn(e).call(p);j({x:s.x,y:s.y,zoom:Rl(s.zoom,t,r)},[[0,0],[g.width,g.height]],o);const x=v.on("wheel.zoom"),E=v.on("dblclick.zoom");p.wheelDelta(tR);function S(V,q){return v?new Promise(ee=>{p==null||p.interpolate((q==null?void 0:q.interpolate)==="linear"?Zc:$f).transform(rv(v,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>ee(!0)),V)}):Promise.resolve(!1)}function _({noWheelClassName:V,noPanClassName:q,onPaneContextMenu:ee,userSelectionActive:B,panOnScroll:K,panOnDrag:M,panOnScrollMode:I,panOnScrollSpeed:U,preventScrolling:$,zoomOnPinch:X,zoomOnScroll:k,zoomOnDoubleClick:L,zoomActivationKeyPressed:Y,lib:W,onTransformChange:J,connectionInProgress:se,paneClickDistance:ne,selectionOnDrag:re}){B&&!h.isZoomingOrPanning&&C();const le=K&&!Y&&!B;p.clickDistance(re?1/0:!Nr(ne)||ne<0?0:ne);const ve=le?_$({zoomPanValues:h,noWheelClassName:V,d3Selection:v,d3Zoom:p,panOnScrollMode:I,panOnScrollSpeed:U,zoomOnPinch:X,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:f}):C$({noWheelClassName:V,preventScrolling:$,d3ZoomHandler:x});if(v.on("wheel.zoom",ve,{passive:!1}),!B){const he=N$({zoomPanValues:h,onDraggingChange:m,onPanZoomStart:c});p.on("start",he);const ye=j$({zoomPanValues:h,panOnDrag:M,onPaneContextMenu:!!ee,onPanZoom:l,onTransformChange:J});p.on("zoom",ye);const Ne=T$({zoomPanValues:h,panOnDrag:M,panOnScroll:K,onPaneContextMenu:ee,onPanZoomEnd:f,onDraggingChange:m});p.on("end",Ne)}const ge=R$({zoomActivationKeyPressed:Y,panOnDrag:M,zoomOnScroll:k,panOnScroll:K,zoomOnDoubleClick:L,zoomOnPinch:X,userSelectionActive:B,noPanClassName:q,noWheelClassName:V,lib:W,connectionInProgress:se});p.filter(ge),L?v.on("dblclick.zoom",E):v.on("dblclick.zoom",null)}function C(){p.on("zoom",null)}async function j(V,q,ee){const B=nv(V),K=p==null?void 0:p.constrain()(B,q,ee);return K&&await S(K),new Promise(M=>M(K))}async function N(V,q){const ee=nv(V);return await S(ee,q),new Promise(B=>B(ee))}function R(V){if(v){const q=nv(V),ee=v.property("__zoom");(ee.k!==V.zoom||ee.x!==V.x||ee.y!==V.y)&&(p==null||p.transform(v,q,null,{sync:!0}))}}function O(){const V=v?NT(v.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}function A(V,q){return v?new Promise(ee=>{p==null||p.interpolate((q==null?void 0:q.interpolate)==="linear"?Zc:$f).scaleTo(rv(v,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>ee(!0)),V)}):Promise.resolve(!1)}function D(V,q){return v?new Promise(ee=>{p==null||p.interpolate((q==null?void 0:q.interpolate)==="linear"?Zc:$f).scaleBy(rv(v,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>ee(!0)),V)}):Promise.resolve(!1)}function P(V){p==null||p.scaleExtent(V)}function H(V){p==null||p.translateExtent(V)}function Q(V){const q=!Nr(V)||V<0?0:V;p==null||p.clickDistance(q)}return{update:_,destroy:C,setViewport:N,setViewportConstrained:j,getViewport:O,scaleTo:A,scaleBy:D,setScaleExtent:P,setTranslateExtent:H,syncViewport:R,setClickDistance:Q}}var Ol;(function(e){e.Line="line",e.Handle="handle"})(Ol||(Ol={}));function A$({width:e,prevWidth:t,height:r,prevHeight:o,affectsX:s,affectsY:l}){const c=e-t,f=r-o,m=[c>0?1:c<0?-1:0,f>0?1:f<0?-1:0];return c&&s&&(m[0]=m[0]*-1),f&&l&&(m[1]=m[1]*-1),m}function OE(e){const t=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),o=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:r,affectsX:o,affectsY:s}}function Mo(e,t){return Math.max(0,t-e)}function Ao(e,t){return Math.max(0,e-t)}function Rf(e,t,r){return Math.max(0,t-e,e-r)}function DE(e,t){return e?!t:t}function O$(e,t,r,o,s,l,c,f){let{affectsX:m,affectsY:h}=t;const{isHorizontal:g,isVertical:p}=t,v=g&&p,{xSnapped:x,ySnapped:E}=r,{minWidth:S,maxWidth:_,minHeight:C,maxHeight:j}=o,{x:N,y:R,width:O,height:A,aspectRatio:D}=e;let P=Math.floor(g?x-e.pointerX:0),H=Math.floor(p?E-e.pointerY:0);const Q=O+(m?-P:P),V=A+(h?-H:H),q=-l[0]*O,ee=-l[1]*A;let B=Rf(Q,S,_),K=Rf(V,C,j);if(c){let U=0,$=0;m&&P<0?U=Mo(N+P+q,c[0][0]):!m&&P>0&&(U=Ao(N+Q+q,c[1][0])),h&&H<0?$=Mo(R+H+ee,c[0][1]):!h&&H>0&&($=Ao(R+V+ee,c[1][1])),B=Math.max(B,U),K=Math.max(K,$)}if(f){let U=0,$=0;m&&P>0?U=Ao(N+P,f[0][0]):!m&&P<0&&(U=Mo(N+Q,f[1][0])),h&&H>0?$=Ao(R+H,f[0][1]):!h&&H<0&&($=Mo(R+V,f[1][1])),B=Math.max(B,U),K=Math.max(K,$)}if(s){if(g){const U=Rf(Q/D,C,j)*D;if(B=Math.max(B,U),c){let $=0;!m&&!h||m&&!h&&v?$=Ao(R+ee+Q/D,c[1][1])*D:$=Mo(R+ee+(m?P:-P)/D,c[0][1])*D,B=Math.max(B,$)}if(f){let $=0;!m&&!h||m&&!h&&v?$=Mo(R+Q/D,f[1][1])*D:$=Ao(R+(m?P:-P)/D,f[0][1])*D,B=Math.max(B,$)}}if(p){const U=Rf(V*D,S,_)/D;if(K=Math.max(K,U),c){let $=0;!m&&!h||h&&!m&&v?$=Ao(N+V*D+q,c[1][0])/D:$=Mo(N+(h?H:-H)*D+q,c[0][0])/D,K=Math.max(K,$)}if(f){let $=0;!m&&!h||h&&!m&&v?$=Mo(N+V*D,f[1][0])/D:$=Ao(N+(h?H:-H)*D,f[0][0])/D,K=Math.max(K,$)}}}H=H+(H<0?K:-K),P=P+(P<0?B:-B),s&&(v?Q>V*D?H=(DE(m,h)?-P:P)/D:P=(DE(m,h)?-H:H)*D:g?(H=P/D,h=m):(P=H*D,m=h));const M=m?N+P:N,I=h?R+H:R;return{width:O+(m?-P:P),height:A+(h?-H:H),x:l[0]*P*(m?-1:1)+M,y:l[1]*H*(h?-1:1)+I}}const nR={width:0,height:0,x:0,y:0},D$={...nR,pointerX:0,pointerY:0,aspectRatio:1};function k$(e){return[[0,0],[e.measured.width,e.measured.height]]}function z$(e,t,r){const o=t.position.x+e.position.x,s=t.position.y+e.position.y,l=e.measured.width??0,c=e.measured.height??0,f=r[0]*l,m=r[1]*c;return[[o-f,s-m],[o+l-f,s+c-m]]}function L$({domNode:e,nodeId:t,getStoreItems:r,onChange:o,onEnd:s}){const l=Gn(e);let c={controlDirection:OE("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:h,boundaries:g,keepAspectRatio:p,resizeDirection:v,onResizeStart:x,onResize:E,onResizeEnd:S,shouldResize:_}){let C={...nR},j={...D$};c={boundaries:g,resizeDirection:v,keepAspectRatio:p,controlDirection:OE(h)};let N,R=null,O=[],A,D,P,H=!1;const Q=fT().on("start",V=>{const{nodeLookup:q,transform:ee,snapGrid:B,snapToGrid:K,nodeOrigin:M,paneDomNode:I}=r();if(N=q.get(t),!N)return;R=(I==null?void 0:I.getBoundingClientRect())??null;const{xSnapped:U,ySnapped:$}=Wc(V.sourceEvent,{transform:ee,snapGrid:B,snapToGrid:K,containerBounds:R});C={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},j={...C,pointerX:U,pointerY:$,aspectRatio:C.width/C.height},A=void 0,N.parentId&&(N.extent==="parent"||N.expandParent)&&(A=q.get(N.parentId),D=A&&N.extent==="parent"?k$(A):void 0),O=[],P=void 0;for(const[X,k]of q)if(k.parentId===t&&(O.push({id:X,position:{...k.position},extent:k.extent}),k.extent==="parent"||k.expandParent)){const L=z$(k,N,k.origin??M);P?P=[[Math.min(L[0][0],P[0][0]),Math.min(L[0][1],P[0][1])],[Math.max(L[1][0],P[1][0]),Math.max(L[1][1],P[1][1])]]:P=L}x==null||x(V,{...C})}).on("drag",V=>{const{transform:q,snapGrid:ee,snapToGrid:B,nodeOrigin:K}=r(),M=Wc(V.sourceEvent,{transform:q,snapGrid:ee,snapToGrid:B,containerBounds:R}),I=[];if(!N)return;const{x:U,y:$,width:X,height:k}=C,L={},Y=N.origin??K,{width:W,height:J,x:se,y:ne}=O$(j,c.controlDirection,M,c.boundaries,c.keepAspectRatio,Y,D,P),re=W!==X,le=J!==k,ve=se!==U&&re,ge=ne!==$&&le;if(!ve&&!ge&&!re&&!le)return;if((ve||ge||Y[0]===1||Y[1]===1)&&(L.x=ve?se:C.x,L.y=ge?ne:C.y,C.x=L.x,C.y=L.y,O.length>0)){const Ue=se-U,ke=ne-$;for(const nt of O)nt.position={x:nt.position.x-Ue+Y[0]*(W-X),y:nt.position.y-ke+Y[1]*(J-k)},I.push(nt)}if((re||le)&&(L.width=re&&(!c.resizeDirection||c.resizeDirection==="horizontal")?W:C.width,L.height=le&&(!c.resizeDirection||c.resizeDirection==="vertical")?J:C.height,C.width=L.width,C.height=L.height),A&&N.expandParent){const Ue=Y[0]*(L.width??0);L.x&&L.x<Ue&&(C.x=Ue,j.x=j.x-(L.x-Ue));const ke=Y[1]*(L.height??0);L.y&&L.y<ke&&(C.y=ke,j.y=j.y-(L.y-ke))}const he=A$({width:C.width,prevWidth:X,height:C.height,prevHeight:k,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),ye={...C,direction:he};(_==null?void 0:_(V,ye))!==!1&&(H=!0,E==null||E(V,ye),o(L,I))}).on("end",V=>{H&&(S==null||S(V,{...C}),s==null||s({...C}),H=!1)});l.call(Q)}function m(){l.on(".drag",null)}return{update:f,destroy:m}}var av={exports:{}},ov={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var kE;function P$(){if(kE)return ov;kE=1;var e=Nu(),t=t4();function r(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var o=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,l=e.useRef,c=e.useEffect,f=e.useMemo,m=e.useDebugValue;return ov.useSyncExternalStoreWithSelector=function(h,g,p,v,x){var E=l(null);if(E.current===null){var S={hasValue:!1,value:null};E.current=S}else S=E.current;E=f(function(){function C(A){if(!j){if(j=!0,N=A,A=v(A),x!==void 0&&S.hasValue){var D=S.value;if(x(D,A))return R=D}return R=A}if(D=R,o(N,A))return D;var P=v(A);return x!==void 0&&x(D,P)?(N=A,D):(N=A,R=P)}var j=!1,N,R,O=p===void 0?null:p;return[function(){return C(g())},O===null?void 0:function(){return C(O())}]},[g,p,v,x]);var _=s(h,E[0],E[1]);return c(function(){S.hasValue=!0,S.value=_},[_]),m(_),_},ov}var zE;function H$(){return zE||(zE=1,av.exports=P$()),av.exports}var I$=H$();const B$=Eh(I$),U$={},LE=e=>{let t;const r=new Set,o=(g,p)=>{const v=typeof g=="function"?g(t):g;if(!Object.is(v,t)){const x=t;t=p??(typeof v!="object"||v===null)?v:Object.assign({},t,v),r.forEach(E=>E(t,x))}},s=()=>t,m={setState:o,getState:s,getInitialState:()=>h,subscribe:g=>(r.add(g),()=>r.delete(g)),destroy:()=>{(U$?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},h=t=e(o,s,m);return m},$$=e=>e?LE(e):LE,{useDebugValue:V$}=me,{useSyncExternalStoreWithSelector:q$}=B$,F$=e=>e;function rR(e,t=F$,r){const o=q$(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return V$(o),o}const PE=(e,t)=>{const r=$$(e),o=(s,l=t)=>rR(r,s,l);return Object.assign(o,r),o},X$=(e,t)=>e?PE(e,t):PE;function yt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,s]of e)if(!Object.is(s,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const o of r)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const im=b.createContext(null),Y$=im.Provider,aR=aa.error001();function We(e,t){const r=b.useContext(im);if(r===null)throw new Error(aR);return rR(r,e,t)}function xt(){const e=b.useContext(im);if(e===null)throw new Error(aR);return b.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const HE={display:"none"},G$={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},oR="react-flow__node-desc",sR="react-flow__edge-desc",K$="react-flow__aria-live",Q$=e=>e.ariaLiveMessage,Z$=e=>e.ariaLabelConfig;function W$({rfId:e}){const t=We(Q$);return d.jsx("div",{id:`${K$}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:G$,children:t})}function J$({rfId:e,disableKeyboardA11y:t}){const r=We(Z$);return d.jsxs(d.Fragment,{children:[d.jsx("div",{id:`${oR}-${e}`,style:HE,children:t?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),d.jsx("div",{id:`${sR}-${e}`,style:HE,children:r["edge.a11yDescription.default"]}),!t&&d.jsx(W$,{rfId:e})]})}const lm=b.forwardRef(({position:e="top-left",children:t,className:r,style:o,...s},l)=>{const c=`${e}`.split("-");return d.jsx("div",{className:Pt(["react-flow__panel",r,...c]),style:o,ref:l,...s,children:t})});lm.displayName="Panel";function eV({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:d.jsx(lm,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:d.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const tV=e=>{const t=[],r=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&r.push(o);return{selectedNodes:t,selectedEdges:r}},Mf=e=>e.id;function nV(e,t){return yt(e.selectedNodes.map(Mf),t.selectedNodes.map(Mf))&&yt(e.selectedEdges.map(Mf),t.selectedEdges.map(Mf))}function rV({onSelectionChange:e}){const t=xt(),{selectedNodes:r,selectedEdges:o}=We(tV,nV);return b.useEffect(()=>{const s={nodes:r,edges:o};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(l=>l(s))},[r,o,e]),null}const aV=e=>!!e.onSelectionChangeHandlers;function oV({onSelectionChange:e}){const t=We(aV);return e||t?d.jsx(rV,{onSelectionChange:e}):null}const iR=[0,0],sV={x:0,y:0,zoom:1},iV=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],IE=[...iV,"rfId"],lV=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),BE={translateExtent:fu,nodeOrigin:iR,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function cV(e){const{setNodes:t,setEdges:r,setMinZoom:o,setMaxZoom:s,setTranslateExtent:l,setNodeExtent:c,reset:f,setDefaultNodesAndEdges:m}=We(lV,yt),h=xt();b.useEffect(()=>(m(e.defaultNodes,e.defaultEdges),()=>{g.current=BE,f()}),[]);const g=b.useRef(BE);return b.useEffect(()=>{for(const p of IE){const v=e[p],x=g.current[p];v!==x&&(typeof e[p]>"u"||(p==="nodes"?t(v):p==="edges"?r(v):p==="minZoom"?o(v):p==="maxZoom"?s(v):p==="translateExtent"?l(v):p==="nodeExtent"?c(v):p==="ariaLabelConfig"?h.setState({ariaLabelConfig:G7(v)}):p==="fitView"?h.setState({fitViewQueued:v}):p==="fitViewOptions"?h.setState({fitViewOptions:v}):h.setState({[p]:v})))}g.current=e},IE.map(p=>e[p])),null}function UE(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function uV(e){var o;const[t,r]=b.useState(e==="system"?null:e);return b.useEffect(()=>{if(e!=="system"){r(e);return}const s=UE(),l=()=>r(s!=null&&s.matches?"dark":"light");return l(),s==null||s.addEventListener("change",l),()=>{s==null||s.removeEventListener("change",l)}},[e]),t!==null?t:(o=UE())!=null&&o.matches?"dark":"light"}const $E=typeof document<"u"?document:null;function gu(e=null,t={target:$E,actInsideInputWithModifier:!0}){const[r,o]=b.useState(!1),s=b.useRef(!1),l=b.useRef(new Set([])),[c,f]=b.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
`).replace(`

`,`
+`).split(`
`)),g=h.reduce((p,v)=>p.concat(...v),[]);return[h,g]}return[[],[]]},[e]);return b.useEffect(()=>{const m=(t==null?void 0:t.target)??$E,h=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const g=x=>{var _,C;if(s.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!s.current||s.current&&!h)&&BT(x))return!1;const S=qE(x.code,f);if(l.current.add(x[S]),VE(c,l.current,!1)){const j=((C=(_=x.composedPath)==null?void 0:_.call(x))==null?void 0:C[0])||x.target,N=(j==null?void 0:j.nodeName)==="BUTTON"||(j==null?void 0:j.nodeName)==="A";t.preventDefault!==!1&&(s.current||!N)&&x.preventDefault(),o(!0)}},p=x=>{const E=qE(x.code,f);VE(c,l.current,!0)?(o(!1),l.current.clear()):l.current.delete(x[E]),x.key==="Meta"&&l.current.clear(),s.current=!1},v=()=>{l.current.clear(),o(!1)};return m==null||m.addEventListener("keydown",g),m==null||m.addEventListener("keyup",p),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{m==null||m.removeEventListener("keydown",g),m==null||m.removeEventListener("keyup",p),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[e,o]),r}function VE(e,t,r){return e.filter(o=>r||o.length===t.size).some(o=>o.every(s=>t.has(s)))}function qE(e,t){return t.includes(e)?"code":"key"}const dV=()=>{const e=xt();return b.useMemo(()=>({zoomIn:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,r)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,r)=>{const{transform:[o,s,l],panZoom:c}=e.getState();return c?(await c.setViewport({x:t.x??o,y:t.y??s,zoom:t.zoom??l},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,r,o]=e.getState().transform;return{x:t,y:r,zoom:o}},setCenter:async(t,r,o)=>e.getState().setCenter(t,r,o),fitBounds:async(t,r)=>{const{width:o,height:s,minZoom:l,maxZoom:c,panZoom:f}=e.getState(),m=q0(t,o,s,l,c,(r==null?void 0:r.padding)??.1);return f?(await f.setViewport(m,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,r={})=>{const{transform:o,snapGrid:s,snapToGrid:l,domNode:c}=e.getState();if(!c)return t;const{x:f,y:m}=c.getBoundingClientRect(),h={x:t.x-f,y:t.y-m},g=r.snapGrid??s,p=r.snapToGrid??l;return Fu(h,o,p,g)},flowToScreenPosition:t=>{const{transform:r,domNode:o}=e.getState();if(!o)return t;const{x:s,y:l}=o.getBoundingClientRect(),c=xh(t,r);return{x:c.x+s,y:c.y+l}}}),[])};function lR(e,t){const r=[],o=new Map,s=[];for(const l of e)if(l.type==="add"){s.push(l);continue}else if(l.type==="remove"||l.type==="replace")o.set(l.id,[l]);else{const c=o.get(l.id);c?c.push(l):o.set(l.id,[l])}for(const l of t){const c=o.get(l.id);if(!c){r.push(l);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){r.push({...c[0].item});continue}const f={...l};for(const m of c)fV(m,f);r.push(f)}return s.length&&s.forEach(l=>{l.index!==void 0?r.splice(l.index,0,{...l.item}):r.push({...l.item})}),r}function fV(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function hV(e,t){return lR(e,t)}function mV(e,t){return lR(e,t)}function Ms(e,t){return{id:e,type:"select",selected:t}}function nl(e,t=new Set,r=!1){const o=[];for(const[s,l]of e){const c=t.has(s);!(l.selected===void 0&&!c)&&l.selected!==c&&(r&&(l.selected=c),o.push(Ms(l.id,c)))}return o}function FE({items:e=[],lookup:t}){var s;const r=[],o=new Map(e.map(l=>[l.id,l]));for(const[l,c]of e.entries()){const f=t.get(c.id),m=((s=f==null?void 0:f.internals)==null?void 0:s.userNode)??f;m!==void 0&&m!==c&&r.push({id:c.id,item:c,type:"replace"}),m===void 0&&r.push({item:c,type:"add",index:l})}for(const[l]of t)o.get(l)===void 0&&r.push({id:l,type:"remove"});return r}function XE(e){return{id:e.id,type:"remove"}}const YE=e=>H7(e),pV=e=>OT(e);function cR(e){return b.forwardRef(e)}const gV=typeof window<"u"?b.useLayoutEffect:b.useEffect;function GE(e){const[t,r]=b.useState(BigInt(0)),[o]=b.useState(()=>vV(()=>r(s=>s+BigInt(1))));return gV(()=>{const s=o.get();s.length&&(e(s),o.reset())},[t]),o}function vV(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:r=>{t.push(r),e()}}}const uR=b.createContext(null);function yV({children:e}){const t=xt(),r=b.useCallback(f=>{const{nodes:m=[],setNodes:h,hasDefaultNodes:g,onNodesChange:p,nodeLookup:v,fitViewQueued:x,onNodesChangeMiddlewareMap:E}=t.getState();let S=m;for(const C of f)S=typeof C=="function"?C(S):C;let _=FE({items:S,lookup:v});for(const C of E.values())_=C(_);g&&h(S),_.length>0?p==null||p(_):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:j,setNodes:N}=t.getState();C&&N(j)})},[]),o=GE(r),s=b.useCallback(f=>{const{edges:m=[],setEdges:h,hasDefaultEdges:g,onEdgesChange:p,edgeLookup:v}=t.getState();let x=m;for(const E of f)x=typeof E=="function"?E(x):E;g?h(x):p&&p(FE({items:x,lookup:v}))},[]),l=GE(s),c=b.useMemo(()=>({nodeQueue:o,edgeQueue:l}),[]);return d.jsx(uR.Provider,{value:c,children:e})}function xV(){const e=b.useContext(uR);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const bV=e=>!!e.panZoom;function cm(){const e=dV(),t=xt(),r=xV(),o=We(bV),s=b.useMemo(()=>{const l=p=>t.getState().nodeLookup.get(p),c=p=>{r.nodeQueue.push(p)},f=p=>{r.edgeQueue.push(p)},m=p=>{var C,j;const{nodeLookup:v,nodeOrigin:x}=t.getState(),E=YE(p)?p:v.get(p.id),S=E.parentId?HT(E.position,E.measured,E.parentId,v,x):E.position,_={...E,position:S,width:((C=E.measured)==null?void 0:C.width)??E.width,height:((j=E.measured)==null?void 0:j.height)??E.height};return Ml(_)},h=(p,v,x={replace:!1})=>{c(E=>E.map(S=>{if(S.id===p){const _=typeof v=="function"?v(S):v;return x.replace&&YE(_)?_:{...S,..._}}return S}))},g=(p,v,x={replace:!1})=>{f(E=>E.map(S=>{if(S.id===p){const _=typeof v=="function"?v(S):v;return x.replace&&pV(_)?_:{...S,..._}}return S}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var v;return(v=l(p))==null?void 0:v.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(v=>({...v}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:c,setEdges:f,addNodes:p=>{const v=Array.isArray(p)?p:[p];r.nodeQueue.push(x=>[...x,...v])},addEdges:p=>{const v=Array.isArray(p)?p:[p];r.edgeQueue.push(x=>[...x,...v])},toObject:()=>{const{nodes:p=[],edges:v=[],transform:x}=t.getState(),[E,S,_]=x;return{nodes:p.map(C=>({...C})),edges:v.map(C=>({...C})),viewport:{x:E,y:S,zoom:_}}},deleteElements:async({nodes:p=[],edges:v=[]})=>{const{nodes:x,edges:E,onNodesDelete:S,onEdgesDelete:_,triggerNodeChanges:C,triggerEdgeChanges:j,onDelete:N,onBeforeDelete:R}=t.getState(),{nodes:O,edges:A}=await V7({nodesToRemove:p,edgesToRemove:v,nodes:x,edges:E,onBeforeDelete:R}),D=A.length>0,P=O.length>0;if(D){const H=A.map(XE);_==null||_(A),j(H)}if(P){const H=O.map(XE);S==null||S(O),C(H)}return(P||D)&&(N==null||N({nodes:O,edges:A})),{deletedNodes:O,deletedEdges:A}},getIntersectingNodes:(p,v=!0,x)=>{const E=wE(p),S=E?p:m(p),_=x!==void 0;return S?(x||t.getState().nodes).filter(C=>{const j=t.getState().nodeLookup.get(C.id);if(j&&!E&&(C.id===p.id||!j.internals.positionAbsolute))return!1;const N=Ml(_?C:j),R=mu(N,S);return v&&R>0||R>=N.width*N.height||R>=S.width*S.height}):[]},isNodeIntersecting:(p,v,x=!0)=>{const S=wE(p)?p:m(p);if(!S)return!1;const _=mu(S,v);return x&&_>0||_>=v.width*v.height||_>=S.width*S.height},updateNode:h,updateNodeData:(p,v,x={replace:!1})=>{h(p,E=>{const S=typeof v=="function"?v(E):v;return x.replace?{...E,data:S}:{...E,data:{...E.data,...S}}},x)},updateEdge:g,updateEdgeData:(p,v,x={replace:!1})=>{g(p,E=>{const S=typeof v=="function"?v(E):v;return x.replace?{...E,data:S}:{...E,data:{...E.data,...S}}},x)},getNodesBounds:p=>{const{nodeLookup:v,nodeOrigin:x}=t.getState();return I7(p,{nodeLookup:v,nodeOrigin:x})},getHandleConnections:({type:p,id:v,nodeId:x})=>{var E;return Array.from(((E=t.getState().connectionLookup.get(`${x}-${p}${v?`-${v}`:""}`))==null?void 0:E.values())??[])},getNodeConnections:({type:p,handleId:v,nodeId:x})=>{var E;return Array.from(((E=t.getState().connectionLookup.get(`${x}${p?v?`-${p}-${v}`:`-${p}`:""}`))==null?void 0:E.values())??[])},fitView:async p=>{const v=t.getState().fitViewResolver??Y7();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:v}),r.nodeQueue.push(x=>[...x]),v.promise}}},[]);return b.useMemo(()=>({...s,...e,viewportInitialized:o}),[o])}const KE=e=>e.selected,wV=typeof window<"u"?window:void 0;function SV({deleteKeyCode:e,multiSelectionKeyCode:t}){const r=xt(),{deleteElements:o}=cm(),s=gu(e,{actInsideInputWithModifier:!1}),l=gu(t,{target:wV});b.useEffect(()=>{if(s){const{edges:c,nodes:f}=r.getState();o({nodes:f.filter(KE),edges:c.filter(KE)}),r.setState({nodesSelectionActive:!1})}},[s]),b.useEffect(()=>{r.setState({multiSelectionActive:l})},[l])}function EV(e){const t=xt();b.useEffect(()=>{const r=()=>{var s,l,c,f;if(!e.current||!(((l=(s=e.current).checkVisibility)==null?void 0:l.call(s))??!0))return!1;const o=F0(e.current);(o.height===0||o.width===0)&&((f=(c=t.getState()).onError)==null||f.call(c,"004",aa.error004())),t.setState({width:o.width||500,height:o.height||500})};if(e.current){r(),window.addEventListener("resize",r);const o=new ResizeObserver(()=>r());return o.observe(e.current),()=>{window.removeEventListener("resize",r),o&&e.current&&o.unobserve(e.current)}}},[])}const um={position:"absolute",width:"100%",height:"100%",top:0,left:0},_V=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function CV({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:r=!0,panOnScroll:o=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=Vs.Free,zoomOnDoubleClick:c=!0,panOnDrag:f=!0,defaultViewport:m,translateExtent:h,minZoom:g,maxZoom:p,zoomActivationKeyCode:v,preventScrolling:x=!0,children:E,noWheelClassName:S,noPanClassName:_,onViewportChange:C,isControlledViewport:j,paneClickDistance:N,selectionOnDrag:R}){const O=xt(),A=b.useRef(null),{userSelectionActive:D,lib:P,connectionInProgress:H}=We(_V,yt),Q=gu(v),V=b.useRef();EV(A);const q=b.useCallback(ee=>{C==null||C({x:ee[0],y:ee[1],zoom:ee[2]}),j||O.setState({transform:ee})},[C,j]);return b.useEffect(()=>{if(A.current){V.current=M$({domNode:A.current,minZoom:g,maxZoom:p,translateExtent:h,viewport:m,onDraggingChange:M=>O.setState(I=>I.paneDragging===M?I:{paneDragging:M}),onPanZoomStart:(M,I)=>{const{onViewportChangeStart:U,onMoveStart:$}=O.getState();$==null||$(M,I),U==null||U(I)},onPanZoom:(M,I)=>{const{onViewportChange:U,onMove:$}=O.getState();$==null||$(M,I),U==null||U(I)},onPanZoomEnd:(M,I)=>{const{onViewportChangeEnd:U,onMoveEnd:$}=O.getState();$==null||$(M,I),U==null||U(I)}});const{x:ee,y:B,zoom:K}=V.current.getViewport();return O.setState({panZoom:V.current,transform:[ee,B,K],domNode:A.current.closest(".react-flow")}),()=>{var M;(M=V.current)==null||M.destroy()}}},[]),b.useEffect(()=>{var ee;(ee=V.current)==null||ee.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:r,panOnScroll:o,panOnScrollSpeed:s,panOnScrollMode:l,zoomOnDoubleClick:c,panOnDrag:f,zoomActivationKeyPressed:Q,preventScrolling:x,noPanClassName:_,userSelectionActive:D,noWheelClassName:S,lib:P,onTransformChange:q,connectionInProgress:H,selectionOnDrag:R,paneClickDistance:N})},[e,t,r,o,s,l,c,f,Q,x,_,D,S,P,q,H,R,N]),d.jsx("div",{className:"react-flow__renderer",ref:A,style:um,children:E})}const NV=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function jV(){const{userSelectionActive:e,userSelectionRect:t}=We(NV,yt);return e&&t?d.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const sv=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},TV=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function RV({isSelecting:e,selectionKeyPressed:t,selectionMode:r=hu.Full,panOnDrag:o,paneClickDistance:s,selectionOnDrag:l,onSelectionStart:c,onSelectionEnd:f,onPaneClick:m,onPaneContextMenu:h,onPaneScroll:g,onPaneMouseEnter:p,onPaneMouseMove:v,onPaneMouseLeave:x,children:E}){const S=xt(),{userSelectionActive:_,elementsSelectable:C,dragging:j,connectionInProgress:N}=We(TV,yt),R=C&&(e||_),O=b.useRef(null),A=b.useRef(),D=b.useRef(new Set),P=b.useRef(new Set),H=b.useRef(!1),Q=U=>{if(H.current||N){H.current=!1;return}m==null||m(U),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},V=U=>{if(Array.isArray(o)&&(o!=null&&o.includes(2))){U.preventDefault();return}h==null||h(U)},q=g?U=>g(U):void 0,ee=U=>{H.current&&(U.stopPropagation(),H.current=!1)},B=U=>{var J,se;const{domNode:$}=S.getState();if(A.current=$==null?void 0:$.getBoundingClientRect(),!A.current)return;const X=U.target===O.current;if(!X&&!!U.target.closest(".nokey")||!e||!(l&&X||t)||U.button!==0||!U.isPrimary)return;(se=(J=U.target)==null?void 0:J.setPointerCapture)==null||se.call(J,U.pointerId),H.current=!1;const{x:Y,y:W}=jr(U.nativeEvent,A.current);S.setState({userSelectionRect:{width:0,height:0,startX:Y,startY:W,x:Y,y:W}}),X||(U.stopPropagation(),U.preventDefault())},K=U=>{const{userSelectionRect:$,transform:X,nodeLookup:k,edgeLookup:L,connectionLookup:Y,triggerNodeChanges:W,triggerEdgeChanges:J,defaultEdgeOptions:se,resetSelectedElements:ne}=S.getState();if(!A.current||!$)return;const{x:re,y:le}=jr(U.nativeEvent,A.current),{startX:ve,startY:ge}=$;if(!H.current){const ke=t?0:s;if(Math.hypot(re-ve,le-ge)<=ke)return;ne(),c==null||c(U)}H.current=!0;const he={startX:ve,startY:ge,x:re<ve?re:ve,y:le<ge?le:ge,width:Math.abs(re-ve),height:Math.abs(le-ge)},ye=D.current,Ne=P.current;D.current=new Set(V0(k,he,X,r===hu.Partial,!0).map(ke=>ke.id)),P.current=new Set;const Ue=(se==null?void 0:se.selectable)??!0;for(const ke of D.current){const nt=Y.get(ke);if(nt)for(const{edgeId:an}of nt.values()){const st=L.get(an);st&&(st.selectable??Ue)&&P.current.add(an)}}if(!SE(ye,D.current)){const ke=nl(k,D.current,!0);W(ke)}if(!SE(Ne,P.current)){const ke=nl(L,P.current);J(ke)}S.setState({userSelectionRect:he,userSelectionActive:!0,nodesSelectionActive:!1})},M=U=>{var $,X;U.button===0&&((X=($=U.target)==null?void 0:$.releasePointerCapture)==null||X.call($,U.pointerId),!_&&U.target===O.current&&S.getState().userSelectionRect&&(Q==null||Q(U)),S.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(f==null||f(U),S.setState({nodesSelectionActive:D.current.size>0})))},I=o===!0||Array.isArray(o)&&o.includes(0);return d.jsxs("div",{className:Pt(["react-flow__pane",{draggable:I,dragging:j,selection:e}]),onClick:R?void 0:sv(Q,O),onContextMenu:sv(V,O),onWheel:sv(q,O),onPointerEnter:R?void 0:p,onPointerMove:R?K:v,onPointerUp:R?M:void 0,onPointerDownCapture:R?B:void 0,onClickCapture:R?ee:void 0,onPointerLeave:x,ref:O,style:um,children:[E,d.jsx(jV,{})]})}function gy({id:e,store:t,unselect:r=!1,nodeRef:o}){const{addSelectedNodes:s,unselectNodesAndEdges:l,multiSelectionActive:c,nodeLookup:f,onError:m}=t.getState(),h=f.get(e);if(!h){m==null||m("012",aa.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(r||h.selected&&c)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var g;return(g=o==null?void 0:o.current)==null?void 0:g.blur()})):s([e])}function dR({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:o,nodeId:s,isSelectable:l,nodeClickDistance:c}){const f=xt(),[m,h]=b.useState(!1),g=b.useRef();return b.useEffect(()=>{g.current=g$({getStoreItems:()=>f.getState(),onNodeMouseDown:p=>{gy({id:p,store:f,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),b.useEffect(()=>{if(!(t||!e.current||!g.current))return g.current.update({noDragClassName:r,handleSelector:o,domNode:e.current,isSelectable:l,nodeId:s,nodeClickDistance:c}),()=>{var p;(p=g.current)==null||p.destroy()}},[r,o,t,l,e,s,c]),m}const MV=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function fR(){const e=xt();return b.useCallback(r=>{const{nodeExtent:o,snapToGrid:s,snapGrid:l,nodesDraggable:c,onError:f,updateNodePositions:m,nodeLookup:h,nodeOrigin:g}=e.getState(),p=new Map,v=MV(c),x=s?l[0]:5,E=s?l[1]:5,S=r.direction.x*x*r.factor,_=r.direction.y*E*r.factor;for(const[,C]of h){if(!v(C))continue;let j={x:C.internals.positionAbsolute.x+S,y:C.internals.positionAbsolute.y+_};s&&(j=qu(j,l));const{position:N,positionAbsolute:R}=DT({nodeId:C.id,nextPosition:j,nodeLookup:h,nodeExtent:o,nodeOrigin:g,onError:f});C.position=N,C.internals.positionAbsolute=R,p.set(C.id,C)}m(p)},[])}const Z0=b.createContext(null),AV=Z0.Provider;Z0.Consumer;const hR=()=>b.useContext(Z0),OV=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),DV=(e,t,r)=>o=>{const{connectionClickStartHandle:s,connectionMode:l,connection:c}=o,{fromHandle:f,toHandle:m,isValid:h}=c,g=(m==null?void 0:m.nodeId)===e&&(m==null?void 0:m.id)===t&&(m==null?void 0:m.type)===r;return{connectingFrom:(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.type)===r,connectingTo:g,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===r,isPossibleEndHandle:l===jl.Strict?(f==null?void 0:f.type)!==r:e!==(f==null?void 0:f.nodeId)||t!==(f==null?void 0:f.id),connectionInProcess:!!f,clickConnectionInProcess:!!s,valid:g&&h}};function kV({type:e="source",position:t=Te.Top,isValidConnection:r,isConnectable:o=!0,isConnectableStart:s=!0,isConnectableEnd:l=!0,id:c,onConnect:f,children:m,className:h,onMouseDown:g,onTouchStart:p,...v},x){var K,M;const E=c||null,S=e==="target",_=xt(),C=hR(),{connectOnClick:j,noPanClassName:N,rfId:R}=We(OV,yt),{connectingFrom:O,connectingTo:A,clickConnecting:D,isPossibleEndHandle:P,connectionInProcess:H,clickConnectionInProcess:Q,valid:V}=We(DV(C,E,e),yt);C||(M=(K=_.getState()).onError)==null||M.call(K,"010",aa.error010());const q=I=>{const{defaultEdgeOptions:U,onConnect:$,hasDefaultEdges:X}=_.getState(),k={...U,...I};if(X){const{edges:L,setEdges:Y}=_.getState();Y(e$(k,L))}$==null||$(k),f==null||f(k)},ee=I=>{if(!C)return;const U=UT(I.nativeEvent);if(s&&(U&&I.button===0||!U)){const $=_.getState();py.onPointerDown(I.nativeEvent,{handleDomNode:I.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:S,handleId:E,nodeId:C,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:(...X)=>{var k,L;return(L=(k=_.getState()).onConnectEnd)==null?void 0:L.call(k,...X)},updateConnection:$.updateConnection,onConnect:q,isValidConnection:r||((...X)=>{var k,L;return((L=(k=_.getState()).isValidConnection)==null?void 0:L.call(k,...X))??!0}),getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}U?g==null||g(I):p==null||p(I)},B=I=>{const{onClickConnectStart:U,onClickConnectEnd:$,connectionClickStartHandle:X,connectionMode:k,isValidConnection:L,lib:Y,rfId:W,nodeLookup:J,connection:se}=_.getState();if(!C||!X&&!s)return;if(!X){U==null||U(I.nativeEvent,{nodeId:C,handleId:E,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:C,type:e,id:E}});return}const ne=IT(I.target),re=r||L,{connection:le,isValid:ve}=py.isValid(I.nativeEvent,{handle:{nodeId:C,id:E,type:e},connectionMode:k,fromNodeId:X.nodeId,fromHandleId:X.id||null,fromType:X.type,isValidConnection:re,flowId:W,doc:ne,lib:Y,nodeLookup:J});ve&&le&&q(le);const ge=structuredClone(se);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,$==null||$(I,ge),_.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":E,"data-nodeid":C,"data-handlepos":t,"data-id":`${R}-${C}-${E}-${e}`,className:Pt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",N,h,{source:!S,target:S,connectable:o,connectablestart:s,connectableend:l,clickconnecting:D,connectingfrom:O,connectingto:A,valid:V,connectionindicator:o&&(!H||P)&&(H||Q?l:s)}]),onMouseDown:ee,onTouchStart:ee,onClick:j?B:void 0,ref:x,...v,children:m})}const Dl=b.memo(cR(kV));function zV({data:e,isConnectable:t,sourcePosition:r=Te.Bottom}){return d.jsxs(d.Fragment,{children:[e==null?void 0:e.label,d.jsx(Dl,{type:"source",position:r,isConnectable:t})]})}function LV({data:e,isConnectable:t,targetPosition:r=Te.Top,sourcePosition:o=Te.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(Dl,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,d.jsx(Dl,{type:"source",position:o,isConnectable:t})]})}function PV(){return null}function HV({data:e,isConnectable:t,targetPosition:r=Te.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(Dl,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label]})}const bh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},QE={input:zV,default:LV,output:HV,group:PV};function IV(e){var t,r,o,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((r=e.style)==null?void 0:r.height)}:{width:e.width??((o=e.style)==null?void 0:o.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const BV=e=>{const{width:t,height:r,x:o,y:s}=Vu(e.nodeLookup,{filter:l=>!!l.selected});return{width:Nr(t)?t:null,height:Nr(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${s}px)`}};function UV({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const o=xt(),{width:s,height:l,transformString:c,userSelectionActive:f}=We(BV,yt),m=fR(),h=b.useRef(null);b.useEffect(()=>{var x;r||(x=h.current)==null||x.focus({preventScroll:!0})},[r]);const g=!f&&s!==null&&l!==null;if(dR({nodeRef:h,disabled:!g}),!g)return null;const p=e?x=>{const E=o.getState().nodes.filter(S=>S.selected);e(x,E)}:void 0,v=x=>{Object.prototype.hasOwnProperty.call(bh,x.key)&&(x.preventDefault(),m({direction:bh[x.key],factor:x.shiftKey?4:1}))};return d.jsx("div",{className:Pt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c},children:d.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:r?void 0:-1,onKeyDown:r?void 0:v,style:{width:s,height:l}})})}const ZE=typeof window<"u"?window:void 0,$V=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function mR({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:c,paneClickDistance:f,deleteKeyCode:m,selectionKeyCode:h,selectionOnDrag:g,selectionMode:p,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:E,panActivationKeyCode:S,zoomActivationKeyCode:_,elementsSelectable:C,zoomOnScroll:j,zoomOnPinch:N,panOnScroll:R,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:D,panOnDrag:P,defaultViewport:H,translateExtent:Q,minZoom:V,maxZoom:q,preventScrolling:ee,onSelectionContextMenu:B,noWheelClassName:K,noPanClassName:M,disableKeyboardA11y:I,onViewportChange:U,isControlledViewport:$}){const{nodesSelectionActive:X,userSelectionActive:k}=We($V,yt),L=gu(h,{target:ZE}),Y=gu(S,{target:ZE}),W=Y||P,J=Y||R,se=g&&W!==!0,ne=L||k||se;return SV({deleteKeyCode:m,multiSelectionKeyCode:E}),d.jsx(CV,{onPaneContextMenu:l,elementsSelectable:C,zoomOnScroll:j,zoomOnPinch:N,panOnScroll:J,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:D,panOnDrag:!L&&W,defaultViewport:H,translateExtent:Q,minZoom:V,maxZoom:q,zoomActivationKeyCode:_,preventScrolling:ee,noWheelClassName:K,noPanClassName:M,onViewportChange:U,isControlledViewport:$,paneClickDistance:f,selectionOnDrag:se,children:d.jsxs(RV,{onSelectionStart:v,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:c,panOnDrag:W,isSelecting:!!ne,selectionMode:p,selectionKeyPressed:L,paneClickDistance:f,selectionOnDrag:se,children:[e,X&&d.jsx(UV,{onSelectionContextMenu:B,noPanClassName:M,disableKeyboardA11y:I})]})})}mR.displayName="FlowRenderer";const VV=b.memo(mR),qV=e=>t=>e?V0(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(r=>r.id):Array.from(t.nodeLookup.keys());function FV(e){return We(b.useCallback(qV(e),[e]),yt)}const XV=e=>e.updateNodeInternals;function YV(){const e=We(XV),[t]=b.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const o=new Map;r.forEach(s=>{const l=s.target.getAttribute("data-id");o.set(l,{id:l,nodeElement:s.target,force:!0})}),e(o)}));return b.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function GV({node:e,nodeType:t,hasDimensions:r,resizeObserver:o}){const s=xt(),l=b.useRef(null),c=b.useRef(null),f=b.useRef(e.sourcePosition),m=b.useRef(e.targetPosition),h=b.useRef(t),g=r&&!!e.internals.handleBounds;return b.useEffect(()=>{l.current&&!e.hidden&&(!g||c.current!==l.current)&&(c.current&&(o==null||o.unobserve(c.current)),o==null||o.observe(l.current),c.current=l.current)},[g,e.hidden]),b.useEffect(()=>()=>{c.current&&(o==null||o.unobserve(c.current),c.current=null)},[]),b.useEffect(()=>{if(l.current){const p=h.current!==t,v=f.current!==e.sourcePosition,x=m.current!==e.targetPosition;(p||v||x)&&(h.current=t,f.current=e.sourcePosition,m.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function KV({id:e,onClick:t,onMouseEnter:r,onMouseMove:o,onMouseLeave:s,onContextMenu:l,onDoubleClick:c,nodesDraggable:f,elementsSelectable:m,nodesConnectable:h,nodesFocusable:g,resizeObserver:p,noDragClassName:v,noPanClassName:x,disableKeyboardA11y:E,rfId:S,nodeTypes:_,nodeClickDistance:C,onError:j}){const{node:N,internals:R,isParent:O}=We(re=>{const le=re.nodeLookup.get(e),ve=re.parentLookup.has(e);return{node:le,internals:le.internals,isParent:ve}},yt);let A=N.type||"default",D=(_==null?void 0:_[A])||QE[A];D===void 0&&(j==null||j("003",aa.error003(A)),A="default",D=(_==null?void 0:_.default)||QE.default);const P=!!(N.draggable||f&&typeof N.draggable>"u"),H=!!(N.selectable||m&&typeof N.selectable>"u"),Q=!!(N.connectable||h&&typeof N.connectable>"u"),V=!!(N.focusable||g&&typeof N.focusable>"u"),q=xt(),ee=PT(N),B=GV({node:N,nodeType:A,hasDimensions:ee,resizeObserver:p}),K=dR({nodeRef:B,disabled:N.hidden||!P,noDragClassName:v,handleSelector:N.dragHandle,nodeId:e,isSelectable:H,nodeClickDistance:C}),M=fR();if(N.hidden)return null;const I=Ya(N),U=IV(N),$=H||P||t||r||o||s,X=r?re=>r(re,{...R.userNode}):void 0,k=o?re=>o(re,{...R.userNode}):void 0,L=s?re=>s(re,{...R.userNode}):void 0,Y=l?re=>l(re,{...R.userNode}):void 0,W=c?re=>c(re,{...R.userNode}):void 0,J=re=>{const{selectNodesOnDrag:le,nodeDragThreshold:ve}=q.getState();H&&(!le||!P||ve>0)&&gy({id:e,store:q,nodeRef:B}),t&&t(re,{...R.userNode})},se=re=>{if(!(BT(re.nativeEvent)||E)){if(TT.includes(re.key)&&H){const le=re.key==="Escape";gy({id:e,store:q,unselect:le,nodeRef:B})}else if(P&&N.selected&&Object.prototype.hasOwnProperty.call(bh,re.key)){re.preventDefault();const{ariaLabelConfig:le}=q.getState();q.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),M({direction:bh[re.key],factor:re.shiftKey?4:1})}}},ne=()=>{var Ne;if(E||!((Ne=B.current)!=null&&Ne.matches(":focus-visible")))return;const{transform:re,width:le,height:ve,autoPanOnNodeFocus:ge,setCenter:he}=q.getState();if(!ge)return;V0(new Map([[e,N]]),{x:0,y:0,width:le,height:ve},re,!0).length>0||he(N.position.x+I.width/2,N.position.y+I.height/2,{zoom:re[2]})};return d.jsx("div",{className:Pt(["react-flow__node",`react-flow__node-${A}`,{[x]:P},N.className,{selected:N.selected,selectable:H,parent:O,draggable:P,dragging:K}]),ref:B,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:ee?"visible":"hidden",...N.style,...U},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:X,onMouseMove:k,onMouseLeave:L,onContextMenu:Y,onClick:J,onDoubleClick:W,onKeyDown:V?se:void 0,tabIndex:V?0:void 0,onFocus:V?ne:void 0,role:N.ariaRole??(V?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${oR}-${S}`,"aria-label":N.ariaLabel,...N.domAttributes,children:d.jsx(AV,{value:e,children:d.jsx(D,{id:e,data:N.data,type:A,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:N.selected??!1,selectable:H,draggable:P,deletable:N.deletable??!0,isConnectable:Q,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:K,dragHandle:N.dragHandle,zIndex:R.z,parentId:N.parentId,...I})})})}var QV=b.memo(KV);const ZV=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function pR(e){const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:o,elementsSelectable:s,onError:l}=We(ZV,yt),c=FV(e.onlyRenderVisibleElements),f=YV();return d.jsx("div",{className:"react-flow__nodes",style:um,children:c.map(m=>d.jsx(QV,{id:m,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:t,nodesConnectable:r,nodesFocusable:o,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:l},m))})}pR.displayName="NodeRenderer";const WV=b.memo(pR);function JV(e){return We(b.useCallback(r=>{if(!e)return r.edges.map(s=>s.id);const o=[];if(r.width&&r.height)for(const s of r.edges){const l=r.nodeLookup.get(s.source),c=r.nodeLookup.get(s.target);l&&c&&Z7({sourceNode:l,targetNode:c,width:r.width,height:r.height,transform:r.transform})&&o.push(s.id)}return o},[e]),yt)}const eq=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e}};return d.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},tq=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e,fill:e}};return d.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},WE={[Tl.Arrow]:eq,[Tl.ArrowClosed]:tq};function nq(e){const t=xt();return b.useMemo(()=>{var s,l;return Object.prototype.hasOwnProperty.call(WE,e)?WE[e]:((l=(s=t.getState()).onError)==null||l.call(s,"009",aa.error009(e)),null)},[e])}const rq=({id:e,type:t,color:r,width:o=12.5,height:s=12.5,markerUnits:l="strokeWidth",strokeWidth:c,orient:f="auto-start-reverse"})=>{const m=nq(t);return m?d.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:f,refX:"0",refY:"0",children:d.jsx(m,{color:r,strokeWidth:c})}):null},gR=({defaultColor:e,rfId:t})=>{const r=We(l=>l.edges),o=We(l=>l.defaultEdgeOptions),s=b.useMemo(()=>o$(r,{id:t,defaultColor:e,defaultMarkerStart:o==null?void 0:o.markerStart,defaultMarkerEnd:o==null?void 0:o.markerEnd}),[r,o,t,e]);return s.length?d.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:d.jsx("defs",{children:s.map(l=>d.jsx(rq,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};gR.displayName="MarkerDefinitions";var aq=b.memo(gR);function vR({x:e,y:t,label:r,labelStyle:o,labelShowBg:s=!0,labelBgStyle:l,labelBgPadding:c=[2,4],labelBgBorderRadius:f=2,children:m,className:h,...g}){const[p,v]=b.useState({x:1,y:0,width:0,height:0}),x=Pt(["react-flow__edge-textwrapper",h]),E=b.useRef(null);return b.useEffect(()=>{if(E.current){const S=E.current.getBBox();v({x:S.x,y:S.y,width:S.width,height:S.height})}},[r]),r?d.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:x,visibility:p.width?"visible":"hidden",...g,children:[s&&d.jsx("rect",{width:p.width+2*c[0],x:-c[0],y:-c[1],height:p.height+2*c[1],className:"react-flow__edge-textbg",style:l,rx:f,ry:f}),d.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:E,style:o,children:r}),m]}):null}vR.displayName="EdgeText";const oq=b.memo(vR);function dm({path:e,labelX:t,labelY:r,label:o,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:m,interactionWidth:h=20,...g}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{...g,d:e,fill:"none",className:Pt(["react-flow__edge-path",g.className])}),h?d.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,o&&Nr(t)&&Nr(r)?d.jsx(oq,{x:t,y:r,label:o,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:m}):null]})}function JE({pos:e,x1:t,y1:r,x2:o,y2:s}){return e===Te.Left||e===Te.Right?[.5*(t+o),r]:[t,.5*(r+s)]}function yR({sourceX:e,sourceY:t,sourcePosition:r=Te.Bottom,targetX:o,targetY:s,targetPosition:l=Te.Top}){const[c,f]=JE({pos:r,x1:e,y1:t,x2:o,y2:s}),[m,h]=JE({pos:l,x1:o,y1:s,x2:e,y2:t}),[g,p,v,x]=$T({sourceX:e,sourceY:t,targetX:o,targetY:s,sourceControlX:c,sourceControlY:f,targetControlX:m,targetControlY:h});return[`M${e},${t} C${c},${f} ${m},${h} ${o},${s}`,g,p,v,x]}function xR(e){return b.memo(({id:t,sourceX:r,sourceY:o,targetX:s,targetY:l,sourcePosition:c,targetPosition:f,label:m,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:S,markerStart:_,interactionWidth:C})=>{const[j,N,R]=yR({sourceX:r,sourceY:o,sourcePosition:c,targetX:s,targetY:l,targetPosition:f}),O=e.isInternal?void 0:t;return d.jsx(dm,{id:O,path:j,labelX:N,labelY:R,label:m,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:S,markerStart:_,interactionWidth:C})})}const sq=xR({isInternal:!1}),bR=xR({isInternal:!0});sq.displayName="SimpleBezierEdge";bR.displayName="SimpleBezierEdgeInternal";function wR(e){return b.memo(({id:t,sourceX:r,sourceY:o,targetX:s,targetY:l,label:c,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:v,sourcePosition:x=Te.Bottom,targetPosition:E=Te.Top,markerEnd:S,markerStart:_,pathOptions:C,interactionWidth:j})=>{const[N,R,O]=fy({sourceX:r,sourceY:o,sourcePosition:x,targetX:s,targetY:l,targetPosition:E,borderRadius:C==null?void 0:C.borderRadius,offset:C==null?void 0:C.offset,stepPosition:C==null?void 0:C.stepPosition}),A=e.isInternal?void 0:t;return d.jsx(dm,{id:A,path:N,labelX:R,labelY:O,label:c,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:v,markerEnd:S,markerStart:_,interactionWidth:j})})}const SR=wR({isInternal:!1}),ER=wR({isInternal:!0});SR.displayName="SmoothStepEdge";ER.displayName="SmoothStepEdgeInternal";function _R(e){return b.memo(({id:t,...r})=>{var s;const o=e.isInternal?void 0:t;return d.jsx(SR,{...r,id:o,pathOptions:b.useMemo(()=>{var l;return{borderRadius:0,offset:(l=r.pathOptions)==null?void 0:l.offset}},[(s=r.pathOptions)==null?void 0:s.offset])})})}const iq=_R({isInternal:!1}),CR=_R({isInternal:!0});iq.displayName="StepEdge";CR.displayName="StepEdgeInternal";function NR(e){return b.memo(({id:t,sourceX:r,sourceY:o,targetX:s,targetY:l,label:c,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:v,markerEnd:x,markerStart:E,interactionWidth:S})=>{const[_,C,j]=FT({sourceX:r,sourceY:o,targetX:s,targetY:l}),N=e.isInternal?void 0:t;return d.jsx(dm,{id:N,path:_,labelX:C,labelY:j,label:c,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:v,markerEnd:x,markerStart:E,interactionWidth:S})})}const lq=NR({isInternal:!1}),jR=NR({isInternal:!0});lq.displayName="StraightEdge";jR.displayName="StraightEdgeInternal";function TR(e){return b.memo(({id:t,sourceX:r,sourceY:o,targetX:s,targetY:l,sourcePosition:c=Te.Bottom,targetPosition:f=Te.Top,label:m,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:S,markerStart:_,pathOptions:C,interactionWidth:j})=>{const[N,R,O]=VT({sourceX:r,sourceY:o,sourcePosition:c,targetX:s,targetY:l,targetPosition:f,curvature:C==null?void 0:C.curvature}),A=e.isInternal?void 0:t;return d.jsx(dm,{id:A,path:N,labelX:R,labelY:O,label:m,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:S,markerStart:_,interactionWidth:j})})}const cq=TR({isInternal:!1}),RR=TR({isInternal:!0});cq.displayName="BezierEdge";RR.displayName="BezierEdgeInternal";const e_={default:RR,straight:jR,step:CR,smoothstep:ER,simplebezier:bR},t_={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},uq=(e,t,r)=>r===Te.Left?e-t:r===Te.Right?e+t:e,dq=(e,t,r)=>r===Te.Top?e-t:r===Te.Bottom?e+t:e,n_="react-flow__edgeupdater";function r_({position:e,centerX:t,centerY:r,radius:o=10,onMouseDown:s,onMouseEnter:l,onMouseOut:c,type:f}){return d.jsx("circle",{onMouseDown:s,onMouseEnter:l,onMouseOut:c,className:Pt([n_,`${n_}-${f}`]),cx:uq(t,o,e),cy:dq(r,o,e),r:o,stroke:"transparent",fill:"transparent"})}function fq({isReconnectable:e,reconnectRadius:t,edge:r,sourceX:o,sourceY:s,targetX:l,targetY:c,sourcePosition:f,targetPosition:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:p,setReconnecting:v,setUpdateHover:x}){const E=xt(),S=(R,O)=>{if(R.button!==0)return;const{autoPanOnConnect:A,domNode:D,connectionMode:P,connectionRadius:H,lib:Q,onConnectStart:V,cancelConnection:q,nodeLookup:ee,rfId:B,panBy:K,updateConnection:M}=E.getState(),I=O.type==="target",U=(k,L)=>{v(!1),p==null||p(k,r,O.type,L)},$=k=>h==null?void 0:h(r,k),X=(k,L)=>{v(!0),g==null||g(R,r,O.type),V==null||V(k,L)};py.onPointerDown(R.nativeEvent,{autoPanOnConnect:A,connectionMode:P,connectionRadius:H,domNode:D,handleId:O.id,nodeId:O.nodeId,nodeLookup:ee,isTarget:I,edgeUpdaterType:O.type,lib:Q,flowId:B,cancelConnection:q,panBy:K,isValidConnection:(...k)=>{var L,Y;return((Y=(L=E.getState()).isValidConnection)==null?void 0:Y.call(L,...k))??!0},onConnect:$,onConnectStart:X,onConnectEnd:(...k)=>{var L,Y;return(Y=(L=E.getState()).onConnectEnd)==null?void 0:Y.call(L,...k)},onReconnectEnd:U,updateConnection:M,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},_=R=>S(R,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),C=R=>S(R,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),j=()=>x(!0),N=()=>x(!1);return d.jsxs(d.Fragment,{children:[(e===!0||e==="source")&&d.jsx(r_,{position:f,centerX:o,centerY:s,radius:t,onMouseDown:_,onMouseEnter:j,onMouseOut:N,type:"source"}),(e===!0||e==="target")&&d.jsx(r_,{position:m,centerX:l,centerY:c,radius:t,onMouseDown:C,onMouseEnter:j,onMouseOut:N,type:"target"})]})}function hq({id:e,edgesFocusable:t,edgesReconnectable:r,elementsSelectable:o,onClick:s,onDoubleClick:l,onContextMenu:c,onMouseEnter:f,onMouseMove:m,onMouseLeave:h,reconnectRadius:g,onReconnect:p,onReconnectStart:v,onReconnectEnd:x,rfId:E,edgeTypes:S,noPanClassName:_,onError:C,disableKeyboardA11y:j}){let N=We(he=>he.edgeLookup.get(e));const R=We(he=>he.defaultEdgeOptions);N=R?{...R,...N}:N;let O=N.type||"default",A=(S==null?void 0:S[O])||e_[O];A===void 0&&(C==null||C("011",aa.error011(O)),O="default",A=(S==null?void 0:S.default)||e_.default);const D=!!(N.focusable||t&&typeof N.focusable>"u"),P=typeof p<"u"&&(N.reconnectable||r&&typeof N.reconnectable>"u"),H=!!(N.selectable||o&&typeof N.selectable>"u"),Q=b.useRef(null),[V,q]=b.useState(!1),[ee,B]=b.useState(!1),K=xt(),{zIndex:M,sourceX:I,sourceY:U,targetX:$,targetY:X,sourcePosition:k,targetPosition:L}=We(b.useCallback(he=>{const ye=he.nodeLookup.get(N.source),Ne=he.nodeLookup.get(N.target);if(!ye||!Ne)return{zIndex:N.zIndex,...t_};const Ue=a$({id:e,sourceNode:ye,targetNode:Ne,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:he.connectionMode,onError:C});return{zIndex:Q7({selected:N.selected,zIndex:N.zIndex,sourceNode:ye,targetNode:Ne,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode}),...Ue||t_}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),yt),Y=b.useMemo(()=>N.markerStart?`url('#${hy(N.markerStart,E)}')`:void 0,[N.markerStart,E]),W=b.useMemo(()=>N.markerEnd?`url('#${hy(N.markerEnd,E)}')`:void 0,[N.markerEnd,E]);if(N.hidden||I===null||U===null||$===null||X===null)return null;const J=he=>{var ke;const{addSelectedEdges:ye,unselectNodesAndEdges:Ne,multiSelectionActive:Ue}=K.getState();H&&(K.setState({nodesSelectionActive:!1}),N.selected&&Ue?(Ne({nodes:[],edges:[N]}),(ke=Q.current)==null||ke.blur()):ye([e])),s&&s(he,N)},se=l?he=>{l(he,{...N})}:void 0,ne=c?he=>{c(he,{...N})}:void 0,re=f?he=>{f(he,{...N})}:void 0,le=m?he=>{m(he,{...N})}:void 0,ve=h?he=>{h(he,{...N})}:void 0,ge=he=>{var ye;if(!j&&TT.includes(he.key)&&H){const{unselectNodesAndEdges:Ne,addSelectedEdges:Ue}=K.getState();he.key==="Escape"?((ye=Q.current)==null||ye.blur(),Ne({edges:[N]})):Ue([e])}};return d.jsx("svg",{style:{zIndex:M},children:d.jsxs("g",{className:Pt(["react-flow__edge",`react-flow__edge-${O}`,N.className,_,{selected:N.selected,animated:N.animated,inactive:!H&&!s,updating:V,selectable:H}]),onClick:J,onDoubleClick:se,onContextMenu:ne,onMouseEnter:re,onMouseMove:le,onMouseLeave:ve,onKeyDown:D?ge:void 0,tabIndex:D?0:void 0,role:N.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":D?`${sR}-${E}`:void 0,ref:Q,...N.domAttributes,children:[!ee&&d.jsx(A,{id:e,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:H,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:I,sourceY:U,targetX:$,targetY:X,sourcePosition:k,targetPosition:L,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:Y,markerEnd:W,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),P&&d.jsx(fq,{edge:N,isReconnectable:P,reconnectRadius:g,onReconnect:p,onReconnectStart:v,onReconnectEnd:x,sourceX:I,sourceY:U,targetX:$,targetY:X,sourcePosition:k,targetPosition:L,setUpdateHover:q,setReconnecting:B})]})})}var mq=b.memo(hq);const pq=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function MR({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:r,edgeTypes:o,noPanClassName:s,onReconnect:l,onEdgeContextMenu:c,onEdgeMouseEnter:f,onEdgeMouseMove:m,onEdgeMouseLeave:h,onEdgeClick:g,reconnectRadius:p,onEdgeDoubleClick:v,onReconnectStart:x,onReconnectEnd:E,disableKeyboardA11y:S}){const{edgesFocusable:_,edgesReconnectable:C,elementsSelectable:j,onError:N}=We(pq,yt),R=JV(t);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(aq,{defaultColor:e,rfId:r}),R.map(O=>d.jsx(mq,{id:O,edgesFocusable:_,edgesReconnectable:C,elementsSelectable:j,noPanClassName:s,onReconnect:l,onContextMenu:c,onMouseEnter:f,onMouseMove:m,onMouseLeave:h,onClick:g,reconnectRadius:p,onDoubleClick:v,onReconnectStart:x,onReconnectEnd:E,rfId:r,onError:N,edgeTypes:o,disableKeyboardA11y:S},O))]})}MR.displayName="EdgeRenderer";const gq=b.memo(MR),vq=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function yq({children:e}){const t=We(vq);return d.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function xq(e){const t=cm(),r=b.useRef(!1);b.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const bq=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function wq(e){const t=We(bq),r=xt();return b.useEffect(()=>{e&&(t==null||t(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Sq(e){return e.connection.inProgress?{...e.connection,to:Fu(e.connection.to,e.transform)}:{...e.connection}}function Eq(e){return Sq}function _q(e){const t=Eq();return We(t,yt)}const Cq=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Nq({containerStyle:e,style:t,type:r,component:o}){const{nodesConnectable:s,width:l,height:c,isValid:f,inProgress:m}=We(Cq,yt);return!(l&&s&&m)?null:d.jsx("svg",{style:e,width:l,height:c,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:Pt(["react-flow__connection",AT(f)]),children:d.jsx(AR,{style:t,type:r,CustomComponent:o,isValid:f})})})}const AR=({style:e,type:t=zo.Bezier,CustomComponent:r,isValid:o})=>{const{inProgress:s,from:l,fromNode:c,fromHandle:f,fromPosition:m,to:h,toNode:g,toHandle:p,toPosition:v,pointer:x}=_q();if(!s)return;if(r)return d.jsx(r,{connectionLineType:t,connectionLineStyle:e,fromNode:c,fromHandle:f,fromX:l.x,fromY:l.y,toX:h.x,toY:h.y,fromPosition:m,toPosition:v,connectionStatus:AT(o),toNode:g,toHandle:p,pointer:x});let E="";const S={sourceX:l.x,sourceY:l.y,sourcePosition:m,targetX:h.x,targetY:h.y,targetPosition:v};switch(t){case zo.Bezier:[E]=VT(S);break;case zo.SimpleBezier:[E]=yR(S);break;case zo.Step:[E]=fy({...S,borderRadius:0});break;case zo.SmoothStep:[E]=fy(S);break;default:[E]=FT(S)}return d.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:e})};AR.displayName="ConnectionLine";const jq={};function a_(e=jq){b.useRef(e),xt(),b.useEffect(()=>{},[e])}function Tq(){xt(),b.useRef(!1),b.useEffect(()=>{},[])}function OR({nodeTypes:e,edgeTypes:t,onInit:r,onNodeClick:o,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:f,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:g,onSelectionContextMenu:p,onSelectionStart:v,onSelectionEnd:x,connectionLineType:E,connectionLineStyle:S,connectionLineComponent:_,connectionLineContainerStyle:C,selectionKeyCode:j,selectionOnDrag:N,selectionMode:R,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:D,deleteKeyCode:P,onlyRenderVisibleElements:H,elementsSelectable:Q,defaultViewport:V,translateExtent:q,minZoom:ee,maxZoom:B,preventScrolling:K,defaultMarkerColor:M,zoomOnScroll:I,zoomOnPinch:U,panOnScroll:$,panOnScrollSpeed:X,panOnScrollMode:k,zoomOnDoubleClick:L,panOnDrag:Y,onPaneClick:W,onPaneMouseEnter:J,onPaneMouseMove:se,onPaneMouseLeave:ne,onPaneScroll:re,onPaneContextMenu:le,paneClickDistance:ve,nodeClickDistance:ge,onEdgeContextMenu:he,onEdgeMouseEnter:ye,onEdgeMouseMove:Ne,onEdgeMouseLeave:Ue,reconnectRadius:ke,onReconnect:nt,onReconnectStart:an,onReconnectEnd:st,noDragClassName:kn,noWheelClassName:pr,noPanClassName:Nt,disableKeyboardA11y:vn,nodeExtent:Ht,rfId:Ga,viewport:yn,onViewportChange:Lr}){return a_(e),a_(t),Tq(),xq(r),wq(yn),d.jsx(VV,{onPaneClick:W,onPaneMouseEnter:J,onPaneMouseMove:se,onPaneMouseLeave:ne,onPaneContextMenu:le,onPaneScroll:re,paneClickDistance:ve,deleteKeyCode:P,selectionKeyCode:j,selectionOnDrag:N,selectionMode:R,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:D,elementsSelectable:Q,zoomOnScroll:I,zoomOnPinch:U,zoomOnDoubleClick:L,panOnScroll:$,panOnScrollSpeed:X,panOnScrollMode:k,panOnDrag:Y,defaultViewport:V,translateExtent:q,minZoom:ee,maxZoom:B,onSelectionContextMenu:p,preventScrolling:K,noDragClassName:kn,noWheelClassName:pr,noPanClassName:Nt,disableKeyboardA11y:vn,onViewportChange:Lr,isControlledViewport:!!yn,children:d.jsxs(yq,{children:[d.jsx(gq,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:c,onReconnect:nt,onReconnectStart:an,onReconnectEnd:st,onlyRenderVisibleElements:H,onEdgeContextMenu:he,onEdgeMouseEnter:ye,onEdgeMouseMove:Ne,onEdgeMouseLeave:Ue,reconnectRadius:ke,defaultMarkerColor:M,noPanClassName:Nt,disableKeyboardA11y:vn,rfId:Ga}),d.jsx(Nq,{style:S,type:E,component:_,containerStyle:C}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(WV,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:l,onNodeMouseEnter:f,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:g,nodeClickDistance:ge,onlyRenderVisibleElements:H,noPanClassName:Nt,noDragClassName:kn,disableKeyboardA11y:vn,nodeExtent:Ht,rfId:Ga}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}OR.displayName="GraphView";const Rq=b.memo(OR),o_=({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,width:s,height:l,fitView:c,fitViewOptions:f,minZoom:m=.5,maxZoom:h=2,nodeOrigin:g,nodeExtent:p,zIndexMode:v="basic"}={})=>{const x=new Map,E=new Map,S=new Map,_=new Map,C=o??t??[],j=r??e??[],N=g??[0,0],R=p??fu;GT(S,_,C);const O=my(j,x,E,{nodeOrigin:N,nodeExtent:R,zIndexMode:v});let A=[0,0,1];if(c&&s&&l){const D=Vu(x,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:P,y:H,zoom:Q}=q0(D,s,l,m,h,(f==null?void 0:f.padding)??.1);A=[P,H,Q]}return{rfId:"1",width:s??0,height:l??0,transform:A,nodes:j,nodesInitialized:O,nodeLookup:x,parentLookup:E,edges:C,edgeLookup:_,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:m,maxZoom:h,translateExtent:fu,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:jl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:c??!1,fitViewOptions:f,fitViewResolver:null,connection:{...MT},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:q7,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:RT,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Mq=({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,width:s,height:l,fitView:c,fitViewOptions:f,minZoom:m,maxZoom:h,nodeOrigin:g,nodeExtent:p,zIndexMode:v})=>X$((x,E)=>{async function S(){const{nodeLookup:_,panZoom:C,fitViewOptions:j,fitViewResolver:N,width:R,height:O,minZoom:A,maxZoom:D}=E();C&&(await $7({nodes:_,width:R,height:O,panZoom:C,minZoom:A,maxZoom:D},j),N==null||N.resolve(!0),x({fitViewResolver:null}))}return{...o_({nodes:e,edges:t,width:s,height:l,fitView:c,fitViewOptions:f,minZoom:m,maxZoom:h,nodeOrigin:g,nodeExtent:p,defaultNodes:r,defaultEdges:o,zIndexMode:v}),setNodes:_=>{const{nodeLookup:C,parentLookup:j,nodeOrigin:N,elevateNodesOnSelect:R,fitViewQueued:O,zIndexMode:A}=E(),D=my(_,C,j,{nodeOrigin:N,nodeExtent:p,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:A});O&&D?(S(),x({nodes:_,nodesInitialized:D,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:_,nodesInitialized:D})},setEdges:_=>{const{connectionLookup:C,edgeLookup:j}=E();GT(C,j,_),x({edges:_})},setDefaultNodesAndEdges:(_,C)=>{if(_){const{setNodes:j}=E();j(_),x({hasDefaultNodes:!0})}if(C){const{setEdges:j}=E();j(C),x({hasDefaultEdges:!0})}},updateNodeInternals:_=>{const{triggerNodeChanges:C,nodeLookup:j,parentLookup:N,domNode:R,nodeOrigin:O,nodeExtent:A,debug:D,fitViewQueued:P,zIndexMode:H}=E(),{changes:Q,updatedInternals:V}=f$(_,j,N,R,O,A,H);V&&(l$(j,N,{nodeOrigin:O,nodeExtent:A,zIndexMode:H}),P?(S(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),(Q==null?void 0:Q.length)>0&&(D&&console.log("React Flow: trigger node changes",Q),C==null||C(Q)))},updateNodePositions:(_,C=!1)=>{const j=[];let N=[];const{nodeLookup:R,triggerNodeChanges:O,connection:A,updateConnection:D,onNodesChangeMiddlewareMap:P}=E();for(const[H,Q]of _){const V=R.get(H),q=!!(V!=null&&V.expandParent&&(V!=null&&V.parentId)&&(Q!=null&&Q.position)),ee={id:H,type:"position",position:q?{x:Math.max(0,Q.position.x),y:Math.max(0,Q.position.y)}:Q.position,dragging:C};if(V&&A.inProgress&&A.fromNode.id===V.id){const B=ti(V,A.fromHandle,Te.Left,!0);D({...A,from:B})}q&&V.parentId&&j.push({id:H,parentId:V.parentId,rect:{...Q.internals.positionAbsolute,width:Q.measured.width??0,height:Q.measured.height??0}}),N.push(ee)}if(j.length>0){const{parentLookup:H,nodeOrigin:Q}=E(),V=Q0(j,R,H,Q);N.push(...V)}for(const H of P.values())N=H(N);O(N)},triggerNodeChanges:_=>{const{onNodesChange:C,setNodes:j,nodes:N,hasDefaultNodes:R,debug:O}=E();if(_!=null&&_.length){if(R){const A=hV(_,N);j(A)}O&&console.log("React Flow: trigger node changes",_),C==null||C(_)}},triggerEdgeChanges:_=>{const{onEdgesChange:C,setEdges:j,edges:N,hasDefaultEdges:R,debug:O}=E();if(_!=null&&_.length){if(R){const A=mV(_,N);j(A)}O&&console.log("React Flow: trigger edge changes",_),C==null||C(_)}},addSelectedNodes:_=>{const{multiSelectionActive:C,edgeLookup:j,nodeLookup:N,triggerNodeChanges:R,triggerEdgeChanges:O}=E();if(C){const A=_.map(D=>Ms(D,!0));R(A);return}R(nl(N,new Set([..._]),!0)),O(nl(j))},addSelectedEdges:_=>{const{multiSelectionActive:C,edgeLookup:j,nodeLookup:N,triggerNodeChanges:R,triggerEdgeChanges:O}=E();if(C){const A=_.map(D=>Ms(D,!0));O(A);return}O(nl(j,new Set([..._]))),R(nl(N,new Set,!0))},unselectNodesAndEdges:({nodes:_,edges:C}={})=>{const{edges:j,nodes:N,nodeLookup:R,triggerNodeChanges:O,triggerEdgeChanges:A}=E(),D=_||N,P=C||j,H=[];for(const V of D){if(!V.selected)continue;const q=R.get(V.id);q&&(q.selected=!1),H.push(Ms(V.id,!1))}const Q=[];for(const V of P)V.selected&&Q.push(Ms(V.id,!1));O(H),A(Q)},setMinZoom:_=>{const{panZoom:C,maxZoom:j}=E();C==null||C.setScaleExtent([_,j]),x({minZoom:_})},setMaxZoom:_=>{const{panZoom:C,minZoom:j}=E();C==null||C.setScaleExtent([j,_]),x({maxZoom:_})},setTranslateExtent:_=>{var C;(C=E().panZoom)==null||C.setTranslateExtent(_),x({translateExtent:_})},resetSelectedElements:()=>{const{edges:_,nodes:C,triggerNodeChanges:j,triggerEdgeChanges:N,elementsSelectable:R}=E();if(!R)return;const O=C.reduce((D,P)=>P.selected?[...D,Ms(P.id,!1)]:D,[]),A=_.reduce((D,P)=>P.selected?[...D,Ms(P.id,!1)]:D,[]);j(O),N(A)},setNodeExtent:_=>{const{nodes:C,nodeLookup:j,parentLookup:N,nodeOrigin:R,elevateNodesOnSelect:O,nodeExtent:A,zIndexMode:D}=E();_[0][0]===A[0][0]&&_[0][1]===A[0][1]&&_[1][0]===A[1][0]&&_[1][1]===A[1][1]||(my(C,j,N,{nodeOrigin:R,nodeExtent:_,elevateNodesOnSelect:O,checkEquality:!1,zIndexMode:D}),x({nodeExtent:_}))},panBy:_=>{const{transform:C,width:j,height:N,panZoom:R,translateExtent:O}=E();return h$({delta:_,panZoom:R,transform:C,translateExtent:O,width:j,height:N})},setCenter:async(_,C,j)=>{const{width:N,height:R,maxZoom:O,panZoom:A}=E();if(!A)return Promise.resolve(!1);const D=typeof(j==null?void 0:j.zoom)<"u"?j.zoom:O;return await A.setViewport({x:N/2-_*D,y:R/2-C*D,zoom:D},{duration:j==null?void 0:j.duration,ease:j==null?void 0:j.ease,interpolate:j==null?void 0:j.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...MT}})},updateConnection:_=>{x({connection:_})},reset:()=>x({...o_()})}},Object.is);function DR({initialNodes:e,initialEdges:t,defaultNodes:r,defaultEdges:o,initialWidth:s,initialHeight:l,initialMinZoom:c,initialMaxZoom:f,initialFitViewOptions:m,fitView:h,nodeOrigin:g,nodeExtent:p,zIndexMode:v,children:x}){const[E]=b.useState(()=>Mq({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,width:s,height:l,fitView:h,minZoom:c,maxZoom:f,fitViewOptions:m,nodeOrigin:g,nodeExtent:p,zIndexMode:v}));return d.jsx(Y$,{value:E,children:d.jsx(yV,{children:x})})}function Aq({children:e,nodes:t,edges:r,defaultNodes:o,defaultEdges:s,width:l,height:c,fitView:f,fitViewOptions:m,minZoom:h,maxZoom:g,nodeOrigin:p,nodeExtent:v,zIndexMode:x}){return b.useContext(im)?d.jsx(d.Fragment,{children:e}):d.jsx(DR,{initialNodes:t,initialEdges:r,defaultNodes:o,defaultEdges:s,initialWidth:l,initialHeight:c,fitView:f,initialFitViewOptions:m,initialMinZoom:h,initialMaxZoom:g,nodeOrigin:p,nodeExtent:v,zIndexMode:x,children:e})}const Oq={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Dq({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,className:s,nodeTypes:l,edgeTypes:c,onNodeClick:f,onEdgeClick:m,onInit:h,onMove:g,onMoveStart:p,onMoveEnd:v,onConnect:x,onConnectStart:E,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:C,onNodeMouseEnter:j,onNodeMouseMove:N,onNodeMouseLeave:R,onNodeContextMenu:O,onNodeDoubleClick:A,onNodeDragStart:D,onNodeDrag:P,onNodeDragStop:H,onNodesDelete:Q,onEdgesDelete:V,onDelete:q,onSelectionChange:ee,onSelectionDragStart:B,onSelectionDrag:K,onSelectionDragStop:M,onSelectionContextMenu:I,onSelectionStart:U,onSelectionEnd:$,onBeforeDelete:X,connectionMode:k,connectionLineType:L=zo.Bezier,connectionLineStyle:Y,connectionLineComponent:W,connectionLineContainerStyle:J,deleteKeyCode:se="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:re=!1,selectionMode:le=hu.Full,panActivationKeyCode:ve="Space",multiSelectionKeyCode:ge=pu()?"Meta":"Control",zoomActivationKeyCode:he=pu()?"Meta":"Control",snapToGrid:ye,snapGrid:Ne,onlyRenderVisibleElements:Ue=!1,selectNodesOnDrag:ke,nodesDraggable:nt,autoPanOnNodeFocus:an,nodesConnectable:st,nodesFocusable:kn,nodeOrigin:pr=iR,edgesFocusable:Nt,edgesReconnectable:vn,elementsSelectable:Ht=!0,defaultViewport:Ga=sV,minZoom:yn=.5,maxZoom:Lr=2,translateExtent:Pr=fu,preventScrolling:ss=!0,nodeExtent:zn,defaultMarkerColor:hi="#b1b1b7",zoomOnScroll:Hr=!0,zoomOnPinch:ca=!0,panOnScroll:Kt=!1,panOnScrollSpeed:Ln=.5,panOnScrollMode:Vt=Vs.Free,zoomOnDoubleClick:Vl=!0,panOnDrag:is=!0,onPaneClick:Zn,onPaneMouseEnter:Ka,onPaneMouseMove:Qa,onPaneMouseLeave:ua,onPaneScroll:Wn,onPaneContextMenu:De,paneClickDistance:dt=1,nodeClickDistance:Mt=0,children:qt,onReconnect:Ir,onReconnectStart:ht,onReconnectEnd:on,onEdgeContextMenu:da,onEdgeDoubleClick:sn,onEdgeMouseEnter:ln,onEdgeMouseMove:Za,onEdgeMouseLeave:Pn,reconnectRadius:ql=10,onNodesChange:Xu,onEdgesChange:Br,noDragClassName:It="nodrag",noWheelClassName:cn="nowheel",noPanClassName:fa="nopan",fitView:mi,fitViewOptions:Yu,connectOnClick:fm,attributionPosition:Gu,proOptions:ls,defaultEdgeOptions:Fl,elevateNodesOnSelect:Wa=!0,elevateEdgesOnSelect:Ja=!1,disableKeyboardA11y:eo=!1,autoPanOnConnect:to,autoPanOnNodeDrag:At,autoPanSpeed:Ku,connectionRadius:Qu,isValidConnection:ha,onError:no,style:hm,id:Xl,nodeDragThreshold:Zu,connectionDragThreshold:mm,viewport:pi,onViewportChange:gi,width:gr,height:xn,colorMode:Wu="light",debug:pm,onScroll:ro,ariaLabelConfig:Ju,zIndexMode:cs="basic",...gm},bn){const us=Xl||"1",ed=uV(Wu),Yl=b.useCallback(ma=>{ma.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ro==null||ro(ma)},[ro]);return d.jsx("div",{"data-testid":"rf__wrapper",...gm,onScroll:Yl,style:{...hm,...Oq},ref:bn,className:Pt(["react-flow",s,ed]),id:Xl,role:"application",children:d.jsxs(Aq,{nodes:e,edges:t,width:gr,height:xn,fitView:mi,fitViewOptions:Yu,minZoom:yn,maxZoom:Lr,nodeOrigin:pr,nodeExtent:zn,zIndexMode:cs,children:[d.jsx(Rq,{onInit:h,onNodeClick:f,onEdgeClick:m,onNodeMouseEnter:j,onNodeMouseMove:N,onNodeMouseLeave:R,onNodeContextMenu:O,onNodeDoubleClick:A,nodeTypes:l,edgeTypes:c,connectionLineType:L,connectionLineStyle:Y,connectionLineComponent:W,connectionLineContainerStyle:J,selectionKeyCode:ne,selectionOnDrag:re,selectionMode:le,deleteKeyCode:se,multiSelectionKeyCode:ge,panActivationKeyCode:ve,zoomActivationKeyCode:he,onlyRenderVisibleElements:Ue,defaultViewport:Ga,translateExtent:Pr,minZoom:yn,maxZoom:Lr,preventScrolling:ss,zoomOnScroll:Hr,zoomOnPinch:ca,zoomOnDoubleClick:Vl,panOnScroll:Kt,panOnScrollSpeed:Ln,panOnScrollMode:Vt,panOnDrag:is,onPaneClick:Zn,onPaneMouseEnter:Ka,onPaneMouseMove:Qa,onPaneMouseLeave:ua,onPaneScroll:Wn,onPaneContextMenu:De,paneClickDistance:dt,nodeClickDistance:Mt,onSelectionContextMenu:I,onSelectionStart:U,onSelectionEnd:$,onReconnect:Ir,onReconnectStart:ht,onReconnectEnd:on,onEdgeContextMenu:da,onEdgeDoubleClick:sn,onEdgeMouseEnter:ln,onEdgeMouseMove:Za,onEdgeMouseLeave:Pn,reconnectRadius:ql,defaultMarkerColor:hi,noDragClassName:It,noWheelClassName:cn,noPanClassName:fa,rfId:us,disableKeyboardA11y:eo,nodeExtent:zn,viewport:pi,onViewportChange:gi}),d.jsx(cV,{nodes:e,edges:t,defaultNodes:r,defaultEdges:o,onConnect:x,onConnectStart:E,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:C,nodesDraggable:nt,autoPanOnNodeFocus:an,nodesConnectable:st,nodesFocusable:kn,edgesFocusable:Nt,edgesReconnectable:vn,elementsSelectable:Ht,elevateNodesOnSelect:Wa,elevateEdgesOnSelect:Ja,minZoom:yn,maxZoom:Lr,nodeExtent:zn,onNodesChange:Xu,onEdgesChange:Br,snapToGrid:ye,snapGrid:Ne,connectionMode:k,translateExtent:Pr,connectOnClick:fm,defaultEdgeOptions:Fl,fitView:mi,fitViewOptions:Yu,onNodesDelete:Q,onEdgesDelete:V,onDelete:q,onNodeDragStart:D,onNodeDrag:P,onNodeDragStop:H,onSelectionDrag:K,onSelectionDragStart:B,onSelectionDragStop:M,onMove:g,onMoveStart:p,onMoveEnd:v,noPanClassName:fa,nodeOrigin:pr,rfId:us,autoPanOnConnect:to,autoPanOnNodeDrag:At,autoPanSpeed:Ku,onError:no,connectionRadius:Qu,isValidConnection:ha,selectNodesOnDrag:ke,nodeDragThreshold:Zu,connectionDragThreshold:mm,onBeforeDelete:X,debug:pm,ariaLabelConfig:Ju,zIndexMode:cs}),d.jsx(oV,{onSelectionChange:ee}),qt,d.jsx(eV,{proOptions:ls,position:Gu}),d.jsx(J$,{rfId:us,disableKeyboardA11y:eo})]})})}var kq=cR(Dq);function zq({dimensions:e,lineWidth:t,variant:r,className:o}){return d.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Pt(["react-flow__background-pattern",r,o])})}function Lq({radius:e,className:t}){return d.jsx("circle",{cx:e,cy:e,r:e,className:Pt(["react-flow__background-pattern","dots",t])})}var Yo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Yo||(Yo={}));const Pq={[Yo.Dots]:1,[Yo.Lines]:1,[Yo.Cross]:6},Hq=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function kR({id:e,variant:t=Yo.Dots,gap:r=20,size:o,lineWidth:s=1,offset:l=0,color:c,bgColor:f,style:m,className:h,patternClassName:g}){const p=b.useRef(null),{transform:v,patternId:x}=We(Hq,yt),E=o||Pq[t],S=t===Yo.Dots,_=t===Yo.Cross,C=Array.isArray(r)?r:[r,r],j=[C[0]*v[2]||1,C[1]*v[2]||1],N=E*v[2],R=Array.isArray(l)?l:[l,l],O=_?[N,N]:j,A=[R[0]*v[2]||1+O[0]/2,R[1]*v[2]||1+O[1]/2],D=`${x}${e||""}`;return d.jsxs("svg",{className:Pt(["react-flow__background",h]),style:{...m,...um,"--xy-background-color-props":f,"--xy-background-pattern-color-props":c},ref:p,"data-testid":"rf__background",children:[d.jsx("pattern",{id:D,x:v[0]%j[0],y:v[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:S?d.jsx(Lq,{radius:N/2,className:g}):d.jsx(zq,{dimensions:O,lineWidth:s,variant:t,className:g})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}kR.displayName="Background";b.memo(kR);function Iq(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:d.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Bq(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:d.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Uq(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:d.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function $q(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Vq(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Af({children:e,className:t,...r}){return d.jsx("button",{type:"button",className:Pt(["react-flow__controls-button",t]),...r,children:e})}const qq=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function zR({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:o=!0,fitViewOptions:s,onZoomIn:l,onZoomOut:c,onFitView:f,onInteractiveChange:m,className:h,children:g,position:p="bottom-left",orientation:v="vertical","aria-label":x}){const E=xt(),{isInteractive:S,minZoomReached:_,maxZoomReached:C,ariaLabelConfig:j}=We(qq,yt),{zoomIn:N,zoomOut:R,fitView:O}=cm(),A=()=>{N(),l==null||l()},D=()=>{R(),c==null||c()},P=()=>{O(s),f==null||f()},H=()=>{E.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),m==null||m(!S)},Q=v==="horizontal"?"horizontal":"vertical";return d.jsxs(lm,{className:Pt(["react-flow__controls",Q,h]),position:p,style:e,"data-testid":"rf__controls","aria-label":x??j["controls.ariaLabel"],children:[t&&d.jsxs(d.Fragment,{children:[d.jsx(Af,{onClick:A,className:"react-flow__controls-zoomin",title:j["controls.zoomIn.ariaLabel"],"aria-label":j["controls.zoomIn.ariaLabel"],disabled:C,children:d.jsx(Iq,{})}),d.jsx(Af,{onClick:D,className:"react-flow__controls-zoomout",title:j["controls.zoomOut.ariaLabel"],"aria-label":j["controls.zoomOut.ariaLabel"],disabled:_,children:d.jsx(Bq,{})})]}),r&&d.jsx(Af,{className:"react-flow__controls-fitview",onClick:P,title:j["controls.fitView.ariaLabel"],"aria-label":j["controls.fitView.ariaLabel"],children:d.jsx(Uq,{})}),o&&d.jsx(Af,{className:"react-flow__controls-interactive",onClick:H,title:j["controls.interactive.ariaLabel"],"aria-label":j["controls.interactive.ariaLabel"],children:S?d.jsx(Vq,{}):d.jsx($q,{})}),g]})}zR.displayName="Controls";b.memo(zR);function Fq({id:e,x:t,y:r,width:o,height:s,style:l,color:c,strokeColor:f,strokeWidth:m,className:h,borderRadius:g,shapeRendering:p,selected:v,onClick:x}){const{background:E,backgroundColor:S}=l||{},_=c||E||S;return d.jsx("rect",{className:Pt(["react-flow__minimap-node",{selected:v},h]),x:t,y:r,rx:g,ry:g,width:o,height:s,style:{fill:_,stroke:f,strokeWidth:m},shapeRendering:p,onClick:x?C=>x(C,e):void 0})}const Xq=b.memo(Fq),Yq=e=>e.nodes.map(t=>t.id),iv=e=>e instanceof Function?e:()=>e;function Gq({nodeStrokeColor:e,nodeColor:t,nodeClassName:r="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:l=Xq,onClick:c}){const f=We(Yq,yt),m=iv(t),h=iv(e),g=iv(r),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:f.map(v=>d.jsx(Qq,{id:v,nodeColorFunc:m,nodeStrokeColorFunc:h,nodeClassNameFunc:g,nodeBorderRadius:o,nodeStrokeWidth:s,NodeComponent:l,onClick:c,shapeRendering:p},v))})}function Kq({id:e,nodeColorFunc:t,nodeStrokeColorFunc:r,nodeClassNameFunc:o,nodeBorderRadius:s,nodeStrokeWidth:l,shapeRendering:c,NodeComponent:f,onClick:m}){const{node:h,x:g,y:p,width:v,height:x}=We(E=>{const S=E.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const _=S.internals.userNode,{x:C,y:j}=S.internals.positionAbsolute,{width:N,height:R}=Ya(_);return{node:_,x:C,y:j,width:N,height:R}},yt);return!h||h.hidden||!PT(h)?null:d.jsx(f,{x:g,y:p,width:v,height:x,style:h.style,selected:!!h.selected,className:o(h),color:t(h),borderRadius:s,strokeColor:r(h),strokeWidth:l,shapeRendering:c,onClick:m,id:h.id})}const Qq=b.memo(Kq);var Zq=b.memo(Gq);const Wq=200,Jq=150,eF=e=>!e.hidden,tF=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?LT(Vu(e.nodeLookup,{filter:eF}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},nF="react-flow__minimap-desc";function LR({style:e,className:t,nodeStrokeColor:r,nodeColor:o,nodeClassName:s="",nodeBorderRadius:l=5,nodeStrokeWidth:c,nodeComponent:f,bgColor:m,maskColor:h,maskStrokeColor:g,maskStrokeWidth:p,position:v="bottom-right",onClick:x,onNodeClick:E,pannable:S=!1,zoomable:_=!1,ariaLabel:C,inversePan:j,zoomStep:N=1,offsetScale:R=5}){const O=xt(),A=b.useRef(null),{boundingRect:D,viewBB:P,rfId:H,panZoom:Q,translateExtent:V,flowWidth:q,flowHeight:ee,ariaLabelConfig:B}=We(tF,yt),K=(e==null?void 0:e.width)??Wq,M=(e==null?void 0:e.height)??Jq,I=D.width/K,U=D.height/M,$=Math.max(I,U),X=$*K,k=$*M,L=R*$,Y=D.x-(X-D.width)/2-L,W=D.y-(k-D.height)/2-L,J=X+L*2,se=k+L*2,ne=`${nF}-${H}`,re=b.useRef(0),le=b.useRef();re.current=$,b.useEffect(()=>{if(A.current&&Q)return le.current=S$({domNode:A.current,panZoom:Q,getTransform:()=>O.getState().transform,getViewScale:()=>re.current}),()=>{var ye;(ye=le.current)==null||ye.destroy()}},[Q]),b.useEffect(()=>{var ye;(ye=le.current)==null||ye.update({translateExtent:V,width:q,height:ee,inversePan:j,pannable:S,zoomStep:N,zoomable:_})},[S,_,j,N,V,q,ee]);const ve=x?ye=>{var ke;const[Ne,Ue]=((ke=le.current)==null?void 0:ke.pointer(ye))||[0,0];x(ye,{x:Ne,y:Ue})}:void 0,ge=E?b.useCallback((ye,Ne)=>{const Ue=O.getState().nodeLookup.get(Ne).internals.userNode;E(ye,Ue)},[]):void 0,he=C??B["minimap.ariaLabel"];return d.jsx(lm,{position:v,style:{...e,"--xy-minimap-background-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*$:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:Pt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:K,height:M,viewBox:`${Y} ${W} ${J} ${se}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:A,onClick:ve,children:[he&&d.jsx("title",{id:ne,children:he}),d.jsx(Zq,{onClick:ge,nodeColor:o,nodeStrokeColor:r,nodeBorderRadius:l,nodeClassName:s,nodeStrokeWidth:c,nodeComponent:f}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${Y-L},${W-L}h${J+L*2}v${se+L*2}h${-J-L*2}z
        M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}LR.displayName="MiniMap";b.memo(LR);const rF=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,aF={[Ol.Line]:"right",[Ol.Handle]:"bottom-right"};function oF({nodeId:e,position:t,variant:r=Ol.Handle,className:o,style:s=void 0,children:l,color:c,minWidth:f=10,minHeight:m=10,maxWidth:h=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:v,autoScale:x=!0,shouldResize:E,onResizeStart:S,onResize:_,onResizeEnd:C}){const j=hR(),N=typeof e=="string"?e:j,R=xt(),O=b.useRef(null),A=r===Ol.Handle,D=We(b.useCallback(rF(A&&x),[A,x]),yt),P=b.useRef(null),H=t??aF[r];b.useEffect(()=>{if(!(!O.current||!N))return P.current||(P.current=L$({domNode:O.current,nodeId:N,getStoreItems:()=>{const{nodeLookup:V,transform:q,snapGrid:ee,snapToGrid:B,nodeOrigin:K,domNode:M}=R.getState();return{nodeLookup:V,transform:q,snapGrid:ee,snapToGrid:B,nodeOrigin:K,paneDomNode:M}},onChange:(V,q)=>{const{triggerNodeChanges:ee,nodeLookup:B,parentLookup:K,nodeOrigin:M}=R.getState(),I=[],U={x:V.x,y:V.y},$=B.get(N);if($&&$.expandParent&&$.parentId){const X=$.origin??M,k=V.width??$.measured.width??0,L=V.height??$.measured.height??0,Y={id:$.id,parentId:$.parentId,rect:{width:k,height:L,...HT({x:V.x??$.position.x,y:V.y??$.position.y},{width:k,height:L},$.parentId,B,X)}},W=Q0([Y],B,K,M);I.push(...W),U.x=V.x?Math.max(X[0]*k,V.x):void 0,U.y=V.y?Math.max(X[1]*L,V.y):void 0}if(U.x!==void 0&&U.y!==void 0){const X={id:N,type:"position",position:{...U}};I.push(X)}if(V.width!==void 0&&V.height!==void 0){const k={id:N,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:V.width,height:V.height}};I.push(k)}for(const X of q){const k={...X,type:"position"};I.push(k)}ee(I)},onEnd:({width:V,height:q})=>{const ee={id:N,type:"dimensions",resizing:!1,dimensions:{width:V,height:q}};R.getState().triggerNodeChanges([ee])}})),P.current.update({controlPosition:H,boundaries:{minWidth:f,minHeight:m,maxWidth:h,maxHeight:g},keepAspectRatio:p,resizeDirection:v,onResizeStart:S,onResize:_,onResizeEnd:C,shouldResize:E}),()=>{var V;(V=P.current)==null||V.destroy()}},[H,f,m,h,g,p,S,_,C,E]);const Q=H.split("-");return d.jsx("div",{className:Pt(["react-flow__resize-control","nodrag",...Q,r,o]),ref:O,style:{...s,scale:D,...c&&{[A?"backgroundColor":"borderColor"]:c}},children:l})}b.memo(oF);function sF(e){const[t,r]=b.useState(null),[o,s]=b.useState(!1),l=b.useRef(null);return b.useEffect(()=>{const c=new EventSource(`/api/sessions/${e}/tree`);return l.current=c,c.onopen=()=>s(!0),c.onmessage=f=>{try{const m=JSON.parse(f.data);r(m)}catch{}},c.onerror=()=>{s(!1)},()=>{c.close(),l.current=null}},[e]),{tree:t,connected:o}}const PR=180,iF=70,wh=24,lF=60;function cF({data:e}){const t=e.pending?"agent-flow-node pending":`agent-flow-node ${eE(e.status)}`;return d.jsxs("div",{className:t,children:[d.jsx(Dl,{type:"target",position:Te.Top}),d.jsx("div",{className:"agent-flow-role",children:e.pending?`[pending: ${e.role}]`:e.role}),!e.pending&&d.jsxs("div",{className:"agent-flow-meta",children:[d.jsx("span",{className:`status-dot ${eE(e.status)}`}),d.jsx("span",{children:e.status}),e.duration_ms!=null&&d.jsx("span",{children:Zh(e.duration_ms)}),e.exit_code!=null&&d.jsxs("span",{children:["exit ",e.exit_code]})]}),d.jsx(Dl,{type:"source",position:Te.Bottom})]})}const uF={agent:cF};function dF(e,t){const r=new Map(e.map(f=>[f.agent_id,f])),o=new Map;for(const f of e){const m=f.parent;o.has(m)||o.set(m,[]),o.get(m).push(f.agent_id)}const s=new Map;for(const f of t){const m=f.requested_by;m&&r.has(m)&&(s.has(m)||s.set(m,[]),s.get(m).push(f))}function l(f){const m=(o.get(f)||[]).map(l),h=(s.get(f)||[]).map(g=>({id:`pending-${g.span_id}`,children:[]}));return{id:f,children:[...m,...h]}}return(o.get(null)||[]).map(l)}function Sh(e){return e.children.length===0?PR:e.children.reduce((t,r)=>t+Sh(r)+wh,-wh)}function HR(e,t,r,o){if(o.set(e.id,{x:t-PR/2,y:r}),e.children.length===0)return;const s=Sh(e);let l=t-s/2;for(const c of e.children){const f=Sh(c),m=l+f/2;HR(c,m,r+iF+lF,o),l+=f+wh}}function fF({runId:e}){return d.jsx(DR,{children:d.jsx(hF,{runId:e})})}function hF({runId:e}){const{tree:t,connected:r}=sF(e),{fitView:o}=cm(),s=b.useCallback(()=>{o({duration:300})},[o]),{flowNodes:l,flowEdges:c}=b.useMemo(()=>{if(!t)return{flowNodes:[],flowEdges:[]};const f=dF(t.nodes,t.pending_delegations),m=new Map;let h=0;for(const E of f){const S=Sh(E),_=h+S/2;HR(E,_,0,m),h+=S+wh*2}const g=new Map(t.nodes.map(E=>[E.agent_id,E])),p=new Map(t.pending_delegations.map(E=>[`pending-${E.span_id}`,E])),v=[];for(const[E,S]of m){const _=g.get(E),C=p.get(E);_?v.push({id:E,type:"agent",position:S,data:{label:_.role,role:_.role,status:_.status,runtime:_.runtime,duration_ms:_.duration_ms,exit_code:_.exit_code}}):C&&v.push({id:E,type:"agent",position:S,data:{label:C.role,role:C.role,status:"running",runtime:"",duration_ms:null,exit_code:null,pending:!0}})}const x=[];for(const E of t.nodes)E.parent&&x.push({id:`e-${E.parent}-${E.agent_id}`,source:E.parent,target:E.agent_id,type:"smoothstep",markerEnd:{type:Tl.ArrowClosed,width:16,height:16}});for(const E of t.pending_delegations)E.requested_by&&x.push({id:`e-${E.requested_by}-pending-${E.span_id}`,source:E.requested_by,target:`pending-${E.span_id}`,type:"smoothstep",markerEnd:{type:Tl.ArrowClosed,width:16,height:16},style:{strokeDasharray:"5 3"}});return{flowNodes:v,flowEdges:x}},[t]);return t?d.jsxs("div",{children:[d.jsxs("div",{className:"react-flow-wrapper",children:[d.jsx(kq,{nodes:l,edges:c,nodeTypes:uF,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0}}),d.jsx("button",{className:"tree-reset-btn",onClick:s,children:"Reset View"})]}),t.denied_delegations.length>0&&d.jsxs("div",{className:"denied-list",children:[d.jsx("strong",{children:"Denied delegations:"}),t.denied_delegations.map(f=>d.jsxs("span",{className:"denied-item",children:[f.role," (",f.reason,")"]},f.span_id))]})]}):d.jsx("div",{className:"agent-tree",children:d.jsx("p",{className:"agent-meta",children:r?"Loading tree...":"Connecting..."})})}const Rs=18,s_=10;function mF({runId:e,agents:t,active:r}){var K;const o=Object.keys(t),s=o.find(M=>t[M].parent===null)??o[0]??"",[l,c]=b.useState(s),{lines:f,connected:m,done:h}=Gj(e,l,!0),[g,p]=b.useState(""),v=g.toLowerCase(),x=g?f.reduce((M,I,U)=>(I.toLowerCase().includes(v)&&M.push(U),M),[]):[],E=b.useRef(null),[S,_]=b.useState(0),[C,j]=b.useState(0),[N,R]=b.useState(!0),O=b.useRef(0),A=f.length*Rs,D=Math.max(0,Math.floor(S/Rs)-s_),P=Math.ceil(C/Rs)+s_*2,H=Math.min(f.length,D+P),Q=f.slice(D,H),V=String(f.length).length,q=b.useCallback(()=>{const M=E.current;if(!M)return;_(M.scrollTop),j(M.clientHeight);const I=M.scrollTop+M.clientHeight>=M.scrollHeight-Rs*2;R(I)},[]);b.useEffect(()=>{const M=E.current;M&&j(M.clientHeight)},[]),b.useEffect(()=>{if(N&&f.length>O.current){const M=E.current;M&&(M.scrollTop=M.scrollHeight)}O.current=f.length},[f.length,N]);const ee=()=>{const M=E.current;M&&(M.scrollTop=M.scrollHeight,R(!0))},B=async()=>{try{const M=await fetch(`/api/sessions/${e}/logs/${l}/full`);if(!M.ok)return;const I=await M.text(),U=new Blob([I],{type:"text/plain"}),$=URL.createObjectURL(U),X=document.createElement("a");X.href=$,X.download=`${l}.log`,X.click(),URL.revokeObjectURL($)}catch{}};return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[o.length>1&&d.jsxs(Jo,{value:l,onValueChange:c,children:[d.jsx(ts,{className:"w-[220px]",children:d.jsx(es,{})}),d.jsx(ns,{children:o.map(M=>d.jsxs(Yn,{value:M,children:[t[M].role," (",M.slice(0,8),")"]},M))})]}),o.length===1&&d.jsxs("span",{className:"text-sm text-muted-foreground",children:[(K=t[l])==null?void 0:K.role," (",l.slice(0,8),")"]}),d.jsxs("div",{className:"relative ml-auto",children:[d.jsx(jj,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),d.jsx(Lt,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:g,onChange:M=>p(M.target.value)})]}),g&&d.jsxs("span",{className:"text-xs text-muted-foreground",children:[x.length," match",x.length!==1?"es":""]}),d.jsxs(Me,{variant:"outline",size:"sm",onClick:B,children:[d.jsx(Gh,{className:"mr-1 h-3.5 w-3.5"}),"Download"]}),d.jsx(pF,{connected:m,done:h,active:r})]}),d.jsxs("div",{className:"relative",children:[d.jsx("div",{ref:E,className:"h-[500px] overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4]",onScroll:q,children:f.length===0?d.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:r&&!h?"Waiting for log output...":"No log output."}):d.jsx("div",{style:{height:A,position:"relative"},children:d.jsx("div",{style:{position:"absolute",top:D*Rs,left:0,right:0},children:Q.map((M,I)=>{const U=D+I,$=g&&M.toLowerCase().includes(v);return d.jsxs("div",{className:$?"bg-yellow-900/30":void 0,style:{height:Rs,lineHeight:`${Rs}px`,display:"flex",whiteSpace:"pre"},children:[d.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(V+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:U+1}),d.jsx("span",{children:$?d.jsx(gF,{line:M,search:v}):M})]},U)})})})}),!N&&f.length>0&&d.jsxs(Me,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:ee,children:[d.jsx(g6,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function pF({connected:e,done:t,active:r}){return t||!r?d.jsx("span",{className:"text-xs text-muted-foreground",children:"Session ended"}):d.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[d.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${e?"animate-pulse bg-green-500":"bg-orange-400"}`}),e?"Live":"Connecting..."]})}function gF({line:e,search:t}){const r=[],o=e.toLowerCase();let s=0,l=o.indexOf(t,s),c=0;for(;l!==-1;)l>s&&r.push(e.slice(s,l)),r.push(d.jsx("span",{className:"bg-yellow-500/60 text-white",children:e.slice(l,l+t.length)},c++)),s=l+t.length,l=o.indexOf(t,s);return s<e.length&&r.push(e.slice(s)),d.jsx(d.Fragment,{children:r})}function vF(e,t){const[r,o]=b.useState([]),[s,l]=b.useState(!1),c=b.useRef(null),f=b.useRef(""),m=b.useRef(void 0),h=b.useRef(1e3);return b.useEffect(()=>{if(!t)return;f.current!==e&&(o([]),f.current=e);function g(){const p=new EventSource(`/api/sessions/${e}/events`);c.current=p,p.onopen=()=>{l(!0),h.current=1e3},p.addEventListener("snapshot",v=>{try{const x=JSON.parse(v.data);x.events&&Array.isArray(x.events)&&o(x.events)}catch{}}),p.addEventListener("delta",v=>{try{const x=JSON.parse(v.data);x.events&&Array.isArray(x.events)&&o(E=>[...E,...x.events])}catch{}}),p.onmessage=v=>{try{const x=JSON.parse(v.data);x.events&&Array.isArray(x.events)&&o(x.events)}catch{}},p.onerror=()=>{p.close(),c.current=null,l(!1),m.current=setTimeout(()=>{h.current=Math.min(h.current*2,15e3),g()},h.current)}}return g(),()=>{var p;(p=c.current)==null||p.close(),c.current=null,m.current&&clearTimeout(m.current)}},[e,t]),{events:r,connected:s}}function yF(){return d.jsxs("div",{className:"space-y-6",children:[d.jsx(tn,{className:"h-8 w-64"}),d.jsx(tn,{className:"h-32 rounded-lg"}),d.jsx(tn,{className:"h-64 rounded-lg"})]})}function xF(){const{projectId:e,runId:t}=by(),[r]=TD(),o=Number(e),s=x=>x==="starting"||x==="running",l=iH(o,t??"",{refetchInterval:void 0}),c=l.data,f=s(c==null?void 0:c.status);b.useEffect(()=>{if(!f)return;const x=setInterval(()=>l.refetch(),2e3);return()=>clearInterval(x)},[f,l]);const{events:m}=vF(t??"",f),h=(c==null?void 0:c.events)??[],g=m.length>0?m:h;if(l.isLoading)return d.jsx(yF,{});if(l.error)return d.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[d.jsx(Zo,{className:"h-4 w-4"}),d.jsxs("span",{children:["Error: ",l.error.message]})]});if(!c)return d.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[d.jsx(Zo,{className:"h-4 w-4"}),d.jsx("span",{children:"Session not found"})]});const p=_F(g),v=r.get("tab")??(f?"agent-tree":"overview");return d.jsxs("div",{className:"space-y-6",children:[d.jsx(bF,{session:c,projectId:o,runId:t??"",onStopped:()=>l.refetch()}),d.jsx(EF,{session:c}),d.jsxs(D0,{defaultValue:v,children:[d.jsxs(k0,{children:[d.jsx(Wr,{value:"overview",children:"Overview"}),d.jsx(Wr,{value:"agent-tree",children:"Agent Tree"}),d.jsx(Wr,{value:"logs",children:"Logs"}),d.jsxs(Wr,{value:"trace",children:["Trace",g.length>0&&` (${g.length})`]}),d.jsxs(Wr,{value:"artifacts",children:["Artifacts",p.length>0&&` (${p.length})`]})]}),d.jsxs(Jr,{value:"overview",className:"space-y-4",children:[c.task&&d.jsxs("section",{className:"space-y-2",children:[d.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Task"}),d.jsx(An,{children:d.jsx(On,{className:"pt-4",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm",children:c.task})})})]}),c.summary&&d.jsxs("section",{className:"space-y-2",children:[d.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Summary"}),d.jsx(An,{children:d.jsx(On,{className:"pt-4",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm",children:c.summary})})})]}),!c.task&&!c.summary&&d.jsx("p",{className:"text-sm text-muted-foreground",children:"No overview information available yet."})]}),d.jsx(Jr,{value:"agent-tree",children:d.jsx(fF,{runId:c.run_id})}),d.jsx(Jr,{value:"logs",children:Object.keys(c.agents).length>0?d.jsx(mF,{runId:c.run_id,agents:c.agents,active:f}):d.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents registered yet."})}),d.jsx(Jr,{value:"trace",children:g.length>0?d.jsx(RF,{events:g,runId:c.run_id}):d.jsx("p",{className:"text-sm text-muted-foreground",children:"No trace events recorded yet."})}),d.jsx(Jr,{value:"artifacts",children:p.length>0?d.jsx(CF,{artifacts:p,runId:c.run_id}):d.jsx("p",{className:"text-sm text-muted-foreground",children:"No artifacts recorded yet."})})]})]})}function bF({session:e,projectId:t,runId:r,onStopped:o}){const[s,l]=b.useState(!1),c=N9(),f=e.status==="starting"||e.status==="running";return d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("h1",{className:"text-2xl font-bold tracking-tight",children:["Session ",e.run_id.slice(0,16)]}),d.jsxs("div",{className:"flex gap-2",children:[f&&(s?d.jsxs("div",{className:"flex gap-1",children:[d.jsx(Me,{size:"sm",variant:"destructive",onClick:async()=>{await c.mutateAsync(r),l(!1),o()},disabled:c.isPending,children:"Confirm"}),d.jsx(Me,{size:"sm",variant:"outline",onClick:()=>l(!1),children:"Cancel"})]}):d.jsxs(Me,{variant:"destructive",onClick:()=>l(!0),children:[d.jsx(Cj,{className:"mr-2 h-4 w-4"}),"Stop Session"]})),d.jsx(Me,{variant:"outline",asChild:!0,children:d.jsxs(Rr,{to:`/projects/${t}`,children:[d.jsx(xj,{className:"mr-2 h-4 w-4"}),"Back"]})})]})]})}function wF({status:e}){const t=SF(e);return d.jsxs($t,{variant:"outline",className:Ee("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&d.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}function SF(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":return"warning";default:return"default"}}function EF({session:e}){return d.jsx(An,{children:d.jsx(On,{className:"pt-6",children:d.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[d.jsx("dt",{className:"font-medium text-muted-foreground",children:"Status"}),d.jsx("dd",{children:d.jsx(wF,{status:e.status})}),d.jsx("dt",{className:"font-medium text-muted-foreground",children:"Role"}),d.jsx("dd",{children:e.role}),d.jsx("dt",{className:"font-medium text-muted-foreground",children:"Runtime"}),d.jsx("dd",{children:e.runtime}),d.jsx("dt",{className:"font-medium text-muted-foreground",children:"Isolation"}),d.jsx("dd",{children:e.isolation}),d.jsx("dt",{className:"font-medium text-muted-foreground",children:"Started"}),d.jsx("dd",{children:ch(e.started_at)}),e.ended_at&&d.jsxs(d.Fragment,{children:[d.jsx("dt",{className:"font-medium text-muted-foreground",children:"Ended"}),d.jsx("dd",{children:ch(e.ended_at)})]}),d.jsx("dt",{className:"font-medium text-muted-foreground",children:"Duration"}),d.jsx("dd",{children:Zh(e.duration_ms)}),e.exit_code!==null&&d.jsxs(d.Fragment,{children:[d.jsx("dt",{className:"font-medium text-muted-foreground",children:"Exit Code"}),d.jsx("dd",{children:e.exit_code})]})]})})})}function _F(e){const t=[];for(const r of e){const o=r.data;r.event==="agent_spawn"&&(o.context_ref&&t.push({label:`Agent Context (${o.role||"agent"})`,hash:String(o.context_ref),event:r.event,agentId:o.agent_id?String(o.agent_id):void 0}),o.task_ref&&t.push({label:`Agent Task (${o.role||"agent"})`,hash:String(o.task_ref),event:r.event,agentId:o.agent_id?String(o.agent_id):void 0})),r.event==="session_end"&&o.output_ref&&t.push({label:"Session Output",hash:String(o.output_ref),event:r.event}),r.event==="agent_end"&&o.output_ref&&t.push({label:`Agent Output (${o.agent_id||"agent"})`,hash:String(o.output_ref),event:r.event,agentId:o.agent_id?String(o.agent_id):void 0}),r.event==="memory_get"&&(o.cards_ref&&t.push({label:`Memory Cards (${o.provider||"memory"})`,hash:String(o.cards_ref),event:r.event}),o.behavior_ref&&t.push({label:`Memory Get Behavior (${o.role||"agent"})`,hash:String(o.behavior_ref),event:r.event}),o.task_ref&&t.push({label:`Memory Get Task (${o.role||"agent"})`,hash:String(o.task_ref),event:r.event})),r.event==="memory_dump"&&(o.output_ref&&t.push({label:`Memory Dump Output (${o.provider||"memory"})`,hash:String(o.output_ref),event:r.event}),o.behavior_ref&&t.push({label:`Memory Dump Behavior (${o.provider||"memory"})`,hash:String(o.behavior_ref),event:r.event}),o.task_ref&&t.push({label:`Memory Dump Task (${o.provider||"memory"})`,hash:String(o.task_ref),event:r.event})),r.event==="delegate_start"&&o.context_ref&&t.push({label:`Delegation Context (${o.role||"delegate"})`,hash:String(o.context_ref),event:r.event}),r.event==="delegate_end"&&o.output_ref&&t.push({label:`Delegation Output (${o.role||"delegate"})`,hash:String(o.output_ref),event:r.event})}return t}function CF({artifacts:e,runId:t}){return d.jsx("div",{className:"space-y-1",children:e.map(r=>d.jsxs(R0,{children:[d.jsxs(M0,{className:"flex w-full items-center gap-2 rounded-md bg-muted/50 px-3 py-2 text-sm hover:bg-muted",children:[d.jsx(Yh,{className:"h-3 w-3 transition-transform [[data-state=open]>&]:rotate-90"}),d.jsx("span",{className:"font-medium text-primary",children:r.label})]}),d.jsx(A0,{children:d.jsx(NF,{runId:t,hash:r.hash})})]},`${r.event}-${r.hash}`))})}function NF({runId:e,hash:t}){const[r,o]=b.useState(null),[s,l]=b.useState(null);return b.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(c=>{if(!c.ok)throw new Error(`${c.status} ${c.statusText}`);return c.text()}).then(o).catch(c=>l(c.message))},[e,t]),s?d.jsxs("p",{className:"px-3 py-2 text-sm text-destructive",children:["Error: ",s]}):r===null?d.jsx("p",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Loading..."}):d.jsx(Wh,{className:"max-h-[300px]",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-b-md bg-muted/30 px-3 py-2 font-mono text-xs leading-relaxed",children:r})})}function jF({event:e}){const t=TF(e);return d.jsx($t,{variant:"outline",className:Ee("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:e})}function TF(e){return e.endsWith("_start")||e==="agent_spawn"?"running":e.endsWith("_end")?"success":e.includes("denied")||e.includes("error")?"error":"default"}function RF({events:e,runId:t}){const[r,o]=b.useState(null);return d.jsxs(d.Fragment,{children:[d.jsx(An,{children:d.jsx(On,{className:"p-0",children:d.jsxs(ui,{children:[d.jsx(di,{children:d.jsxs(Dn,{children:[d.jsx(Qe,{children:"Time"}),d.jsx(Qe,{children:"Event"}),d.jsx(Qe,{children:"Span"}),d.jsx(Qe,{children:"Details"})]})}),d.jsx(fi,{children:e.map((s,l)=>d.jsxs(Dn,{children:[d.jsx(Ze,{className:"text-sm text-muted-foreground",children:ch(s.ts)}),d.jsx(Ze,{children:d.jsx(jF,{event:s.event})}),d.jsx(Ze,{className:"font-mono text-xs text-muted-foreground",children:s.span_id.slice(0,8)}),d.jsx(Ze,{className:"max-w-[400px] text-sm",children:AF(s,(c,f)=>o({hash:c,label:f}))})]},l))})]})})}),d.jsx(si,{open:!!r,onOpenChange:()=>o(null),children:d.jsxs(ii,{className:"max-w-3xl overflow-hidden",children:[d.jsx(li,{children:d.jsx(ci,{children:r==null?void 0:r.label})}),r&&d.jsx(MF,{runId:t,hash:r.hash})]})})]})}function MF({runId:e,hash:t}){const[r,o]=b.useState(null),[s,l]=b.useState(null);return b.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(c=>{if(!c.ok)throw new Error(`${c.status} ${c.statusText}`);return c.text()}).then(o).catch(c=>l(c.message))},[e,t]),s?d.jsxs("p",{className:"text-sm text-destructive",children:["Error: ",s]}):r===null?d.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):d.jsx(Wh,{className:"max-h-[60vh]",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-4 font-mono text-xs leading-relaxed",children:r})})}function AF(e,t){const r=e.data,o=[];for(const[c,f]of Object.entries(r))if(c.endsWith("_ref")&&f){const m=c.replace(/_ref$/,"");o.push(d.jsx("button",{className:"rounded border border-primary/30 bg-primary/5 px-1.5 py-0.5 font-mono text-xs text-primary hover:bg-primary/10",onClick:()=>t(String(f),m),children:m},c))}const s=[];for(const[c,f]of Object.entries(r)){if(c.endsWith("_ref")||f==null||f==="")continue;const m=c==="duration_ms"?Zh(f):Array.isArray(f)?f.join(", "):String(f);s.push(d.jsxs("span",{children:[d.jsxs("span",{className:"text-muted-foreground",children:[c,"="]}),d.jsx("span",{children:m})]},c))}const l=r.summary?d.jsx("span",{className:"italic text-foreground/80",children:String(r.summary)},"summary"):null;return d.jsxs(d.Fragment,{children:[o.length>0&&d.jsx("div",{className:"mb-1 flex flex-wrap gap-1",children:o}),l,s.length>0&&d.jsx("div",{className:"flex flex-wrap gap-x-2 gap-y-0.5 text-xs text-muted-foreground",children:s})]})}const OF={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers"};function DF(){const{resourceType:e="roles"}=by(),{data:t,isLoading:r}=iu(e),[o,s]=b.useState(null),[l,c]=b.useState(!1),[f,m]=b.useState(!1),{data:h}=_9(e,o??"",{enabled:l&&!!o}),g=OF[e]??e;return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:g}),d.jsxs("p",{className:"text-sm text-muted-foreground",children:["Installed ",g.toLowerCase()," from StrawHub"]})]}),d.jsxs(Me,{onClick:()=>m(!0),size:"sm",children:[d.jsx(Gh,{className:"mr-2 h-4 w-4"}),"Install"]})]}),r?d.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((p,v)=>d.jsx(tn,{className:"h-12 w-full"},v))}):!t||t.length===0?d.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:["No ",g.toLowerCase()," installed yet."]}):d.jsxs(ui,{children:[d.jsx(di,{children:d.jsxs(Dn,{children:[d.jsx(Qe,{children:"Name"}),d.jsx(Qe,{children:"Version"}),d.jsx(Qe,{children:"Description"}),d.jsx(Qe,{children:"Source"})]})}),d.jsx(fi,{children:t.map(p=>d.jsxs(Dn,{className:"cursor-pointer",onClick:()=>{s(p.name),c(!0)},children:[d.jsx(Ze,{className:"font-medium",children:p.name}),d.jsx(Ze,{className:"text-sm text-muted-foreground",children:p.version??"—"}),d.jsx(Ze,{className:"max-w-[300px] truncate text-sm",children:p.description||"—"}),d.jsx(Ze,{children:d.jsx($t,{variant:"outline",className:"text-xs",children:p.source})})]},p.name))})]}),d.jsx(Zj,{resource:h??null,resourceType:e,open:l,onOpenChange:c}),d.jsx(O0,{open:f,onOpenChange:m,defaultType:e})]})}function kF(){return rn({queryKey:Ye.schedules.all,queryFn:()=>He.get("/schedules")})}function zF(){const e=ft();return Ct({mutationFn:t=>He.post("/schedules",t),onSuccess:()=>{e.invalidateQueries({queryKey:Ye.schedules.all})}})}function LF(){const e=ft();return Ct({mutationFn:({id:t,...r})=>He.put(`/schedules/${t}`,r),onSuccess:()=>{e.invalidateQueries({queryKey:Ye.schedules.all})}})}function PF(){const e=ft();return Ct({mutationFn:t=>He.delete(`/schedules/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ye.schedules.all})}})}function HF(){const e=ft();return Ct({mutationFn:({id:t,enable:r})=>He.post(`/schedules/${t}/${r?"enable":"disable"}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ye.schedules.all})}})}var lv={exports:{}},i_;function IF(){return i_||(i_=1,(function(e,t){(function(o,s){e.exports=s()})(globalThis,()=>(()=>{var r={949(c,f,m){Object.defineProperty(f,"__esModule",{value:!0}),f.CronParser=void 0;var h=m(515),g=(function(){function p(v,x,E){x===void 0&&(x=!0),E===void 0&&(E=!1),this.expression=v,this.dayOfWeekStartIndexZero=x,this.monthStartIndexZero=E}return p.prototype.parse=function(){var v,x,E=(v=this.expression)!==null&&v!==void 0?v:"";if(E==="@reboot")return x=["@reboot","","","","","",""],x;if(E.startsWith("@")){var S=this.parseSpecial(this.expression);x=this.extractParts(S)}else x=this.extractParts(this.expression);return this.normalize(x),this.validate(x),x},p.prototype.parseSpecial=function(v){var x={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},E=x[v];if(!E)throw new Error("Unknown special expression.");return E},p.prototype.extractParts=function(v){if(!this.expression)throw new Error("cron expression is empty");for(var x=v.trim().split(/[ ]+/),E=0;E<x.length;E++)if(x[E].includes(",")){var S=x[E].split(",").map(function(C){return C.trim()}).filter(function(C){return C!==""}).map(function(C){return isNaN(Number(C))?C:Number(C)}).filter(function(C){return C!==null&&C!==""});S.length===0&&S.push("*"),S.sort(function(C,j){return C!==null&&j!==null?C-j:0}),x[E]=S.map(function(C){return C!==null?C.toString():""}).join(",")}if(x.length<5)throw new Error("Expression has only ".concat(x.length," part").concat(x.length==1?"":"s",". At least 5 parts are required."));if(x.length==5)x.unshift(""),x.push("");else if(x.length==6){var _=/\d{4}$/.test(x[5])||x[4]=="?"||x[2]=="?";_?x.unshift(""):x.push("")}else if(x.length>7)throw new Error("Expression has ".concat(x.length," parts; too many!"));return x},p.prototype.normalize=function(v){var x=this;if(v[3]=v[3].replace("?","*"),v[5]=v[5].replace("?","*"),v[2]=v[2].replace("?","*"),v[0].indexOf("0/")==0&&(v[0]=v[0].replace("0/","*/")),v[1].indexOf("0/")==0&&(v[1]=v[1].replace("0/","*/")),v[2].indexOf("0/")==0&&(v[2]=v[2].replace("0/","*/")),v[3].indexOf("1/")==0&&(v[3]=v[3].replace("1/","*/")),v[4].indexOf("1/")==0&&(v[4]=v[4].replace("1/","*/")),v[6].indexOf("1/")==0&&(v[6]=v[6].replace("1/","*/")),v[5]=v[5].replace(/(^\d)|([^#/\s]\d)/g,function(O){var A=O.replace(/\D/,""),D=A;return x.dayOfWeekStartIndexZero?A=="7"&&(D="0"):D=(parseInt(A)-1).toString(),O.replace(A,D)}),v[5]=="L"&&(v[5]="6"),v[3]=="?"&&(v[3]="*"),v[3].indexOf("W")>-1&&(v[3].indexOf(",")>-1||v[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var E={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var S in E)v[5]=v[5].replace(new RegExp(S,"gi"),E[S].toString());v[4]=v[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(O){var A=O.replace(/\D/,""),D=A;return x.monthStartIndexZero&&(D=(parseInt(A)+1).toString()),O.replace(A,D)});var _={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var C in _)v[4]=v[4].replace(new RegExp(C,"gi"),_[C].toString());v[0]=="0"&&(v[0]=""),!/\*|\-|\,|\//.test(v[2])&&(/\*|\//.test(v[1])||/\*|\//.test(v[0]))&&(v[2]+="-".concat(v[2]));for(var j=0;j<v.length;j++)if(v[j].indexOf(",")!=-1&&(v[j]=v[j].split(",").filter(function(O){return O!==""}).join(",")||"*"),v[j]=="*/1"&&(v[j]="*"),v[j].indexOf("/")>-1&&!/^\*|\-|\,/.test(v[j])){var N=null;switch(j){case 4:N="12";break;case 5:N="6";break;case 6:N="9999";break;default:N=null;break}if(N!==null){var R=v[j].split("/");v[j]="".concat(R[0],"-").concat(N,"/").concat(R[1])}}},p.prototype.validate=function(v){var x="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(v[0],x),this.validateOnlyExpectedCharactersFound(v[1],x),this.validateOnlyExpectedCharactersFound(v[2],x),this.validateOnlyExpectedCharactersFound(v[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(v[4],x),this.validateOnlyExpectedCharactersFound(v[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(v[6],x),this.validateAnyRanges(v)},p.prototype.validateAnyRanges=function(v){h.default.secondRange(v[0]),h.default.minuteRange(v[1]),h.default.hourRange(v[2]),h.default.dayOfMonthRange(v[3]),h.default.monthRange(v[4],this.monthStartIndexZero),h.default.dayOfWeekRange(v[5],this.dayOfWeekStartIndexZero)},p.prototype.validateOnlyExpectedCharactersFound=function(v,x){var E=v.match(new RegExp("[^".concat(x,"]+"),"gi"));if(E&&E.length)throw new Error("Expression contains invalid values: '".concat(E.toString(),"'"))},p})();f.CronParser=g},333(c,f,m){Object.defineProperty(f,"__esModule",{value:!0}),f.ExpressionDescriptor=void 0;var h=m(823),g=m(949),p=(function(){function v(x,E){if(this.expression=x,this.options=E,this.expressionParts=new Array(5),!this.options.locale&&v.defaultLocale&&(this.options.locale=v.defaultLocale),!v.locales[this.options.locale]){var S=Object.keys(v.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(S,"'.")),this.options.locale=S}this.i18n=v.locales[this.options.locale],E.use24HourTimeFormat===void 0&&(E.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return v.toString=function(x,E){var S=E===void 0?{}:E,_=S.throwExceptionOnParseError,C=_===void 0?!0:_,j=S.verbose,N=j===void 0?!1:j,R=S.dayOfWeekStartIndexZero,O=R===void 0?!0:R,A=S.monthStartIndexZero,D=A===void 0?!1:A,P=S.use24HourTimeFormat,H=S.locale,Q=H===void 0?null:H,V=S.logicalAndDayFields,q=V===void 0?!1:V,ee={throwExceptionOnParseError:C,verbose:N,dayOfWeekStartIndexZero:O,monthStartIndexZero:D,use24HourTimeFormat:P,locale:Q,logicalAndDayFields:q};ee.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var B=new v(x,ee);return B.getFullDescription()},v.initialize=function(x,E){E===void 0&&(E="en"),v.specialCharacters=["/","-",",","*"],v.defaultLocale=E,x.load(v.locales)},v.prototype.getFullDescription=function(){var x,E,S="";try{var _=new g.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=_.parse(),this.expressionParts[0]==="@reboot")return((E=(x=this.i18n).atReboot)===null||E===void 0?void 0:E.call(x))||"Run once, at startup";var C=this.getTimeOfDayDescription(),j=this.getDayOfMonthDescription(),N=this.getMonthDescription(),R=this.getDayOfWeekDescription(),O=this.getYearDescription();S+=C+j+R+N+O,S=this.transformVerbosity(S,!!this.options.verbose),S=S.charAt(0).toLocaleUpperCase()+S.substr(1)}catch(A){if(!this.options.throwExceptionOnParseError)S=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(A)}return S},v.prototype.getTimeOfDayDescription=function(){var x=this.expressionParts[0],E=this.expressionParts[1],S=this.expressionParts[2],_="";if(!h.StringUtilities.containsAny(E,v.specialCharacters)&&!h.StringUtilities.containsAny(S,v.specialCharacters)&&!h.StringUtilities.containsAny(x,v.specialCharacters))_+=this.i18n.atSpace()+this.formatTime(S,E,x);else if(!x&&E.indexOf("-")>-1&&!(E.indexOf(",")>-1)&&!(E.indexOf("/")>-1)&&!h.StringUtilities.containsAny(S,v.specialCharacters)){var C=E.split("-");_+=h.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(S,C[0],""),this.formatTime(S,C[1],""))}else if(!x&&S.indexOf(",")>-1&&S.indexOf("-")==-1&&S.indexOf("/")==-1&&!h.StringUtilities.containsAny(E,v.specialCharacters)){var j=S.split(",");_+=this.i18n.at();for(var N=0;N<j.length;N++)_+=" ",_+=this.formatTime(j[N],E,""),N<j.length-2&&(_+=","),N==j.length-2&&(_+=this.i18n.spaceAnd())}else{var R=this.getSecondsDescription(),O=this.getMinutesDescription(),A=this.getHoursDescription();if(_+=R,_&&O&&(_+=", "),_+=O,O===A)return _;_&&A&&(_+=", "),_+=A}return _},v.prototype.getSecondsDescription=function(){var x=this,E=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(S){return S},function(S){return h.StringUtilities.format(x.i18n.everyX0Seconds(S),S)},function(S){return x.i18n.secondsX0ThroughX1PastTheMinute()},function(S){return S=="0"?"":parseInt(S)<20?x.i18n.atX0SecondsPastTheMinute(S):x.i18n.atX0SecondsPastTheMinuteGt20()||x.i18n.atX0SecondsPastTheMinute(S)});return E},v.prototype.getMinutesDescription=function(){var x=this,E=this.expressionParts[0],S=this.expressionParts[2],_=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(C){return C},function(C){return h.StringUtilities.format(x.i18n.everyX0Minutes(C),C)},function(C){return x.i18n.minutesX0ThroughX1PastTheHour()},function(C){var j,N;try{return C=="0"&&S.indexOf("/")==-1&&E==""?x.i18n.everyHour():C=="0"?((N=(j=x.i18n).onTheHour)===null||N===void 0?void 0:N.call(j))||x.i18n.atX0MinutesPastTheHour(C):parseInt(C)<20?x.i18n.atX0MinutesPastTheHour(C):x.i18n.atX0MinutesPastTheHourGt20()||x.i18n.atX0MinutesPastTheHour(C)}catch{return x.i18n.atX0MinutesPastTheHour(C)}});return _},v.prototype.getHoursDescription=function(){var x=this,E=this.expressionParts[2],S=0,_=[];E.split("/")[0].split(",").forEach(function(N){var R=N.split("-");R.length===2&&_.push({value:R[1],index:S+1}),S+=R.length});var C=0,j=this.getSegmentDescription(E,this.i18n.everyHour(),function(N){var R=_.find(function(A){return A.value===N&&A.index===C}),O=R&&x.expressionParts[1]!=="0";return C++,O?x.formatTime(N,"59",""):x.formatTime(N,"0","")},function(N){return h.StringUtilities.format(x.i18n.everyX0Hours(N),N)},function(N){return x.i18n.betweenX0AndX1()},function(N){return x.i18n.atX0()});return j},v.prototype.getDayOfWeekDescription=function(){var x=this,E=this.i18n.daysOfTheWeek(),S=null;return this.expressionParts[5]=="*"?S="":S=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(_,C){var j=_;_.indexOf("#")>-1?j=_.substring(0,_.indexOf("#")):_.indexOf("L")>-1&&(j=j.replace("L",""));var N=parseInt(j),R=x.i18n.daysOfTheWeekInCase?x.i18n.daysOfTheWeekInCase(C)[N]:E[N];if(_.indexOf("#")>-1){var O=null,A=_.substring(_.indexOf("#")+1),D=_.substring(0,_.indexOf("#"));switch(A){case"1":O=x.i18n.first(D);break;case"2":O=x.i18n.second(D);break;case"3":O=x.i18n.third(D);break;case"4":O=x.i18n.fourth(D);break;case"5":O=x.i18n.fifth(D);break}R=O+" "+R}return R},function(_){return parseInt(_)==1?"":h.StringUtilities.format(x.i18n.commaEveryX0DaysOfTheWeek(_),_)},function(_){var C=_.substring(0,_.indexOf("-")),j=x.expressionParts[3]!="*";return j?x.i18n.commaAndX0ThroughX1(C):x.i18n.commaX0ThroughX1(C)},function(_){var C=null;if(_.indexOf("#")>-1){var j=_.substring(_.indexOf("#")+1),N=_.substring(0,_.indexOf("#"));C=x.i18n.commaOnThe(j,N).trim()+x.i18n.spaceX0OfTheMonth()}else if(_.indexOf("L")>-1)C=x.i18n.commaOnTheLastX0OfTheMonth(_.replace("L",""));else{var R=x.expressionParts[3]!="*";R?x.options.logicalAndDayFields?C=x.i18n.commaOnlyOnX0(_):C=x.i18n.commaAndOnX0():C=x.i18n.commaOnlyOnX0(_)}return C}),S},v.prototype.getMonthDescription=function(){var x=this,E=this.i18n.monthsOfTheYear(),S=this.getSegmentDescription(this.expressionParts[4],"",function(_,C){return C&&x.i18n.monthsOfTheYearInCase?x.i18n.monthsOfTheYearInCase(C)[parseInt(_)-1]:E[parseInt(_)-1]},function(_){return parseInt(_)==1?"":h.StringUtilities.format(x.i18n.commaEveryX0Months(_),_)},function(_){return x.i18n.commaMonthX0ThroughMonthX1()||x.i18n.commaX0ThroughX1()},function(_){return x.i18n.commaOnlyInMonthX0?x.i18n.commaOnlyInMonthX0():x.i18n.commaOnlyInX0()});return S},v.prototype.getDayOfMonthDescription=function(){var x=this,E=null,S=this.expressionParts[3];switch(S){case"L":E=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":E=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var _=S.match(/(\d{1,2}W)|(W\d{1,2})/);if(_){var C=parseInt(_[0].replace("W","")),j=C==1?this.i18n.firstWeekday():h.StringUtilities.format(this.i18n.weekdayNearestDayX0(),C.toString());E=h.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),j);break}else{var N=S.match(/L-(\d{1,2})/);if(N){var R=N[1];E=h.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(R),R);break}else{if(S=="*"&&this.expressionParts[5]!="*")return"";E=this.getSegmentDescription(S,this.i18n.commaEveryDay(),function(O){return O=="L"?x.i18n.lastDay():x.i18n.dayX0?h.StringUtilities.format(x.i18n.dayX0(),O):O},function(O){return O=="1"?x.i18n.commaEveryDay():x.i18n.commaEveryX0Days(O)},function(O){return x.i18n.commaBetweenDayX0AndX1OfTheMonth(O)},function(O){return x.i18n.commaOnDayX0OfTheMonth(O)})}break}}return E},v.prototype.getYearDescription=function(){var x=this,E=this.getSegmentDescription(this.expressionParts[6],"",function(S){return/^\d+$/.test(S)?new Date(parseInt(S),1).getFullYear().toString():S},function(S){return h.StringUtilities.format(x.i18n.commaEveryX0Years(S),S)},function(S){return x.i18n.commaYearX0ThroughYearX1()||x.i18n.commaX0ThroughX1()},function(S){return x.i18n.commaOnlyInYearX0?x.i18n.commaOnlyInYearX0():x.i18n.commaOnlyInX0()});return E},v.prototype.getSegmentDescription=function(x,E,S,_,C,j){var N=null,R=x.indexOf("/")>-1,O=x.indexOf("-")>-1,A=x.indexOf(",")>-1;if(!x)N="";else if(x==="*")N=E;else if(!R&&!O&&!A)N=h.StringUtilities.format(j(x),S(x));else if(A){for(var D=x.split(","),P="",H=0;H<D.length;H++)if(H>0&&D.length>2&&(P+=",",H<D.length-1&&(P+=" ")),H>0&&D.length>1&&(H==D.length-1||D.length==2)&&(P+="".concat(this.i18n.spaceAnd()," ")),D[H].indexOf("/")>-1||D[H].indexOf("-")>-1){var Q=D[H].indexOf("-")>-1&&D[H].indexOf("/")==-1,V=this.getSegmentDescription(D[H],E,S,_,Q?this.i18n.commaX0ThroughX1:C,j);Q&&(V=V.replace(", ","")),P+=V}else if(!R)P+=S(D[H]);else{var q=this.getSegmentDescription(D[H],E,S,_,C,j);q&&q.startsWith(", ")&&(q=q.substring(2)),P+=q}R?N=P:N=h.StringUtilities.format(j(x),P)}else if(R){var D=x.split("/");if(N=h.StringUtilities.format(_(D[1]),D[1]),D[0].indexOf("-")>-1){var ee=this.generateRangeSegmentDescription(D[0],C,S);ee.indexOf(", ")!=0&&(N+=", "),N+=ee}else if(D[0].indexOf("*")==-1){var B=h.StringUtilities.format(j(D[0]),S(D[0]));B=B.replace(", ",""),N+=h.StringUtilities.format(this.i18n.commaStartingX0(),B)}}else O&&(N=this.generateRangeSegmentDescription(x,C,S));return N},v.prototype.generateRangeSegmentDescription=function(x,E,S){var _="",C=x.split("-"),j=S(C[0],1),N=S(C[1],2),R=E(x);return _+=h.StringUtilities.format(R,j,N),_},v.prototype.formatTime=function(x,E,S){var _=0,C=0,j=parseInt(x)+_,N=parseInt(E)+C;N>=60?(N-=60,j+=1):N<0&&(N+=60,j-=1),j>=24?j=j-24:j<0&&(j=24+j);var R="",O=!1;this.options.use24HourTimeFormat||(O=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),R=O?"".concat(this.getPeriod(j)," "):" ".concat(this.getPeriod(j)),j>12&&(j-=12),j===0&&(j=12));var A="";return S&&(A=":".concat(("00"+S).substring(S.length))),"".concat(O?R:"").concat(("00"+j.toString()).substring(j.toString().length),":").concat(("00"+N.toString()).substring(N.toString().length)).concat(A).concat(O?"":R)},v.prototype.transformVerbosity=function(x,E){if(!E&&(x=x.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),x=x.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),x=x.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),x=x.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var S=0,_=Object.entries(this.i18n.conciseVerbosityReplacements());S<_.length;S++){var C=_[S],j=C[0],N=C[1];x=x.replace(new RegExp(j,"g"),N)}return x},v.prototype.getPeriod=function(x){return x>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},v.locales={},v})();f.ExpressionDescriptor=p},747(c,f,m){Object.defineProperty(f,"__esModule",{value:!0}),f.enLocaleLoader=void 0;var h=m(486),g=(function(){function p(){}return p.prototype.load=function(v){v.en=new h.en},p})();f.enLocaleLoader=g},486(c,f){Object.defineProperty(f,"__esModule",{value:!0}),f.en=void 0;var m=(function(){function h(){}return h.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},h.prototype.atX0MinutesPastTheHourGt20=function(){return null},h.prototype.commaMonthX0ThroughMonthX1=function(){return null},h.prototype.commaYearX0ThroughYearX1=function(){return null},h.prototype.use24HourTimeFormatByDefault=function(){return!1},h.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},h.prototype.everyMinute=function(){return"every minute"},h.prototype.everyHour=function(){return"every hour"},h.prototype.atSpace=function(){return"At "},h.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},h.prototype.at=function(){return"At"},h.prototype.spaceAnd=function(){return" and"},h.prototype.everySecond=function(){return"every second"},h.prototype.everyX0Seconds=function(){return"every %s seconds"},h.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},h.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},h.prototype.everyX0Minutes=function(){return"every %s minutes"},h.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},h.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},h.prototype.everyX0Hours=function(){return"every %s hours"},h.prototype.betweenX0AndX1=function(){return"between %s and %s"},h.prototype.atX0=function(){return"at %s"},h.prototype.commaEveryDay=function(){return", every day"},h.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},h.prototype.commaX0ThroughX1=function(){return", %s through %s"},h.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},h.prototype.first=function(){return"first"},h.prototype.second=function(){return"second"},h.prototype.third=function(){return"third"},h.prototype.fourth=function(){return"fourth"},h.prototype.fifth=function(){return"fifth"},h.prototype.commaOnThe=function(){return", on the "},h.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},h.prototype.lastDay=function(){return"the last day"},h.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},h.prototype.commaOnlyOnX0=function(){return", only on %s"},h.prototype.commaAndOnX0=function(){return", and on %s"},h.prototype.commaEveryX0Months=function(){return", every %s months"},h.prototype.commaOnlyInX0=function(){return", only in %s"},h.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},h.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},h.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},h.prototype.firstWeekday=function(){return"first weekday"},h.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},h.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},h.prototype.commaEveryX0Days=function(){return", every %s days in a month"},h.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},h.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},h.prototype.commaEveryHour=function(){return", every hour"},h.prototype.commaEveryX0Years=function(){return", every %s years"},h.prototype.commaStartingX0=function(){return", starting %s"},h.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},h.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},h.prototype.atReboot=function(){return"Run once, at startup"},h.prototype.onTheHour=function(){return"on the hour"},h})();f.en=m},515(c,f){Object.defineProperty(f,"__esModule",{value:!0});function m(g,p){if(!g)throw new Error(p)}var h=(function(){function g(){}return g.secondRange=function(p){for(var v=p.split(","),x=0;x<v.length;x++)if(!isNaN(parseInt(v[x],10))){var E=parseInt(v[x],10);m(E>=0&&E<=59,"seconds part must be >= 0 and <= 59")}},g.minuteRange=function(p){for(var v=p.split(","),x=0;x<v.length;x++)if(!isNaN(parseInt(v[x],10))){var E=parseInt(v[x],10);m(E>=0&&E<=59,"minutes part must be >= 0 and <= 59")}},g.hourRange=function(p){for(var v=p.split(","),x=0;x<v.length;x++)if(!isNaN(parseInt(v[x],10))){var E=parseInt(v[x],10);m(E>=0&&E<=23,"hours part must be >= 0 and <= 23")}},g.dayOfMonthRange=function(p){for(var v=p.split(","),x=0;x<v.length;x++)if(!isNaN(parseInt(v[x],10))){var E=parseInt(v[x],10);m(E>=1&&E<=31,"DOM part must be >= 1 and <= 31")}},g.monthRange=function(p,v){for(var x=p.split(","),E=0;E<x.length;E++)if(!isNaN(parseInt(x[E],10))){var S=parseInt(x[E],10);m(S>=1&&S<=12,v?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},g.dayOfWeekRange=function(p,v){for(var x=p.split(","),E=0;E<x.length;E++)if(!isNaN(parseInt(x[E],10))){var S=parseInt(x[E],10);m(S>=0&&S<=6,v?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},g})();f.default=h},823(c,f){Object.defineProperty(f,"__esModule",{value:!0}),f.StringUtilities=void 0;var m=(function(){function h(){}return h.format=function(g){for(var p=[],v=1;v<arguments.length;v++)p[v-1]=arguments[v];return g.replace(/%s/g,function(x){return p.shift()})},h.containsAny=function(g,p){return p.some(function(v){return g.indexOf(v)>-1})},h})();f.StringUtilities=m}},o={};function s(c){var f=o[c];if(f!==void 0)return f.exports;var m=o[c]={exports:{}};return r[c](m,m.exports,s),m.exports}var l={};return(()=>{var c=l;Object.defineProperty(c,"__esModule",{value:!0}),c.toString=void 0;var f=s(333),m=s(747);f.ExpressionDescriptor.initialize(new m.enLocaleLoader),c.default=f.ExpressionDescriptor;var h=f.ExpressionDescriptor.toString;c.toString=h})(),l})())})(lv)),lv.exports}var BF=IF();const UF=Eh(BF),$F=[{label:"Every 1 minute",value:"* * * * *"},{label:"Every 5 minutes",value:"*/5 * * * *"},{label:"Every hour",value:"0 * * * *"},{label:"Daily at midnight",value:"0 0 * * *"},{label:"Weekdays at 9am",value:"0 9 * * 1-5"},{label:"Weekly Monday 9am",value:"0 9 * * 1"}];function VF({open:e,onOpenChange:t,editing:r}){const{data:o}=Ul(),{data:s}=Qj(),l=zF(),c=LF(),[f,m]=b.useState(""),[h,g]=b.useState(""),[p,v]=b.useState(""),[x,E]=b.useState(""),[S,_]=b.useState(""),[C,j]=b.useState(""),[N,R]=b.useState(!0),[O,A]=b.useState(!1);b.useEffect(()=>{e&&r?(m(r.name),g(String(r.project_id)),v(r.task),E(r.cron_expr),_(r.role??""),j(r.system_prompt??""),R(r.skip_if_running)):e&&!r&&D()},[e,r]);function D(){m(""),g(""),v(""),E(""),_(""),j(""),R(!0),A(!1)}async function P(q){q.preventDefault();try{const ee={name:f.trim(),task:p.trim(),cron_expr:x.trim(),role:S.trim()||void 0,system_prompt:C.trim()||void 0,skip_if_running:N};r?await c.mutateAsync({id:r.id,...ee}):await l.mutateAsync({...ee,project_id:Number(h)}),D(),t(!1)}catch{}}const H=b.useMemo(()=>{if(!x.trim())return null;try{return UF.toString(x.trim())}catch{return null}},[x]),Q=l.isPending||c.isPending,V=l.error||c.error;return d.jsx(si,{open:e,onOpenChange:t,children:d.jsxs(ii,{className:"max-w-lg",children:[d.jsx(li,{children:d.jsx(ci,{children:r?"Edit Schedule":"Create Schedule"})}),d.jsxs("form",{onSubmit:P,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Rt,{htmlFor:"sched-name",children:["Name ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx(Lt,{id:"sched-name",value:f,onChange:q=>m(q.target.value),placeholder:"e.g. github-issue-checker",required:!0,autoFocus:!0})]}),!r&&d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Rt,{htmlFor:"sched-project",children:["Project ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsxs(Jo,{value:h,onValueChange:g,required:!0,children:[d.jsx(ts,{id:"sched-project",children:d.jsx(es,{placeholder:"Select a project"})}),d.jsx(ns,{children:(o??[]).map(q=>d.jsx(Yn,{value:String(q.id),children:q.display_name},q.id))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Rt,{htmlFor:"sched-task",children:["Task ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx(uh,{id:"sched-task",value:p,onChange:q=>v(q.target.value),placeholder:"What should the agent do each time this runs?",required:!0,rows:3})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(Rt,{htmlFor:"sched-cron",children:["Cron Expression ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsxs(sh,{children:[d.jsx(ih,{asChild:!0,children:d.jsxs(Me,{variant:"ghost",size:"sm",className:"h-6 text-xs",children:["Presets",d.jsx(su,{className:"ml-1 h-3 w-3"})]})}),d.jsx(lh,{align:"end",children:$F.map(q=>d.jsxs(Gc,{onClick:()=>E(q.value),children:[d.jsx("span",{className:"mr-3 font-mono text-xs text-muted-foreground",children:q.value}),q.label]},q.value))})]})]}),d.jsx(Lt,{id:"sched-cron",value:x,onChange:q=>E(q.target.value),placeholder:"*/5 * * * *",required:!0,className:"font-mono"}),H&&d.jsx("p",{className:"text-xs text-muted-foreground",children:H})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Rt,{htmlFor:"sched-role",children:"Role"}),d.jsx(Lt,{id:"sched-role",value:S,onChange:q=>_(q.target.value),placeholder:(s==null?void 0:s[0])??"orchestrator",list:"sched-role-list"}),d.jsx("datalist",{id:"sched-role-list",children:(s??[]).map(q=>d.jsx("option",{value:q},q))})]}),d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:N,onChange:q=>R(q.target.checked),className:"rounded border-input"}),d.jsx("span",{className:"text-sm",children:"Skip if already running"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"— don't start a new session while a previous one is still active"})]}),d.jsxs(R0,{open:O,onOpenChange:A,children:[d.jsx(M0,{asChild:!0,children:d.jsxs(Me,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[d.jsx(su,{className:`h-3 w-3 transition-transform ${O?"rotate-180":""}`}),"Advanced Options"]})}),d.jsx(A0,{className:"space-y-4 pt-2",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx(Rt,{htmlFor:"sched-prompt",children:"System Prompt"}),d.jsx(uh,{id:"sched-prompt",value:C,onChange:q=>j(q.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),V&&d.jsx("p",{className:"text-sm text-destructive",children:V.message}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(Me,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),d.jsx(Me,{type:"submit",disabled:Q,children:Q?"Saving...":r?"Update":"Create"})]})]})]})})}function l_(e){if(!e)return"—";try{const t=new Date(e),r=new Date,o=t.getTime()-r.getTime(),s=Math.abs(o);if(s<6e4)return o>0?"in < 1m":"< 1m ago";if(s<36e5){const l=Math.round(s/6e4);return o>0?`in ${l}m`:`${l}m ago`}if(s<864e5){const l=Math.round(s/36e5);return o>0?`in ${l}h`:`${l}h ago`}return t.toLocaleDateString()}catch{return"—"}}function qF({schedule:e}){return e.enabled?e.last_error?d.jsx(vj,{children:d.jsxs(i6,{children:[d.jsx(l6,{children:d.jsx($t,{variant:"destructive",children:"Error"})}),d.jsx(c6,{className:"max-w-xs",children:d.jsx("p",{className:"text-xs",children:e.last_error})})]})}):d.jsx($t,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Active"}):d.jsx($t,{variant:"secondary",children:"Disabled"})}function FF(){const{data:e,isLoading:t,error:r}=kF(),[o,s]=b.useState(!1),[l,c]=b.useState(null),f=PF(),m=HF();if(t)return d.jsxs("div",{className:"space-y-6",children:[d.jsx(tn,{className:"h-8 w-48"}),d.jsx(tn,{className:"h-64 rounded-lg"})]});if(r)return d.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[d.jsx(Zo,{className:"h-4 w-4"}),d.jsxs("span",{children:["Error: ",r.message]})]});const h=e??[];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Scheduled Tasks"}),d.jsxs(Me,{onClick:()=>{c(null),s(!0)},children:[d.jsx(Wv,{className:"mr-2 h-4 w-4"}),"Create Schedule"]})]}),h.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[d.jsx("p",{className:"text-muted-foreground",children:"No scheduled tasks yet."}),d.jsxs(Me,{variant:"outline",className:"mt-4",onClick:()=>{c(null),s(!0)},children:[d.jsx(Wv,{className:"mr-2 h-4 w-4"}),"Create your first schedule"]})]}):d.jsx("div",{className:"rounded-lg border",children:d.jsxs(ui,{children:[d.jsx(di,{children:d.jsxs(Dn,{children:[d.jsx(Qe,{children:"Name"}),d.jsx(Qe,{children:"Project"}),d.jsx(Qe,{children:"Cron"}),d.jsx(Qe,{children:"Next Run"}),d.jsx(Qe,{children:"Last Run"}),d.jsx(Qe,{children:"Status"}),d.jsx(Qe,{className:"w-[120px]",children:"Actions"})]})}),d.jsx(fi,{children:h.map(g=>d.jsxs(Dn,{children:[d.jsx(Ze,{className:"font-medium",children:g.name}),d.jsx(Ze,{className:"text-muted-foreground",children:g.project_name}),d.jsx(Ze,{children:d.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:g.cron_expr})}),d.jsx(Ze,{className:"text-sm text-muted-foreground",children:l_(g.next_run_at)}),d.jsx(Ze,{className:"text-sm text-muted-foreground",children:l_(g.last_run_at)}),d.jsx(Ze,{children:d.jsx(qF,{schedule:g})}),d.jsx(Ze,{children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(Me,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{c(g),s(!0)},children:d.jsx(cP,{className:"h-3.5 w-3.5"})}),d.jsx(Me,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m.mutate({id:g.id,enable:!g.enabled}),children:g.enabled?d.jsx(iP,{className:"h-3.5 w-3.5"}):d.jsx(_0,{className:"h-3.5 w-3.5"})}),d.jsx(Me,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${g.name}"?`)&&f.mutate(g.id)},children:d.jsx(C0,{className:"h-3.5 w-3.5"})})]})})]},g.id))})]})}),d.jsx(VF,{open:o,onOpenChange:s,editing:l})]})}function XF(){return rn({queryKey:Ye.config.global,queryFn:()=>He.get("/config/global")})}function YF(){const e=ft();return Ct({mutationFn:t=>He.put("/config/global",t),onSuccess:()=>{e.invalidateQueries({queryKey:Ye.config.global})}})}function GF(){const e=ft();return Ct({mutationFn:({projectId:t,data:r})=>He.put(`/projects/${t}/config`,r),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:Ye.projects.config(r.projectId)})}})}function cv(e){const t=e.orchestrator??{},r=e.policy??{},o=e.session??{},s=e.trace??{};return{runtime:ir(e.runtime),isolation:ir(e.isolation),memory:ir(e.memory),orchestrator_role:ir(t.role),orchestrator_permission_mode:ir(t.permission_mode),policy_max_depth:ir(r.max_depth),policy_agent_timeout:ir(r.agent_timeout),policy_max_delegate_retries:ir(r.max_delegate_retries),session_merge_strategy:ir(o.merge_strategy),session_pull_before_session:ir(o.pull_before_session),session_pr_command:ir(o.pr_command),trace_enabled:ir(s.enabled)}}function ir(e){return e==null?"":String(e)}function KF(e){const t={};e.runtime&&(t.runtime=e.runtime),e.isolation&&(t.isolation=e.isolation),e.memory&&(t.memory=e.memory);const r={};e.orchestrator_role&&(r.role=e.orchestrator_role),e.orchestrator_permission_mode&&(r.permission_mode=e.orchestrator_permission_mode),Object.keys(r).length>0&&(t.orchestrator=r);const o={};e.policy_max_depth&&(o.max_depth=Number(e.policy_max_depth)),e.policy_agent_timeout&&(o.agent_timeout=Number(e.policy_agent_timeout)),e.policy_max_delegate_retries&&(o.max_delegate_retries=Number(e.policy_max_delegate_retries)),Object.keys(o).length>0&&(t.policy=o);const s={};e.session_merge_strategy&&(s.merge_strategy=e.session_merge_strategy),e.session_pull_before_session&&(s.pull_before_session=e.session_pull_before_session),e.session_pr_command&&(s.pr_command=e.session_pr_command),Object.keys(s).length>0&&(t.session=s);const l={};return e.trace_enabled&&(l.enabled=e.trace_enabled==="true"),Object.keys(l).length>0&&(t.trace=l),t}const QF=["none","worktree"],ZF=["default","plan","bypassPermissions"],WF=["auto","local","pr"],JF=["prompt","always","never"],eX=["true","false"],uv="__empty__";function c_({values:e,placeholders:t,onSave:r,saving:o}){const[s,l]=b.useState(cv(e)),{data:c}=iu("agents"),{data:f}=iu("roles"),m=t?cv(t):void 0;b.useEffect(()=>{l(cv(e))},[e]);const h=x=>E=>l(S=>({...S,[x]:E})),g=()=>{r(KF(s))},p=(c??[]).map(x=>x.name),v=(f??[]).map(x=>x.name);return d.jsxs("div",{className:"flex flex-col gap-6",children:[d.jsxs("section",{className:"flex flex-col gap-3",children:[d.jsx("h3",{className:"text-sm font-semibold",children:"General"}),d.jsx(ko,{}),d.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[d.jsxs(lr,{label:"Runtime",children:[d.jsx(Lt,{list:"cfg-dl-runtime",value:s.runtime,onChange:x=>h("runtime")(x.target.value),placeholder:(m==null?void 0:m.runtime)||"strawpot-claude-code",className:"h-8 text-xs"}),p.length>0&&d.jsx("datalist",{id:"cfg-dl-runtime",children:p.map(x=>d.jsx("option",{value:x},x))})]}),d.jsx(lr,{label:"Isolation",children:d.jsx(qc,{value:s.isolation,onChange:h("isolation"),options:QF,placeholder:(m==null?void 0:m.isolation)||"none",allowEmpty:!0})}),d.jsx(lr,{label:"Memory",children:d.jsx(Lt,{value:s.memory,onChange:x=>h("memory")(x.target.value),placeholder:(m==null?void 0:m.memory)||"dial",className:"h-8 text-xs"})})]})]}),d.jsxs("section",{className:"flex flex-col gap-3",children:[d.jsx("h3",{className:"text-sm font-semibold",children:"Orchestrator"}),d.jsx(ko,{}),d.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[d.jsxs(lr,{label:"Role",children:[d.jsx(Lt,{list:"cfg-dl-role",value:s.orchestrator_role,onChange:x=>h("orchestrator_role")(x.target.value),placeholder:(m==null?void 0:m.orchestrator_role)||"ai-ceo",className:"h-8 text-xs"}),v.length>0&&d.jsx("datalist",{id:"cfg-dl-role",children:v.map(x=>d.jsx("option",{value:x},x))})]}),d.jsx(lr,{label:"Permission Mode",children:d.jsx(qc,{value:s.orchestrator_permission_mode,onChange:h("orchestrator_permission_mode"),options:ZF,placeholder:(m==null?void 0:m.orchestrator_permission_mode)||"default",allowEmpty:!0})})]})]}),d.jsxs("section",{className:"flex flex-col gap-3",children:[d.jsx("h3",{className:"text-sm font-semibold",children:"Policy"}),d.jsx(ko,{}),d.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[d.jsx(lr,{label:"Max Depth",children:d.jsx(Lt,{type:"number",value:s.policy_max_depth,onChange:x=>h("policy_max_depth")(x.target.value),placeholder:(m==null?void 0:m.policy_max_depth)||"3",className:"h-8 text-xs"})}),d.jsx(lr,{label:"Agent Timeout",children:d.jsx(Lt,{type:"number",value:s.policy_agent_timeout,onChange:x=>h("policy_agent_timeout")(x.target.value),placeholder:(m==null?void 0:m.policy_agent_timeout)||"none",className:"h-8 text-xs"})}),d.jsx(lr,{label:"Max Delegate Retries",children:d.jsx(Lt,{type:"number",value:s.policy_max_delegate_retries,onChange:x=>h("policy_max_delegate_retries")(x.target.value),placeholder:(m==null?void 0:m.policy_max_delegate_retries)||"0",className:"h-8 text-xs"})})]})]}),d.jsxs("section",{className:"flex flex-col gap-3",children:[d.jsx("h3",{className:"text-sm font-semibold",children:"Session"}),d.jsx(ko,{}),d.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[d.jsx(lr,{label:"Merge Strategy",children:d.jsx(qc,{value:s.session_merge_strategy,onChange:h("session_merge_strategy"),options:WF,placeholder:(m==null?void 0:m.session_merge_strategy)||"auto",allowEmpty:!0})}),d.jsx(lr,{label:"Pull Before Session",children:d.jsx(qc,{value:s.session_pull_before_session,onChange:h("session_pull_before_session"),options:JF,placeholder:(m==null?void 0:m.session_pull_before_session)||"prompt",allowEmpty:!0})}),d.jsx(lr,{label:"PR Command",className:"sm:col-span-3",children:d.jsx(Lt,{value:s.session_pr_command,onChange:x=>h("session_pr_command")(x.target.value),placeholder:(m==null?void 0:m.session_pr_command)||"gh pr create --base {base_branch} --head {session_branch}",className:"h-8 text-xs font-mono"})})]})]}),d.jsxs("section",{className:"flex flex-col gap-3",children:[d.jsx("h3",{className:"text-sm font-semibold",children:"Trace"}),d.jsx(ko,{}),d.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:d.jsx(lr,{label:"Enabled",children:d.jsx(qc,{value:s.trace_enabled,onChange:h("trace_enabled"),options:eX,placeholder:(m==null?void 0:m.trace_enabled)||"true",allowEmpty:!0})})})]}),d.jsxs(Me,{size:"sm",onClick:g,disabled:o,className:"self-start",children:[d.jsx(Nj,{className:"mr-2 h-3.5 w-3.5"}),o?"Saving...":"Save Configuration"]})]})}function lr({label:e,children:t,className:r}){return d.jsxs("div",{className:`flex flex-col gap-1 ${r??""}`,children:[d.jsx(Rt,{className:"text-xs",children:e}),t]})}function qc({value:e,onChange:t,options:r,placeholder:o,allowEmpty:s}){return d.jsxs(Jo,{value:e||(s?uv:""),onValueChange:l=>t(l===uv?"":l),children:[d.jsx(ts,{className:"h-8 text-xs",children:d.jsx(es,{placeholder:o})}),d.jsxs(ns,{children:[s&&d.jsx(Yn,{value:uv,className:"text-muted-foreground",children:o?`Default (${o})`:"Default"}),r.map(l=>d.jsx(Yn,{value:l,children:l},l))]})]})}function tX(){const[e,t]=b.useState(null),r=XF(),o=Ul(),s=zj(e??0,{enabled:e!=null}),l=YF(),c=GF(),f=h=>{l.mutate(h,{onSuccess:()=>gt.success("Global configuration saved"),onError:()=>gt.error("Failed to save global configuration")})},m=h=>{e!=null&&c.mutate({projectId:e,data:h},{onSuccess:()=>gt.success("Project configuration saved"),onError:()=>gt.error("Failed to save project configuration")})};return d.jsxs("div",{className:"space-y-6",children:[d.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),d.jsxs(D0,{defaultValue:"global",children:[d.jsxs(k0,{children:[d.jsx(Wr,{value:"global",children:"Global"}),d.jsx(Wr,{value:"project",children:"Project"})]}),d.jsx(Jr,{value:"global",className:"mt-4",children:r.isLoading?d.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):d.jsx(c_,{values:r.data??{},onSave:f,saving:l.isPending})}),d.jsx(Jr,{value:"project",className:"mt-4",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs("div",{className:"flex flex-col gap-1 max-w-xs",children:[d.jsx(Rt,{className:"text-xs",children:"Project"}),d.jsxs(Jo,{value:e!=null?String(e):"",onValueChange:h=>t(Number(h)),children:[d.jsx(ts,{className:"h-8 text-xs",children:d.jsx(es,{placeholder:"Select a project"})}),d.jsx(ns,{children:(o.data??[]).map(h=>d.jsx(Yn,{value:String(h.id),children:h.display_name},h.id))})]})]}),e!=null&&s.isLoading&&d.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),e!=null&&s.data&&d.jsx(c_,{values:s.data.project,placeholders:s.data.merged,onSave:m,saving:c.isPending})]})})]})]})}function nX(){return d.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20",children:[d.jsx("h1",{className:"text-2xl font-bold",children:"Page not found"}),d.jsx(Me,{variant:"outline",asChild:!0,children:d.jsxs(Rr,{to:"/",children:[d.jsx(X6,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]})}const rX=3,aX=1e4,oX=2e3;function sX(){const e=ft(),t=b.useRef(null),r=b.useRef(void 0),o=b.useRef(1e3),s=b.useRef(0),l=b.useRef({});b.useEffect(()=>{function c(m){const h=Date.now();if(h-s.current<oX)return!1;const g=(l.current[m]??[]).filter(p=>h-p<aX);return g.length>=rX?!1:(g.push(h),l.current[m]=g,!0)}function f(){const m=new EventSource("/api/events");t.current=m,m.onopen=()=>{o.current=1e3,s.current=Date.now()};const h=g=>{var p;try{const v=JSON.parse(g.data),x=(v.run_id??"unknown").slice(0,12);c(g.type)&&(g.type==="session_started"?gt.info(`Session ${x} started`):g.type==="session_completed"?gt.success(`Session ${x} completed`,{description:(p=v.summary)==null?void 0:p.slice(0,80)}):g.type==="session_failed"?gt.error(`Session ${x} failed`):g.type==="session_stopped"&&gt.warning(`Session ${x} stopped`)),e.invalidateQueries({queryKey:["sessions"]}),v.project_id&&e.invalidateQueries({queryKey:Ye.projects.sessions(v.project_id)})}catch{}};m.addEventListener("session_started",h),m.addEventListener("session_completed",h),m.addEventListener("session_failed",h),m.addEventListener("session_stopped",h),m.onerror=()=>{m.close(),t.current=null,r.current=setTimeout(()=>{o.current=Math.min(o.current*2,15e3),f()},o.current)}}return f(),()=>{var m;(m=t.current)==null||m.close(),t.current=null,r.current&&clearTimeout(r.current)}},[e])}function iX(){return sX(),d.jsx(JO,{children:d.jsxs(Xr,{element:d.jsx(JH,{}),children:[d.jsx(Xr,{index:!0,element:d.jsx(l9,{})}),d.jsx(Xr,{path:"projects",element:d.jsx(p9,{})}),d.jsx(Xr,{path:"projects/:projectId",element:d.jsx(aI,{})}),d.jsx(Xr,{path:"projects/:projectId/sessions/:runId",element:d.jsx(xF,{})}),d.jsx(Xr,{path:"schedules",element:d.jsx(FF,{})}),d.jsx(Xr,{path:"resources/:resourceType",element:d.jsx(DF,{})}),d.jsx(Xr,{path:"settings",element:d.jsx(tX,{})}),d.jsx(Xr,{path:"*",element:d.jsx(nX,{})})]})})}JA.createRoot(document.getElementById("root")).render(d.jsx(b.StrictMode,{children:d.jsx(m3,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:d.jsx(o3,{client:tH,children:d.jsxs(vj,{children:[d.jsx(_D,{children:d.jsx(iX,{})}),d.jsx(eH,{})]})})})}));
